// this script was compiled with wurst 1.5.0.0-jenkins-Wurst-112 globals integer array LinkedList_dummy integer array LinkedList_size integer array LLEntry_elem integer array LLEntry_prev integer array LLEntry_next integer array LLIterator_dummy integer array LLIterator_current string array Char_c2s integer Char_MAX_INDEX=0 string String_charset=null string String_numberset=null hashtable Table_ht=null integer Colors_decs=0 real Maths_PI=0. real Maths_DEGTORAD=0. real Maths_RADTODEG=0. real Terrain_MAX_RANGE=0. integer Terrain_DUMMY_ITEM_ID=0 location Terrain_tempLoc=null item Terrain_dItem=null rect Terrain_find=null item array Terrain_hid integer Terrain_hidMax=0 real Terrain_tempPos_x=0. real Terrain_tempPos_y=0. player array Player_players boolean array PrintingHelper_wantDebug integer PrintingHelper_DEBUG_LEVEL=0 real PrintingHelper_DEBUG_MSG_DURATION=0. integer array W3UDefinition_def integer Basics_DUMMY_UNIT_ID=0 integer Basics_HEIGHT_ENABLER=0 integer Basics_LOCUST_ID=0 real Basics_ANIMATION_PERIOD=0. player Basics_DUMMY_PLAYER=null timer GameTimer_gameTimer=null real GameTimer_currentTime=0. integer ErrorHandling_MUTE_ERROR_DURATION=0 integer ErrorHandling_traceHashs=0 timer array TimerUtils_freeTimers integer TimerUtils_freeTimersCount=0 integer TimerUtils_timerData=0 integer TimerUtils_HELD=0 group TempGroups_ENUM_GROUP=null integer TypeCasting_typecastdata=0 integer BonusHandlerConfig_MAX_BONUS_LIFE=0 integer BonusHandlerConfig_MAX_BONUS_MANA=0 integer BonusHandlerConfig_MAX_BONUS_DAMAGE=0 integer BonusHandlerConfig_MAX_BONUS_ARMOR=0 integer BonusHandlerConfig_MAX_BONUS_SIGHTRANGE=0 integer BonusHandlerConfig_MAX_BONUS_LIFEREGEN=0 integer BonusHandlerConfig_MAX_BONUS_MANAREGEN=0 integer BonusHandlerConfig_MAX_BONUS_ATTACKSPEED=0 integer BonusHandlerConfig_MAX_BONUS_STRENGTH=0 integer BonusHandlerConfig_MAX_BONUS_AGILITY=0 integer BonusHandlerConfig_MAX_BONUS_INTELLIGENCE=0 integer array AbilityDefinition_def integer array BonusHandler_powersOf2 integer array BonusHandler_rawShifts integer BonusHandler_rawShiftNeg=0 integer array BonusHandler_bonusTypes integer array BonusType_baseRaw integer array BonusType_maxBonus hashtable HashMap_ht=null integer array StatHandler_statType integer array StatHandler_statSubstat integer array StatHandler_parentStat integer array StatHandler_statChangedEvents integer StatHandler_numStats=0 integer StatHandler_mapBaseStatBuffers=0 integer array StatHandler_mapUnitStatBuffers integer StatHandler_DEFAULT_BASE_STAT_BUFFER=0 integer array StatEntity_stat integer array StatEntity_val integer array StatList_statList integer array StatListIterator_iter integer array StatListIterator_current integer array UnitBaseStatBuffer_stats integer array UnitBaseStatBuffer_arrayStart integer array UnitStatBuffer_statsAbs integer array UnitStatBuffer_statsPerc integer array UnitStatBuffer_statsPerc_2 integer array UnitStatBuffer_cache boolean array UnitStatBuffer_cacheDirty integer array UnitStatBuffer_eventsToInvoke integer UnitStatBuffer_eventsToInvokeLast=0 boolean array UnitStatBuffer_isEventAdded integer array UnitStatBuffer_arrayStart unit array UnitStatBuffer_u integer array UnitStatBuffer_baseStats integer UnitTypeData_raw2UnitTypeData=0 integer array UnitTypeData_unitBaseStatBuffer boolean HeroTypeGen_compiletimeMode=false integer BagObjGen_BAG_RAW=0 integer Config_NUM_OF_PLAYERS=0 integer array ItemData_boundTo real Bag_BAG_MOVE_TIMEOUT=0. unit array Bag_playerBagUnit boolean Bag_blockEvents=false integer array PlayerData_playerData integer array PlayerData_playerId unit array PlayerData_hero integer array PlayerData_learnPointsStats integer array PlayerData_learnPointsTalents integer array PlayerData_learnedStats integer array PlayerData_learnedStr integer array PlayerData_learnedAgi integer array PlayerData_learnedInt unit UnitIndexEvent_indexedUnit=null trigger EventModule_trig=null unit UnitDeindexEvent_deindexedUnit=null trigger EventModule_trig_2=null unit array UnitIndex_u real CreepExp_CREEP_EXP_RANGE=0. integer CreepExp_MAX_LVL_DIFFERENCE=0 integer CreepExp_EXP_LEVEL_FACTOR=0 integer UnitTypeGen_currentUnitTypeData=0 boolean UnitTypeGen_compiletimeMode=false integer ThreatHandlerConfig_TIME_TO_PORT=0 real ThreatHandlerConfig_RETURN_RANGE=0. real ThreatHandlerConfig_ORDER_RETURN_RANGE=0. real ThreatHandlerConfig_CAMP_RANGE=0. hashtable ThreatHandler_ht=null integer array ThreatHandler_icList integer ThreatHandler_icListLast=0 integer array ThreatHandlerCamp_icListId integer array ThreatHandlerCamp_dummy integer array ThreatHandlerCamp_state integer array ThreatHandlerCamp_timeToPortLeft unit array ThreatHandlerPU_u integer array ThreatHandlerPU_dummy integer array ThreatHandlerTU_state unit array ThreatHandlerTU_u real array ThreatHandlerTU_campPos real array ThreatHandlerTU_campPos_2 integer array ThreatHandlerTU_dummy trigger array ThreatHandlerTU_targetAcquireTrigger integer array ThreatHandlerTU_camp integer array ThreatHandlerTU_campPrev integer array ThreatHandlerTU_campNext integer array ThreatUnitIterator_tu integer array ThreatUnitIterator_current integer array ThreatListEntry_pu integer array ThreatListEntry_tu integer array ThreatListEntry_puPrev integer array ThreatListEntry_puNext integer array ThreatListEntry_tuPrev integer array ThreatListEntry_tuNext real array ThreatListEntry_threat integer array CreepRespawn_unitRaw real array CreepRespawn_pos real array CreepRespawn_pos_2 real array CreepRespawn_facing real HeroRespawn_HERO_RESPAWN_TIME=0. real HeroRespawn_HERO_RESPAWN_POS_x=0. real HeroRespawn_HERO_RESPAWN_POS_y=0. unit array HeroRespawn_hero integer array W3TDefinition_def integer PQuestGen_TALK_DUMMY=0 real PQuest_QUEST_EVENT_RANGE=0. real PQuest_TALK_DURATION=0. integer PQuest_numPQuests=0 integer array PQuest_questItems string array PQuest_title integer array PQuest_completeQuestAction integer array PQuest_thisQuest integer array PQuest_state string array PQuest_talkText integer array PQuest_talkAction integer array PQuestItem_parent string array PQuestItem_description integer array PQuestItem_maxCount boolean array PQuestItem_initDiscovered integer array PQuestItem_thisQuestItem integer array PQuestItem_state integer array PQuestItem_count integer array PQuestItem_next boolean array PQuestItem_completesQuest unit array PQuestItem_talkNPC string array PQuestItem_talkText integer array PQuestItem_talkAction integer PQuest_raw2qi=0 integer PQuest_talkNpc2qi=0 integer array PQuest_npc2QuestMark integer array PQuest_npc2QuestDiscoverOnTalk integer array Droptable_drops integer array Droptable_questDrops integer array Drop_chance integer array Drop_itemRaw integer array QuestDrop_questItem integer array QuestDrop_chance integer array QuestDrop_itemRaw integer CreepDrop_unitDrops=0 real OOCRegen_INTERVAL=0. real OOCRegen_DELAY=0. unit array OOCRUnit_u real array OOCRUnit_t integer OOCRegen_oocrUnits=0 integer array UnitData_unitStatBuffer integer array UnitData_unitDamageHandler integer array UnitData_unitBuffList integer array UnitData_threatHandlerPu integer array UnitData_threatHandlerTu integer array UnitData_creepRespawn integer CastBar_CASTBAR_DUMMY=0 unit array CastBar_dummy integer SpellHandler_channelDataMap=0 integer array ChannelData_parent unit array ChannelData_caster trigger array ChannelData_interruptTrigger timer array ChannelData_channelTimer integer array ChannelData_bar integer array ChannelData_stepMax integer array ChannelData_stepCurrent unit array Spell_caster unit array Spell_targetUnit real array Spell_targetPoint real array Spell_targetPoint_2 boolean array Spell_autoDestroy integer SpellHandler_castEvents=0 integer SpellIgnoreThePain_SPELL_RAW=0 integer SpellIgnoreThePain_BUFF_ABIL_RAW=0 integer SpellIgnoreThePain_BUFF_RAW=0 timer array Buff_timerObject integer array Buff_timerCounter integer array Buff_timerCounterMax boolean array Buff_timerDestroyAfter integer array Buff_parent integer array BuffIgnoreThePain_stats sound SimError_error=null integer Talent_raw2talent=0 integer array Talent_raw integer array Talent_levels string TalentObjectGen_talentOrder1=null string TalentObjectGen_talentOrder2=null string TalentObjectGen_talentOrder3=null string TalentObjectGen_talentOrder4=null boolean TalentObjectGen_compiletimeMode=false integer TalentList_TALENT_WARRIOR_SHIELDSLAM_STUN=0 integer TalentList_TALENT_WARRIOR_SHIELDSLAM_TAUNT=0 integer TalentList_TALENT_WARRIOR_IGNORE_REFLECT=0 integer TalentList_TALENT_WARRIOR_CHARGE_THREAT=0 integer TalentList_TALENT_PRIEST_HEAL_OVERHEAL=0 integer TalentList_TALENT_PRIEST_HEAL_HASTE=0 integer TalentList_TALENT_PRIEST_SHIELD_HEALREC=0 integer TalentList_TALENT_PRIEST_HOLYBOLT_JUMP=0 integer TalentList_TALENT_RANGER_FIREARROW_DURATION=0 integer TalentList_TALENT_RANGER_SPLITSHOT_PIERCE=0 integer TalentList_TALENT_RANGER_SPLITSHOT_BURN=0 integer TalentList_TALENT_RANGER_TRAP_POISON=0 integer TalentList_TALENT_DRUID_REJU_TICK=0 integer TalentList_TALENT_DRUID_WRATH_ENTANGLE=0 integer TalentList_TALENT_DRUID_MOON_DELAY=0 integer TalentList_TALENT_DRUID_MOON_REJU=0 integer TalentList_BOOK_TALENT_WARRIOR=0 integer TalentList_BOOK_TALENT_PRIEST=0 integer TalentList_BOOK_TALENT_RANGER=0 integer TalentList_BOOK_TALENT_DRUID=0 trigger DamageHandler_unitAttackTrigger=null boolean DamageHandler_blockDmgEvent=false integer array BuffList_buffs unit array BuffList_u integer StatusHandlerConfig_STUN_ABILITY_ID=0 integer StatusHandlerConfig_STUN_BUFF_ID=0 integer StatusHandlerConfig_SILENCE_ABILITY_ID=0 integer StatusHandlerConfig_DISARM_BOTH_ABILITY_ID=0 integer StatusHandlerConfig_DISARM_MELEE_ABILITY_ID=0 integer StatusHandlerConfig_DISARM_RANGED_ABILITY_ID=0 integer StatusHandlerConfig_ENSNARE_ABILITY_ID=0 integer StatusHandlerConfig_ENSNARE1_BUFF_ID=0 integer StatusHandlerConfig_ENSNARE2_BUFF_ID=0 rect MapBounds_playableMapRect=null rect MapBounds_boundRect=null real MapBounds_playableMin_x=0. real MapBounds_playableMin_y=0. real MapBounds_playableMax_x=0. real MapBounds_playableMax_y=0. real MapBounds_boundMin_x=0. real MapBounds_boundMin_y=0. real MapBounds_boundMax_x=0. real MapBounds_boundMax_y=0. integer NewDummyRecycler_DIFFERENT_ANGLES=0 real NewDummyRecycler_ANGLE_DEGREE=0. integer NewDummyRecycler_SAVED_UNITS_PER_ANGLE=0 integer array DummyRecycler_angleQueues integer array ArrayQueue_fp integer array ArrayQueue_rp integer array ArrayQueue_size timer DelayNode_t=null unit array DelayNode_u real array DelayNode_delayTime integer array DelayNode_next integer DelayNode_first=0 integer DelayNode_last=0 boolean DummyCaster_FORCE_INVISIBLE_CAST=false boolean DummyCaster_AUTO_RESET_MANA_COOLDOWN=false integer DummyCaster_delayTable=0 integer array DummyCaster_abilityId integer array DummyCaster_level player array DummyCaster_owner integer array DummyCaster_orderId real array DummyCaster_recycleDelay boolean array DummyCaster_customSource real array DummyCaster_customPos real array DummyCaster_customPos_2 real array DummyCaster_customPos_3 boolean array DummyCaster_autodestroy real DummyCaster_aoex=0. real DummyCaster_aoey=0. real DummyCaster_aoeradius=0. integer DummyCaster_cinstance=0 integer StatusHandler_STUN_DUMMY_CASTER=0 integer StatusHandler_ENSNARE_DUMMY_CASTER=0 integer array Status_status timer array Status_stunTimer integer array Status_stunCounter integer array Status_ensnareCounter trigger TestUtils_smartCoordsTrigger=null unit array InventoryIterator_u integer array InventoryIterator_nextSlot unit udg_npc_bryce=null unit udg_npc_brom=null unit udg_npc_marta=null trigger gg_trg_npcs=null unit gg_unit_npc2_0055=null unit gg_unit_npc1_0054=null unit gg_unit_npc3_0056=null integer ItemTypeData_raw2ItemTypeData=0 string array ItemTypeData_name integer array ItemTypeData_itemClass integer array ItemTypeData_equipmentSlot integer array ItemTypeData_equipmentClass integer array ItemTypeData_stats integer array ItemTypeData_recipeTarget integer array ItemTypeData_recipeReq1 integer array ItemTypeData_recipeReq2 integer array ItemTypeData_recipeReq3 integer array ItemTypeData_recipeReq4 integer array ItemTypeData_recipeReq5 integer array ItemTypeData_recipeReq6 integer array ItemTypeData_recipeReq7 integer array ItemTypeData_recipeReq8 string ItemTooltipGen_tooltipHeader=null string ItemTooltipGen_tooltipStats=null string ItemTooltipGen_tooltipDescription=null string ItemTooltipGen_tooltipRecipeReq=null integer ItemTypeGen_currentItemTypeData=0 integer ItemTypeGen_currentItemTypeDefinition=0 boolean ItemTypeGen_compiletimeMode=false boolean array Recipe_slotsUsed integer QuestPreciousPelts_pqPreciousPelts=0 integer QuestPreciousPelts_pqPreciousPelts_collect=0 integer QuestPreciousPelts_pqPreciousPelts_return=0 integer QuestProvingYourWorth_pqProveWorth=0 integer QuestProvingYourWorth_pqProveWorth_talk=0 integer QuestProvingYourWorth_pqProveWorth_kill=0 integer QuestProvingYourWorth_pqProveWorth_return=0 integer HeropickObjectGen_RAW_SHIP=0 integer HeropickObjectGen_RAW_DUMMY_PICK=0 integer HeropickObjectGen_RAW_DUMMY_WARRIOR=0 integer HeropickObjectGen_RAW_DUMMY_PRIEST=0 integer HeropickObjectGen_RAW_DUMMY_RANGER=0 integer HeropickObjectGen_RAW_DUMMY_DRUID=0 real Heropick_heroPickPos_x=0. real Heropick_heroPickPos_y=0. real Heropick_heroStartPos_x=0. real Heropick_heroStartPos_y=0. unit Heropick_ship=null unit array Fx_dummy effect array Fx_fx integer SpellNaturesWrath_SPELL_RAW=0 integer SpellNaturesWrath_BUFF_ABIL_RAW=0 integer SpellNaturesWrath_BUFF_RAW=0 real SpellNaturesWrath_CHANNEL_DURATION=0. integer array BuffNaturesWrath_stats unit array BuffNaturesWrath_caster boolean array BuffNaturesWrath_entangleEnsnare integer SpellRejuvenation_SPELL_RAW=0 integer SpellRejuvenation_BUFF_ABIL_RAW=0 integer SpellRejuvenation_BUFF_RAW=0 effect array BuffRejuvenation_sfx1 unit array BuffRejuvenation_caster real array BuffRejuvenation_healPerTick integer SpellMoonlightShadow_SPELL_RAW=0 integer SpellTrap_SPELL_RAW=0 integer SpellTrap_BUFF_ABIL_RAW=0 integer SpellTrap_BUFF_RAW=0 real SpellTrap_CHANNEL_DURATION=0. real SpellTrap_TRAP_DURATION=0. real SpellTrap_ENSNARE_DURATION=0. real SpellTrap_AOE=0. real array BuffTrapOwner_pos real array BuffTrapOwner_pos_2 effect array BuffTrapOwner_sfx1 unit array BuffTrapTarget_caster effect array BuffTrapTarget_sfxNet real Missile_TIMER_TIMEOUT=0. integer array Missile_fx real array Missile_time real array Missile_missilePos real array Missile_missilePos_2 real array Missile_missilePos_3 real array Missile_missileVel real array Missile_missileVel_2 real array Missile_missileVel_3 real array Missile_missileVelXY real array Missile_missileAccZ real array Missile_targetPos real array Missile_targetPos_2 real array Missile_targetPos_3 unit array Missile_targetUnit real array Missile_targetUnitZOffset real array Missile_collisionSize integer array Missile_seenUnits boolean array Missile_alive timer array Periodic_t integer SpellFirearrow_SPELL_RAW=0 integer SpellFirearrow_BUFF_ABIL_RAW=0 integer SpellFirearrow_BUFF_RAW=0 effect array BuffFirearrow_sfx1 unit array BuffFirearrow_caster real array BuffFirearrow_damagePerTick unit array MissileFirearrow_casterUnit unit array MissileFirearrow_targetUnit integer SpellSplitshot_SPELL_RAW=0 real SpellSplitshot_ARROW_RANGE=0. real SpellSplitshot_MAX_SPREAD_ANGLE=0. unit array MissileSplitshot_casterUnit integer array MissileSplitshot_targetsLeft boolean array MissileSplitshot_isBurning integer SpellShieldSlam_SPELL_RAW=0 unit array BuffShieldSlamTaunt_caster string KnockbackHandler_SFX_EARTH=null string KnockbackHandler_SFX_WATER=null string KnockbackHandler_SFX_ATTACHPOINT=null unit array Knockback_u real array Knockback_acc real array Knockback_acc_2 real array Knockback_vel real array Knockback_vel_2 integer array Knockback_steps boolean array Knockback_useEffects boolean array Knockback_stopImpassable effect array Knockback_sfx integer array Knockback_sfxCurr integer array Knockback_collisionAction integer array Knockback_collisionUnits real array Knockback_collisionSize timer array Periodic_t_2 integer SpellCharge_SPELL_RAW=0 integer array this integer SpellShield_SPELL_RAW=0 integer SpellShield_BUFF_ABIL_RAW=0 integer SpellShield_BUFF_RAW=0 integer array BuffShield_stats unit array BuffShield_caster effect array BuffShield_sfx1 integer SpellHeal_SPELL_RAW=0 real SpellHeal_CHANNEL_DURATION=0. integer SpellHolyBolt_SPELL_RAW=0 real SpellHolyBolt_CHANNEL_DURATION=0. unit array MissileHolyBolt_casterUnit unit array MissileHolyBolt_targetUnit real array MissileHolyBolt_mult unit array SpellHolyBolt_currentTarget boolean HeroInventory_blockEvents=false integer array LinkedList_nextFree integer LinkedList_firstFree=0 integer LinkedList_maxIndex=0 integer array LinkedList_typeId integer array LLEntry_nextFree integer LLEntry_firstFree=0 integer LLEntry_maxIndex=0 integer array LLEntry_typeId integer array LLIterator_nextFree integer LLIterator_firstFree=0 integer LLIterator_maxIndex=0 integer array LLIterator_typeId integer array Table_nextFree integer Table_firstFree=0 integer Table_maxIndex=0 integer array Table_typeId integer array W3UDefinition_nextFree integer W3UDefinition_firstFree=0 integer W3UDefinition_maxIndex=0 integer array W3UDefinition_typeId integer array IdGenerator_nextFree integer IdGenerator_firstFree=0 integer IdGenerator_maxIndex=0 integer array OrderStringFactory_nextFree integer OrderStringFactory_firstFree=0 integer OrderStringFactory_maxIndex=0 integer array AbilityDefinition_nextFree integer AbilityDefinition_firstFree=0 integer AbilityDefinition_maxIndex=0 integer array AbilityDefinition_typeId integer array BonusType_nextFree integer BonusType_firstFree=0 integer BonusType_maxIndex=0 integer array BonusType_typeId integer array StatChangedEvent_nextFree integer StatChangedEvent_firstFree=0 integer StatChangedEvent_maxIndex=0 integer array StatChangedEvent_typeId integer array HashMap_nextFree integer HashMap_firstFree=0 integer HashMap_maxIndex=0 integer array HashMap_typeId integer array StatEntity_nextFree integer StatEntity_firstFree=0 integer StatEntity_maxIndex=0 integer array StatEntity_typeId integer array StatList_nextFree integer StatList_firstFree=0 integer StatList_maxIndex=0 integer array StatList_typeId integer array StatListIterator_nextFree integer StatListIterator_firstFree=0 integer StatListIterator_maxIndex=0 integer array StatListIterator_typeId integer array UnitBaseStatBuffer_nextFree integer UnitBaseStatBuffer_firstFree=0 integer UnitBaseStatBuffer_maxIndex=0 integer array UnitBaseStatBuffer_typeId integer array UnitStatBuffer_nextFree integer UnitStatBuffer_firstFree=0 integer UnitStatBuffer_maxIndex=0 integer array UnitStatBuffer_typeId integer array UnitTypeData_nextFree integer UnitTypeData_firstFree=0 integer UnitTypeData_maxIndex=0 integer array ItemData_nextFree integer ItemData_firstFree=0 integer ItemData_maxIndex=0 integer array ItemData_typeId integer array PlayerData_nextFree integer PlayerData_firstFree=0 integer PlayerData_maxIndex=0 integer array PlayerData_typeId integer array UnitIndex_nextFree integer UnitIndex_firstFree=0 integer UnitIndex_maxIndex=0 integer array UnitIndex_typeId integer array ThreatHandlerCamp_nextFree integer ThreatHandlerCamp_firstFree=0 integer ThreatHandlerCamp_maxIndex=0 integer array ThreatHandlerCamp_typeId integer array ThreatHandlerPU_nextFree integer ThreatHandlerPU_firstFree=0 integer ThreatHandlerPU_maxIndex=0 integer array ThreatHandlerPU_typeId integer array ThreatHandlerTU_nextFree integer ThreatHandlerTU_firstFree=0 integer ThreatHandlerTU_maxIndex=0 integer array ThreatHandlerTU_typeId integer array ThreatUnitIterator_nextFree integer ThreatUnitIterator_firstFree=0 integer ThreatUnitIterator_maxIndex=0 integer array ThreatUnitIterator_typeId integer array ThreatListEntry_nextFree integer ThreatListEntry_firstFree=0 integer ThreatListEntry_maxIndex=0 integer array ThreatListEntry_typeId integer array CreepRespawn_nextFree integer CreepRespawn_firstFree=0 integer CreepRespawn_maxIndex=0 integer array CreepRespawn_typeId integer array HeroRespawn_nextFree integer HeroRespawn_firstFree=0 integer HeroRespawn_maxIndex=0 integer array HeroRespawn_typeId integer array W3TDefinition_nextFree integer W3TDefinition_firstFree=0 integer W3TDefinition_maxIndex=0 integer array W3TDefinition_typeId integer array TalkAction_nextFree integer TalkAction_firstFree=0 integer TalkAction_maxIndex=0 integer array TalkAction_typeId integer array CompleteQuestAction_nextFree integer CompleteQuestAction_firstFree=0 integer CompleteQuestAction_maxIndex=0 integer array CompleteQuestAction_typeId integer array PQuest_nextFree integer PQuest_firstFree=0 integer PQuest_maxIndex=0 integer array PQuest_typeId integer array PQuestItem_nextFree integer PQuestItem_firstFree=0 integer PQuestItem_maxIndex=0 integer array PQuestItem_typeId integer array Droptable_nextFree integer Droptable_firstFree=0 integer Droptable_maxIndex=0 integer array Droptable_typeId integer array Drop_nextFree integer Drop_firstFree=0 integer Drop_maxIndex=0 integer array QuestDrop_nextFree integer QuestDrop_firstFree=0 integer QuestDrop_maxIndex=0 integer array OOCRUnit_nextFree integer OOCRUnit_firstFree=0 integer OOCRUnit_maxIndex=0 integer array CastBar_nextFree integer CastBar_firstFree=0 integer CastBar_maxIndex=0 integer array CastBar_typeId integer array ChannelData_nextFree integer ChannelData_firstFree=0 integer ChannelData_maxIndex=0 integer array ChannelData_typeId integer array Spell_nextFree integer Spell_firstFree=0 integer Spell_maxIndex=0 integer array Spell_typeId integer array SpellCastRegistry_nextFree integer SpellCastRegistry_firstFree=0 integer SpellCastRegistry_maxIndex=0 integer array SpellCastRegistry_typeId integer array Buff_nextFree integer Buff_firstFree=0 integer Buff_maxIndex=0 integer array Buff_typeId integer array Talent_nextFree integer Talent_firstFree=0 integer Talent_maxIndex=0 integer array UnitDamageHandler_nextFree integer UnitDamageHandler_firstFree=0 integer UnitDamageHandler_maxIndex=0 integer array UnitDamageHandler_typeId integer array BuffList_nextFree integer BuffList_firstFree=0 integer BuffList_maxIndex=0 integer array BuffList_typeId integer array ArrayQueue_nextFree integer ArrayQueue_firstFree=0 integer ArrayQueue_maxIndex=0 integer array ArrayQueue_typeId integer array DelayNode_nextFree integer DelayNode_firstFree=0 integer DelayNode_maxIndex=0 integer array DelayNode_typeId integer array DummyCaster_nextFree integer DummyCaster_firstFree=0 integer DummyCaster_maxIndex=0 integer array DummyCaster_typeId integer array InventoryIterator_nextFree integer InventoryIterator_firstFree=0 integer InventoryIterator_maxIndex=0 integer array InventoryIterator_typeId integer array ItemTypeData_nextFree integer ItemTypeData_firstFree=0 integer ItemTypeData_maxIndex=0 integer array Fx_nextFree integer Fx_firstFree=0 integer Fx_maxIndex=0 integer array Fx_typeId integer array Missile_nextFree integer Missile_firstFree=0 integer Missile_maxIndex=0 integer array Missile_typeId integer array UnitCollision_nextFree integer UnitCollision_firstFree=0 integer UnitCollision_maxIndex=0 integer array UnitCollision_typeId integer array Knockback_nextFree integer Knockback_firstFree=0 integer Knockback_maxIndex=0 integer array Knockback_typeId unit array ArrayQueue_units_0 unit array ArrayQueue_units_1 unit array ArrayQueue_units_2 unit array ArrayQueue_units_3 unit array ArrayQueue_units_4 unit array ArrayQueue_units_5 real angle_toVec_return_x=0. real angle_toVec_return_y=0. real vec3_op_minus_return_x=0. real vec3_op_minus_return_y=0. real vec3_op_minus_return_z=0. real vec3_op_plus_return_x=0. real vec3_op_plus_return_y=0. real vec3_op_plus_return_z=0. real vec2_op_plus_return_x=0. real vec2_op_plus_return_y=0. real vec2_op_minus_return_x=0. real vec2_op_minus_return_y=0. real vec2_op_mult_return_x=0. real vec2_op_mult_return_y=0. real item_getPos_return_x=0. real item_getPos_return_y=0. real vec2_withRealZ_return_x=0. real vec2_withRealZ_return_y=0. real vec2_withRealZ_return_z=0. real vec3_toVec2_return_x=0. real vec3_toVec2_return_y=0. real vec2_withZ_return_x=0. real vec2_withZ_return_y=0. real vec2_withZ_return_z=0. integer rational_op_mult_return_p=0 integer rational_op_mult_return_q=0 integer rational_op_divReal_return_p=0 integer rational_op_divReal_return_q=0 real unit_getPos_return_x=0. real unit_getPos_return_y=0. real unit_getPos3fake_return_x=0. real unit_getPos3fake_return_y=0. real unit_getPos3fake_return_z=0. real vec2_polarOffset_return_x=0. real vec2_polarOffset_return_y=0. real randomPosOffset3_return_x=0. real randomPosOffset3_return_y=0. real unit_getPos3_return_x=0. real unit_getPos3_return_y=0. real unit_getPos3_return_z=0. real unit_getPos3_return_x_2=0. real unit_getPos3_return_y_2=0. real unit_getPos3_return_z_2=0. real vec2_toVec3_return_x=0. real vec2_toVec3_return_y=0. real vec2_toVec3_return_z=0. real vec2_norm_return_x=0. real vec2_norm_return_y=0. code ref_function_hideItem=null code ref_function_acquireTarget=null code ref_function_closure_impl=null code ref_function_Timed_timerCallback=null code ref_function_Timed_timerCallback_2=null code ref_function_closure_impl_2=null code ref_function_ChannelData_invokeInterrupt=null code ref_function_ChannelData_callback=null code ref_function_ChannelData_callback_2=null code ref_function_Buff_timerCallback=null code ref_function_DelayNode_recycle=null code ref_function_DelayNode_recycle_2=null code ref_function_DelayNode_recycle_3=null code ref_function_closure_impl_3=null code ref_function_closure_impl_4=null code ref_function_Trig_npcs_Actions=null code ref_function_Timed_timerCallback_3=null code ref_function_Periodic_timerCallback=null code ref_function_Periodic_timerCallback_2=null code ref_function_switchDebug=null code ref_function_closure_impl_5=null code ref_function_itemSoldAction=null code ref_function_onTimeout=null code ref_function_orderAction=null code ref_function_update=null code ref_function_closure_impl_6=null code ref_function_closure_impl_7=null code ref_function_closure_impl_8=null code ref_function_callback=null code ref_function_spellEffect=null code ref_function_learnAction=null code ref_function_unitAttacked=null code ref_function_DummyCaster_filterAOE=null code ref_function_closure_impl_9=null code ref_function_closure_impl_10=null code ref_function_closure_impl_11=null code ref_function_closure_impl_12=null code ref_function_closure_impl_13=null code ref_function_useItemAction=null code ref_function_incAttributeAction=null code ref_function_levelupAction=null code ref_function_heroPickedAction=null code ref_function_takeItem=null code ref_function_dropItem=null boolean tempReturn_boolean=false integer tempReturn_integer=0 timer getTimertempReturn=null unit group_nexttempReturn=null texttag createTTExtempReturn=null texttag createTTExtempReturn_2=null item xSpawnItemtempReturn=null item xCreateItemForHerotempReturn=null unit ThreatHandlerTU_getFirstInThreatListtempReturn=null unit DummyRecycler_gettempReturn=null unit createDummytempReturn=null unit DummyCaster_createDummyCastertempReturn=null unit getSelectedUnittempReturn=null unit dispatch_Table_loadUnittempReturn=null effect dispatch_Table_loadEffecttempReturn=null quest dispatch_Table_loadQuesttempReturn=null questitem dispatch_Table_loadQuestItemtempReturn=null unit dispatch_ThreatHandlerTU_getFirstInThreatListtempReturn=null unit dispatch_Buff_getUnittempReturn=null unit dispatch_BuffList_getUnittempReturn=null unit dispatch_ArrayQueue_dequeuetempReturn=null unit dispatch_DummyCaster_createDummyCastertempReturn=null item dispatch_InventoryIterator_nexttempReturn=null unit ArrayQueue_units_gettempReturn=null endglobals native UnitAlive takes unit id returns boolean function CreateNeutralHostile takes nothing returns nothing local player p = Player(PLAYER_NEUTRAL_AGGRESSIVE) call CreateUnit(p, 1747988528, - 10752.0, - 831.5, 344.712) call CreateUnit(p, 1747988528, - 10731.8, - 1053.4, 28.160) call CreateUnit(p, 1747988528, - 8435.2, - 1173.9, 247.908) call CreateUnit(p, 1747988528, - 8340.2, - 1414.6, 175.567) call CreateUnit(p, 1747988528, - 8480.8, - 1592.7, 107.721) call CreateUnit(p, 1747988528, - 8358.0, 37.3, 177.460) call CreateUnit(p, 1747988528, - 8388.4, - 135.0, 144.127) call CreateUnit(p, 1747988528, - 10014.8, 850.1, 341.252) call CreateUnit(p, 1747988531, 1374.6, 6663.6, 223.691) call CreateUnit(p, 1747988529, - 7087.7, 1251.4, 77.349) call CreateUnit(p, 1747988529, - 6927.3, 1368.8, 176.442) call CreateUnit(p, 1747988528, - 8330.2, 2598.8, 298.051) call CreateUnit(p, 1747988528, - 8175.7, 2583.5, 261.744) call CreateUnit(p, 1747988531, 1461.8, 6481.5, 184.113) call CreateUnit(p, 1747988529, - 7747.6, 3921.2, 343.528) call CreateUnit(p, 1747988529, - 7345.7, 4896.9, 298.672) call CreateUnit(p, 1747988529, - 7143.9, 4903.7, 258.129) call CreateUnit(p, 1747988529, - 5654.1, 5568.0, 263.744) call CreateUnit(p, 1747988530, - 5443.6, 5482.6, 200.081) call CreateUnit(p, 1747988529, - 5497.6, 5290.8, 172.798) call CreateUnit(p, 1747988532, - 5430.0, 3964.8, 292.944) call CreateUnit(p, 1747988529, - 5601.9, 3826.9, 344.792) call CreateUnit(p, 1747988531, - 103.8, 2374.9, 182.483) call CreateUnit(p, 1747988531, - 234.6, 2199.1, 148.191) call CreateUnit(p, 1747988530, - 1686.5, 5279.5, 253.860) call CreateUnit(p, 1853320308, - 1565.9, 5136.8, 188.827) call CreateUnit(p, 1747988530, - 1440.1, 6304.6, 254.363) call CreateUnit(p, 1747988530, - 1309.4, 6157.3, 200.067) call CreateUnit(p, 1853320308, - 2686.4, 6440.0, 299.819) call CreateUnit(p, 1747988530, - 2471.9, 6476.6, 212.262) call CreateUnit(p, 1747988530, - 3283.6, 5248.6, 354.800) call CreateUnit(p, 1747988530, - 3121.7, 5032.0, 81.764) call CreateUnit(p, 1747988533, - 4288.2, 4347.0, 32.037) call CreateUnit(p, 1747988530, - 4154.5, 4220.1, 66.184) call CreateUnit(p, 1747988530, - 1703.1, 7918.3, 23.010) call CreateUnit(p, 1747988530, - 1580.9, 8035.3, 247.658) call CreateUnit(p, 1747988530, - 3253.9, 8910.9, 346.422) call CreateUnit(p, 1747988530, - 3119.2, 8705.1, 43.828) call CreateUnit(p, 1747988530, - 4313.5, 4594.3, 344.184) call CreateUnit(p, 1747988529, - 1535.5, 2256.2, 115.041) call CreateUnit(p, 1747988529, - 1394.8, 2437.4, 149.655) call CreateUnit(p, 1747988530, - 401.2, 4085.4, 118.232) call CreateUnit(p, 1853320308, - 554.2, 4042.9, 124.627) set p = null endfunction function CreateNeutralPassive takes nothing returns nothing local player p = Player(PLAYER_NEUTRAL_PASSIVE) call CreateUnit(p, 1852138344, - 8726.3, 2994.2, 1.912) call CreateUnit(p, 1852138344, - 8715.3, 2909.8, 64.338) call CreateUnit(p, 1852138354, - 10603.2, 427.4, 158.630) call CreateUnit(p, 1852138354, - 11181.0, 2689.8, 21.680) call CreateUnit(p, 1852859188, - 2254.9, 3653.5, 337.421) call CreateUnit(p, 1852138344, - 2452.0, 4216.5, 127.324) call CreateUnit(p, 1852138344, - 2471.1, 4090.8, 171.765) set gg_unit_npc1_0054 = CreateUnit(p, 1852859185, - 10018.5, 4078.8, 116.275) set gg_unit_npc2_0055 = CreateUnit(p, 1852859186, - 9644.2, 1953.5, 72.439) set gg_unit_npc3_0056 = CreateUnit(p, 1852859187, - 9664.9, 3762.7, 216.403) call CreateUnit(p, 1852138344, - 2416.3, 4127.4, 86.355) call CreateUnit(p, 1853253996, - 8536.5, 4764.9, 264.695) call CreateUnit(p, 1853253996, - 8830.6, 3178.3, 227.708) call CreateUnit(p, 1853253996, - 10162.7, 2588.5, 358.386) call CreateUnit(p, 1853253996, - 10003.2, 1833.6, 0.857) call CreateUnit(p, 1852138344, - 8820.1, 2895.6, 314.636) call CreateUnit(p, 1852138354, - 9832.1, 2934.1, 93.914) set p = null endfunction function CreatePlayerBuildings takes nothing returns nothing endfunction function CreatePlayerUnits takes nothing returns nothing endfunction function CreateAllUnits takes nothing returns nothing call CreatePlayerBuildings() call CreateNeutralHostile() call CreateNeutralPassive() call CreatePlayerUnits() endfunction function InitTrig_npcs takes nothing returns nothing set gg_trg_npcs = CreateTrigger() call TriggerAddAction(gg_trg_npcs, ref_function_Trig_npcs_Actions) endfunction function InitCustomTriggers takes nothing returns nothing call InitTrig_npcs() endfunction function InitGlobals takes nothing returns nothing endfunction function RunInitializationTriggers takes nothing returns nothing call ConditionalTriggerExecute(gg_trg_npcs) endfunction function hashtable_hasBoolean takes hashtable this_2, integer parentKey, integer childKey returns boolean return HaveSavedBoolean(this_2, parentKey, childKey) endfunction function Table_hasBoolean takes integer this_2, integer parentKey returns boolean return hashtable_hasBoolean(Table_ht, this_2, parentKey) endfunction function hashtable_hasInt takes hashtable this_2, integer parentKey, integer childKey returns boolean return HaveSavedInteger(this_2, parentKey, childKey) endfunction function Table_hasInt takes integer this_2, integer parentKey returns boolean return hashtable_hasInt(Table_ht, this_2, parentKey) endfunction function hashtable_loadBoolean takes hashtable this_2, integer parentKey, integer childKey returns boolean return LoadBoolean(this_2, parentKey, childKey) endfunction function Table_loadBoolean takes integer this_2, integer parentKey returns boolean return hashtable_loadBoolean(Table_ht, this_2, parentKey) endfunction function hashtable_loadInt takes hashtable this_2, integer parentKey, integer childKey returns integer return LoadInteger(this_2, parentKey, childKey) endfunction function Table_loadInt takes integer this_2, integer parentKey returns integer return hashtable_loadInt(Table_ht, this_2, parentKey) endfunction function hashtable_saveBoolean takes hashtable this_2, integer parentKey, integer childKey, boolean value returns nothing call SaveBoolean(this_2, parentKey, childKey, value) endfunction function Table_saveBoolean takes integer this_2, integer parentKey, boolean value returns nothing call hashtable_saveBoolean(Table_ht, this_2, parentKey, value) endfunction function hashtable_saveInt takes hashtable this_2, integer parentKey, integer childKey, integer value returns nothing call SaveInteger(this_2, parentKey, childKey, value) endfunction function Table_saveInt takes integer this_2, integer parentKey, integer value returns nothing call hashtable_saveInt(Table_ht, this_2, parentKey, value) endfunction function print takes string msg returns nothing call DisplayTimedTextToPlayer(GetLocalPlayer(), 0., 0., PrintingHelper_DEBUG_MSG_DURATION, msg) endfunction function real_toInt takes real this_2 returns integer return R2I(this_2) endfunction function cyc_cyc_cyc_cyc_dispatch_Table_loadInt takes integer funcChoice, integer funcChoice_2, integer funcChoice_3, integer funcChoice_4, integer this_2, integer parentKey, string msg, integer this_3, integer parentKey_2, boolean value returns nothing local integer loadInt_result local integer hash local boolean loadBoolean_result local boolean hasInt_result local boolean hasBoolean_result if funcChoice == 0 then if funcChoice_2 == 0 then if funcChoice_3 == 0 then if funcChoice_4 == 0 then if Table_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.loadInt", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.loadInt on invalid object.", 0, 0, false) endif endif set loadInt_result = Table_loadInt(this_2, parentKey) set tempReturn_integer = loadInt_result return elseif funcChoice_4 == 1 then if this_2 == 0 then if parentKey == 0 then set hash = StringHash(msg) call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 1, ErrorHandling_traceHashs, null, hash, 0, false) if tempReturn_boolean then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 0, ErrorHandling_traceHashs, hash, null, 0, 0, false) if tempReturn_integer + ErrorHandling_MUTE_ERROR_DURATION < GameTimer_currentTime then call print("|cffFF3A29Error:|r " + msg + "") call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(1, ErrorHandling_traceHashs, hash, 0, 0, 0, null, 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 1, ErrorHandling_traceHashs, hash, 0, 0, null, 0, 0, false) if tempReturn_boolean then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 1, null, ErrorHandling_traceHashs, hash, false) if not tempReturn_boolean then call print("|cffFF3A29Excessive repeating errors are being omitted") call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(1, ErrorHandling_traceHashs, hash, 0, 0, 0, null, 0, 0, true) endif else call print("|cffFF3A29Excessive repeating errors are being omitted") call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(1, ErrorHandling_traceHashs, hash, 0, 0, 0, null, 0, 0, true) endif endif else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, ErrorHandling_traceHashs, hash, real_toInt(GameTimer_currentTime), null, 0, 0, false) call print("|cffFF3A29Error:|r " + msg + "") endif call I2S(1 / 0) elseif parentKey == 1 then if Table_typeId[this_3] == 0 then if this_3 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.loadBoolean", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.loadBoolean on invalid object.", 0, 0, false) endif endif set loadBoolean_result = Table_loadBoolean(this_3, parentKey_2) set tempReturn_boolean = loadBoolean_result return endif elseif this_2 == 1 then if Table_typeId[parentKey] == 0 then if parentKey == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.hasInt", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.hasInt on invalid object.", 0, 0, false) endif endif set hasInt_result = Table_hasInt(parentKey, this_3) set tempReturn_boolean = hasInt_result return endif endif elseif funcChoice_3 == 1 then if Table_typeId[funcChoice_4] == 0 then if funcChoice_4 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.saveInt", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.saveInt on invalid object.", 0, 0, false) endif endif call Table_saveInt(funcChoice_4, this_2, parentKey) endif elseif funcChoice_2 == 1 then if Table_typeId[funcChoice_3] == 0 then if funcChoice_3 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.hasBoolean", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.hasBoolean on invalid object.", 0, 0, false) endif endif set hasBoolean_result = Table_hasBoolean(funcChoice_3, funcChoice_4) set tempReturn_boolean = hasBoolean_result return endif elseif funcChoice == 1 then if Table_typeId[funcChoice_2] == 0 then if funcChoice_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.saveBoolean", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.saveBoolean on invalid object.", 0, 0, false) endif endif call Table_saveBoolean(funcChoice_2, funcChoice_3, value) endif endfunction function LLEntry_onDestroy takes integer this_2 returns nothing endfunction function dealloc_LLEntry takes integer obj returns nothing if LLEntry_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type LLEntry", 0, 0, false) else set LLEntry_nextFree[LLEntry_firstFree] = obj set LLEntry_firstFree = LLEntry_firstFree + 1 set LLEntry_typeId[obj] = 0 endif endfunction function destroyLLEntry takes integer this_2 returns nothing call LLEntry_onDestroy(this_2) call dealloc_LLEntry(this_2) endfunction function dispatch_LLEntry_destroyLLEntry takes integer this_2 returns nothing if LLEntry_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LLEntry.destroyLLEntry", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LLEntry.destroyLLEntry on invalid object.", 0, 0, false) endif endif call destroyLLEntry(this_2) endfunction function LinkedList_remove takes integer this_2, integer t returns nothing local integer r = LLEntry_next[LinkedList_dummy[this_2]] loop exitwhen not (r != LinkedList_dummy[this_2]) if LLEntry_elem[r] == t then set LLEntry_next[LLEntry_prev[r]] = LLEntry_next[r] set LLEntry_prev[LLEntry_next[r]] = LLEntry_prev[r] call dispatch_LLEntry_destroyLLEntry(r) set LinkedList_size[this_2] = LinkedList_size[this_2] - 1 return endif set r = LLEntry_next[r] endloop endfunction function dispatch_LinkedList_remove takes integer this_2, integer t returns nothing if LinkedList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LinkedList.remove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LinkedList.remove on invalid object.", 0, 0, false) endif endif call LinkedList_remove(this_2, t) endfunction function BuffList_removeBuff takes integer this_2, integer b returns nothing call dispatch_LinkedList_remove(BuffList_buffs[this_2], b) endfunction function dispatch_BuffList_removeBuff takes integer this_2, integer b returns nothing if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.removeBuff", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.removeBuff on invalid object.", 0, 0, false) endif endif call BuffList_removeBuff(this_2, b) endfunction function effect_destr takes effect this_2 returns nothing call DestroyEffect(this_2) endfunction function BuffFirearrow_onRemove takes integer this_2 returns nothing call effect_destr(BuffFirearrow_sfx1[this_2]) endfunction function BuffList_getUnit takes integer this_2 returns unit return BuffList_u[this_2] endfunction function dispatch_BuffList_getUnit takes integer this_2 returns unit local unit getUnit_result if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.getUnit", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.getUnit on invalid object.", 0, 0, false) endif endif set getUnit_result = BuffList_getUnit(this_2) set dispatch_BuffList_getUnittempReturn = getUnit_result set getUnit_result = null return dispatch_BuffList_getUnittempReturn endfunction function Buff_getUnit takes integer this_2 returns unit if Buff_parent[this_2] != 0 then return dispatch_BuffList_getUnit(Buff_parent[this_2]) else return null endif endfunction function dispatch_Buff_getUnit takes integer this_2 returns unit local unit getUnit_result if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.getUnit", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.getUnit on invalid object.", 0, 0, false) endif endif set getUnit_result = Buff_getUnit(this_2) set dispatch_Buff_getUnittempReturn = getUnit_result set getUnit_result = null return dispatch_Buff_getUnittempReturn endfunction function LLIterator_onDestroy takes integer this_2 returns nothing endfunction function dealloc_LLIterator takes integer obj returns nothing if LLIterator_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type LLIterator", 0, 0, false) else set LLIterator_nextFree[LLIterator_firstFree] = obj set LLIterator_firstFree = LLIterator_firstFree + 1 set LLIterator_typeId[obj] = 0 endif endfunction function destroyLLIterator takes integer this_2 returns nothing call LLIterator_onDestroy(this_2) call dealloc_LLIterator(this_2) endfunction function dispatch_LLIterator_destroyLLIterator takes integer this_2 returns nothing if LLIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LLIterator.destroyLLIterator", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LLIterator.destroyLLIterator on invalid object.", 0, 0, false) endif endif call destroyLLIterator(this_2) endfunction function LLIterator_close takes integer this_2 returns nothing call dispatch_LLIterator_destroyLLIterator(this_2) endfunction function dispatch_LLIterator_close takes integer this_2 returns nothing if LLIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LLIterator.close", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LLIterator.close on invalid object.", 0, 0, false) endif endif call LLIterator_close(this_2) endfunction function LLIterator_hasNext takes integer this_2 returns boolean return LLEntry_next[LLIterator_current[this_2]] != LLIterator_dummy[this_2] endfunction function dispatch_LLIterator_hasNext takes integer this_2 returns boolean local boolean hasNext_result if LLIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LLIterator.hasNext", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LLIterator.hasNext on invalid object.", 0, 0, false) endif endif set hasNext_result = LLIterator_hasNext(this_2) return hasNext_result endfunction function LLIterator_next takes integer this_2 returns integer set LLIterator_current[this_2] = LLEntry_next[LLIterator_current[this_2]] return LLEntry_elem[LLIterator_current[this_2]] endfunction function dispatch_LLIterator_next takes integer this_2 returns integer local integer next_result if LLIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LLIterator.next", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LLIterator.next on invalid object.", 0, 0, false) endif endif set next_result = LLIterator_next(this_2) return next_result endfunction function LinkedList_onDestroy takes integer this_2 returns nothing local integer current = LLEntry_next[LinkedList_dummy[this_2]] loop exitwhen not (current != LinkedList_dummy[this_2]) set current = LLEntry_next[current] call dispatch_LLEntry_destroyLLEntry(LLEntry_prev[current]) endloop call dispatch_LLEntry_destroyLLEntry(LinkedList_dummy[this_2]) endfunction function dealloc_LinkedList takes integer obj returns nothing if LinkedList_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type LinkedList", 0, 0, false) else set LinkedList_nextFree[LinkedList_firstFree] = obj set LinkedList_firstFree = LinkedList_firstFree + 1 set LinkedList_typeId[obj] = 0 endif endfunction function destroyLinkedList takes integer this_2 returns nothing call LinkedList_onDestroy(this_2) call dealloc_LinkedList(this_2) endfunction function dispatch_LinkedList_destroyLinkedList takes integer this_2 returns nothing if LinkedList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LinkedList.destroyLinkedList", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LinkedList.destroyLinkedList on invalid object.", 0, 0, false) endif endif call destroyLinkedList(this_2) endfunction function alloc_LLIterator takes nothing returns integer local integer this_2 if LLIterator_firstFree == 0 then set LLIterator_maxIndex = LLIterator_maxIndex + 1 set this_2 = LLIterator_maxIndex else set LLIterator_firstFree = LLIterator_firstFree - 1 set this_2 = LLIterator_nextFree[LLIterator_firstFree] endif set LLIterator_typeId[this_2] = 3 return this_2 endfunction function construct_LLIterator takes integer this_2, integer dummy returns nothing set LLIterator_dummy[this_2] = dummy set LLIterator_current[this_2] = dummy endfunction function new_LLIterator takes integer dummy returns integer local integer this_2 = alloc_LLIterator() call construct_LLIterator(this_2, dummy) return this_2 endfunction function LinkedList_iterator takes integer this_2 returns integer return new_LLIterator(LinkedList_dummy[this_2]) endfunction function dispatch_LinkedList_iterator takes integer this_2 returns integer local integer iterator_result if LinkedList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LinkedList.iterator", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LinkedList.iterator on invalid object.", 0, 0, false) endif endif set iterator_result = LinkedList_iterator(this_2) return iterator_result endfunction function StatEntity_onDestroy takes integer this_2 returns nothing endfunction function dealloc_StatEntity takes integer obj returns nothing if StatEntity_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type StatEntity", 0, 0, false) else set StatEntity_nextFree[StatEntity_firstFree] = obj set StatEntity_firstFree = StatEntity_firstFree + 1 set StatEntity_typeId[obj] = 0 endif endfunction function destroyStatEntity takes integer this_2 returns nothing call StatEntity_onDestroy(this_2) call dealloc_StatEntity(this_2) endfunction function dispatch_StatEntity_destroyStatEntity takes integer this_2 returns nothing if StatEntity_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatEntity.destroyStatEntity", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatEntity.destroyStatEntity on invalid object.", 0, 0, false) endif endif call destroyStatEntity(this_2) endfunction function StatList_onDestroy takes integer this_2 returns nothing local integer wurst__iterator0 = dispatch_LinkedList_iterator(StatList_statList[this_2]) local integer s loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator0) set s = dispatch_LLIterator_next(wurst__iterator0) call dispatch_StatEntity_destroyStatEntity(s) endloop call dispatch_LLIterator_close(wurst__iterator0) call dispatch_LinkedList_destroyLinkedList(StatList_statList[this_2]) endfunction function dealloc_StatList takes integer obj returns nothing if StatList_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type StatList", 0, 0, false) else set StatList_nextFree[StatList_firstFree] = obj set StatList_firstFree = StatList_firstFree + 1 set StatList_typeId[obj] = 0 endif endfunction function destroyStatList takes integer this_2 returns nothing call StatList_onDestroy(this_2) call dealloc_StatList(this_2) endfunction function dispatch_StatList_destroyStatList takes integer this_2 returns nothing if StatList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatList.destroyStatList", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatList.destroyStatList on invalid object.", 0, 0, false) endif endif call destroyStatList(this_2) endfunction function UnitStatBuffer_eventQueueAdd takes integer s returns nothing if ( not UnitStatBuffer_isEventAdded[s]) and StatHandler_statChangedEvents[s] != 0 then set UnitStatBuffer_isEventAdded[s] = true set UnitStatBuffer_eventsToInvokeLast = UnitStatBuffer_eventsToInvokeLast + 1 set UnitStatBuffer_eventsToInvoke[UnitStatBuffer_eventsToInvokeLast] = s endif endfunction function UnitStatBuffer_eventQueueReset takes nothing returns nothing set UnitStatBuffer_eventsToInvokeLast = -1 endfunction function gcd takes integer p, integer q returns integer local integer a = p local integer b = q local integer h loop exitwhen not (b != 0) set h = ModuloInteger(a, b) set a = b set b = h endloop return a endfunction function rational_op_mult takes integer this_p, integer this_q, integer r_p, integer r_q returns integer local integer gcd1 = gcd(this_p, r_q) local integer gcd2 = gcd(this_q, r_p) set rational_op_mult_return_p = this_p / gcd1 * (r_p / gcd2) set rational_op_mult_return_q = this_q / gcd2 * (r_q / gcd1) return rational_op_mult_return_p endfunction function rational_toInt takes integer this_p, integer this_q returns integer return this_p / this_q endfunction function UnitStatBuffer_getStatRecalc takes integer this_2, integer statId returns integer local integer result = 0 local integer temp = StatHandler_statType[statId] local integer tempIndex local integer tempIndex_2 if temp == 0 then set result = UnitStatBuffer_statsAbs[UnitStatBuffer_arrayStart[this_2] + statId] elseif temp == 1 then set tempIndex = UnitStatBuffer_arrayStart[this_2] + statId set result = rational_toInt(rational_op_mult(UnitStatBuffer_statsPerc[tempIndex], UnitStatBuffer_statsPerc_2[tempIndex], 100, 1), rational_op_mult_return_q) - 100 elseif temp == 2 then set tempIndex_2 = UnitStatBuffer_arrayStart[this_2] + statId set result = 100 - rational_toInt(rational_op_mult(UnitStatBuffer_statsPerc[tempIndex_2], UnitStatBuffer_statsPerc_2[tempIndex_2], 100, 1), rational_op_mult_return_q) endif if StatHandler_statSubstat[statId] != -1 then set result = result * (100 + UnitStatBuffer_getStatRecalc(this_2, StatHandler_statSubstat[statId])) / 100 endif return result endfunction function dispatch_UnitStatBuffer_getStatRecalc takes integer this_2, integer statId returns integer local integer getStatRecalc_result if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.getStatRecalc", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.getStatRecalc on invalid object.", 0, 0, false) endif endif set getStatRecalc_result = UnitStatBuffer_getStatRecalc(this_2, statId) return getStatRecalc_result endfunction function UnitStatBuffer_get takes integer this_2, integer s returns integer local integer result = 0 if UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + s] then set result = dispatch_UnitStatBuffer_getStatRecalc(this_2, s) set UnitStatBuffer_cache[UnitStatBuffer_arrayStart[this_2] + s] = result set UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + s] = false else set result = UnitStatBuffer_cache[UnitStatBuffer_arrayStart[this_2] + s] endif return result endfunction function dispatch_UnitStatBuffer_get takes integer this_2, integer s returns integer local integer get_result if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.get", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.get on invalid object.", 0, 0, false) endif endif set get_result = UnitStatBuffer_get(this_2, s) return get_result endfunction function unit_getUserData takes unit this_2 returns integer return GetUnitUserData(this_2) endfunction function getUnitIndex takes unit u returns integer return unit_getUserData(u) endfunction function printWarning takes string msg returns nothing call DisplayTimedTextToPlayer(GetLocalPlayer(), 0., 0., PrintingHelper_DEBUG_MSG_DURATION, "|cffFF8000[WARNING]|r - " + msg) endfunction function unit_getStat takes unit this_2, integer s returns integer local integer buffer = StatHandler_mapUnitStatBuffers[getUnitIndex(this_2)] if buffer == 0 then call printWarning("StatHandlerConfig: A called function requires a valid implementation of getUnitIndex(unit u).") endif return dispatch_UnitStatBuffer_get(buffer, s) endfunction function closure_impl takes integer this_2, unit u, integer s returns nothing call SetHeroInt(u, unit_getStat(u, 9), true) endfunction function unit_addAbility takes unit this_2, integer abil returns boolean return UnitAddAbility(this_2, abil) endfunction function unit_removeAbility takes unit this_2, integer abil returns nothing call UnitRemoveAbility(this_2, abil) endfunction function BonusType_setBonus takes integer this_2, unit u, integer bonus returns nothing local integer val local integer raw local integer n if bonus >= BonusHandler_powersOf2[BonusType_maxBonus[this_2]] then call printWarning("Bonus exceeds maximum") return endif if bonus < ( - BonusHandler_powersOf2[BonusType_maxBonus[this_2]]) then call printWarning("Bonus exceeds minimum") return endif set raw = BonusType_baseRaw[this_2] + BonusHandler_rawShiftNeg if bonus < 0 then call unit_addAbility(u, raw) call UnitMakeAbilityPermanent(u, true, raw) set val = bonus + BonusHandler_powersOf2[BonusType_maxBonus[this_2]] else set val = bonus call UnitMakeAbilityPermanent(u, false, raw) call unit_removeAbility(u, raw) endif set n = BonusType_maxBonus[this_2] - 1 loop exitwhen n < 0 set raw = BonusType_baseRaw[this_2] + BonusHandler_rawShifts[n] if val >= BonusHandler_powersOf2[n] then call unit_addAbility(u, raw) call UnitMakeAbilityPermanent(u, true, raw) set val = val - BonusHandler_powersOf2[n] else call UnitMakeAbilityPermanent(u, false, raw) call unit_removeAbility(u, raw) endif set n = n - 1 endloop endfunction function dispatch_BonusType_setBonus takes integer this_2, unit u, integer bonus returns nothing if BonusType_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BonusType.setBonus", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BonusType.setBonus on invalid object.", 0, 0, false) endif endif call BonusType_setBonus(this_2, u, bonus) endfunction function setUnitBonus takes unit u, integer bonusType, integer amount returns nothing call dispatch_BonusType_setBonus(BonusHandler_bonusTypes[bonusType], u, amount) endfunction function UnitBaseStatBuffer_getStatRaw takes integer this_2, integer s returns integer return UnitBaseStatBuffer_stats[UnitBaseStatBuffer_arrayStart[this_2] + s] endfunction function dispatch_UnitBaseStatBuffer_getStatRaw takes integer this_2, integer s returns integer local integer getStatRaw_result if UnitBaseStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitBaseStatBuffer.getStatRaw", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitBaseStatBuffer.getStatRaw on invalid object.", 0, 0, false) endif endif set getStatRaw_result = UnitBaseStatBuffer_getStatRaw(this_2, s) return getStatRaw_result endfunction function UnitBaseStatBuffer_get takes integer this_2, integer s returns integer local integer res = 0 local integer temp = StatHandler_statType[s] if temp == 0 then set res = dispatch_UnitBaseStatBuffer_getStatRaw(this_2, s) elseif temp == 1 then set res = dispatch_UnitBaseStatBuffer_getStatRaw(this_2, s) - 100 elseif temp == 2 then set res = 100 - dispatch_UnitBaseStatBuffer_getStatRaw(this_2, s) endif return res endfunction function dispatch_UnitBaseStatBuffer_get takes integer this_2, integer s returns integer local integer get_result if UnitBaseStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitBaseStatBuffer.get", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitBaseStatBuffer.get on invalid object.", 0, 0, false) endif endif set get_result = UnitBaseStatBuffer_get(this_2, s) return get_result endfunction function UnitStatBuffer_getBaseStat takes integer this_2, integer s returns integer return dispatch_UnitBaseStatBuffer_get(UnitStatBuffer_baseStats[this_2], s) endfunction function dispatch_UnitStatBuffer_getBaseStat takes integer this_2, integer s returns integer local integer getBaseStat_result if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.getBaseStat", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.getBaseStat on invalid object.", 0, 0, false) endif endif set getBaseStat_result = UnitStatBuffer_getBaseStat(this_2, s) return getBaseStat_result endfunction function unit_getBaseStat takes unit this_2, integer s returns integer local integer buffer = StatHandler_mapUnitStatBuffers[getUnitIndex(this_2)] if buffer == 0 then call printWarning("StatHandlerConfig: A called function requires a valid implementation of getUnitIndex(unit u).") endif return dispatch_UnitStatBuffer_getBaseStat(buffer, s) endfunction function closure_impl_2 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 1, unit_getStat(u, 1) - unit_getBaseStat(u, 1)) endfunction function unit_setMoveSpeed takes unit this_2, real speed returns nothing call SetUnitMoveSpeed(this_2, speed) endfunction function closure_impl_3 takes integer this_2, unit u, integer s returns nothing call unit_setMoveSpeed(u, 1. * unit_getStat(u, 14)) endfunction function closure_impl_4 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 9, unit_getStat(u, 5) - unit_getStat(u, 8)) endfunction function closure_impl_5 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 3, unit_getStat(u, 12) - unit_getBaseStat(u, 12)) endfunction function closure_impl_6 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 0, unit_getStat(u, 0) - unit_getBaseStat(u, 0)) endfunction function closure_impl_7 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 10, unit_getStat(u, 6) - unit_getStat(u, 9)) endfunction function closure_impl_8 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 8, unit_getStat(u, 4) - unit_getStat(u, 7)) endfunction function closure_impl_9 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 7, unit_getStat(u, 13)) endfunction function closure_impl_10 takes integer this_2, unit u, integer s returns nothing call SetHeroStr(u, unit_getStat(u, 7), true) endfunction function closure_impl_11 takes integer this_2, unit u, integer s returns nothing call SetHeroAgi(u, unit_getStat(u, 8), true) endfunction function closure_impl_12 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 5, unit_getStat(u, 2) - unit_getBaseStat(u, 2)) endfunction function closure_impl_13 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 2, unit_getStat(u, 10) - unit_getBaseStat(u, 10)) endfunction function closure_impl_14 takes integer this_2, unit u, integer s returns nothing call setUnitBonus(u, 6, unit_getStat(u, 3) - unit_getBaseStat(u, 3)) endfunction function dispatch_StatChangedEvent_statChanged takes integer this_2, unit u, integer s returns nothing if StatChangedEvent_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatChangedEvent.statChanged", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatChangedEvent.statChanged on invalid object.", 0, 0, false) endif endif if StatChangedEvent_typeId[this_2] <= 668 then if StatChangedEvent_typeId[this_2] <= 665 then if StatChangedEvent_typeId[this_2] <= 663 then if StatChangedEvent_typeId[this_2] <= 662 then call closure_impl_4(this_2, u, s) else call closure_impl_14(this_2, u, s) endif elseif StatChangedEvent_typeId[this_2] <= 664 then call closure_impl_2(this_2, u, s) else call closure_impl_9(this_2, u, s) endif elseif StatChangedEvent_typeId[this_2] <= 667 then if StatChangedEvent_typeId[this_2] <= 666 then call closure_impl_10(this_2, u, s) else call closure_impl_6(this_2, u, s) endif else call closure_impl_5(this_2, u, s) endif elseif StatChangedEvent_typeId[this_2] <= 672 then if StatChangedEvent_typeId[this_2] <= 670 then if StatChangedEvent_typeId[this_2] <= 669 then call closure_impl_7(this_2, u, s) else call closure_impl_3(this_2, u, s) endif elseif StatChangedEvent_typeId[this_2] <= 671 then call closure_impl_13(this_2, u, s) else call closure_impl_8(this_2, u, s) endif elseif StatChangedEvent_typeId[this_2] <= 674 then if StatChangedEvent_typeId[this_2] <= 673 then call closure_impl(this_2, u, s) else call closure_impl_11(this_2, u, s) endif else call closure_impl_12(this_2, u, s) endif endfunction function UnitStatBuffer_eventQueueInvoke takes integer this_2 returns nothing local integer n = 0 local integer temp = UnitStatBuffer_eventsToInvokeLast loop exitwhen n > temp set UnitStatBuffer_isEventAdded[UnitStatBuffer_eventsToInvoke[n]] = false call dispatch_StatChangedEvent_statChanged(StatHandler_statChangedEvents[UnitStatBuffer_eventsToInvoke[n]], UnitStatBuffer_u[this_2], UnitStatBuffer_eventsToInvoke[n]) set n = n + 1 endloop endfunction function dispatch_UnitStatBuffer_eventQueueInvoke takes integer this_2 returns nothing if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.eventQueueInvoke", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.eventQueueInvoke on invalid object.", 0, 0, false) endif endif call UnitStatBuffer_eventQueueInvoke(this_2) endfunction function rational_op_divReal takes integer this_p, integer this_q, integer r_p, integer r_q returns integer local integer gcd1 = gcd(this_p, r_p) local integer gcd2 = gcd(this_q, r_q) set rational_op_divReal_return_p = this_p / gcd1 * (r_q / gcd2) set rational_op_divReal_return_q = this_q / gcd2 * (r_p / gcd1) return rational_op_divReal_return_p endfunction function UnitStatBuffer_remove takes integer this_2, integer l returns nothing local integer wurst__iterator2 local integer s local integer tempIndex local integer tempIndex_2 local integer temp call UnitStatBuffer_eventQueueReset() set wurst__iterator2 = dispatch_LinkedList_iterator(StatList_statList[l]) loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator2) set s = dispatch_LLIterator_next(wurst__iterator2) set UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s]] = true if StatHandler_parentStat[StatEntity_stat[s]] != -1 then set UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + StatHandler_parentStat[StatEntity_stat[s]]] = true call UnitStatBuffer_eventQueueAdd(StatHandler_parentStat[StatEntity_stat[s]]) else call UnitStatBuffer_eventQueueAdd(StatEntity_stat[s]) endif set UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s]] = true if StatHandler_statType[StatEntity_stat[s]] == 0 then set UnitStatBuffer_statsAbs[UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s]] = UnitStatBuffer_statsAbs[UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s]] - StatEntity_val[s] else set tempIndex = UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s] set temp = tempIndex set tempIndex_2 = UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s] set UnitStatBuffer_statsPerc[temp] = rational_op_divReal(UnitStatBuffer_statsPerc[tempIndex_2], UnitStatBuffer_statsPerc_2[tempIndex_2], StatEntity_val[s], 100) set UnitStatBuffer_statsPerc_2[tempIndex] = rational_op_divReal_return_q endif endloop call dispatch_LLIterator_close(wurst__iterator2) call dispatch_UnitStatBuffer_eventQueueInvoke(this_2) endfunction function dispatch_UnitStatBuffer_remove takes integer this_2, integer l returns nothing if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.remove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.remove on invalid object.", 0, 0, false) endif endif call UnitStatBuffer_remove(this_2, l) endfunction function unit_getIndex takes unit this_2 returns integer return unit_getUserData(this_2) endfunction function unit_xGetUnitData takes unit this_2 returns integer return unit_getIndex(this_2) endfunction function BuffIgnoreThePain_onRemove takes integer this_2 returns nothing call dispatch_UnitStatBuffer_remove(UnitData_unitStatBuffer[unit_xGetUnitData(dispatch_Buff_getUnit(this_2))], BuffIgnoreThePain_stats[this_2]) call AddUnitAnimationProperties(dispatch_Buff_getUnit(this_2), "defend", false) call dispatch_StatList_destroyStatList(BuffIgnoreThePain_stats[this_2]) endfunction function UnitStatBuffer_apply takes integer this_2, integer l returns nothing local integer wurst__iterator1 local integer s local integer tempIndex local integer tempIndex_2 local integer temp call UnitStatBuffer_eventQueueReset() set wurst__iterator1 = dispatch_LinkedList_iterator(StatList_statList[l]) loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator1) set s = dispatch_LLIterator_next(wurst__iterator1) set UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s]] = true if StatHandler_parentStat[StatEntity_stat[s]] != -1 then set UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + StatHandler_parentStat[StatEntity_stat[s]]] = true call UnitStatBuffer_eventQueueAdd(StatHandler_parentStat[StatEntity_stat[s]]) else call UnitStatBuffer_eventQueueAdd(StatEntity_stat[s]) endif if StatHandler_statType[StatEntity_stat[s]] == 0 then set UnitStatBuffer_statsAbs[UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s]] = UnitStatBuffer_statsAbs[UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s]] + StatEntity_val[s] else set tempIndex = UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s] set temp = tempIndex set tempIndex_2 = UnitStatBuffer_arrayStart[this_2] + StatEntity_stat[s] set UnitStatBuffer_statsPerc[temp] = rational_op_mult(UnitStatBuffer_statsPerc[tempIndex_2], UnitStatBuffer_statsPerc_2[tempIndex_2], StatEntity_val[s], 100) set UnitStatBuffer_statsPerc_2[tempIndex] = rational_op_mult_return_q endif endloop call dispatch_LLIterator_close(wurst__iterator1) call dispatch_UnitStatBuffer_eventQueueInvoke(this_2) endfunction function dispatch_UnitStatBuffer_apply takes integer this_2, integer l returns nothing if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.apply", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.apply on invalid object.", 0, 0, false) endif endif call UnitStatBuffer_apply(this_2, l) endfunction function unit_isEnsnared takes unit this_2 returns boolean return Status_ensnareCounter[Status_status[unit_getIndex(this_2)]] > 0 endfunction function unit_removeEnsnare takes unit this_2 returns nothing set Status_ensnareCounter[Status_status[unit_getIndex(this_2)]] = Status_ensnareCounter[Status_status[unit_getIndex(this_2)]] - 1 if Status_ensnareCounter[Status_status[unit_getIndex(this_2)]] < 0 then call printWarning("StatusHandler: tried removing a non-existing ensnare.") set Status_ensnareCounter[Status_status[unit_getIndex(this_2)]] = 0 endif if not unit_isEnsnared(this_2) then call unit_removeAbility(this_2, StatusHandlerConfig_ENSNARE1_BUFF_ID) call unit_removeAbility(this_2, StatusHandlerConfig_ENSNARE2_BUFF_ID) endif endfunction function BuffNaturesWrath_onRemove takes integer this_2 returns nothing call dispatch_UnitStatBuffer_apply(UnitData_unitStatBuffer[unit_xGetUnitData(dispatch_Buff_getUnit(this_2))], BuffNaturesWrath_stats[this_2]) if BuffNaturesWrath_entangleEnsnare[this_2] then call unit_removeEnsnare(dispatch_Buff_getUnit(this_2)) endif call dispatch_StatList_destroyStatList(BuffNaturesWrath_stats[this_2]) endfunction function BuffRejuvenation_onRemove takes integer this_2 returns nothing call effect_destr(BuffRejuvenation_sfx1[this_2]) endfunction function ThreatHandlerCamp_addIncombatList takes integer this_2 returns nothing if ThreatHandlerCamp_icListId[this_2] == 0 then set ThreatHandler_icListLast = ThreatHandler_icListLast + 1 set ThreatHandlerCamp_icListId[this_2] = ThreatHandler_icListLast set ThreatHandler_icList[ThreatHandler_icListLast] = this_2 endif endfunction function dispatch_ThreatHandlerCamp_addIncombatList takes integer this_2 returns nothing if ThreatHandlerCamp_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerCamp.addIncombatList", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerCamp.addIncombatList on invalid object.", 0, 0, false) endif endif call ThreatHandlerCamp_addIncombatList(this_2) endfunction function ThreatHandlerTU_remove takes integer this_2, integer e returns nothing set ThreatListEntry_tuPrev[ThreatListEntry_tuNext[e]] = ThreatListEntry_tuPrev[e] set ThreatListEntry_tuNext[ThreatListEntry_tuPrev[e]] = ThreatListEntry_tuNext[e] endfunction function dispatch_ThreatHandlerTU_remove takes integer this_2, integer e returns nothing if ThreatHandlerTU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerTU.remove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerTU.remove on invalid object.", 0, 0, false) endif endif call ThreatHandlerTU_remove(this_2, e) endfunction function ThreatHandlerTU_sort takes integer this_2, integer e, boolean increased returns nothing local integer t local integer t_2 if increased then if ThreatListEntry_threat[e] > ThreatListEntry_threat[ThreatListEntry_tuPrev[e]] then set t = ThreatListEntry_tuPrev[e] loop exitwhen not (ThreatListEntry_threat[e] > ThreatListEntry_threat[t]) set t = ThreatListEntry_tuPrev[t] endloop call dispatch_ThreatHandlerTU_remove(this_2, e) set ThreatListEntry_tuPrev[ThreatListEntry_tuNext[t]] = e set ThreatListEntry_tuNext[e] = ThreatListEntry_tuNext[t] set ThreatListEntry_tuNext[t] = e set ThreatListEntry_tuPrev[e] = t endif elseif ThreatListEntry_threat[e] < ThreatListEntry_threat[ThreatListEntry_tuNext[e]] then set t_2 = ThreatListEntry_tuNext[e] loop exitwhen not (ThreatListEntry_threat[e] < ThreatListEntry_threat[t_2]) set t_2 = ThreatListEntry_tuNext[t_2] endloop call dispatch_ThreatHandlerTU_remove(this_2, e) set ThreatListEntry_tuNext[ThreatListEntry_tuPrev[t_2]] = e set ThreatListEntry_tuPrev[e] = ThreatListEntry_tuPrev[t_2] set ThreatListEntry_tuPrev[t_2] = e set ThreatListEntry_tuNext[e] = t_2 endif endfunction function dispatch_ThreatHandlerTU_sort takes integer this_2, integer e, boolean increased returns nothing if ThreatHandlerTU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerTU.sort", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerTU.sort on invalid object.", 0, 0, false) endif endif call ThreatHandlerTU_sort(this_2, e, increased) endfunction function ThreatListEntry_setThreat takes integer this_2, real newThreat returns nothing local boolean increased = newThreat > ThreatListEntry_threat[this_2] set ThreatListEntry_threat[this_2] = newThreat call dispatch_ThreatHandlerTU_sort(ThreatListEntry_tu[this_2], this_2, increased) endfunction function dispatch_ThreatListEntry_setThreat takes integer this_2, real newThreat returns nothing if ThreatListEntry_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatListEntry.setThreat", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatListEntry.setThreat on invalid object.", 0, 0, false) endif endif call ThreatListEntry_setThreat(this_2, newThreat) endfunction function getPlayerUnit takes unit u returns integer return UnitData_threatHandlerPu[unit_xGetUnitData(u)] endfunction function getThreatUnit takes unit u returns integer return UnitData_threatHandlerTu[unit_xGetUnitData(u)] endfunction function alloc_ThreatListEntry takes nothing returns integer local integer this_2 if ThreatListEntry_firstFree == 0 then set ThreatListEntry_maxIndex = ThreatListEntry_maxIndex + 1 set this_2 = ThreatListEntry_maxIndex else set ThreatListEntry_firstFree = ThreatListEntry_firstFree - 1 set this_2 = ThreatListEntry_nextFree[ThreatListEntry_firstFree] endif set ThreatListEntry_typeId[this_2] = 692 return this_2 endfunction function ThreatHandlerPU_add takes integer this_2, integer e returns nothing set ThreatListEntry_puPrev[e] = ThreatListEntry_puPrev[ThreatHandlerPU_dummy[this_2]] set ThreatListEntry_puNext[e] = ThreatHandlerPU_dummy[this_2] set ThreatListEntry_puNext[ThreatListEntry_puPrev[ThreatHandlerPU_dummy[this_2]]] = e set ThreatListEntry_puPrev[ThreatHandlerPU_dummy[this_2]] = e endfunction function dispatch_ThreatHandlerPU_add takes integer this_2, integer e returns nothing if ThreatHandlerPU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerPU.add", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerPU.add on invalid object.", 0, 0, false) endif endif call ThreatHandlerPU_add(this_2, e) endfunction function ThreatHandlerTU_add takes integer this_2, integer e returns nothing local integer t = ThreatListEntry_tuPrev[ThreatHandlerTU_dummy[this_2]] loop exitwhen not (ThreatListEntry_threat[e] > ThreatListEntry_threat[t]) set t = ThreatListEntry_tuPrev[t] endloop set ThreatListEntry_tuPrev[ThreatListEntry_tuNext[t]] = e set ThreatListEntry_tuNext[e] = ThreatListEntry_tuNext[t] set ThreatListEntry_tuNext[t] = e set ThreatListEntry_tuPrev[e] = t endfunction function dispatch_ThreatHandlerTU_add takes integer this_2, integer e returns nothing if ThreatHandlerTU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerTU.add", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerTU.add on invalid object.", 0, 0, false) endif endif call ThreatHandlerTU_add(this_2, e) endfunction function construct_ThreatListEntry takes integer this_2, integer pu, integer tu, real threat returns nothing set ThreatListEntry_pu[this_2] = pu set ThreatListEntry_tu[this_2] = tu set ThreatListEntry_threat[this_2] = threat call dispatch_ThreatHandlerPU_add(pu, this_2) call dispatch_ThreatHandlerTU_add(tu, this_2) call hashtable_saveInt(ThreatHandler_ht, pu, tu, this_2) endfunction function new_ThreatListEntry takes integer pu, integer tu, real threat returns integer local integer this_2 = alloc_ThreatListEntry() call construct_ThreatListEntry(this_2, pu, tu, threat) return this_2 endfunction function unit_getTypeId takes unit this_2 returns integer return GetUnitTypeId(this_2) endfunction function modifyThreat takes unit playerUnit, unit threatUnit, real value, boolean add returns nothing local integer pu = getPlayerUnit(playerUnit) local integer tu = getThreatUnit(threatUnit) local real newValue = value local integer e local integer campUnit if pu == 0 or tu == 0 then return endif if IsUnitType(playerUnit, UNIT_TYPE_DEAD) or IsUnitType(threatUnit, UNIT_TYPE_DEAD) or unit_getTypeId(playerUnit) == 0 or unit_getTypeId(threatUnit) == 0 then return endif if ThreatHandlerTU_state[tu] == 2 or ThreatHandlerTU_state[tu] == 3 then return endif if HaveSavedInteger(ThreatHandler_ht, pu, tu) then set e = hashtable_loadInt(ThreatHandler_ht, pu, tu) if add then set newValue = ThreatListEntry_threat[e] + value endif if newValue < 0. then set newValue = 0. endif call dispatch_ThreatListEntry_setThreat(e, newValue) else if value < 0. then set newValue = 0. endif call dispatch_ThreatHandlerCamp_addIncombatList(ThreatHandlerTU_camp[tu]) set ThreatHandlerCamp_state[ThreatHandlerTU_camp[tu]] = 1 set e = new_ThreatListEntry(pu, tu, newValue) set campUnit = ThreatHandlerCamp_dummy[ThreatHandlerTU_camp[tu]] loop exitwhen not (ThreatHandlerTU_campNext[campUnit] != ThreatHandlerCamp_dummy[ThreatHandlerTU_camp[tu]]) set campUnit = ThreatHandlerTU_campNext[campUnit] set ThreatHandlerTU_state[campUnit] = 1 if campUnit != tu then set e = new_ThreatListEntry(pu, campUnit, 0.) endif endloop endif endfunction function unit_isAlive takes unit this_2 returns boolean return UnitAlive(this_2) endfunction function BuffShieldSlamTaunt_onRemove takes integer this_2 returns nothing if unit_isAlive(BuffShieldSlamTaunt_caster[this_2]) then call modifyThreat(BuffShieldSlamTaunt_caster[this_2], dispatch_Buff_getUnit(this_2), -99999., true) endif endfunction function BuffShield_onRemove takes integer this_2 returns nothing call dispatch_UnitStatBuffer_remove(UnitData_unitStatBuffer[unit_xGetUnitData(dispatch_Buff_getUnit(this_2))], BuffShield_stats[this_2]) call dispatch_StatList_destroyStatList(BuffShield_stats[this_2]) call effect_destr(BuffShield_sfx1[this_2]) endfunction function BuffTrapOwner_onRemove takes integer this_2 returns nothing call effect_destr(BuffTrapOwner_sfx1[this_2]) endfunction function BuffTrapTarget_onRemove takes integer this_2 returns nothing call unit_removeEnsnare(dispatch_Buff_getUnit(this_2)) call effect_destr(BuffTrapTarget_sfxNet[this_2]) endfunction function Buff_onRemove takes integer this_2 returns nothing endfunction function dispatch_Buff_onRemove takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.onRemove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.onRemove on invalid object.", 0, 0, false) endif endif if Buff_typeId[this_2] <= 740 then if Buff_typeId[this_2] <= 738 then if Buff_typeId[this_2] <= 737 then if Buff_typeId[this_2] <= 736 then call Buff_onRemove(this_2) else call BuffNaturesWrath_onRemove(this_2) endif else call BuffFirearrow_onRemove(this_2) endif elseif Buff_typeId[this_2] <= 739 then call BuffShieldSlamTaunt_onRemove(this_2) else call BuffShield_onRemove(this_2) endif elseif Buff_typeId[this_2] <= 742 then if Buff_typeId[this_2] <= 741 then call BuffRejuvenation_onRemove(this_2) else call BuffTrapOwner_onRemove(this_2) endif elseif Buff_typeId[this_2] <= 743 then call BuffIgnoreThePain_onRemove(this_2) else call BuffTrapTarget_onRemove(this_2) endif endfunction function Buff_getBuffTypeId takes integer this_2 returns integer return Buff_typeId[this_2] endfunction function dispatch_Buff_getBuffTypeId takes integer this_2 returns integer local integer getBuffTypeId_result if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.getBuffTypeId", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.getBuffTypeId on invalid object.", 0, 0, false) endif endif set getBuffTypeId_result = Buff_getBuffTypeId(this_2) return getBuffTypeId_result endfunction function BuffList_countBuffsOfTypeId takes integer this_2, integer id returns integer local integer n = 0 local integer wurst__iterator1 = dispatch_LinkedList_iterator(BuffList_buffs[this_2]) local integer b loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator1) set b = dispatch_LLIterator_next(wurst__iterator1) if dispatch_Buff_getBuffTypeId(b) == id then set n = n + 1 endif endloop call dispatch_LLIterator_close(wurst__iterator1) return n endfunction function dispatch_BuffList_countBuffsOfTypeId takes integer this_2, integer id returns integer local integer countBuffsOfTypeId_result if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.countBuffsOfTypeId", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.countBuffsOfTypeId on invalid object.", 0, 0, false) endif endif set countBuffsOfTypeId_result = BuffList_countBuffsOfTypeId(this_2, id) return countBuffsOfTypeId_result endfunction function BuffList_countBuffsOfType takes integer this_2, integer b returns integer return dispatch_BuffList_countBuffsOfTypeId(this_2, dispatch_Buff_getBuffTypeId(b)) endfunction function dispatch_BuffList_countBuffsOfType takes integer this_2, integer b returns integer local integer countBuffsOfType_result if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.countBuffsOfType", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.countBuffsOfType on invalid object.", 0, 0, false) endif endif set countBuffsOfType_result = BuffList_countBuffsOfType(this_2, b) return countBuffsOfType_result endfunction function BuffFirearrow_getBuffRaw takes integer this_2 returns integer return SpellFirearrow_BUFF_RAW endfunction function BuffIgnoreThePain_getBuffRaw takes integer this_2 returns integer return SpellIgnoreThePain_BUFF_RAW endfunction function BuffNaturesWrath_getBuffRaw takes integer this_2 returns integer return SpellNaturesWrath_BUFF_RAW endfunction function BuffRejuvenation_getBuffRaw takes integer this_2 returns integer return SpellRejuvenation_BUFF_RAW endfunction function BuffShield_getBuffRaw takes integer this_2 returns integer return SpellShield_BUFF_RAW endfunction function BuffTrapTarget_getBuffRaw takes integer this_2 returns integer return SpellTrap_BUFF_RAW endfunction function Buff_getBuffRaw takes integer this_2 returns integer return 0 endfunction function dispatch_Buff_getBuffRaw takes integer this_2 returns integer local integer getBuffRaw_result if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.getBuffRaw", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.getBuffRaw on invalid object.", 0, 0, false) endif endif if Buff_typeId[this_2] <= 740 then if Buff_typeId[this_2] <= 738 then if Buff_typeId[this_2] <= 737 then if Buff_typeId[this_2] <= 736 then set getBuffRaw_result = Buff_getBuffRaw(this_2) else set getBuffRaw_result = BuffNaturesWrath_getBuffRaw(this_2) endif else set getBuffRaw_result = BuffFirearrow_getBuffRaw(this_2) endif elseif Buff_typeId[this_2] <= 739 then set getBuffRaw_result = Buff_getBuffRaw(this_2) else set getBuffRaw_result = BuffShield_getBuffRaw(this_2) endif elseif Buff_typeId[this_2] <= 742 then if Buff_typeId[this_2] <= 741 then set getBuffRaw_result = BuffRejuvenation_getBuffRaw(this_2) else set getBuffRaw_result = Buff_getBuffRaw(this_2) endif elseif Buff_typeId[this_2] <= 743 then set getBuffRaw_result = BuffIgnoreThePain_getBuffRaw(this_2) else set getBuffRaw_result = BuffTrapTarget_getBuffRaw(this_2) endif return getBuffRaw_result endfunction function BuffFirearrow_getRaw takes integer this_2 returns integer return SpellFirearrow_BUFF_ABIL_RAW endfunction function BuffIgnoreThePain_getRaw takes integer this_2 returns integer return SpellIgnoreThePain_BUFF_ABIL_RAW endfunction function BuffNaturesWrath_getRaw takes integer this_2 returns integer return SpellNaturesWrath_BUFF_ABIL_RAW endfunction function BuffRejuvenation_getRaw takes integer this_2 returns integer return SpellRejuvenation_BUFF_ABIL_RAW endfunction function BuffShield_getRaw takes integer this_2 returns integer return SpellShield_BUFF_ABIL_RAW endfunction function BuffTrapTarget_getRaw takes integer this_2 returns integer return SpellTrap_BUFF_ABIL_RAW endfunction function Buff_getRaw takes integer this_2 returns integer return 0 endfunction function dispatch_Buff_getRaw takes integer this_2 returns integer local integer getRaw_result if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.getRaw", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.getRaw on invalid object.", 0, 0, false) endif endif if Buff_typeId[this_2] <= 740 then if Buff_typeId[this_2] <= 738 then if Buff_typeId[this_2] <= 737 then if Buff_typeId[this_2] <= 736 then set getRaw_result = Buff_getRaw(this_2) else set getRaw_result = BuffNaturesWrath_getRaw(this_2) endif else set getRaw_result = BuffFirearrow_getRaw(this_2) endif elseif Buff_typeId[this_2] <= 739 then set getRaw_result = Buff_getRaw(this_2) else set getRaw_result = BuffShield_getRaw(this_2) endif elseif Buff_typeId[this_2] <= 742 then if Buff_typeId[this_2] <= 741 then set getRaw_result = BuffRejuvenation_getRaw(this_2) else set getRaw_result = Buff_getRaw(this_2) endif elseif Buff_typeId[this_2] <= 743 then set getRaw_result = BuffIgnoreThePain_getRaw(this_2) else set getRaw_result = BuffTrapTarget_getRaw(this_2) endif return getRaw_result endfunction function Buff_removeBuffIcon takes integer this_2 returns nothing local integer raw = dispatch_Buff_getRaw(this_2) local integer buffRaw if raw != 0 then if dispatch_BuffList_countBuffsOfType(Buff_parent[this_2], this_2) <= 1 then call UnitMakeAbilityPermanent(dispatch_BuffList_getUnit(Buff_parent[this_2]), false, raw) call unit_removeAbility(dispatch_BuffList_getUnit(Buff_parent[this_2]), raw) set buffRaw = dispatch_Buff_getBuffRaw(this_2) if buffRaw != 0 then call unit_removeAbility(dispatch_BuffList_getUnit(Buff_parent[this_2]), buffRaw) endif endif endif endfunction function dispatch_Buff_removeBuffIcon takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.removeBuffIcon", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.removeBuffIcon on invalid object.", 0, 0, false) endif endif call Buff_removeBuffIcon(this_2) endfunction function Buff_applyRemove takes integer this_2, unit target returns nothing if Buff_parent[this_2] != 0 then call dispatch_Buff_onRemove(this_2) call dispatch_Buff_removeBuffIcon(this_2) call dispatch_BuffList_removeBuff(Buff_parent[this_2], this_2) set Buff_parent[this_2] = 0 endif endfunction function dispatch_Buff_applyRemove takes integer this_2, unit target returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.applyRemove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.applyRemove on invalid object.", 0, 0, false) endif endif call Buff_applyRemove(this_2, target) endfunction function BuffCustomMembers_destroyCustomMembers takes integer this_2 returns nothing endfunction function dispatch_Buff_destroyCustomMembers takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.destroyCustomMembers", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.destroyCustomMembers on invalid object.", 0, 0, false) endif endif call BuffCustomMembers_destroyCustomMembers(this_2) endfunction function Buff_preDestroy takes integer this_2 returns nothing endfunction function dispatch_Buff_preDestroy takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.preDestroy", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.preDestroy on invalid object.", 0, 0, false) endif endif call Buff_preDestroy(this_2) endfunction function timer_getData takes timer this_2 returns integer call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 0, TimerUtils_timerData, GetHandleId(this_2), null, 0, 0, false) return tempReturn_integer endfunction function timer_pause takes timer this_2 returns nothing call PauseTimer(this_2) endfunction function timer_setData takes timer this_2, integer data returns nothing call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, TimerUtils_timerData, GetHandleId(this_2), data, null, 0, 0, false) endfunction function timer_release takes timer this_2 returns nothing if this_2 == null then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Trying to release a null timer", 0, 0, false) return endif if timer_getData(this_2) == TimerUtils_HELD then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "ReleaseTimer: Double free!", 0, 0, false) return endif call timer_setData(this_2, TimerUtils_HELD) call timer_pause(this_2) set TimerUtils_freeTimers[TimerUtils_freeTimersCount] = this_2 set TimerUtils_freeTimersCount = TimerUtils_freeTimersCount + 1 endfunction function Buff_stopTimed takes integer this_2 returns nothing call timer_release(Buff_timerObject[this_2]) set Buff_timerObject[this_2] = null endfunction function dispatch_Buff_stopTimed takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.stopTimed", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.stopTimed on invalid object.", 0, 0, false) endif endif call Buff_stopTimed(this_2) endfunction function Buff_onDestroy takes integer this_2 returns nothing call dispatch_Buff_applyRemove(this_2, null) call dispatch_Buff_preDestroy(this_2) call dispatch_Buff_destroyCustomMembers(this_2) if Buff_timerObject[this_2] != null then call dispatch_Buff_stopTimed(this_2) endif endfunction function dealloc_Buff takes integer obj returns nothing if Buff_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type Buff", 0, 0, false) else set Buff_nextFree[Buff_firstFree] = obj set Buff_firstFree = Buff_firstFree + 1 set Buff_typeId[obj] = 0 endif endfunction function destroyBuff takes integer this_2 returns nothing call Buff_onDestroy(this_2) call dealloc_Buff(this_2) endfunction function dispatch_Buff_destroyBuff takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.destroyBuff", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.destroyBuff on invalid object.", 0, 0, false) endif endif call destroyBuff(this_2) endfunction function texttag_setColor takes texttag this_2, integer col_red, integer col_green, integer col_blue, integer col_alpha returns nothing call SetTextTagColor(this_2, col_red, col_green, col_blue, col_alpha) endfunction function texttag_setFadepoint takes texttag this_2, real fadepoint returns nothing call SetTextTagFadepoint(this_2, fadepoint) endfunction function texttag_setLifespan takes texttag this_2, real span returns nothing call SetTextTagLifespan(this_2, span) endfunction function texttag_setPermanent takes texttag this_2, boolean flag returns nothing call SetTextTagPermanent(this_2, flag) endfunction function texttag_setPos takes texttag this_2, real pos_x, real pos_y, real pos_z returns nothing call SetTextTagPos(this_2, pos_x, pos_y, pos_z) endfunction function texttag_setText takes texttag this_2, string text, real size returns nothing call SetTextTagText(this_2, text, size * 0.0023) endfunction function texttag_setVelocity takes texttag this_2, real xvel, real yvel returns nothing call SetTextTagVelocity(this_2, xvel, yvel) endfunction function vec2_withZ takes real this_x, real this_y, real z returns real set vec2_withZ_return_x = this_x set vec2_withZ_return_y = this_y set vec2_withZ_return_z = z return vec2_withZ_return_x endfunction function vec3_toVec2 takes real this_x, real this_y, real this_z returns real set vec3_toVec2_return_x = this_x set vec3_toVec2_return_y = this_y return vec3_toVec2_return_x endfunction function createTTEx takes real pos_x, real pos_y, real pos_z, real vel_x, real vel_y, string message, real size, real duration, integer col_red, integer col_green, integer col_blue, integer col_alpha returns texttag local texttag receiver = CreateTextTag() local texttag receiver_2 local texttag receiver_3 local texttag receiver_4 local texttag receiver_5 local texttag receiver_6 local texttag receiver_7 call texttag_setPos(receiver, vec2_withZ(vec3_toVec2(pos_x, pos_y, pos_z), vec3_toVec2_return_y, 20.), vec2_withZ_return_y, vec2_withZ_return_z) set receiver_2 = receiver call texttag_setText(receiver_2, message, size) set receiver_3 = receiver_2 call texttag_setColor(receiver_3, col_red, col_green, col_blue, col_alpha) set receiver_4 = receiver_3 call texttag_setVelocity(receiver_4, vel_x, vel_y) set receiver_5 = receiver_4 call texttag_setLifespan(receiver_5, duration) set receiver_6 = receiver_5 call texttag_setFadepoint(receiver_6, .1) set receiver_7 = receiver_6 call texttag_setPermanent(receiver_7, false) set createTTExtempReturn = receiver_7 set receiver = null set receiver_2 = null set receiver_3 = null set receiver_4 = null set receiver_5 = null set receiver_6 = null set receiver_7 = null return createTTExtempReturn endfunction function texttag_setVisibility takes texttag this_2, boolean flag returns nothing call SetTextTagVisibility(this_2, flag) endfunction function createTTEx_2 takes real pos_x, real pos_y, real pos_z, real vel_x, real vel_y, string message, real size, real duration, integer col_red, integer col_green, integer col_blue, integer col_alpha, player p returns texttag local texttag receiver = createTTEx(pos_x, pos_y, pos_z, vel_x, vel_y, message, size, duration, col_red, col_green, col_blue, col_alpha) call texttag_setVisibility(receiver, GetLocalPlayer() == p) set createTTExtempReturn_2 = receiver set receiver = null return createTTExtempReturn_2 endfunction function int_toString takes integer this_2 returns string return I2S(this_2) endfunction function unit_getX takes unit this_2 returns real return GetUnitX(this_2) endfunction function unit_getY takes unit this_2 returns real return GetUnitY(this_2) endfunction function unit_getPos3fake takes unit this_2 returns real set unit_getPos3fake_return_x = unit_getX(this_2) set unit_getPos3fake_return_y = unit_getY(this_2) set unit_getPos3fake_return_z = 0. return unit_getPos3fake_return_x endfunction function combatTextCrit takes unit source, unit target, real dmg returns nothing local texttag receiver = createTTEx_2(unit_getPos3fake(target), unit_getPos3fake_return_y, unit_getPos3fake_return_z, GetRandomReal( - 0.02, 0.02), 0.04, int_toString(R2I(dmg)) + "!", 8., 1.2, 255, 0, 0, 255, GetOwningPlayer(source)) local texttag receiver_2 call texttag_setPermanent(receiver, false) set receiver_2 = receiver call texttag_setFadepoint(receiver_2, 0.6) set receiver = null set receiver_2 = null endfunction function combatTextDamage takes unit source, unit target, real dmg returns nothing local texttag receiver = createTTEx_2(unit_getPos3fake(target), unit_getPos3fake_return_y, unit_getPos3fake_return_z, GetRandomReal( - 0.02, 0.02), 0.04, int_toString(R2I(dmg)), 8., 1.2, 255, 255, 255, 255, GetOwningPlayer(source)) local texttag receiver_2 call texttag_setPermanent(receiver, false) set receiver_2 = receiver call texttag_setFadepoint(receiver_2, 0.6) set receiver = null set receiver_2 = null endfunction function combatTextEvade takes unit source, unit target returns nothing local texttag receiver = createTTEx_2(unit_getPos3fake(target), unit_getPos3fake_return_y, unit_getPos3fake_return_z, GetRandomReal( - 0.02, 0.02), 0.04, "dodge", 8., 1.2, 255, 255, 255, 255, GetOwningPlayer(source)) local texttag receiver_2 call texttag_setPermanent(receiver, false) set receiver_2 = receiver call texttag_setFadepoint(receiver_2, 0.6) set receiver = null set receiver_2 = null endfunction function createItem takes integer itemId, real pos_x, real pos_y returns item return CreateItem(itemId, pos_x, pos_y) endfunction function HashMap_get takes integer this_2, integer key returns integer return hashtable_loadInt(HashMap_ht, this_2, key) endfunction function dispatch_HashMap_get takes integer this_2, integer key returns integer local integer get_result if HashMap_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HashMap.get", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HashMap.get on invalid object.", 0, 0, false) endif endif set get_result = HashMap_get(this_2, key) return get_result endfunction function HashMap_has takes integer this_2, integer key returns boolean return dispatch_HashMap_get(this_2, key) != 0 endfunction function dispatch_HashMap_has takes integer this_2, integer key returns boolean local boolean has_result if HashMap_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HashMap.has", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HashMap.has on invalid object.", 0, 0, false) endif endif set has_result = HashMap_has(this_2, key) return has_result endfunction function PQuestItem_getState takes integer this_2, integer playerId returns integer return dispatch_HashMap_get(PQuestItem_state[this_2], playerId) endfunction function dispatch_PQuestItem_getState takes integer this_2, integer playerId returns integer local integer getState_result if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.getState", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.getState on invalid object.", 0, 0, false) endif endif set getState_result = PQuestItem_getState(this_2, playerId) return getState_result endfunction function group_clear takes group this_2 returns nothing call GroupClear(this_2) endfunction function group_close takes group this_2 returns nothing call DestroyGroup(this_2) endfunction function group_enumUnitsInRange takes group this_2, real pos_x, real pos_y, real range returns nothing call GroupEnumUnitsInRange(this_2, pos_x, pos_y, range, null) endfunction function group_hasNext takes group this_2 returns boolean return FirstOfGroup(this_2) != null endfunction function group_iterator takes group this_2 returns group set bj_groupAddGroupDest = CreateGroup() call ForGroup(this_2, function GroupAddGroupEnum) return bj_groupAddGroupDest endfunction function group_next takes group this_2 returns unit local unit u = FirstOfGroup(this_2) call GroupRemoveUnit(this_2, u) set group_nexttempReturn = u set u = null return group_nexttempReturn endfunction function player_getId takes player this_2 returns integer return GetPlayerId(this_2) endfunction function unit_getOwner takes unit this_2 returns player return GetOwningPlayer(this_2) endfunction function xGetPlayerHero takes integer playerId returns unit if PlayerData_playerData[playerId] == 0 then return null endif return PlayerData_hero[PlayerData_playerData[playerId]] endfunction function unit_xIsHero takes unit this_2 returns boolean return xGetPlayerHero(player_getId(unit_getOwner(this_2))) == this_2 endfunction function isPlayerWithQuestItemInRange takes real pos_x, real pos_y, integer questItem returns boolean local boolean found local group wurst__iterator0 local unit u local integer pid call group_clear(TempGroups_ENUM_GROUP) call group_enumUnitsInRange(TempGroups_ENUM_GROUP, pos_x, pos_y, PQuest_QUEST_EVENT_RANGE) set found = false set wurst__iterator0 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator0) set u = group_next(wurst__iterator0) if unit_xIsHero(u) then set pid = player_getId(unit_getOwner(u)) if dispatch_PQuestItem_getState(questItem, pid) == 1 then set found = true exitwhen true endif endif endloop call group_close(wurst__iterator0) set wurst__iterator0 = null set u = null return found endfunction function unit_getPos takes unit this_2 returns real set unit_getPos_return_x = unit_getX(this_2) set unit_getPos_return_y = unit_getY(this_2) return unit_getPos_return_x endfunction function alloc_ItemData takes nothing returns integer local integer this_2 if ItemData_firstFree == 0 then set ItemData_maxIndex = ItemData_maxIndex + 1 set this_2 = ItemData_maxIndex else set ItemData_firstFree = ItemData_firstFree - 1 set this_2 = ItemData_nextFree[ItemData_firstFree] endif set ItemData_typeId[this_2] = 682 return this_2 endfunction function item_setUserData takes item this_2, integer data returns nothing call SetItemUserData(this_2, data) endfunction function construct_ItemData takes integer this_2, item i returns nothing call item_setUserData(i, this_2) set ItemData_boundTo[this_2] = -1 endfunction function new_ItemData takes item i returns integer local integer this_2 = alloc_ItemData() call construct_ItemData(this_2, i) return this_2 endfunction function xSpawnItem takes integer raw, real pos_x, real pos_y returns item local item itm = createItem(raw, pos_x, pos_y) call new_ItemData(itm) set xSpawnItemtempReturn = itm set itm = null return xSpawnItemtempReturn endfunction function creepDrop takes unit u returns nothing local integer table local integer rolled local integer counter local integer wurst__iterator0 local integer d local integer wurst__iterator1 local integer d_2 if dispatch_HashMap_has(CreepDrop_unitDrops, unit_getTypeId(u)) then set table = dispatch_HashMap_get(CreepDrop_unitDrops, unit_getTypeId(u)) set rolled = GetRandomInt(0, 99) set counter = 1 set wurst__iterator0 = dispatch_LinkedList_iterator(Droptable_drops[table]) loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator0) set d = dispatch_LLIterator_next(wurst__iterator0) set counter = counter + Drop_chance[d] if counter >= rolled then call xSpawnItem(Drop_itemRaw[d], unit_getPos(u), unit_getPos_return_y) exitwhen true endif endloop call dispatch_LLIterator_close(wurst__iterator0) set wurst__iterator1 = dispatch_LinkedList_iterator(Droptable_questDrops[table]) loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator1) set d_2 = dispatch_LLIterator_next(wurst__iterator1) if isPlayerWithQuestItemInRange(unit_getPos(u), unit_getPos_return_y, QuestDrop_questItem[d_2]) then set rolled = GetRandomInt(1, 100) if QuestDrop_chance[d_2] >= rolled then call createItem(QuestDrop_itemRaw[d_2], unit_getPos(u), unit_getPos_return_y) exitwhen true endif endif endloop call dispatch_LLIterator_close(wurst__iterator1) endif endfunction function combatTextExp takes unit target, integer exp returns nothing local texttag receiver = createTTEx_2(unit_getPos3fake(target), unit_getPos3fake_return_y, unit_getPos3fake_return_z, GetRandomReal( - 0.02, 0.02), 0.04, int_toString(exp) + " exp", 8., 1.2, 0, 255, 204, 0, GetOwningPlayer(target)) local texttag receiver_2 call texttag_setPermanent(receiver, false) set receiver_2 = receiver call texttag_setFadepoint(receiver_2, 0.6) set receiver = null set receiver_2 = null endfunction function player_getState takes player this_2, playerstate state returns integer return GetPlayerState(this_2, state) endfunction function player_addState takes player this_2, playerstate state, integer val returns nothing call SetPlayerState(this_2, state, player_getState(this_2, state) + val) endfunction function player_addGold takes player this_2, integer val returns nothing call player_addState(this_2, PLAYER_STATE_RESOURCE_GOLD, val) endfunction function heroAddCreepExpGold takes unit creep, unit hero returns nothing local integer dist = GetUnitLevel(creep) - GetHeroLevel(hero) local integer exp = R2I((1. - dist * dist * 1. / (CreepExp_MAX_LVL_DIFFERENCE * CreepExp_MAX_LVL_DIFFERENCE)) * GetUnitLevel(creep) * CreepExp_EXP_LEVEL_FACTOR) if exp > 0 then call combatTextExp(hero, exp) call AddHeroXP(hero, exp, true) call player_addGold(unit_getOwner(hero), 1 + GetUnitLevel(creep) / 2) endif endfunction function creepSpreadExp takes unit creep returns nothing local unit u call group_clear(TempGroups_ENUM_GROUP) call group_enumUnitsInRange(TempGroups_ENUM_GROUP, unit_getPos(creep), unit_getPos_return_y, CreepExp_CREEP_EXP_RANGE) loop exitwhen not group_hasNext(TempGroups_ENUM_GROUP) set u = group_next(TempGroups_ENUM_GROUP) if unit_xIsHero(u) then call heroAddCreepExpGold(creep, u) endif endloop set u = null endfunction function getTimer takes nothing returns timer local timer receiver if TimerUtils_freeTimersCount > 0 then set TimerUtils_freeTimersCount = TimerUtils_freeTimersCount - 1 call timer_setData(TimerUtils_freeTimers[TimerUtils_freeTimersCount], 0) set receiver = null return TimerUtils_freeTimers[TimerUtils_freeTimersCount] else set receiver = CreateTimer() call timer_setData(receiver, 0) set getTimertempReturn = receiver set receiver = null return getTimertempReturn endif endfunction function Timed_startTimer takes integer this_2, real time returns nothing local timer t = getTimer() call timer_setData(t, this_2) call TimerStart(t, time, false, ref_function_Timed_timerCallback) set t = null endfunction function dispatch_CreepRespawn_startTimer takes integer this_2, real time returns nothing if CreepRespawn_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling CreepRespawn.startTimer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called CreepRespawn.startTimer on invalid object.", 0, 0, false) endif endif call Timed_startTimer(this_2, time) endfunction function respawnTime takes integer raw returns real return 90. endfunction function CreepRespawn_respawn takes integer this_2 returns nothing call dispatch_CreepRespawn_startTimer(this_2, respawnTime(CreepRespawn_unitRaw[this_2])) endfunction function dispatch_CreepRespawn_respawn takes integer this_2 returns nothing if CreepRespawn_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling CreepRespawn.respawn", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called CreepRespawn.respawn on invalid object.", 0, 0, false) endif endif call CreepRespawn_respawn(this_2) endfunction function timer_start takes timer this_2, real time, code timerCallBack returns nothing call TimerStart(this_2, time, false, timerCallBack) endfunction function UnitData_destroyTimed takes integer this_2, real timeout returns nothing local timer receiver = getTimer() local timer receiver_2 call timer_setData(receiver, this_2) set receiver_2 = receiver call timer_start(receiver_2, timeout, ref_function_closure_impl_2) set receiver = null set receiver_2 = null endfunction function dispatch_UnitData_destroyTimed takes integer this_2, real timeout returns nothing if UnitIndex_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitData.destroyTimed", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitData.destroyTimed on invalid object.", 0, 0, false) endif endif call UnitData_destroyTimed(this_2, timeout) endfunction function Timed_startTimer_2 takes integer this_2, real time returns nothing local timer t = getTimer() call timer_setData(t, this_2) call TimerStart(t, time, false, ref_function_Timed_timerCallback_2) set t = null endfunction function dispatch_HeroRespawn_startTimer takes integer this_2, real time returns nothing if HeroRespawn_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroRespawn.startTimer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroRespawn.startTimer on invalid object.", 0, 0, false) endif endif call Timed_startTimer_2(this_2, time) endfunction function ThreatHandlerPU_remove takes integer this_2, integer e returns nothing set ThreatListEntry_puPrev[ThreatListEntry_puNext[e]] = ThreatListEntry_puPrev[e] set ThreatListEntry_puNext[ThreatListEntry_puPrev[e]] = ThreatListEntry_puNext[e] endfunction function dispatch_ThreatHandlerPU_remove takes integer this_2, integer e returns nothing if ThreatHandlerPU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerPU.remove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerPU.remove on invalid object.", 0, 0, false) endif endif call ThreatHandlerPU_remove(this_2, e) endfunction function ThreatListEntry_onDestroy takes integer this_2 returns nothing if ThreatListEntry_pu[this_2] != 0 then call dispatch_ThreatHandlerPU_remove(ThreatListEntry_pu[this_2], this_2) call dispatch_ThreatHandlerTU_remove(ThreatListEntry_tu[this_2], this_2) call RemoveSavedInteger(ThreatHandler_ht, ThreatListEntry_pu[this_2], ThreatListEntry_tu[this_2]) endif endfunction function dealloc_ThreatListEntry takes integer obj returns nothing if ThreatListEntry_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type ThreatListEntry", 0, 0, false) else set ThreatListEntry_nextFree[ThreatListEntry_firstFree] = obj set ThreatListEntry_firstFree = ThreatListEntry_firstFree + 1 set ThreatListEntry_typeId[obj] = 0 endif endfunction function destroyThreatListEntry takes integer this_2 returns nothing call ThreatListEntry_onDestroy(this_2) call dealloc_ThreatListEntry(this_2) endfunction function dispatch_ThreatListEntry_destroyThreatListEntry takes integer this_2 returns nothing if ThreatListEntry_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatListEntry.destroyThreatListEntry", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatListEntry.destroyThreatListEntry on invalid object.", 0, 0, false) endif endif call destroyThreatListEntry(this_2) endfunction function ThreatHandlerPU_onDestroy takes integer this_2 returns nothing local integer e = ThreatHandlerPU_dummy[this_2] loop exitwhen not (ThreatListEntry_puNext[e] != ThreatHandlerPU_dummy[this_2]) set e = ThreatListEntry_puNext[e] call dispatch_ThreatListEntry_destroyThreatListEntry(e) endloop call dispatch_ThreatListEntry_destroyThreatListEntry(ThreatHandlerPU_dummy[this_2]) set ThreatHandlerPU_u[this_2] = null endfunction function dealloc_ThreatHandlerPU takes integer obj returns nothing if ThreatHandlerPU_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type ThreatHandlerPU", 0, 0, false) else set ThreatHandlerPU_nextFree[ThreatHandlerPU_firstFree] = obj set ThreatHandlerPU_firstFree = ThreatHandlerPU_firstFree + 1 set ThreatHandlerPU_typeId[obj] = 0 endif endfunction function destroyThreatHandlerPU takes integer this_2 returns nothing call ThreatHandlerPU_onDestroy(this_2) call dealloc_ThreatHandlerPU(this_2) endfunction function dispatch_ThreatHandlerPU_destroyThreatHandlerPU takes integer this_2 returns nothing if ThreatHandlerPU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerPU.destroyThreatHandlerPU", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerPU.destroyThreatHandlerPU on invalid object.", 0, 0, false) endif endif call destroyThreatHandlerPU(this_2) endfunction function printTimedToPlayer takes string msg, real duration, player p returns nothing call DisplayTimedTextToPlayer(p, 0., 0., duration, msg) endfunction function HeroRespawn_respawn takes integer this_2 returns nothing call dispatch_ThreatHandlerPU_destroyThreatHandlerPU(UnitData_threatHandlerPu[unit_xGetUnitData(HeroRespawn_hero[this_2])]) call dispatch_HeroRespawn_startTimer(this_2, HeroRespawn_HERO_RESPAWN_TIME) call printTimedToPlayer("Your hero has died and will respawn in " + int_toString(R2I(HeroRespawn_HERO_RESPAWN_TIME)) + " seconds.", 5., unit_getOwner(HeroRespawn_hero[this_2])) endfunction function dispatch_HeroRespawn_respawn takes integer this_2 returns nothing if HeroRespawn_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroRespawn.respawn", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroRespawn.respawn on invalid object.", 0, 0, false) endif endif call HeroRespawn_respawn(this_2) endfunction function alloc_HeroRespawn takes nothing returns integer local integer this_2 if HeroRespawn_firstFree == 0 then set HeroRespawn_maxIndex = HeroRespawn_maxIndex + 1 set this_2 = HeroRespawn_maxIndex else set HeroRespawn_firstFree = HeroRespawn_firstFree - 1 set this_2 = HeroRespawn_nextFree[HeroRespawn_firstFree] endif set HeroRespawn_typeId[this_2] = 694 return this_2 endfunction function construct_HeroRespawn takes integer this_2, unit hero returns nothing set HeroRespawn_hero[this_2] = hero endfunction function new_HeroRespawn takes unit hero returns integer local integer this_2 = alloc_HeroRespawn() call construct_HeroRespawn(this_2, hero) return this_2 endfunction function respawnHero takes unit u returns nothing call dispatch_HeroRespawn_respawn(new_HeroRespawn(u)) endfunction function unitDeath takes unit u returns nothing local integer unitData = unit_xGetUnitData(u) local integer wurst__iterator0 = dispatch_LinkedList_iterator(BuffList_buffs[UnitData_unitBuffList[unitData]]) local integer b loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator0) set b = dispatch_LLIterator_next(wurst__iterator0) call dispatch_Buff_destroyBuff(b) endloop call dispatch_LLIterator_close(wurst__iterator0) if unit_xIsHero(u) then call respawnHero(u) else call creepSpreadExp(u) call creepDrop(u) if UnitData_creepRespawn[unitData] != 0 then call dispatch_CreepRespawn_respawn(UnitData_creepRespawn[unitData]) endif call dispatch_UnitData_destroyTimed(unitData, 3.) endif endfunction function unit_getState takes unit this_2, unitstate state returns real return GetUnitState(this_2, state) endfunction function unit_getHP takes unit this_2 returns real return unit_getState(this_2, UNIT_STATE_LIFE) endfunction function unit_getBuffList takes unit this_2 returns integer return UnitData_unitBuffList[unit_xGetUnitData(this_2)] endfunction function unit_hasBuff takes unit this_2, integer buffTypeId returns boolean return dispatch_BuffList_countBuffsOfTypeId(unit_getBuffList(this_2), buffTypeId) > 0 endfunction function unit_setState takes unit this_2, unitstate state, real value returns nothing call SetUnitState(this_2, state, value) endfunction function unit_setHP takes unit this_2, real hp returns nothing call unit_setState(this_2, UNIT_STATE_LIFE, hp) endfunction function getTalentUnit takes integer playerId returns unit return xGetPlayerHero(playerId) endfunction function getTalentUnit_2 takes unit u returns unit return getTalentUnit(player_getId(unit_getOwner(u))) endfunction function unit_getAbilityLevel takes unit this_2, integer id returns integer return GetUnitAbilityLevel(this_2, id) endfunction function unit_xHasTalent takes unit this_2, integer talent returns boolean return unit_getAbilityLevel(getTalentUnit_2(this_2), Talent_raw[talent]) > 1 endfunction function real_squared takes real this_2 returns real return this_2 * this_2 endfunction function vec2_distToVecSquared takes real this_x, real this_y, real v_x, real v_y returns real return real_squared(v_x - this_x) + real_squared(v_y - this_y) endfunction function cyc_unitDamageTarget takes integer funcChoice, unit source, unit target, real damage, integer damageType, boolean isAttack returns nothing local boolean isCrit local real dmg local integer temp local real threat if funcChoice == 0 then call cyc_unitDamageTarget(1, source, target, damage, damageType, false) elseif funcChoice == 1 then if unit_hasBuff(target, 743) then if isAttack and unit_xHasTalent(target, TalentList_TALENT_WARRIOR_IGNORE_REFLECT) and vec2_distToVecSquared(unit_getPos(source), unit_getPos_return_y, unit_getPos(target), unit_getPos_return_y) <= 100 * 100 then call cyc_unitDamageTarget(0, target, source, unit_getStat(target, 10) * 1., 0, false) endif return endif set isCrit = false set dmg = damage if isAttack then if GetRandomInt(0, 99) < unit_getStat(target, 15) then call combatTextEvade(source, target) return endif if GetRandomInt(0, 99) < unit_getStat(source, 16) then set isCrit = true set dmg = dmg * (1. + unit_getStat(source, 17) * 0.01) + unit_getStat(source, 18) endif endif set temp = damageType if temp == 0 then set dmg = dmg - unit_getStat(target, 12) elseif temp == 1 then elseif temp == 2 then elseif temp == 3 then endif if dmg > 0. then call unit_setHP(target, unit_getHP(target) - dmg) if not unit_xIsHero(target) then set threat = dmg set threat = threat * (1. + unit_getStat(source, 20) * 0.01) call modifyThreat(source, target, threat, true) endif if unit_getHP(target) < 0.405 then call unitDeath(target) endif endif if isCrit then call combatTextCrit(source, target, dmg) else call combatTextDamage(source, target, dmg) endif endif endfunction function BuffFirearrow_onTimer takes integer this_2 returns nothing call cyc_unitDamageTarget(0, BuffFirearrow_caster[this_2], dispatch_Buff_getUnit(this_2), BuffFirearrow_damagePerTick[this_2], 2, false) endfunction function alloc_DelayNode takes nothing returns integer local integer this_2 if DelayNode_firstFree == 0 then set DelayNode_maxIndex = DelayNode_maxIndex + 1 set this_2 = DelayNode_maxIndex else set DelayNode_firstFree = DelayNode_firstFree - 1 set this_2 = DelayNode_nextFree[DelayNode_firstFree] endif set DelayNode_typeId[this_2] = 751 return this_2 endfunction function timer_getElapsed takes timer this_2 returns real return TimerGetElapsed(this_2) endfunction function getElapsedGameTime takes nothing returns real return timer_getElapsed(GameTimer_gameTimer) endfunction function timer_getRemaining takes timer this_2 returns real return TimerGetRemaining(this_2) endfunction function construct_DelayNode takes integer this_2, unit u, real time returns nothing local integer tmp set DelayNode_next[this_2] = 0 set DelayNode_u[this_2] = u set DelayNode_delayTime[this_2] = getElapsedGameTime() + time if DelayNode_first == 0 then set DelayNode_first = this_2 set DelayNode_last = DelayNode_first else set tmp = DelayNode_first loop exitwhen not (DelayNode_next[tmp] != 0 and DelayNode_delayTime[tmp] < DelayNode_delayTime[this_2]) set tmp = DelayNode_next[tmp] endloop if DelayNode_delayTime[tmp] < DelayNode_delayTime[this_2] then if tmp == DelayNode_last then set DelayNode_next[tmp] = this_2 set DelayNode_last = this_2 else set DelayNode_next[this_2] = DelayNode_next[tmp] set DelayNode_next[tmp] = this_2 endif elseif tmp == DelayNode_first then set DelayNode_first = this_2 set DelayNode_next[this_2] = tmp elseif tmp == DelayNode_last then set DelayNode_next[tmp] = this_2 set DelayNode_last = tmp else set DelayNode_next[this_2] = DelayNode_next[tmp] set DelayNode_next[tmp] = this_2 endif if timer_getRemaining(DelayNode_t) > 0. and time < timer_getRemaining(DelayNode_t) then call timer_start(DelayNode_t, time, ref_function_DelayNode_recycle_2) elseif timer_getRemaining(DelayNode_t) <= 0. then call timer_start(DelayNode_t, time, ref_function_DelayNode_recycle_3) endif endif endfunction function new_DelayNode takes unit u, real time returns integer local integer this_2 = alloc_DelayNode() call construct_DelayNode(this_2, u, time) return this_2 endfunction function DummyRecycler_recycle takes unit u, real delay returns nothing call new_DelayNode(u, delay) endfunction function Fx_onDestroy takes integer this_2 returns nothing if Fx_fx[this_2] != null then call effect_destr(Fx_fx[this_2]) endif call DummyRecycler_recycle(Fx_dummy[this_2], 1.) endfunction function dealloc_Fx takes integer obj returns nothing if Fx_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type Fx", 0, 0, false) else set Fx_nextFree[Fx_firstFree] = obj set Fx_firstFree = Fx_firstFree + 1 set Fx_typeId[obj] = 0 endif endfunction function destroyFx takes integer this_2 returns nothing call Fx_onDestroy(this_2) call dealloc_Fx(this_2) endfunction function dispatch_Fx_destroyFx takes integer this_2 returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.destroyFx", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.destroyFx on invalid object.", 0, 0, false) endif endif call destroyFx(this_2) endfunction function unit_setVertexColor takes unit this_2, integer col_red, integer col_green, integer col_blue, integer col_alpha returns nothing call SetUnitVertexColor(this_2, col_red, col_green, col_blue, col_alpha) endfunction function Fx_setColor takes integer this_2, integer newColor_red, integer newColor_green, integer newColor_blue, integer newColor_alpha returns nothing call unit_setVertexColor(Fx_dummy[this_2], newColor_red, newColor_green, newColor_blue, newColor_alpha) endfunction function dispatch_Fx_setColor takes integer this_2, integer newColor_red, integer newColor_green, integer newColor_blue, integer newColor_alpha returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setColor", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setColor on invalid object.", 0, 0, false) endif endif call Fx_setColor(this_2, newColor_red, newColor_green, newColor_blue, newColor_alpha) endfunction function Fx_recolor takes integer this_2, integer newColor_red, integer newColor_green, integer newColor_blue, integer newColor_alpha returns nothing call dispatch_Fx_setColor(this_2, newColor_red, newColor_green, newColor_blue, newColor_alpha) endfunction function dispatch_Fx_recolor takes integer this_2, integer newColor_red, integer newColor_green, integer newColor_blue, integer newColor_alpha returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.recolor", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.recolor on invalid object.", 0, 0, false) endif endif call Fx_recolor(this_2, newColor_red, newColor_green, newColor_blue, newColor_alpha) endfunction function unit_setScale takes unit this_2, real scale returns nothing call SetUnitScale(this_2, scale, scale, scale) endfunction function Fx_setScale takes integer this_2, real value returns nothing call unit_setScale(Fx_dummy[this_2], value) endfunction function dispatch_Fx_setScale takes integer this_2, real value returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setScale", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setScale on invalid object.", 0, 0, false) endif endif call Fx_setScale(this_2, value) endfunction function alloc_Fx takes nothing returns integer local integer this_2 if Fx_firstFree == 0 then set Fx_maxIndex = Fx_maxIndex + 1 set this_2 = Fx_maxIndex else set Fx_firstFree = Fx_firstFree - 1 set this_2 = Fx_nextFree[Fx_firstFree] endif set Fx_typeId[this_2] = 759 return this_2 endfunction function angle_degrees takes real this_radians returns real return this_radians * Maths_RADTODEG endfunction function createUnit takes player p, integer unitId, real pos_x, real pos_y, real facing_radians returns unit return CreateUnit(p, unitId, pos_x, pos_y, angle_degrees(facing_radians)) endfunction function unit_setXY takes unit this_2, real pos_x, real pos_y returns nothing call SetUnitX(this_2, pos_x) call SetUnitY(this_2, pos_y) endfunction function createDummy takes real pos_x, real pos_y, player owner, real facing_radians returns unit local unit u = createUnit(owner, Basics_DUMMY_UNIT_ID, pos_x, pos_y, facing_radians) local unit receiver = u local unit receiver_2 local unit receiver_3 local unit receiver_4 call unit_setXY(receiver, pos_x, pos_y) set receiver_2 = receiver call unit_addAbility(receiver_2, Basics_HEIGHT_ENABLER) set receiver_3 = receiver_2 call unit_removeAbility(receiver_3, Basics_HEIGHT_ENABLER) set receiver_4 = receiver_3 call unit_addAbility(receiver_4, Basics_LOCUST_ID) set createDummytempReturn = u set u = null set receiver = null set receiver_2 = null set receiver_3 = null set receiver_4 = null return createDummytempReturn endfunction function ArrayQueue_units_get takes integer index1, integer index2 returns unit local unit returnVal if index2 < 0 or index2 >= 6 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Index out of Bounds", 0, 0, false) elseif index2 <= 2 then if index2 <= 1 then if index2 <= 0 then set returnVal = ArrayQueue_units_0[index1] else set returnVal = ArrayQueue_units_1[index1] endif else set returnVal = ArrayQueue_units_2[index1] endif elseif index2 <= 4 then if index2 <= 3 then set returnVal = ArrayQueue_units_3[index1] else set returnVal = ArrayQueue_units_4[index1] endif else set returnVal = ArrayQueue_units_5[index1] endif set ArrayQueue_units_gettempReturn = returnVal set returnVal = null return ArrayQueue_units_gettempReturn endfunction function ArrayQueue_dequeue takes integer this_2 returns unit if ArrayQueue_size[this_2] > 0 then set ArrayQueue_size[this_2] = ArrayQueue_size[this_2] - 1 set ArrayQueue_fp[this_2] = ModuloInteger(ArrayQueue_fp[this_2] + 1, NewDummyRecycler_SAVED_UNITS_PER_ANGLE) return ArrayQueue_units_get(this_2, ArrayQueue_fp[this_2]) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Queue empty", 0, 0, false) return null endif endfunction function dispatch_ArrayQueue_dequeue takes integer this_2 returns unit local unit dequeue_result if ArrayQueue_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ArrayQueue.dequeue", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ArrayQueue.dequeue on invalid object.", 0, 0, false) endif endif set dequeue_result = ArrayQueue_dequeue(this_2) set dispatch_ArrayQueue_dequeuetempReturn = dequeue_result set dequeue_result = null return dispatch_ArrayQueue_dequeuetempReturn endfunction function unit_unpause takes unit this_2 returns nothing call PauseUnit(this_2, false) endfunction function DummyRecycler_get takes real pos_x, real pos_y, real a_radians returns unit local integer angleIndex = real_toInt(real_toInt(ModuloReal(angle_degrees(a_radians), 360.)) / NewDummyRecycler_ANGLE_DEGREE) local unit receiver local unit receiver_2 if ArrayQueue_size[DummyRecycler_angleQueues[angleIndex]] > 0 then set receiver = dispatch_ArrayQueue_dequeue(DummyRecycler_angleQueues[angleIndex]) call unit_setXY(receiver, pos_x, pos_y) set receiver_2 = receiver call unit_unpause(receiver_2) set DummyRecycler_gettempReturn = receiver_2 set receiver = null set receiver_2 = null return DummyRecycler_gettempReturn else set receiver = null set receiver_2 = null return createDummy(pos_x, pos_y, Basics_DUMMY_PLAYER, a_radians) endif endfunction function unit_addEffect takes unit this_2, string fx, string attachment returns effect return AddSpecialEffectTarget(fx, this_2, attachment) endfunction function Fx_setFx takes integer this_2, string newpath returns nothing if Fx_fx[this_2] != null then call effect_destr(Fx_fx[this_2]) endif if newpath == "" then set Fx_fx[this_2] = null else set Fx_fx[this_2] = unit_addEffect(Fx_dummy[this_2], newpath, "origin") endif endfunction function dispatch_Fx_setFx takes integer this_2, string newpath returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setFx", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setFx on invalid object.", 0, 0, false) endif endif call Fx_setFx(this_2, newpath) endfunction function construct_Fx3 takes integer this_2, real pos_x, real pos_y, real facing_radians, string fxpath returns nothing set Fx_dummy[this_2] = null set Fx_fx[this_2] = null set Fx_dummy[this_2] = DummyRecycler_get(pos_x, pos_y, facing_radians) call dispatch_Fx_setFx(this_2, fxpath) endfunction function new_Fx takes real pos_x, real pos_y, real facing_radians, string fxpath returns integer local integer this_2 = alloc_Fx() call construct_Fx3(this_2, pos_x, pos_y, facing_radians, fxpath) return this_2 endfunction function randomPosOffset3 takes real dist returns real local real x = GetRandomReal( - dist, dist) + GetRandomReal( - dist, dist) + GetRandomReal( - dist, dist) local real y = GetRandomReal( - dist, dist) + GetRandomReal( - dist, dist) + GetRandomReal( - dist, dist) set randomPosOffset3_return_x = x set randomPosOffset3_return_y = y return randomPosOffset3_return_x endfunction function vec2_op_plus takes real this_x, real this_y, real v_x, real v_y returns real set vec2_op_plus_return_x = this_x + v_x set vec2_op_plus_return_y = this_y + v_y return vec2_op_plus_return_x endfunction function BuffNaturesWrath_onTimer takes integer this_2 returns nothing local real temp_sfxPos_x = vec2_op_plus(unit_getPos(dispatch_Buff_getUnit(this_2)), unit_getPos_return_y, randomPosOffset3(20.), randomPosOffset3_return_y) local real temp_sfxPos_y = vec2_op_plus_return_y local real sfxPos_x = temp_sfxPos_x local real sfxPos_y = temp_sfxPos_y local integer receiver = new_Fx(sfxPos_x, sfxPos_y, GetRandomReal(0., 10.), "Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl") local integer fx local integer receiver_2 call dispatch_Fx_setScale(receiver, GetRandomReal(0.2, 0.5)) set receiver_2 = receiver call dispatch_Fx_recolor(receiver_2, 0, GetRandomInt(80, 255), 255, 255) set fx = receiver_2 call dispatch_Fx_destroyFx(fx) endfunction function combatTextHeal takes unit source, unit target, real heal returns nothing local texttag receiver = createTTEx_2(unit_getPos3fake(target), unit_getPos3fake_return_y, unit_getPos3fake_return_z, GetRandomReal( - 0.02, 0.02), 0.04, int_toString(R2I(heal)), 8., 1.2, 0, 255, 0, 255, GetOwningPlayer(source)) local texttag receiver_2 call texttag_setPermanent(receiver, false) set receiver_2 = receiver call texttag_setFadepoint(receiver_2, 0.6) set receiver = null set receiver_2 = null endfunction function min takes real x, real y returns real local real r if x < y then set r = x else set r = y endif return r endfunction function unit_addState takes unit this_2, unitstate state, real value returns nothing call SetUnitState(this_2, state, unit_getState(this_2, state) + value) endfunction function unit_addHP takes unit this_2, real val returns nothing call unit_addState(this_2, UNIT_STATE_LIFE, val) endfunction function unit_getMaxHP takes unit this_2 returns real return unit_getState(this_2, UNIT_STATE_MAX_LIFE) endfunction function vec2_distToVec takes real this_x, real this_y, real v_x, real v_y returns real return SquareRoot(real_squared(v_x - this_x) + real_squared(v_y - this_y)) endfunction function unitHealTarget takes unit source, unit target, real amount returns real local real healrec = (100 + dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(target)], 19)) / 100. local real healed = amount * healrec local group wurst__iterator0 local unit u local real dist local real aggro set healed = min(healed, unit_getMaxHP(target) - unit_getHP(target)) call unit_addHP(target, healed) call combatTextHeal(source, target, healed) call group_clear(TempGroups_ENUM_GROUP) call group_enumUnitsInRange(TempGroups_ENUM_GROUP, unit_getPos(source), unit_getPos_return_y, 700.) set wurst__iterator0 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator0) set u = group_next(wurst__iterator0) if unit_getOwner(u) == Player(PLAYER_NEUTRAL_AGGRESSIVE) then set dist = vec2_distToVec(unit_getPos(u), unit_getPos_return_y, unit_getPos(source), unit_getPos_return_y) set aggro = (800. - dist) / 800. * healed call modifyThreat(source, u, aggro, true) endif endloop call group_close(wurst__iterator0) set wurst__iterator0 = null set u = null return healed endfunction function BuffRejuvenation_onTimer takes integer this_2 returns nothing call unitHealTarget(BuffRejuvenation_caster[this_2], dispatch_Buff_getUnit(this_2), BuffRejuvenation_healPerTick[this_2]) endfunction function Buff_onTimer takes integer this_2 returns nothing endfunction function dispatch_Buff_onTimer takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.onTimer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.onTimer on invalid object.", 0, 0, false) endif endif if Buff_typeId[this_2] <= 738 then if Buff_typeId[this_2] <= 737 then if Buff_typeId[this_2] <= 736 then call Buff_onTimer(this_2) else call BuffNaturesWrath_onTimer(this_2) endif else call BuffFirearrow_onTimer(this_2) endif elseif Buff_typeId[this_2] <= 741 then if Buff_typeId[this_2] <= 740 then call Buff_onTimer(this_2) else call BuffRejuvenation_onTimer(this_2) endif else call Buff_onTimer(this_2) endif endfunction function Buff_timerCallback takes nothing returns nothing local timer t = GetExpiredTimer() local integer obj = timer_getData(t) set Buff_timerCounter[obj] = Buff_timerCounter[obj] + 1 call dispatch_Buff_onTimer(obj) if Buff_timerCounterMax[obj] != -1 and Buff_timerCounter[obj] >= Buff_timerCounterMax[obj] then if Buff_timerDestroyAfter[obj] then call dispatch_Buff_destroyBuff(obj) else call dispatch_Buff_stopTimed(obj) endif endif set t = null endfunction function unit_remove takes unit this_2 returns nothing call RemoveUnit(this_2) endfunction function CastBar_onDestroy takes integer this_2 returns nothing call unit_remove(CastBar_dummy[this_2]) endfunction function dealloc_CastBar takes integer obj returns nothing if CastBar_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type CastBar", 0, 0, false) else set CastBar_nextFree[CastBar_firstFree] = obj set CastBar_firstFree = CastBar_firstFree + 1 set CastBar_typeId[obj] = 0 endif endfunction function destroyCastBar takes integer this_2 returns nothing call CastBar_onDestroy(this_2) call dealloc_CastBar(this_2) endfunction function dispatch_CastBar_destroyCastBar takes integer this_2 returns nothing if CastBar_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling CastBar.destroyCastBar", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called CastBar.destroyCastBar on invalid object.", 0, 0, false) endif endif call destroyCastBar(this_2) endfunction function ChannelData_onDestroy takes integer this_2 returns nothing endfunction function dealloc_ChannelData takes integer obj returns nothing if ChannelData_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type ChannelData", 0, 0, false) else set ChannelData_nextFree[ChannelData_firstFree] = obj set ChannelData_firstFree = ChannelData_firstFree + 1 set ChannelData_typeId[obj] = 0 endif endfunction function destroyChannelData takes integer this_2 returns nothing call ChannelData_onDestroy(this_2) call dealloc_ChannelData(this_2) endfunction function dispatch_ChannelData_destroyChannelData takes integer this_2 returns nothing if ChannelData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ChannelData.destroyChannelData", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ChannelData.destroyChannelData on invalid object.", 0, 0, false) endif endif call destroyChannelData(this_2) endfunction function hashtable_removeInt takes hashtable this_2, integer parentKey, integer childKey returns nothing call RemoveSavedInteger(this_2, parentKey, childKey) endfunction function HashMap_remove takes integer this_2, integer key returns nothing call hashtable_removeInt(HashMap_ht, this_2, key) endfunction function dispatch_HashMap_remove takes integer this_2, integer key returns nothing if HashMap_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HashMap.remove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HashMap.remove on invalid object.", 0, 0, false) endif endif call HashMap_remove(this_2, key) endfunction function Spell_onDestroy takes integer this_2 returns nothing endfunction function dealloc_Spell takes integer obj returns nothing if Spell_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type Spell", 0, 0, false) else set Spell_nextFree[Spell_firstFree] = obj set Spell_firstFree = Spell_firstFree + 1 set Spell_typeId[obj] = 0 endif endfunction function destroySpell takes integer this_2 returns nothing call Spell_onDestroy(this_2) call dealloc_Spell(this_2) endfunction function dispatch_Spell_destroySpell takes integer this_2 returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Spell.destroySpell", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Spell.destroySpell on invalid object.", 0, 0, false) endif endif call destroySpell(this_2) endfunction function int_toReal takes integer this_2 returns real return this_2 * 1. endfunction function max takes integer x, integer y returns integer local integer r if x > y then set r = x else set r = y endif return r endfunction function unit_addMana takes unit this_2, real val returns nothing call unit_addState(this_2, UNIT_STATE_MANA, val) endfunction function SpellHeal_onChannelEnd takes integer this_2, boolean success returns nothing local real heal local real healed local integer manaRestored if success then set heal = dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(Spell_caster[this_2])], 6) * 4. set healed = unitHealTarget(Spell_caster[this_2], Spell_targetUnit[this_2], heal) call effect_destr(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", Spell_targetUnit[this_2], "overhead")) if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_PRIEST_HEAL_OVERHEAL) then set manaRestored = real_toInt((1. - healed / heal) / 0.25) set manaRestored = max(0, manaRestored) call unit_addMana(Spell_caster[this_2], int_toReal(manaRestored)) endif endif endfunction function SpellHolyBolt_onChannelEnd takes integer this_2, boolean success returns nothing if success then endif endfunction function alloc_LLEntry takes nothing returns integer local integer this_2 if LLEntry_firstFree == 0 then set LLEntry_maxIndex = LLEntry_maxIndex + 1 set this_2 = LLEntry_maxIndex else set LLEntry_firstFree = LLEntry_firstFree - 1 set this_2 = LLEntry_nextFree[LLEntry_firstFree] endif set LLEntry_typeId[this_2] = 2 return this_2 endfunction function construct_LLEntry takes integer this_2, integer elem, integer prev, integer next returns nothing set LLEntry_elem[this_2] = elem set LLEntry_prev[this_2] = prev set LLEntry_next[this_2] = next endfunction function new_LLEntry takes integer elem, integer prev, integer next returns integer local integer this_2 = alloc_LLEntry() call construct_LLEntry(this_2, elem, prev, next) return this_2 endfunction function LinkedList_add takes integer this_2, integer elem returns nothing local integer entry = new_LLEntry(elem, LLEntry_prev[LinkedList_dummy[this_2]], LinkedList_dummy[this_2]) set LLEntry_next[LLEntry_prev[LinkedList_dummy[this_2]]] = entry set LLEntry_prev[LinkedList_dummy[this_2]] = entry set LinkedList_size[this_2] = LinkedList_size[this_2] + 1 endfunction function dispatch_LinkedList_add takes integer this_2, integer elem returns nothing if LinkedList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LinkedList.add", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LinkedList.add on invalid object.", 0, 0, false) endif endif call LinkedList_add(this_2, elem) endfunction function BuffList_addBuff takes integer this_2, integer b returns nothing call dispatch_LinkedList_add(BuffList_buffs[this_2], b) endfunction function dispatch_BuffList_addBuff takes integer this_2, integer b returns nothing if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.addBuff", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.addBuff on invalid object.", 0, 0, false) endif endif call BuffList_addBuff(this_2, b) endfunction function blockDamageEvents takes boolean flag returns nothing set DamageHandler_blockDmgEvent = flag endfunction function Buff_addBuffIcon takes integer this_2 returns nothing local integer raw = dispatch_Buff_getRaw(this_2) if raw != 0 then if dispatch_BuffList_countBuffsOfType(Buff_parent[this_2], this_2) <= 1 then call blockDamageEvents(true) call unit_addAbility(dispatch_BuffList_getUnit(Buff_parent[this_2]), raw) call blockDamageEvents(false) call UnitMakeAbilityPermanent(dispatch_BuffList_getUnit(Buff_parent[this_2]), true, raw) endif endif endfunction function dispatch_Buff_addBuffIcon takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.addBuffIcon", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.addBuffIcon on invalid object.", 0, 0, false) endif endif call Buff_addBuffIcon(this_2) endfunction function BuffList_getList takes integer this_2 returns integer return BuffList_buffs[this_2] endfunction function dispatch_BuffList_getList takes integer this_2 returns integer local integer getList_result if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.getList", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.getList on invalid object.", 0, 0, false) endif endif set getList_result = BuffList_getList(this_2) return getList_result endfunction function BuffFirearrow_getPolicy takes integer this_2 returns integer return 0 endfunction function BuffNaturesWrath_getPolicy takes integer this_2 returns integer return 1 endfunction function BuffRejuvenation_getPolicy takes integer this_2 returns integer return 0 endfunction function BuffShield_getPolicy takes integer this_2 returns integer return 1 endfunction function Buff_getPolicy takes integer this_2 returns integer return 0 endfunction function dispatch_Buff_getPolicy takes integer this_2 returns integer local integer getPolicy_result if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.getPolicy", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.getPolicy on invalid object.", 0, 0, false) endif endif if Buff_typeId[this_2] <= 739 then if Buff_typeId[this_2] <= 737 then if Buff_typeId[this_2] <= 736 then set getPolicy_result = Buff_getPolicy(this_2) else set getPolicy_result = BuffNaturesWrath_getPolicy(this_2) endif elseif Buff_typeId[this_2] <= 738 then set getPolicy_result = BuffFirearrow_getPolicy(this_2) else set getPolicy_result = Buff_getPolicy(this_2) endif elseif Buff_typeId[this_2] <= 741 then if Buff_typeId[this_2] <= 740 then set getPolicy_result = BuffShield_getPolicy(this_2) else set getPolicy_result = BuffRejuvenation_getPolicy(this_2) endif else set getPolicy_result = Buff_getPolicy(this_2) endif return getPolicy_result endfunction function Buff_checkApply takes integer this_2 returns boolean local integer wurst__iterator0 local integer b if dispatch_Buff_getPolicy(this_2) == 1 then set wurst__iterator0 = dispatch_LinkedList_iterator(dispatch_BuffList_getList(Buff_parent[this_2])) loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator0) set b = dispatch_LLIterator_next(wurst__iterator0) if dispatch_Buff_getBuffTypeId(b) == dispatch_Buff_getBuffTypeId(this_2) and b != this_2 then call dispatch_Buff_destroyBuff(b) endif endloop call dispatch_LLIterator_close(wurst__iterator0) endif return true endfunction function dispatch_Buff_checkApply takes integer this_2 returns boolean local boolean checkApply_result if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.checkApply", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.checkApply on invalid object.", 0, 0, false) endif endif set checkApply_result = Buff_checkApply(this_2) return checkApply_result endfunction function timer_startPeriodic takes timer this_2, real time, code timerCallBack returns nothing call TimerStart(this_2, time, true, timerCallBack) endfunction function Buff_startTimed takes integer this_2, real timeout, integer times, boolean destroyAfter returns nothing local timer receiver local timer receiver_2 set Buff_timerDestroyAfter[this_2] = destroyAfter set Buff_timerCounterMax[this_2] = times set Buff_timerCounter[this_2] = 0 set receiver = getTimer() call timer_setData(receiver, this_2) set receiver_2 = receiver call timer_startPeriodic(receiver_2, timeout, ref_function_Buff_timerCallback) set Buff_timerObject[this_2] = receiver_2 set receiver = null set receiver_2 = null endfunction function dispatch_Buff_startTimed takes integer this_2, real timeout, integer times, boolean destroyAfter returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.startTimed", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.startTimed on invalid object.", 0, 0, false) endif endif call Buff_startTimed(this_2, timeout, times, destroyAfter) endfunction function BuffFirearrow_onApply takes integer this_2 returns nothing local real timePerTick = 1. local integer ticks = 4 set BuffFirearrow_damagePerTick[this_2] = dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(BuffFirearrow_caster[this_2])], 5) * 2. / ticks if unit_xHasTalent(BuffFirearrow_caster[this_2], TalentList_TALENT_RANGER_FIREARROW_DURATION) then set ticks = 6 endif call dispatch_Buff_startTimed(this_2, timePerTick, ticks, true) set BuffFirearrow_sfx1[this_2] = unit_addEffect(dispatch_Buff_getUnit(this_2), "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeDamageTarget.mdl", "chest") endfunction function Buff_destroyAfter takes integer this_2, real timeout returns nothing call dispatch_Buff_startTimed(this_2, timeout, 1, true) endfunction function dispatch_Buff_destroyAfter takes integer this_2, real timeout returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.destroyAfter", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.destroyAfter on invalid object.", 0, 0, false) endif endif call Buff_destroyAfter(this_2, timeout) endfunction function alloc_StatEntity takes nothing returns integer local integer this_2 if StatEntity_firstFree == 0 then set StatEntity_maxIndex = StatEntity_maxIndex + 1 set this_2 = StatEntity_maxIndex else set StatEntity_firstFree = StatEntity_firstFree - 1 set this_2 = StatEntity_nextFree[StatEntity_firstFree] endif set StatEntity_typeId[this_2] = 676 return this_2 endfunction function construct_StatEntity takes integer this_2, integer stat, integer val returns nothing set StatEntity_stat[this_2] = stat set StatEntity_val[this_2] = val endfunction function new_StatEntity takes integer stat, integer val returns integer local integer this_2 = alloc_StatEntity() call construct_StatEntity(this_2, stat, val) return this_2 endfunction function StatList_add takes integer this_2, integer s, integer value returns nothing local integer temp = StatHandler_statType[s] if temp == 0 then call dispatch_LinkedList_add(StatList_statList[this_2], new_StatEntity(s, value)) elseif temp == 1 then call dispatch_LinkedList_add(StatList_statList[this_2], new_StatEntity(s, value + 100)) elseif temp == 2 then call dispatch_LinkedList_add(StatList_statList[this_2], new_StatEntity(s, 100 - value)) endif endfunction function dispatch_StatList_add takes integer this_2, integer s, integer value returns nothing if StatList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatList.add", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatList.add on invalid object.", 0, 0, false) endif endif call StatList_add(this_2, s, value) endfunction function alloc_StatList takes nothing returns integer local integer this_2 if StatList_firstFree == 0 then set StatList_maxIndex = StatList_maxIndex + 1 set this_2 = StatList_maxIndex else set StatList_firstFree = StatList_firstFree - 1 set this_2 = StatList_nextFree[StatList_firstFree] endif set StatList_typeId[this_2] = 677 return this_2 endfunction function alloc_LinkedList takes nothing returns integer local integer this_2 if LinkedList_firstFree == 0 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this_2 = LinkedList_maxIndex else set LinkedList_firstFree = LinkedList_firstFree - 1 set this_2 = LinkedList_nextFree[LinkedList_firstFree] endif set LinkedList_typeId[this_2] = 1 return this_2 endfunction function construct_LinkedList takes integer this_2 returns nothing set LinkedList_size[this_2] = 0 set LinkedList_dummy[this_2] = new_LLEntry(0, 0, 0) set LLEntry_next[LinkedList_dummy[this_2]] = LinkedList_dummy[this_2] set LLEntry_prev[LinkedList_dummy[this_2]] = LinkedList_dummy[this_2] endfunction function new_LinkedList takes nothing returns integer local integer this_2 = alloc_LinkedList() call construct_LinkedList(this_2) return this_2 endfunction function construct_StatList takes integer this_2 returns nothing set StatList_statList[this_2] = new_LinkedList() endfunction function new_StatList takes nothing returns integer local integer this_2 = alloc_StatList() call construct_StatList(this_2) return this_2 endfunction function BuffIgnoreThePain_onApply takes integer this_2 returns nothing local integer receiver = new_StatList() call dispatch_StatList_add(receiver, 14, -100) set BuffIgnoreThePain_stats[this_2] = receiver call dispatch_UnitStatBuffer_apply(UnitData_unitStatBuffer[unit_xGetUnitData(dispatch_Buff_getUnit(this_2))], BuffIgnoreThePain_stats[this_2]) call AddUnitAnimationProperties(dispatch_Buff_getUnit(this_2), "defend", true) call dispatch_Buff_destroyAfter(this_2, 4.) endfunction function debugPrint takes string msg, integer level returns nothing local integer i if level >= PrintingHelper_DEBUG_LEVEL then set i = 0 loop exitwhen i > 11 if PrintingHelper_wantDebug[i] then call DisplayTimedTextToPlayer(Player(i), 0., 0., PrintingHelper_DEBUG_MSG_DURATION, "|cff9C9C9CDEBUG - |r" + msg) endif set i = i + 1 endloop endif endfunction function unit_getName takes unit this_2 returns string return GetUnitName(this_2) endfunction function unit_hasAbility takes unit this_2, integer id returns boolean return GetUnitAbilityLevel(this_2, id) > 0 endfunction function unit_setAbilityLevel takes unit this_2, integer abilId, integer lvl returns nothing call SetUnitAbilityLevel(this_2, abilId, lvl) endfunction function unit_setMana takes unit this_2, real val returns nothing call unit_setState(this_2, UNIT_STATE_MANA, val) endfunction function unit_setOwner takes unit this_2, player p, boolean changeColor returns nothing call SetUnitOwner(this_2, p, changeColor) endfunction function DummyCaster_createDummyCaster takes integer this_2, real tpos_x, real tpos_y returns unit local unit dummy local integer tempIndex if DummyCaster_customSource[this_2] then set tempIndex = this_2 set dummy = DummyRecycler_get(vec3_toVec2(DummyCaster_customPos[tempIndex], DummyCaster_customPos_2[tempIndex], DummyCaster_customPos_3[tempIndex]), vec3_toVec2_return_y, 0.) else call debugPrint("no custom source", 3) set dummy = DummyRecycler_get(tpos_x, tpos_y, 0.) call debugPrint("new dummy " + unit_getName(dummy), 3) endif call unit_setOwner(dummy, DummyCaster_owner[this_2], false) call unit_unpause(dummy) call debugPrint("AbilId: " + int_toString(DummyCaster_abilityId[this_2]), 3) if not unit_hasAbility(dummy, DummyCaster_abilityId[this_2]) then call unit_addAbility(dummy, DummyCaster_abilityId[this_2]) endif if DummyCaster_AUTO_RESET_MANA_COOLDOWN then call UnitResetCooldown(dummy) call unit_setMana(dummy, 10000.0) endif if DummyCaster_level[this_2] > 1 then call unit_setAbilityLevel(dummy, DummyCaster_abilityId[this_2], DummyCaster_level[this_2]) endif call debugPrint("Dummycaster created", 3) set DummyCaster_createDummyCastertempReturn = dummy set dummy = null return DummyCaster_createDummyCastertempReturn endfunction function dispatch_DummyCaster_createDummyCaster takes integer this_2, real tpos_x, real tpos_y returns unit local unit createDummyCaster_result if DummyCaster_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling DummyCaster.createDummyCaster", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called DummyCaster.createDummyCaster on invalid object.", 0, 0, false) endif endif set createDummyCaster_result = DummyCaster_createDummyCaster(this_2, tpos_x, tpos_y) set dispatch_DummyCaster_createDummyCastertempReturn = createDummyCaster_result set createDummyCaster_result = null return dispatch_DummyCaster_createDummyCastertempReturn endfunction function DummyCaster_onDestroy takes integer this_2 returns nothing endfunction function dealloc_DummyCaster takes integer obj returns nothing if DummyCaster_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type DummyCaster", 0, 0, false) else set DummyCaster_nextFree[DummyCaster_firstFree] = obj set DummyCaster_firstFree = DummyCaster_firstFree + 1 set DummyCaster_typeId[obj] = 0 endif endfunction function destroyDummyCaster takes integer this_2 returns nothing call DummyCaster_onDestroy(this_2) call dealloc_DummyCaster(this_2) endfunction function dispatch_DummyCaster_destroyDummyCaster takes integer this_2 returns nothing if DummyCaster_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling DummyCaster.destroyDummyCaster", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called DummyCaster.destroyDummyCaster on invalid object.", 0, 0, false) endif endif call destroyDummyCaster(this_2) endfunction function hashtable_saveUnitHandle takes hashtable this_2, integer parentKey, integer childKey, unit value returns nothing call SaveUnitHandle(this_2, parentKey, childKey, value) endfunction function Table_saveUnit takes integer this_2, integer parentKey, unit value returns nothing call hashtable_saveUnitHandle(Table_ht, this_2, parentKey, value) endfunction function dispatch_Table_saveUnit takes integer this_2, integer parentKey, unit value returns nothing if Table_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.saveUnit", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.saveUnit on invalid object.", 0, 0, false) endif endif call Table_saveUnit(this_2, parentKey, value) endfunction function handle_getHandleId takes handle this_2 returns integer return GetHandleId(this_2) endfunction function unit_issueTargetOrderById takes unit this_2, integer id, widget target returns boolean return IssueTargetOrderById(this_2, id, target) endfunction function DummyCaster_castOnTarget takes integer this_2, unit target returns boolean local unit dummy local boolean res local timer receiver local timer receiver_2 call debugPrint("cast on target", 3) set dummy = dispatch_DummyCaster_createDummyCaster(this_2, unit_getPos(target), unit_getPos_return_y) call debugPrint("dummy created", 3) if DummyCaster_FORCE_INVISIBLE_CAST then call UnitShareVision(target, DummyCaster_owner[this_2], true) endif set res = unit_issueTargetOrderById(dummy, DummyCaster_orderId[this_2], target) if DummyCaster_FORCE_INVISIBLE_CAST then call UnitShareVision(target, DummyCaster_owner[this_2], false) endif call dispatch_Table_saveUnit(DummyCaster_delayTable, handle_getHandleId(dummy), dummy) set receiver = getTimer() call timer_setData(receiver, handle_getHandleId(dummy)) set receiver_2 = receiver call timer_start(receiver_2, DummyCaster_recycleDelay[this_2], ref_function_closure_impl_3) call debugPrint("recycled", 3) if DummyCaster_autodestroy[this_2] then call dispatch_DummyCaster_destroyDummyCaster(this_2) endif set dummy = null set receiver = null set receiver_2 = null return res endfunction function dispatch_DummyCaster_castOnTarget takes integer this_2, unit target returns boolean local boolean castOnTarget_result if DummyCaster_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling DummyCaster.castOnTarget", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called DummyCaster.castOnTarget on invalid object.", 0, 0, false) endif endif set castOnTarget_result = DummyCaster_castOnTarget(this_2, target) return castOnTarget_result endfunction function unit_addEnsnare takes unit this_2 returns nothing if not unit_isEnsnared(this_2) then call dispatch_DummyCaster_castOnTarget(StatusHandler_ENSNARE_DUMMY_CASTER, this_2) endif set Status_ensnareCounter[Status_status[unit_getIndex(this_2)]] = Status_ensnareCounter[Status_status[unit_getIndex(this_2)]] + 1 endfunction function unit_xIsBoss takes unit this_2 returns boolean return IsUnitType(this_2, UNIT_TYPE_SAPPER) endfunction function BuffNaturesWrath_onApply takes integer this_2 returns nothing local integer receiver call dispatch_Buff_startTimed(this_2, 0.3, 10, true) set receiver = new_StatList() call dispatch_StatList_add(receiver, 14, 80) set BuffNaturesWrath_stats[this_2] = receiver call dispatch_UnitStatBuffer_remove(UnitData_unitStatBuffer[unit_xGetUnitData(dispatch_Buff_getUnit(this_2))], BuffNaturesWrath_stats[this_2]) if unit_xHasTalent(BuffNaturesWrath_caster[this_2], TalentList_TALENT_DRUID_WRATH_ENTANGLE) and ( not unit_xIsBoss(dispatch_Buff_getUnit(this_2))) then set BuffNaturesWrath_entangleEnsnare[this_2] = true call unit_addEnsnare(dispatch_Buff_getUnit(this_2)) endif endfunction function BuffRejuvenation_onApply takes integer this_2 returns nothing local real timePerTick = 1.5 local integer ticks = 4 set BuffRejuvenation_healPerTick[this_2] = dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(BuffRejuvenation_caster[this_2])], 6) * 3. / ticks if unit_xHasTalent(BuffRejuvenation_caster[this_2], TalentList_TALENT_DRUID_REJU_TICK) then set ticks = ticks + 1 endif set BuffRejuvenation_sfx1[this_2] = unit_addEffect(dispatch_Buff_getUnit(this_2), "Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl", "chest") call dispatch_Buff_startTimed(this_2, timePerTick, ticks, true) endfunction function BuffShieldSlamTaunt_onApply takes integer this_2 returns nothing call modifyThreat(BuffShieldSlamTaunt_caster[this_2], dispatch_Buff_getUnit(this_2), 99999., true) call dispatch_Buff_destroyAfter(this_2, 4.) endfunction function BuffShield_onApply takes integer this_2 returns nothing local integer armorbonus = R2I(1. + dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(BuffShield_caster[this_2])], 6) * 0.15) local integer receiver = new_StatList() call dispatch_StatList_add(receiver, 12, armorbonus) set BuffShield_stats[this_2] = receiver if unit_xHasTalent(BuffShield_caster[this_2], TalentList_TALENT_PRIEST_SHIELD_HEALREC) then call dispatch_StatList_add(BuffShield_stats[this_2], 19, 10) endif call dispatch_UnitStatBuffer_apply(UnitData_unitStatBuffer[unit_xGetUnitData(dispatch_Buff_getUnit(this_2))], BuffShield_stats[this_2]) set BuffShield_sfx1[this_2] = unit_addEffect(dispatch_Buff_getUnit(this_2), "Abilities\\Spells\\Human\\InnerFire\\InnerFireTarget.mdl", "overhead") call dispatch_Buff_destroyAfter(this_2, 20.) endfunction function addEffect takes string path, real pos_x, real pos_y returns effect return AddSpecialEffect(path, pos_x, pos_y) endfunction function BuffTrapOwner_onApply takes integer this_2 returns nothing local integer temp = this_2 local integer tempIndex = this_2 set BuffTrapOwner_sfx1[temp] = addEffect("units\\creeps\\GoblinLandMine\\GoblinLandMine.mdl", BuffTrapOwner_pos[tempIndex], BuffTrapOwner_pos_2[tempIndex]) call dispatch_Buff_destroyAfter(this_2, SpellTrap_TRAP_DURATION) endfunction function BuffTrapTarget_onApply takes integer this_2 returns nothing call dispatch_Buff_destroyAfter(this_2, SpellTrap_ENSNARE_DURATION) call unit_addEnsnare(dispatch_Buff_getUnit(this_2)) set BuffTrapTarget_sfxNet[this_2] = unit_addEffect(dispatch_Buff_getUnit(this_2), "Abilities\\Spells\\Orc\\Ensnare\\ensnareTarget.mdl", "origin") if unit_xHasTalent(BuffTrapTarget_caster[this_2], TalentList_TALENT_RANGER_TRAP_POISON) then call effect_destr(unit_addEffect(dispatch_Buff_getUnit(this_2), "Abilities\\Spells\\Other\\Cleave\\CleaveDamageTarget.mdl", "overhead")) call cyc_unitDamageTarget(0, BuffTrapTarget_caster[this_2], dispatch_Buff_getUnit(this_2), dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(BuffTrapTarget_caster[this_2])], 5) * 2., 3, false) endif endfunction function Buff_onApply takes integer this_2 returns nothing endfunction function dispatch_Buff_onApply takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.onApply", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.onApply on invalid object.", 0, 0, false) endif endif if Buff_typeId[this_2] <= 740 then if Buff_typeId[this_2] <= 738 then if Buff_typeId[this_2] <= 737 then if Buff_typeId[this_2] <= 736 then call Buff_onApply(this_2) else call BuffNaturesWrath_onApply(this_2) endif else call BuffFirearrow_onApply(this_2) endif elseif Buff_typeId[this_2] <= 739 then call BuffShieldSlamTaunt_onApply(this_2) else call BuffShield_onApply(this_2) endif elseif Buff_typeId[this_2] <= 742 then if Buff_typeId[this_2] <= 741 then call BuffRejuvenation_onApply(this_2) else call BuffTrapOwner_onApply(this_2) endif elseif Buff_typeId[this_2] <= 743 then call BuffIgnoreThePain_onApply(this_2) else call BuffTrapTarget_onApply(this_2) endif endfunction function Buff_applyReapply takes integer this_2, unit target returns nothing if target != null then set Buff_parent[this_2] = unit_getBuffList(target) if dispatch_Buff_checkApply(this_2) then call dispatch_BuffList_addBuff(Buff_parent[this_2], this_2) call dispatch_Buff_addBuffIcon(this_2) call dispatch_Buff_onApply(this_2) endif endif endfunction function dispatch_Buff_applyReapply takes integer this_2, unit target returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.applyReapply", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.applyReapply on invalid object.", 0, 0, false) endif endif call Buff_applyReapply(this_2, target) endfunction function Buff_apply takes integer this_2, unit target returns nothing call dispatch_Buff_applyRemove(this_2, target) call dispatch_Buff_applyReapply(this_2, target) endfunction function dispatch_Buff_apply takes integer this_2, unit target returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.apply", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.apply on invalid object.", 0, 0, false) endif endif call Buff_apply(this_2, target) endfunction function alloc_BuffNaturesWrath takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 737 return this_2 endfunction function BuffCustomMembers_initCustomMembers takes integer this_2 returns nothing endfunction function dispatch_Buff_initCustomMembers takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.initCustomMembers", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.initCustomMembers on invalid object.", 0, 0, false) endif endif call BuffCustomMembers_initCustomMembers(this_2) endfunction function Buff_onCreate takes integer this_2 returns nothing endfunction function dispatch_Buff_onCreate takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Buff.onCreate", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Buff.onCreate on invalid object.", 0, 0, false) endif endif call Buff_onCreate(this_2) endfunction function construct_Buff takes integer this_2 returns nothing set Buff_parent[this_2] = 0 call dispatch_Buff_initCustomMembers(this_2) call dispatch_Buff_onCreate(this_2) endfunction function construct_BuffNaturesWrath takes integer this_2, unit caster returns nothing call construct_Buff(this_2) set BuffNaturesWrath_caster[this_2] = caster set BuffNaturesWrath_entangleEnsnare[this_2] = false endfunction function new_BuffNaturesWrath takes unit caster returns integer local integer this_2 = alloc_BuffNaturesWrath() call construct_BuffNaturesWrath(this_2, caster) return this_2 endfunction function unit_xGetStat takes unit this_2, integer s returns integer return dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(this_2)], s) endfunction function SpellNaturesWrath_onChannelEnd takes integer this_2, boolean success returns nothing local real dmgMod if success then set dmgMod = 1. if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_DRUID_WRATH_ENTANGLE) and unit_xIsBoss(Spell_targetUnit[this_2]) then set dmgMod = 1.2 endif call cyc_unitDamageTarget(0, Spell_caster[this_2], Spell_targetUnit[this_2], unit_xGetStat(Spell_caster[this_2], 6) * 3. * dmgMod, 1, false) call dispatch_Buff_apply(new_BuffNaturesWrath(Spell_caster[this_2]), Spell_targetUnit[this_2]) endif endfunction function alloc_BuffTrapOwner takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 742 return this_2 endfunction function construct_BuffTrapOwner takes integer this_2, real pos_x, real pos_y returns nothing local integer tempIndex call construct_Buff(this_2) set tempIndex = this_2 set BuffTrapOwner_pos[tempIndex] = pos_x set BuffTrapOwner_pos_2[tempIndex] = pos_y endfunction function new_BuffTrapOwner takes real pos_x, real pos_y returns integer local integer this_2 = alloc_BuffTrapOwner() call construct_BuffTrapOwner(this_2, pos_x, pos_y) return this_2 endfunction function SpellTrap_onChannelEnd takes integer this_2, boolean success returns nothing local integer tempIndex if success then set tempIndex = this_2 call dispatch_Buff_apply(new_BuffTrapOwner(Spell_targetPoint[tempIndex], Spell_targetPoint_2[tempIndex]), Spell_caster[this_2]) call unit_removeAbility(Spell_caster[this_2], SpellTrap_SPELL_RAW) call unit_addAbility(Spell_caster[this_2], SpellTrap_SPELL_RAW) call unit_setAbilityLevel(Spell_caster[this_2], SpellTrap_SPELL_RAW, 2) endif endfunction function Spell_onChannelEnd takes integer this_2, boolean success returns nothing endfunction function dispatch_Spell_onChannelEnd takes integer this_2, boolean success returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Spell.onChannelEnd", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Spell.onChannelEnd on invalid object.", 0, 0, false) endif endif if Spell_typeId[this_2] <= 718 then if Spell_typeId[this_2] <= 714 then if Spell_typeId[this_2] <= 713 then call Spell_onChannelEnd(this_2, success) else call SpellTrap_onChannelEnd(this_2, success) endif elseif Spell_typeId[this_2] <= 715 then call SpellNaturesWrath_onChannelEnd(this_2, success) else call Spell_onChannelEnd(this_2, success) endif elseif Spell_typeId[this_2] <= 720 then if Spell_typeId[this_2] <= 719 then call SpellHeal_onChannelEnd(this_2, success) else call SpellHolyBolt_onChannelEnd(this_2, success) endif else call Spell_onChannelEnd(this_2, success) endif endfunction function trigger_destr takes trigger this_2 returns nothing call DestroyTrigger(this_2) endfunction function unitToIndex takes unit object returns integer return handle_getHandleId(object) endfunction function ChannelData_finishChannel takes integer this_2, boolean success returns nothing call dispatch_HashMap_remove(SpellHandler_channelDataMap, unitToIndex(ChannelData_caster[this_2])) call trigger_destr(ChannelData_interruptTrigger[this_2]) call timer_release(ChannelData_channelTimer[this_2]) call dispatch_CastBar_destroyCastBar(ChannelData_bar[this_2]) call IssueImmediateOrder(ChannelData_caster[this_2], "stop") set Spell_autoDestroy[ChannelData_parent[this_2]] = true call dispatch_Spell_onChannelEnd(ChannelData_parent[this_2], success) if Spell_autoDestroy[ChannelData_parent[this_2]] then call dispatch_Spell_destroySpell(ChannelData_parent[this_2]) endif call dispatch_ChannelData_destroyChannelData(this_2) endfunction function dispatch_ChannelData_finishChannel takes integer this_2, boolean success returns nothing if ChannelData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ChannelData.finishChannel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ChannelData.finishChannel on invalid object.", 0, 0, false) endif endif call ChannelData_finishChannel(this_2, success) endfunction function alloc_MissileHolyBolt takes nothing returns integer local integer this_2 if Missile_firstFree == 0 then set Missile_maxIndex = Missile_maxIndex + 1 set this_2 = Missile_maxIndex else set Missile_firstFree = Missile_firstFree - 1 set this_2 = Missile_nextFree[Missile_firstFree] endif set Missile_typeId[this_2] = 763 return this_2 endfunction function Periodic_startPeriodic takes integer this_2, real time returns nothing set Periodic_t[this_2] = getTimer() call timer_setData(Periodic_t[this_2], this_2) call TimerStart(Periodic_t[this_2], time, true, ref_function_Periodic_timerCallback) endfunction function dispatch_Missile_startPeriodic takes integer this_2, real time returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.startPeriodic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.startPeriodic on invalid object.", 0, 0, false) endif endif call Periodic_startPeriodic(this_2, time) endfunction function unit_setFacing takes unit this_2, real a_radians returns nothing call SetUnitFacing(this_2, angle_degrees(a_radians)) endfunction function Fx_setXYAngle takes integer this_2, real value_radians returns nothing call unit_setFacing(Fx_dummy[this_2], value_radians) endfunction function dispatch_Fx_setXYAngle takes integer this_2, real value_radians returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setXYAngle", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setXYAngle on invalid object.", 0, 0, false) endif endif call Fx_setXYAngle(this_2, value_radians) endfunction function vec3_lengthXY takes real this_x, real this_y, real this_z returns real return SquareRoot(this_x * this_x + this_y * this_y) endfunction function vec3_op_minus takes real this_x, real this_y, real this_z, real v_x, real v_y, real v_z returns real set vec3_op_minus_return_x = this_x - v_x set vec3_op_minus_return_y = this_y - v_y set vec3_op_minus_return_z = this_z - v_z return vec3_op_minus_return_x endfunction function Missile_updateTargetPos takes integer this_2 returns nothing local integer tempIndex = this_2 local real temp = Missile_targetPos[tempIndex] local real temp_2 = Missile_targetPos_2[tempIndex] local real temp_3 = Missile_targetPos_3[tempIndex] local integer tempIndex_2 = this_2 local real temp_del_x = vec3_op_minus(temp, temp_2, temp_3, Missile_missilePos[tempIndex_2], Missile_missilePos_2[tempIndex_2], Missile_missilePos_3[tempIndex_2]) local real temp_del_y = vec3_op_minus_return_y local real temp_del_z = vec3_op_minus_return_z local real del_x = temp_del_x local real del_y = temp_del_y local real del_z = temp_del_z local real dist = vec3_lengthXY(del_x, del_y, del_z) local real a = Atan2(del_y, del_x) local integer tempIndex_3 local integer tempIndex_4 local integer tempIndex_5 local real tempTupleSelectionResult_3 local real temp_tempTupleSelectionResult_3 local integer tempIndex_6 local real tempTupleSelectionResult_3_2 local real temp_tempTupleSelectionResult_3_2 local integer tempIndex_7 local real tempTupleSelectionResult_3_3 local real temp_tempTupleSelectionResult_3_3 local real temp_4 local real temp_5 local integer temp_6 if dist > 0. then set Missile_time[this_2] = dist / Missile_missileVelXY[this_2] * Missile_TIMER_TIMEOUT else set Missile_time[this_2] = Missile_TIMER_TIMEOUT endif set tempIndex_3 = this_2 set Missile_missileVel[tempIndex_3] = Cos(a) * Missile_missileVelXY[this_2] set tempIndex_4 = this_2 set Missile_missileVel_2[tempIndex_4] = Sin(a) * Missile_missileVelXY[this_2] call dispatch_Fx_setXYAngle(Missile_fx[this_2], a) set temp_6 = this_2 set tempIndex_5 = this_2 set temp_tempTupleSelectionResult_3 = Missile_targetPos_3[tempIndex_5] set tempTupleSelectionResult_3 = temp_tempTupleSelectionResult_3 set temp_4 = tempTupleSelectionResult_3 set tempIndex_6 = this_2 set temp_tempTupleSelectionResult_3_2 = Missile_missilePos_3[tempIndex_6] set tempTupleSelectionResult_3_2 = temp_tempTupleSelectionResult_3_2 set temp_5 = (temp_4 - tempTupleSelectionResult_3_2) / Missile_time[this_2] / Missile_time[this_2] * Missile_TIMER_TIMEOUT * Missile_TIMER_TIMEOUT set tempIndex_7 = this_2 set temp_tempTupleSelectionResult_3_3 = Missile_missileVel_3[tempIndex_7] set tempTupleSelectionResult_3_3 = temp_tempTupleSelectionResult_3_3 set Missile_missileAccZ[temp_6] = 2. * (temp_5 - tempTupleSelectionResult_3_3 * Missile_TIMER_TIMEOUT / Missile_time[this_2]) endfunction function dispatch_Missile_updateTargetPos takes integer this_2 returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.updateTargetPos", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.updateTargetPos on invalid object.", 0, 0, false) endif endif call Missile_updateTargetPos(this_2) endfunction function getTerrainZ takes real x, real y returns real call MoveLocation(Terrain_tempLoc, x, y) return GetLocationZ(Terrain_tempLoc) endfunction function unit_setFlyHeight takes unit this_2, real height, real rate returns nothing call SetUnitFlyHeight(this_2, height, rate) endfunction function Fx_setZ takes integer this_2, real z returns nothing call unit_setFlyHeight(Fx_dummy[this_2], z, 0.) endfunction function dispatch_Fx_setZ takes integer this_2, real z returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setZ", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setZ on invalid object.", 0, 0, false) endif endif call Fx_setZ(this_2, z) endfunction function construct_Fx5 takes integer this_2, real pos_x, real pos_y, real pos_z, real facing_radians, string fxpath returns nothing set Fx_dummy[this_2] = null set Fx_fx[this_2] = null set Fx_dummy[this_2] = DummyRecycler_get(vec3_toVec2(pos_x, pos_y, pos_z), vec3_toVec2_return_y, facing_radians) call dispatch_Fx_setZ(this_2, pos_z) call dispatch_Fx_setFx(this_2, fxpath) endfunction function new_Fx_2 takes real pos_x, real pos_y, real pos_z, real facing_radians, string fxpath returns integer local integer this_2 = alloc_Fx() call construct_Fx5(this_2, pos_x, pos_y, pos_z, facing_radians, fxpath) return this_2 endfunction function vec3_op_plus takes real this_x, real this_y, real this_z, real v_x, real v_y, real v_z returns real set vec3_op_plus_return_x = this_x + v_x set vec3_op_plus_return_y = this_y + v_y set vec3_op_plus_return_z = this_z + v_z return vec3_op_plus_return_x endfunction function Missile_launch takes integer this_2, real mPos_x, real mPos_y, real mPos_z, real tPos_x, real tPos_y, real tPos_z, real speed, real arc, string model returns nothing local real del_x local real del_y local real del_z local real dist local real ang local integer tempIndex local integer tempIndex_2 local integer tempIndex_3 local integer tempIndex_4 local real temp_del_x local real temp_del_y local real temp_del_z local integer tempIndex_5 local integer tempIndex_6 local real temp local real temp_2 local real temp_3 local integer temp_4 set Missile_alive[this_2] = true set tempIndex = this_2 set Missile_missilePos[tempIndex] = mPos_x set Missile_missilePos_2[tempIndex] = mPos_y set Missile_missilePos_3[tempIndex] = mPos_z set tempIndex_2 = this_2 set Missile_targetPos[tempIndex_2] = vec3_op_plus(tPos_x, tPos_y, tPos_z, 0., 0., getTerrainZ(tPos_x, tPos_y)) set Missile_targetPos_2[tempIndex_2] = vec3_op_plus_return_y set Missile_targetPos_3[tempIndex_2] = vec3_op_plus_return_z set tempIndex_3 = this_2 set temp = Missile_targetPos[tempIndex_3] set temp_2 = Missile_targetPos_2[tempIndex_3] set temp_3 = Missile_targetPos_3[tempIndex_3] set tempIndex_4 = this_2 set temp_del_x = vec3_op_minus(temp, temp_2, temp_3, Missile_missilePos[tempIndex_4], Missile_missilePos_2[tempIndex_4], Missile_missilePos_3[tempIndex_4]) set temp_del_y = vec3_op_minus_return_y set temp_del_z = vec3_op_minus_return_z set del_x = temp_del_x set del_y = temp_del_y set del_z = temp_del_z set dist = vec3_lengthXY(del_x, del_y, del_z) set Missile_missileVelXY[this_2] = speed * Missile_TIMER_TIMEOUT if dist > 0. then set Missile_time[this_2] = dist / speed else set Missile_time[this_2] = Missile_TIMER_TIMEOUT endif set tempIndex_5 = this_2 set Missile_missileVel_3[tempIndex_5] = (dist * arc / (Missile_time[this_2] * 0.25) + del_z / Missile_time[this_2]) * Missile_TIMER_TIMEOUT set ang = Atan2(del_y, del_x) if ang < 0. then set ang = ang + 2. * Maths_PI endif set temp_4 = this_2 set tempIndex_6 = this_2 set Missile_fx[temp_4] = new_Fx_2(Missile_missilePos[tempIndex_6], Missile_missilePos_2[tempIndex_6], Missile_missilePos_3[tempIndex_6], ang, model) call dispatch_Missile_updateTargetPos(this_2) call dispatch_Missile_startPeriodic(this_2, Missile_TIMER_TIMEOUT) endfunction function dispatch_Missile_launch takes integer this_2, real mPos_x, real mPos_y, real mPos_z, real tPos_x, real tPos_y, real tPos_z, real speed, real arc, string model returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.launch", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.launch on invalid object.", 0, 0, false) endif endif call Missile_launch(this_2, mPos_x, mPos_y, mPos_z, tPos_x, tPos_y, tPos_z, speed, arc, model) endfunction function unit_getFlyHeight takes unit this_2 returns real return GetUnitFlyHeight(this_2) endfunction function unit_getPos3 takes unit this_2, real tZ returns real set unit_getPos3_return_x = unit_getX(this_2) set unit_getPos3_return_y = unit_getY(this_2) set unit_getPos3_return_z = unit_getFlyHeight(this_2) + tZ return unit_getPos3_return_x endfunction function construct_Missile2 takes integer this_2, real startPos_x, real startPos_y, real startPos_z, real speed, real arc, string model, unit targetUnit, real targetZOffset returns nothing local integer tempIndex set Missile_missileVelXY[this_2] = 1. set tempIndex = this_2 set Missile_targetPos[tempIndex] = 0. set Missile_targetPos_2[tempIndex] = 0. set Missile_targetPos_3[tempIndex] = 0. set Missile_targetUnit[this_2] = null set Missile_targetUnitZOffset[this_2] = 0. set Missile_collisionSize[this_2] = 0. set Missile_targetUnit[this_2] = targetUnit set Missile_targetUnitZOffset[this_2] = targetZOffset call dispatch_Missile_launch(this_2, startPos_x, startPos_y, startPos_z, unit_getPos3(targetUnit, targetZOffset), unit_getPos3_return_y, unit_getPos3_return_z, speed, arc, model) endfunction function vec2_withRealZ takes real this_x, real this_y, unit u returns real set vec2_withRealZ_return_x = this_x set vec2_withRealZ_return_y = this_y set vec2_withRealZ_return_z = getTerrainZ(this_x, this_y) + unit_getFlyHeight(u) return vec2_withRealZ_return_x endfunction function unit_getPos3_2 takes unit this_2 returns real set unit_getPos3_return_x_2 = vec2_withRealZ(unit_getX(this_2), unit_getY(this_2), this_2) set unit_getPos3_return_y_2 = vec2_withRealZ_return_y set unit_getPos3_return_z_2 = vec2_withRealZ_return_z return unit_getPos3_return_x_2 endfunction function construct_MissileHolyBolt takes integer this_2, unit caster, unit missileStart, unit target, real mult returns nothing call construct_Missile2(this_2, unit_getPos3_2(missileStart), unit_getPos3_return_y_2, unit_getPos3_return_z_2, 1300., 0.1, "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl", target, 0.) set MissileHolyBolt_casterUnit[this_2] = caster set MissileHolyBolt_targetUnit[this_2] = target set MissileHolyBolt_mult[this_2] = mult endfunction function new_MissileHolyBolt takes unit caster, unit missileStart, unit target, real mult returns integer local integer this_2 = alloc_MissileHolyBolt() call construct_MissileHolyBolt(this_2, caster, missileStart, target, mult) return this_2 endfunction function player_isAllyOf takes player this_2, player p returns boolean return IsPlayerAlly(this_2, p) endfunction function unit_xIsAlive takes unit this_2 returns boolean return ( not IsUnitType(this_2, UNIT_TYPE_DEAD)) and GetUnitTypeId(this_2) != 0 endfunction function SpellHolyBolt_onChannel takes integer this_2, integer n, integer nmax returns nothing local unit minU = null local real minHp = 2. local group wurst__iterator0 local unit u local real thisHp local unit oldTarget call group_clear(TempGroups_ENUM_GROUP) call group_enumUnitsInRange(TempGroups_ENUM_GROUP, unit_getPos(Spell_targetUnit[this_2]), unit_getPos_return_y, 600) set wurst__iterator0 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator0) set u = group_next(wurst__iterator0) if unit_xIsAlive(u) and player_isAllyOf(unit_getOwner(u), unit_getOwner(Spell_caster[this_2])) and u != SpellHolyBolt_currentTarget[this_2] then set thisHp = unit_getHP(u) / unit_getMaxHP(u) if thisHp < minHp then set minU = u set minHp = thisHp endif endif endloop call group_close(wurst__iterator0) if minU != null then set oldTarget = SpellHolyBolt_currentTarget[this_2] set SpellHolyBolt_currentTarget[this_2] = minU call new_MissileHolyBolt(Spell_caster[this_2], oldTarget, SpellHolyBolt_currentTarget[this_2], 1.) endif set minU = null set wurst__iterator0 = null set u = null set oldTarget = null endfunction function Spell_onChannel takes integer this_2, integer current, integer max_2 returns nothing endfunction function dispatch_Spell_onChannel takes integer this_2, integer current, integer max_2 returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Spell.onChannel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Spell.onChannel on invalid object.", 0, 0, false) endif endif if Spell_typeId[this_2] <= 720 then if Spell_typeId[this_2] <= 719 then call Spell_onChannel(this_2, current, max_2) else call SpellHolyBolt_onChannel(this_2, current, max_2) endif else call Spell_onChannel(this_2, current, max_2) endif endfunction function ChannelData_callback takes nothing returns nothing local integer obj = timer_getData(GetExpiredTimer()) if ChannelData_stepMax[obj] == 0 then call dispatch_ChannelData_finishChannel(obj, true) else set ChannelData_stepCurrent[obj] = ChannelData_stepCurrent[obj] + 1 call dispatch_Spell_onChannel(ChannelData_parent[obj], ChannelData_stepCurrent[obj], ChannelData_stepMax[obj]) if ChannelData_stepCurrent[obj] >= ChannelData_stepMax[obj] then call dispatch_ChannelData_finishChannel(obj, true) endif endif endfunction function ChannelData_invokeInterrupt takes nothing returns boolean call dispatch_ChannelData_finishChannel(dispatch_HashMap_get(SpellHandler_channelDataMap, unitToIndex(GetTriggerUnit())), false) return false endfunction function ArrayQueue_units_set takes integer instanceId, integer arrayIndex, unit value returns nothing if arrayIndex < 0 or arrayIndex >= 6 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Index out of Bounds", 0, 0, false) elseif arrayIndex <= 2 then if arrayIndex <= 1 then if arrayIndex <= 0 then set ArrayQueue_units_0[instanceId] = value else set ArrayQueue_units_1[instanceId] = value endif else set ArrayQueue_units_2[instanceId] = value endif elseif arrayIndex <= 4 then if arrayIndex <= 3 then set ArrayQueue_units_3[instanceId] = value else set ArrayQueue_units_4[instanceId] = value endif else set ArrayQueue_units_5[instanceId] = value endif endfunction function ArrayQueue_enqueue takes integer this_2, unit u returns nothing if ArrayQueue_size[this_2] < NewDummyRecycler_SAVED_UNITS_PER_ANGLE then set ArrayQueue_size[this_2] = ArrayQueue_size[this_2] + 1 set ArrayQueue_rp[this_2] = ModuloInteger(ArrayQueue_rp[this_2] + 1, NewDummyRecycler_SAVED_UNITS_PER_ANGLE) call ArrayQueue_units_set(this_2, ArrayQueue_rp[this_2], u) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Queue Overflow", 0, 0, false) endif endfunction function dispatch_ArrayQueue_enqueue takes integer this_2, unit u returns nothing if ArrayQueue_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ArrayQueue.enqueue", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ArrayQueue.enqueue on invalid object.", 0, 0, false) endif endif call ArrayQueue_enqueue(this_2, u) endfunction function unit_pause takes unit this_2 returns nothing call PauseUnit(this_2, true) endfunction function unit_setFacing_2 takes unit this_2, real deg returns nothing call SetUnitFacing(this_2, deg) endfunction function DummyRecycler_recycle_2 takes unit u returns nothing local integer smallestQueue = 0 local integer i = 1 local integer temp = NewDummyRecycler_DIFFERENT_ANGLES - 1 local unit receiver local unit receiver_2 local unit receiver_3 loop exitwhen i > temp if ArrayQueue_size[DummyRecycler_angleQueues[smallestQueue]] > ArrayQueue_size[DummyRecycler_angleQueues[i]] then set smallestQueue = i endif set i = i + 1 endloop if ArrayQueue_size[DummyRecycler_angleQueues[smallestQueue]] >= NewDummyRecycler_SAVED_UNITS_PER_ANGLE then call unit_remove(u) else call dispatch_ArrayQueue_enqueue(DummyRecycler_angleQueues[smallestQueue], u) set receiver = u call unit_setXY(receiver, MapBounds_boundMax_x, MapBounds_boundMax_y) set receiver_2 = receiver call unit_pause(receiver_2) set receiver_3 = receiver_2 call unit_setFacing_2(receiver_3, smallestQueue * NewDummyRecycler_ANGLE_DEGREE) endif set receiver = null set receiver_2 = null set receiver_3 = null endfunction function DelayNode_onDestroy takes integer this_2 returns nothing endfunction function dealloc_DelayNode takes integer obj returns nothing if DelayNode_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type DelayNode", 0, 0, false) else set DelayNode_nextFree[DelayNode_firstFree] = obj set DelayNode_firstFree = DelayNode_firstFree + 1 set DelayNode_typeId[obj] = 0 endif endfunction function destroyDelayNode takes integer this_2 returns nothing call DelayNode_onDestroy(this_2) call dealloc_DelayNode(this_2) endfunction function dispatch_DelayNode_destroyDelayNode takes integer this_2 returns nothing if DelayNode_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling DelayNode.destroyDelayNode", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called DelayNode.destroyDelayNode on invalid object.", 0, 0, false) endif endif call destroyDelayNode(this_2) endfunction function DelayNode_recycle takes nothing returns nothing local integer tmp call DummyRecycler_recycle_2(DelayNode_u[DelayNode_first]) set tmp = DelayNode_first if DelayNode_next[DelayNode_first] == 0 then set DelayNode_first = 0 endif if DelayNode_next[DelayNode_first] != 0 then set DelayNode_first = DelayNode_next[DelayNode_first] call timer_start(DelayNode_t, DelayNode_delayTime[DelayNode_first] - getElapsedGameTime(), ref_function_DelayNode_recycle) else set DelayNode_first = 0 endif call dispatch_DelayNode_destroyDelayNode(tmp) endfunction function DummyCaster_filterAOE takes nothing returns boolean local unit u = GetFilterUnit() if IsUnitInRangeXY(u, DummyCaster_aoex, DummyCaster_aoey, DummyCaster_aoeradius) then call dispatch_DummyCaster_castOnTarget(DummyCaster_cinstance, u) endif set u = null return false endfunction function Periodic_stopPeriodic takes integer this_2 returns nothing call timer_release(Periodic_t_2[this_2]) set Periodic_t_2[this_2] = null endfunction function dispatch_Knockback_stopPeriodic takes integer this_2 returns nothing if Knockback_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Knockback.stopPeriodic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Knockback.stopPeriodic on invalid object.", 0, 0, false) endif endif call Periodic_stopPeriodic(this_2) endfunction function Knockback_onDestroy takes integer this_2 returns nothing if Knockback_sfx[this_2] != null then call effect_destr(Knockback_sfx[this_2]) endif if Knockback_collisionUnits[this_2] != 0 then call dispatch_LinkedList_destroyLinkedList(Knockback_collisionUnits[this_2]) set Knockback_collisionUnits[this_2] = 0 endif call dispatch_Knockback_stopPeriodic(this_2) endfunction function dealloc_Knockback takes integer obj returns nothing if Knockback_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type Knockback", 0, 0, false) else set Knockback_nextFree[Knockback_firstFree] = obj set Knockback_firstFree = Knockback_firstFree + 1 set Knockback_typeId[obj] = 0 endif endfunction function destroyKnockback takes integer this_2 returns nothing call Knockback_onDestroy(this_2) call dealloc_Knockback(this_2) endfunction function dispatch_Knockback_destroyKnockback takes integer this_2 returns nothing if Knockback_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Knockback.destroyKnockback", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Knockback.destroyKnockback on invalid object.", 0, 0, false) endif endif call destroyKnockback(this_2) endfunction function LinkedList_contains takes integer this_2, integer elem returns boolean local integer r = LLEntry_next[LinkedList_dummy[this_2]] loop exitwhen not (r != LinkedList_dummy[this_2]) if LLEntry_elem[r] == elem then return true endif set r = LLEntry_next[r] endloop return false endfunction function dispatch_LinkedList_contains takes integer this_2, integer elem returns boolean local boolean contains_result if LinkedList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling LinkedList.contains", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called LinkedList.contains on invalid object.", 0, 0, false) endif endif set contains_result = LinkedList_contains(this_2, elem) return contains_result endfunction function alloc_Knockback takes nothing returns integer local integer this_2 if Knockback_firstFree == 0 then set Knockback_maxIndex = Knockback_maxIndex + 1 set this_2 = Knockback_maxIndex else set Knockback_firstFree = Knockback_firstFree - 1 set this_2 = Knockback_nextFree[Knockback_firstFree] endif set Knockback_typeId[this_2] = 766 return this_2 endfunction function Periodic_startPeriodic_2 takes integer this_2, real time returns nothing set Periodic_t_2[this_2] = getTimer() call timer_setData(Periodic_t_2[this_2], this_2) call TimerStart(Periodic_t_2[this_2], time, true, ref_function_Periodic_timerCallback_2) endfunction function dispatch_Knockback_startPeriodic takes integer this_2, real time returns nothing if Knockback_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Knockback.startPeriodic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Knockback.startPeriodic on invalid object.", 0, 0, false) endif endif call Periodic_startPeriodic_2(this_2, time) endfunction function isTerrainLand takes real x, real y returns boolean return IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) endfunction function isTerrainShallowWater takes real x, real y returns boolean return ( not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY)) and ( not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)) and IsTerrainPathable(x, y, PATHING_TYPE_BUILDABILITY) endfunction function vec2_length takes real this_x, real this_y returns real return SquareRoot(this_x * this_x + this_y * this_y) endfunction function vec2_norm takes real this_x, real this_y returns real local real len = vec2_length(this_x, this_y) local real x = 0. local real y = 0. if len != 0.0 then set x = this_x / len set y = this_y / len endif set vec2_norm_return_x = x set vec2_norm_return_y = y return vec2_norm_return_x endfunction function vec2_op_mult takes real this_x, real this_y, real factor returns real set vec2_op_mult_return_x = this_x * factor set vec2_op_mult_return_y = this_y * factor return vec2_op_mult_return_x endfunction function construct_Knockback takes integer this_2, unit u, real moveVec_x, real moveVec_y, real time, boolean useEffects, boolean stopImpassable returns nothing local real speed = 2. * vec2_length(moveVec_x, moveVec_y) / (time / Basics_ANIMATION_PERIOD + 1.) local real acceleration = speed / (time / Basics_ANIMATION_PERIOD) local real temp_dir_x = vec2_norm(moveVec_x, moveVec_y) local real temp_dir_y = vec2_norm_return_y local real dir_x = temp_dir_x local real dir_y = temp_dir_y local integer tempIndex local integer tempIndex_2 set Knockback_u[this_2] = u set tempIndex = this_2 set Knockback_acc[tempIndex] = vec2_op_mult(dir_x, dir_y, acceleration) set Knockback_acc_2[tempIndex] = vec2_op_mult_return_y set tempIndex_2 = this_2 set Knockback_vel[tempIndex_2] = vec2_op_mult(dir_x, dir_y, speed) set Knockback_vel_2[tempIndex_2] = vec2_op_mult_return_y set Knockback_steps[this_2] = real_toInt(time / Basics_ANIMATION_PERIOD) set Knockback_useEffects[this_2] = useEffects set Knockback_stopImpassable[this_2] = stopImpassable set Knockback_collisionAction[this_2] = 0 if useEffects then if isTerrainLand(unit_getX(u), unit_getY(u)) then set Knockback_sfx[this_2] = unit_addEffect(u, KnockbackHandler_SFX_EARTH, KnockbackHandler_SFX_ATTACHPOINT) set Knockback_sfxCurr[this_2] = 1 elseif isTerrainShallowWater(unit_getX(u), unit_getY(u)) then set Knockback_sfx[this_2] = unit_addEffect(u, KnockbackHandler_SFX_WATER, KnockbackHandler_SFX_ATTACHPOINT) set Knockback_sfxCurr[this_2] = 2 endif endif call dispatch_Knockback_startPeriodic(this_2, Basics_ANIMATION_PERIOD) endfunction function new_Knockback takes unit u, real moveVec_x, real moveVec_y, real time, boolean useEffects, boolean stopImpassable returns integer local integer this_2 = alloc_Knockback() call construct_Knockback(this_2, u, moveVec_x, moveVec_y, time, useEffects, stopImpassable) return this_2 endfunction function unit_xIsCombatUnit takes unit this_2 returns boolean return unit_xGetUnitData(this_2) != 0 endfunction function vec2_op_minus takes real this_x, real this_y, real v_x, real v_y returns real set vec2_op_minus_return_x = this_x - v_x set vec2_op_minus_return_y = this_y - v_y return vec2_op_minus_return_x endfunction function closure_impl_15 takes integer this_2, unit u, unit t returns nothing local real damage if unit_xIsCombatUnit(t) and ( not unit_xIsBoss(t)) then call new_Knockback(t, vec2_op_mult(vec2_norm(vec2_op_minus(unit_getPos(t), unit_getPos_return_y, unit_getPos(u), unit_getPos_return_y), vec2_op_minus_return_y), vec2_norm_return_y, 200.), vec2_op_mult_return_y, 0.2, false, true) set damage = dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(Spell_caster[this[this_2]])], 4) * 1. call cyc_unitDamageTarget(0, u, t, damage, 0, false) if unit_xHasTalent(Spell_caster[this[this_2]], TalentList_TALENT_WARRIOR_CHARGE_THREAT) then call modifyThreat(Spell_caster[this[this_2]], Spell_targetUnit[this[this_2]], 5. + damage, true) endif endif endfunction function dispatch_UnitCollision_onCollide takes integer this_2, unit knockbackUnit, unit hitUnit returns nothing if UnitCollision_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitCollision.onCollide", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitCollision.onCollide on invalid object.", 0, 0, false) endif endif call closure_impl_15(this_2, knockbackUnit, hitUnit) endfunction function item_getX takes item this_2 returns real return GetItemX(this_2) endfunction function item_getY takes item this_2 returns real return GetItemY(this_2) endfunction function item_getPos takes item this_2 returns real set item_getPos_return_x = item_getX(this_2) set item_getPos_return_y = item_getY(this_2) return item_getPos_return_x endfunction function isTerrainWalkable takes real x, real y returns boolean local real temp_Terrain_tempPos_x local real temp_Terrain_tempPos_y call MoveRectTo(Terrain_find, x, y) call EnumItemsInRect(Terrain_find, null, ref_function_hideItem) call SetItemPosition(Terrain_dItem, x, y) set temp_Terrain_tempPos_x = item_getPos(Terrain_dItem) set temp_Terrain_tempPos_y = item_getPos_return_y set Terrain_tempPos_x = temp_Terrain_tempPos_x set Terrain_tempPos_y = temp_Terrain_tempPos_y call SetItemVisible(Terrain_dItem, false) loop exitwhen not (Terrain_hidMax > 0) set Terrain_hidMax = Terrain_hidMax - 1 call SetItemVisible(Terrain_hid[Terrain_hidMax], true) set Terrain_hid[Terrain_hidMax] = null endloop return (Terrain_tempPos_x - x) * (Terrain_tempPos_x - x) + (Terrain_tempPos_y - y) * (Terrain_tempPos_y - y) <= Terrain_MAX_RANGE * Terrain_MAX_RANGE and ( not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)) endfunction function unitValid takes unit u returns boolean return ( not IsUnitType(u, UNIT_TYPE_DEAD)) and GetUnitTypeId(u) != Basics_DUMMY_UNIT_ID endfunction function Knockback_periodic takes integer this_2 returns nothing local integer tempIndex = this_2 local integer temp_3 = tempIndex local integer tempIndex_2 = this_2 local real temp = Knockback_vel[tempIndex_2] local real temp_2 = Knockback_vel_2[tempIndex_2] local integer tempIndex_3 = this_2 local real newPos_x local real newPos_y local group wurst__iterator0 local unit cu local integer tempIndex_4 local real temp_newPos_x local real temp_newPos_y local real temp_4 local real temp_5 set Knockback_vel[temp_3] = vec2_op_minus(temp, temp_2, Knockback_acc[tempIndex_3], Knockback_acc_2[tempIndex_3]) set Knockback_vel_2[tempIndex] = vec2_op_minus_return_y set temp_4 = unit_getPos(Knockback_u[this_2]) set temp_5 = unit_getPos_return_y set tempIndex_4 = this_2 set temp_newPos_x = vec2_op_plus(temp_4, temp_5, Knockback_vel[tempIndex_4], Knockback_vel_2[tempIndex_4]) set temp_newPos_y = vec2_op_plus_return_y set newPos_x = temp_newPos_x set newPos_y = temp_newPos_y if Knockback_useEffects[this_2] then if isTerrainLand(unit_getX(Knockback_u[this_2]), unit_getY(Knockback_u[this_2])) and Knockback_sfxCurr[this_2] != 1 then call effect_destr(Knockback_sfx[this_2]) set Knockback_sfx[this_2] = unit_addEffect(Knockback_u[this_2], KnockbackHandler_SFX_EARTH, KnockbackHandler_SFX_ATTACHPOINT) set Knockback_sfxCurr[this_2] = 1 elseif isTerrainShallowWater(unit_getX(Knockback_u[this_2]), unit_getY(Knockback_u[this_2])) and Knockback_sfxCurr[this_2] != 2 then call effect_destr(Knockback_sfx[this_2]) set Knockback_sfx[this_2] = unit_addEffect(Knockback_u[this_2], KnockbackHandler_SFX_WATER, KnockbackHandler_SFX_ATTACHPOINT) set Knockback_sfxCurr[this_2] = 2 endif endif if isTerrainWalkable(newPos_x, newPos_y) then call unit_setXY(Knockback_u[this_2], newPos_x, newPos_y) elseif Knockback_stopImpassable[this_2] then call dispatch_Knockback_destroyKnockback(this_2) set wurst__iterator0 = null set cu = null return endif if Knockback_collisionAction[this_2] != 0 then if Knockback_collisionSize[this_2] > 0. then call group_clear(TempGroups_ENUM_GROUP) call group_enumUnitsInRange(TempGroups_ENUM_GROUP, unit_getPos(Knockback_u[this_2]), unit_getPos_return_y, Knockback_collisionSize[this_2]) set wurst__iterator0 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator0) set cu = group_next(wurst__iterator0) if unitValid(cu) and cu != Knockback_u[this_2] then if not dispatch_LinkedList_contains(Knockback_collisionUnits[this_2], unitToIndex(cu)) then call dispatch_LinkedList_add(Knockback_collisionUnits[this_2], unitToIndex(cu)) call dispatch_UnitCollision_onCollide(Knockback_collisionAction[this_2], Knockback_u[this_2], cu) endif endif endloop call group_close(wurst__iterator0) endif endif set Knockback_steps[this_2] = Knockback_steps[this_2] - 1 if Knockback_steps[this_2] <= 0 then call dispatch_Knockback_destroyKnockback(this_2) endif set wurst__iterator0 = null set cu = null endfunction function dispatch_Knockback_periodic takes integer this_2 returns nothing if Knockback_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Knockback.periodic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Knockback.periodic on invalid object.", 0, 0, false) endif endif call Knockback_periodic(this_2) endfunction function Periodic_timerCallback takes nothing returns nothing local timer t = GetExpiredTimer() local integer c = timer_getData(t) call dispatch_Knockback_periodic(c) set t = null endfunction function unit_setXY_2 takes unit this_2, real x, real y returns nothing call SetUnitX(this_2, x) call SetUnitY(this_2, y) endfunction function Fx_setXYZ takes integer this_2, real pos_x, real pos_y, real pos_z returns nothing call unit_setXY_2(Fx_dummy[this_2], pos_x, pos_y) call dispatch_Fx_setZ(this_2, pos_z - getTerrainZ(pos_x, pos_y)) endfunction function dispatch_Fx_setXYZ takes integer this_2, real pos_x, real pos_y, real pos_z returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setXYZ", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setXYZ on invalid object.", 0, 0, false) endif endif call Fx_setXYZ(this_2, pos_x, pos_y, pos_z) endfunction function angle_radians takes real this_radians returns real return this_radians endfunction function Fx_setZAngle takes integer this_2, real value returns nothing local integer i = R2I(value * bj_RADTODEG + 90.5) if i >= 180 then set i = 179 elseif i < 0 then set i = 0 endif call SetUnitAnimationByIndex(Fx_dummy[this_2], i) endfunction function dispatch_Fx_setZAngle takes integer this_2, real value returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setZAngle", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setZAngle on invalid object.", 0, 0, false) endif endif call Fx_setZAngle(this_2, value) endfunction function Fx_setZAngle_2 takes integer this_2, real value_radians returns nothing call dispatch_Fx_setZAngle(this_2, angle_radians(value_radians)) endfunction function dispatch_Fx_setZAngle_2 takes integer this_2, real value_radians returns nothing if Fx_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Fx.setZAngle", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Fx.setZAngle on invalid object.", 0, 0, false) endif endif call Fx_setZAngle_2(this_2, value_radians) endfunction function player_isEnemyOf takes player this_2, player p returns boolean return IsPlayerEnemy(this_2, p) endfunction function MissileSplitshot_collisionFilter takes integer this_2, unit u returns boolean return player_isEnemyOf(unit_getOwner(u), unit_getOwner(MissileSplitshot_casterUnit[this_2])) endfunction function Missile_collisionFilter takes integer this_2, unit u returns boolean return true endfunction function dispatch_Missile_collisionFilter takes integer this_2, unit u returns boolean local boolean collisionFilter_result if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.collisionFilter", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.collisionFilter on invalid object.", 0, 0, false) endif endif if Missile_typeId[this_2] <= 762 then if Missile_typeId[this_2] <= 761 then set collisionFilter_result = Missile_collisionFilter(this_2, u) else set collisionFilter_result = MissileSplitshot_collisionFilter(this_2, u) endif else set collisionFilter_result = Missile_collisionFilter(this_2, u) endif return collisionFilter_result endfunction function Periodic_stopPeriodic_2 takes integer this_2 returns nothing call timer_release(Periodic_t[this_2]) set Periodic_t[this_2] = null endfunction function dispatch_Missile_stopPeriodic takes integer this_2 returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.stopPeriodic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.stopPeriodic on invalid object.", 0, 0, false) endif endif call Periodic_stopPeriodic_2(this_2) endfunction function Missile_onDestroy takes integer this_2 returns nothing set Missile_alive[this_2] = false call dispatch_Fx_destroyFx(Missile_fx[this_2]) if Missile_seenUnits[this_2] != 0 then call dispatch_LinkedList_destroyLinkedList(Missile_seenUnits[this_2]) set Missile_seenUnits[this_2] = 0 endif call dispatch_Missile_stopPeriodic(this_2) endfunction function dealloc_Missile takes integer obj returns nothing if Missile_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type Missile", 0, 0, false) else set Missile_nextFree[Missile_firstFree] = obj set Missile_firstFree = Missile_firstFree + 1 set Missile_typeId[obj] = 0 endif endfunction function destroyMissile takes integer this_2 returns nothing call Missile_onDestroy(this_2) call dealloc_Missile(this_2) endfunction function dispatch_Missile_destroyMissile takes integer this_2 returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.destroyMissile", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.destroyMissile on invalid object.", 0, 0, false) endif endif call destroyMissile(this_2) endfunction function Missile_loopControl takes integer this_2 returns nothing endfunction function dispatch_Missile_loopControl takes integer this_2 returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.loopControl", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.loopControl on invalid object.", 0, 0, false) endif endif call Missile_loopControl(this_2) endfunction function MissileSplitshot_onDestroy takes integer this_2 returns nothing call Missile_onDestroy(this_2) endfunction function dealloc_MissileSplitshot takes integer obj returns nothing if Missile_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type MissileSplitshot", 0, 0, false) else set Missile_nextFree[Missile_firstFree] = obj set Missile_firstFree = Missile_firstFree + 1 set Missile_typeId[obj] = 0 endif endfunction function destroyMissileSplitshot takes integer this_2 returns nothing call MissileSplitshot_onDestroy(this_2) call dealloc_MissileSplitshot(this_2) endfunction function dispatch_MissileSplitshot_destroyMissileSplitshot takes integer this_2 returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling MissileSplitshot.destroyMissileSplitshot", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called MissileSplitshot.destroyMissileSplitshot on invalid object.", 0, 0, false) endif endif call destroyMissileSplitshot(this_2) endfunction function Missile_getFx takes integer this_2 returns integer return Missile_fx[this_2] endfunction function dispatch_Missile_getFx takes integer this_2 returns integer local integer getFx_result if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.getFx", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.getFx on invalid object.", 0, 0, false) endif endif set getFx_result = Missile_getFx(this_2) return getFx_result endfunction function MissileSplitshot_onCollision takes integer this_2, unit u returns nothing local real dmg = dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(MissileSplitshot_casterUnit[this_2])], 10) * .8 call cyc_unitDamageTarget(0, MissileSplitshot_casterUnit[this_2], u, dmg, 0, false) if MissileSplitshot_isBurning[this_2] then call cyc_unitDamageTarget(0, MissileSplitshot_casterUnit[this_2], u, dmg * 0.3, 2, false) endif set MissileSplitshot_targetsLeft[this_2] = MissileSplitshot_targetsLeft[this_2] - 1 if MissileSplitshot_targetsLeft[this_2] <= 0 then call dispatch_MissileSplitshot_destroyMissileSplitshot(this_2) elseif ( not MissileSplitshot_isBurning[this_2]) and unit_xHasTalent(MissileSplitshot_casterUnit[this_2], TalentList_TALENT_RANGER_SPLITSHOT_BURN) and unit_hasBuff(u, 738) then call dispatch_Fx_setFx(dispatch_Missile_getFx(this_2), "Abilities\\Weapons\\SearingArrow\\SearingArrowMissile.mdl") set MissileSplitshot_isBurning[this_2] = true endif endfunction function Missile_onCollision takes integer this_2, unit u returns nothing endfunction function dispatch_Missile_onCollision takes integer this_2, unit u returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.onCollision", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.onCollision on invalid object.", 0, 0, false) endif endif if Missile_typeId[this_2] <= 762 then if Missile_typeId[this_2] <= 761 then call Missile_onCollision(this_2, u) else call MissileSplitshot_onCollision(this_2, u) endif else call Missile_onCollision(this_2, u) endif endfunction function alloc_BuffFirearrow takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 738 return this_2 endfunction function construct_BuffFirearrow takes integer this_2, unit caster returns nothing call construct_Buff(this_2) set BuffFirearrow_caster[this_2] = caster endfunction function new_BuffFirearrow takes unit caster returns integer local integer this_2 = alloc_BuffFirearrow() call construct_BuffFirearrow(this_2, caster) return this_2 endfunction function MissileFirearrow_onHit takes integer this_2 returns nothing if unit_xIsAlive(MissileFirearrow_targetUnit[this_2]) then call cyc_unitDamageTarget(0, MissileFirearrow_casterUnit[this_2], MissileFirearrow_targetUnit[this_2], dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(MissileFirearrow_casterUnit[this_2])], 10) * 1., 0, false) call dispatch_Buff_apply(new_BuffFirearrow(MissileFirearrow_casterUnit[this_2]), MissileFirearrow_targetUnit[this_2]) endif endfunction function MissileHolyBolt_onHit takes integer this_2 returns nothing if unit_xIsAlive(MissileHolyBolt_targetUnit[this_2]) then call unitHealTarget(MissileHolyBolt_casterUnit[this_2], MissileHolyBolt_targetUnit[this_2], dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(MissileHolyBolt_casterUnit[this_2])], 6) * MissileHolyBolt_mult[this_2]) call effect_destr(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", MissileHolyBolt_targetUnit[this_2], "overhead")) endif endfunction function Missile_onHit takes integer this_2 returns nothing endfunction function dispatch_Missile_onHit takes integer this_2 returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.onHit", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.onHit on invalid object.", 0, 0, false) endif endif if Missile_typeId[this_2] <= 761 then if Missile_typeId[this_2] <= 760 then call Missile_onHit(this_2) else call MissileFirearrow_onHit(this_2) endif elseif Missile_typeId[this_2] <= 762 then call Missile_onHit(this_2) else call MissileHolyBolt_onHit(this_2) endif endfunction function unitValid_2 takes unit u returns boolean return ( not IsUnitType(u, UNIT_TYPE_DEAD)) and GetUnitTypeId(u) != Basics_DUMMY_UNIT_ID endfunction function Missile_periodic takes integer this_2 returns nothing local real a local group wurst__iterator0 local unit u local integer id local integer tempIndex local integer tempIndex_2 local integer tempIndex_3 local real tempTupleSelectionResult_3 local real temp_tempTupleSelectionResult_3 local integer tempIndex_4 local integer tempIndex_5 local integer tempIndex_6 local integer tempIndex_7 local integer tempIndex_8 local real tempTupleSelectionResult_3_2 local real temp_tempTupleSelectionResult_3_2 local integer tempIndex_9 local integer tempIndex_10 local real tempTupleSelectionResult_3_3 local real temp_tempTupleSelectionResult_3_3 local integer tempIndex_11 local integer temp local real temp_2 local real temp_3 local real temp_4 local integer temp_5 local integer temp_6 local integer temp_7 local integer temp_8 local group temp_9 if Missile_targetUnit[this_2] != null and unit_getTypeId(Missile_targetUnit[this_2]) != 0 then set tempIndex = this_2 set Missile_targetPos[tempIndex] = vec3_op_plus(unit_getPos3(Missile_targetUnit[this_2], Missile_targetUnitZOffset[this_2]), unit_getPos3_return_y, unit_getPos3_return_z, 0., 0., getTerrainZ(unit_getX(Missile_targetUnit[this_2]), unit_getY(Missile_targetUnit[this_2]))) set Missile_targetPos_2[tempIndex] = vec3_op_plus_return_y set Missile_targetPos_3[tempIndex] = vec3_op_plus_return_z call dispatch_Missile_updateTargetPos(this_2) endif set a = Missile_missileAccZ[this_2] * 0.5 set tempIndex_2 = this_2 set temp = tempIndex_2 set tempIndex_3 = this_2 set temp_tempTupleSelectionResult_3 = Missile_missileVel_3[tempIndex_3] set tempTupleSelectionResult_3 = temp_tempTupleSelectionResult_3 set Missile_missileVel_3[temp] = tempTupleSelectionResult_3 + a set tempIndex_4 = this_2 set temp_5 = tempIndex_4 set tempIndex_5 = this_2 set temp_2 = Missile_missilePos[tempIndex_5] set temp_3 = Missile_missilePos_2[tempIndex_5] set temp_4 = Missile_missilePos_3[tempIndex_5] set tempIndex_6 = this_2 set Missile_missilePos[temp_5] = vec3_op_plus(temp_2, temp_3, temp_4, Missile_missileVel[tempIndex_6], Missile_missileVel_2[tempIndex_6], Missile_missileVel_3[tempIndex_6]) set Missile_missilePos_2[tempIndex_4] = vec3_op_plus_return_y set Missile_missilePos_3[tempIndex_4] = vec3_op_plus_return_z set tempIndex_7 = this_2 set temp_6 = tempIndex_7 set tempIndex_8 = this_2 set temp_tempTupleSelectionResult_3_2 = Missile_missileVel_3[tempIndex_8] set tempTupleSelectionResult_3_2 = temp_tempTupleSelectionResult_3_2 set Missile_missileVel_3[temp_6] = tempTupleSelectionResult_3_2 + a set temp_7 = Missile_fx[this_2] set tempIndex_9 = this_2 call dispatch_Fx_setXYZ(temp_7, Missile_missilePos[tempIndex_9], Missile_missilePos_2[tempIndex_9], Missile_missilePos_3[tempIndex_9]) set temp_8 = Missile_fx[this_2] set tempIndex_10 = this_2 set temp_tempTupleSelectionResult_3_3 = Missile_missileVel_3[tempIndex_10] set tempTupleSelectionResult_3_3 = temp_tempTupleSelectionResult_3_3 call dispatch_Fx_setZAngle_2(temp_8, Atan2(tempTupleSelectionResult_3_3, Missile_missileVelXY[this_2])) set Missile_time[this_2] = Missile_time[this_2] - Missile_TIMER_TIMEOUT if Missile_time[this_2] < 0. then call dispatch_Missile_onHit(this_2) call dispatch_Missile_destroyMissile(this_2) else if Missile_collisionSize[this_2] > 0. then call group_clear(TempGroups_ENUM_GROUP) set temp_9 = TempGroups_ENUM_GROUP set tempIndex_11 = this_2 call group_enumUnitsInRange(temp_9, vec3_toVec2(Missile_missilePos[tempIndex_11], Missile_missilePos_2[tempIndex_11], Missile_missilePos_3[tempIndex_11]), vec3_toVec2_return_y, Missile_collisionSize[this_2]) set wurst__iterator0 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator0) set u = group_next(wurst__iterator0) if unitValid_2(u) and dispatch_Missile_collisionFilter(this_2, u) then set id = handle_getHandleId(u) if not dispatch_LinkedList_contains(Missile_seenUnits[this_2], id) then call dispatch_LinkedList_add(Missile_seenUnits[this_2], id) call dispatch_Missile_onCollision(this_2, u) endif endif endloop call group_close(wurst__iterator0) endif if Missile_alive[this_2] then call dispatch_Missile_loopControl(this_2) endif endif set wurst__iterator0 = null set u = null set temp_9 = null endfunction function dispatch_Missile_periodic takes integer this_2 returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.periodic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.periodic on invalid object.", 0, 0, false) endif endif call Missile_periodic(this_2) endfunction function Periodic_timerCallback_2 takes nothing returns nothing local timer t = GetExpiredTimer() local integer c = timer_getData(t) call dispatch_Missile_periodic(c) set t = null endfunction function alloc_UnitData takes nothing returns integer local integer this_2 if UnitIndex_firstFree == 0 then set UnitIndex_maxIndex = UnitIndex_maxIndex + 1 set this_2 = UnitIndex_maxIndex else set UnitIndex_firstFree = UnitIndex_firstFree - 1 set this_2 = UnitIndex_nextFree[UnitIndex_firstFree] endif set UnitIndex_typeId[this_2] = 687 return this_2 endfunction function trigger_evaluate takes trigger this_2 returns nothing call TriggerEvaluate(this_2) endfunction function EventModule_fire takes nothing returns nothing call trigger_evaluate(EventModule_trig) endfunction function unit_setUserData takes unit this_2, integer data returns nothing call SetUnitUserData(this_2, data) endfunction function construct_UnitIndex takes integer this_2, unit u returns nothing local unit tmp set UnitIndex_u[this_2] = u call unit_setUserData(u, this_2) set tmp = UnitIndexEvent_indexedUnit set UnitIndexEvent_indexedUnit = u call EventModule_fire() set UnitIndexEvent_indexedUnit = tmp set tmp = null endfunction function int_xGetUnitTypeData takes integer this_2 returns integer return dispatch_HashMap_get(UnitTypeData_raw2UnitTypeData, this_2) endfunction function alloc_BuffList takes nothing returns integer local integer this_2 if BuffList_firstFree == 0 then set BuffList_maxIndex = BuffList_maxIndex + 1 set this_2 = BuffList_maxIndex else set BuffList_firstFree = BuffList_firstFree - 1 set this_2 = BuffList_nextFree[BuffList_firstFree] endif set BuffList_typeId[this_2] = 748 return this_2 endfunction function construct_BuffList takes integer this_2, unit u returns nothing set BuffList_u[this_2] = u set BuffList_buffs[this_2] = new_LinkedList() endfunction function new_BuffList takes unit u returns integer local integer this_2 = alloc_BuffList() call construct_BuffList(this_2, u) return this_2 endfunction function alloc_ThreatHandlerPU takes nothing returns integer local integer this_2 if ThreatHandlerPU_firstFree == 0 then set ThreatHandlerPU_maxIndex = ThreatHandlerPU_maxIndex + 1 set this_2 = ThreatHandlerPU_maxIndex else set ThreatHandlerPU_firstFree = ThreatHandlerPU_firstFree - 1 set this_2 = ThreatHandlerPU_nextFree[ThreatHandlerPU_firstFree] endif set ThreatHandlerPU_typeId[this_2] = 689 return this_2 endfunction function construct_ThreatListEntry2 takes integer this_2 returns nothing set ThreatListEntry_tuPrev[this_2] = this_2 set ThreatListEntry_tuNext[this_2] = this_2 set ThreatListEntry_puPrev[this_2] = this_2 set ThreatListEntry_puNext[this_2] = this_2 set ThreatListEntry_threat[this_2] = 100000000. set ThreatListEntry_pu[this_2] = 0 set ThreatListEntry_tu[this_2] = 0 endfunction function new_ThreatListEntry_2 takes nothing returns integer local integer this_2 = alloc_ThreatListEntry() call construct_ThreatListEntry2(this_2) return this_2 endfunction function construct_ThreatHandlerPU takes integer this_2, unit u returns nothing set ThreatHandlerPU_u[this_2] = u set ThreatHandlerPU_dummy[this_2] = new_ThreatListEntry_2() endfunction function new_ThreatHandlerPU takes unit u returns integer local integer this_2 = alloc_ThreatHandlerPU() call construct_ThreatHandlerPU(this_2, u) return this_2 endfunction function alloc_ThreatHandlerTU takes nothing returns integer local integer this_2 if ThreatHandlerTU_firstFree == 0 then set ThreatHandlerTU_maxIndex = ThreatHandlerTU_maxIndex + 1 set this_2 = ThreatHandlerTU_maxIndex else set ThreatHandlerTU_firstFree = ThreatHandlerTU_firstFree - 1 set this_2 = ThreatHandlerTU_nextFree[ThreatHandlerTU_firstFree] endif set ThreatHandlerTU_typeId[this_2] = 690 return this_2 endfunction function ThreatHandlerCamp_add takes integer this_2, integer tu returns nothing if ThreatHandlerTU_camp[tu] != 0 then call printWarning("ThreatHandlerCamp.add(ThreatHandlerTU tu): " + unit_getName(ThreatHandlerTU_u[tu]) + " already has a camp assigned.") endif set ThreatHandlerTU_campPrev[tu] = ThreatHandlerTU_campPrev[ThreatHandlerCamp_dummy[this_2]] set ThreatHandlerTU_campNext[tu] = ThreatHandlerCamp_dummy[this_2] set ThreatHandlerTU_campNext[ThreatHandlerTU_campPrev[ThreatHandlerCamp_dummy[this_2]]] = tu set ThreatHandlerTU_campPrev[ThreatHandlerCamp_dummy[this_2]] = tu set ThreatHandlerTU_camp[tu] = this_2 endfunction function dispatch_ThreatHandlerCamp_add takes integer this_2, integer tu returns nothing if ThreatHandlerCamp_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerCamp.add", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerCamp.add on invalid object.", 0, 0, false) endif endif call ThreatHandlerCamp_add(this_2, tu) endfunction function alloc_ThreatHandlerCamp takes nothing returns integer local integer this_2 if ThreatHandlerCamp_firstFree == 0 then set ThreatHandlerCamp_maxIndex = ThreatHandlerCamp_maxIndex + 1 set this_2 = ThreatHandlerCamp_maxIndex else set ThreatHandlerCamp_firstFree = ThreatHandlerCamp_firstFree - 1 set this_2 = ThreatHandlerCamp_nextFree[ThreatHandlerCamp_firstFree] endif set ThreatHandlerCamp_typeId[this_2] = 688 return this_2 endfunction function construct_ThreatHandlerTU takes integer this_2 returns nothing set ThreatHandlerTU_campPrev[this_2] = this_2 set ThreatHandlerTU_campNext[this_2] = this_2 set ThreatHandlerTU_camp[this_2] = 0 endfunction function new_ThreatHandlerTU takes nothing returns integer local integer this_2 = alloc_ThreatHandlerTU() call construct_ThreatHandlerTU(this_2) return this_2 endfunction function construct_ThreatHandlerCamp takes integer this_2 returns nothing set ThreatHandlerCamp_icListId[this_2] = 0 set ThreatHandlerCamp_dummy[this_2] = new_ThreatHandlerTU() set ThreatHandlerCamp_state[this_2] = 0 endfunction function new_ThreatHandlerCamp takes nothing returns integer local integer this_2 = alloc_ThreatHandlerCamp() call construct_ThreatHandlerCamp(this_2) return this_2 endfunction function trigger_addAction takes trigger this_2, code actionFunc returns nothing call TriggerAddAction(this_2, actionFunc) endfunction function trigger_registerUnitEvent takes trigger this_2, unit whichUnit, unitevent whichEvent returns nothing call TriggerRegisterUnitEvent(this_2, whichUnit, whichEvent) endfunction function construct_ThreatHandlerTU2 takes integer this_2, unit u returns nothing local trigger receiver local trigger receiver_2 local trigger receiver_3 local unit other local integer otherTu local integer tempIndex local real tempTupleSelectionResult_1 local real temp_tempTupleSelectionResult_1 local real tempTupleSelectionResult_2 local real temp_tempTupleSelectionResult_2 local group temp local real temp_2 set ThreatHandlerTU_state[this_2] = 0 set ThreatHandlerTU_u[this_2] = u set tempIndex = this_2 set ThreatHandlerTU_campPos[tempIndex] = unit_getPos(u) set ThreatHandlerTU_campPos_2[tempIndex] = unit_getPos_return_y set ThreatHandlerTU_dummy[this_2] = new_ThreatListEntry_2() set receiver = CreateTrigger() call trigger_registerUnitEvent(receiver, u, EVENT_UNIT_ISSUED_TARGET_ORDER) set receiver_2 = receiver call trigger_registerUnitEvent(receiver_2, u, EVENT_UNIT_ACQUIRED_TARGET) set receiver_3 = receiver_2 call trigger_addAction(receiver_3, ref_function_acquireTarget) set ThreatHandlerTU_targetAcquireTrigger[this_2] = receiver_3 set temp = TempGroups_ENUM_GROUP set temp_tempTupleSelectionResult_1 = unit_getPos(u) set tempTupleSelectionResult_1 = temp_tempTupleSelectionResult_1 set temp_2 = tempTupleSelectionResult_1 call unit_getPos(u) set temp_tempTupleSelectionResult_2 = unit_getPos_return_y set tempTupleSelectionResult_2 = temp_tempTupleSelectionResult_2 call GroupEnumUnitsInRange(temp, temp_2, tempTupleSelectionResult_2, ThreatHandlerConfig_CAMP_RANGE, Condition(ref_function_closure_impl)) set other = FirstOfGroup(TempGroups_ENUM_GROUP) if other != null then set otherTu = getThreatUnit(other) call dispatch_ThreatHandlerCamp_add(ThreatHandlerTU_camp[otherTu], this_2) else call dispatch_ThreatHandlerCamp_add(new_ThreatHandlerCamp(), this_2) endif call group_clear(TempGroups_ENUM_GROUP) set receiver = null set receiver_2 = null set receiver_3 = null set other = null set temp = null endfunction function new_ThreatHandlerTU_2 takes unit u returns integer local integer this_2 = alloc_ThreatHandlerTU() call construct_ThreatHandlerTU2(this_2, u) return this_2 endfunction function alloc_UnitDamageHandler takes nothing returns integer local integer this_2 if UnitDamageHandler_firstFree == 0 then set UnitDamageHandler_maxIndex = UnitDamageHandler_maxIndex + 1 set this_2 = UnitDamageHandler_maxIndex else set UnitDamageHandler_firstFree = UnitDamageHandler_firstFree - 1 set this_2 = UnitDamageHandler_nextFree[UnitDamageHandler_firstFree] endif set UnitDamageHandler_typeId[this_2] = 746 return this_2 endfunction function construct_UnitDamageHandler takes integer this_2, unit u returns nothing call trigger_registerUnitEvent(DamageHandler_unitAttackTrigger, u, EVENT_UNIT_DAMAGED) endfunction function new_UnitDamageHandler takes unit u returns integer local integer this_2 = alloc_UnitDamageHandler() call construct_UnitDamageHandler(this_2, u) return this_2 endfunction function alloc_UnitStatBuffer takes nothing returns integer local integer this_2 if UnitStatBuffer_firstFree == 0 then set UnitStatBuffer_maxIndex = UnitStatBuffer_maxIndex + 1 set this_2 = UnitStatBuffer_maxIndex else set UnitStatBuffer_firstFree = UnitStatBuffer_firstFree - 1 set this_2 = UnitStatBuffer_nextFree[UnitStatBuffer_firstFree] endif set UnitStatBuffer_typeId[this_2] = 680 return this_2 endfunction function UnitStatBuffer_reset takes integer this_2, unit u, integer baseStatBuffer returns nothing local integer n local integer temp local integer tempIndex set UnitStatBuffer_u[this_2] = u if baseStatBuffer == 0 then set UnitStatBuffer_baseStats[this_2] = StatHandler_DEFAULT_BASE_STAT_BUFFER else set UnitStatBuffer_baseStats[this_2] = baseStatBuffer endif set UnitStatBuffer_arrayStart[this_2] = 1 + (this_2 - 1) * StatHandler_numStats set n = 0 set temp = StatHandler_numStats loop exitwhen n > temp set UnitStatBuffer_cacheDirty[UnitStatBuffer_arrayStart[this_2] + n] = true if StatHandler_statType[n] == 0 then set UnitStatBuffer_statsAbs[UnitStatBuffer_arrayStart[this_2] + n] = dispatch_UnitBaseStatBuffer_getStatRaw(UnitStatBuffer_baseStats[this_2], n) else set tempIndex = UnitStatBuffer_arrayStart[this_2] + n set UnitStatBuffer_statsPerc[tempIndex] = dispatch_UnitBaseStatBuffer_getStatRaw(UnitStatBuffer_baseStats[this_2], n) set UnitStatBuffer_statsPerc_2[tempIndex] = 100 endif set n = n + 1 endloop endfunction function dispatch_UnitStatBuffer_reset takes integer this_2, unit u, integer baseStatBuffer returns nothing if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.reset", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.reset on invalid object.", 0, 0, false) endif endif call UnitStatBuffer_reset(this_2, u, baseStatBuffer) endfunction function construct_UnitStatBuffer2 takes integer this_2, unit u, integer baseStats returns nothing set StatHandler_mapUnitStatBuffers[getUnitIndex(u)] = this_2 call dispatch_UnitStatBuffer_reset(this_2, u, baseStats) endfunction function new_UnitStatBuffer takes unit u, integer baseStats returns integer local integer this_2 = alloc_UnitStatBuffer() call construct_UnitStatBuffer2(this_2, u, baseStats) return this_2 endfunction function alloc_OOCRUnit takes nothing returns integer local integer this_2 if OOCRUnit_firstFree == 0 then set OOCRUnit_maxIndex = OOCRUnit_maxIndex + 1 set this_2 = OOCRUnit_maxIndex else set OOCRUnit_firstFree = OOCRUnit_firstFree - 1 set this_2 = OOCRUnit_nextFree[OOCRUnit_firstFree] endif return this_2 endfunction function construct_OOCRUnit takes integer this_2, unit u, real t returns nothing set OOCRUnit_u[this_2] = u set OOCRUnit_t[this_2] = t endfunction function new_OOCRUnit takes unit u, real t returns integer local integer this_2 = alloc_OOCRUnit() call construct_OOCRUnit(this_2, u, t) return this_2 endfunction function unitEnableOOCRegen takes unit u returns nothing local integer obj = new_OOCRUnit(u, -1.) call dispatch_LinkedList_add(OOCRegen_oocrUnits, obj) endfunction function construct_UnitData takes integer this_2, unit u returns nothing call construct_UnitIndex(this_2, u) set UnitData_unitStatBuffer[this_2] = new_UnitStatBuffer(u, UnitTypeData_unitBaseStatBuffer[int_xGetUnitTypeData(unit_getTypeId(u))]) set UnitData_unitDamageHandler[this_2] = new_UnitDamageHandler(u) set UnitData_unitBuffList[this_2] = new_BuffList(u) if unit_xIsHero(u) then set UnitData_threatHandlerPu[this_2] = new_ThreatHandlerPU(u) call unitEnableOOCRegen(u) else set UnitData_threatHandlerTu[this_2] = new_ThreatHandlerTU_2(u) endif set UnitData_creepRespawn[this_2] = 0 endfunction function new_UnitData takes unit u returns integer local integer this_2 = alloc_UnitData() call construct_UnitData(this_2, u) return this_2 endfunction function CreepRespawn_onTimer takes integer this_2 returns nothing local player temp = Player(PLAYER_NEUTRAL_AGGRESSIVE) local integer temp_2 = CreepRespawn_unitRaw[this_2] local integer tempIndex = this_2 local real temp_3 = CreepRespawn_pos[tempIndex] local real temp_4 = CreepRespawn_pos_2[tempIndex] local integer tempIndex_2 = this_2 local unit u = createUnit(temp, temp_2, temp_3, temp_4, CreepRespawn_facing[tempIndex_2]) set UnitData_creepRespawn[new_UnitData(u)] = this_2 set u = null set temp = null endfunction function dispatch_CreepRespawn_onTimer takes integer this_2 returns nothing if CreepRespawn_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling CreepRespawn.onTimer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called CreepRespawn.onTimer on invalid object.", 0, 0, false) endif endif call CreepRespawn_onTimer(this_2) endfunction function Timed_timerCallback takes nothing returns nothing local timer t = GetExpiredTimer() local integer c = timer_getData(t) call dispatch_CreepRespawn_onTimer(c) call timer_release(t) set t = null endfunction function player_getGold takes player this_2 returns integer return player_getState(this_2, PLAYER_STATE_RESOURCE_GOLD) endfunction function player_subState takes player this_2, playerstate state, integer val returns nothing call SetPlayerState(this_2, state, player_getState(this_2, state) - val) endfunction function player_subGold takes player this_2, integer val returns nothing call player_subState(this_2, PLAYER_STATE_RESOURCE_GOLD, val) endfunction function unit_revive takes unit this_2, real pos_x, real pos_y, boolean doEyecandy returns nothing call ReviveHero(this_2, pos_x, pos_y, doEyecandy) endfunction function HeroRespawn_onTimer takes integer this_2 returns nothing local player owner = unit_getOwner(HeroRespawn_hero[this_2]) local integer goldLost if GetLocalPlayer() == owner then call PanCameraToTimed(HeroRespawn_HERO_RESPAWN_POS_x, HeroRespawn_HERO_RESPAWN_POS_y, 0.) endif call unit_revive(HeroRespawn_hero[this_2], HeroRespawn_HERO_RESPAWN_POS_x, HeroRespawn_HERO_RESPAWN_POS_y, true) set UnitData_threatHandlerPu[unit_xGetUnitData(HeroRespawn_hero[this_2])] = new_ThreatHandlerPU(HeroRespawn_hero[this_2]) set goldLost = player_getGold(owner) / 5 call player_subGold(owner, goldLost) call printTimedToPlayer("You lost " + int_toString(goldLost) + " gold.", 5., owner) set owner = null endfunction function dispatch_HeroRespawn_onTimer takes integer this_2 returns nothing if HeroRespawn_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroRespawn.onTimer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroRespawn.onTimer on invalid object.", 0, 0, false) endif endif call HeroRespawn_onTimer(this_2) endfunction function Timed_timerCallback_2 takes nothing returns nothing local timer t = GetExpiredTimer() local integer c = timer_getData(t) call dispatch_HeroRespawn_onTimer(c) call timer_release(t) set t = null endfunction function SpellMoonlightShadow_onDestroy takes integer this_2 returns nothing call Spell_onDestroy(this_2) endfunction function dealloc_SpellMoonlightShadow takes integer obj returns nothing if Spell_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type SpellMoonlightShadow", 0, 0, false) else set Spell_nextFree[Spell_firstFree] = obj set Spell_firstFree = Spell_firstFree + 1 set Spell_typeId[obj] = 0 endif endfunction function destroySpellMoonlightShadow takes integer this_2 returns nothing call SpellMoonlightShadow_onDestroy(this_2) call dealloc_SpellMoonlightShadow(this_2) endfunction function dispatch_SpellMoonlightShadow_destroySpellMoonlightShadow takes integer this_2 returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling SpellMoonlightShadow.destroySpellMoonlightShadow", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called SpellMoonlightShadow.destroySpellMoonlightShadow on invalid object.", 0, 0, false) endif endif call destroySpellMoonlightShadow(this_2) endfunction function SpellMoonlightShadow_onTimer takes integer this_2 returns nothing local real healMod if unit_xIsAlive(Spell_targetUnit[this_2]) then call effect_destr(unit_addEffect(Spell_targetUnit[this_2], "Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl", "overhead")) if player_isAllyOf(unit_getOwner(Spell_targetUnit[this_2]), unit_getOwner(Spell_caster[this_2])) then set healMod = 1. if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_DRUID_MOON_REJU) and unit_hasBuff(Spell_targetUnit[this_2], 741) then set healMod = 1.2 endif call unitHealTarget(Spell_caster[this_2], Spell_targetUnit[this_2], dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(Spell_caster[this_2])], 6) * 2.5 * healMod) else call cyc_unitDamageTarget(0, Spell_caster[this_2], Spell_targetUnit[this_2], dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(Spell_caster[this_2])], 6) * 2., 1, false) endif endif call dispatch_SpellMoonlightShadow_destroySpellMoonlightShadow(this_2) endfunction function dispatch_SpellMoonlightShadow_onTimer takes integer this_2 returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling SpellMoonlightShadow.onTimer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called SpellMoonlightShadow.onTimer on invalid object.", 0, 0, false) endif endif call SpellMoonlightShadow_onTimer(this_2) endfunction function Timed_timerCallback_3 takes nothing returns nothing local timer t = GetExpiredTimer() local integer c = timer_getData(t) call dispatch_SpellMoonlightShadow_onTimer(c) call timer_release(t) set t = null endfunction function Trig_npcs_Actions takes nothing returns nothing set udg_npc_bryce = gg_unit_npc1_0054 set udg_npc_brom = gg_unit_npc2_0055 set udg_npc_marta = gg_unit_npc3_0056 endfunction function acquireTarget takes nothing returns nothing local unit tu = GetTriggerUnit() local unit pu if GetEventTargetUnit() != null then set pu = GetEventTargetUnit() else set pu = GetOrderTargetUnit() endif if IsUnitEnemy(pu, GetOwningPlayer(tu)) then if ThreatHandlerTU_state[getThreatUnit(tu)] == 0 then call modifyThreat(pu, tu, 0., true) endif endif set tu = null set pu = null endfunction function ThreatHandlerTU_getFirstInThreatList takes integer this_2 returns unit local unit ret = null if ThreatListEntry_tuNext[ThreatHandlerTU_dummy[this_2]] != ThreatHandlerTU_dummy[this_2] then set ret = ThreatHandlerPU_u[ThreatListEntry_pu[ThreatListEntry_tuNext[ThreatHandlerTU_dummy[this_2]]]] endif set ThreatHandlerTU_getFirstInThreatListtempReturn = ret set ret = null return ThreatHandlerTU_getFirstInThreatListtempReturn endfunction function dispatch_ThreatHandlerTU_getFirstInThreatList takes integer this_2 returns unit local unit getFirstInThreatList_result if ThreatHandlerTU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerTU.getFirstInThreatList", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerTU.getFirstInThreatList on invalid object.", 0, 0, false) endif endif set getFirstInThreatList_result = ThreatHandlerTU_getFirstInThreatList(this_2) set dispatch_ThreatHandlerTU_getFirstInThreatListtempReturn = getFirstInThreatList_result set getFirstInThreatList_result = null return dispatch_ThreatHandlerTU_getFirstInThreatListtempReturn endfunction function getCombatState takes unit u returns boolean local integer pu local integer tu if GetUnitTypeId(u) == 0 or IsUnitType(u, UNIT_TYPE_DEAD) then return false endif set pu = getPlayerUnit(u) if pu != 0 then return ThreatListEntry_puNext[ThreatHandlerPU_dummy[pu]] != ThreatHandlerPU_dummy[pu] endif set tu = getThreatUnit(u) if tu != 0 then return dispatch_ThreatHandlerTU_getFirstInThreatList(tu) != null endif return false endfunction function regen takes unit u returns nothing call unit_addHP(u, unit_getMaxHP(u) * 0.05) call unit_addMana(u, unit_getState(u, UNIT_STATE_MAX_MANA) * 0.1) endfunction function callback takes nothing returns nothing local integer wurst__iterator1 = dispatch_LinkedList_iterator(OOCRegen_oocrUnits) local integer obj loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator1) set obj = dispatch_LLIterator_next(wurst__iterator1) if unit_xIsAlive(OOCRUnit_u[obj]) then if getCombatState(OOCRUnit_u[obj]) then set OOCRUnit_t[obj] = -1. elseif OOCRUnit_t[obj] < 0. then set OOCRUnit_t[obj] = getElapsedGameTime() elseif OOCRUnit_t[obj] + OOCRegen_DELAY <= getElapsedGameTime() then call regen(OOCRUnit_u[obj]) endif endif endloop call dispatch_LLIterator_close(wurst__iterator1) endfunction function real_toString takes real this_2 returns string return R2S(this_2) endfunction function closure_impl_16 takes nothing returns nothing if GetIssuedOrderId() == 851971 then call print("Coordinates: " + real_toString(GetOrderPointX()) + " / " + real_toString(GetOrderPointY())) call TriggerSleepAction(0.01) call IssueImmediateOrder(GetTriggerUnit(), "stop") endif endfunction function int_getUnit takes integer this_2 returns unit return UnitIndex_u[this_2] endfunction function unit_isStunned takes unit this_2 returns boolean return Status_stunCounter[Status_status[unit_getIndex(this_2)]] > 0 endfunction function unit_removeStun takes unit this_2 returns nothing set Status_stunCounter[Status_status[unit_getIndex(this_2)]] = Status_stunCounter[Status_status[unit_getIndex(this_2)]] - 1 if Status_stunCounter[Status_status[unit_getIndex(this_2)]] < 0 then call printWarning("StatusHandler: tried removing a non-existing stun.") set Status_stunCounter[Status_status[unit_getIndex(this_2)]] = 0 endif if not unit_isStunned(this_2) then call unit_removeAbility(this_2, StatusHandlerConfig_STUN_BUFF_ID) endif endfunction function closure_impl_17 takes nothing returns nothing local integer j = timer_getData(GetExpiredTimer()) call unit_removeStun(int_getUnit(j)) call timer_release(Status_stunTimer[Status_status[j]]) set Status_stunTimer[Status_status[j]] = null endfunction function PQuestItem_getCounterMax takes integer this_2 returns integer return PQuestItem_maxCount[this_2] endfunction function dispatch_PQuestItem_getCounterMax takes integer this_2 returns integer local integer getCounterMax_result if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.getCounterMax", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.getCounterMax on invalid object.", 0, 0, false) endif endif set getCounterMax_result = PQuestItem_getCounterMax(this_2) return getCounterMax_result endfunction function HashMap_put takes integer this_2, integer key, integer value returns nothing call hashtable_saveInt(HashMap_ht, this_2, key, value) endfunction function dispatch_HashMap_put takes integer this_2, integer key, integer value returns nothing if HashMap_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HashMap.put", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HashMap.put on invalid object.", 0, 0, false) endif endif call HashMap_put(this_2, key, value) endfunction function hashtable_loadQuestHandle takes hashtable this_2, integer parentKey, integer childKey returns quest return LoadQuestHandle(this_2, parentKey, childKey) endfunction function Table_loadQuest takes integer this_2, integer parentKey returns quest return hashtable_loadQuestHandle(Table_ht, this_2, parentKey) endfunction function dispatch_Table_loadQuest takes integer this_2, integer parentKey returns quest local quest loadQuest_result if Table_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.loadQuest", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.loadQuest on invalid object.", 0, 0, false) endif endif set loadQuest_result = Table_loadQuest(this_2, parentKey) set dispatch_Table_loadQuesttempReturn = loadQuest_result set loadQuest_result = null return dispatch_Table_loadQuesttempReturn endfunction function hashtable_saveFogStateHandle takes hashtable this_2, integer parentKey, integer childKey, fogstate value returns nothing call SaveFogStateHandle(this_2, parentKey, childKey, value) endfunction function Table_saveFogState takes integer this_2, integer parentKey, fogstate value returns nothing call hashtable_saveFogStateHandle(Table_ht, this_2, parentKey, value) endfunction function dispatch_Table_saveFogState takes integer this_2, integer parentKey, fogstate value returns nothing if Table_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.saveFogState", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.saveFogState on invalid object.", 0, 0, false) endif endif call Table_saveFogState(this_2, parentKey, value) endfunction function questFromIndex takes integer index returns quest call dispatch_Table_saveFogState(TypeCasting_typecastdata, 0, ConvertFogState(index)) return dispatch_Table_loadQuest(TypeCasting_typecastdata, 0) endfunction function questMsg takes integer playerId, string msg returns nothing call printTimedToPlayer(msg, 10., Player_players[playerId]) if GetLocalPlayer() == Player_players[playerId] then call FlashQuestDialogButton() endif endfunction function questitemToIndex takes questitem object returns integer return handle_getHandleId(object) endfunction function effectToIndex takes effect object returns integer return handle_getHandleId(object) endfunction function hashtable_loadEffectHandle takes hashtable this_2, integer parentKey, integer childKey returns effect return LoadEffectHandle(this_2, parentKey, childKey) endfunction function Table_loadEffect takes integer this_2, integer parentKey returns effect return hashtable_loadEffectHandle(Table_ht, this_2, parentKey) endfunction function dispatch_Table_loadEffect takes integer this_2, integer parentKey returns effect local effect loadEffect_result if Table_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.loadEffect", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.loadEffect on invalid object.", 0, 0, false) endif endif set loadEffect_result = Table_loadEffect(this_2, parentKey) set dispatch_Table_loadEffecttempReturn = loadEffect_result set loadEffect_result = null return dispatch_Table_loadEffecttempReturn endfunction function effectFromIndex takes integer index returns effect call dispatch_Table_saveFogState(TypeCasting_typecastdata, 0, ConvertFogState(index)) return dispatch_Table_loadEffect(TypeCasting_typecastdata, 0) endfunction function unitRemoveQuestMarks takes unit npc, integer playerId returns nothing local effect sfx = effectFromIndex(dispatch_HashMap_get(PQuest_npc2QuestMark[playerId], unitToIndex(npc))) if sfx != null then call effect_destr(sfx) call dispatch_HashMap_remove(PQuest_npc2QuestMark[playerId], unitToIndex(npc)) endif set sfx = null endfunction function unitSetQuestMarkQ takes unit npc, integer playerId returns nothing local string path local effect sfx call unitRemoveQuestMarks(npc, playerId) set path = "" if GetLocalPlayer() == Player_players[playerId] then set path = "TalkToMeQuestionMark2.mdl" endif set sfx = unit_addEffect(npc, path, "overhead") call dispatch_HashMap_put(PQuest_npc2QuestMark[playerId], unitToIndex(npc), effectToIndex(sfx)) set sfx = null endfunction function PQuestItem_setDiscovered takes integer this_2, integer playerId returns nothing local quest q local questitem qi local string desc call dispatch_HashMap_put(PQuestItem_state[this_2], playerId, 1) set q = questFromIndex(dispatch_HashMap_get(PQuest_thisQuest[PQuestItem_parent[this_2]], playerId)) set qi = QuestCreateItem(q) call dispatch_HashMap_put(PQuestItem_thisQuestItem[this_2], playerId, questitemToIndex(qi)) set desc = PQuestItem_description[this_2] if PQuestItem_maxCount[this_2] > 0 then set desc = desc + " (0/" + int_toString(PQuestItem_maxCount[this_2]) + ")" endif call QuestItemSetDescription(qi, desc) call questMsg(playerId, "Quest Update:\n" + desc) call dispatch_HashMap_put(PQuest_talkNpc2qi, unitToIndex(PQuestItem_talkNPC[this_2]), this_2) call unitSetQuestMarkQ(PQuestItem_talkNPC[this_2], playerId) set q = null set qi = null endfunction function dispatch_PQuestItem_setDiscovered takes integer this_2, integer playerId returns nothing if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.setDiscovered", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.setDiscovered on invalid object.", 0, 0, false) endif endif call PQuestItem_setDiscovered(this_2, playerId) endfunction function unitSetQuestMarkE takes unit npc, integer playerId returns nothing local string path local effect sfx call unitRemoveQuestMarks(npc, playerId) set path = "" if GetLocalPlayer() == Player_players[playerId] then set path = "Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl" endif set sfx = unit_addEffect(npc, path, "overhead") call dispatch_HashMap_put(PQuest_npc2QuestMark[playerId], unitToIndex(npc), effectToIndex(sfx)) set sfx = null endfunction function PQuest_setDiscoverable takes integer this_2, integer playerId, unit npc returns nothing call dispatch_HashMap_put(PQuest_npc2QuestDiscoverOnTalk[playerId], unitToIndex(npc), this_2) call unitSetQuestMarkE(npc, playerId) endfunction function dispatch_PQuest_setDiscoverable takes integer this_2, integer playerId, unit npc returns nothing if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.setDiscoverable", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.setDiscoverable on invalid object.", 0, 0, false) endif endif call PQuest_setDiscoverable(this_2, playerId, npc) endfunction function item_getName takes item this_2 returns string return GetItemName(this_2) endfunction function unit_addXp takes unit this_2, integer toAdd, boolean showEyeCandy returns nothing call AddHeroXP(this_2, toAdd, showEyeCandy) endfunction function xCreateItemForHero takes unit hero, integer itemRaw returns item local item itm = null if hero != null then set itm = xSpawnItem(itemRaw, unit_getPos(hero), unit_getPos_return_y) call UnitAddItem(hero, itm) endif set xCreateItemForHerotempReturn = itm set itm = null return xCreateItemForHerotempReturn endfunction function xCreateItemForPlayerHero takes integer playerId, integer itemRaw returns item return xCreateItemForHero(xGetPlayerHero(playerId), itemRaw) endfunction function giveQuestRewards takes integer playerId, integer gold, integer exp, integer itemRaw returns nothing local string rewardMsg = "Reward:\n" local item itm if gold > 0 then call player_addGold(Player_players[playerId], gold) set rewardMsg = rewardMsg + int_toString(gold) + " Gold\n" endif if exp > 0 then call unit_addXp(xGetPlayerHero(playerId), exp, true) set rewardMsg = rewardMsg + int_toString(exp) + " Exp\n" endif if itemRaw != 0 then set itm = xCreateItemForPlayerHero(playerId, itemRaw) set rewardMsg = rewardMsg + "Item: " + item_getName(itm) endif call printTimedToPlayer(rewardMsg, 10., Player_players[playerId]) set itm = null endfunction function closure_impl_18 takes integer this_2, integer playerId returns nothing call giveQuestRewards(playerId, 15, 80, 0) call dispatch_PQuest_setDiscoverable(QuestPreciousPelts_pqPreciousPelts, playerId, udg_npc_marta) endfunction function closure_impl_19 takes integer this_2, integer playerId returns nothing call giveQuestRewards(playerId, 30, 120, 0) endfunction function dispatch_CompleteQuestAction_questCompleted takes integer this_2, integer playerId returns nothing if CompleteQuestAction_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling CompleteQuestAction.questCompleted", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called CompleteQuestAction.questCompleted on invalid object.", 0, 0, false) endif endif if CompleteQuestAction_typeId[this_2] <= 700 then call closure_impl_18(this_2, playerId) else call closure_impl_19(this_2, playerId) endif endfunction function PQuest_setCompleted takes integer this_2, integer playerId returns nothing local quest q = questFromIndex(dispatch_HashMap_get(PQuest_thisQuest[this_2], playerId)) call dispatch_HashMap_put(PQuest_state[this_2], playerId, 2) if GetLocalPlayer() == Player_players[playerId] then call QuestSetEnabled(q, false) endif if PQuest_completeQuestAction[this_2] != 0 then call dispatch_CompleteQuestAction_questCompleted(PQuest_completeQuestAction[this_2], playerId) endif set q = null endfunction function dispatch_PQuest_setCompleted takes integer this_2, integer playerId returns nothing if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.setCompleted", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.setCompleted on invalid object.", 0, 0, false) endif endif call PQuest_setCompleted(this_2, playerId) endfunction function hashtable_loadQuestItemHandle takes hashtable this_2, integer parentKey, integer childKey returns questitem return LoadQuestItemHandle(this_2, parentKey, childKey) endfunction function Table_loadQuestItem takes integer this_2, integer parentKey returns questitem return hashtable_loadQuestItemHandle(Table_ht, this_2, parentKey) endfunction function dispatch_Table_loadQuestItem takes integer this_2, integer parentKey returns questitem local questitem loadQuestItem_result if Table_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.loadQuestItem", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.loadQuestItem on invalid object.", 0, 0, false) endif endif set loadQuestItem_result = Table_loadQuestItem(this_2, parentKey) set dispatch_Table_loadQuestItemtempReturn = loadQuestItem_result set loadQuestItem_result = null return dispatch_Table_loadQuestItemtempReturn endfunction function questitemFromIndex takes integer index returns questitem call dispatch_Table_saveFogState(TypeCasting_typecastdata, 0, ConvertFogState(index)) return dispatch_Table_loadQuestItem(TypeCasting_typecastdata, 0) endfunction function PQuestItem_setCompleted takes integer this_2, integer playerId returns nothing local questitem qi call dispatch_HashMap_put(PQuestItem_state[this_2], playerId, 2) set qi = questitemFromIndex(dispatch_HashMap_get(PQuestItem_thisQuestItem[this_2], playerId)) call QuestItemSetCompleted(qi, true) if PQuestItem_next[this_2] != 0 then call dispatch_PQuestItem_setDiscovered(PQuestItem_next[this_2], playerId) endif if PQuestItem_completesQuest[this_2] then call dispatch_PQuest_setCompleted(PQuestItem_parent[this_2], playerId) endif set qi = null endfunction function dispatch_PQuestItem_setCompleted takes integer this_2, integer playerId returns nothing if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.setCompleted", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.setCompleted on invalid object.", 0, 0, false) endif endif call PQuestItem_setCompleted(this_2, playerId) endfunction function PQuestItem_incCounter takes integer this_2, integer playerId returns boolean local boolean completed = false local integer c = dispatch_HashMap_get(PQuestItem_count[this_2], playerId) + 1 local string newDescr call dispatch_HashMap_put(PQuestItem_count[this_2], playerId, c) set newDescr = PQuestItem_description[this_2] + " (" + int_toString(c) + "/" + int_toString(PQuestItem_maxCount[this_2]) + ")" call QuestItemSetDescription(questitemFromIndex(dispatch_HashMap_get(PQuestItem_thisQuestItem[this_2], playerId)), newDescr) if c >= PQuestItem_maxCount[this_2] then call dispatch_PQuestItem_setCompleted(this_2, playerId) endif return completed endfunction function dispatch_PQuestItem_incCounter takes integer this_2, integer playerId returns boolean local boolean incCounter_result if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.incCounter", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.incCounter on invalid object.", 0, 0, false) endif endif set incCounter_result = PQuestItem_incCounter(this_2, playerId) return incCounter_result endfunction function closure_impl_20 takes nothing returns nothing local integer qi local group wurst__iterator3 local unit u local integer pid if dispatch_HashMap_has(PQuest_raw2qi, GetItemTypeId(GetManipulatedItem())) then set qi = dispatch_HashMap_get(PQuest_raw2qi, GetItemTypeId(GetManipulatedItem())) call group_clear(TempGroups_ENUM_GROUP) call group_enumUnitsInRange(TempGroups_ENUM_GROUP, unit_getPos(GetTriggerUnit()), unit_getPos_return_y, PQuest_QUEST_EVENT_RANGE) set wurst__iterator3 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator3) set u = group_next(wurst__iterator3) if unit_xIsHero(u) then set pid = player_getId(unit_getOwner(u)) if dispatch_PQuestItem_getState(qi, pid) == 1 then if dispatch_PQuestItem_getCounterMax(qi) > 0 then call dispatch_PQuestItem_incCounter(qi, pid) else call dispatch_PQuestItem_setCompleted(qi, pid) endif endif endif endloop call group_close(wurst__iterator3) endif set wurst__iterator3 = null set u = null endfunction function trigger_disable takes trigger this_2 returns nothing call DisableTrigger(this_2) endfunction function trigger_enable takes trigger this_2 returns nothing call EnableTrigger(this_2) endfunction function closure_impl_21 takes nothing returns nothing if IsTriggerEnabled(TestUtils_smartCoordsTrigger) then call trigger_disable(TestUtils_smartCoordsTrigger) call print("Testutils: Smart Coords disabled") else call trigger_enable(TestUtils_smartCoordsTrigger) call print("Testutils: Smart Coords enabled") endif endfunction function closure_impl_22 takes nothing returns nothing local unit creep = GetTriggerUnit() local integer qi local group wurst__iterator4 local unit u local integer pid if dispatch_HashMap_has(PQuest_raw2qi, GetUnitTypeId(creep)) then set qi = dispatch_HashMap_get(PQuest_raw2qi, GetUnitTypeId(creep)) call group_clear(TempGroups_ENUM_GROUP) call group_enumUnitsInRange(TempGroups_ENUM_GROUP, unit_getPos(creep), unit_getPos_return_y, PQuest_QUEST_EVENT_RANGE) set wurst__iterator4 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator4) set u = group_next(wurst__iterator4) if unit_xIsHero(u) then set pid = player_getId(unit_getOwner(u)) if dispatch_PQuestItem_getState(qi, pid) == 1 then if dispatch_PQuestItem_getCounterMax(qi) > 0 then call dispatch_PQuestItem_incCounter(qi, pid) else call dispatch_PQuestItem_setCompleted(qi, pid) endif endif endif endloop call group_close(wurst__iterator4) endif set creep = null set wurst__iterator4 = null set u = null endfunction function InventoryIterator_getCurrentSlotId takes integer this_2 returns integer return InventoryIterator_nextSlot[this_2] endfunction function dispatch_InventoryIterator_getCurrentSlotId takes integer this_2 returns integer local integer getCurrentSlotId_result if InventoryIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling InventoryIterator.getCurrentSlotId", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called InventoryIterator.getCurrentSlotId on invalid object.", 0, 0, false) endif endif set getCurrentSlotId_result = InventoryIterator_getCurrentSlotId(this_2) return getCurrentSlotId_result endfunction function InventoryIterator_findNextNonemptySlot takes integer this_2 returns nothing loop exitwhen not (InventoryIterator_nextSlot[this_2] < 6 and UnitItemInSlot(InventoryIterator_u[this_2], InventoryIterator_nextSlot[this_2] + 1) == null) set InventoryIterator_nextSlot[this_2] = InventoryIterator_nextSlot[this_2] + 1 endloop endfunction function dispatch_InventoryIterator_findNextNonemptySlot takes integer this_2 returns nothing if InventoryIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling InventoryIterator.findNextNonemptySlot", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called InventoryIterator.findNextNonemptySlot on invalid object.", 0, 0, false) endif endif call InventoryIterator_findNextNonemptySlot(this_2) endfunction function InventoryIterator_hasNext takes integer this_2 returns boolean call dispatch_InventoryIterator_findNextNonemptySlot(this_2) return InventoryIterator_nextSlot[this_2] < 6 endfunction function dispatch_InventoryIterator_hasNext takes integer this_2 returns boolean local boolean hasNext_result if InventoryIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling InventoryIterator.hasNext", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called InventoryIterator.hasNext on invalid object.", 0, 0, false) endif endif set hasNext_result = InventoryIterator_hasNext(this_2) return hasNext_result endfunction function InventoryIterator_next takes integer this_2 returns item set InventoryIterator_nextSlot[this_2] = InventoryIterator_nextSlot[this_2] + 1 return UnitItemInSlot(InventoryIterator_u[this_2], InventoryIterator_nextSlot[this_2]) endfunction function dispatch_InventoryIterator_next takes integer this_2 returns item local item next_result if InventoryIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling InventoryIterator.next", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called InventoryIterator.next on invalid object.", 0, 0, false) endif endif set next_result = InventoryIterator_next(this_2) set dispatch_InventoryIterator_nexttempReturn = next_result set next_result = null return dispatch_InventoryIterator_nexttempReturn endfunction function group_destr takes group this_2 returns nothing call DestroyGroup(this_2) endfunction function getSelectedUnit takes player p returns unit local group g = CreateGroup() local unit u call SyncSelections() call GroupEnumUnitsSelected(g, p, null) set u = FirstOfGroup(g) call group_destr(g) set getSelectedUnittempReturn = u set g = null set u = null return getSelectedUnittempReturn endfunction function alloc_InventoryIterator takes nothing returns integer local integer this_2 if InventoryIterator_firstFree == 0 then set InventoryIterator_maxIndex = InventoryIterator_maxIndex + 1 set this_2 = InventoryIterator_maxIndex else set InventoryIterator_firstFree = InventoryIterator_firstFree - 1 set this_2 = InventoryIterator_nextFree[InventoryIterator_firstFree] endif set InventoryIterator_typeId[this_2] = 757 return this_2 endfunction function construct_InventoryIterator takes integer this_2, unit u returns nothing set InventoryIterator_u[this_2] = u set InventoryIterator_nextSlot[this_2] = -1 endfunction function new_InventoryIterator takes unit u returns integer local integer this_2 = alloc_InventoryIterator() call construct_InventoryIterator(this_2, u) return this_2 endfunction function closure_impl_23 takes nothing returns nothing local integer iter = new_InventoryIterator(getSelectedUnit(GetTriggerPlayer())) local item itm loop exitwhen not dispatch_InventoryIterator_hasNext(iter) set itm = dispatch_InventoryIterator_next(iter) call print(item_getName(itm) + " in slot " + int_toString(dispatch_InventoryIterator_getCurrentSlotId(iter))) endloop set itm = null endfunction function closure_impl_24 takes nothing returns nothing set GameTimer_currentTime = GameTimer_currentTime + Basics_ANIMATION_PERIOD endfunction function PQuest_getState takes integer this_2, integer playerId returns integer return dispatch_HashMap_get(PQuest_state[this_2], playerId) endfunction function dispatch_PQuest_getState takes integer this_2, integer playerId returns integer local integer getState_result if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.getState", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.getState on invalid object.", 0, 0, false) endif endif set getState_result = PQuest_getState(this_2, playerId) return getState_result endfunction function PQuest_setDiscovered takes integer this_2, integer playerId returns nothing local quest q = questFromIndex(dispatch_HashMap_get(PQuest_thisQuest[this_2], playerId)) local integer wurst__iterator1 local integer qi call dispatch_HashMap_put(PQuest_state[this_2], playerId, 1) call questMsg(playerId, "New Quest Discovered: " + PQuest_title[this_2]) if GetLocalPlayer() == Player_players[playerId] then call QuestSetEnabled(q, true) endif set wurst__iterator1 = dispatch_LinkedList_iterator(PQuest_questItems[this_2]) loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator1) set qi = dispatch_LLIterator_next(wurst__iterator1) if PQuestItem_initDiscovered[qi] then call dispatch_PQuestItem_setDiscovered(qi, playerId) endif endloop call dispatch_LLIterator_close(wurst__iterator1) set q = null endfunction function dispatch_PQuest_setDiscovered takes integer this_2, integer playerId returns nothing if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.setDiscovered", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.setDiscovered on invalid object.", 0, 0, false) endif endif call PQuest_setDiscovered(this_2, playerId) endfunction function unit_getHeroType takes unit this_2 returns integer local integer ht = 0 local integer temp = unit_getTypeId(this_2) if temp == 1212493873 then set ht = 0 elseif temp == 1212493874 then set ht = 1 elseif temp == 1212493875 then set ht = 2 elseif temp == 1212493876 then set ht = 3 endif return ht endfunction function giveItem takes integer playerId returns nothing local integer ht = unit_getHeroType(xGetPlayerHero(playerId)) local integer temp = ht if temp == 0 then call xCreateItemForPlayerHero(playerId, 1227960369) elseif temp == 1 then call xCreateItemForPlayerHero(playerId, 1227960370) elseif temp == 2 then call xCreateItemForPlayerHero(playerId, 1227960371) elseif temp == 3 then call xCreateItemForPlayerHero(playerId, 1227960370) endif endfunction function closure_impl_25 takes integer this_2, integer playerId, unit npc returns nothing call giveItem(playerId) endfunction function dispatch_TalkAction_onTalk takes integer this_2, integer playerId, unit npc returns nothing if TalkAction_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling TalkAction.onTalk", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called TalkAction.onTalk on invalid object.", 0, 0, false) endif endif call closure_impl_25(this_2, playerId, npc) endfunction function closure_impl_26 takes nothing returns nothing local integer pid local unit npc local integer q local integer qi if unit_getTypeId(GetSoldUnit()) == PQuestGen_TALK_DUMMY then call UnitApplyTimedLife(GetSoldUnit(), 1112820806, 1.) set pid = player_getId(unit_getOwner(GetBuyingUnit())) set npc = GetTriggerUnit() if dispatch_HashMap_has(PQuest_npc2QuestDiscoverOnTalk[pid], unitToIndex(npc)) then set q = dispatch_HashMap_get(PQuest_npc2QuestDiscoverOnTalk[pid], unitToIndex(npc)) if dispatch_PQuest_getState(q, pid) == 0 then if PQuest_talkText[q] != null then call printTimedToPlayer(PQuest_talkText[q] + "\n\n", PQuest_TALK_DURATION, Player_players[pid]) endif if PQuest_talkAction[q] != 0 then call dispatch_TalkAction_onTalk(PQuest_talkAction[q], pid, npc) endif call dispatch_PQuest_setDiscovered(q, pid) call unitRemoveQuestMarks(npc, pid) endif endif if dispatch_HashMap_has(PQuest_talkNpc2qi, unitToIndex(npc)) then set qi = dispatch_HashMap_get(PQuest_talkNpc2qi, unitToIndex(npc)) if dispatch_PQuestItem_getState(qi, pid) == 1 then if PQuestItem_talkText[qi] != null then call printTimedToPlayer(PQuestItem_talkText[qi] + "\n\n", PQuest_TALK_DURATION, Player_players[pid]) endif if PQuestItem_talkAction[qi] != 0 then call dispatch_TalkAction_onTalk(PQuestItem_talkAction[qi], pid, npc) endif call unitRemoveQuestMarks(npc, pid) call dispatch_PQuestItem_setCompleted(qi, pid) endif endif endif set npc = null endfunction function closure_impl_27 takes nothing returns boolean local integer tu = getThreatUnit(GetFilterUnit()) return ThreatHandlerTU_u[tu] != null and ThreatHandlerTU_camp[tu] != 0 and ( not IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD)) and ThreatHandlerTU_state[tu] == 0 endfunction function closure_impl_28 takes nothing returns nothing if GetLocalPlayer() == GetTriggerPlayer() then call ClearTextMessages() endif endfunction function EventModule_fire_2 takes nothing returns nothing call trigger_evaluate(EventModule_trig_2) endfunction function UnitIndex_onDestroy takes integer this_2 returns nothing local unit tmp = UnitDeindexEvent_deindexedUnit set UnitDeindexEvent_deindexedUnit = UnitIndex_u[this_2] call EventModule_fire_2() set UnitDeindexEvent_deindexedUnit = tmp call unit_setUserData(UnitIndex_u[this_2], 0) set tmp = null endfunction function dealloc_ThreatHandlerCamp takes integer obj returns nothing if ThreatHandlerCamp_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type ThreatHandlerCamp", 0, 0, false) else set ThreatHandlerCamp_nextFree[ThreatHandlerCamp_firstFree] = obj set ThreatHandlerCamp_firstFree = ThreatHandlerCamp_firstFree + 1 set ThreatHandlerCamp_typeId[obj] = 0 endif endfunction function dealloc_ThreatHandlerTU takes integer obj returns nothing if ThreatHandlerTU_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type ThreatHandlerTU", 0, 0, false) else set ThreatHandlerTU_nextFree[ThreatHandlerTU_firstFree] = obj set ThreatHandlerTU_firstFree = ThreatHandlerTU_firstFree + 1 set ThreatHandlerTU_typeId[obj] = 0 endif endfunction function ThreatHandlerCamp_removeIncombatList takes integer this_2 returns nothing if ThreatHandlerCamp_icListId[this_2] != 0 then set ThreatHandler_icList[ThreatHandlerCamp_icListId[this_2]] = ThreatHandler_icList[ThreatHandler_icListLast] set ThreatHandler_icListLast = ThreatHandler_icListLast - 1 set ThreatHandlerCamp_icListId[this_2] = 0 endif endfunction function dispatch_ThreatHandlerCamp_removeIncombatList takes integer this_2 returns nothing if ThreatHandlerCamp_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerCamp.removeIncombatList", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerCamp.removeIncombatList on invalid object.", 0, 0, false) endif endif call ThreatHandlerCamp_removeIncombatList(this_2) endfunction function alloc_ThreatUnitIterator takes nothing returns integer local integer this_2 if ThreatUnitIterator_firstFree == 0 then set ThreatUnitIterator_maxIndex = ThreatUnitIterator_maxIndex + 1 set this_2 = ThreatUnitIterator_maxIndex else set ThreatUnitIterator_firstFree = ThreatUnitIterator_firstFree - 1 set this_2 = ThreatUnitIterator_nextFree[ThreatUnitIterator_firstFree] endif set ThreatUnitIterator_typeId[this_2] = 691 return this_2 endfunction function construct_ThreatUnitIterator takes integer this_2, integer tu returns nothing set ThreatUnitIterator_tu[this_2] = tu set ThreatUnitIterator_current[this_2] = ThreatHandlerTU_dummy[tu] endfunction function new_ThreatUnitIterator takes integer tu returns integer local integer this_2 = alloc_ThreatUnitIterator() call construct_ThreatUnitIterator(this_2, tu) return this_2 endfunction function ThreatHandlerTU_iterator takes integer this_2 returns integer return new_ThreatUnitIterator(this_2) endfunction function dispatch_ThreatHandlerTU_iterator takes integer this_2 returns integer local integer iterator_result if ThreatHandlerTU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerTU.iterator", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerTU.iterator on invalid object.", 0, 0, false) endif endif set iterator_result = ThreatHandlerTU_iterator(this_2) return iterator_result endfunction function ThreatUnitIterator_close takes integer this_2 returns nothing endfunction function dispatch_ThreatUnitIterator_close takes integer this_2 returns nothing if ThreatUnitIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatUnitIterator.close", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatUnitIterator.close on invalid object.", 0, 0, false) endif endif call ThreatUnitIterator_close(this_2) endfunction function ThreatUnitIterator_hasNext takes integer this_2 returns boolean return ThreatListEntry_tuNext[ThreatUnitIterator_current[this_2]] != ThreatHandlerTU_dummy[ThreatUnitIterator_tu[this_2]] endfunction function dispatch_ThreatUnitIterator_hasNext takes integer this_2 returns boolean local boolean hasNext_result if ThreatUnitIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatUnitIterator.hasNext", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatUnitIterator.hasNext on invalid object.", 0, 0, false) endif endif set hasNext_result = ThreatUnitIterator_hasNext(this_2) return hasNext_result endfunction function ThreatUnitIterator_next takes integer this_2 returns integer set ThreatUnitIterator_current[this_2] = ThreatListEntry_tuNext[ThreatUnitIterator_current[this_2]] return ThreatUnitIterator_current[this_2] endfunction function dispatch_ThreatUnitIterator_next takes integer this_2 returns integer local integer next_result if ThreatUnitIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatUnitIterator.next", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatUnitIterator.next on invalid object.", 0, 0, false) endif endif set next_result = ThreatUnitIterator_next(this_2) return next_result endfunction function unit_issueImmediateOrderById takes unit this_2, integer id returns boolean return IssueImmediateOrderById(this_2, id) endfunction function cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU takes integer funcChoice, integer this_2, integer tu returns nothing local integer wurst__iterator1 local integer e if funcChoice == 0 then if ThreatHandlerTU_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerTU.destroyThreatHandlerTU", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerTU.destroyThreatHandlerTU on invalid object.", 0, 0, false) endif endif call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(1, this_2, 0) elseif funcChoice == 1 then call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(2, this_2, 0) call dealloc_ThreatHandlerTU(this_2) elseif funcChoice == 2 then if ThreatHandlerTU_camp[this_2] != 0 then set wurst__iterator1 = dispatch_ThreatHandlerTU_iterator(this_2) loop exitwhen not dispatch_ThreatUnitIterator_hasNext(wurst__iterator1) set e = dispatch_ThreatUnitIterator_next(wurst__iterator1) call dispatch_ThreatListEntry_destroyThreatListEntry(e) endloop call dispatch_ThreatUnitIterator_close(wurst__iterator1) call dispatch_ThreatListEntry_destroyThreatListEntry(ThreatHandlerTU_dummy[this_2]) call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(3, ThreatHandlerTU_camp[this_2], this_2) call trigger_destr(ThreatHandlerTU_targetAcquireTrigger[this_2]) if ThreatHandlerTU_state[this_2] == 2 then call unit_issueImmediateOrderById(ThreatHandlerTU_u[this_2], 851972) call SetUnitInvulnerable(ThreatHandlerTU_u[this_2], false) if IsUnitPaused(ThreatHandlerTU_u[this_2]) then call unit_unpause(ThreatHandlerTU_u[this_2]) endif endif set ThreatHandlerTU_u[this_2] = null endif elseif funcChoice == 3 then if ThreatHandlerCamp_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerCamp.remove", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerCamp.remove on invalid object.", 0, 0, false) endif endif call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(4, this_2, tu) elseif funcChoice == 4 then set ThreatHandlerTU_campPrev[ThreatHandlerTU_campNext[tu]] = ThreatHandlerTU_campPrev[tu] set ThreatHandlerTU_campNext[ThreatHandlerTU_campPrev[tu]] = ThreatHandlerTU_campNext[tu] set ThreatHandlerTU_camp[tu] = 0 if ThreatHandlerTU_campNext[ThreatHandlerCamp_dummy[this_2]] == ThreatHandlerCamp_dummy[this_2] then call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(5, this_2, 0) endif elseif funcChoice == 5 then if ThreatHandlerCamp_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerCamp.destroyThreatHandlerCamp", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerCamp.destroyThreatHandlerCamp on invalid object.", 0, 0, false) endif endif call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(6, this_2, 0) elseif funcChoice == 6 then call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(7, this_2, 0) call dealloc_ThreatHandlerCamp(this_2) elseif funcChoice == 7 then call dispatch_ThreatHandlerCamp_removeIncombatList(this_2) call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(0, ThreatHandlerCamp_dummy[this_2], 0) endif endfunction function BuffList_onDestroy takes integer this_2 returns nothing call dispatch_LinkedList_destroyLinkedList(BuffList_buffs[this_2]) endfunction function dealloc_BuffList takes integer obj returns nothing if BuffList_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type BuffList", 0, 0, false) else set BuffList_nextFree[BuffList_firstFree] = obj set BuffList_firstFree = BuffList_firstFree + 1 set BuffList_typeId[obj] = 0 endif endfunction function destroyBuffList takes integer this_2 returns nothing call BuffList_onDestroy(this_2) call dealloc_BuffList(this_2) endfunction function dispatch_BuffList_destroyBuffList takes integer this_2 returns nothing if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.destroyBuffList", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.destroyBuffList on invalid object.", 0, 0, false) endif endif call destroyBuffList(this_2) endfunction function UnitDamageHandler_onDestroy takes integer this_2 returns nothing endfunction function dealloc_UnitDamageHandler takes integer obj returns nothing if UnitDamageHandler_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type UnitDamageHandler", 0, 0, false) else set UnitDamageHandler_nextFree[UnitDamageHandler_firstFree] = obj set UnitDamageHandler_firstFree = UnitDamageHandler_firstFree + 1 set UnitDamageHandler_typeId[obj] = 0 endif endfunction function destroyUnitDamageHandler takes integer this_2 returns nothing call UnitDamageHandler_onDestroy(this_2) call dealloc_UnitDamageHandler(this_2) endfunction function dispatch_UnitDamageHandler_destroyUnitDamageHandler takes integer this_2 returns nothing if UnitDamageHandler_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitDamageHandler.destroyUnitDamageHandler", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitDamageHandler.destroyUnitDamageHandler on invalid object.", 0, 0, false) endif endif call destroyUnitDamageHandler(this_2) endfunction function UnitStatBuffer_onDestroy takes integer this_2 returns nothing set StatHandler_mapUnitStatBuffers[getUnitIndex(UnitStatBuffer_u[this_2])] = 0 endfunction function dealloc_UnitStatBuffer takes integer obj returns nothing if UnitStatBuffer_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type UnitStatBuffer", 0, 0, false) else set UnitStatBuffer_nextFree[UnitStatBuffer_firstFree] = obj set UnitStatBuffer_firstFree = UnitStatBuffer_firstFree + 1 set UnitStatBuffer_typeId[obj] = 0 endif endfunction function destroyUnitStatBuffer takes integer this_2 returns nothing call UnitStatBuffer_onDestroy(this_2) call dealloc_UnitStatBuffer(this_2) endfunction function dispatch_UnitStatBuffer_destroyUnitStatBuffer takes integer this_2 returns nothing if UnitStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitStatBuffer.destroyUnitStatBuffer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitStatBuffer.destroyUnitStatBuffer on invalid object.", 0, 0, false) endif endif call destroyUnitStatBuffer(this_2) endfunction function unitDisableOOCRegen takes unit u returns nothing local integer wurst__iterator0 = dispatch_LinkedList_iterator(OOCRegen_oocrUnits) local integer obj loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator0) set obj = dispatch_LLIterator_next(wurst__iterator0) if OOCRUnit_u[obj] == u then call dispatch_LinkedList_remove(OOCRegen_oocrUnits, obj) exitwhen true endif endloop call dispatch_LLIterator_close(wurst__iterator0) endfunction function UnitData_onDestroy takes integer this_2 returns nothing call dispatch_UnitStatBuffer_destroyUnitStatBuffer(UnitData_unitStatBuffer[this_2]) call dispatch_UnitDamageHandler_destroyUnitDamageHandler(UnitData_unitDamageHandler[this_2]) call dispatch_BuffList_destroyBuffList(UnitData_unitBuffList[this_2]) if UnitData_threatHandlerPu[this_2] != 0 then call dispatch_ThreatHandlerPU_destroyThreatHandlerPU(UnitData_threatHandlerPu[this_2]) endif if UnitData_threatHandlerTu[this_2] != 0 then call cyc_dispatch_ThreatHandlerTU_destroyThreatHandlerTU(0, UnitData_threatHandlerTu[this_2], 0) endif if unit_xIsHero(UnitIndex_u[this_2]) then call unitDisableOOCRegen(UnitIndex_u[this_2]) endif call UnitIndex_onDestroy(this_2) endfunction function dealloc_UnitData takes integer obj returns nothing if UnitIndex_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type UnitData", 0, 0, false) else set UnitIndex_nextFree[UnitIndex_firstFree] = obj set UnitIndex_firstFree = UnitIndex_firstFree + 1 set UnitIndex_typeId[obj] = 0 endif endfunction function destroyUnitData takes integer this_2 returns nothing call UnitData_onDestroy(this_2) call dealloc_UnitData(this_2) endfunction function dispatch_UnitData_destroyUnitData takes integer this_2 returns nothing if UnitIndex_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitData.destroyUnitData", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitData.destroyUnitData on invalid object.", 0, 0, false) endif endif call destroyUnitData(this_2) endfunction function closure_impl_29 takes nothing returns nothing local timer t = GetExpiredTimer() call dispatch_UnitData_destroyUnitData(timer_getData(t)) call timer_release(t) set t = null endfunction function PlayerData_getLearnPointsStats takes integer this_2 returns integer return PlayerData_learnPointsStats[this_2] endfunction function dispatch_PlayerData_getLearnPointsStats takes integer this_2 returns integer local integer getLearnPointsStats_result if PlayerData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PlayerData.getLearnPointsStats", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PlayerData.getLearnPointsStats on invalid object.", 0, 0, false) endif endif set getLearnPointsStats_result = PlayerData_getLearnPointsStats(this_2) return getLearnPointsStats_result endfunction function printStat takes player p, string statName, string prefix, integer val, string suffix returns nothing call printTimedToPlayer("|cffffcc00" + statName + ":|r " + prefix + "" + int_toString(val) + " " + suffix, 10., p) endfunction function xGetPlayerData takes integer playerId returns integer return PlayerData_playerData[playerId] endfunction function closure_impl_30 takes nothing returns nothing local player p = GetTriggerPlayer() local integer sbuf if xGetPlayerHero(player_getId(p)) != null then set sbuf = UnitData_unitStatBuffer[unit_xGetUnitData(xGetPlayerHero(player_getId(p)))] call printStat(p, "Life", "", dispatch_UnitStatBuffer_get(sbuf, 0), "") call printStat(p, "Mana", "", dispatch_UnitStatBuffer_get(sbuf, 1), "") call printStat(p, "Strength", "", dispatch_UnitStatBuffer_get(sbuf, 4), "") call printStat(p, "Agility", "", dispatch_UnitStatBuffer_get(sbuf, 5), "") call printStat(p, "Intelligence", "", dispatch_UnitStatBuffer_get(sbuf, 6), "") call printStat(p, "Attack Power", "", dispatch_UnitStatBuffer_get(sbuf, 10), "(total)") call printStat(p, "Attack Power", "", dispatch_UnitStatBuffer_get(sbuf, 11), "% (relativ bonus)") call printStat(p, "Armor", "", dispatch_UnitStatBuffer_get(sbuf, 12), "") call printStat(p, "Attackspeed", "", dispatch_UnitStatBuffer_get(sbuf, 13), "%") call printStat(p, "Movespeed", "", dispatch_UnitStatBuffer_get(sbuf, 14), "") call printStat(p, "Evasion Chance", "", dispatch_UnitStatBuffer_get(sbuf, 15), "%") call printStat(p, "Crit Chance", "", dispatch_UnitStatBuffer_get(sbuf, 16), "%") call printStat(p, "Crit Multiplier", "", dispatch_UnitStatBuffer_get(sbuf, 17), "% (of attackpower)") call printStat(p, "Crit Bonusdamage", "", dispatch_UnitStatBuffer_get(sbuf, 18), "(applied after multiplier)") call printStat(p, "Heal Received", "", dispatch_UnitStatBuffer_get(sbuf, 19), "%") call printStat(p, "Attack Threat", "", dispatch_UnitStatBuffer_get(sbuf, 20), "% (increased threat from normal attacks)") call printStat(p, "Casttime", "-", dispatch_UnitStatBuffer_get(sbuf, 21), "%") call printStat(p, "Learn points (attributes)", "", dispatch_PlayerData_getLearnPointsStats(xGetPlayerData(player_getId(p))), "") endif set p = null endfunction function hashtable_loadUnitHandle takes hashtable this_2, integer parentKey, integer childKey returns unit return LoadUnitHandle(this_2, parentKey, childKey) endfunction function Table_loadUnit takes integer this_2, integer parentKey returns unit return hashtable_loadUnitHandle(Table_ht, this_2, parentKey) endfunction function dispatch_Table_loadUnit takes integer this_2, integer parentKey returns unit local unit loadUnit_result if Table_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Table.loadUnit", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Table.loadUnit on invalid object.", 0, 0, false) endif endif set loadUnit_result = Table_loadUnit(this_2, parentKey) set dispatch_Table_loadUnittempReturn = loadUnit_result set loadUnit_result = null return dispatch_Table_loadUnittempReturn endfunction function closure_impl_31 takes nothing returns nothing local timer t = GetExpiredTimer() call DummyRecycler_recycle_2(dispatch_Table_loadUnit(DummyCaster_delayTable, timer_getData(t))) call timer_release(t) set t = null endfunction function int_xGetItemTypeData takes integer this_2 returns integer return dispatch_HashMap_get(ItemTypeData_raw2ItemTypeData, this_2) endfunction function dropItem takes nothing returns nothing local unit u local item i if not HeroInventory_blockEvents then set u = GetTriggerUnit() set i = GetManipulatedItem() if not (GetItemType(i) == ITEM_TYPE_POWERUP) then if unit_xIsHero(u) and ItemTypeData_itemClass[int_xGetItemTypeData(GetItemTypeId(i))] == 0 then call dispatch_UnitStatBuffer_remove(UnitData_unitStatBuffer[unit_xGetUnitData(u)], ItemTypeData_stats[int_xGetItemTypeData(GetItemTypeId(i))]) endif endif endif set u = null set i = null endfunction function PlayerData_onDestroy takes integer this_2 returns nothing call dispatch_StatList_destroyStatList(PlayerData_learnedStats[this_2]) call dispatch_UnitData_destroyUnitData(unit_xGetUnitData(PlayerData_hero[this_2])) call unit_remove(PlayerData_hero[this_2]) set PlayerData_playerData[PlayerData_playerId[this_2]] = 0 endfunction function dealloc_PlayerData takes integer obj returns nothing if PlayerData_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type PlayerData", 0, 0, false) else set PlayerData_nextFree[PlayerData_firstFree] = obj set PlayerData_firstFree = PlayerData_firstFree + 1 set PlayerData_typeId[obj] = 0 endif endfunction function destroyPlayerData takes integer this_2 returns nothing call PlayerData_onDestroy(this_2) call dealloc_PlayerData(this_2) endfunction function dispatch_PlayerData_destroyPlayerData takes integer this_2 returns nothing if PlayerData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PlayerData.destroyPlayerData", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PlayerData.destroyPlayerData on invalid object.", 0, 0, false) endif endif call destroyPlayerData(this_2) endfunction function alloc_PlayerData takes nothing returns integer local integer this_2 if PlayerData_firstFree == 0 then set PlayerData_maxIndex = PlayerData_maxIndex + 1 set this_2 = PlayerData_maxIndex else set PlayerData_firstFree = PlayerData_firstFree - 1 set this_2 = PlayerData_nextFree[PlayerData_firstFree] endif set PlayerData_typeId[this_2] = 683 return this_2 endfunction function playerCreateBag takes integer playerId returns nothing if Bag_playerBagUnit[playerId] == null then set Bag_playerBagUnit[playerId] = createUnit(Player_players[playerId], BagObjGen_BAG_RAW, unit_getPos(xGetPlayerHero(playerId)), unit_getPos_return_y, 0.) endif endfunction function construct_PlayerData takes integer this_2, integer playerId, unit hero returns nothing set PlayerData_playerData[playerId] = this_2 set PlayerData_playerId[this_2] = playerId set PlayerData_hero[this_2] = hero call new_UnitData(hero) call playerCreateBag(playerId) set PlayerData_learnPointsStats[this_2] = 0 set PlayerData_learnPointsTalents[this_2] = 0 set PlayerData_learnedStats[this_2] = new_StatList() set PlayerData_learnedStr[this_2] = 0 set PlayerData_learnedAgi[this_2] = 0 set PlayerData_learnedInt[this_2] = 0 call dispatch_UnitStatBuffer_apply(UnitData_unitStatBuffer[unit_xGetUnitData(hero)], PlayerData_learnedStats[this_2]) endfunction function new_PlayerData takes integer playerId, unit hero returns integer local integer this_2 = alloc_PlayerData() call construct_PlayerData(this_2, playerId, hero) return this_2 endfunction function initPlayerData takes integer playerId, unit hero returns nothing if PlayerData_playerData[playerId] != 0 then call dispatch_PlayerData_destroyPlayerData(PlayerData_playerData[playerId]) endif call new_PlayerData(playerId, hero) endfunction function player_getName takes player this_2 returns string return GetPlayerName(this_2) endfunction function printTimed takes string msg, real duration returns nothing call DisplayTimedTextToPlayer(GetLocalPlayer(), 0., 0., duration, msg) endfunction function heroPickedAction takes nothing returns nothing local player p = unit_getOwner(GetBuyingUnit()) local integer pid = player_getId(p) local unit hero = null local integer temp = unit_getTypeId(GetSoldUnit()) local unit receiver local unit receiver_2 local unit receiver_3 local unit receiver_4 local unit receiver_5 local unit receiver_6 local unit receiver_7 local unit receiver_8 local unit receiver_9 local unit receiver_10 local unit receiver_11 local unit receiver_12 local unit receiver_13 local unit receiver_14 local unit receiver_15 local unit receiver_16 if temp == HeropickObjectGen_RAW_DUMMY_WARRIOR then set receiver = createUnit(p, 1212493873, Heropick_heroStartPos_x, Heropick_heroStartPos_y, 0.) call unit_addAbility(receiver, 1095970866) set receiver_2 = receiver call unit_addAbility(receiver_2, 1095970867) set receiver_3 = receiver_2 call unit_addAbility(receiver_3, 1095971122) set receiver_4 = receiver_3 call unit_addAbility(receiver_4, TalentList_BOOK_TALENT_WARRIOR) set hero = receiver_4 elseif temp == HeropickObjectGen_RAW_DUMMY_PRIEST then set receiver_5 = createUnit(p, 1212493874, Heropick_heroStartPos_x, Heropick_heroStartPos_y, 0.) call unit_addAbility(receiver_5, 1095970865) set receiver_6 = receiver_5 call unit_addAbility(receiver_6, 1095970868) set receiver_7 = receiver_6 call unit_addAbility(receiver_7, 1095970873) set receiver_8 = receiver_7 call unit_addAbility(receiver_8, TalentList_BOOK_TALENT_PRIEST) set hero = receiver_8 elseif temp == HeropickObjectGen_RAW_DUMMY_RANGER then set receiver_9 = createUnit(p, 1212493875, Heropick_heroStartPos_x, Heropick_heroStartPos_y, 0.) call unit_addAbility(receiver_9, 1095970871) set receiver_10 = receiver_9 call unit_addAbility(receiver_10, 1095970872) set receiver_11 = receiver_10 call unit_addAbility(receiver_11, 1095971121) set receiver_12 = receiver_11 call unit_addAbility(receiver_12, TalentList_BOOK_TALENT_RANGER) set hero = receiver_12 elseif temp == HeropickObjectGen_RAW_DUMMY_DRUID then set receiver_13 = createUnit(p, 1212493876, Heropick_heroStartPos_x, Heropick_heroStartPos_y, 0.) call unit_addAbility(receiver_13, 1095970869) set receiver_14 = receiver_13 call unit_addAbility(receiver_14, 1095970870) set receiver_15 = receiver_14 call unit_addAbility(receiver_15, 1095971120) set receiver_16 = receiver_15 call unit_addAbility(receiver_16, TalentList_BOOK_TALENT_DRUID) set hero = receiver_16 endif call initPlayerData(pid, hero) call printTimed(player_getName(p) + " picked: |cffffcc00" + unit_getName(hero), 4.) call SetCameraPositionForPlayer(p, Heropick_heroStartPos_x, Heropick_heroStartPos_y) call SelectUnitForPlayerSingle(hero, p) call unit_remove(GetSoldUnit()) call unit_remove(GetBuyingUnit()) call dispatch_PQuest_setDiscoverable(QuestProvingYourWorth_pqProveWorth, pid, udg_npc_bryce) set p = null set hero = null set receiver = null set receiver_2 = null set receiver_3 = null set receiver_4 = null set receiver_5 = null set receiver_6 = null set receiver_7 = null set receiver_8 = null set receiver_9 = null set receiver_10 = null set receiver_11 = null set receiver_12 = null set receiver_13 = null set receiver_14 = null set receiver_15 = null set receiver_16 = null endfunction function hideItem takes nothing returns nothing if IsItemVisible(GetEnumItem()) then set Terrain_hid[Terrain_hidMax] = GetEnumItem() call SetItemVisible(Terrain_hid[Terrain_hidMax], false) set Terrain_hidMax = Terrain_hidMax + 1 endif endfunction function player_setState takes player this_2, playerstate state, integer val returns nothing call SetPlayerState(this_2, state, val) endfunction function PlayerData_incLearnPointsStats takes integer this_2, integer add returns nothing set PlayerData_learnPointsStats[this_2] = PlayerData_learnPointsStats[this_2] + add call player_setState(Player_players[PlayerData_playerId[this_2]], PLAYER_STATE_RESOURCE_FOOD_USED, PlayerData_learnPointsStats[this_2]) endfunction function dispatch_PlayerData_incLearnPointsStats takes integer this_2, integer add returns nothing if PlayerData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PlayerData.incLearnPointsStats", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PlayerData.incLearnPointsStats on invalid object.", 0, 0, false) endif endif call PlayerData_incLearnPointsStats(this_2, add) endfunction function PlayerData_incLearnedAttributes takes integer this_2, integer str, integer agi, integer inte returns nothing set PlayerData_learnedStr[this_2] = PlayerData_learnedStr[this_2] + str set PlayerData_learnedAgi[this_2] = PlayerData_learnedAgi[this_2] + agi set PlayerData_learnedInt[this_2] = PlayerData_learnedInt[this_2] + inte call dispatch_UnitStatBuffer_remove(UnitData_unitStatBuffer[unit_xGetUnitData(PlayerData_hero[this_2])], PlayerData_learnedStats[this_2]) call dispatch_StatList_destroyStatList(PlayerData_learnedStats[this_2]) set PlayerData_learnedStats[this_2] = new_StatList() call dispatch_StatList_add(PlayerData_learnedStats[this_2], 4, PlayerData_learnedStr[this_2]) call dispatch_StatList_add(PlayerData_learnedStats[this_2], 5, PlayerData_learnedAgi[this_2]) call dispatch_StatList_add(PlayerData_learnedStats[this_2], 6, PlayerData_learnedInt[this_2]) call dispatch_StatList_add(PlayerData_learnedStats[this_2], 7, PlayerData_learnedStr[this_2]) call dispatch_StatList_add(PlayerData_learnedStats[this_2], 8, PlayerData_learnedAgi[this_2]) call dispatch_StatList_add(PlayerData_learnedStats[this_2], 9, PlayerData_learnedInt[this_2]) call dispatch_UnitStatBuffer_apply(UnitData_unitStatBuffer[unit_xGetUnitData(PlayerData_hero[this_2])], PlayerData_learnedStats[this_2]) endfunction function dispatch_PlayerData_incLearnedAttributes takes integer this_2, integer str, integer agi, integer inte returns nothing if PlayerData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PlayerData.incLearnedAttributes", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PlayerData.incLearnedAttributes on invalid object.", 0, 0, false) endif endif call PlayerData_incLearnedAttributes(this_2, str, agi, inte) endfunction function simError takes player forPlayer, string message returns nothing if GetLocalPlayer() == forPlayer then call ClearTextMessages() call DisplayTimedTextToPlayer(forPlayer, .52, .96, 2., "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00" + message + "|r") call StartSound(SimError_error) endif endfunction function incAttr takes integer pid, integer str, integer agi, integer inte returns nothing if dispatch_PlayerData_getLearnPointsStats(xGetPlayerData(pid)) >= 10 then call dispatch_PlayerData_incLearnedAttributes(xGetPlayerData(pid), str, agi, inte) call dispatch_PlayerData_incLearnPointsStats(xGetPlayerData(pid), -10) else call simError(Player_players[pid], "Not enough learning points") endif endfunction function incAttributeAction takes nothing returns nothing local integer abilRaw = GetSpellAbilityId() local integer pid = player_getId(GetTriggerPlayer()) local integer temp = abilRaw if temp == 1094791218 then call incAttr(pid, 1, 0, 0) elseif temp == 1094791219 then call incAttr(pid, 0, 1, 0) elseif temp == 1094791220 then call incAttr(pid, 0, 0, 1) endif endfunction function ItemData_bind takes integer this_2, integer playerId returns nothing set ItemData_boundTo[this_2] = playerId endfunction function dispatch_ItemData_bind takes integer this_2, integer playerId returns nothing if ItemData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemData.bind", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemData.bind on invalid object.", 0, 0, false) endif endif call ItemData_bind(this_2, playerId) endfunction function itemSoldAction takes nothing returns nothing local item itm = GetSoldItem() local unit hero = GetBuyingUnit() call dispatch_ItemData_bind(new_ItemData(itm), player_getId(unit_getOwner(hero))) set itm = null set hero = null endfunction function PlayerData_getLearnPointsTalents takes integer this_2 returns integer return PlayerData_learnPointsTalents[this_2] endfunction function dispatch_PlayerData_getLearnPointsTalents takes integer this_2 returns integer local integer getLearnPointsTalents_result if PlayerData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PlayerData.getLearnPointsTalents", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PlayerData.getLearnPointsTalents on invalid object.", 0, 0, false) endif endif set getLearnPointsTalents_result = PlayerData_getLearnPointsTalents(this_2) return getLearnPointsTalents_result endfunction function PlayerData_incLearnPointsTalents takes integer this_2, integer add returns nothing set PlayerData_learnPointsTalents[this_2] = PlayerData_learnPointsTalents[this_2] + add call player_setState(Player_players[PlayerData_playerId[this_2]], PLAYER_STATE_RESOURCE_FOOD_CAP, PlayerData_learnPointsTalents[this_2]) endfunction function dispatch_PlayerData_incLearnPointsTalents takes integer this_2, integer add returns nothing if PlayerData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PlayerData.incLearnPointsTalents", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PlayerData.incLearnPointsTalents on invalid object.", 0, 0, false) endif endif call PlayerData_incLearnPointsTalents(this_2, add) endfunction function unit_xGetTalentLevel takes unit this_2, integer talent returns integer return max(0, unit_getAbilityLevel(getTalentUnit_2(this_2), Talent_raw[talent]) - 1) endfunction function learnAction takes nothing returns nothing local integer talent local integer pid local unit tu if dispatch_HashMap_has(Talent_raw2talent, GetSpellAbilityId()) then set talent = dispatch_HashMap_get(Talent_raw2talent, GetSpellAbilityId()) set pid = player_getId(unit_getOwner(GetTriggerUnit())) set tu = getTalentUnit(pid) if unit_xGetTalentLevel(tu, talent) < Talent_levels[talent] then if dispatch_PlayerData_getLearnPointsTalents(xGetPlayerData(pid)) >= 10 then call unit_setAbilityLevel(tu, Talent_raw[talent], unit_getAbilityLevel(tu, Talent_raw[talent]) + 1) call dispatch_PlayerData_incLearnPointsTalents(xGetPlayerData(pid), -10) else call simError(Player_players[pid], "Not enough talent points") endif else call simError(Player_players[pid], "Talent already has maximum level") endif endif set tu = null endfunction function levelupAction takes nothing returns nothing call dispatch_PlayerData_incLearnPointsStats(xGetPlayerData(player_getId(unit_getOwner(GetTriggerUnit()))), 10) if ModuloInteger(GetHeroLevel(GetTriggerUnit()), 2) == 0 then call dispatch_PlayerData_incLearnPointsTalents(xGetPlayerData(player_getId(unit_getOwner(GetTriggerUnit()))), 10) endif endfunction function onTimeout takes nothing returns nothing local integer pid = 0 local integer temp = Config_NUM_OF_PLAYERS - 1 local unit hero local unit bag loop exitwhen pid > temp set hero = xGetPlayerHero(pid) if hero != null then set bag = Bag_playerBagUnit[pid] if GetUnitCurrentOrder(bag) == 852001 then set Bag_blockEvents = true call IssuePointOrderById(hero, 851971, unit_getX(bag), unit_getY(bag)) set Bag_blockEvents = false endif call unit_setXY(bag, unit_getPos(hero), unit_getPos_return_y) endif set pid = pid + 1 endloop set hero = null set bag = null endfunction function widget_getX takes widget this_2 returns real return GetWidgetX(this_2) endfunction function widget_getY takes widget this_2 returns real return GetWidgetY(this_2) endfunction function orderAction takes nothing returns nothing local integer pid = player_getId(GetTriggerPlayer()) local unit hero = xGetPlayerHero(pid) local unit bag = Bag_playerBagUnit[pid] if GetTriggerUnit() == hero then if not Bag_blockEvents then set Bag_blockEvents = true call IssueImmediateOrderById(bag, 851972) set Bag_blockEvents = false endif elseif GetTriggerUnit() == bag then if not Bag_blockEvents then set Bag_blockEvents = true call unit_setXY(bag, unit_getPos(hero), unit_getPos_return_y) if GetOrderTarget() != null then call IssuePointOrder(hero, "move", widget_getX(GetOrderTarget()), widget_getY(GetOrderTarget())) endif if GetOrderPointX() != 0. and GetOrderPointY() != 0. then call IssuePointOrder(hero, "move", GetOrderPointX(), GetOrderPointY()) endif set Bag_blockEvents = false endif endif set hero = null set bag = null endfunction function alloc_SpellFirearrow takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 716 return this_2 endfunction function alloc_Closure takes nothing returns integer local integer this_2 if UnitCollision_firstFree == 0 then set UnitCollision_maxIndex = UnitCollision_maxIndex + 1 set this_2 = UnitCollision_maxIndex else set UnitCollision_firstFree = UnitCollision_firstFree - 1 set this_2 = UnitCollision_nextFree[UnitCollision_firstFree] endif set UnitCollision_typeId[this_2] = 765 return this_2 endfunction function dispatch_UnitCollision_destroyUnitCollision takes integer this_2 returns nothing endfunction function Knockback_enableCollision takes integer this_2, real size, integer action returns nothing if action == 0 then if Knockback_collisionAction[this_2] != 0 then call dispatch_UnitCollision_destroyUnitCollision(Knockback_collisionAction[this_2]) set Knockback_collisionAction[this_2] = 0 call dispatch_LinkedList_destroyLinkedList(Knockback_collisionUnits[this_2]) endif elseif Knockback_collisionAction[this_2] == 0 then set Knockback_collisionAction[this_2] = action set Knockback_collisionUnits[this_2] = new_LinkedList() endif set Knockback_collisionSize[this_2] = size endfunction function dispatch_Knockback_enableCollision takes integer this_2, real size, integer action returns nothing if Knockback_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Knockback.enableCollision", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Knockback.enableCollision on invalid object.", 0, 0, false) endif endif call Knockback_enableCollision(this_2, size, action) endfunction function SpellCharge_onCast takes integer this_2 returns nothing local unit temp = Spell_caster[this_2] local integer tempIndex = this_2 local integer receiver = new_Knockback(temp, vec2_op_minus(Spell_targetPoint[tempIndex], Spell_targetPoint_2[tempIndex], unit_getPos(Spell_caster[this_2]), unit_getPos_return_y), vec2_op_minus_return_y, .3, true, true) local integer temp_2 = receiver local integer clVar = alloc_Closure() set this[clVar] = this_2 call dispatch_Knockback_enableCollision(temp_2, 100., clVar) set temp = null endfunction function alloc_MissileFirearrow takes nothing returns integer local integer this_2 if Missile_firstFree == 0 then set Missile_maxIndex = Missile_maxIndex + 1 set this_2 = Missile_maxIndex else set Missile_firstFree = Missile_firstFree - 1 set this_2 = Missile_nextFree[Missile_firstFree] endif set Missile_typeId[this_2] = 761 return this_2 endfunction function construct_MissileFirearrow takes integer this_2, unit caster, unit target returns nothing call construct_Missile2(this_2, unit_getPos3_2(caster), unit_getPos3_return_y_2, unit_getPos3_return_z_2, 1300., 0.15, "Abilities\\Weapons\\SearingArrow\\SearingArrowMissile.mdl", target, 0.) set MissileFirearrow_casterUnit[this_2] = caster set MissileFirearrow_targetUnit[this_2] = target endfunction function new_MissileFirearrow takes unit caster, unit target returns integer local integer this_2 = alloc_MissileFirearrow() call construct_MissileFirearrow(this_2, caster, target) return this_2 endfunction function SpellFirearrow_onCast takes integer this_2 returns nothing call new_MissileFirearrow(Spell_caster[this_2], Spell_targetUnit[this_2]) endfunction function alloc_ChannelData takes nothing returns integer local integer this_2 if ChannelData_firstFree == 0 then set ChannelData_maxIndex = ChannelData_maxIndex + 1 set this_2 = ChannelData_maxIndex else set ChannelData_firstFree = ChannelData_firstFree - 1 set this_2 = ChannelData_nextFree[ChannelData_firstFree] endif set ChannelData_typeId[this_2] = 709 return this_2 endfunction function alloc_CastBar takes nothing returns integer local integer this_2 if CastBar_firstFree == 0 then set CastBar_maxIndex = CastBar_maxIndex + 1 set this_2 = CastBar_maxIndex else set CastBar_firstFree = CastBar_firstFree - 1 set this_2 = CastBar_nextFree[CastBar_firstFree] endif set CastBar_typeId[this_2] = 708 return this_2 endfunction function unit_setAnimation takes unit this_2, string animation returns nothing call SetUnitAnimation(this_2, animation) endfunction function unit_setColor takes unit this_2, playercolor c returns nothing call SetUnitColor(this_2, c) endfunction function unit_setPathing takes unit this_2, boolean value returns nothing call SetUnitPathing(this_2, value) endfunction function unit_setPos takes unit this_2, real pos_x, real pos_y returns nothing call SetUnitPosition(this_2, pos_x, pos_y) endfunction function unit_setTimeScale takes unit this_2, real scale returns nothing call SetUnitTimeScale(this_2, scale) endfunction function construct_CastBar takes integer this_2, real pos_x, real pos_y, real casttime, boolean reversed, playercolor color returns nothing local unit receiver = createUnit(Player_players[PLAYER_NEUTRAL_PASSIVE], CastBar_CASTBAR_DUMMY, pos_x, pos_y, 0.) local unit receiver_2 local unit receiver_3 local unit receiver_4 local unit receiver_5 local unit receiver_6 local unit receiver_7 call unit_addAbility(receiver, Basics_HEIGHT_ENABLER) set receiver_2 = receiver call unit_removeAbility(receiver_2, Basics_HEIGHT_ENABLER) set receiver_3 = receiver_2 call unit_setFlyHeight(receiver_3, 100., 0.) set receiver_4 = receiver_3 call unit_setPathing(receiver_4, false) set receiver_5 = receiver_4 call unit_setPos(receiver_5, pos_x, pos_y) set receiver_6 = receiver_5 call unit_setColor(receiver_6, color) set receiver_7 = receiver_6 call unit_pause(receiver_7) set CastBar_dummy[this_2] = receiver_7 if reversed then call unit_setAnimation(CastBar_dummy[this_2], "Spell") else call unit_setAnimation(CastBar_dummy[this_2], "Birth") endif call unit_setTimeScale(CastBar_dummy[this_2], 1. / casttime * 1.05000000) set receiver = null set receiver_2 = null set receiver_3 = null set receiver_4 = null set receiver_5 = null set receiver_6 = null set receiver_7 = null endfunction function new_CastBar takes real pos_x, real pos_y, real casttime, boolean reversed, playercolor color returns integer local integer this_2 = alloc_CastBar() call construct_CastBar(this_2, pos_x, pos_y, casttime, reversed, color) return this_2 endfunction function player_getColor takes player this_2 returns playercolor return GetPlayerColor(this_2) endfunction function trigger_addCondition takes trigger this_2, boolexpr condition returns nothing call TriggerAddCondition(this_2, condition) endfunction function construct_ChannelData takes integer this_2, integer parent, unit caster, real channelTime, boolean reversedBar, integer steps returns nothing local trigger receiver local trigger receiver_2 local trigger receiver_3 local trigger receiver_4 local timer receiver_5 set ChannelData_parent[this_2] = parent set ChannelData_caster[this_2] = caster set receiver = CreateTrigger() call trigger_registerUnitEvent(receiver, caster, EVENT_UNIT_ISSUED_ORDER) set receiver_2 = receiver call trigger_registerUnitEvent(receiver_2, caster, EVENT_UNIT_ISSUED_POINT_ORDER) set receiver_3 = receiver_2 call trigger_registerUnitEvent(receiver_3, caster, EVENT_UNIT_ISSUED_TARGET_ORDER) set receiver_4 = receiver_3 call trigger_addCondition(receiver_4, Filter(ref_function_ChannelData_invokeInterrupt)) set ChannelData_interruptTrigger[this_2] = receiver_4 call dispatch_HashMap_put(SpellHandler_channelDataMap, unitToIndex(caster), this_2) set receiver_5 = getTimer() call timer_setData(receiver_5, this_2) set ChannelData_channelTimer[this_2] = receiver_5 if steps >= 1 then set ChannelData_stepMax[this_2] = steps set ChannelData_stepCurrent[this_2] = 0 call timer_startPeriodic(ChannelData_channelTimer[this_2], channelTime / steps, ref_function_ChannelData_callback) else set ChannelData_stepMax[this_2] = 0 call timer_start(ChannelData_channelTimer[this_2], channelTime, ref_function_ChannelData_callback_2) endif set ChannelData_bar[this_2] = new_CastBar(unit_getPos(caster), unit_getPos_return_y, channelTime, reversedBar, player_getColor(unit_getOwner(caster))) set receiver = null set receiver_2 = null set receiver_3 = null set receiver_4 = null set receiver_5 = null endfunction function new_ChannelData takes integer parent, unit caster, real channelTime, boolean reversedBar, integer steps returns integer local integer this_2 = alloc_ChannelData() call construct_ChannelData(this_2, parent, caster, channelTime, reversedBar, steps) return this_2 endfunction function Spell_channel takes integer this_2, real channelTime, boolean reversedBar, integer steps returns nothing call new_ChannelData(this_2, Spell_caster[this_2], channelTime, reversedBar, steps) set Spell_autoDestroy[this_2] = false endfunction function dispatch_Spell_channel takes integer this_2, real channelTime, boolean reversedBar, integer steps returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Spell.channel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Spell.channel on invalid object.", 0, 0, false) endif endif call Spell_channel(this_2, channelTime, reversedBar, steps) endfunction function Spell_channel_2 takes integer this_2, real channelTime, boolean reversedBar returns nothing call dispatch_Spell_channel(this_2, channelTime, reversedBar, 0) endfunction function dispatch_Spell_channel_2 takes integer this_2, real channelTime, boolean reversedBar returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Spell.channel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Spell.channel on invalid object.", 0, 0, false) endif endif call Spell_channel_2(this_2, channelTime, reversedBar) endfunction function unit_xGetStatReal takes unit this_2, integer s returns real return unit_xGetStat(this_2, s) / 100. endfunction function SpellHeal_onCast takes integer this_2 returns nothing local real casttimeMod = 1. if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_PRIEST_HEAL_HASTE) and unit_hasBuff(Spell_targetUnit[this_2], 740) then set casttimeMod = 0.85 endif call dispatch_Spell_channel_2(this_2, SpellHeal_CHANNEL_DURATION * (1. - unit_xGetStatReal(Spell_caster[this_2], 21)) * casttimeMod, false) endfunction function SpellHolyBolt_onCast takes integer this_2 returns nothing local integer jumps = 1 set SpellHolyBolt_currentTarget[this_2] = Spell_targetUnit[this_2] call new_MissileHolyBolt(Spell_caster[this_2], Spell_caster[this_2], SpellHolyBolt_currentTarget[this_2], 2.5) if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_PRIEST_HOLYBOLT_JUMP) then set jumps = jumps + 1 endif call dispatch_Spell_channel(this_2, SpellHolyBolt_CHANNEL_DURATION * (1. - unit_xGetStatReal(Spell_caster[this_2], 21)), true, jumps) endfunction function alloc_BuffIgnoreThePain takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 743 return this_2 endfunction function construct_BuffIgnoreThePain takes integer this_2 returns nothing call construct_Buff(this_2) endfunction function new_BuffIgnoreThePain takes nothing returns integer local integer this_2 = alloc_BuffIgnoreThePain() call construct_BuffIgnoreThePain(this_2) return this_2 endfunction function SpellIgnoreThePain_onCast takes integer this_2 returns nothing call dispatch_Buff_apply(new_BuffIgnoreThePain(), Spell_caster[this_2]) endfunction function Timed_startTimer_3 takes integer this_2, real time returns nothing local timer t = getTimer() call timer_setData(t, this_2) call TimerStart(t, time, false, ref_function_Timed_timerCallback_3) set t = null endfunction function dispatch_SpellMoonlightShadow_startTimer takes integer this_2, real time returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling SpellMoonlightShadow.startTimer", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called SpellMoonlightShadow.startTimer on invalid object.", 0, 0, false) endif endif call Timed_startTimer_3(this_2, time) endfunction function Spell_disableAutodestroy takes integer this_2 returns nothing set Spell_autoDestroy[this_2] = false endfunction function dispatch_Spell_disableAutodestroy takes integer this_2 returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Spell.disableAutodestroy", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Spell.disableAutodestroy on invalid object.", 0, 0, false) endif endif call Spell_disableAutodestroy(this_2) endfunction function SpellMoonlightShadow_onCast takes integer this_2 returns nothing local real delay call dispatch_Spell_disableAutodestroy(this_2) call effect_destr(unit_addEffect(Spell_targetUnit[this_2], "Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl", "origin")) set delay = 1. if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_DRUID_MOON_DELAY) then set delay = delay * 0.33 endif call dispatch_SpellMoonlightShadow_startTimer(this_2, delay) endfunction function SpellNaturesWrath_onCast takes integer this_2 returns nothing call dispatch_Spell_channel_2(this_2, SpellNaturesWrath_CHANNEL_DURATION * (1. - unit_xGetStatReal(Spell_caster[this_2], 21)), false) endfunction function alloc_BuffRejuvenation takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 741 return this_2 endfunction function construct_BuffRejuvenation takes integer this_2, unit caster returns nothing call construct_Buff(this_2) set BuffRejuvenation_caster[this_2] = caster endfunction function new_BuffRejuvenation takes unit caster returns integer local integer this_2 = alloc_BuffRejuvenation() call construct_BuffRejuvenation(this_2, caster) return this_2 endfunction function SpellRejuvenation_onCast takes integer this_2 returns nothing call dispatch_Buff_apply(new_BuffRejuvenation(Spell_caster[this_2]), Spell_targetUnit[this_2]) endfunction function alloc_BuffShieldSlamTaunt takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 739 return this_2 endfunction function construct_BuffShieldSlamTaunt takes integer this_2, unit caster returns nothing call construct_Buff(this_2) set BuffShieldSlamTaunt_caster[this_2] = caster endfunction function new_BuffShieldSlamTaunt takes unit caster returns integer local integer this_2 = alloc_BuffShieldSlamTaunt() call construct_BuffShieldSlamTaunt(this_2, caster) return this_2 endfunction function unit_addStun takes unit this_2 returns nothing if not unit_isStunned(this_2) then call dispatch_DummyCaster_castOnTarget(StatusHandler_STUN_DUMMY_CASTER, this_2) endif set Status_stunCounter[Status_status[unit_getIndex(this_2)]] = Status_stunCounter[Status_status[unit_getIndex(this_2)]] + 1 endfunction function unit_addStunTimed takes unit this_2, real timeout returns nothing local integer i = unit_getIndex(this_2) local timer receiver if Status_stunTimer[Status_status[i]] != null and timer_getRemaining(Status_stunTimer[Status_status[i]]) >= timeout then set receiver = null return endif if Status_stunTimer[Status_status[i]] == null then set receiver = getTimer() call timer_setData(receiver, i) set Status_stunTimer[Status_status[i]] = receiver call unit_addStun(this_2) endif call timer_start(Status_stunTimer[Status_status[i]], timeout, ref_function_closure_impl_4) set receiver = null endfunction function SpellShieldSlam_onCast takes integer this_2 returns nothing local real damage = dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(Spell_caster[this_2])], 4) * 2. local sound s call unit_setAnimation(Spell_caster[this_2], "stand defend") set s = CreateSoundFromLabel("MetalHeavyBashFlesh", false, false, false, 0, 0) call AttachSoundToUnit(s, Spell_caster[this_2]) call StartSound(s) call KillSoundWhenDone(s) call effect_destr(unit_addEffect(Spell_caster[this_2], "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl", "chest")) call cyc_unitDamageTarget(0, Spell_caster[this_2], Spell_targetUnit[this_2], damage, 0, false) call modifyThreat(Spell_caster[this_2], Spell_targetUnit[this_2], 10. + damage * 2., true) if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_WARRIOR_SHIELDSLAM_STUN) then call unit_addStunTimed(Spell_targetUnit[this_2], 1.) endif if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_WARRIOR_SHIELDSLAM_TAUNT) then call dispatch_Buff_apply(new_BuffShieldSlamTaunt(Spell_caster[this_2]), Spell_targetUnit[this_2]) endif set s = null endfunction function alloc_BuffShield takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 740 return this_2 endfunction function construct_BuffShield takes integer this_2, unit caster returns nothing call construct_Buff(this_2) set BuffShield_caster[this_2] = caster endfunction function new_BuffShield takes unit caster returns integer local integer this_2 = alloc_BuffShield() call construct_BuffShield(this_2, caster) return this_2 endfunction function SpellShield_onCast takes integer this_2 returns nothing call dispatch_Buff_apply(new_BuffShield(Spell_caster[this_2]), Spell_targetUnit[this_2]) endfunction function alloc_MissileSplitshot takes nothing returns integer local integer this_2 if Missile_firstFree == 0 then set Missile_maxIndex = Missile_maxIndex + 1 set this_2 = Missile_maxIndex else set Missile_firstFree = Missile_firstFree - 1 set this_2 = Missile_nextFree[Missile_firstFree] endif set Missile_typeId[this_2] = 762 return this_2 endfunction function construct_Missile takes integer this_2, real startPos_x, real startPos_y, real startPos_z, real speed, real arc, string model, real targetPos_x, real targetPos_y, real targetPos_z returns nothing local integer tempIndex set Missile_missileVelXY[this_2] = 1. set tempIndex = this_2 set Missile_targetPos[tempIndex] = 0. set Missile_targetPos_2[tempIndex] = 0. set Missile_targetPos_3[tempIndex] = 0. set Missile_targetUnit[this_2] = null set Missile_targetUnitZOffset[this_2] = 0. set Missile_collisionSize[this_2] = 0. set Missile_targetUnit[this_2] = null call dispatch_Missile_launch(this_2, startPos_x, startPos_y, startPos_z, targetPos_x, targetPos_y, targetPos_z, speed, arc, model) endfunction function Missile_setCollision takes integer this_2, real collisionSize returns nothing set Missile_collisionSize[this_2] = collisionSize if collisionSize == 0. and Missile_seenUnits[this_2] != 0 then call dispatch_LinkedList_destroyLinkedList(Missile_seenUnits[this_2]) set Missile_seenUnits[this_2] = 0 endif if collisionSize != 0. and Missile_seenUnits[this_2] == 0 then set Missile_seenUnits[this_2] = new_LinkedList() endif endfunction function dispatch_Missile_setCollision takes integer this_2, real collisionSize returns nothing if Missile_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Missile.setCollision", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Missile.setCollision on invalid object.", 0, 0, false) endif endif call Missile_setCollision(this_2, collisionSize) endfunction function vec2_toVec3 takes real this_x, real this_y returns real set vec2_toVec3_return_x = this_x set vec2_toVec3_return_y = this_y set vec2_toVec3_return_z = 0. return vec2_toVec3_return_x endfunction function construct_MissileSplitshot takes integer this_2, unit caster, real target_x, real target_y, integer numTargets returns nothing call construct_Missile(this_2, unit_getPos3_2(caster), unit_getPos3_return_y_2, unit_getPos3_return_z_2, 1200., 0.05, "Abilities\\Weapons\\Arrow\\ArrowMissile.mdl", vec2_toVec3(target_x, target_y), vec2_toVec3_return_y, vec2_toVec3_return_z) call dispatch_Missile_setCollision(this_2, 40.) set MissileSplitshot_casterUnit[this_2] = caster set MissileSplitshot_targetsLeft[this_2] = numTargets set MissileSplitshot_isBurning[this_2] = false endfunction function new_MissileSplitshot takes unit caster, real target_x, real target_y, integer numTargets returns integer local integer this_2 = alloc_MissileSplitshot() call construct_MissileSplitshot(this_2, caster, target_x, target_y, numTargets) return this_2 endfunction function angle_toVec takes real this_radians, real len returns real set angle_toVec_return_x = Cos(this_radians) * len set angle_toVec_return_y = Sin(this_radians) * len return angle_toVec_return_x endfunction function vec2_polarOffset takes real this_x, real this_y, real ang_radians, real dist returns real set vec2_polarOffset_return_x = vec2_op_plus(this_x, this_y, angle_toVec(ang_radians, dist), angle_toVec_return_y) set vec2_polarOffset_return_y = vec2_op_plus_return_y return vec2_polarOffset_return_x endfunction function SpellSplitshot_onCast takes integer this_2 returns nothing local integer numArrows = 3 + R2I(dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(Spell_caster[this_2])], 5) * 0.1) local integer numTargets = 2 local real del_x local real del_y local real castAngle local real spread local real arrowAngle local real angleBetweenArrows local integer n local integer temp local integer tempIndex local real temp_del_x local real temp_del_y if unit_xHasTalent(Spell_caster[this_2], TalentList_TALENT_RANGER_SPLITSHOT_PIERCE) then set numTargets = numTargets + 1 endif set tempIndex = this_2 set temp_del_x = vec2_op_minus(Spell_targetPoint[tempIndex], Spell_targetPoint_2[tempIndex], unit_getPos(Spell_caster[this_2]), unit_getPos_return_y) set temp_del_y = vec2_op_minus_return_y set del_x = temp_del_x set del_y = temp_del_y set castAngle = Atan2(del_y, del_x) set spread = Atan(50. / vec2_length(del_x, del_y)) set spread = min(spread, SpellSplitshot_MAX_SPREAD_ANGLE) set arrowAngle = castAngle - spread set angleBetweenArrows = spread * 2. / (numArrows - 1) call new_MissileSplitshot(Spell_caster[this_2], vec2_polarOffset(unit_getPos(Spell_caster[this_2]), unit_getPos_return_y, arrowAngle, SpellSplitshot_ARROW_RANGE), vec2_polarOffset_return_y, numTargets) set n = 1 set temp = numArrows - 1 loop exitwhen n > temp set arrowAngle = arrowAngle + angleBetweenArrows call new_MissileSplitshot(Spell_caster[this_2], vec2_polarOffset(unit_getPos(Spell_caster[this_2]), unit_getPos_return_y, arrowAngle, SpellSplitshot_ARROW_RANGE), vec2_polarOffset_return_y, numTargets) set n = n + 1 endloop endfunction function BuffList_getFirstBuffOfType takes integer this_2, integer id returns integer local integer bf = 0 local integer wurst__iterator2 = dispatch_LinkedList_iterator(BuffList_buffs[this_2]) local integer b loop exitwhen not dispatch_LLIterator_hasNext(wurst__iterator2) set b = dispatch_LLIterator_next(wurst__iterator2) if dispatch_Buff_getBuffTypeId(b) == id then set bf = b exitwhen true endif endloop call dispatch_LLIterator_close(wurst__iterator2) return bf endfunction function dispatch_BuffList_getFirstBuffOfType takes integer this_2, integer id returns integer local integer getFirstBuffOfType_result if BuffList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffList.getFirstBuffOfType", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffList.getFirstBuffOfType on invalid object.", 0, 0, false) endif endif set getFirstBuffOfType_result = BuffList_getFirstBuffOfType(this_2, id) return getFirstBuffOfType_result endfunction function BuffTrapOwner_onDestroy takes integer this_2 returns nothing call Buff_onDestroy(this_2) endfunction function dealloc_BuffTrapOwner takes integer obj returns nothing if Buff_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type BuffTrapOwner", 0, 0, false) else set Buff_nextFree[Buff_firstFree] = obj set Buff_firstFree = Buff_firstFree + 1 set Buff_typeId[obj] = 0 endif endfunction function destroyBuffTrapOwner takes integer this_2 returns nothing call BuffTrapOwner_onDestroy(this_2) call dealloc_BuffTrapOwner(this_2) endfunction function dispatch_BuffTrapOwner_destroyBuffTrapOwner takes integer this_2 returns nothing if Buff_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling BuffTrapOwner.destroyBuffTrapOwner", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called BuffTrapOwner.destroyBuffTrapOwner on invalid object.", 0, 0, false) endif endif call destroyBuffTrapOwner(this_2) endfunction function alloc_BuffTrapTarget takes nothing returns integer local integer this_2 if Buff_firstFree == 0 then set Buff_maxIndex = Buff_maxIndex + 1 set this_2 = Buff_maxIndex else set Buff_firstFree = Buff_firstFree - 1 set this_2 = Buff_nextFree[Buff_firstFree] endif set Buff_typeId[this_2] = 744 return this_2 endfunction function construct_BuffTrapTarget takes integer this_2, unit caster returns nothing call construct_Buff(this_2) set BuffTrapTarget_caster[this_2] = caster endfunction function new_BuffTrapTarget takes unit caster returns integer local integer this_2 = alloc_BuffTrapTarget() call construct_BuffTrapTarget(this_2, caster) return this_2 endfunction function SpellTrap_onCast takes integer this_2 returns nothing local integer lvl = unit_getAbilityLevel(Spell_caster[this_2], SpellTrap_SPELL_RAW) local integer b local unit minU local real minDist local group wurst__iterator0 local unit u local real dist local integer tempIndex local group temp if lvl == 1 then call dispatch_Spell_channel_2(this_2, SpellTrap_CHANNEL_DURATION * (1. - unit_xGetStatReal(Spell_caster[this_2], 21)), false) else call unit_setAbilityLevel(Spell_caster[this_2], SpellTrap_SPELL_RAW, 1) set b = dispatch_BuffList_getFirstBuffOfType(unit_getBuffList(Spell_caster[this_2]), 742) if b != 0 then set minU = null set minDist = 9999999. call group_clear(TempGroups_ENUM_GROUP) set temp = TempGroups_ENUM_GROUP set tempIndex = b call group_enumUnitsInRange(temp, BuffTrapOwner_pos[tempIndex], BuffTrapOwner_pos_2[tempIndex], SpellTrap_AOE) set wurst__iterator0 = group_iterator(TempGroups_ENUM_GROUP) loop exitwhen not group_hasNext(wurst__iterator0) set u = group_next(wurst__iterator0) if unit_xIsAlive(u) and player_isEnemyOf(unit_getOwner(u), unit_getOwner(Spell_caster[this_2])) and ( not unit_xIsBoss(u)) then set dist = vec2_distToVecSquared(unit_getPos(Spell_caster[this_2]), unit_getPos_return_y, unit_getPos(u), unit_getPos_return_y) if dist < minDist then set minU = u set minDist = dist endif endif endloop call group_close(wurst__iterator0) if minU != null then call dispatch_Buff_apply(new_BuffTrapTarget(Spell_caster[this_2]), minU) endif endif call dispatch_BuffTrapOwner_destroyBuffTrapOwner(b) endif set minU = null set wurst__iterator0 = null set u = null set temp = null endfunction function Spell_onCast takes integer this_2 returns nothing endfunction function dispatch_Spell_onCast takes integer this_2 returns nothing if Spell_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Spell.onCast", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Spell.onCast on invalid object.", 0, 0, false) endif endif if Spell_typeId[this_2] <= 716 then if Spell_typeId[this_2] <= 713 then if Spell_typeId[this_2] <= 711 then if Spell_typeId[this_2] <= 710 then call Spell_onCast(this_2) else call SpellIgnoreThePain_onCast(this_2) endif elseif Spell_typeId[this_2] <= 712 then call SpellSplitshot_onCast(this_2) else call SpellRejuvenation_onCast(this_2) endif elseif Spell_typeId[this_2] <= 715 then if Spell_typeId[this_2] <= 714 then call SpellTrap_onCast(this_2) else call SpellNaturesWrath_onCast(this_2) endif else call SpellFirearrow_onCast(this_2) endif elseif Spell_typeId[this_2] <= 719 then if Spell_typeId[this_2] <= 718 then if Spell_typeId[this_2] <= 717 then call SpellShield_onCast(this_2) else call SpellMoonlightShadow_onCast(this_2) endif else call SpellHeal_onCast(this_2) endif elseif Spell_typeId[this_2] <= 721 then if Spell_typeId[this_2] <= 720 then call SpellHolyBolt_onCast(this_2) else call SpellShieldSlam_onCast(this_2) endif else call SpellCharge_onCast(this_2) endif endfunction function construct_Spell takes integer this_2 returns nothing local integer tempIndex set Spell_caster[this_2] = GetTriggerUnit() set Spell_targetUnit[this_2] = GetSpellTargetUnit() set tempIndex = this_2 set Spell_targetPoint[tempIndex] = GetSpellTargetX() set Spell_targetPoint_2[tempIndex] = GetSpellTargetY() set Spell_autoDestroy[this_2] = true call dispatch_Spell_onCast(this_2) if Spell_autoDestroy[this_2] then call dispatch_Spell_destroySpell(this_2) endif endfunction function construct_SpellFirearrow takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellFirearrow takes nothing returns integer local integer this_2 = alloc_SpellFirearrow() call construct_SpellFirearrow(this_2) return this_2 endfunction function closure_impl_32 takes integer this_2 returns integer return new_SpellFirearrow() endfunction function alloc_SpellNaturesWrath takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 715 return this_2 endfunction function construct_SpellNaturesWrath takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellNaturesWrath takes nothing returns integer local integer this_2 = alloc_SpellNaturesWrath() call construct_SpellNaturesWrath(this_2) return this_2 endfunction function closure_impl_33 takes integer this_2 returns integer return new_SpellNaturesWrath() endfunction function alloc_SpellHeal takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 719 return this_2 endfunction function construct_SpellHeal takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellHeal takes nothing returns integer local integer this_2 = alloc_SpellHeal() call construct_SpellHeal(this_2) return this_2 endfunction function closure_impl_34 takes integer this_2 returns integer return new_SpellHeal() endfunction function alloc_SpellRejuvenation takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 713 return this_2 endfunction function construct_SpellRejuvenation takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellRejuvenation takes nothing returns integer local integer this_2 = alloc_SpellRejuvenation() call construct_SpellRejuvenation(this_2) return this_2 endfunction function closure_impl_35 takes integer this_2 returns integer return new_SpellRejuvenation() endfunction function alloc_SpellSplitshot takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 712 return this_2 endfunction function construct_SpellSplitshot takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellSplitshot takes nothing returns integer local integer this_2 = alloc_SpellSplitshot() call construct_SpellSplitshot(this_2) return this_2 endfunction function closure_impl_36 takes integer this_2 returns integer return new_SpellSplitshot() endfunction function alloc_SpellTrap takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 714 return this_2 endfunction function construct_SpellTrap takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellTrap takes nothing returns integer local integer this_2 = alloc_SpellTrap() call construct_SpellTrap(this_2) return this_2 endfunction function closure_impl_37 takes integer this_2 returns integer return new_SpellTrap() endfunction function alloc_SpellShield takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 717 return this_2 endfunction function construct_SpellShield takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellShield takes nothing returns integer local integer this_2 = alloc_SpellShield() call construct_SpellShield(this_2) return this_2 endfunction function closure_impl_38 takes integer this_2 returns integer return new_SpellShield() endfunction function alloc_SpellHolyBolt takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 720 return this_2 endfunction function construct_SpellHolyBolt takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellHolyBolt takes nothing returns integer local integer this_2 = alloc_SpellHolyBolt() call construct_SpellHolyBolt(this_2) return this_2 endfunction function closure_impl_39 takes integer this_2 returns integer return new_SpellHolyBolt() endfunction function alloc_SpellShieldSlam takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 721 return this_2 endfunction function construct_SpellShieldSlam takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellShieldSlam takes nothing returns integer local integer this_2 = alloc_SpellShieldSlam() call construct_SpellShieldSlam(this_2) return this_2 endfunction function closure_impl_40 takes integer this_2 returns integer return new_SpellShieldSlam() endfunction function alloc_SpellIgnoreThePain takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 711 return this_2 endfunction function construct_SpellIgnoreThePain takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellIgnoreThePain takes nothing returns integer local integer this_2 = alloc_SpellIgnoreThePain() call construct_SpellIgnoreThePain(this_2) return this_2 endfunction function closure_impl_41 takes integer this_2 returns integer return new_SpellIgnoreThePain() endfunction function alloc_SpellCharge takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 722 return this_2 endfunction function construct_SpellCharge takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellCharge takes nothing returns integer local integer this_2 = alloc_SpellCharge() call construct_SpellCharge(this_2) return this_2 endfunction function closure_impl_42 takes integer this_2 returns integer return new_SpellCharge() endfunction function alloc_SpellMoonlightShadow takes nothing returns integer local integer this_2 if Spell_firstFree == 0 then set Spell_maxIndex = Spell_maxIndex + 1 set this_2 = Spell_maxIndex else set Spell_firstFree = Spell_firstFree - 1 set this_2 = Spell_nextFree[Spell_firstFree] endif set Spell_typeId[this_2] = 718 return this_2 endfunction function construct_SpellMoonlightShadow takes integer this_2 returns nothing call construct_Spell(this_2) endfunction function new_SpellMoonlightShadow takes nothing returns integer local integer this_2 = alloc_SpellMoonlightShadow() call construct_SpellMoonlightShadow(this_2) return this_2 endfunction function closure_impl_43 takes integer this_2 returns integer return new_SpellMoonlightShadow() endfunction function dispatch_SpellCastRegistry_run takes integer this_2 returns nothing if SpellCastRegistry_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling SpellCastRegistry.run", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called SpellCastRegistry.run on invalid object.", 0, 0, false) endif endif if SpellCastRegistry_typeId[this_2] <= 729 then if SpellCastRegistry_typeId[this_2] <= 726 then if SpellCastRegistry_typeId[this_2] <= 725 then if SpellCastRegistry_typeId[this_2] <= 724 then call closure_impl_35(this_2) else call closure_impl_38(this_2) endif else call closure_impl_39(this_2) endif elseif SpellCastRegistry_typeId[this_2] <= 728 then if SpellCastRegistry_typeId[this_2] <= 727 then call closure_impl_41(this_2) else call closure_impl_36(this_2) endif else call closure_impl_43(this_2) endif elseif SpellCastRegistry_typeId[this_2] <= 732 then if SpellCastRegistry_typeId[this_2] <= 731 then if SpellCastRegistry_typeId[this_2] <= 730 then call closure_impl_32(this_2) else call closure_impl_33(this_2) endif else call closure_impl_40(this_2) endif elseif SpellCastRegistry_typeId[this_2] <= 734 then if SpellCastRegistry_typeId[this_2] <= 733 then call closure_impl_42(this_2) else call closure_impl_34(this_2) endif else call closure_impl_37(this_2) endif endfunction function spellEffect takes nothing returns nothing local integer raw = GetSpellAbilityId() if dispatch_HashMap_has(SpellHandler_castEvents, raw) then call dispatch_SpellCastRegistry_run(dispatch_HashMap_get(SpellHandler_castEvents, raw)) endif endfunction function switchDebug takes nothing returns nothing local player p = GetTriggerPlayer() local integer id = player_getId(p) if PrintingHelper_wantDebug[id] then set PrintingHelper_wantDebug[id] = false call DisplayTimedTextToPlayer(p, 0., 0., 20., "|cff9C9C9CDEBUG-View|r |cffB55208deactivated") else set PrintingHelper_wantDebug[id] = true call DisplayTimedTextToPlayer(p, 0., 0., 20., "|cff9C9C9CDEBUG-View|r |cff3AAD42activated") endif set p = null endfunction function ItemData_getBound takes integer this_2 returns integer return ItemData_boundTo[this_2] endfunction function dispatch_ItemData_getBound takes integer this_2 returns integer local integer getBound_result if ItemData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemData.getBound", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemData.getBound on invalid object.", 0, 0, false) endif endif set getBound_result = ItemData_getBound(this_2) return getBound_result endfunction function unit_removeItem takes unit this_2, item itm returns nothing call UnitRemoveItem(this_2, itm) endfunction function errorDropItem takes unit u, string err returns nothing call simError(unit_getOwner(u), err) set HeroInventory_blockEvents = true call unit_removeItem(u, GetManipulatedItem()) set HeroInventory_blockEvents = false endfunction function item_getUserData takes item this_2 returns integer return GetItemUserData(this_2) endfunction function item_xGetItemData takes item this_2 returns integer return item_getUserData(this_2) endfunction function validateClass takes unit u, item i returns boolean local boolean allowed = false local integer ht = unit_getHeroType(u) local integer cls = ItemTypeData_equipmentClass[int_xGetItemTypeData(GetItemTypeId(i))] local integer temp = ht if temp == 0 then set allowed = cls == 0 or cls == 1 or cls == 6 or cls == 10 or cls == 13 elseif temp == 1 then set allowed = cls == 4 or cls == 7 or cls == 12 or cls == 13 elseif temp == 2 then set allowed = cls == 5 or cls == 8 or cls == 11 or cls == 13 elseif temp == 3 then set allowed = cls == 4 or cls == 7 or cls == 12 or cls == 13 endif return allowed endfunction function InventoryIterator_onDestroy takes integer this_2 returns nothing endfunction function dealloc_InventoryIterator takes integer obj returns nothing if InventoryIterator_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type InventoryIterator", 0, 0, false) else set InventoryIterator_nextFree[InventoryIterator_firstFree] = obj set InventoryIterator_firstFree = InventoryIterator_firstFree + 1 set InventoryIterator_typeId[obj] = 0 endif endfunction function destroyInventoryIterator takes integer this_2 returns nothing call InventoryIterator_onDestroy(this_2) call dealloc_InventoryIterator(this_2) endfunction function dispatch_InventoryIterator_destroyInventoryIterator takes integer this_2 returns nothing if InventoryIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling InventoryIterator.destroyInventoryIterator", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called InventoryIterator.destroyInventoryIterator on invalid object.", 0, 0, false) endif endif call destroyInventoryIterator(this_2) endfunction function InventoryIterator_close takes integer this_2 returns nothing call dispatch_InventoryIterator_destroyInventoryIterator(this_2) endfunction function dispatch_InventoryIterator_close takes integer this_2 returns nothing if InventoryIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling InventoryIterator.close", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called InventoryIterator.close on invalid object.", 0, 0, false) endif endif call InventoryIterator_close(this_2) endfunction function validateSlot takes unit u, item i returns boolean local integer slot = ItemTypeData_equipmentSlot[int_xGetItemTypeData(GetItemTypeId(i))] local integer iter = new_InventoryIterator(u) local integer slotItemTypeData local item slotItem loop exitwhen not dispatch_InventoryIterator_hasNext(iter) set slotItem = dispatch_InventoryIterator_next(iter) set slotItemTypeData = int_xGetItemTypeData(GetItemTypeId(slotItem)) if ItemTypeData_itemClass[slotItemTypeData] == 0 then if slotItem != i and ItemTypeData_equipmentSlot[slotItemTypeData] == slot then call dispatch_InventoryIterator_close(iter) set slotItem = null return false endif endif endloop set slotItem = null return true endfunction function takeItem takes nothing returns nothing local unit u local item i if not HeroInventory_blockEvents then set u = GetTriggerUnit() set i = GetManipulatedItem() if not (GetItemType(i) == ITEM_TYPE_POWERUP) then if dispatch_ItemData_getBound(item_xGetItemData(i)) != -1 and dispatch_ItemData_getBound(item_xGetItemData(i)) != player_getId(unit_getOwner(u)) then call errorDropItem(u, "Item is bound to another player") elseif false then call errorDropItem(u, "You cannot take items which were dropped before your hero was created") elseif unit_xIsHero(u) and ItemTypeData_itemClass[int_xGetItemTypeData(GetItemTypeId(i))] == 0 then if not validateClass(u, i) then call errorDropItem(u, "Your hero cannot use items of this class") elseif not validateSlot(u, i) then call errorDropItem(u, "You already wear an item in that slot") else call dispatch_UnitStatBuffer_apply(UnitData_unitStatBuffer[unit_xGetUnitData(u)], ItemTypeData_stats[int_xGetItemTypeData(GetItemTypeId(i))]) endif endif endif endif set u = null set i = null endfunction function unitAttacked takes nothing returns nothing local unit source local real damage if not DamageHandler_blockDmgEvent then set source = GetEventDamageSource() if unit_getTypeId(source) != Basics_DUMMY_UNIT_ID then set damage = 1. * dispatch_UnitStatBuffer_get(UnitData_unitStatBuffer[unit_xGetUnitData(source)], 10) call cyc_unitDamageTarget(1, source, GetTriggerUnit(), damage, 0, true) endif endif set source = null endfunction function ThreatHandlerCamp_checkReturned takes integer this_2 returns nothing local boolean ret = true local integer campUnit = ThreatHandlerCamp_dummy[this_2] loop exitwhen not (ThreatHandlerTU_campNext[campUnit] != ThreatHandlerCamp_dummy[this_2]) set campUnit = ThreatHandlerTU_campNext[campUnit] if ThreatHandlerTU_state[campUnit] != 3 then set ret = false exitwhen true endif endloop if ret then set ThreatHandlerCamp_state[this_2] = 0 call dispatch_ThreatHandlerCamp_removeIncombatList(this_2) set campUnit = ThreatHandlerCamp_dummy[this_2] loop exitwhen not (ThreatHandlerTU_campNext[campUnit] != ThreatHandlerCamp_dummy[this_2]) set campUnit = ThreatHandlerTU_campNext[campUnit] set ThreatHandlerTU_state[campUnit] = 0 call SetUnitInvulnerable(ThreatHandlerTU_u[campUnit], false) call unit_unpause(ThreatHandlerTU_u[campUnit]) endloop endif endfunction function dispatch_ThreatHandlerCamp_checkReturned takes integer this_2 returns nothing if ThreatHandlerCamp_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerCamp.checkReturned", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerCamp.checkReturned on invalid object.", 0, 0, false) endif endif call ThreatHandlerCamp_checkReturned(this_2) endfunction function onThreatUnitReturn takes unit u returns nothing call unit_setHP(u, unit_getState(u, UNIT_STATE_MAX_LIFE)) call unit_setMana(u, unit_getState(u, UNIT_STATE_MAX_MANA)) endfunction function unit_issuePointOrder takes unit this_2, string order, real target_x, real target_y returns nothing call IssuePointOrder(this_2, order, target_x, target_y) endfunction function ThreatHandlerCamp_returnCamp takes integer this_2 returns nothing local integer campUnit local integer wurst__iterator0 local integer e local integer tempIndex local unit temp set ThreatHandlerCamp_state[this_2] = 2 set ThreatHandlerCamp_timeToPortLeft[this_2] = ThreatHandlerConfig_TIME_TO_PORT * 2 set campUnit = ThreatHandlerCamp_dummy[this_2] loop exitwhen not (ThreatHandlerTU_campNext[campUnit] != ThreatHandlerCamp_dummy[this_2]) set campUnit = ThreatHandlerTU_campNext[campUnit] set ThreatHandlerTU_state[campUnit] = 2 set wurst__iterator0 = dispatch_ThreatHandlerTU_iterator(campUnit) loop exitwhen not dispatch_ThreatUnitIterator_hasNext(wurst__iterator0) set e = dispatch_ThreatUnitIterator_next(wurst__iterator0) call dispatch_ThreatListEntry_destroyThreatListEntry(e) endloop call dispatch_ThreatUnitIterator_close(wurst__iterator0) call unit_issueImmediateOrderById(ThreatHandlerTU_u[campUnit], 851972) set temp = ThreatHandlerTU_u[campUnit] set tempIndex = campUnit call unit_issuePointOrder(temp, "move", ThreatHandlerTU_campPos[tempIndex], ThreatHandlerTU_campPos_2[tempIndex]) call SetUnitInvulnerable(ThreatHandlerTU_u[campUnit], true) call onThreatUnitReturn(ThreatHandlerTU_u[campUnit]) endloop set temp = null endfunction function dispatch_ThreatHandlerCamp_returnCamp takes integer this_2 returns nothing if ThreatHandlerCamp_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ThreatHandlerCamp.returnCamp", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ThreatHandlerCamp.returnCamp on invalid object.", 0, 0, false) endif endif call ThreatHandlerCamp_returnCamp(this_2) endfunction function update takes nothing returns nothing local integer i = 1 local integer temp = ThreatHandler_icListLast local unit u local integer camp local integer tu local unit target local integer tempIndex local real tempTupleSelectionResult_1 local real temp_tempTupleSelectionResult_1 local integer tempIndex_2 local real tempTupleSelectionResult_2 local real temp_tempTupleSelectionResult_2 local integer tempIndex_3 local real tempTupleSelectionResult_1_2 local real temp_tempTupleSelectionResult_1_2 local integer tempIndex_4 local real tempTupleSelectionResult_2_2 local real temp_tempTupleSelectionResult_2_2 local integer tempIndex_5 local real tempTupleSelectionResult_1_3 local real temp_tempTupleSelectionResult_1_3 local integer tempIndex_6 local real tempTupleSelectionResult_2_3 local real temp_tempTupleSelectionResult_2_3 local integer tempIndex_7 local integer tempIndex_8 local unit temp_2 local real temp_3 local boolean andLeft local unit temp_4 local real temp_5 local boolean andLeft_2 local unit temp_6 local real temp_7 local unit temp_8 local unit temp_9 loop exitwhen i > temp set camp = ThreatHandler_icList[i] if ThreatHandlerCamp_state[camp] == 1 then set tu = ThreatHandlerCamp_dummy[camp] loop exitwhen not (ThreatHandlerTU_campNext[tu] != ThreatHandlerCamp_dummy[camp]) set tu = ThreatHandlerTU_campNext[tu] set u = ThreatHandlerTU_u[tu] set target = dispatch_ThreatHandlerTU_getFirstInThreatList(tu) if target != null then set temp_2 = u set tempIndex = tu set temp_tempTupleSelectionResult_1 = ThreatHandlerTU_campPos[tempIndex] set tempTupleSelectionResult_1 = temp_tempTupleSelectionResult_1 set temp_3 = tempTupleSelectionResult_1 set tempIndex_2 = tu set temp_tempTupleSelectionResult_2 = ThreatHandlerTU_campPos_2[tempIndex_2] set tempTupleSelectionResult_2 = temp_tempTupleSelectionResult_2 set andLeft = IsUnitInRangeXY(temp_2, temp_3, tempTupleSelectionResult_2, ThreatHandlerConfig_RETURN_RANGE) else set andLeft = false endif if andLeft then set temp_4 = target set tempIndex_3 = tu set temp_tempTupleSelectionResult_1_2 = ThreatHandlerTU_campPos[tempIndex_3] set tempTupleSelectionResult_1_2 = temp_tempTupleSelectionResult_1_2 set temp_5 = tempTupleSelectionResult_1_2 set tempIndex_4 = tu set temp_tempTupleSelectionResult_2_2 = ThreatHandlerTU_campPos_2[tempIndex_4] set tempTupleSelectionResult_2_2 = temp_tempTupleSelectionResult_2_2 set andLeft_2 = IsUnitInRangeXY(temp_4, temp_5, tempTupleSelectionResult_2_2, ThreatHandlerConfig_ORDER_RETURN_RANGE) else set andLeft_2 = false endif if andLeft_2 then if GetUnitCurrentOrder(u) == 851983 or GetUnitCurrentOrder(u) == 0 or GetUnitCurrentOrder(u) == 851971 then call unit_issueTargetOrderById(u, 851971, target) endif else call dispatch_ThreatHandlerCamp_returnCamp(camp) exitwhen true endif endloop endif if ThreatHandlerCamp_state[camp] == 2 then if ThreatHandlerCamp_timeToPortLeft[camp] > 0 then set ThreatHandlerCamp_timeToPortLeft[camp] = ThreatHandlerCamp_timeToPortLeft[camp] - 1 set tu = ThreatHandlerCamp_dummy[camp] loop exitwhen not (ThreatHandlerTU_campNext[tu] != ThreatHandlerCamp_dummy[camp]) set tu = ThreatHandlerTU_campNext[tu] set u = ThreatHandlerTU_u[tu] if ThreatHandlerTU_state[tu] == 2 then set temp_6 = u set tempIndex_5 = tu set temp_tempTupleSelectionResult_1_3 = ThreatHandlerTU_campPos[tempIndex_5] set tempTupleSelectionResult_1_3 = temp_tempTupleSelectionResult_1_3 set temp_7 = tempTupleSelectionResult_1_3 set tempIndex_6 = tu set temp_tempTupleSelectionResult_2_3 = ThreatHandlerTU_campPos_2[tempIndex_6] set tempTupleSelectionResult_2_3 = temp_tempTupleSelectionResult_2_3 if IsUnitInRangeXY(temp_6, temp_7, tempTupleSelectionResult_2_3, 35.) then if not (GetUnitCurrentOrder(u) == 851986) then set ThreatHandlerTU_state[tu] = 3 call unit_pause(u) call dispatch_ThreatHandlerCamp_checkReturned(camp) endif else set temp_8 = u set tempIndex_7 = tu call unit_issuePointOrder(temp_8, "move", ThreatHandlerTU_campPos[tempIndex_7], ThreatHandlerTU_campPos_2[tempIndex_7]) endif endif endloop else set ThreatHandlerCamp_state[camp] = 0 set tu = ThreatHandlerCamp_dummy[camp] loop exitwhen not (ThreatHandlerTU_campNext[tu] != ThreatHandlerCamp_dummy[camp]) set tu = ThreatHandlerTU_campNext[tu] set u = ThreatHandlerTU_u[tu] if ThreatHandlerTU_state[tu] == 2 then set temp_9 = u set tempIndex_8 = tu call unit_setPos(temp_9, ThreatHandlerTU_campPos[tempIndex_8], ThreatHandlerTU_campPos_2[tempIndex_8]) call onThreatUnitReturn(u) endif set ThreatHandlerTU_state[tu] = 0 call SetUnitInvulnerable(u, false) call unit_unpause(u) endloop endif endif set i = i + 1 endloop set u = null set target = null set temp_2 = null set temp_4 = null set temp_6 = null set temp_8 = null set temp_9 = null endfunction function ItemData_onDestroy takes integer this_2 returns nothing endfunction function dealloc_ItemData takes integer obj returns nothing if ItemData_typeId[obj] == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Double free: object of type ItemData", 0, 0, false) else set ItemData_nextFree[ItemData_firstFree] = obj set ItemData_firstFree = ItemData_firstFree + 1 set ItemData_typeId[obj] = 0 endif endfunction function destroyItemData takes integer this_2 returns nothing call ItemData_onDestroy(this_2) call dealloc_ItemData(this_2) endfunction function dispatch_ItemData_destroyItemData takes integer this_2 returns nothing if ItemData_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemData.destroyItemData", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemData.destroyItemData on invalid object.", 0, 0, false) endif endif call destroyItemData(this_2) endfunction function item_remove takes item this_2 returns nothing call RemoveItem(this_2) endfunction function searchItem takes integer itemRaw, unit hero, unit bag returns boolean local integer i = 0 local integer i_2 loop exitwhen i > 5 if ( not Recipe_slotsUsed[i]) and GetItemTypeId(UnitItemInSlot(hero, i)) == itemRaw then set Recipe_slotsUsed[i] = true return true endif set i = i + 1 endloop set i_2 = 0 loop exitwhen i_2 > 5 if ( not Recipe_slotsUsed[6 + i_2]) and GetItemTypeId(UnitItemInSlot(bag, i_2)) == itemRaw then set Recipe_slotsUsed[6 + i_2] = true return true endif set i_2 = i_2 + 1 endloop return false endfunction function xGetPlayerBag takes integer playerId returns unit return Bag_playerBagUnit[playerId] endfunction function useItemAction takes nothing returns nothing local item itm = GetManipulatedItem() local integer data = int_xGetItemTypeData(GetItemTypeId(itm)) local unit hero local integer pid local unit bag local integer i local boolean hasAllReq local integer i_2 local item x local integer i_3 local item x_2 if data != 0 and ItemTypeData_itemClass[data] == 2 then set hero = GetTriggerUnit() set pid = player_getId(unit_getOwner(hero)) set bag = xGetPlayerBag(pid) set i = 0 loop exitwhen i > 11 set Recipe_slotsUsed[i] = false set i = i + 1 endloop set hasAllReq = true set hasAllReq = hasAllReq and ItemTypeData_recipeReq1[data] == 0 or searchItem(ItemTypeData_recipeReq1[data], hero, bag) set hasAllReq = hasAllReq and ItemTypeData_recipeReq2[data] == 0 or searchItem(ItemTypeData_recipeReq2[data], hero, bag) set hasAllReq = hasAllReq and ItemTypeData_recipeReq3[data] == 0 or searchItem(ItemTypeData_recipeReq3[data], hero, bag) set hasAllReq = hasAllReq and ItemTypeData_recipeReq4[data] == 0 or searchItem(ItemTypeData_recipeReq4[data], hero, bag) set hasAllReq = hasAllReq and ItemTypeData_recipeReq5[data] == 0 or searchItem(ItemTypeData_recipeReq5[data], hero, bag) set hasAllReq = hasAllReq and ItemTypeData_recipeReq6[data] == 0 or searchItem(ItemTypeData_recipeReq6[data], hero, bag) set hasAllReq = hasAllReq and ItemTypeData_recipeReq7[data] == 0 or searchItem(ItemTypeData_recipeReq7[data], hero, bag) set hasAllReq = hasAllReq and ItemTypeData_recipeReq8[data] == 0 or searchItem(ItemTypeData_recipeReq8[data], hero, bag) if hasAllReq then set i_2 = 0 loop exitwhen i_2 > 5 if Recipe_slotsUsed[i_2] then set x = UnitItemInSlot(hero, i_2) call dispatch_ItemData_destroyItemData(item_xGetItemData(x)) call item_remove(x) endif set i_2 = i_2 + 1 endloop set i_3 = 0 loop exitwhen i_3 > 5 if Recipe_slotsUsed[6 + i_3] then set x_2 = UnitItemInSlot(bag, i_3) call dispatch_ItemData_destroyItemData(item_xGetItemData(x_2)) call item_remove(x_2) endif set i_3 = i_3 + 1 endloop call dispatch_ItemData_bind(item_xGetItemData(xCreateItemForHero(hero, ItemTypeData_recipeTarget[data])), pid) call dispatch_ItemData_destroyItemData(item_xGetItemData(itm)) call item_remove(itm) else call simError(unit_getOwner(hero), "Materials missing") endif endif set itm = null set hero = null set bag = null set x = null set x_2 = null endfunction function initGlobals takes nothing returns nothing set udg_npc_bryce = null set udg_npc_brom = null set udg_npc_marta = null set gg_trg_npcs = null set gg_unit_npc2_0055 = null set gg_unit_npc1_0054 = null set gg_unit_npc3_0056 = null set LinkedList_firstFree = 0 set LinkedList_maxIndex = 0 set LLEntry_firstFree = 0 set LLEntry_maxIndex = 0 set LLIterator_firstFree = 0 set LLIterator_maxIndex = 0 set Table_firstFree = 0 set Table_maxIndex = 0 set W3UDefinition_firstFree = 0 set W3UDefinition_maxIndex = 0 set IdGenerator_firstFree = 0 set IdGenerator_maxIndex = 0 set OrderStringFactory_firstFree = 0 set OrderStringFactory_maxIndex = 0 set AbilityDefinition_firstFree = 0 set AbilityDefinition_maxIndex = 0 set BonusType_firstFree = 0 set BonusType_maxIndex = 0 set StatChangedEvent_firstFree = 0 set StatChangedEvent_maxIndex = 0 set HashMap_firstFree = 0 set HashMap_maxIndex = 0 set StatEntity_firstFree = 0 set StatEntity_maxIndex = 0 set StatList_firstFree = 0 set StatList_maxIndex = 0 set StatListIterator_firstFree = 0 set StatListIterator_maxIndex = 0 set UnitBaseStatBuffer_firstFree = 0 set UnitBaseStatBuffer_maxIndex = 0 set UnitStatBuffer_firstFree = 0 set UnitStatBuffer_maxIndex = 0 set UnitTypeData_firstFree = 0 set UnitTypeData_maxIndex = 0 set ItemData_firstFree = 0 set ItemData_maxIndex = 0 set PlayerData_firstFree = 0 set PlayerData_maxIndex = 0 set UnitIndex_firstFree = 0 set UnitIndex_maxIndex = 0 set ThreatHandlerCamp_firstFree = 0 set ThreatHandlerCamp_maxIndex = 0 set ThreatHandlerPU_firstFree = 0 set ThreatHandlerPU_maxIndex = 0 set ThreatHandlerTU_firstFree = 0 set ThreatHandlerTU_maxIndex = 0 set ThreatUnitIterator_firstFree = 0 set ThreatUnitIterator_maxIndex = 0 set ThreatListEntry_firstFree = 0 set ThreatListEntry_maxIndex = 0 set CreepRespawn_firstFree = 0 set CreepRespawn_maxIndex = 0 set HeroRespawn_firstFree = 0 set HeroRespawn_maxIndex = 0 set W3TDefinition_firstFree = 0 set W3TDefinition_maxIndex = 0 set TalkAction_firstFree = 0 set TalkAction_maxIndex = 0 set CompleteQuestAction_firstFree = 0 set CompleteQuestAction_maxIndex = 0 set PQuest_firstFree = 0 set PQuest_maxIndex = 0 set PQuestItem_firstFree = 0 set PQuestItem_maxIndex = 0 set Droptable_firstFree = 0 set Droptable_maxIndex = 0 set Drop_firstFree = 0 set Drop_maxIndex = 0 set QuestDrop_firstFree = 0 set QuestDrop_maxIndex = 0 set OOCRUnit_firstFree = 0 set OOCRUnit_maxIndex = 0 set CastBar_firstFree = 0 set CastBar_maxIndex = 0 set ChannelData_firstFree = 0 set ChannelData_maxIndex = 0 set Spell_firstFree = 0 set Spell_maxIndex = 0 set SpellCastRegistry_firstFree = 0 set SpellCastRegistry_maxIndex = 0 set Buff_firstFree = 0 set Buff_maxIndex = 0 set Talent_firstFree = 0 set Talent_maxIndex = 0 set UnitDamageHandler_firstFree = 0 set UnitDamageHandler_maxIndex = 0 set BuffList_firstFree = 0 set BuffList_maxIndex = 0 set ArrayQueue_firstFree = 0 set ArrayQueue_maxIndex = 0 set DelayNode_firstFree = 0 set DelayNode_maxIndex = 0 set DummyCaster_firstFree = 0 set DummyCaster_maxIndex = 0 set InventoryIterator_firstFree = 0 set InventoryIterator_maxIndex = 0 set ItemTypeData_firstFree = 0 set ItemTypeData_maxIndex = 0 set Fx_firstFree = 0 set Fx_maxIndex = 0 set Missile_firstFree = 0 set Missile_maxIndex = 0 set UnitCollision_firstFree = 0 set UnitCollision_maxIndex = 0 set Knockback_firstFree = 0 set Knockback_maxIndex = 0 set ref_function_hideItem = function hideItem set ref_function_acquireTarget = function acquireTarget set ref_function_closure_impl = function closure_impl_27 set ref_function_Timed_timerCallback = function Timed_timerCallback set ref_function_Timed_timerCallback_2 = function Timed_timerCallback_2 set ref_function_closure_impl_2 = function closure_impl_29 set ref_function_ChannelData_invokeInterrupt = function ChannelData_invokeInterrupt set ref_function_ChannelData_callback = function ChannelData_callback set ref_function_ChannelData_callback_2 = function ChannelData_callback set ref_function_Buff_timerCallback = function Buff_timerCallback set ref_function_DelayNode_recycle = function DelayNode_recycle set ref_function_DelayNode_recycle_2 = function DelayNode_recycle set ref_function_DelayNode_recycle_3 = function DelayNode_recycle set ref_function_closure_impl_3 = function closure_impl_31 set ref_function_closure_impl_4 = function closure_impl_17 set ref_function_Trig_npcs_Actions = function Trig_npcs_Actions set ref_function_Timed_timerCallback_3 = function Timed_timerCallback_3 set ref_function_Periodic_timerCallback = function Periodic_timerCallback_2 set ref_function_Periodic_timerCallback_2 = function Periodic_timerCallback set ref_function_switchDebug = function switchDebug set ref_function_closure_impl_5 = function closure_impl_24 set ref_function_itemSoldAction = function itemSoldAction set ref_function_onTimeout = function onTimeout set ref_function_orderAction = function orderAction set ref_function_update = function update set ref_function_closure_impl_6 = function closure_impl_20 set ref_function_closure_impl_7 = function closure_impl_22 set ref_function_closure_impl_8 = function closure_impl_26 set ref_function_callback = function callback set ref_function_spellEffect = function spellEffect set ref_function_learnAction = function learnAction set ref_function_unitAttacked = function unitAttacked set ref_function_DummyCaster_filterAOE = function DummyCaster_filterAOE set ref_function_closure_impl_9 = function closure_impl_16 set ref_function_closure_impl_10 = function closure_impl_21 set ref_function_closure_impl_11 = function closure_impl_23 set ref_function_closure_impl_12 = function closure_impl_30 set ref_function_closure_impl_13 = function closure_impl_28 set ref_function_useItemAction = function useItemAction set ref_function_incAttributeAction = function incAttributeAction set ref_function_levelupAction = function levelupAction set ref_function_heroPickedAction = function heroPickedAction set ref_function_takeItem = function takeItem set ref_function_dropItem = function dropItem endfunction function init_AbilityTooltipGenerator takes nothing returns nothing endfunction function trigger_registerPlayerUnitEvent takes trigger this_2, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns nothing call TriggerRegisterPlayerUnitEvent(this_2, whichPlayer, whichPlayerUnitEvent, filter) endfunction function init_Bag takes nothing returns nothing local integer pid local integer temp local trigger receiver local trigger receiver_2 local trigger receiver_3 local trigger receiver_4 set Bag_BAG_MOVE_TIMEOUT = 0.4 set Bag_blockEvents = false call timer_startPeriodic(CreateTimer(), Bag_BAG_MOVE_TIMEOUT, ref_function_onTimeout) set pid = 0 set temp = Config_NUM_OF_PLAYERS - 1 loop exitwhen pid > temp set receiver = CreateTrigger() call trigger_registerPlayerUnitEvent(receiver, Player_players[pid], EVENT_PLAYER_UNIT_ISSUED_ORDER, null) set receiver_2 = receiver call trigger_registerPlayerUnitEvent(receiver_2, Player_players[pid], EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, null) set receiver_3 = receiver_2 call trigger_registerPlayerUnitEvent(receiver_3, Player_players[pid], EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null) set receiver_4 = receiver_3 call trigger_addAction(receiver_4, ref_function_orderAction) set pid = pid + 1 endloop set receiver = null set receiver_2 = null set receiver_3 = null set receiver_4 = null endfunction function init_BagObjGen takes nothing returns nothing set BagObjGen_BAG_RAW = 1430413671 endfunction function init_Basics takes nothing returns nothing set Basics_DUMMY_UNIT_ID = 2019849581 set Basics_HEIGHT_ENABLER = 1097691750 set Basics_LOCUST_ID = 1097625443 set Basics_ANIMATION_PERIOD = 0.03 set Basics_DUMMY_PLAYER = Player(15) call Player(12) endfunction function alloc_BonusType takes nothing returns integer local integer this_2 if BonusType_firstFree == 0 then set BonusType_maxIndex = BonusType_maxIndex + 1 set this_2 = BonusType_maxIndex else set BonusType_firstFree = BonusType_firstFree - 1 set this_2 = BonusType_nextFree[BonusType_firstFree] endif set BonusType_typeId[this_2] = 659 return this_2 endfunction function construct_BonusType takes integer this_2, integer baseRaw, integer maxBonus returns nothing set BonusType_baseRaw[this_2] = baseRaw set BonusType_maxBonus[this_2] = maxBonus endfunction function new_BonusType takes integer baseRaw, integer maxBonus returns integer local integer this_2 = alloc_BonusType() call construct_BonusType(this_2, baseRaw, maxBonus) return this_2 endfunction function int_moduloInt takes integer this_2, integer divisor returns integer return this_2 - this_2 / divisor * divisor endfunction function shiftRaw takes integer n returns integer if n < 10 then return n else return n / 10 * 256 + int_moduloInt(n, 10) endif endfunction function init_BonusHandler takes nothing returns nothing local integer n = 0 local integer n_2 loop exitwhen n > 30 set BonusHandler_powersOf2[n] = real_toInt(Pow(2., int_toReal(n))) set n = n + 1 endloop set n_2 = 0 loop exitwhen n_2 > 30 set BonusHandler_rawShifts[n_2] = shiftRaw(n_2) set n_2 = n_2 + 1 endloop set BonusHandler_rawShiftNeg = 808463661 - 808464432 set BonusHandler_bonusTypes[0] = new_BonusType(608972848, BonusHandlerConfig_MAX_BONUS_LIFE) set BonusHandler_bonusTypes[1] = new_BonusType(609038384, BonusHandlerConfig_MAX_BONUS_MANA) set BonusHandler_bonusTypes[2] = new_BonusType(608448560, BonusHandlerConfig_MAX_BONUS_DAMAGE) set BonusHandler_bonusTypes[3] = new_BonusType(609366064, BonusHandlerConfig_MAX_BONUS_ARMOR) set BonusHandler_bonusTypes[4] = new_BonusType(609628208, BonusHandlerConfig_MAX_BONUS_SIGHTRANGE) set BonusHandler_bonusTypes[5] = new_BonusType(611070000, BonusHandlerConfig_MAX_BONUS_LIFEREGEN) set BonusHandler_bonusTypes[6] = new_BonusType(611135536, BonusHandlerConfig_MAX_BONUS_MANAREGEN) set BonusHandler_bonusTypes[7] = new_BonusType(609234992, BonusHandlerConfig_MAX_BONUS_ATTACKSPEED) set BonusHandler_bonusTypes[8] = new_BonusType(609431600, BonusHandlerConfig_MAX_BONUS_STRENGTH) set BonusHandler_bonusTypes[9] = new_BonusType(608251952, BonusHandlerConfig_MAX_BONUS_AGILITY) set BonusHandler_bonusTypes[10] = new_BonusType(608776240, BonusHandlerConfig_MAX_BONUS_INTELLIGENCE) endfunction function init_BonusHandlerConfig takes nothing returns nothing set BonusHandlerConfig_MAX_BONUS_LIFE = 12 set BonusHandlerConfig_MAX_BONUS_MANA = 12 set BonusHandlerConfig_MAX_BONUS_DAMAGE = 10 set BonusHandlerConfig_MAX_BONUS_ARMOR = 10 set BonusHandlerConfig_MAX_BONUS_SIGHTRANGE = 11 set BonusHandlerConfig_MAX_BONUS_LIFEREGEN = 4 set BonusHandlerConfig_MAX_BONUS_MANAREGEN = 10 set BonusHandlerConfig_MAX_BONUS_ATTACKSPEED = 9 set BonusHandlerConfig_MAX_BONUS_STRENGTH = 9 set BonusHandlerConfig_MAX_BONUS_AGILITY = 9 set BonusHandlerConfig_MAX_BONUS_INTELLIGENCE = 9 endfunction function init_CastBar takes nothing returns nothing set CastBar_CASTBAR_DUMMY = 1885495666 endfunction function alloc_OrderStringFactory takes nothing returns integer local integer this_2 if OrderStringFactory_firstFree == 0 then set OrderStringFactory_maxIndex = OrderStringFactory_maxIndex + 1 set this_2 = OrderStringFactory_maxIndex else set OrderStringFactory_firstFree = OrderStringFactory_firstFree - 1 set this_2 = OrderStringFactory_nextFree[OrderStringFactory_firstFree] endif return this_2 endfunction function construct_OrderStringFactory takes integer this_2 returns nothing endfunction function new_OrderStringFactory takes nothing returns integer local integer this_2 = alloc_OrderStringFactory() call construct_OrderStringFactory(this_2) return this_2 endfunction function init_ChannelAbilityPreset takes nothing returns nothing call new_OrderStringFactory() endfunction function c2sInit takes nothing returns nothing set Char_c2s[0] = "" set Char_c2s[1] = "" set Char_c2s[2] = "" set Char_c2s[3] = "" set Char_c2s[4] = "" set Char_c2s[5] = "" set Char_c2s[6] = "" set Char_c2s[7] = "" set Char_c2s[8] = "" set Char_c2s[9] = "\t" set Char_c2s[10] = "\n" set Char_c2s[11] = "" set Char_c2s[12] = "" set Char_c2s[13] = "\r" set Char_c2s[14] = "" set Char_c2s[15] = "" set Char_c2s[16] = "" set Char_c2s[17] = "" set Char_c2s[18] = "" set Char_c2s[19] = "" set Char_c2s[20] = "" set Char_c2s[21] = "" set Char_c2s[22] = "" set Char_c2s[23] = "" set Char_c2s[24] = "" set Char_c2s[25] = "" set Char_c2s[26] = "" set Char_c2s[27] = "" set Char_c2s[28] = "" set Char_c2s[29] = "" set Char_c2s[30] = "" set Char_c2s[31] = "" set Char_c2s[32] = " " set Char_c2s[33] = "!" set Char_c2s[34] = "\"" set Char_c2s[35] = "#" set Char_c2s[36] = "$" set Char_c2s[37] = "%" set Char_c2s[38] = "&" set Char_c2s[39] = "'" set Char_c2s[40] = "(" set Char_c2s[41] = ")" set Char_c2s[42] = "*" set Char_c2s[43] = "+" set Char_c2s[44] = "," set Char_c2s[45] = "-" set Char_c2s[46] = "." set Char_c2s[47] = "/" set Char_c2s[48] = "0" set Char_c2s[49] = "1" set Char_c2s[50] = "2" set Char_c2s[51] = "3" set Char_c2s[52] = "4" set Char_c2s[53] = "5" set Char_c2s[54] = "6" set Char_c2s[55] = "7" set Char_c2s[56] = "8" set Char_c2s[57] = "9" set Char_c2s[58] = ":" set Char_c2s[59] = ";" set Char_c2s[60] = "<" set Char_c2s[61] = "=" set Char_c2s[62] = ">" set Char_c2s[63] = "?" set Char_c2s[64] = "@" set Char_c2s[65] = "A" set Char_c2s[66] = "B" set Char_c2s[67] = "C" set Char_c2s[68] = "D" set Char_c2s[69] = "E" set Char_c2s[70] = "F" set Char_c2s[71] = "G" set Char_c2s[72] = "H" set Char_c2s[73] = "I" set Char_c2s[74] = "J" set Char_c2s[75] = "K" set Char_c2s[76] = "L" set Char_c2s[77] = "M" set Char_c2s[78] = "N" set Char_c2s[79] = "O" set Char_c2s[80] = "P" set Char_c2s[81] = "Q" set Char_c2s[82] = "R" set Char_c2s[83] = "S" set Char_c2s[84] = "T" set Char_c2s[85] = "U" set Char_c2s[86] = "V" set Char_c2s[87] = "W" set Char_c2s[88] = "X" set Char_c2s[89] = "Y" set Char_c2s[90] = "Z" set Char_c2s[91] = "[" set Char_c2s[92] = "\\" set Char_c2s[93] = "]" set Char_c2s[94] = "^" set Char_c2s[95] = "_" set Char_c2s[96] = "`" set Char_c2s[97] = "a" set Char_c2s[98] = "b" set Char_c2s[99] = "c" set Char_c2s[100] = "d" set Char_c2s[101] = "e" set Char_c2s[102] = "f" set Char_c2s[103] = "g" set Char_c2s[104] = "h" set Char_c2s[105] = "i" set Char_c2s[106] = "j" set Char_c2s[107] = "k" set Char_c2s[108] = "l" set Char_c2s[109] = "m" set Char_c2s[110] = "n" set Char_c2s[111] = "o" set Char_c2s[112] = "p" set Char_c2s[113] = "q" set Char_c2s[114] = "r" set Char_c2s[115] = "s" set Char_c2s[116] = "t" set Char_c2s[117] = "u" set Char_c2s[118] = "v" set Char_c2s[119] = "w" set Char_c2s[120] = "x" set Char_c2s[121] = "y" set Char_c2s[122] = "z" set Char_c2s[123] = "{" set Char_c2s[124] = "|" set Char_c2s[125] = "}" set Char_c2s[126] = "~" set Char_c2s[127] = "" endfunction function string_toUpperCase takes string this_2 returns string return StringCase(this_2, true) endfunction function s2cInit takes nothing returns nothing local integer i = 0 local integer temp = Char_MAX_INDEX loop exitwhen i > temp if string_toUpperCase(Char_c2s[i]) == Char_c2s[i] then endif set i = i + 1 endloop endfunction function widthInit takes nothing returns nothing endfunction function init_Char takes nothing returns nothing set Char_MAX_INDEX = 126 + 1 call c2sInit() call s2cInit() call widthInit() endfunction function trigger_registerPlayerChatEvent takes trigger this_2, player whichPlayer, string chatMessageToDetect, boolean exactMatchOnly returns nothing call TriggerRegisterPlayerChatEvent(this_2, whichPlayer, chatMessageToDetect, exactMatchOnly) endfunction function chatEvent takes string s, code c returns nothing local trigger receiver = CreateTrigger() local trigger receiver_2 call trigger_registerPlayerChatEvent(receiver, Player(0), s, true) set receiver_2 = receiver call trigger_addAction(receiver_2, c) set receiver = null set receiver_2 = null endfunction function init_CmdClear takes nothing returns nothing call chatEvent("-clear", ref_function_closure_impl_13) endfunction function init_CmdStats takes nothing returns nothing call chatEvent("-stats", ref_function_closure_impl_12) endfunction function alloc_Table takes nothing returns integer local integer this_2 if Table_firstFree == 0 then set Table_maxIndex = Table_maxIndex + 1 set this_2 = Table_maxIndex else set Table_firstFree = Table_firstFree - 1 set this_2 = Table_nextFree[Table_firstFree] endif set Table_typeId[this_2] = 9 return this_2 endfunction function construct_Table takes integer this_2 returns nothing endfunction function new_Table takes nothing returns integer local integer this_2 = alloc_Table() call construct_Table(this_2) return this_2 endfunction function init_Colors takes nothing returns nothing local integer i = 0 local integer i2 loop exitwhen i > 9 call int_toString(i) set i = i + 1 endloop set Colors_decs = new_Table() set i2 = 0 loop exitwhen i2 > 9 call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, Colors_decs, StringHash(int_toString(i2)), i2, null, 0, 0, false) set i2 = i2 + 1 endloop call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, Colors_decs, StringHash("A"), 10, null, 0, 0, false) call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, Colors_decs, StringHash("B"), 11, null, 0, 0, false) call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, Colors_decs, StringHash("C"), 12, null, 0, 0, false) call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, Colors_decs, StringHash("D"), 13, null, 0, 0, false) call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, Colors_decs, StringHash("E"), 14, null, 0, 0, false) call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 1, Colors_decs, StringHash("F"), 15, null, 0, 0, false) endfunction function init_Config takes nothing returns nothing set Config_NUM_OF_PLAYERS = 5 endfunction function alloc_HashMap takes nothing returns integer local integer this_2 if HashMap_firstFree == 0 then set HashMap_maxIndex = HashMap_maxIndex + 1 set this_2 = HashMap_maxIndex else set HashMap_firstFree = HashMap_firstFree - 1 set this_2 = HashMap_nextFree[HashMap_firstFree] endif set HashMap_typeId[this_2] = 660 return this_2 endfunction function construct_HashMap takes integer this_2 returns nothing endfunction function new_HashMap takes nothing returns integer local integer this_2 = alloc_HashMap() call construct_HashMap(this_2) return this_2 endfunction function init_CreepDrop takes nothing returns nothing set CreepDrop_unitDrops = new_HashMap() endfunction function alloc_Drop takes nothing returns integer local integer this_2 if Drop_firstFree == 0 then set Drop_maxIndex = Drop_maxIndex + 1 set this_2 = Drop_maxIndex else set Drop_firstFree = Drop_firstFree - 1 set this_2 = Drop_nextFree[Drop_firstFree] endif return this_2 endfunction function construct_Drop takes integer this_2, integer chance, integer itemRaw returns nothing set Drop_chance[this_2] = chance set Drop_itemRaw[this_2] = itemRaw endfunction function new_Drop takes integer chance, integer itemRaw returns integer local integer this_2 = alloc_Drop() call construct_Drop(this_2, chance, itemRaw) return this_2 endfunction function Droptable_add takes integer this_2, integer chance, integer itemRaw returns nothing call dispatch_LinkedList_add(Droptable_drops[this_2], new_Drop(chance, itemRaw)) endfunction function dispatch_Droptable_add takes integer this_2, integer chance, integer itemRaw returns nothing if Droptable_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Droptable.add", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Droptable.add on invalid object.", 0, 0, false) endif endif call Droptable_add(this_2, chance, itemRaw) endfunction function alloc_Droptable takes nothing returns integer local integer this_2 if Droptable_firstFree == 0 then set Droptable_maxIndex = Droptable_maxIndex + 1 set this_2 = Droptable_maxIndex else set Droptable_firstFree = Droptable_firstFree - 1 set this_2 = Droptable_nextFree[Droptable_firstFree] endif set Droptable_typeId[this_2] = 704 return this_2 endfunction function construct_Droptable takes integer this_2, integer unitRaw returns nothing call dispatch_HashMap_put(CreepDrop_unitDrops, unitRaw, this_2) set Droptable_drops[this_2] = new_LinkedList() set Droptable_questDrops[this_2] = new_LinkedList() endfunction function new_Droptable takes integer unitRaw returns integer local integer this_2 = alloc_Droptable() call construct_Droptable(this_2, unitRaw) return this_2 endfunction function init_CreepDroptable takes nothing returns nothing local integer receiver = new_Droptable(1747988528) local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer receiver_12 local integer receiver_13 local integer receiver_14 local integer receiver_15 local integer receiver_16 local integer receiver_17 local integer receiver_18 local integer receiver_19 local integer receiver_20 local integer receiver_21 local integer receiver_22 call dispatch_Droptable_add(receiver, 5, 1228222513) set receiver_2 = receiver call dispatch_Droptable_add(receiver_2, 5, 1228222514) set receiver_3 = receiver_2 call dispatch_Droptable_add(receiver_3, 10, 1229795376) set receiver_4 = new_Droptable(1747988529) call dispatch_Droptable_add(receiver_4, 5, 1228091441) set receiver_5 = receiver_4 call dispatch_Droptable_add(receiver_5, 5, 1228091442) set receiver_6 = receiver_5 call dispatch_Droptable_add(receiver_6, 5, 1228091443) set receiver_7 = receiver_6 call dispatch_Droptable_add(receiver_7, 10, 1229795378) set receiver_8 = new_Droptable(1747988530) call dispatch_Droptable_add(receiver_8, 6, 1228091441) set receiver_9 = receiver_8 call dispatch_Droptable_add(receiver_9, 6, 1228091442) set receiver_10 = receiver_9 call dispatch_Droptable_add(receiver_10, 6, 1228091443) set receiver_11 = receiver_10 call dispatch_Droptable_add(receiver_11, 10, 1229795378) set receiver_12 = new_Droptable(1747988531) call dispatch_Droptable_add(receiver_12, 5, 1227960374) set receiver_13 = receiver_12 call dispatch_Droptable_add(receiver_13, 10, 1229795379) set receiver_14 = new_Droptable(1747988532) call dispatch_Droptable_add(receiver_14, 30, 1227960373) set receiver_15 = receiver_14 call dispatch_Droptable_add(receiver_15, 30, 1228091444) set receiver_16 = receiver_15 call dispatch_Droptable_add(receiver_16, 30, 1228156979) set receiver_17 = new_Droptable(1747988533) call dispatch_Droptable_add(receiver_17, 17, 1228156980) set receiver_18 = receiver_17 call dispatch_Droptable_add(receiver_18, 17, 1228025908) set receiver_19 = receiver_18 call dispatch_Droptable_add(receiver_19, 17, 1227960375) set receiver_20 = receiver_19 call dispatch_Droptable_add(receiver_20, 17, 1228222515) set receiver_21 = receiver_20 call dispatch_Droptable_add(receiver_21, 16, 1228222516) set receiver_22 = receiver_21 call dispatch_Droptable_add(receiver_22, 16, 1228222517) endfunction function init_CreepExp takes nothing returns nothing set CreepExp_CREEP_EXP_RANGE = 1200. set CreepExp_MAX_LVL_DIFFERENCE = 5 set CreepExp_EXP_LEVEL_FACTOR = 10 endfunction function alloc_CreepRespawn takes nothing returns integer local integer this_2 if CreepRespawn_firstFree == 0 then set CreepRespawn_maxIndex = CreepRespawn_maxIndex + 1 set this_2 = CreepRespawn_maxIndex else set CreepRespawn_firstFree = CreepRespawn_firstFree - 1 set this_2 = CreepRespawn_nextFree[CreepRespawn_firstFree] endif set CreepRespawn_typeId[this_2] = 693 return this_2 endfunction function real_asAngleDegrees takes real this_2 returns real return this_2 * Maths_DEGTORAD endfunction function unit_getFacingAngle takes unit this_2 returns real return real_asAngleDegrees(GetUnitFacing(this_2)) endfunction function construct_CreepRespawn takes integer this_2, unit u returns nothing local integer tempIndex set CreepRespawn_unitRaw[this_2] = unit_getTypeId(u) set tempIndex = this_2 set CreepRespawn_pos[tempIndex] = unit_getPos(u) set CreepRespawn_pos_2[tempIndex] = unit_getPos_return_y set CreepRespawn_facing[this_2] = unit_getFacingAngle(u) endfunction function new_CreepRespawn takes unit u returns integer local integer this_2 = alloc_CreepRespawn() call construct_CreepRespawn(this_2, u) return this_2 endfunction function init_CreepRespawn takes nothing returns nothing local group g = CreateGroup() local group wurst__iterator0 local unit u call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, null) set wurst__iterator0 = group_iterator(g) loop exitwhen not group_hasNext(wurst__iterator0) set u = group_next(wurst__iterator0) if unit_getOwner(u) == Player(PLAYER_NEUTRAL_AGGRESSIVE) then set UnitData_creepRespawn[new_UnitData(u)] = new_CreepRespawn(u) endif endloop call group_close(wurst__iterator0) call group_close(g) set g = null set wurst__iterator0 = null set u = null endfunction function init_DamageHandler takes nothing returns nothing local trigger receiver set DamageHandler_blockDmgEvent = false set receiver = CreateTrigger() call trigger_addAction(receiver, ref_function_unitAttacked) set DamageHandler_unitAttackTrigger = receiver set receiver = null endfunction function init_Debug takes nothing returns nothing call chatEvent("-iter inventory", ref_function_closure_impl_11) endfunction function init_DummyCaster takes nothing returns nothing set DummyCaster_FORCE_INVISIBLE_CAST = false set DummyCaster_AUTO_RESET_MANA_COOLDOWN = true set DummyCaster_delayTable = new_Table() call Condition(ref_function_DummyCaster_filterAOE) endfunction function init_EquipmentSlotList takes nothing returns nothing endfunction function init_ErrorHandling takes nothing returns nothing set ErrorHandling_MUTE_ERROR_DURATION = 60 set ErrorHandling_traceHashs = new_Table() endfunction function init_GameTimer takes nothing returns nothing set GameTimer_gameTimer = CreateTimer() call timer_start(GameTimer_gameTimer, 100000., null) call timer_startPeriodic(CreateTimer(), Basics_ANIMATION_PERIOD, ref_function_closure_impl_5) endfunction function init_HashMap takes nothing returns nothing set HashMap_ht = InitHashtable() endfunction function init_HeroInventory takes nothing returns nothing local trigger takeItemTrigger local trigger receiver local trigger dropItemTrigger local trigger receiver_2 local integer i local integer temp set HeroInventory_blockEvents = false set receiver = CreateTrigger() call trigger_addAction(receiver, ref_function_takeItem) set takeItemTrigger = receiver set receiver_2 = CreateTrigger() call trigger_addAction(receiver_2, ref_function_dropItem) set dropItemTrigger = receiver_2 set i = 0 set temp = Config_NUM_OF_PLAYERS - 1 loop exitwhen i > temp call trigger_registerPlayerUnitEvent(takeItemTrigger, Player(i), EVENT_PLAYER_UNIT_PICKUP_ITEM, null) call trigger_registerPlayerUnitEvent(dropItemTrigger, Player(i), EVENT_PLAYER_UNIT_DROP_ITEM, null) set i = i + 1 endloop set takeItemTrigger = null set receiver = null set dropItemTrigger = null set receiver_2 = null endfunction function init_HeroRespawn takes nothing returns nothing local real temp_HeroRespawn_HERO_RESPAWN_POS_x local real temp_HeroRespawn_HERO_RESPAWN_POS_y set HeroRespawn_HERO_RESPAWN_TIME = 20. set temp_HeroRespawn_HERO_RESPAWN_POS_x = -10250. set temp_HeroRespawn_HERO_RESPAWN_POS_y = 4390. set HeroRespawn_HERO_RESPAWN_POS_x = temp_HeroRespawn_HERO_RESPAWN_POS_x set HeroRespawn_HERO_RESPAWN_POS_y = temp_HeroRespawn_HERO_RESPAWN_POS_y endfunction function ObjectDefinition_setString takes integer this_key, string modification, string value returns nothing endfunction function UnitOrBuildingOrHeroDefinition_setNormalAbilities takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "uabi", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setNormalAbilities takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setNormalAbilities", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setNormalAbilities on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setNormalAbilities(this_2, data) endfunction function HeroDefinition_addGlow takes integer this_2 returns nothing call dispatch_UnitOrBuildingOrHeroDefinition_setNormalAbilities(this_2, "AInv,AA01,AXgl") endfunction function UnitOrBuildingOrHeroDefinition_setAttack1ProjectileArt takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "ua1m", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setAttack1ProjectileArt takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setAttack1ProjectileArt", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setAttack1ProjectileArt on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setAttack1ProjectileArt(this_2, data) endfunction function ObjectDefinition_setInt takes integer this_key, string modification, integer value returns nothing endfunction function UnitOrBuildingOrHeroDefinition_setAttack1Range takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ua1r", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setAttack1Range takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setAttack1Range", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setAttack1Range on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setAttack1Range(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setIconGameInterface takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "uico", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setIconGameInterface takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setIconGameInterface", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setIconGameInterface on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setIconGameInterface(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setModelFile takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "umdl", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setModelFile takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setModelFile", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setModelFile on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setModelFile(this_2, data) endfunction function ObjectDefinition_setReal takes integer this_key, string modification, real value returns nothing endfunction function UnitOrBuildingOrHeroDefinition_setScalingValue takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setReal(W3UDefinition_def[tempIndex], "usca", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setScalingValue takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setScalingValue", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setScalingValue on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setScalingValue(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setSelectionScale takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setReal(W3UDefinition_def[tempIndex], "ussc", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setSelectionScale takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setSelectionScale", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setSelectionScale on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setSelectionScale(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setUnitSoundSet takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "usnd", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setUnitSoundSet takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setUnitSoundSet", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setUnitSoundSet on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setUnitSoundSet(this_2, data) endfunction function ObjectDefinition_setUnreal takes integer this_key, string modification, real value returns nothing endfunction function HeroDefinition_setAgilityPerLevel takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setUnreal(W3UDefinition_def[tempIndex], "uagp", data) endfunction function dispatch_HeroDefinition_setAgilityPerLevel takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setAgilityPerLevel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setAgilityPerLevel on invalid object.", 0, 0, false) endif endif call HeroDefinition_setAgilityPerLevel(this_2, data) endfunction function HeroDefinition_setHeroAbilities takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "uhab", data) endfunction function dispatch_HeroDefinition_setHeroAbilities takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setHeroAbilities", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setHeroAbilities on invalid object.", 0, 0, false) endif endif call HeroDefinition_setHeroAbilities(this_2, data) endfunction function HeroDefinition_setIntelligencePerLevel takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setUnreal(W3UDefinition_def[tempIndex], "uinp", data) endfunction function dispatch_HeroDefinition_setIntelligencePerLevel takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setIntelligencePerLevel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setIntelligencePerLevel on invalid object.", 0, 0, false) endif endif call HeroDefinition_setIntelligencePerLevel(this_2, data) endfunction function HeroDefinition_setPrimaryAttribute takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "upra", data) endfunction function dispatch_HeroDefinition_setPrimaryAttribute takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setPrimaryAttribute", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setPrimaryAttribute on invalid object.", 0, 0, false) endif endif call HeroDefinition_setPrimaryAttribute(this_2, data) endfunction function HeroDefinition_setStartingAgility takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "uagi", data) endfunction function dispatch_HeroDefinition_setStartingAgility takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setStartingAgility", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setStartingAgility on invalid object.", 0, 0, false) endif endif call HeroDefinition_setStartingAgility(this_2, data) endfunction function HeroDefinition_setStartingIntelligence takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "uint", data) endfunction function dispatch_HeroDefinition_setStartingIntelligence takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setStartingIntelligence", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setStartingIntelligence on invalid object.", 0, 0, false) endif endif call HeroDefinition_setStartingIntelligence(this_2, data) endfunction function HeroDefinition_setStartingStrength takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ustr", data) endfunction function dispatch_HeroDefinition_setStartingStrength takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setStartingStrength", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setStartingStrength on invalid object.", 0, 0, false) endif endif call HeroDefinition_setStartingStrength(this_2, data) endfunction function HeroDefinition_setStrengthPerLevel takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setUnreal(W3UDefinition_def[tempIndex], "ustp", data) endfunction function dispatch_HeroDefinition_setStrengthPerLevel takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling HeroDefinition.setStrengthPerLevel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called HeroDefinition.setStrengthPerLevel on invalid object.", 0, 0, false) endif endif call HeroDefinition_setStrengthPerLevel(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setAttack1CooldownTime takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setUnreal(W3UDefinition_def[tempIndex], "ua1c", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setAttack1CooldownTime takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setAttack1CooldownTime", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setAttack1CooldownTime on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setAttack1CooldownTime(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setAttack1DamageBase takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ua1b", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageBase takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setAttack1DamageBase", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setAttack1DamageBase on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setAttack1DamageBase(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setAttack1DamageNumberofDice takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ua1d", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageNumberofDice takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setAttack1DamageNumberofDice", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setAttack1DamageNumberofDice on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setAttack1DamageNumberofDice(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setAttack1DamageSidesperDie takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ua1s", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageSidesperDie takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setAttack1DamageSidesperDie", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setAttack1DamageSidesperDie on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setAttack1DamageSidesperDie(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setAttacksEnabled takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "uaen", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setAttacksEnabled takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setAttacksEnabled", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setAttacksEnabled on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setAttacksEnabled(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setDefaultActiveAbility takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "udaa", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setDefaultActiveAbility takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setDefaultActiveAbility", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setDefaultActiveAbility on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setDefaultActiveAbility(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setDefenseBase takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "udef", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setDefenseBase takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setDefenseBase", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setDefenseBase on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setDefenseBase(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setDefenseUpgradeBonus takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "udup", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setDefenseUpgradeBonus takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setDefenseUpgradeBonus", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setDefenseUpgradeBonus on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setDefenseUpgradeBonus(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setDependencyEquivalents takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "udep", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setDependencyEquivalents takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setDependencyEquivalents", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setDependencyEquivalents on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setDependencyEquivalents(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setFoodCost takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ufoo", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setFoodCost takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setFoodCost", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setFoodCost on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setFoodCost(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedBase takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ubba", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedBase takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setGoldBountyAwardedBase", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setGoldBountyAwardedBase on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedBase(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedNumberofDice takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ubdi", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedNumberofDice takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setGoldBountyAwardedNumberofDice", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setGoldBountyAwardedNumberofDice on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedNumberofDice(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setHitPointsMaximumBase takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "uhpm", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setHitPointsMaximumBase takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setHitPointsMaximumBase", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setHitPointsMaximumBase on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setHitPointsMaximumBase(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setHitPointsRegenerationRate takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setUnreal(W3UDefinition_def[tempIndex], "uhpr", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setHitPointsRegenerationRate takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setHitPointsRegenerationRate", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setHitPointsRegenerationRate on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setHitPointsRegenerationRate(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setManaMaximum takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "umpm", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setManaMaximum takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setManaMaximum", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setManaMaximum on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setManaMaximum(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setManaRegeneration takes integer this_2, real data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setUnreal(W3UDefinition_def[tempIndex], "umpr", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setManaRegeneration takes integer this_2, real data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setManaRegeneration", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setManaRegeneration on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setManaRegeneration(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setNameEditorSuffix takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "unsf", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setNameEditorSuffix takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setNameEditorSuffix", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setNameEditorSuffix on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setNameEditorSuffix(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setPointValue takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "upoi", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setPointValue takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setPointValue", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setPointValue on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setPointValue(this_2, data) endfunction function Race_toObjectString takes integer this_2 returns string local string result = "unknown" local integer temp = this_2 if temp == 0 then set result = "commoner" elseif temp == 1 then set result = "creeps" elseif temp == 2 then set result = "critters" elseif temp == 3 then set result = "demon" elseif temp == 4 then set result = "human" elseif temp == 5 then set result = "naga" elseif temp == 6 then set result = "nightelf" elseif temp == 7 then set result = "orc" elseif temp == 8 then set result = "other" elseif temp == 9 then set result = "undead" elseif temp == 10 then set result = "unknown" endif return result endfunction function UnitOrBuildingOrHeroDefinition_setRace takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "urac", Race_toObjectString(data)) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setRace takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setRace", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setRace on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setRace(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setSightRadiusDay takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "usid", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setSightRadiusDay takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setSightRadiusDay", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setSightRadiusDay on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setSightRadiusDay(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setSightRadiusNight takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "usin", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setSightRadiusNight takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setSightRadiusNight", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setSightRadiusNight on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setSightRadiusNight(this_2, data) endfunction function boolean_toInt takes boolean this_2 returns integer if this_2 then return 1 else return 0 endif endfunction function ObjectDefinition_setBoolean takes integer this_key, string modification, boolean value returns nothing call ObjectDefinition_setInt(this_key, modification, boolean_toInt(value)) endfunction function UnitOrBuildingOrHeroDefinition_setSleeps takes integer this_2, boolean data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setBoolean(W3UDefinition_def[tempIndex], "usle", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setSleeps takes integer this_2, boolean data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setSleeps", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setSleeps on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setSleeps(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setSpeedBase takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "umvs", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setSpeedBase takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setSpeedBase", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setSpeedBase on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setSpeedBase(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setUnitClassification takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "utyp", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setUnitClassification takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setUnitClassification", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setUnitClassification on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setUnitClassification(this_2, data) endfunction function UnitOrHeroDefinition_setLevel takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3UDefinition_def[tempIndex], "ulev", data) endfunction function dispatch_UnitOrHeroDefinition_setLevel takes integer this_2, integer data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrHeroDefinition.setLevel", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrHeroDefinition.setLevel on invalid object.", 0, 0, false) endif endif call UnitOrHeroDefinition_setLevel(this_2, data) endfunction function W3UDefinition_setDescription takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "ides", data) endfunction function dispatch_W3UDefinition_setDescription takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3UDefinition.setDescription", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3UDefinition.setDescription on invalid object.", 0, 0, false) endif endif call W3UDefinition_setDescription(this_2, data) endfunction function W3UDefinition_setHotkey takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "uhot", data) endfunction function dispatch_W3UDefinition_setHotkey takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3UDefinition.setHotkey", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3UDefinition.setHotkey on invalid object.", 0, 0, false) endif endif call W3UDefinition_setHotkey(this_2, data) endfunction function W3UDefinition_setName takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "unam", data) endfunction function dispatch_W3UDefinition_setName takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3UDefinition.setName", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3UDefinition.setName on invalid object.", 0, 0, false) endif endif call W3UDefinition_setName(this_2, data) endfunction function W3UDefinition_setRequirements takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "ureq", data) endfunction function dispatch_W3UDefinition_setRequirements takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3UDefinition.setRequirements", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3UDefinition.setRequirements on invalid object.", 0, 0, false) endif endif call W3UDefinition_setRequirements(this_2, data) endfunction function W3UDefinition_setRequirementsLevels takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "urqa", data) endfunction function dispatch_W3UDefinition_setRequirementsLevels takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3UDefinition.setRequirementsLevels", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3UDefinition.setRequirementsLevels on invalid object.", 0, 0, false) endif endif call W3UDefinition_setRequirementsLevels(this_2, data) endfunction function W3UDefinition_setTooltipBasic takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "utip", data) endfunction function dispatch_W3UDefinition_setTooltipBasic takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3UDefinition.setTooltipBasic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3UDefinition.setTooltipBasic on invalid object.", 0, 0, false) endif endif call W3UDefinition_setTooltipBasic(this_2, data) endfunction function W3UDefinition_setTooltipExtended takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "utub", data) endfunction function dispatch_W3UDefinition_setTooltipExtended takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3UDefinition.setTooltipExtended", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3UDefinition.setTooltipExtended on invalid object.", 0, 0, false) endif endif call W3UDefinition_setTooltipExtended(this_2, data) endfunction function alloc_HeroDefinition takes nothing returns integer local integer this_2 if W3UDefinition_firstFree == 0 then set W3UDefinition_maxIndex = W3UDefinition_maxIndex + 1 set this_2 = W3UDefinition_maxIndex else set W3UDefinition_firstFree = W3UDefinition_firstFree - 1 set this_2 = W3UDefinition_nextFree[W3UDefinition_firstFree] endif set W3UDefinition_typeId[this_2] = 27 return this_2 endfunction function createObjectDefinition takes string fileType, integer newId, integer deriveFrom returns integer return 0 endfunction function construct_W3UDefinition takes integer this_2, integer newUnitId, integer origUnitId returns nothing set W3UDefinition_def[this_2] = createObjectDefinition("w3u", newUnitId, origUnitId) endfunction function construct_UnitOrBuildingOrHeroDefinition takes integer this_2, integer newUnitId, integer origUnitId returns nothing call construct_W3UDefinition(this_2, newUnitId, origUnitId) endfunction function construct_UnitOrHeroDefinition takes integer this_2, integer newId, integer origId returns nothing call construct_UnitOrBuildingOrHeroDefinition(this_2, newId, origId) endfunction function construct_HeroDefinition takes integer this_2, integer newId, integer origId returns nothing call construct_UnitOrHeroDefinition(this_2, newId, origId) endfunction function new_HeroDefinition takes integer newId, integer origId returns integer local integer this_2 = alloc_HeroDefinition() call construct_HeroDefinition(this_2, newId, origId) return this_2 endfunction function genHeroData takes integer raw, integer baseRaw, string name, integer life, integer mana, integer damage, integer armor, integer attackspeed, integer movespeed, integer str, integer agi, integer inte returns integer local integer receiver = new_HeroDefinition(raw, baseRaw) local integer def local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer receiver_12 local integer receiver_13 local integer receiver_14 local integer receiver_15 local integer receiver_16 local integer receiver_17 local integer receiver_18 local integer receiver_19 local integer receiver_20 local integer receiver_21 local integer receiver_22 local integer receiver_23 local integer receiver_24 local integer receiver_25 local integer receiver_26 local integer receiver_27 local integer receiver_28 local integer receiver_29 local integer receiver_30 local integer receiver_31 local integer receiver_32 local integer receiver_33 local integer receiver_34 local integer receiver_35 local integer receiver_36 local integer receiver_37 local integer receiver_38 local integer receiver_39 local integer receiver_40 local integer receiver_41 call dispatch_W3UDefinition_setName(receiver, name) set receiver_2 = receiver call dispatch_UnitOrHeroDefinition_setLevel(receiver_2, 1) set receiver_3 = receiver_2 call dispatch_UnitOrBuildingOrHeroDefinition_setHitPointsMaximumBase(receiver_3, life) set receiver_4 = receiver_3 call dispatch_UnitOrBuildingOrHeroDefinition_setManaMaximum(receiver_4, mana) set receiver_5 = receiver_4 call dispatch_UnitOrBuildingOrHeroDefinition_setHitPointsRegenerationRate(receiver_5, 0.) set receiver_6 = receiver_5 call dispatch_UnitOrBuildingOrHeroDefinition_setManaRegeneration(receiver_6, 0.) set receiver_7 = receiver_6 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageBase(receiver_7, damage - 1) set receiver_8 = receiver_7 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageNumberofDice(receiver_8, 1) set receiver_9 = receiver_8 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageSidesperDie(receiver_9, 1) set receiver_10 = receiver_9 call dispatch_UnitOrBuildingOrHeroDefinition_setAttacksEnabled(receiver_10, 1) set receiver_11 = receiver_10 call dispatch_UnitOrBuildingOrHeroDefinition_setDefenseBase(receiver_11, armor) set receiver_12 = receiver_11 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1CooldownTime(receiver_12, attackspeed * 0.01) set receiver_13 = receiver_12 call dispatch_UnitOrBuildingOrHeroDefinition_setSpeedBase(receiver_13, movespeed) set receiver_14 = receiver_13 call dispatch_HeroDefinition_setStartingStrength(receiver_14, str) set receiver_15 = receiver_14 call dispatch_HeroDefinition_setStartingAgility(receiver_15, agi) set receiver_16 = receiver_15 call dispatch_HeroDefinition_setStartingIntelligence(receiver_16, inte) set receiver_17 = receiver_16 call dispatch_HeroDefinition_setStrengthPerLevel(receiver_17, 0.) set receiver_18 = receiver_17 call dispatch_HeroDefinition_setAgilityPerLevel(receiver_18, 0.) set receiver_19 = receiver_18 call dispatch_HeroDefinition_setPrimaryAttribute(receiver_19, "STR") set receiver_20 = receiver_19 call dispatch_HeroDefinition_setIntelligencePerLevel(receiver_20, 0.) set receiver_21 = receiver_20 call dispatch_HeroDefinition_setHeroAbilities(receiver_21, "") set receiver_22 = receiver_21 call dispatch_UnitOrBuildingOrHeroDefinition_setDefaultActiveAbility(receiver_22, "") set receiver_23 = receiver_22 call dispatch_UnitOrBuildingOrHeroDefinition_setDependencyEquivalents(receiver_23, "") set receiver_24 = receiver_23 call dispatch_UnitOrBuildingOrHeroDefinition_setDefenseUpgradeBonus(receiver_24, 0) set receiver_25 = receiver_24 call dispatch_W3UDefinition_setRequirements(receiver_25, "") set receiver_26 = receiver_25 call dispatch_W3UDefinition_setRequirementsLevels(receiver_26, "") set receiver_27 = receiver_26 call dispatch_W3UDefinition_setDescription(receiver_27, "") set receiver_28 = receiver_27 call dispatch_UnitOrBuildingOrHeroDefinition_setNameEditorSuffix(receiver_28, "") set receiver_29 = receiver_28 call dispatch_W3UDefinition_setHotkey(receiver_29, "") set receiver_30 = receiver_29 call dispatch_W3UDefinition_setTooltipBasic(receiver_30, "") set receiver_31 = receiver_30 call dispatch_W3UDefinition_setTooltipExtended(receiver_31, "") set receiver_32 = receiver_31 call dispatch_UnitOrBuildingOrHeroDefinition_setUnitClassification(receiver_32, "") set receiver_33 = receiver_32 call dispatch_UnitOrBuildingOrHeroDefinition_setFoodCost(receiver_33, 0) set receiver_34 = receiver_33 call dispatch_UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedBase(receiver_34, 0) set receiver_35 = receiver_34 call dispatch_UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedNumberofDice(receiver_35, 0) set receiver_36 = receiver_35 call dispatch_UnitOrBuildingOrHeroDefinition_setPointValue(receiver_36, 0) set receiver_37 = receiver_36 call dispatch_UnitOrBuildingOrHeroDefinition_setSleeps(receiver_37, false) set receiver_38 = receiver_37 call dispatch_UnitOrBuildingOrHeroDefinition_setSightRadiusNight(receiver_38, 700) set receiver_39 = receiver_38 call dispatch_UnitOrBuildingOrHeroDefinition_setSightRadiusDay(receiver_39, 700) set receiver_40 = receiver_39 call dispatch_UnitOrBuildingOrHeroDefinition_setRace(receiver_40, 4) set receiver_41 = receiver_40 call dispatch_UnitOrBuildingOrHeroDefinition_setNormalAbilities(receiver_41, "AInv,AA01") set def = receiver_41 return def endfunction function UnitBaseStatBuffer_s2i takes integer this_2, integer s returns integer return UnitBaseStatBuffer_arrayStart[this_2] + s endfunction function dispatch_UnitBaseStatBuffer_s2i takes integer this_2, integer s returns integer local integer s2i_result if UnitBaseStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitBaseStatBuffer.s2i", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitBaseStatBuffer.s2i on invalid object.", 0, 0, false) endif endif set s2i_result = UnitBaseStatBuffer_s2i(this_2, s) return s2i_result endfunction function UnitBaseStatBuffer_set takes integer this_2, integer s, integer value returns nothing local integer temp = StatHandler_statType[s] if temp == 0 then set UnitBaseStatBuffer_stats[dispatch_UnitBaseStatBuffer_s2i(this_2, s)] = value elseif temp == 1 then set UnitBaseStatBuffer_stats[dispatch_UnitBaseStatBuffer_s2i(this_2, s)] = value + 100 elseif temp == 2 then set UnitBaseStatBuffer_stats[dispatch_UnitBaseStatBuffer_s2i(this_2, s)] = 100 - value endif endfunction function dispatch_UnitBaseStatBuffer_set takes integer this_2, integer s, integer value returns nothing if UnitBaseStatBuffer_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitBaseStatBuffer.set", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitBaseStatBuffer.set on invalid object.", 0, 0, false) endif endif call UnitBaseStatBuffer_set(this_2, s, value) endfunction function alloc_UnitBaseStatBuffer takes nothing returns integer local integer this_2 if UnitBaseStatBuffer_firstFree == 0 then set UnitBaseStatBuffer_maxIndex = UnitBaseStatBuffer_maxIndex + 1 set this_2 = UnitBaseStatBuffer_maxIndex else set UnitBaseStatBuffer_firstFree = UnitBaseStatBuffer_firstFree - 1 set this_2 = UnitBaseStatBuffer_nextFree[UnitBaseStatBuffer_firstFree] endif set UnitBaseStatBuffer_typeId[this_2] = 679 return this_2 endfunction function construct_UnitBaseStatBuffer takes integer this_2, integer unitType returns nothing local integer n local integer temp call dispatch_HashMap_put(StatHandler_mapBaseStatBuffers, unitType, this_2) set UnitBaseStatBuffer_arrayStart[this_2] = 1 + (this_2 - 1) * StatHandler_numStats set n = 0 set temp = StatHandler_numStats loop exitwhen n > temp if StatHandler_statType[n] == 0 then set UnitBaseStatBuffer_stats[UnitBaseStatBuffer_arrayStart[this_2] + n] = 0 else set UnitBaseStatBuffer_stats[UnitBaseStatBuffer_arrayStart[this_2] + n] = 100 endif set n = n + 1 endloop endfunction function new_UnitBaseStatBuffer takes integer unitType returns integer local integer this_2 = alloc_UnitBaseStatBuffer() call construct_UnitBaseStatBuffer(this_2, unitType) return this_2 endfunction function alloc_UnitTypeData takes nothing returns integer local integer this_2 if UnitTypeData_firstFree == 0 then set UnitTypeData_maxIndex = UnitTypeData_maxIndex + 1 set this_2 = UnitTypeData_maxIndex else set UnitTypeData_firstFree = UnitTypeData_firstFree - 1 set this_2 = UnitTypeData_nextFree[UnitTypeData_firstFree] endif return this_2 endfunction function construct_UnitTypeData takes integer this_2, integer raw, integer unitBaseStatBuffer returns nothing call dispatch_HashMap_put(UnitTypeData_raw2UnitTypeData, raw, this_2) set UnitTypeData_unitBaseStatBuffer[this_2] = unitBaseStatBuffer endfunction function new_UnitTypeData takes integer raw, integer unitBaseStatBuffer returns integer local integer this_2 = alloc_UnitTypeData() call construct_UnitTypeData(this_2, raw, unitBaseStatBuffer) return this_2 endfunction function registerHeroData takes integer raw, integer life, integer mana, integer damage, integer armor, integer attackspeed, integer movespeed, integer str, integer agi, integer inte returns nothing local integer receiver = new_UnitBaseStatBuffer(raw) local integer baseStats local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 call dispatch_UnitBaseStatBuffer_set(receiver, 0, life) set receiver_2 = receiver call dispatch_UnitBaseStatBuffer_set(receiver_2, 1, mana) set receiver_3 = receiver_2 call dispatch_UnitBaseStatBuffer_set(receiver_3, 10, damage) set receiver_4 = receiver_3 call dispatch_UnitBaseStatBuffer_set(receiver_4, 12, armor) set receiver_5 = receiver_4 call dispatch_UnitBaseStatBuffer_set(receiver_5, 14, movespeed) set receiver_6 = receiver_5 call dispatch_UnitBaseStatBuffer_set(receiver_6, 7, str) set receiver_7 = receiver_6 call dispatch_UnitBaseStatBuffer_set(receiver_7, 8, agi) set receiver_8 = receiver_7 call dispatch_UnitBaseStatBuffer_set(receiver_8, 9, inte) set receiver_9 = receiver_8 call dispatch_UnitBaseStatBuffer_set(receiver_9, 4, str) set receiver_10 = receiver_9 call dispatch_UnitBaseStatBuffer_set(receiver_10, 5, agi) set receiver_11 = receiver_10 call dispatch_UnitBaseStatBuffer_set(receiver_11, 6, inte) set baseStats = receiver_11 call new_UnitTypeData(raw, baseStats) endfunction function initHeroTypeList takes nothing returns nothing local integer raw = 1212493873 local integer life = 80 local integer mana = 50 local integer dmg = 6 local integer armor = 0 local integer aspd = 200 local integer ms = 300 local integer str = 5 local integer agi = 3 local integer inte = 2 local integer receiver local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer receiver_12 local integer receiver_13 local integer receiver_14 local integer receiver_15 local integer receiver_16 local integer receiver_17 local integer receiver_18 local integer receiver_19 local integer receiver_20 local integer receiver_21 local integer receiver_22 local integer receiver_23 local integer receiver_24 local integer receiver_25 local integer receiver_26 if HeroTypeGen_compiletimeMode then set receiver = genHeroData(raw, 1215324524, "Warrior", life, mana, dmg, armor, aspd, ms, str, agi, inte) call dispatch_UnitOrBuildingOrHeroDefinition_setModelFile(receiver, "units\\other\\BloodElfLieutenant\\BloodElfLieutenant") set receiver_2 = receiver call dispatch_UnitOrBuildingOrHeroDefinition_setIconGameInterface(receiver_2, "ReplaceableTextures\\CommandButtons\\BTNTheCaptain.blp") set receiver_3 = receiver_2 call dispatch_UnitOrBuildingOrHeroDefinition_setUnitSoundSet(receiver_3, "HeroPaladin") set receiver_4 = receiver_3 call dispatch_UnitOrBuildingOrHeroDefinition_setScalingValue(receiver_4, 1.1) set receiver_5 = receiver_4 call HeroDefinition_addGlow(receiver_5) else call registerHeroData(raw, life, mana, dmg, armor, aspd, ms, str, agi, inte) endif set raw = 1212493874 set life = 60 set mana = 80 set dmg = 7 set armor = 0 set aspd = 300 set ms = 300 set str = 2 set agi = 2 set inte = 6 if HeroTypeGen_compiletimeMode then set receiver_6 = genHeroData(raw, 1214344551, "Priest", life, mana, dmg, armor, aspd, ms, str, agi, inte) call dispatch_UnitOrBuildingOrHeroDefinition_setModelFile(receiver_6, "units\\human\\Priest\\Priest") set receiver_7 = receiver_6 call dispatch_UnitOrBuildingOrHeroDefinition_setIconGameInterface(receiver_7, "ReplaceableTextures\\CommandButtons\\BTNPriest.blp") set receiver_8 = receiver_7 call dispatch_UnitOrBuildingOrHeroDefinition_setUnitSoundSet(receiver_8, "Priest") set receiver_9 = receiver_8 call dispatch_UnitOrBuildingOrHeroDefinition_setScalingValue(receiver_9, 1.) set receiver_10 = receiver_9 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1Range(receiver_10, 500) set receiver_11 = receiver_10 call dispatch_UnitOrBuildingOrHeroDefinition_setSelectionScale(receiver_11, 1.2) set receiver_12 = receiver_11 call HeroDefinition_addGlow(receiver_12) else call registerHeroData(raw, life, mana, dmg, armor, aspd, ms, str, agi, inte) endif set raw = 1212493875 set life = 60 set mana = 60 set dmg = 6 set armor = 0 set aspd = 200 set ms = 300 set str = 2 set agi = 5 set inte = 3 if HeroTypeGen_compiletimeMode then set receiver_13 = genHeroData(raw, 1214344551, "Ranger", life, mana, dmg, armor, aspd, ms, str, agi, inte) call dispatch_UnitOrBuildingOrHeroDefinition_setModelFile(receiver_13, "units\\creeps\\SylvanusWindrunner\\SylvanusWindrunner") set receiver_14 = receiver_13 call dispatch_UnitOrBuildingOrHeroDefinition_setIconGameInterface(receiver_14, "ReplaceableTextures\\CommandButtons\\BTNSylvanusWindrunner.blp") set receiver_15 = receiver_14 call dispatch_UnitOrBuildingOrHeroDefinition_setUnitSoundSet(receiver_15, "Sylvanas") set receiver_16 = receiver_15 call dispatch_UnitOrBuildingOrHeroDefinition_setScalingValue(receiver_16, .9) set receiver_17 = receiver_16 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1Range(receiver_17, 600) set receiver_18 = receiver_17 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1ProjectileArt(receiver_18, "Abilities\\Weapons\\Arrow\\ArrowMissile.mdl") set receiver_19 = receiver_18 call dispatch_UnitOrBuildingOrHeroDefinition_setSelectionScale(receiver_19, 1.3) else call registerHeroData(raw, life, mana, dmg, armor, aspd, ms, str, agi, inte) endif set raw = 1212493876 set life = 70 set mana = 70 set dmg = 7 set armor = 0 set aspd = 300 set ms = 300 set str = 2 set agi = 3 set inte = 5 if HeroTypeGen_compiletimeMode then set receiver_20 = genHeroData(raw, 1214344551, "Druid", life, mana, dmg, armor, aspd, ms, str, agi, inte) call dispatch_UnitOrBuildingOrHeroDefinition_setModelFile(receiver_20, "units\\nightelf\\MalFurion\\MalFurionNoStag") set receiver_21 = receiver_20 call dispatch_UnitOrBuildingOrHeroDefinition_setIconGameInterface(receiver_21, "ReplaceableTextures\\CommandButtons\\BTNFurion.blp") set receiver_22 = receiver_21 call dispatch_UnitOrBuildingOrHeroDefinition_setUnitSoundSet(receiver_22, "Furion") set receiver_23 = receiver_22 call dispatch_UnitOrBuildingOrHeroDefinition_setScalingValue(receiver_23, .8) set receiver_24 = receiver_23 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1Range(receiver_24, 500) set receiver_25 = receiver_24 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1ProjectileArt(receiver_25, "Abilities\\Weapons\\KeeperGroveMissile\\KeeperGroveMissile.mdl") set receiver_26 = receiver_25 call dispatch_UnitOrBuildingOrHeroDefinition_setSelectionScale(receiver_26, 1.3) else call registerHeroData(raw, life, mana, dmg, armor, aspd, ms, str, agi, inte) endif endfunction function init_HeroTypeGen takes nothing returns nothing set HeroTypeGen_compiletimeMode = false call initHeroTypeList() endfunction function startHeropick takes player p returns nothing call createUnit(p, HeropickObjectGen_RAW_DUMMY_PICK, Heropick_heroPickPos_x, Heropick_heroPickPos_y, 0.) endfunction function init_Heropick takes nothing returns nothing local real temp_Heropick_heroPickPos_x = -10500. local real temp_Heropick_heroPickPos_y = -11200. local trigger receiver local trigger receiver_2 local integer pid local integer temp local real temp_Heropick_heroStartPos_x local real temp_Heropick_heroStartPos_y set Heropick_heroPickPos_x = temp_Heropick_heroPickPos_x set Heropick_heroPickPos_y = temp_Heropick_heroPickPos_y set temp_Heropick_heroStartPos_x = -10250. set temp_Heropick_heroStartPos_y = 4390. set Heropick_heroStartPos_x = temp_Heropick_heroStartPos_x set Heropick_heroStartPos_y = temp_Heropick_heroStartPos_y set Heropick_ship = createUnit(Player(PLAYER_NEUTRAL_PASSIVE), HeropickObjectGen_RAW_SHIP, Heropick_heroPickPos_x, Heropick_heroPickPos_y, 0.) set receiver = CreateTrigger() call trigger_registerUnitEvent(receiver, Heropick_ship, EVENT_UNIT_SELL) set receiver_2 = receiver call trigger_addAction(receiver_2, ref_function_heroPickedAction) set pid = 0 set temp = Config_NUM_OF_PLAYERS - 1 loop exitwhen pid > temp call startHeropick(Player_players[pid]) set pid = pid + 1 endloop set receiver = null set receiver_2 = null endfunction function init_HeropickObjectGen takes nothing returns nothing set HeropickObjectGen_RAW_SHIP = 1970286640 set HeropickObjectGen_RAW_DUMMY_PICK = 1970286641 set HeropickObjectGen_RAW_DUMMY_WARRIOR = 1970286642 set HeropickObjectGen_RAW_DUMMY_PRIEST = 1970286643 set HeropickObjectGen_RAW_DUMMY_RANGER = 1970286644 set HeropickObjectGen_RAW_DUMMY_DRUID = 1970286645 endfunction function init_ItemData takes nothing returns nothing local trigger receiver = CreateTrigger() local trigger receiver_2 call trigger_registerPlayerUnitEvent(receiver, Player(PLAYER_NEUTRAL_PASSIVE), EVENT_PLAYER_UNIT_SELL_ITEM, null) set receiver_2 = receiver call trigger_addAction(receiver_2, ref_function_itemSoldAction) set receiver = null set receiver_2 = null endfunction function init_ItemTypeData takes nothing returns nothing set ItemTypeData_raw2ItemTypeData = new_HashMap() endfunction function ItemDefinition_setCanBeSoldToMerchants takes integer this_2, boolean data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setBoolean(W3TDefinition_def[tempIndex], "ipaw", data) endfunction function dispatch_ItemDefinition_setCanBeSoldToMerchants takes integer this_2, boolean data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setCanBeSoldToMerchants", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setCanBeSoldToMerchants on invalid object.", 0, 0, false) endif endif call ItemDefinition_setCanBeSoldToMerchants(this_2, data) endfunction function ItemDefinition_setClassification takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3TDefinition_def[tempIndex], "icla", data) endfunction function dispatch_ItemDefinition_setClassification takes integer this_2, string data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setClassification", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setClassification on invalid object.", 0, 0, false) endif endif call ItemDefinition_setClassification(this_2, data) endfunction function ItemDefinition_setGoldCost takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3TDefinition_def[tempIndex], "igol", data) endfunction function dispatch_ItemDefinition_setGoldCost takes integer this_2, integer data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setGoldCost", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setGoldCost on invalid object.", 0, 0, false) endif endif call ItemDefinition_setGoldCost(this_2, data) endfunction function ItemDefinition_setHitPoints takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3TDefinition_def[tempIndex], "ihtp", data) endfunction function dispatch_ItemDefinition_setHitPoints takes integer this_2, integer data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setHitPoints", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setHitPoints on invalid object.", 0, 0, false) endif endif call ItemDefinition_setHitPoints(this_2, data) endfunction function ItemDefinition_setInterfaceIcon takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3TDefinition_def[tempIndex], "iico", data) endfunction function dispatch_ItemDefinition_setInterfaceIcon takes integer this_2, string data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setInterfaceIcon", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setInterfaceIcon on invalid object.", 0, 0, false) endif endif call ItemDefinition_setInterfaceIcon(this_2, data) endfunction function ItemDefinition_setStockReplenishInterval takes integer this_2, integer data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setInt(W3TDefinition_def[tempIndex], "istr", data) endfunction function dispatch_ItemDefinition_setStockReplenishInterval takes integer this_2, integer data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setStockReplenishInterval", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setStockReplenishInterval on invalid object.", 0, 0, false) endif endif call ItemDefinition_setStockReplenishInterval(this_2, data) endfunction function W3TDefinition_setDescription takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3TDefinition_def[tempIndex], "ides", data) endfunction function dispatch_W3TDefinition_setDescription takes integer this_2, string data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3TDefinition.setDescription", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3TDefinition.setDescription on invalid object.", 0, 0, false) endif endif call W3TDefinition_setDescription(this_2, data) endfunction function W3TDefinition_setName takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3TDefinition_def[tempIndex], "unam", data) endfunction function dispatch_W3TDefinition_setName takes integer this_2, string data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3TDefinition.setName", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3TDefinition.setName on invalid object.", 0, 0, false) endif endif call W3TDefinition_setName(this_2, data) endfunction function W3TDefinition_setTooltipBasic takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3TDefinition_def[tempIndex], "utip", data) endfunction function dispatch_W3TDefinition_setTooltipBasic takes integer this_2, string data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3TDefinition.setTooltipBasic", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3TDefinition.setTooltipBasic on invalid object.", 0, 0, false) endif endif call W3TDefinition_setTooltipBasic(this_2, data) endfunction function W3TDefinition_setTooltipExtended takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3TDefinition_def[tempIndex], "utub", data) endfunction function dispatch_W3TDefinition_setTooltipExtended takes integer this_2, string data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling W3TDefinition.setTooltipExtended", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called W3TDefinition.setTooltipExtended on invalid object.", 0, 0, false) endif endif call W3TDefinition_setTooltipExtended(this_2, data) endfunction function alloc_ItemDefinition takes nothing returns integer local integer this_2 if W3TDefinition_firstFree == 0 then set W3TDefinition_maxIndex = W3TDefinition_maxIndex + 1 set this_2 = W3TDefinition_maxIndex else set W3TDefinition_firstFree = W3TDefinition_firstFree - 1 set this_2 = W3TDefinition_nextFree[W3TDefinition_firstFree] endif set W3TDefinition_typeId[this_2] = 696 return this_2 endfunction function construct_W3TDefinition takes integer this_2, integer newUnitId, integer origUnitId returns nothing set W3TDefinition_def[this_2] = createObjectDefinition("w3t", newUnitId, origUnitId) endfunction function construct_ItemDefinition takes integer this_2, integer newId, integer origId returns nothing call construct_W3TDefinition(this_2, newId, origId) endfunction function new_ItemDefinition takes integer newId, integer origId returns integer local integer this_2 = alloc_ItemDefinition() call construct_ItemDefinition(this_2, newId, origId) return this_2 endfunction function alloc_ItemTypeData takes nothing returns integer local integer this_2 if ItemTypeData_firstFree == 0 then set ItemTypeData_maxIndex = ItemTypeData_maxIndex + 1 set this_2 = ItemTypeData_maxIndex else set ItemTypeData_firstFree = ItemTypeData_firstFree - 1 set this_2 = ItemTypeData_nextFree[ItemTypeData_firstFree] endif return this_2 endfunction function construct_ItemTypeData takes integer this_2, integer raw returns nothing set ItemTypeData_recipeTarget[this_2] = 0 set ItemTypeData_recipeReq1[this_2] = 0 set ItemTypeData_recipeReq2[this_2] = 0 set ItemTypeData_recipeReq3[this_2] = 0 set ItemTypeData_recipeReq4[this_2] = 0 set ItemTypeData_recipeReq5[this_2] = 0 set ItemTypeData_recipeReq6[this_2] = 0 set ItemTypeData_recipeReq7[this_2] = 0 set ItemTypeData_recipeReq8[this_2] = 0 call dispatch_HashMap_put(ItemTypeData_raw2ItemTypeData, raw, this_2) endfunction function new_ItemTypeData takes integer raw returns integer local integer this_2 = alloc_ItemTypeData() call construct_ItemTypeData(this_2, raw) return this_2 endfunction function tooltipAddDescription takes string description returns nothing set ItemTooltipGen_tooltipDescription = description endfunction function tooltipAddEquipmentProperties takes integer equipmentSlot, integer equipmentClass returns nothing local integer temp local integer temp_2 set ItemTooltipGen_tooltipHeader = "|cffB3B3B3" set temp = equipmentSlot if temp == 0 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Mainhand" elseif temp == 1 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Offhand" elseif temp == 2 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Chest" elseif temp == 3 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Helmet" elseif temp == 5 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Misc" elseif temp == 4 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Accessory" endif set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + " - " set temp_2 = equipmentClass if temp_2 == 0 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Sword" elseif temp_2 == 1 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Axe" elseif temp_2 == 2 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Dagger" elseif temp_2 == 3 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Twohanded" elseif temp_2 == 4 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Staff" elseif temp_2 == 5 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Bow" elseif temp_2 == 6 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Shield" elseif temp_2 == 7 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Orb" elseif temp_2 == 8 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Quiver" elseif temp_2 == 9 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Knife" elseif temp_2 == 10 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Chain" elseif temp_2 == 11 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Leather" elseif temp_2 == 12 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Cloth" elseif temp_2 == 13 then set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "Accessory" endif set ItemTooltipGen_tooltipHeader = ItemTooltipGen_tooltipHeader + "|r" endfunction function tooltipColorizeItemName takes string itemName, integer equipmentQuality returns string local string name = "" local integer temp = equipmentQuality if temp == 0 then set name = itemName elseif temp == 1 then set name = "|cff3B85ED" + itemName + "|r" elseif temp == 2 then set name = "|cffA938FF" + itemName + "|r" endif return name endfunction function tooltipGet takes nothing returns string local string tooltip = "" if ItemTooltipGen_tooltipHeader != "" then set tooltip = tooltip + ItemTooltipGen_tooltipHeader endif if ItemTooltipGen_tooltipStats != "" then if tooltip != "" then set tooltip = tooltip + "\n\n" endif set tooltip = tooltip + ItemTooltipGen_tooltipStats endif if ItemTooltipGen_tooltipRecipeReq != "" then if tooltip != "" then set tooltip = tooltip + "\n\n" endif set tooltip = tooltip + ItemTooltipGen_tooltipRecipeReq endif if ItemTooltipGen_tooltipDescription != "" then if tooltip != "" then set tooltip = tooltip + "\n\n" endif set tooltip = tooltip + ItemTooltipGen_tooltipDescription endif return tooltip endfunction function tooltipReset takes nothing returns nothing set ItemTooltipGen_tooltipHeader = "" set ItemTooltipGen_tooltipStats = "" set ItemTooltipGen_tooltipDescription = "" set ItemTooltipGen_tooltipRecipeReq = "" endfunction function itemgenNewEquipment takes integer raw, integer equipmentQuality, integer equipmentSlot, integer equipmentClass, integer cost, string name, string description, string icon returns integer local string tt local integer receiver local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 set ItemTypeGen_currentItemTypeData = new_ItemTypeData(raw) set ItemTypeData_itemClass[ItemTypeGen_currentItemTypeData] = 0 set ItemTypeData_name[ItemTypeGen_currentItemTypeData] = name set ItemTypeData_equipmentSlot[ItemTypeGen_currentItemTypeData] = equipmentSlot set ItemTypeData_equipmentClass[ItemTypeGen_currentItemTypeData] = equipmentClass set ItemTypeData_stats[ItemTypeGen_currentItemTypeData] = new_StatList() if ItemTypeGen_compiletimeMode then call tooltipReset() call tooltipAddEquipmentProperties(equipmentSlot, equipmentClass) call tooltipAddDescription(description) set tt = tooltipGet() set receiver = new_ItemDefinition(raw, 1667786099) call dispatch_W3TDefinition_setName(receiver, tooltipColorizeItemName(name, equipmentQuality)) set receiver_2 = receiver call dispatch_W3TDefinition_setTooltipBasic(receiver_2, name) set receiver_3 = receiver_2 call dispatch_ItemDefinition_setInterfaceIcon(receiver_3, icon) set receiver_4 = receiver_3 call dispatch_W3TDefinition_setDescription(receiver_4, tt) set receiver_5 = receiver_4 call dispatch_W3TDefinition_setTooltipExtended(receiver_5, tt) set receiver_6 = receiver_5 call dispatch_ItemDefinition_setGoldCost(receiver_6, cost) set receiver_7 = receiver_6 call dispatch_ItemDefinition_setStockReplenishInterval(receiver_7, 0) set receiver_8 = receiver_7 call dispatch_ItemDefinition_setClassification(receiver_8, "Campaign") set receiver_9 = receiver_8 call dispatch_ItemDefinition_setHitPoints(receiver_9, 999999) set receiver_10 = receiver_9 call dispatch_ItemDefinition_setCanBeSoldToMerchants(receiver_10, true) set ItemTypeGen_currentItemTypeDefinition = receiver_10 endif return raw endfunction function tooltipAddMaterialProperties takes nothing returns nothing set ItemTooltipGen_tooltipHeader = "|cffB3B3B3Material|r" endfunction function itemgenNewMaterial takes integer raw, integer cost, string name, string description, string icon returns integer local string tt local integer receiver local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 set ItemTypeGen_currentItemTypeData = new_ItemTypeData(raw) set ItemTypeData_itemClass[ItemTypeGen_currentItemTypeData] = 1 set ItemTypeData_name[ItemTypeGen_currentItemTypeData] = name if ItemTypeGen_compiletimeMode then call tooltipReset() call tooltipAddMaterialProperties() call tooltipAddDescription(description) set tt = tooltipGet() set receiver = new_ItemDefinition(raw, 1667786099) call dispatch_W3TDefinition_setName(receiver, name) set receiver_2 = receiver call dispatch_W3TDefinition_setTooltipBasic(receiver_2, name) set receiver_3 = receiver_2 call dispatch_ItemDefinition_setInterfaceIcon(receiver_3, icon) set receiver_4 = receiver_3 call dispatch_W3TDefinition_setDescription(receiver_4, tt) set receiver_5 = receiver_4 call dispatch_W3TDefinition_setTooltipExtended(receiver_5, tt) set receiver_6 = receiver_5 call dispatch_ItemDefinition_setGoldCost(receiver_6, cost) set receiver_7 = receiver_6 call dispatch_ItemDefinition_setStockReplenishInterval(receiver_7, 0) set receiver_8 = receiver_7 call dispatch_ItemDefinition_setClassification(receiver_8, "Purchasable") set receiver_9 = receiver_8 call dispatch_ItemDefinition_setHitPoints(receiver_9, 999999) set receiver_10 = receiver_9 call dispatch_ItemDefinition_setCanBeSoldToMerchants(receiver_10, true) set ItemTypeGen_currentItemTypeDefinition = receiver_10 endif return raw endfunction function ItemDefinition_setAbilities takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3TDefinition_def[tempIndex], "iabi", data) endfunction function dispatch_ItemDefinition_setAbilities takes integer this_2, string data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setAbilities", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setAbilities on invalid object.", 0, 0, false) endif endif call ItemDefinition_setAbilities(this_2, data) endfunction function ItemDefinition_setActivelyUsed takes integer this_2, boolean data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setBoolean(W3TDefinition_def[tempIndex], "iusa", data) endfunction function dispatch_ItemDefinition_setActivelyUsed takes integer this_2, boolean data returns nothing if W3TDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling ItemDefinition.setActivelyUsed", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called ItemDefinition.setActivelyUsed on invalid object.", 0, 0, false) endif endif call ItemDefinition_setActivelyUsed(this_2, data) endfunction function tooltipAddRecipeProperties takes nothing returns nothing set ItemTooltipGen_tooltipHeader = "|cffB3B3B3Recipe|r" endfunction function itemgenNewRecipe takes integer raw, integer cost, integer targetRaw, string description returns integer local string targetName local string tt local integer receiver local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer receiver_12 set ItemTypeGen_currentItemTypeData = new_ItemTypeData(raw) set ItemTypeData_itemClass[ItemTypeGen_currentItemTypeData] = 2 set targetName = ItemTypeData_name[int_xGetItemTypeData(targetRaw)] set ItemTypeData_name[ItemTypeGen_currentItemTypeData] = "Recipe: " + targetName set ItemTypeData_recipeTarget[ItemTypeGen_currentItemTypeData] = targetRaw if ItemTypeGen_compiletimeMode then call tooltipReset() call tooltipAddRecipeProperties() call tooltipAddDescription(description) set tt = tooltipGet() set receiver = new_ItemDefinition(raw, 1667786099) call dispatch_W3TDefinition_setName(receiver, "Recipe: " + targetName) set receiver_2 = receiver call dispatch_W3TDefinition_setTooltipBasic(receiver_2, "Recipe: " + targetName) set receiver_3 = receiver_2 call dispatch_ItemDefinition_setInterfaceIcon(receiver_3, "ReplaceableTextures\\CommandButtons\\BTNSnazzyScroll.blp") set receiver_4 = receiver_3 call dispatch_W3TDefinition_setDescription(receiver_4, tt) set receiver_5 = receiver_4 call dispatch_W3TDefinition_setTooltipExtended(receiver_5, tt) set receiver_6 = receiver_5 call dispatch_ItemDefinition_setGoldCost(receiver_6, cost) set receiver_7 = receiver_6 call dispatch_ItemDefinition_setStockReplenishInterval(receiver_7, 0) set receiver_8 = receiver_7 call dispatch_ItemDefinition_setClassification(receiver_8, "Charged") set receiver_9 = receiver_8 call dispatch_ItemDefinition_setAbilities(receiver_9, "AD01") set receiver_10 = receiver_9 call dispatch_ItemDefinition_setHitPoints(receiver_10, 999999) set receiver_11 = receiver_10 call dispatch_ItemDefinition_setActivelyUsed(receiver_11, true) set receiver_12 = receiver_11 call dispatch_ItemDefinition_setCanBeSoldToMerchants(receiver_12, true) set ItemTypeGen_currentItemTypeDefinition = receiver_12 endif return raw endfunction function tooltipAddRecipeReq takes integer itemTypeData returns nothing set ItemTooltipGen_tooltipRecipeReq = "|cffffcc00Requires:|r" if ItemTypeData_recipeReq1[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq1[itemTypeData])] endif if ItemTypeData_recipeReq2[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq2[itemTypeData])] endif if ItemTypeData_recipeReq3[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq3[itemTypeData])] endif if ItemTypeData_recipeReq4[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq4[itemTypeData])] endif if ItemTypeData_recipeReq5[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq5[itemTypeData])] endif if ItemTypeData_recipeReq6[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq6[itemTypeData])] endif if ItemTypeData_recipeReq7[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq7[itemTypeData])] endif if ItemTypeData_recipeReq8[itemTypeData] != 0 then set ItemTooltipGen_tooltipRecipeReq = ItemTooltipGen_tooltipRecipeReq + "\n" + ItemTypeData_name[int_xGetItemTypeData(ItemTypeData_recipeReq8[itemTypeData])] endif endfunction function itemgenSetRecipeReq takes integer raw1, integer raw2, integer raw3, integer raw4, integer raw5, integer raw6, integer raw7, integer raw8 returns nothing local string tt set ItemTypeData_recipeReq1[ItemTypeGen_currentItemTypeData] = raw1 set ItemTypeData_recipeReq2[ItemTypeGen_currentItemTypeData] = raw2 set ItemTypeData_recipeReq3[ItemTypeGen_currentItemTypeData] = raw3 set ItemTypeData_recipeReq4[ItemTypeGen_currentItemTypeData] = raw4 set ItemTypeData_recipeReq5[ItemTypeGen_currentItemTypeData] = raw5 set ItemTypeData_recipeReq6[ItemTypeGen_currentItemTypeData] = raw6 set ItemTypeData_recipeReq7[ItemTypeGen_currentItemTypeData] = raw7 set ItemTypeData_recipeReq8[ItemTypeGen_currentItemTypeData] = raw8 if ItemTypeGen_compiletimeMode then call tooltipAddRecipeReq(ItemTypeGen_currentItemTypeData) set tt = tooltipGet() call dispatch_W3TDefinition_setDescription(ItemTypeGen_currentItemTypeDefinition, tt) call dispatch_W3TDefinition_setTooltipExtended(ItemTypeGen_currentItemTypeDefinition, tt) endif endfunction function StatListIterator_close takes integer this_2 returns nothing call dispatch_LLIterator_close(StatListIterator_iter[this_2]) endfunction function dispatch_StatListIterator_close takes integer this_2 returns nothing if StatListIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatListIterator.close", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatListIterator.close on invalid object.", 0, 0, false) endif endif call StatListIterator_close(this_2) endfunction function StatListIterator_currentValue takes integer this_2 returns integer local integer val = 0 local integer temp = StatHandler_statType[StatEntity_stat[StatListIterator_current[this_2]]] if temp == 0 then set val = StatEntity_val[StatListIterator_current[this_2]] elseif temp == 1 then set val = StatEntity_val[StatListIterator_current[this_2]] - 100 elseif temp == 2 then set val = 100 - StatEntity_val[StatListIterator_current[this_2]] endif return val endfunction function dispatch_StatListIterator_currentValue takes integer this_2 returns integer local integer currentValue_result if StatListIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatListIterator.currentValue", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatListIterator.currentValue on invalid object.", 0, 0, false) endif endif set currentValue_result = StatListIterator_currentValue(this_2) return currentValue_result endfunction function StatListIterator_hasNext takes integer this_2 returns boolean return dispatch_LLIterator_hasNext(StatListIterator_iter[this_2]) endfunction function dispatch_StatListIterator_hasNext takes integer this_2 returns boolean local boolean hasNext_result if StatListIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatListIterator.hasNext", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatListIterator.hasNext on invalid object.", 0, 0, false) endif endif set hasNext_result = StatListIterator_hasNext(this_2) return hasNext_result endfunction function StatListIterator_next takes integer this_2 returns integer set StatListIterator_current[this_2] = dispatch_LLIterator_next(StatListIterator_iter[this_2]) return StatEntity_stat[StatListIterator_current[this_2]] endfunction function dispatch_StatListIterator_next takes integer this_2 returns integer local integer next_result if StatListIterator_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatListIterator.next", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatListIterator.next on invalid object.", 0, 0, false) endif endif set next_result = StatListIterator_next(this_2) return next_result endfunction function alloc_StatListIterator takes nothing returns integer local integer this_2 if StatListIterator_firstFree == 0 then set StatListIterator_maxIndex = StatListIterator_maxIndex + 1 set this_2 = StatListIterator_maxIndex else set StatListIterator_firstFree = StatListIterator_firstFree - 1 set this_2 = StatListIterator_nextFree[StatListIterator_firstFree] endif set StatListIterator_typeId[this_2] = 678 return this_2 endfunction function construct_StatListIterator takes integer this_2, integer statList returns nothing set StatListIterator_iter[this_2] = dispatch_LinkedList_iterator(StatList_statList[statList]) endfunction function new_StatListIterator takes integer statList returns integer local integer this_2 = alloc_StatListIterator() call construct_StatListIterator(this_2, statList) return this_2 endfunction function StatList_iterator takes integer this_2 returns integer return new_StatListIterator(this_2) endfunction function dispatch_StatList_iterator takes integer this_2 returns integer local integer iterator_result if StatList_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling StatList.iterator", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called StatList.iterator on invalid object.", 0, 0, false) endif endif set iterator_result = StatList_iterator(this_2) return iterator_result endfunction function tooltipConvertStat takes integer stat, integer value returns string local string name = "" local integer valueConverted = value local string sign = "+" local string suffix = "" local integer temp = stat if temp == 0 then set name = "Life" elseif temp == 1 then set name = "Mana" elseif temp == 2 then set name = "Lifereg" elseif temp == 3 then set name = "Manareg" elseif temp == 4 then set name = "Str" elseif temp == 5 then set name = "Agi" elseif temp == 6 then set name = "Int" elseif temp == 10 then set name = "Attack Power" elseif temp == 11 then set name = "Attack Power" set suffix = "%" elseif temp == 12 then set name = "Armor" elseif temp == 13 then set name = "Aspd" set suffix = "%" elseif temp == 14 then set name = "Movespeed" elseif temp == 15 then set name = "Evasion" set suffix = "%" elseif temp == 16 then set name = "Critchance" set suffix = "%" elseif temp == 17 then set name = "Critdamage" set suffix = "%" elseif temp == 18 then set name = "Critbonus" elseif temp == 19 then set name = "Heal Received" set suffix = "%" elseif temp == 20 then set name = "Attack Threat" set suffix = "%" elseif temp == 21 then set name = "Casttime" set sign = "-" set suffix = "%" elseif temp == 7 then elseif temp == 8 then elseif temp == 9 then endif return name + " " + sign + int_toString(valueConverted) + suffix endfunction function tooltipAddStatList takes integer statList returns nothing local integer iter = dispatch_StatList_iterator(statList) local integer s loop exitwhen not dispatch_StatListIterator_hasNext(iter) set s = dispatch_StatListIterator_next(iter) if ItemTooltipGen_tooltipStats != "" then set ItemTooltipGen_tooltipStats = ItemTooltipGen_tooltipStats + "\n" endif set ItemTooltipGen_tooltipStats = ItemTooltipGen_tooltipStats + tooltipConvertStat(s, dispatch_StatListIterator_currentValue(iter)) endloop call dispatch_StatListIterator_close(iter) endfunction function itemgenSetStats takes integer statList returns nothing local string tt if ItemTypeGen_compiletimeMode then call tooltipAddStatList(statList) set tt = tooltipGet() call dispatch_W3TDefinition_setDescription(ItemTypeGen_currentItemTypeDefinition, tt) call dispatch_W3TDefinition_setTooltipExtended(ItemTypeGen_currentItemTypeDefinition, tt) endif endfunction function stats takes nothing returns integer return ItemTypeData_stats[ItemTypeGen_currentItemTypeData] endfunction function initItemTypeLists takes nothing returns nothing local integer receiver local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer receiver_12 local integer receiver_13 local integer receiver_14 local integer receiver_15 local integer receiver_16 local integer receiver_17 local integer receiver_18 local integer receiver_19 local integer receiver_20 local integer receiver_21 local integer receiver_22 local integer receiver_23 local integer receiver_24 local integer receiver_25 local integer receiver_26 local integer receiver_27 local integer receiver_28 local integer receiver_29 local integer receiver_30 local integer receiver_31 local integer receiver_32 local integer receiver_33 local integer receiver_34 local integer receiver_35 local integer receiver_36 local integer receiver_37 local integer receiver_38 local integer receiver_39 local integer receiver_40 local integer receiver_41 local integer receiver_42 local integer receiver_43 local integer receiver_44 local integer receiver_45 local integer receiver_46 local integer receiver_47 local integer receiver_48 local integer receiver_49 local integer receiver_50 local integer receiver_51 local integer receiver_52 local integer receiver_53 local integer receiver_54 local integer receiver_55 local integer receiver_56 local integer receiver_57 local integer receiver_58 local integer receiver_59 local integer receiver_60 local integer receiver_61 local integer receiver_62 local integer receiver_63 local integer receiver_64 local integer receiver_65 call itemgenNewEquipment(1227960369, 0, 0, 0, 10, "Old Sword", "", "ReplaceableTextures\\CommandButtons\\BTNSteelMelee.blp") set receiver = stats() call dispatch_StatList_add(receiver, 10, 1) call itemgenSetStats(receiver) call itemgenNewEquipment(1227960370, 0, 0, 4, 10, "Old Staff", "", "ReplaceableTextures\\CommandButtons\\BTNWand.blp") set receiver_2 = stats() call dispatch_StatList_add(receiver_2, 6, 1) call itemgenSetStats(receiver_2) call itemgenNewEquipment(1227960371, 0, 0, 5, 10, "Old Bow", "", "ReplaceableTextures\\CommandButtons\\BTNImprovedBows.blp") set receiver_3 = stats() call dispatch_StatList_add(receiver_3, 10, 1) call itemgenSetStats(receiver_3) call itemgenNewEquipment(1227960372, 0, 0, 1, 20, "Woodcutters Axe", "", "ReplaceableTextures\\CommandButtons\\BTNOrcMeleeUpOne.blp") set receiver_4 = stats() call dispatch_StatList_add(receiver_4, 10, 2) set receiver_5 = receiver_4 call dispatch_StatList_add(receiver_5, 4, 1) set receiver_6 = receiver_5 call dispatch_StatList_add(receiver_6, 20, 20) call itemgenSetStats(receiver_6) call itemgenNewEquipment(1227960373, 1, 0, 5, 50, "Horn Bow", "", "ReplaceableTextures\\CommandButtons\\BTNQuillSprayOff.blp") set receiver_7 = stats() call dispatch_StatList_add(receiver_7, 10, 3) set receiver_8 = receiver_7 call dispatch_StatList_add(receiver_8, 5, 1) set receiver_9 = receiver_8 call dispatch_StatList_add(receiver_9, 13, 15) call itemgenSetStats(receiver_9) call itemgenNewEquipment(1227960374, 0, 0, 4, 20, "Enchanted Staff", "", "ReplaceableTextures\\CommandButtons\\BTNStarWand.blp") set receiver_10 = stats() call dispatch_StatList_add(receiver_10, 10, 1) set receiver_11 = receiver_10 call dispatch_StatList_add(receiver_11, 6, 2) call itemgenSetStats(receiver_11) call itemgenNewEquipment(1227960375, 1, 0, 4, 50, "Sylvan Staff", "", "ReplaceableTextures\\CommandButtons\\BTNStaffOfPreservation.blp") set receiver_12 = stats() call dispatch_StatList_add(receiver_12, 10, 2) set receiver_13 = receiver_12 call dispatch_StatList_add(receiver_13, 6, 3) set receiver_14 = receiver_13 call dispatch_StatList_add(receiver_14, 1, 20) set receiver_15 = receiver_14 call dispatch_StatList_add(receiver_15, 21, 8) call itemgenSetStats(receiver_15) call itemgenNewEquipment(1228025905, 0, 1, 6, 30, "Wooden Buckler", "", "ReplaceableTextures\\CommandButtons\\BTNSteelArmor.blp") set receiver_16 = stats() call dispatch_StatList_add(receiver_16, 12, 2) set receiver_17 = receiver_16 call dispatch_StatList_add(receiver_17, 0, 5) call itemgenSetStats(receiver_17) call itemgenNewEquipment(1228025906, 0, 1, 7, 30, "Energy Orb", "", "ReplaceableTextures\\CommandButtons\\BTNUsedSoulGem.blp") set receiver_18 = stats() call dispatch_StatList_add(receiver_18, 6, 1) set receiver_19 = receiver_18 call dispatch_StatList_add(receiver_19, 1, 5) call itemgenSetStats(receiver_19) call itemgenNewEquipment(1228025907, 0, 1, 8, 30, "Sharp Arows", "", "ReplaceableTextures\\CommandButtons\\BTNImpalingBolt.blp") set receiver_20 = stats() call dispatch_StatList_add(receiver_20, 10, 1) set receiver_21 = receiver_20 call dispatch_StatList_add(receiver_21, 5, 1) call itemgenSetStats(receiver_21) call itemgenNewEquipment(1228025908, 1, 1, 6, 50, "Mithril Plate", "", "ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpThree.blp") set receiver_22 = stats() call dispatch_StatList_add(receiver_22, 12, 4) set receiver_23 = receiver_22 call dispatch_StatList_add(receiver_23, 0, 12) set receiver_24 = receiver_23 call dispatch_StatList_add(receiver_24, 15, 6) call itemgenSetStats(receiver_24) call itemgenNewEquipment(1228091441, 0, 2, 10, 20, "Wooden Mail", "", "ReplaceableTextures\\CommandButtons\\BTNImprovedMoonArmor.blp") set receiver_25 = stats() call dispatch_StatList_add(receiver_25, 12, 1) set receiver_26 = receiver_25 call dispatch_StatList_add(receiver_26, 0, 10) call itemgenSetStats(receiver_26) call itemgenNewEquipment(1228091442, 0, 2, 11, 20, "Fur Coat", "", "ReplaceableTextures\\CommandButtons\\BTNImprovedReinforcedHides.blp") set receiver_27 = stats() call dispatch_StatList_add(receiver_27, 12, 1) set receiver_28 = receiver_27 call dispatch_StatList_add(receiver_28, 0, 10) call itemgenSetStats(receiver_28) call itemgenNewEquipment(1228091443, 0, 2, 12, 20, "Tattered Robe", "", "ReplaceableTextures\\CommandButtons\\BTNCloak.blp") set receiver_29 = stats() call dispatch_StatList_add(receiver_29, 12, 1) set receiver_30 = receiver_29 call dispatch_StatList_add(receiver_30, 1, 5) call itemgenSetStats(receiver_30) call itemgenNewEquipment(1228091444, 1, 2, 10, 50, "Shining Chestguard", "", "ReplaceableTextures\\CommandButtons\\BTNArmorGolem.blp") set receiver_31 = stats() call dispatch_StatList_add(receiver_31, 12, 2) set receiver_32 = receiver_31 call dispatch_StatList_add(receiver_32, 0, 10) set receiver_33 = receiver_32 call dispatch_StatList_add(receiver_33, 15, 3) set receiver_34 = receiver_33 call dispatch_StatList_add(receiver_34, 19, 5) call itemgenSetStats(receiver_34) call itemgenNewEquipment(1228156977, 0, 3, 10, 16, "Light Helmet", "", "ReplaceableTextures\\CommandButtons\\BTNFootman.blp") set receiver_35 = stats() call dispatch_StatList_add(receiver_35, 12, 1) call itemgenSetStats(receiver_35) call itemgenNewEquipment(1228156978, 0, 3, 11, 20, "Leather Mask", "", "ReplaceableTextures\\CommandButtons\\BTNHuntress.blp") set receiver_36 = stats() call dispatch_StatList_add(receiver_36, 12, 1) set receiver_37 = receiver_36 call dispatch_StatList_add(receiver_37, 0, 5) call itemgenSetStats(receiver_37) call itemgenNewEquipment(1228156979, 1, 3, 12, 50, "Shamans Hood", "", "ReplaceableTextures\\CommandButtons\\BTNCloak.blp") set receiver_38 = stats() call dispatch_StatList_add(receiver_38, 6, 2) set receiver_39 = receiver_38 call dispatch_StatList_add(receiver_39, 0, 10) set receiver_40 = receiver_39 call dispatch_StatList_add(receiver_40, 1, 5) set receiver_41 = receiver_40 call dispatch_StatList_add(receiver_41, 21, 4) call itemgenSetStats(receiver_41) call itemgenNewEquipment(1228156980, 1, 3, 11, 50, "Pointy Hat", "", "ReplaceableTextures\\CommandButtons\\BTNHoodOfCunning.blp") set receiver_42 = stats() call dispatch_StatList_add(receiver_42, 12, 1) set receiver_43 = receiver_42 call dispatch_StatList_add(receiver_43, 0, 10) set receiver_44 = receiver_43 call dispatch_StatList_add(receiver_44, 5, 3) set receiver_45 = receiver_44 call dispatch_StatList_add(receiver_45, 16, 5) set receiver_46 = receiver_45 call dispatch_StatList_add(receiver_46, 18, 6) call itemgenSetStats(receiver_46) call itemgenNewEquipment(1228222513, 0, 4, 13, 10, "Fairy Ring", "", "ReplaceableTextures\\CommandButtons\\BTNRingPurple.blp") set receiver_47 = stats() call dispatch_StatList_add(receiver_47, 1, 8) call itemgenSetStats(receiver_47) call itemgenNewEquipment(1228222514, 0, 4, 13, 10, "Ring of Vitality", "", "ReplaceableTextures\\CommandButtons\\BTNGoldRing.blp") set receiver_48 = stats() call dispatch_StatList_add(receiver_48, 0, 10) call itemgenSetStats(receiver_48) call itemgenNewEquipment(1228222515, 1, 4, 13, 60, "Crystal Necklace of the Astute", "", "ReplaceableTextures\\CommandButtons\\BTNSoulGem.blp") set receiver_49 = stats() call dispatch_StatList_add(receiver_49, 6, 2) set receiver_50 = receiver_49 call dispatch_StatList_add(receiver_50, 21, 4) set receiver_51 = receiver_50 call dispatch_StatList_add(receiver_51, 1, 8) call itemgenSetStats(receiver_51) call itemgenNewEquipment(1228222516, 1, 4, 13, 60, "Crystal Necklace of Vigor", "", "ReplaceableTextures\\CommandButtons\\BTNUsedSoulGem.blp") set receiver_52 = stats() call dispatch_StatList_add(receiver_52, 4, 2) set receiver_53 = receiver_52 call dispatch_StatList_add(receiver_53, 15, 3) set receiver_54 = receiver_53 call dispatch_StatList_add(receiver_54, 19, 12) call itemgenSetStats(receiver_54) call itemgenNewEquipment(1228222517, 1, 4, 13, 60, "Crystal Necklace of the Eagle", "", "ReplaceableTextures\\CommandButtons\\BTNOrbOfDarkness.blp") set receiver_55 = stats() call dispatch_StatList_add(receiver_55, 5, 2) set receiver_56 = receiver_55 call dispatch_StatList_add(receiver_56, 16, 3) set receiver_57 = receiver_56 call dispatch_StatList_add(receiver_57, 17, 10) set receiver_58 = receiver_57 call dispatch_StatList_add(receiver_58, 1, 5) call itemgenSetStats(receiver_58) call itemgenNewEquipment(1228298842, 1, 4, 13, 100, "Testitem", "", "ReplaceableTextures\\CommandButtons\\BTNPenguin.blp") set receiver_59 = stats() call dispatch_StatList_add(receiver_59, 0, 100) set receiver_60 = receiver_59 call dispatch_StatList_add(receiver_60, 4, 20) set receiver_61 = receiver_60 call dispatch_StatList_add(receiver_61, 5, 20) set receiver_62 = receiver_61 call dispatch_StatList_add(receiver_62, 6, 20) set receiver_63 = receiver_62 call dispatch_StatList_add(receiver_63, 10, 20) set receiver_64 = receiver_63 call dispatch_StatList_add(receiver_64, 12, 4) set receiver_65 = receiver_64 call dispatch_StatList_add(receiver_65, 14, 100) call itemgenSetStats(receiver_65) call itemgenNewMaterial(1229795376, 8, "Boar Tusk", "", "ReplaceableTextures\\CommandButtons\\BTNRazorback.blp") call itemgenNewMaterial(1229795377, 6, "Wood Stem", "", "ReplaceableTextures\\CommandButtons\\BTNBundleOfLumber.blp") call itemgenNewMaterial(1229795378, 8, "Wolf Pelt", "", "ReplaceableTextures\\CommandButtons\\BTNReinforcedHides.blp") call itemgenNewMaterial(1229795379, 12, "Scale", "", "ReplaceableTextures\\CommandButtons\\BTNImprovedCreatureCarapace.blp") call itemgenNewMaterial(1229795380, 10, "Aquamarine", "", "ReplaceableTextures\\CommandButtons\\BTNWispSplode.blp") call itemgenNewRecipe(1764896817, 15, 1228025905, "") call itemgenSetRecipeReq(1229795377, 1229795379, 0, 0, 0, 0, 0, 0) call itemgenNewRecipe(1764896818, 15, 1228025906, "") call itemgenSetRecipeReq(1229795378, 1229795380, 0, 0, 0, 0, 0, 0) call itemgenNewRecipe(1764896819, 15, 1228025907, "") call itemgenSetRecipeReq(1229795376, 1229795377, 0, 0, 0, 0, 0, 0) call itemgenNewRecipe(1765027890, 10, 1228156978, "") call itemgenSetRecipeReq(1229795378, 0, 0, 0, 0, 0, 0, 0) call itemgenNewRecipe(1764831284, 12, 1227960372, "") call itemgenSetRecipeReq(1229795376, 1229795377, 0, 0, 0, 0, 0, 0) endfunction function init_ItemTypeGen takes nothing returns nothing set ItemTypeGen_compiletimeMode = false call initItemTypeLists() endfunction function init_KnockbackHandler takes nothing returns nothing set KnockbackHandler_SFX_EARTH = "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" set KnockbackHandler_SFX_WATER = "Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl" set KnockbackHandler_SFX_ATTACHPOINT = "origin" endfunction function trigger_registerAnyUnitEvent takes trigger this_2, playerunitevent whichEvent returns nothing call TriggerRegisterAnyUnitEventBJ(this_2, whichEvent) endfunction function init_Learnpoints takes nothing returns nothing local trigger receiver = CreateTrigger() local trigger receiver_2 local trigger receiver_3 local trigger receiver_4 call trigger_registerAnyUnitEvent(receiver, EVENT_PLAYER_UNIT_SPELL_EFFECT) set receiver_2 = receiver call trigger_addAction(receiver_2, ref_function_incAttributeAction) set receiver_3 = CreateTrigger() call trigger_registerAnyUnitEvent(receiver_3, EVENT_PLAYER_HERO_LEVEL) set receiver_4 = receiver_3 call trigger_addAction(receiver_4, ref_function_levelupAction) set receiver = null set receiver_2 = null set receiver_3 = null set receiver_4 = null endfunction function init_MagicFunctions takes nothing returns nothing endfunction function rect_getMaxX takes rect this_2 returns real return GetRectMaxX(this_2) endfunction function rect_getMaxY takes rect this_2 returns real return GetRectMaxY(this_2) endfunction function rect_getMinX takes rect this_2 returns real return GetRectMinX(this_2) endfunction function rect_getMinY takes rect this_2 returns real return GetRectMinY(this_2) endfunction function region_addRect takes region this_2, rect r returns nothing call RegionAddRect(this_2, r) endfunction function init_MapBounds takes nothing returns nothing local region receiver local region receiver_2 local real temp_MapBounds_playableMin_x local real temp_MapBounds_playableMin_y local real temp_MapBounds_playableMax_x local real temp_MapBounds_playableMax_y local real temp_MapBounds_boundMin_x local real temp_MapBounds_boundMin_y local real temp_MapBounds_boundMax_x local real temp_MapBounds_boundMax_y set MapBounds_playableMapRect = GetPlayableMapRect() set receiver = CreateRegion() call region_addRect(receiver, MapBounds_playableMapRect) set MapBounds_boundRect = GetWorldBounds() set receiver_2 = CreateRegion() call region_addRect(receiver_2, MapBounds_boundRect) set temp_MapBounds_playableMin_x = rect_getMinX(MapBounds_playableMapRect) set temp_MapBounds_playableMin_y = rect_getMinY(MapBounds_playableMapRect) set MapBounds_playableMin_x = temp_MapBounds_playableMin_x set MapBounds_playableMin_y = temp_MapBounds_playableMin_y set temp_MapBounds_playableMax_x = rect_getMaxX(MapBounds_playableMapRect) set temp_MapBounds_playableMax_y = rect_getMaxY(MapBounds_playableMapRect) set MapBounds_playableMax_x = temp_MapBounds_playableMax_x set MapBounds_playableMax_y = temp_MapBounds_playableMax_y set temp_MapBounds_boundMin_x = rect_getMinX(MapBounds_boundRect) set temp_MapBounds_boundMin_y = rect_getMinY(MapBounds_boundRect) set MapBounds_boundMin_x = temp_MapBounds_boundMin_x set MapBounds_boundMin_y = temp_MapBounds_boundMin_y set temp_MapBounds_boundMax_x = rect_getMaxX(MapBounds_boundRect) set temp_MapBounds_boundMax_y = rect_getMaxY(MapBounds_boundRect) set MapBounds_boundMax_x = temp_MapBounds_boundMax_x set MapBounds_boundMax_y = temp_MapBounds_boundMax_y call vec2_op_mult(vec2_op_plus(MapBounds_playableMin_x, MapBounds_playableMin_y, MapBounds_playableMax_x, MapBounds_playableMax_y), vec2_op_plus_return_y, .5) call vec2_op_mult(vec2_op_plus(MapBounds_boundMin_x, MapBounds_boundMin_y, MapBounds_boundMax_x, MapBounds_boundMax_y), vec2_op_plus_return_y, .5) set receiver = null set receiver_2 = null endfunction function init_Maptest takes nothing returns nothing call SetTimeOfDay(6.) endfunction function init_Maths takes nothing returns nothing set Maths_PI = 3.141592654 set Maths_DEGTORAD = 0.017453293 set Maths_RADTODEG = 57.295779513 endfunction function init_Missile takes nothing returns nothing set Missile_TIMER_TIMEOUT = 0.025 endfunction function alloc_ArrayQueue takes nothing returns integer local integer this_2 if ArrayQueue_firstFree == 0 then set ArrayQueue_maxIndex = ArrayQueue_maxIndex + 1 set this_2 = ArrayQueue_maxIndex else set ArrayQueue_firstFree = ArrayQueue_firstFree - 1 set this_2 = ArrayQueue_nextFree[ArrayQueue_firstFree] endif set ArrayQueue_typeId[this_2] = 750 return this_2 endfunction function construct_ArrayQueue takes integer this_2 returns nothing set ArrayQueue_fp[this_2] = 0 set ArrayQueue_rp[this_2] = 0 set ArrayQueue_size[this_2] = 0 endfunction function new_ArrayQueue takes nothing returns integer local integer this_2 = alloc_ArrayQueue() call construct_ArrayQueue(this_2) return this_2 endfunction function init_NewDummyRecycler takes nothing returns nothing local integer i local integer temp local integer j local integer temp_2 set NewDummyRecycler_DIFFERENT_ANGLES = 8 set NewDummyRecycler_ANGLE_DEGREE = 360 * 1. / NewDummyRecycler_DIFFERENT_ANGLES set NewDummyRecycler_SAVED_UNITS_PER_ANGLE = 6 set DelayNode_t = CreateTimer() set DelayNode_first = 0 set DelayNode_last = 0 set i = 0 set temp = NewDummyRecycler_DIFFERENT_ANGLES - 1 loop exitwhen i > temp set DummyRecycler_angleQueues[i] = new_ArrayQueue() set j = 0 set temp_2 = NewDummyRecycler_SAVED_UNITS_PER_ANGLE - 1 loop exitwhen j > temp_2 call dispatch_ArrayQueue_enqueue(DummyRecycler_angleQueues[i], createDummy(MapBounds_boundMax_x, MapBounds_boundMax_y, Basics_DUMMY_PLAYER, real_asAngleDegrees(i * NewDummyRecycler_ANGLE_DEGREE))) set j = j + 1 endloop set i = i + 1 endloop endfunction function init_OOCRegen takes nothing returns nothing set OOCRegen_INTERVAL = 1. set OOCRegen_DELAY = 5. set OOCRegen_oocrUnits = new_LinkedList() call timer_startPeriodic(CreateTimer(), OOCRegen_INTERVAL, ref_function_callback) endfunction function alloc_IdGenerator takes nothing returns integer local integer this_2 if IdGenerator_firstFree == 0 then set IdGenerator_maxIndex = IdGenerator_maxIndex + 1 set this_2 = IdGenerator_maxIndex else set IdGenerator_firstFree = IdGenerator_firstFree - 1 set this_2 = IdGenerator_nextFree[IdGenerator_firstFree] endif return this_2 endfunction function construct_IdGenerator takes integer this_2, integer start returns nothing endfunction function new_IdGenerator takes integer start returns integer local integer this_2 = alloc_IdGenerator() call construct_IdGenerator(this_2, start) return this_2 endfunction function init_ObjectIdGenerator takes nothing returns nothing call new_IdGenerator(1932537904) call new_IdGenerator(1261449264) call new_IdGenerator(1098395696) call new_IdGenerator(1177563184) call new_IdGenerator(1328558128) endfunction function init_ObjectIds takes nothing returns nothing endfunction function init_PQuest takes nothing returns nothing local integer pid local integer temp local trigger pickupItemTrigger local trigger killUnitTrigger local trigger talkTrigger set PQuest_QUEST_EVENT_RANGE = 1500. set PQuest_TALK_DURATION = 4. set PQuest_numPQuests = 0 set PQuest_raw2qi = new_HashMap() set PQuest_talkNpc2qi = new_HashMap() set pid = 0 set temp = Config_NUM_OF_PLAYERS - 1 loop exitwhen pid > temp set PQuest_npc2QuestMark[pid] = new_HashMap() set PQuest_npc2QuestDiscoverOnTalk[pid] = new_HashMap() set pid = pid + 1 endloop set pickupItemTrigger = CreateTrigger() call trigger_registerAnyUnitEvent(pickupItemTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) call trigger_addAction(pickupItemTrigger, ref_function_closure_impl_6) set killUnitTrigger = CreateTrigger() call trigger_registerPlayerUnitEvent(killUnitTrigger, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH, null) call trigger_addAction(killUnitTrigger, ref_function_closure_impl_7) set talkTrigger = CreateTrigger() call trigger_registerPlayerUnitEvent(talkTrigger, Player(PLAYER_NEUTRAL_PASSIVE), EVENT_PLAYER_UNIT_SELL, null) call trigger_addAction(talkTrigger, ref_function_closure_impl_8) set pickupItemTrigger = null set killUnitTrigger = null set talkTrigger = null endfunction function init_PQuestGen takes nothing returns nothing set PQuestGen_TALK_DUMMY = 1697656880 endfunction function init_Player takes nothing returns nothing local integer i = 0 local integer temp = bj_MAX_PLAYER_SLOTS - 1 loop exitwhen i > temp set Player_players[i] = Player(i) set i = i + 1 endloop endfunction function init_PrintingHelper takes nothing returns nothing local trigger t local integer i set PrintingHelper_DEBUG_LEVEL = 0 set PrintingHelper_DEBUG_MSG_DURATION = 45. set t = CreateTrigger() call trigger_addAction(t, ref_function_switchDebug) set i = 0 loop exitwhen i > 11 set PrintingHelper_wantDebug[i] = false call trigger_registerPlayerChatEvent(t, Player(i), "-d", true) set i = i + 1 endloop set t = null endfunction function init_QuestNPCs takes nothing returns nothing endfunction function alloc_Closure_2 takes nothing returns integer local integer this_2 if CompleteQuestAction_firstFree == 0 then set CompleteQuestAction_maxIndex = CompleteQuestAction_maxIndex + 1 set this_2 = CompleteQuestAction_maxIndex else set CompleteQuestAction_firstFree = CompleteQuestAction_firstFree - 1 set this_2 = CompleteQuestAction_nextFree[CompleteQuestAction_firstFree] endif set CompleteQuestAction_typeId[this_2] = 701 return this_2 endfunction function alloc_QuestDrop takes nothing returns integer local integer this_2 if QuestDrop_firstFree == 0 then set QuestDrop_maxIndex = QuestDrop_maxIndex + 1 set this_2 = QuestDrop_maxIndex else set QuestDrop_firstFree = QuestDrop_firstFree - 1 set this_2 = QuestDrop_nextFree[QuestDrop_firstFree] endif return this_2 endfunction function construct_QuestDrop takes integer this_2, integer questItem, integer chance, integer itemRaw returns nothing set QuestDrop_questItem[this_2] = questItem set QuestDrop_chance[this_2] = chance set QuestDrop_itemRaw[this_2] = itemRaw endfunction function new_QuestDrop takes integer questItem, integer chance, integer itemRaw returns integer local integer this_2 = alloc_QuestDrop() call construct_QuestDrop(this_2, questItem, chance, itemRaw) return this_2 endfunction function Droptable_addQuestDrop takes integer this_2, integer questItem, integer chance, integer itemRaw returns nothing call dispatch_LinkedList_add(Droptable_questDrops[this_2], new_QuestDrop(questItem, chance, itemRaw)) endfunction function dispatch_Droptable_addQuestDrop takes integer this_2, integer questItem, integer chance, integer itemRaw returns nothing if Droptable_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling Droptable.addQuestDrop", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called Droptable.addQuestDrop on invalid object.", 0, 0, false) endif endif call Droptable_addQuestDrop(this_2, questItem, chance, itemRaw) endfunction function PQuestItem_setCompletesQuest takes integer this_2 returns nothing set PQuestItem_completesQuest[this_2] = true endfunction function dispatch_PQuestItem_setCompletesQuest takes integer this_2 returns nothing if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.setCompletesQuest", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.setCompletesQuest on invalid object.", 0, 0, false) endif endif call PQuestItem_setCompletesQuest(this_2) endfunction function PQuestItem_setInitDiscovered takes integer this_2 returns nothing set PQuestItem_initDiscovered[this_2] = true endfunction function dispatch_PQuestItem_setInitDiscovered takes integer this_2 returns nothing if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.setInitDiscovered", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.setInitDiscovered on invalid object.", 0, 0, false) endif endif call PQuestItem_setInitDiscovered(this_2) endfunction function PQuestItem_setNext takes integer this_2, integer next returns nothing set PQuestItem_next[this_2] = next endfunction function dispatch_PQuestItem_setNext takes integer this_2, integer next returns nothing if PQuestItem_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuestItem.setNext", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuestItem.setNext on invalid object.", 0, 0, false) endif endif call PQuestItem_setNext(this_2, next) endfunction function alloc_PQuestItem takes nothing returns integer local integer this_2 if PQuestItem_firstFree == 0 then set PQuestItem_maxIndex = PQuestItem_maxIndex + 1 set this_2 = PQuestItem_maxIndex else set PQuestItem_firstFree = PQuestItem_firstFree - 1 set this_2 = PQuestItem_nextFree[PQuestItem_firstFree] endif set PQuestItem_typeId[this_2] = 703 return this_2 endfunction function construct_PQuestItem takes integer this_2, integer pQuest, string descr, integer maxCount returns nothing local integer pid local integer temp set PQuestItem_talkNPC[this_2] = null set PQuestItem_talkText[this_2] = "" set PQuestItem_talkAction[this_2] = 0 set PQuestItem_parent[this_2] = pQuest set PQuestItem_description[this_2] = descr set PQuestItem_maxCount[this_2] = maxCount set PQuestItem_thisQuestItem[this_2] = new_HashMap() set PQuestItem_state[this_2] = new_HashMap() set PQuestItem_count[this_2] = new_HashMap() set PQuestItem_next[this_2] = 0 set PQuestItem_completesQuest[this_2] = false set pid = 0 set temp = Config_NUM_OF_PLAYERS - 1 loop exitwhen pid > temp call dispatch_HashMap_put(PQuestItem_count[this_2], pid, 0) call dispatch_HashMap_put(PQuestItem_state[this_2], pid, 0) set pid = pid + 1 endloop endfunction function new_PQuestItem takes integer pQuest, string descr, integer maxCount returns integer local integer this_2 = alloc_PQuestItem() call construct_PQuestItem(this_2, pQuest, descr, maxCount) return this_2 endfunction function PQuest_addItem takes integer this_2, string descr, integer maxCount returns integer local integer qi = new_PQuestItem(this_2, descr, maxCount) call dispatch_LinkedList_add(PQuest_questItems[this_2], qi) return qi endfunction function dispatch_PQuest_addItem takes integer this_2, string descr, integer maxCount returns integer local integer addItem_result if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.addItem", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.addItem on invalid object.", 0, 0, false) endif endif set addItem_result = PQuest_addItem(this_2, descr, maxCount) return addItem_result endfunction function PQuest_addItemKillCollect takes integer this_2, string descr, integer objectRaw, integer count returns integer local integer itm = dispatch_PQuest_addItem(this_2, descr, count) call dispatch_HashMap_put(PQuest_raw2qi, objectRaw, itm) return itm endfunction function dispatch_PQuest_addItemKillCollect takes integer this_2, string descr, integer objectRaw, integer count returns integer local integer addItemKillCollect_result if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.addItemKillCollect", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.addItemKillCollect on invalid object.", 0, 0, false) endif endif set addItemKillCollect_result = PQuest_addItemKillCollect(this_2, descr, objectRaw, count) return addItemKillCollect_result endfunction function PQuest_addItem_2 takes integer this_2, string descr returns integer return dispatch_PQuest_addItem(this_2, descr, 0) endfunction function dispatch_PQuest_addItem_2 takes integer this_2, string descr returns integer local integer addItem_result if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.addItem", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.addItem on invalid object.", 0, 0, false) endif endif set addItem_result = PQuest_addItem_2(this_2, descr) return addItem_result endfunction function PQuest_addItemTalk takes integer this_2, string descr, unit npc, string text, integer action returns integer local integer itm = dispatch_PQuest_addItem_2(this_2, descr) set PQuestItem_talkNPC[itm] = npc set PQuestItem_talkText[itm] = text set PQuestItem_talkAction[itm] = action return itm endfunction function dispatch_PQuest_addItemTalk takes integer this_2, string descr, unit npc, string text, integer action returns integer local integer addItemTalk_result if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.addItemTalk", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.addItemTalk on invalid object.", 0, 0, false) endif endif set addItemTalk_result = PQuest_addItemTalk(this_2, descr, npc, text, action) return addItemTalk_result endfunction function PQuest_setCompleteAction takes integer this_2, integer action returns nothing set PQuest_completeQuestAction[this_2] = action endfunction function dispatch_PQuest_setCompleteAction takes integer this_2, integer action returns nothing if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.setCompleteAction", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.setCompleteAction on invalid object.", 0, 0, false) endif endif call PQuest_setCompleteAction(this_2, action) endfunction function PQuest_setDiscoverTalkData takes integer this_2, string text, integer action returns nothing set PQuest_talkText[this_2] = text set PQuest_talkAction[this_2] = action endfunction function dispatch_PQuest_setDiscoverTalkData takes integer this_2, string text, integer action returns nothing if PQuest_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling PQuest.setDiscoverTalkData", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called PQuest.setDiscoverTalkData on invalid object.", 0, 0, false) endif endif call PQuest_setDiscoverTalkData(this_2, text, action) endfunction function getUnitDroptable takes integer unitRaw returns integer return dispatch_HashMap_get(CreepDrop_unitDrops, unitRaw) endfunction function alloc_PQuest takes nothing returns integer local integer this_2 if PQuest_firstFree == 0 then set PQuest_maxIndex = PQuest_maxIndex + 1 set this_2 = PQuest_maxIndex else set PQuest_firstFree = PQuest_firstFree - 1 set this_2 = PQuest_nextFree[PQuest_firstFree] endif set PQuest_typeId[this_2] = 702 return this_2 endfunction function questToIndex takes quest object returns integer return handle_getHandleId(object) endfunction function construct_PQuest takes integer this_2, string title, string icon, string description returns nothing local integer pid local integer temp local quest q set PQuest_talkText[this_2] = "" set PQuest_talkAction[this_2] = 0 set PQuest_numPQuests = PQuest_numPQuests + 1 set PQuest_questItems[this_2] = new_LinkedList() set PQuest_title[this_2] = title set PQuest_completeQuestAction[this_2] = 0 set PQuest_thisQuest[this_2] = new_HashMap() set PQuest_state[this_2] = new_HashMap() set pid = 0 set temp = Config_NUM_OF_PLAYERS - 1 loop exitwhen pid > temp set q = CreateQuest() call dispatch_HashMap_put(PQuest_thisQuest[this_2], pid, questToIndex(q)) call QuestSetTitle(q, title) call QuestSetIconPath(q, icon) call QuestSetDescription(q, description) call QuestSetEnabled(q, false) call dispatch_HashMap_put(PQuest_state[this_2], pid, 0) set pid = pid + 1 endloop set q = null endfunction function new_PQuest takes string title, string icon, string description returns integer local integer this_2 = alloc_PQuest() call construct_PQuest(this_2, title, icon, description) return this_2 endfunction function init_QuestPreciousPelts takes nothing returns nothing local integer receiver local integer receiver_2 local integer clVar local integer temp set QuestPreciousPelts_pqPreciousPelts = new_PQuest("Precious Pelts", "ReplaceableTextures\\CommandButtons\\BTNEnchantedBears.blp", "The merchant Marta requires wolf pelts.") set QuestPreciousPelts_pqPreciousPelts_collect = dispatch_PQuest_addItemKillCollect(QuestPreciousPelts_pqPreciousPelts, "Collect some Flawless Pelts", 1230057520, 5) set QuestPreciousPelts_pqPreciousPelts_return = dispatch_PQuest_addItemTalk(QuestPreciousPelts_pqPreciousPelts, "Return to Marta", udg_npc_marta, "Thank you, those are perfect. Here is your gold.", 0) set receiver = getUnitDroptable(1747988529) call dispatch_Droptable_addQuestDrop(receiver, QuestPreciousPelts_pqPreciousPelts_collect, 40, 1230057520) set receiver_2 = getUnitDroptable(1747988530) call dispatch_Droptable_addQuestDrop(receiver_2, QuestPreciousPelts_pqPreciousPelts_collect, 40, 1230057520) call dispatch_PQuest_setDiscoverTalkData(QuestPreciousPelts_pqPreciousPelts, "Hey there, interested in a job? I require more wolf pelts, if you can bring me some I will pay a good price.", 0) call dispatch_PQuestItem_setInitDiscovered(QuestPreciousPelts_pqPreciousPelts_collect) call dispatch_PQuestItem_setNext(QuestPreciousPelts_pqPreciousPelts_collect, QuestPreciousPelts_pqPreciousPelts_return) call dispatch_PQuestItem_setCompletesQuest(QuestPreciousPelts_pqPreciousPelts_return) set temp = QuestPreciousPelts_pqPreciousPelts set clVar = alloc_Closure_2() call dispatch_PQuest_setCompleteAction(temp, clVar) endfunction function alloc_Closure_3 takes nothing returns integer local integer this_2 if TalkAction_firstFree == 0 then set TalkAction_maxIndex = TalkAction_maxIndex + 1 set this_2 = TalkAction_maxIndex else set TalkAction_firstFree = TalkAction_firstFree - 1 set this_2 = TalkAction_nextFree[TalkAction_firstFree] endif set TalkAction_typeId[this_2] = 698 return this_2 endfunction function alloc_Closure_4 takes nothing returns integer local integer this_2 if CompleteQuestAction_firstFree == 0 then set CompleteQuestAction_maxIndex = CompleteQuestAction_maxIndex + 1 set this_2 = CompleteQuestAction_maxIndex else set CompleteQuestAction_firstFree = CompleteQuestAction_firstFree - 1 set this_2 = CompleteQuestAction_nextFree[CompleteQuestAction_firstFree] endif set CompleteQuestAction_typeId[this_2] = 700 return this_2 endfunction function init_QuestProvingYourWorth takes nothing returns nothing local integer clVar local integer clVar_2 local integer temp local unit temp_2 local integer temp_3 set QuestProvingYourWorth_pqProveWorth = new_PQuest("Proving your worth", "ReplaceableTextures\\CommandButtons\\BTNArthas.blp", "Captain Bryce wants you to help out the local guards to prove your worth.") set temp = QuestProvingYourWorth_pqProveWorth set temp_2 = udg_npc_brom set clVar = alloc_Closure_3() set QuestProvingYourWorth_pqProveWorth_talk = dispatch_PQuest_addItemTalk(temp, "Talk to Brom, the gate guard", temp_2, "Bryce sent you? The boars became very agressive lately and we dont have enough men to keep their numbers down. \nTake this weapon, may it help you.", clVar) set QuestProvingYourWorth_pqProveWorth_kill = dispatch_PQuest_addItemKillCollect(QuestProvingYourWorth_pqProveWorth, "Kill 8 boars", 1747988528, 8) set QuestProvingYourWorth_pqProveWorth_return = dispatch_PQuest_addItemTalk(QuestProvingYourWorth_pqProveWorth, "Return to Brom", udg_npc_brom, "Good job, here is some gold for your troubles.", 0) call dispatch_PQuest_setDiscoverTalkData(QuestProvingYourWorth_pqProveWorth, "Hello stranger, I am glad you came to aid us in these difficult times. Please dont get me wrong, but before I fill you in with our plans I need to make sure I can trust you.\nYou should talk to Brom, I am sure he has some work to do.", 0) call dispatch_PQuestItem_setInitDiscovered(QuestProvingYourWorth_pqProveWorth_talk) call dispatch_PQuestItem_setNext(QuestProvingYourWorth_pqProveWorth_talk, QuestProvingYourWorth_pqProveWorth_kill) call dispatch_PQuestItem_setNext(QuestProvingYourWorth_pqProveWorth_kill, QuestProvingYourWorth_pqProveWorth_return) call dispatch_PQuestItem_setCompletesQuest(QuestProvingYourWorth_pqProveWorth_return) set temp_3 = QuestProvingYourWorth_pqProveWorth set clVar_2 = alloc_Closure_4() call dispatch_PQuest_setCompleteAction(temp_3, clVar_2) set temp_2 = null endfunction function init_Rational takes nothing returns nothing endfunction function init_Recipe takes nothing returns nothing local trigger receiver = CreateTrigger() local trigger receiver_2 call trigger_registerAnyUnitEvent(receiver, EVENT_PLAYER_UNIT_USE_ITEM) set receiver_2 = receiver call trigger_addAction(receiver_2, ref_function_useItemAction) set receiver = null set receiver_2 = null endfunction function init_Rect takes nothing returns nothing call new_Table() endfunction function init_Region takes nothing returns nothing call new_Table() endfunction function init_SimError takes nothing returns nothing set SimError_error = CreateSoundFromLabel("InterfaceError", false, false, false, 10, 10) endfunction function alloc_Closure_5 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 733 return this_2 endfunction function registerSpellcast takes integer raw, integer action returns nothing call dispatch_HashMap_put(SpellHandler_castEvents, raw, action) endfunction function init_SpellCharge takes nothing returns nothing local integer clVar local integer temp set SpellCharge_SPELL_RAW = 1095971122 set temp = SpellCharge_SPELL_RAW set clVar = alloc_Closure_5() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_6 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 730 return this_2 endfunction function init_SpellFirearrow takes nothing returns nothing local integer clVar local integer temp set SpellFirearrow_SPELL_RAW = 1095970871 set SpellFirearrow_BUFF_ABIL_RAW = 1094856759 set SpellFirearrow_BUFF_RAW = 1111633975 set temp = SpellFirearrow_SPELL_RAW set clVar = alloc_Closure_6() call registerSpellcast(temp, clVar) endfunction function init_SpellHandler takes nothing returns nothing local trigger receiver local trigger receiver_2 set SpellHandler_channelDataMap = new_HashMap() set SpellHandler_castEvents = new_HashMap() set receiver = CreateTrigger() call trigger_registerAnyUnitEvent(receiver, EVENT_PLAYER_UNIT_SPELL_EFFECT) set receiver_2 = receiver call trigger_addAction(receiver_2, ref_function_spellEffect) set receiver = null set receiver_2 = null endfunction function alloc_Closure_7 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 734 return this_2 endfunction function init_SpellHeal takes nothing returns nothing local integer clVar local integer temp set SpellHeal_SPELL_RAW = 1095970865 set SpellHeal_CHANNEL_DURATION = 2.5 set temp = SpellHeal_SPELL_RAW set clVar = alloc_Closure_7() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_8 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 726 return this_2 endfunction function init_SpellHolyBolt takes nothing returns nothing local integer clVar local integer temp set SpellHolyBolt_SPELL_RAW = 1095970873 set SpellHolyBolt_CHANNEL_DURATION = 3. set temp = SpellHolyBolt_SPELL_RAW set clVar = alloc_Closure_8() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_9 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 727 return this_2 endfunction function init_SpellIgnoreThePain takes nothing returns nothing local integer clVar local integer temp set SpellIgnoreThePain_SPELL_RAW = 1095970867 set SpellIgnoreThePain_BUFF_ABIL_RAW = 1094856755 set SpellIgnoreThePain_BUFF_RAW = 1111633971 set temp = SpellIgnoreThePain_SPELL_RAW set clVar = alloc_Closure_9() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_10 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 729 return this_2 endfunction function init_SpellMoonlightShadow takes nothing returns nothing local integer clVar local integer temp set SpellMoonlightShadow_SPELL_RAW = 1095971120 set temp = SpellMoonlightShadow_SPELL_RAW set clVar = alloc_Closure_10() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_11 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 731 return this_2 endfunction function init_SpellNaturesWrath takes nothing returns nothing local integer clVar local integer temp set SpellNaturesWrath_SPELL_RAW = 1095970870 set SpellNaturesWrath_BUFF_ABIL_RAW = 1094856758 set SpellNaturesWrath_BUFF_RAW = 1111633974 set SpellNaturesWrath_CHANNEL_DURATION = 1.5 set temp = SpellNaturesWrath_SPELL_RAW set clVar = alloc_Closure_11() call registerSpellcast(temp, clVar) endfunction function init_SpellObjectGen takes nothing returns nothing endfunction function alloc_Closure_12 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 724 return this_2 endfunction function init_SpellRejuvenation takes nothing returns nothing local integer clVar local integer temp set SpellRejuvenation_SPELL_RAW = 1095970869 set SpellRejuvenation_BUFF_ABIL_RAW = 1094856757 set SpellRejuvenation_BUFF_RAW = 1111633973 set temp = SpellRejuvenation_SPELL_RAW set clVar = alloc_Closure_12() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_13 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 725 return this_2 endfunction function init_SpellShield takes nothing returns nothing local integer clVar local integer temp set SpellShield_SPELL_RAW = 1095970868 set SpellShield_BUFF_ABIL_RAW = 1094856756 set SpellShield_BUFF_RAW = 1111633972 set temp = SpellShield_SPELL_RAW set clVar = alloc_Closure_13() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_14 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 732 return this_2 endfunction function init_SpellShieldSlam takes nothing returns nothing local integer clVar local integer temp set SpellShieldSlam_SPELL_RAW = 1095970866 set temp = SpellShieldSlam_SPELL_RAW set clVar = alloc_Closure_14() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_15 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 728 return this_2 endfunction function init_SpellSplitshot takes nothing returns nothing local integer clVar local integer temp set SpellSplitshot_SPELL_RAW = 1095970872 set SpellSplitshot_ARROW_RANGE = 600. set SpellSplitshot_MAX_SPREAD_ANGLE = 40. * Maths_DEGTORAD set temp = SpellSplitshot_SPELL_RAW set clVar = alloc_Closure_15() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_16 takes nothing returns integer local integer this_2 if SpellCastRegistry_firstFree == 0 then set SpellCastRegistry_maxIndex = SpellCastRegistry_maxIndex + 1 set this_2 = SpellCastRegistry_maxIndex else set SpellCastRegistry_firstFree = SpellCastRegistry_firstFree - 1 set this_2 = SpellCastRegistry_nextFree[SpellCastRegistry_firstFree] endif set SpellCastRegistry_typeId[this_2] = 735 return this_2 endfunction function init_SpellTrap takes nothing returns nothing local integer clVar local integer temp set SpellTrap_SPELL_RAW = 1095971121 set SpellTrap_BUFF_ABIL_RAW = 1094857009 set SpellTrap_BUFF_RAW = 1111634225 set SpellTrap_CHANNEL_DURATION = 2. set SpellTrap_TRAP_DURATION = 25. set SpellTrap_ENSNARE_DURATION = 8. set SpellTrap_AOE = 200. set temp = SpellTrap_SPELL_RAW set clVar = alloc_Closure_16() call registerSpellcast(temp, clVar) endfunction function alloc_Closure_17 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 664 return this_2 endfunction function alloc_Closure_18 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 662 return this_2 endfunction function alloc_Closure_19 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 674 return this_2 endfunction function alloc_Closure_20 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 665 return this_2 endfunction function alloc_Closure_21 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 669 return this_2 endfunction function alloc_Closure_22 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 673 return this_2 endfunction function alloc_Closure_23 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 671 return this_2 endfunction function alloc_Closure_24 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 670 return this_2 endfunction function alloc_Closure_25 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 667 return this_2 endfunction function alloc_Closure_26 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 675 return this_2 endfunction function alloc_Closure_27 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 672 return this_2 endfunction function alloc_Closure_28 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 666 return this_2 endfunction function alloc_Closure_29 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 663 return this_2 endfunction function alloc_Closure_30 takes nothing returns integer local integer this_2 if StatChangedEvent_firstFree == 0 then set StatChangedEvent_maxIndex = StatChangedEvent_maxIndex + 1 set this_2 = StatChangedEvent_maxIndex else set StatChangedEvent_firstFree = StatChangedEvent_firstFree - 1 set this_2 = StatChangedEvent_nextFree[StatChangedEvent_firstFree] endif set StatChangedEvent_typeId[this_2] = 668 return this_2 endfunction function registerStatExp takes integer stat returns nothing set StatHandler_statType[stat] = 1 set StatHandler_statSubstat[stat] = -1 set StatHandler_parentStat[stat] = -1 set StatHandler_numStats = StatHandler_numStats + 1 endfunction function registerStatExp_2 takes integer stat, integer statChangedEvent returns nothing set StatHandler_statChangedEvents[stat] = statChangedEvent call registerStatExp(stat) endfunction function registerStatLin takes integer stat returns nothing set StatHandler_statType[stat] = 0 set StatHandler_statSubstat[stat] = -1 set StatHandler_parentStat[stat] = -1 set StatHandler_numStats = StatHandler_numStats + 1 endfunction function registerStatLin_2 takes integer stat, integer statChangedEvent returns nothing set StatHandler_statChangedEvents[stat] = statChangedEvent call registerStatLin(stat) endfunction function registerStatLinExp takes integer stat, integer substat returns nothing call registerStatLin(stat) call registerStatExp(substat) set StatHandler_statSubstat[stat] = substat set StatHandler_parentStat[substat] = stat endfunction function registerStatLinExp_2 takes integer stat, integer substat, integer statChangedEvent returns nothing set StatHandler_statChangedEvents[stat] = statChangedEvent call registerStatLinExp(stat, substat) endfunction function registerStatLog takes integer stat returns nothing set StatHandler_statType[stat] = 2 set StatHandler_statSubstat[stat] = -1 set StatHandler_parentStat[stat] = -1 set StatHandler_numStats = StatHandler_numStats + 1 endfunction function statRegistry takes nothing returns nothing local integer clVar = alloc_Closure_25() local integer clVar_2 local integer clVar_3 local integer clVar_4 local integer clVar_5 local integer clVar_6 local integer clVar_7 local integer clVar_8 local integer clVar_9 local integer clVar_10 local integer clVar_11 local integer clVar_12 local integer clVar_13 local integer clVar_14 call registerStatLin_2(0, clVar) set clVar_2 = alloc_Closure_17() call registerStatLin_2(1, clVar_2) set clVar_3 = alloc_Closure_26() call registerStatLin_2(2, clVar_3) set clVar_4 = alloc_Closure_29() call registerStatLin_2(3, clVar_4) set clVar_5 = alloc_Closure_27() call registerStatLin_2(4, clVar_5) set clVar_6 = alloc_Closure_18() call registerStatLin_2(5, clVar_6) set clVar_7 = alloc_Closure_21() call registerStatLin_2(6, clVar_7) set clVar_8 = alloc_Closure_23() call registerStatLinExp_2(10, 11, clVar_8) set clVar_9 = alloc_Closure_30() call registerStatLin_2(12, clVar_9) set clVar_10 = alloc_Closure_20() call registerStatExp_2(13, clVar_10) set clVar_11 = alloc_Closure_24() call registerStatLin_2(14, clVar_11) set clVar_12 = alloc_Closure_28() call registerStatLin_2(7, clVar_12) set clVar_13 = alloc_Closure_19() call registerStatLin_2(8, clVar_13) set clVar_14 = alloc_Closure_22() call registerStatLin_2(9, clVar_14) call registerStatLog(15) call registerStatLog(16) call registerStatExp(17) call registerStatLin(18) call registerStatExp(19) call registerStatExp(20) call registerStatExp(21) endfunction function init_StatHandler takes nothing returns nothing set StatHandler_numStats = 0 set StatHandler_mapBaseStatBuffers = new_HashMap() call statRegistry() set StatHandler_DEFAULT_BASE_STAT_BUFFER = new_UnitBaseStatBuffer(0) endfunction function alloc_DummyCaster takes nothing returns integer local integer this_2 if DummyCaster_firstFree == 0 then set DummyCaster_maxIndex = DummyCaster_maxIndex + 1 set this_2 = DummyCaster_maxIndex else set DummyCaster_firstFree = DummyCaster_firstFree - 1 set this_2 = DummyCaster_nextFree[DummyCaster_firstFree] endif set DummyCaster_typeId[this_2] = 755 return this_2 endfunction function construct_DummyCaster takes integer this_2, integer abilityId, string orderString, player owner, boolean autodestroy returns nothing set DummyCaster_abilityId[this_2] = 0 set DummyCaster_level[this_2] = 1 set DummyCaster_owner[this_2] = Basics_DUMMY_PLAYER set DummyCaster_orderId[this_2] = 0 set DummyCaster_recycleDelay[this_2] = 0.5 set DummyCaster_customSource[this_2] = false set DummyCaster_autodestroy[this_2] = false set DummyCaster_orderId[this_2] = OrderId(orderString) set DummyCaster_abilityId[this_2] = abilityId set DummyCaster_owner[this_2] = owner set DummyCaster_autodestroy[this_2] = autodestroy call debugPrint("DC constructed", 3) endfunction function new_DummyCaster takes integer abilityId, string orderString, player owner, boolean autodestroy returns integer local integer this_2 = alloc_DummyCaster() call construct_DummyCaster(this_2, abilityId, orderString, owner, autodestroy) return this_2 endfunction function init_StatusHandler takes nothing returns nothing set StatusHandler_STUN_DUMMY_CASTER = new_DummyCaster(StatusHandlerConfig_STUN_ABILITY_ID, "firebolt", Basics_DUMMY_PLAYER, false) call new_DummyCaster(StatusHandlerConfig_SILENCE_ABILITY_ID, "soulburn", Basics_DUMMY_PLAYER, false) call new_DummyCaster(StatusHandlerConfig_DISARM_BOTH_ABILITY_ID, "drunkenhaze", Basics_DUMMY_PLAYER, false) call new_DummyCaster(StatusHandlerConfig_DISARM_MELEE_ABILITY_ID, "drunkenhaze", Basics_DUMMY_PLAYER, false) call new_DummyCaster(StatusHandlerConfig_DISARM_RANGED_ABILITY_ID, "drunkenhaze", Basics_DUMMY_PLAYER, false) set StatusHandler_ENSNARE_DUMMY_CASTER = new_DummyCaster(StatusHandlerConfig_ENSNARE_ABILITY_ID, "ensnare", Basics_DUMMY_PLAYER, false) endfunction function init_StatusHandlerConfig takes nothing returns nothing set StatusHandlerConfig_STUN_ABILITY_ID = 1396790100 set StatusHandlerConfig_STUN_BUFF_ID = 1396855636 set StatusHandlerConfig_SILENCE_ABILITY_ID = 1396790089 set StatusHandlerConfig_DISARM_BOTH_ABILITY_ID = 1396786241 set StatusHandlerConfig_DISARM_MELEE_ABILITY_ID = 1396786253 set StatusHandlerConfig_DISARM_RANGED_ABILITY_ID = 1396786258 set StatusHandlerConfig_ENSNARE_ABILITY_ID = 1396786510 set StatusHandlerConfig_ENSNARE1_BUFF_ID = 1396852017 set StatusHandlerConfig_ENSNARE2_BUFF_ID = 1396852018 endfunction function string_length takes string this_2 returns integer return StringLength(this_2) endfunction function init_String takes nothing returns nothing set String_charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" set String_numberset = "0123456789" call string_length(String_numberset) call string_length(String_charset) endfunction function init_Table takes nothing returns nothing set Table_ht = InitHashtable() endfunction function init_Talent takes nothing returns nothing local trigger receiver local trigger receiver_2 set Talent_raw2talent = new_HashMap() set receiver = CreateTrigger() call trigger_registerAnyUnitEvent(receiver, EVENT_PLAYER_UNIT_SPELL_CHANNEL) set receiver_2 = receiver call trigger_addAction(receiver_2, ref_function_learnAction) set receiver = null set receiver_2 = null endfunction function init_TalentList takes nothing returns nothing set TalentList_BOOK_TALENT_WARRIOR = 1096041009 set TalentList_BOOK_TALENT_PRIEST = 1096041010 set TalentList_BOOK_TALENT_RANGER = 1096041011 set TalentList_BOOK_TALENT_DRUID = 1096041012 endfunction function col takes string s returns string return "|cffffcc00" + s + "|r" endfunction function ObjectDefinition_setLvlDataUnreal takes integer this_key, string modification, integer lvl, integer dataPointer, real value returns nothing endfunction function AbilityDefinitionIllidanChannel_setArtDuration takes integer this_2, integer level, real value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataUnreal(AbilityDefinition_def[tempIndex], "Ncl4", level, 4, value) endfunction function dispatch_AbilityDefinitionIllidanChannel_setArtDuration takes integer this_2, integer level, real value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinitionIllidanChannel.setArtDuration", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinitionIllidanChannel.setArtDuration on invalid object.", 0, 0, false) endif endif call AbilityDefinitionIllidanChannel_setArtDuration(this_2, level, value) endfunction function ObjectDefinition_setLvlDataString takes integer this_key, string modification, integer lvl, integer dataPointer, string value returns nothing endfunction function AbilityDefinitionIllidanChannel_setBaseOrderID takes integer this_2, integer level, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "Ncl6", level, 6, value) endfunction function dispatch_AbilityDefinitionIllidanChannel_setBaseOrderID takes integer this_2, integer level, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinitionIllidanChannel.setBaseOrderID", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinitionIllidanChannel.setBaseOrderID on invalid object.", 0, 0, false) endif endif call AbilityDefinitionIllidanChannel_setBaseOrderID(this_2, level, value) endfunction function ObjectDefinition_setLvlDataInt takes integer this_key, string modification, integer lvl, integer dataPointer, integer value returns nothing endfunction function ObjectDefinition_setLvlDataBoolean takes integer this_key, string modification, integer lvl, integer dataPointer, boolean value returns nothing if value then call ObjectDefinition_setLvlDataInt(this_key, modification, lvl, dataPointer, 1) else call ObjectDefinition_setLvlDataInt(this_key, modification, lvl, dataPointer, 0) endif endfunction function AbilityDefinitionIllidanChannel_setDisableOtherAbilities takes integer this_2, integer level, boolean value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataBoolean(AbilityDefinition_def[tempIndex], "Ncl5", level, 5, value) endfunction function dispatch_AbilityDefinitionIllidanChannel_setDisableOtherAbilities takes integer this_2, integer level, boolean value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinitionIllidanChannel.setDisableOtherAbilities", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinitionIllidanChannel.setDisableOtherAbilities on invalid object.", 0, 0, false) endif endif call AbilityDefinitionIllidanChannel_setDisableOtherAbilities(this_2, level, value) endfunction function AbilityDefinitionIllidanChannel_setFollowThroughTime takes integer this_2, integer level, real value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataUnreal(AbilityDefinition_def[tempIndex], "Ncl1", level, 1, value) endfunction function dispatch_AbilityDefinitionIllidanChannel_setFollowThroughTime takes integer this_2, integer level, real value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinitionIllidanChannel.setFollowThroughTime", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinitionIllidanChannel.setFollowThroughTime on invalid object.", 0, 0, false) endif endif call AbilityDefinitionIllidanChannel_setFollowThroughTime(this_2, level, value) endfunction function AbilityDefinitionIllidanChannel_setOptions takes integer this_2, integer level, integer value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataInt(AbilityDefinition_def[tempIndex], "Ncl3", level, 3, value) endfunction function dispatch_AbilityDefinitionIllidanChannel_setOptions takes integer this_2, integer level, integer value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinitionIllidanChannel.setOptions", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinitionIllidanChannel.setOptions on invalid object.", 0, 0, false) endif endif call AbilityDefinitionIllidanChannel_setOptions(this_2, level, value) endfunction function AbilityDefinitionIllidanChannel_setTargetType takes integer this_2, integer level, integer value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataInt(AbilityDefinition_def[tempIndex], "Ncl2", level, 2, value) endfunction function dispatch_AbilityDefinitionIllidanChannel_setTargetType takes integer this_2, integer level, integer value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinitionIllidanChannel.setTargetType", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinitionIllidanChannel.setTargetType on invalid object.", 0, 0, false) endif endif call AbilityDefinitionIllidanChannel_setTargetType(this_2, level, value) endfunction function AbilityDefinition_setAnimationNames takes integer this_2, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "aani", 0, 0, value) endfunction function dispatch_AbilityDefinition_setAnimationNames takes integer this_2, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setAnimationNames", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setAnimationNames on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setAnimationNames(this_2, value) endfunction function AbilityDefinition_setArtCaster takes integer this_2, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "acat", 0, 0, value) endfunction function dispatch_AbilityDefinition_setArtCaster takes integer this_2, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setArtCaster", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setArtCaster on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setArtCaster(this_2, value) endfunction function AbilityDefinition_setArtEffect takes integer this_2, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "aeat", 0, 0, value) endfunction function dispatch_AbilityDefinition_setArtEffect takes integer this_2, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setArtEffect", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setArtEffect on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setArtEffect(this_2, value) endfunction function AbilityDefinition_setArtTarget takes integer this_2, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "atat", 0, 0, value) endfunction function dispatch_AbilityDefinition_setArtTarget takes integer this_2, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setArtTarget", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setArtTarget on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setArtTarget(this_2, value) endfunction function AbilityDefinition_setButtonPositionNormalX takes integer this_2, integer value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataInt(AbilityDefinition_def[tempIndex], "abpx", 0, 0, value) endfunction function dispatch_AbilityDefinition_setButtonPositionNormalX takes integer this_2, integer value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setButtonPositionNormalX", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setButtonPositionNormalX on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setButtonPositionNormalX(this_2, value) endfunction function AbilityDefinition_setButtonPositionNormalY takes integer this_2, integer value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataInt(AbilityDefinition_def[tempIndex], "abpy", 0, 0, value) endfunction function dispatch_AbilityDefinition_setButtonPositionNormalY takes integer this_2, integer value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setButtonPositionNormalY", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setButtonPositionNormalY on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setButtonPositionNormalY(this_2, value) endfunction function AbilityDefinition_setHeroAbility takes integer this_2, boolean value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataBoolean(AbilityDefinition_def[tempIndex], "aher", 0, 0, value) endfunction function dispatch_AbilityDefinition_setHeroAbility takes integer this_2, boolean value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setHeroAbility", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setHeroAbility on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setHeroAbility(this_2, value) endfunction function AbilityDefinition_setIconNormal takes integer this_2, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "aart", 0, 0, value) endfunction function dispatch_AbilityDefinition_setIconNormal takes integer this_2, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setIconNormal", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setIconNormal on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setIconNormal(this_2, value) endfunction function AbilityDefinition_setLevels takes integer this_2, integer value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataInt(AbilityDefinition_def[tempIndex], "alev", 0, 0, value) endfunction function dispatch_AbilityDefinition_setLevels takes integer this_2, integer value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setLevels", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setLevels on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setLevels(this_2, value) endfunction function AbilityDefinition_setName takes integer this_2, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "anam", 0, 0, value) endfunction function dispatch_AbilityDefinition_setName takes integer this_2, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setName", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setName on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setName(this_2, value) endfunction function AbilityDefinition_setRace takes integer this_2, integer rce returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "arac", 0, 0, Race_toObjectString(rce)) endfunction function dispatch_AbilityDefinition_setRace takes integer this_2, integer rce returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setRace", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setRace on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setRace(this_2, rce) endfunction function AbilityDefinition_setTooltipNormal takes integer this_2, integer level, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "atp1", level, 0, value) endfunction function dispatch_AbilityDefinition_setTooltipNormal takes integer this_2, integer level, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setTooltipNormal", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setTooltipNormal on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setTooltipNormal(this_2, level, value) endfunction function AbilityDefinition_setTooltipNormalExtended takes integer this_2, integer level, string value returns nothing local integer tempIndex = this_2 call ObjectDefinition_setLvlDataString(AbilityDefinition_def[tempIndex], "aub1", level, 0, value) endfunction function dispatch_AbilityDefinition_setTooltipNormalExtended takes integer this_2, integer level, string value returns nothing if AbilityDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling AbilityDefinition.setTooltipNormalExtended", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called AbilityDefinition.setTooltipNormalExtended on invalid object.", 0, 0, false) endif endif call AbilityDefinition_setTooltipNormalExtended(this_2, level, value) endfunction function alloc_AbilityDefinitionIllidanChannel takes nothing returns integer local integer this_2 if AbilityDefinition_firstFree == 0 then set AbilityDefinition_maxIndex = AbilityDefinition_maxIndex + 1 set this_2 = AbilityDefinition_maxIndex else set AbilityDefinition_firstFree = AbilityDefinition_firstFree - 1 set this_2 = AbilityDefinition_nextFree[AbilityDefinition_firstFree] endif set AbilityDefinition_typeId[this_2] = 606 return this_2 endfunction function construct_AbilityDefinition takes integer this_2, integer newAbilityId, integer origAbilityId returns nothing set AbilityDefinition_def[this_2] = createObjectDefinition("w3a", newAbilityId, origAbilityId) endfunction function construct_AbilityDefinitionIllidanChannel takes integer this_2, integer newAbilityId returns nothing call construct_AbilityDefinition(this_2, newAbilityId, 1095656300) endfunction function new_AbilityDefinitionIllidanChannel takes integer newAbilityId returns integer local integer this_2 = alloc_AbilityDefinitionIllidanChannel() call construct_AbilityDefinitionIllidanChannel(this_2, newAbilityId) return this_2 endfunction function alloc_Talent takes nothing returns integer local integer this_2 if Talent_firstFree == 0 then set Talent_maxIndex = Talent_maxIndex + 1 set this_2 = Talent_maxIndex else set Talent_firstFree = Talent_firstFree - 1 set this_2 = Talent_nextFree[Talent_firstFree] endif return this_2 endfunction function construct_Talent takes integer this_2, integer raw, integer levels, string name returns nothing call dispatch_HashMap_put(Talent_raw2talent, raw, this_2) set Talent_raw[this_2] = raw set Talent_levels[this_2] = levels endfunction function new_Talent takes integer raw, integer levels, string name returns integer local integer this_2 = alloc_Talent() call construct_Talent(this_2, raw, levels, name) return this_2 endfunction function genTalent takes integer raw, string order, string name, integer levels, string description, string icon returns integer local integer tal = new_Talent(raw, levels, name) local integer obj local integer receiver local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer lvl local integer temp if TalentObjectGen_compiletimeMode then set receiver = new_AbilityDefinitionIllidanChannel(raw) call dispatch_AbilityDefinition_setName(receiver, "talent_" + name) set receiver_2 = receiver call dispatch_AbilityDefinition_setIconNormal(receiver_2, icon) set receiver_3 = receiver_2 call dispatch_AbilityDefinition_setAnimationNames(receiver_3, "") set receiver_4 = receiver_3 call dispatch_AbilityDefinition_setButtonPositionNormalX(receiver_4, 0) set receiver_5 = receiver_4 call dispatch_AbilityDefinition_setButtonPositionNormalY(receiver_5, 0) set receiver_6 = receiver_5 call dispatch_AbilityDefinition_setArtCaster(receiver_6, "") set receiver_7 = receiver_6 call dispatch_AbilityDefinition_setArtEffect(receiver_7, "") set receiver_8 = receiver_7 call dispatch_AbilityDefinition_setArtTarget(receiver_8, "") set receiver_9 = receiver_8 call dispatch_AbilityDefinition_setLevels(receiver_9, levels + 1) set receiver_10 = receiver_9 call dispatch_AbilityDefinition_setHeroAbility(receiver_10, false) set receiver_11 = receiver_10 call dispatch_AbilityDefinition_setRace(receiver_11, 8) set obj = receiver_11 set lvl = 1 set temp = levels + 1 loop exitwhen lvl > temp call dispatch_AbilityDefinitionIllidanChannel_setArtDuration(obj, lvl, 0.) call dispatch_AbilityDefinitionIllidanChannel_setFollowThroughTime(obj, lvl, 0.) call dispatch_AbilityDefinitionIllidanChannel_setOptions(obj, lvl, 1) call dispatch_AbilityDefinitionIllidanChannel_setTargetType(obj, lvl, 0) call dispatch_AbilityDefinition_setTooltipNormalExtended(obj, lvl, description) call dispatch_AbilityDefinitionIllidanChannel_setBaseOrderID(obj, lvl, order) call dispatch_AbilityDefinitionIllidanChannel_setDisableOtherAbilities(obj, lvl, false) if lvl == 1 then call dispatch_AbilityDefinition_setTooltipNormal(obj, lvl, "|cffB3B3B3Learn talent:|r " + name + " (0/" + int_toString(levels) + ")") else call dispatch_AbilityDefinition_setTooltipNormal(obj, lvl, "|cffffcc00Talent:|r " + name + " (" + int_toString(lvl - 1) + "/" + int_toString(levels) + ")") endif set lvl = lvl + 1 endloop endif return tal endfunction function genTalentBook takes integer raw, string name, string talentRaws returns nothing local integer u_key = createObjectDefinition("w3a", raw, 1098084450) call ObjectDefinition_setLvlDataString(u_key, "aart", 0, 0, "ReplaceableTextures\\CommandButtons\\BTNEngineeringUpgrade.blp") call ObjectDefinition_setLvlDataInt(u_key, "spb2", 1, 2, 0) call ObjectDefinition_setLvlDataString(u_key, "spb1", 1, 1, talentRaws) call ObjectDefinition_setLvlDataInt(u_key, "aite", 0, 0, 0) call ObjectDefinition_setLvlDataString(u_key, "anam", 0, 0, "book_talents_" + name) call ObjectDefinition_setLvlDataString(u_key, "atp1", 1, 0, "Talents: " + name) call ObjectDefinition_setLvlDataString(u_key, "aub1", 1, 0, "Learning a talent costs 10 talentpoints. Your hero gains 10 talentpoints every second level.") call ObjectDefinition_setLvlDataInt(u_key, "abpx", 0, 0, 2) call ObjectDefinition_setLvlDataInt(u_key, "abpy", 0, 0, 1) call ObjectDefinition_setLvlDataInt(u_key, "spb4", 1, 4, 11) call ObjectDefinition_setLvlDataInt(u_key, "spb3", 1, 3, 11) call ObjectDefinition_setLvlDataString(u_key, "spb5", 1, 5, "creephealon") endfunction function initTalentList takes nothing returns nothing set TalentList_TALENT_WARRIOR_SHIELDSLAM_STUN = genTalent(1412509745, TalentObjectGen_talentOrder1, "Brute Force", 1, col("Shield Slam") + " also stuns the target for 1 second.", "ReplaceableTextures\\CommandButtons\\BTNThunderClap.blp") set TalentList_TALENT_WARRIOR_SHIELDSLAM_TAUNT = genTalent(1412509746, TalentObjectGen_talentOrder2, "Taunt", 1, col("Shield Slam") + " forces the target to attack the Warrior for 4 seconds.", "ReplaceableTextures\\CommandButtons\\BTNBanditLord.blp") set TalentList_TALENT_WARRIOR_IGNORE_REFLECT = genTalent(1412509747, TalentObjectGen_talentOrder3, "Spiked Shields", 1, "While " + col("Ignore The Pain") + " is active, attackers in melee range take 1 x AP damage.", "ReplaceableTextures\\CommandButtons\\BTNAdvancedSpikedBarricades.blp") set TalentList_TALENT_WARRIOR_CHARGE_THREAT = genTalent(1412509748, TalentObjectGen_talentOrder4, "Valor", 1, col("Charge") + " creates additional threat on all targets", "ReplaceableTextures\\CommandButtons\\BTNAvatarOff.blp") call genTalentBook(TalentList_BOOK_TALENT_WARRIOR, "Warrior", "T101,T102,T103,T104") set TalentList_TALENT_PRIEST_HEAL_OVERHEAL = genTalent(1412575281, TalentObjectGen_talentOrder1, "Ancient Wisdom", 1, "For each 25% the priest overheals with " + col("Heal") + ", he gets back 1 mana.", "ReplaceableTextures\\CommandButtons\\BTNBlink.blp") set TalentList_TALENT_PRIEST_HEAL_HASTE = genTalent(1412575282, TalentObjectGen_talentOrder2, "Haste", 1, "Decreases casttime for " + col("Heal") + " on targets where " + col("Shield") + " is active by 15%.", "ReplaceableTextures\\CommandButtons\\BTNHeal.blp") set TalentList_TALENT_PRIEST_SHIELD_HEALREC = genTalent(1412575283, TalentObjectGen_talentOrder3, "Divine Protection", 1, col("Shield") + " also increases received heal by 10%.", "ReplaceableTextures\\CommandButtons\\BTNBarkSkin.blp") set TalentList_TALENT_PRIEST_HOLYBOLT_JUMP = genTalent(1412575284, TalentObjectGen_talentOrder4, "Devotion", 1, "Allows " + col("Holy Bolt") + " to jump to one additional target.", "ReplaceableTextures\\CommandButtons\\BTNHealingWave.blp") call genTalentBook(TalentList_BOOK_TALENT_PRIEST, "Priest", "T201,T202,T203,T204") set TalentList_TALENT_RANGER_FIREARROW_DURATION = genTalent(1412640817, TalentObjectGen_talentOrder1, "Tinder Coating", 1, "Increases the duration and damage of " + col("Firearrows") + " debuff by 50%.", "ReplaceableTextures\\CommandButtons\\BTNFlamingArrows.blp") set TalentList_TALENT_RANGER_SPLITSHOT_PIERCE = genTalent(1412640818, TalentObjectGen_talentOrder2, "Barbed Arrowheads", 1, "Allows the arrows of " + col("Splitshot") + " to pierce one additional target.", "ReplaceableTextures\\CommandButtons\\BTNTrueShot.blp") set TalentList_TALENT_RANGER_SPLITSHOT_BURN = genTalent(1412640819, TalentObjectGen_talentOrder3, "Igniting Arrows", 1, "Arrows of " + col("Splitshot") + " that pierce a target where " + "Firearrow" + " is active will ignite and deal an additional 30% fire damage to their next targets.", "ReplaceableTextures\\CommandButtons\\BTNFlare.blp") set TalentList_TALENT_RANGER_TRAP_POISON = genTalent(1412640820, TalentObjectGen_talentOrder4, "Poison Stings", 1, "Targets hit by " + col("Trap") + " take 2 x Agi poison damage.", "ReplaceableTextures\\CommandButtons\\BTNPoisonSting.blp") call genTalentBook(TalentList_BOOK_TALENT_RANGER, "Ranger", "T301,T302,T303,T304") set TalentList_TALENT_DRUID_REJU_TICK = genTalent(1412706353, TalentObjectGen_talentOrder1, "Remedy", 1, "Increases duration and healing of " + col("Rejuvenation") + " by 25%.", "ReplaceableTextures\\CommandButtons\\BTNBanish.blp") set TalentList_TALENT_DRUID_WRATH_ENTANGLE = genTalent(1412706354, TalentObjectGen_talentOrder2, "Entangle", 1, col("Natures Wrath") + " entangles the target for the duration. If the target cannot be entangled it takes 20% increased damage instead.", "ReplaceableTextures\\CommandButtons\\BTNThorns.blp") set TalentList_TALENT_DRUID_MOON_DELAY = genTalent(1412706355, TalentObjectGen_talentOrder3, "Stardust", 1, "Decreases the delay of " + col("Moonlight Shadow") + " by 66%.", "ReplaceableTextures\\CommandButtons\\BTNGenericSpellImmunity.blp") set TalentList_TALENT_DRUID_MOON_REJU = genTalent(1412706356, TalentObjectGen_talentOrder4, "Symbiosis", 1, "Increases the amount healed by " + col("Moonlight Shadow") + " by 20% on targets where " + col("Rejuvenation") + " is active.", "ReplaceableTextures\\CommandButtons\\BTNHeartOfSearinox.blp") call genTalentBook(TalentList_BOOK_TALENT_DRUID, "Druid", "T401,T402,T403,T404") endfunction function init_TalentObjectGen takes nothing returns nothing set TalentObjectGen_talentOrder1 = "creephealoff" set TalentObjectGen_talentOrder2 = "weboff" set TalentObjectGen_talentOrder3 = "restorationoff" set TalentObjectGen_talentOrder4 = "raisedeadoff" set TalentObjectGen_compiletimeMode = false call initTalentList() endfunction function init_TempGroups takes nothing returns nothing set TempGroups_ENUM_GROUP = CreateGroup() endfunction function init_Terrain takes nothing returns nothing local real temp_Terrain_tempPos_x local real temp_Terrain_tempPos_y set Terrain_MAX_RANGE = 10. set Terrain_DUMMY_ITEM_ID = 2003790951 set Terrain_tempLoc = Location(0., 0.) set Terrain_dItem = null set Terrain_find = null set Terrain_hidMax = 0 set temp_Terrain_tempPos_x = 0. set temp_Terrain_tempPos_y = 0. set Terrain_tempPos_x = temp_Terrain_tempPos_x set Terrain_tempPos_y = temp_Terrain_tempPos_y set Terrain_find = Rect(0., 0., 128., 128.) set Terrain_dItem = CreateItem(Terrain_DUMMY_ITEM_ID, 0., 0.) call SetItemVisible(Terrain_dItem, false) endfunction function init_TestUtils takes nothing returns nothing local trigger receiver = CreateTrigger() local trigger receiver_2 local trigger receiver_3 call trigger_registerPlayerUnitEvent(receiver, Player(0), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, null) set receiver_2 = receiver call trigger_addAction(receiver_2, ref_function_closure_impl_9) set receiver_3 = receiver_2 call trigger_disable(receiver_3) set TestUtils_smartCoordsTrigger = receiver_3 call chatEvent("-testutils smartcoords", ref_function_closure_impl_10) set receiver = null set receiver_2 = null set receiver_3 = null endfunction function init_ThreatHandler takes nothing returns nothing set ThreatHandler_ht = InitHashtable() set ThreatHandler_icListLast = 0 call timer_startPeriodic(CreateTimer(), 0.5, ref_function_update) endfunction function init_ThreatHandlerConfig takes nothing returns nothing set ThreatHandlerConfig_TIME_TO_PORT = 10 set ThreatHandlerConfig_RETURN_RANGE = 1200. set ThreatHandlerConfig_ORDER_RETURN_RANGE = 4000. set ThreatHandlerConfig_CAMP_RANGE = 400. endfunction function init_TimerUtils takes nothing returns nothing set TimerUtils_freeTimersCount = 0 set TimerUtils_timerData = new_Table() set TimerUtils_HELD = 679645218 endfunction function init_Trigger takes nothing returns nothing call new_Table() endfunction function init_TypeCasting takes nothing returns nothing set TypeCasting_typecastdata = new_Table() endfunction function init_UnitIndex takes nothing returns nothing set EventModule_trig = CreateTrigger() set EventModule_trig_2 = CreateTrigger() endfunction function init_UnitTypeData takes nothing returns nothing set UnitTypeData_raw2UnitTypeData = new_HashMap() endfunction function UnitDefinition_setStructuresBuilt takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "ubui", data) endfunction function dispatch_UnitDefinition_setStructuresBuilt takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitDefinition.setStructuresBuilt", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitDefinition.setStructuresBuilt on invalid object.", 0, 0, false) endif endif call UnitDefinition_setStructuresBuilt(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setCategorizationSpecial takes integer this_2, boolean data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setBoolean(W3UDefinition_def[tempIndex], "uspe", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setCategorizationSpecial takes integer this_2, boolean data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setCategorizationSpecial", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setCategorizationSpecial on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setCategorizationSpecial(this_2, data) endfunction function UnitOrBuildingOrHeroDefinition_setTilesets takes integer this_2, string data returns nothing local integer tempIndex = this_2 call ObjectDefinition_setString(W3UDefinition_def[tempIndex], "util", data) endfunction function dispatch_UnitOrBuildingOrHeroDefinition_setTilesets takes integer this_2, string data returns nothing if W3UDefinition_typeId[this_2] == 0 then if this_2 == 0 then call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Nullpointer exception when calling UnitOrBuildingOrHeroDefinition.setTilesets", 0, 0, false) else call cyc_cyc_cyc_cyc_dispatch_Table_loadInt(0, 0, 0, 1, 0, 0, "Called UnitOrBuildingOrHeroDefinition.setTilesets on invalid object.", 0, 0, false) endif endif call UnitOrBuildingOrHeroDefinition_setTilesets(this_2, data) endfunction function alloc_UnitDefinition takes nothing returns integer local integer this_2 if W3UDefinition_firstFree == 0 then set W3UDefinition_maxIndex = W3UDefinition_maxIndex + 1 set this_2 = W3UDefinition_maxIndex else set W3UDefinition_firstFree = W3UDefinition_firstFree - 1 set this_2 = W3UDefinition_nextFree[W3UDefinition_firstFree] endif set W3UDefinition_typeId[this_2] = 26 return this_2 endfunction function construct_UnitDefinition takes integer this_2, integer newId, integer origId returns nothing call construct_UnitOrHeroDefinition(this_2, newId, origId) endfunction function new_UnitDefinition takes integer newId, integer origId returns integer local integer this_2 = alloc_UnitDefinition() call construct_UnitDefinition(this_2, newId, origId) return this_2 endfunction function unitgenNewCreep takes integer raw, integer baseRaw, integer level, string name, integer life, integer mana, integer damage, integer armor, integer attackspeed, integer movespeed returns integer local integer receiver = new_UnitBaseStatBuffer(raw) local integer baseStats local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer receiver_12 local integer receiver_13 local integer receiver_14 local integer receiver_15 local integer receiver_16 local integer receiver_17 local integer receiver_18 local integer receiver_19 local integer receiver_20 local integer receiver_21 local integer receiver_22 local integer receiver_23 local integer receiver_24 local integer receiver_25 local integer receiver_26 local integer receiver_27 local integer receiver_28 local integer receiver_29 local integer receiver_30 local integer receiver_31 local integer receiver_32 local integer receiver_33 local integer receiver_34 local integer receiver_35 local integer receiver_36 local integer receiver_37 local integer receiver_38 local integer receiver_39 local integer receiver_40 local integer receiver_41 call dispatch_UnitBaseStatBuffer_set(receiver, 0, life) set receiver_2 = receiver call dispatch_UnitBaseStatBuffer_set(receiver_2, 1, mana) set receiver_3 = receiver_2 call dispatch_UnitBaseStatBuffer_set(receiver_3, 10, damage) set receiver_4 = receiver_3 call dispatch_UnitBaseStatBuffer_set(receiver_4, 12, armor) set receiver_5 = receiver_4 call dispatch_UnitBaseStatBuffer_set(receiver_5, 14, movespeed) set baseStats = receiver_5 set UnitTypeGen_currentUnitTypeData = new_UnitTypeData(raw, baseStats) if UnitTypeGen_compiletimeMode then set receiver_6 = new_UnitDefinition(raw, baseRaw) call dispatch_W3UDefinition_setName(receiver_6, name) set receiver_7 = receiver_6 call dispatch_UnitOrHeroDefinition_setLevel(receiver_7, level) set receiver_8 = receiver_7 call dispatch_UnitOrBuildingOrHeroDefinition_setHitPointsMaximumBase(receiver_8, life) set receiver_9 = receiver_8 call dispatch_UnitOrBuildingOrHeroDefinition_setManaMaximum(receiver_9, mana) set receiver_10 = receiver_9 call dispatch_UnitOrBuildingOrHeroDefinition_setHitPointsRegenerationRate(receiver_10, 0.) set receiver_11 = receiver_10 call dispatch_UnitOrBuildingOrHeroDefinition_setManaRegeneration(receiver_11, 0.) set receiver_12 = receiver_11 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageBase(receiver_12, damage - 1) set receiver_13 = receiver_12 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageNumberofDice(receiver_13, 1) set receiver_14 = receiver_13 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1DamageSidesperDie(receiver_14, 1) set receiver_15 = receiver_14 call dispatch_UnitOrBuildingOrHeroDefinition_setAttacksEnabled(receiver_15, 1) set receiver_16 = receiver_15 call dispatch_UnitOrBuildingOrHeroDefinition_setDefenseBase(receiver_16, armor) set receiver_17 = receiver_16 call dispatch_UnitOrBuildingOrHeroDefinition_setAttack1CooldownTime(receiver_17, attackspeed * 0.01) set receiver_18 = receiver_17 call dispatch_UnitOrBuildingOrHeroDefinition_setSpeedBase(receiver_18, movespeed) set receiver_19 = receiver_18 call dispatch_UnitOrBuildingOrHeroDefinition_setNormalAbilities(receiver_19, "") set receiver_20 = receiver_19 call dispatch_UnitOrBuildingOrHeroDefinition_setDefaultActiveAbility(receiver_20, "") set receiver_21 = receiver_20 call dispatch_UnitOrBuildingOrHeroDefinition_setDependencyEquivalents(receiver_21, "") set receiver_22 = receiver_21 call dispatch_UnitOrBuildingOrHeroDefinition_setDefenseUpgradeBonus(receiver_22, 0) set receiver_23 = receiver_22 call dispatch_UnitDefinition_setStructuresBuilt(receiver_23, "") set receiver_24 = receiver_23 call dispatch_W3UDefinition_setRequirements(receiver_24, "") set receiver_25 = receiver_24 call dispatch_W3UDefinition_setRequirementsLevels(receiver_25, "") set receiver_26 = receiver_25 call dispatch_W3UDefinition_setDescription(receiver_26, "") set receiver_27 = receiver_26 call dispatch_UnitOrBuildingOrHeroDefinition_setNameEditorSuffix(receiver_27, "") set receiver_28 = receiver_27 call dispatch_W3UDefinition_setHotkey(receiver_28, "") set receiver_29 = receiver_28 call dispatch_W3UDefinition_setTooltipBasic(receiver_29, "") set receiver_30 = receiver_29 call dispatch_W3UDefinition_setTooltipExtended(receiver_30, "") set receiver_31 = receiver_30 call dispatch_UnitOrBuildingOrHeroDefinition_setUnitClassification(receiver_31, "") set receiver_32 = receiver_31 call dispatch_UnitOrBuildingOrHeroDefinition_setFoodCost(receiver_32, 0) set receiver_33 = receiver_32 call dispatch_UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedBase(receiver_33, 0) set receiver_34 = receiver_33 call dispatch_UnitOrBuildingOrHeroDefinition_setGoldBountyAwardedNumberofDice(receiver_34, 0) set receiver_35 = receiver_34 call dispatch_UnitOrBuildingOrHeroDefinition_setPointValue(receiver_35, 0) set receiver_36 = receiver_35 call dispatch_UnitOrBuildingOrHeroDefinition_setSleeps(receiver_36, false) set receiver_37 = receiver_36 call dispatch_UnitOrBuildingOrHeroDefinition_setSightRadiusNight(receiver_37, 700) set receiver_38 = receiver_37 call dispatch_UnitOrBuildingOrHeroDefinition_setSightRadiusDay(receiver_38, 700) set receiver_39 = receiver_38 call dispatch_UnitOrBuildingOrHeroDefinition_setRace(receiver_39, 1) set receiver_40 = receiver_39 call dispatch_UnitOrBuildingOrHeroDefinition_setCategorizationSpecial(receiver_40, false) set receiver_41 = receiver_40 call dispatch_UnitOrBuildingOrHeroDefinition_setTilesets(receiver_41, "*") endif return raw endfunction function unitgenSetStats takes nothing returns integer return UnitTypeData_unitBaseStatBuffer[UnitTypeGen_currentUnitTypeData] endfunction function initCreepTypeLists takes nothing returns nothing local integer receiver local integer receiver_2 local integer receiver_3 local integer receiver_4 local integer receiver_5 local integer receiver_6 local integer receiver_7 local integer receiver_8 local integer receiver_9 local integer receiver_10 local integer receiver_11 local integer receiver_12 local integer receiver_13 local integer receiver_14 local integer receiver_15 local integer receiver_16 call unitgenNewCreep(1747988528, 1853059184, 1, "Boar", 110, 0, 5, 0, 220, 300) set receiver = unitgenSetStats() call dispatch_UnitBaseStatBuffer_set(receiver, 15, 5) call unitgenNewCreep(1747988529, 1853320308, 2, "Wolf", 130, 0, 7, 0, 260, 290) set receiver_2 = unitgenSetStats() call dispatch_UnitBaseStatBuffer_set(receiver_2, 15, 5) set receiver_3 = receiver_2 call dispatch_UnitBaseStatBuffer_set(receiver_3, 16, 15) set receiver_4 = receiver_3 call dispatch_UnitBaseStatBuffer_set(receiver_4, 18, 4) call unitgenNewCreep(1747988530, 1853323110, 3, "Wolf", 180, 0, 7, 1, 240, 290) set receiver_5 = unitgenSetStats() call dispatch_UnitBaseStatBuffer_set(receiver_5, 15, 5) set receiver_6 = receiver_5 call dispatch_UnitBaseStatBuffer_set(receiver_6, 16, 20) set receiver_7 = receiver_6 call dispatch_UnitBaseStatBuffer_set(receiver_7, 18, 4) call unitgenNewCreep(1747988531, 1853125224, 4, "Sea Turtle", 240, 20, 11, 2, 300, 290) set receiver_8 = unitgenSetStats() call dispatch_UnitBaseStatBuffer_set(receiver_8, 15, 5) set receiver_9 = receiver_8 call dispatch_UnitBaseStatBuffer_set(receiver_9, 16, 20) set receiver_10 = receiver_9 call dispatch_UnitBaseStatBuffer_set(receiver_10, 18, 4) call unitgenNewCreep(1747988532, 1852275249, 5, "Bear", 650, 30, 14, 3, 280, 300) set receiver_11 = unitgenSetStats() call dispatch_UnitBaseStatBuffer_set(receiver_11, 15, 5) set receiver_12 = receiver_11 call dispatch_UnitBaseStatBuffer_set(receiver_12, 16, 10) set receiver_13 = receiver_12 call dispatch_UnitBaseStatBuffer_set(receiver_13, 18, 8) call unitgenNewCreep(1747988533, 1853320292, 6, "The Packleader", 1000, 40, 16, 4, 250, 300) set receiver_14 = unitgenSetStats() call dispatch_UnitBaseStatBuffer_set(receiver_14, 15, 5) set receiver_15 = receiver_14 call dispatch_UnitBaseStatBuffer_set(receiver_15, 16, 20) set receiver_16 = receiver_15 call dispatch_UnitBaseStatBuffer_set(receiver_16, 18, 3) endfunction function init_UnitTypeGen takes nothing returns nothing set UnitTypeGen_compiletimeMode = false call initCreepTypeLists() endfunction function main takes nothing returns nothing call initGlobals() call SetCameraBounds(( - 11520.0) + GetCameraMargin(CAMERA_MARGIN_LEFT), ( - 11776.0) + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 11520.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 11264.0 - GetCameraMargin(CAMERA_MARGIN_TOP), ( - 11520.0) + GetCameraMargin(CAMERA_MARGIN_LEFT), 11264.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 11520.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), ( - 11776.0) + GetCameraMargin(CAMERA_MARGIN_BOTTOM)) call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl") call NewSoundEnvironment("Default") call SetAmbientDaySound("VillageDay") call SetAmbientNightSound("VillageNight") call SetMapMusic("Music", true, 0) call CreateAllUnits() call InitBlizzard() call InitGlobals() call InitCustomTriggers() call RunInitializationTriggers() call init_String() call init_Table() call init_Trigger() call init_Player() call init_PrintingHelper() call init_MagicFunctions() call init_ErrorHandling() call init_TimerUtils() call init_Maths() call init_TempGroups() call init_Colors() call init_Rect() call init_Terrain() call init_Basics() call init_TypeCasting() call init_ObjectIds() call init_ObjectIdGenerator() call init_ChannelAbilityPreset() call init_AbilityTooltipGenerator() call init_BagObjGen() call init_Config() call init_BonusHandlerConfig() call init_BonusHandler() call init_Rational() call init_HashMap() call init_StatHandler() call init_ItemData() call init_Bag() call init_CastBar() call init_Char() call init_TestUtils() call init_CmdClear() call init_UnitIndex() call init_UnitTypeData() call init_UnitTypeGen() call init_DamageHandler() call init_ThreatHandlerConfig() call init_ThreatHandler() call init_GameTimer() call init_OOCRegen() call init_CmdStats() call init_PQuestGen() call init_PQuest() call init_CreepDrop() call init_CreepDroptable() call init_CreepExp() call init_CreepRespawn() call init_Debug() call init_Region() call init_MapBounds() call init_NewDummyRecycler() call init_DummyCaster() call init_EquipmentSlotList() call init_ItemTypeData() call init_SimError() call init_HeroTypeGen() call init_HeroInventory() call init_HeroRespawn() call init_HeropickObjectGen() call init_Talent() call init_TalentList() call init_QuestPreciousPelts() call init_QuestProvingYourWorth() call init_Heropick() call init_ItemTypeGen() call init_KnockbackHandler() call init_Learnpoints() call init_Maptest() call init_Missile() call init_QuestNPCs() call init_Recipe() call init_SpellObjectGen() call init_SpellHandler() call init_SpellCharge() call init_SpellFirearrow() call init_SpellHeal() call init_SpellHolyBolt() call init_SpellIgnoreThePain() call init_SpellRejuvenation() call init_SpellMoonlightShadow() call init_StatusHandlerConfig() call init_StatusHandler() call init_SpellNaturesWrath() call init_SpellShield() call init_SpellShieldSlam() call init_SpellSplitshot() call init_SpellTrap() call init_TalentObjectGen() endfunction function InitAllyPriorities takes nothing returns nothing call SetStartLocPrioCount(0, 3) call SetStartLocPrio(0, 0, 2, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0, 1, 3, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0, 2, 4, MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(1, 4) call SetStartLocPrio(1, 0, 0, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1, 1, 2, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1, 2, 3, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1, 3, 4, MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(2, 3) call SetStartLocPrio(2, 0, 0, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2, 1, 3, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2, 2, 4, MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(3, 3) call SetStartLocPrio(3, 0, 0, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3, 1, 2, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3, 2, 4, MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(4, 3) call SetStartLocPrio(4, 0, 0, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4, 1, 2, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4, 2, 3, MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(5, 4) call SetStartLocPrio(5, 0, 0, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5, 1, 2, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5, 2, 3, MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5, 3, 4, MAP_LOC_PRIO_HIGH) 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), false) call SetPlayerController(Player(0), MAP_CONTROL_USER) call SetPlayerStartLocation(Player(1), 1) call SetPlayerColor(Player(1), ConvertPlayerColor(1)) call SetPlayerRacePreference(Player(1), RACE_PREF_ORC) call SetPlayerRaceSelectable(Player(1), false) call SetPlayerController(Player(1), MAP_CONTROL_USER) call SetPlayerStartLocation(Player(2), 2) call SetPlayerColor(Player(2), ConvertPlayerColor(2)) call SetPlayerRacePreference(Player(2), RACE_PREF_UNDEAD) call SetPlayerRaceSelectable(Player(2), false) call SetPlayerController(Player(2), MAP_CONTROL_USER) call SetPlayerStartLocation(Player(3), 3) call SetPlayerColor(Player(3), ConvertPlayerColor(3)) call SetPlayerRacePreference(Player(3), RACE_PREF_NIGHTELF) call SetPlayerRaceSelectable(Player(3), false) call SetPlayerController(Player(3), MAP_CONTROL_USER) call SetPlayerStartLocation(Player(4), 4) call SetPlayerColor(Player(4), ConvertPlayerColor(4)) call SetPlayerRacePreference(Player(4), RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(4), false) call SetPlayerController(Player(4), MAP_CONTROL_USER) call SetPlayerStartLocation(Player(5), 5) call SetPlayerColor(Player(5), ConvertPlayerColor(5)) call SetPlayerRacePreference(Player(5), RACE_PREF_ORC) call SetPlayerRaceSelectable(Player(5), false) call SetPlayerController(Player(5), MAP_CONTROL_COMPUTER) endfunction function InitCustomTeams takes nothing returns nothing call SetPlayerTeam(Player(0), 0) call SetPlayerTeam(Player(1), 0) call SetPlayerTeam(Player(2), 0) call SetPlayerTeam(Player(3), 0) call SetPlayerTeam(Player(4), 0) call SetPlayerAllianceStateAllyBJ(Player(0), Player(1), true) call SetPlayerAllianceStateAllyBJ(Player(0), Player(2), true) call SetPlayerAllianceStateAllyBJ(Player(0), Player(3), true) call SetPlayerAllianceStateAllyBJ(Player(0), Player(4), true) call SetPlayerAllianceStateAllyBJ(Player(1), Player(0), true) call SetPlayerAllianceStateAllyBJ(Player(1), Player(2), true) call SetPlayerAllianceStateAllyBJ(Player(1), Player(3), true) call SetPlayerAllianceStateAllyBJ(Player(1), Player(4), true) call SetPlayerAllianceStateAllyBJ(Player(2), Player(0), true) call SetPlayerAllianceStateAllyBJ(Player(2), Player(1), true) call SetPlayerAllianceStateAllyBJ(Player(2), Player(3), true) call SetPlayerAllianceStateAllyBJ(Player(2), Player(4), true) call SetPlayerAllianceStateAllyBJ(Player(3), Player(0), true) call SetPlayerAllianceStateAllyBJ(Player(3), Player(1), true) call SetPlayerAllianceStateAllyBJ(Player(3), Player(2), true) call SetPlayerAllianceStateAllyBJ(Player(3), Player(4), true) call SetPlayerAllianceStateAllyBJ(Player(4), Player(0), true) call SetPlayerAllianceStateAllyBJ(Player(4), Player(1), true) call SetPlayerAllianceStateAllyBJ(Player(4), Player(2), true) call SetPlayerAllianceStateAllyBJ(Player(4), Player(3), true) call SetPlayerAllianceStateVisionBJ(Player(0), Player(1), true) call SetPlayerAllianceStateVisionBJ(Player(0), Player(2), true) call SetPlayerAllianceStateVisionBJ(Player(0), Player(3), true) call SetPlayerAllianceStateVisionBJ(Player(0), Player(4), true) call SetPlayerAllianceStateVisionBJ(Player(1), Player(0), true) call SetPlayerAllianceStateVisionBJ(Player(1), Player(2), true) call SetPlayerAllianceStateVisionBJ(Player(1), Player(3), true) call SetPlayerAllianceStateVisionBJ(Player(1), Player(4), true) call SetPlayerAllianceStateVisionBJ(Player(2), Player(0), true) call SetPlayerAllianceStateVisionBJ(Player(2), Player(1), true) call SetPlayerAllianceStateVisionBJ(Player(2), Player(3), true) call SetPlayerAllianceStateVisionBJ(Player(2), Player(4), true) call SetPlayerAllianceStateVisionBJ(Player(3), Player(0), true) call SetPlayerAllianceStateVisionBJ(Player(3), Player(1), true) call SetPlayerAllianceStateVisionBJ(Player(3), Player(2), true) call SetPlayerAllianceStateVisionBJ(Player(3), Player(4), true) call SetPlayerAllianceStateVisionBJ(Player(4), Player(0), true) call SetPlayerAllianceStateVisionBJ(Player(4), Player(1), true) call SetPlayerAllianceStateVisionBJ(Player(4), Player(2), true) call SetPlayerAllianceStateVisionBJ(Player(4), Player(3), true) call SetPlayerTeam(Player(5), 1) endfunction function config takes nothing returns nothing call SetMapName("TRIGSTR_001") call SetMapDescription("") call SetPlayers(6) call SetTeams(6) call SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER) call DefineStartLocation(0, 12032.0, - 12032.0) call DefineStartLocation(1, 11904.0, - 11968.0) call DefineStartLocation(2, 12032.0, - 12032.0) call DefineStartLocation(3, 12032.0, - 12032.0) call DefineStartLocation(4, 12032.0, - 12032.0) call DefineStartLocation(5, 12032.0, - 12032.0) call InitCustomPlayerSlots() call InitCustomTeams() call InitAllyPriorities() endfunction