diff --git a/wowr.w3x/war3map.imp b/wowr.w3x/war3map.imp index 0aba4d30..7c418f0d 100644 Binary files a/wowr.w3x/war3map.imp and b/wowr.w3x/war3map.imp differ diff --git a/wowr.w3x/war3map.j b/wowr.w3x/war3map.j index f539a38d..12b7a65a 100644 --- a/wowr.w3x/war3map.j +++ b/wowr.w3x/war3map.j @@ -110,7 +110,7 @@ constant boolean LIBRARY_Corpse=true constant integer Corpse_ABILITY_ID= 'A1NL' constant integer Corpse_ABILITY_ID_ITEM= 'A1M0' -trigger Corpse___castTrigger= CreateTrigger() +trigger Corpse__castTrigger= CreateTrigger() //endglobals from Corpse //globals from Corruption: constant boolean LIBRARY_Corruption=true @@ -191,9 +191,9 @@ timer FloatingTextArc__TMR= CreateTimer() //endglobals from FloatingTextArc //globals from ForceUtils: constant boolean LIBRARY_ForceUtils=true -force ForceUtils___allPlayingUsers= CreateForce() -integer ForceUtils___allPlayingUsersCounter= 0 -trigger ForceUtils___leaveTrigger= CreateTrigger() +force ForceUtils__allPlayingUsers= CreateForce() +integer ForceUtils__allPlayingUsersCounter= 0 +trigger ForceUtils__leaveTrigger= CreateTrigger() //endglobals from ForceUtils //globals from FrameLoader: constant boolean LIBRARY_FrameLoader=true @@ -263,15 +263,15 @@ constant boolean LIBRARY_HeroReviveCancelEvent=true //globals from HeroUtils: constant boolean LIBRARY_HeroUtils=true constant integer HeroUtils_TOME_OF_RETRAINING= 'I0A7' -trigger array HeroUtils___unskillTrigger -integer HeroUtils___unskillTriggerCounter= 0 -unit HeroUtils___unskilledHero= null -hashtable HeroUtils___h= InitHashtable() -trigger HeroUtils___levelTrigger= CreateTrigger() +trigger array HeroUtils__unskillTrigger +integer HeroUtils__unskillTriggerCounter= 0 +unit HeroUtils__unskilledHero= null +hashtable HeroUtils__h= InitHashtable() +trigger HeroUtils__levelTrigger= CreateTrigger() //endglobals from HeroUtils //globals from HostUtils: constant boolean LIBRARY_HostUtils=true -player HostUtils___Host= null +player HostUtils__Host= null //endglobals from HostUtils //globals from IdleWorkersSystem: constant boolean LIBRARY_IdleWorkersSystem=true @@ -347,22 +347,22 @@ trigger ItemRespawnSystem__refreshEvaluateTrigger= CreateTrigger() //globals from ItemTypeUtils: constant boolean LIBRARY_ItemTypeUtils=true // Barade: Cache all the values for better performance. -hashtable ItemTypeUtils___h= InitHashtable() +hashtable ItemTypeUtils__h= InitHashtable() -constant integer ItemTypeUtils___SHOP= 'ngme' -constant integer ItemTypeUtils___SELL_UNIT= ITEM_VALUES_DUMMY_HERO +constant integer ItemTypeUtils__SHOP= 'ngme' +constant integer ItemTypeUtils__SELL_UNIT= ITEM_VALUES_DUMMY_HERO -constant integer ItemTypeUtils___KEY_VALUE_GOLD= 0 -constant integer ItemTypeUtils___KEY_VALUE_LUMBER= 1 -constant integer ItemTypeUtils___KEY_PERISHABLE= 2 -constant integer ItemTypeUtils___KEY_MODEL= 3 -constant integer ItemTypeUtils___KEY_ICON= 4 +constant integer ItemTypeUtils__KEY_VALUE_GOLD= 0 +constant integer ItemTypeUtils__KEY_VALUE_LUMBER= 1 +constant integer ItemTypeUtils__KEY_PERISHABLE= 2 +constant integer ItemTypeUtils__KEY_MODEL= 3 +constant integer ItemTypeUtils__KEY_ICON= 4 //endglobals from ItemTypeUtils //globals from ItemUtils: constant boolean LIBRARY_ItemUtils=true -filterfunc ItemUtils___filterIsItemOfType -integer ItemUtils___filterItemTypeId= 0 -integer ItemUtils___countFilteredItems= 0 +filterfunc ItemUtils__filterIsItemOfType +integer ItemUtils__filterItemTypeId= 0 +integer ItemUtils__countFilteredItems= 0 //endglobals from ItemUtils //globals from LineSegmentEnumeration: constant boolean LIBRARY_LineSegmentEnumeration=true @@ -415,16 +415,16 @@ constant boolean LIBRARY_PlayerUtils=true //endglobals from PlayerUtils //globals from QuestUtils: constant boolean LIBRARY_QuestUtils=true -hashtable QuestUtils___h= InitHashtable() -constant integer QuestUtils___KEY_TITLE= 0 -constant integer QuestUtils___KEY_DESCRIPTION= 1 -constant integer QuestUtils___KEY_COUNTER= 2 +hashtable QuestUtils__h= InitHashtable() +constant integer QuestUtils__KEY_TITLE= 0 +constant integer QuestUtils__KEY_DESCRIPTION= 1 +constant integer QuestUtils__KEY_COUNTER= 2 //endglobals from QuestUtils //globals from QueueUIConfig: constant boolean LIBRARY_QueueUIConfig=true -hashtable QueueUIConfig___h= InitHashtable() -constant integer QueueUIConfig___KEY_LEVELS= 0 -constant integer QueueUIConfig___KEY_LEVEL_1= 1 +hashtable QueueUIConfig__h= InitHashtable() +constant integer QueueUIConfig__KEY_LEVELS= 0 +constant integer QueueUIConfig__KEY_LEVEL_1= 1 //endglobals from QueueUIConfig //globals from Reflection: constant boolean LIBRARY_Reflection=true @@ -457,8 +457,8 @@ integer Table__more= 8190 //Configure it if you use more than 8190 "key" variables in your map (this will never happen though). hashtable Table__ht= InitHashtable() -constant integer Table__sizeK=4 -constant integer Table__listK=6 +constant integer Table__sizeK=2 +constant integer Table__listK=3 //endglobals from Table //globals from TerrainPathability: constant boolean LIBRARY_TerrainPathability=true @@ -473,10 +473,10 @@ real TerrainPathability_Y= 0. //endglobals from TerrainPathability //globals from TextTagUtils: constant boolean LIBRARY_TextTagUtils=true -texttag TextTagUtils___enumTextTag= null -texttag array TextTagUtils___allTextTags -integer TextTagUtils___allTextTagsCounter= 0 -hashtable TextTagUtils___h= InitHashtable() +texttag TextTagUtils__enumTextTag= null +texttag array TextTagUtils__allTextTags +integer TextTagUtils__allTextTagsCounter= 0 +hashtable TextTagUtils__h= InitHashtable() //endglobals from TextTagUtils //globals from TimerUtils: constant boolean LIBRARY_TimerUtils=true @@ -559,18 +559,18 @@ constant boolean TURRET_SYSTEM_APPLY_MOVEMENT_SETTINGS= true //endglobals from TurretSystemConfig //globals from UnitTypeUtils: constant boolean LIBRARY_UnitTypeUtils=true -constant integer UnitTypeUtils___KEY_LEVEL= 0 -constant integer UnitTypeUtils___KEY_DEFENSE= 1 -constant integer UnitTypeUtils___KEY_DAMAGE_TYPE= 2 -constant integer UnitTypeUtils___KEY_DEFENSE_TYPE= 3 -constant integer UnitTypeUtils___KEY_MOVE_TYPE= 4 -constant integer UnitTypeUtils___MAX_KEYS= 5 - -real UnitTypeUtils___X= 0.0 -real UnitTypeUtils___Y= 0.0 -trigger UnitTypeUtils___researchTrigger= CreateTrigger() -trigger UnitTypeUtils___changeOwnerTrigger= CreateTrigger() -hashtable UnitTypeUtils___cache= InitHashtable() +constant integer UnitTypeUtils__KEY_LEVEL= 0 +constant integer UnitTypeUtils__KEY_DEFENSE= 1 +constant integer UnitTypeUtils__KEY_DAMAGE_TYPE= 2 +constant integer UnitTypeUtils__KEY_DEFENSE_TYPE= 3 +constant integer UnitTypeUtils__KEY_MOVE_TYPE= 4 +constant integer UnitTypeUtils__MAX_KEYS= 5 + +real UnitTypeUtils__X= 0.0 +real UnitTypeUtils__Y= 0.0 +trigger UnitTypeUtils__researchTrigger= CreateTrigger() +trigger UnitTypeUtils__changeOwnerTrigger= CreateTrigger() +hashtable UnitTypeUtils__cache= InitHashtable() //endglobals from UnitTypeUtils //globals from Villager255: constant boolean LIBRARY_Villager255=true @@ -617,7 +617,7 @@ constant integer DUNGEON_WHITE_FOG_LIGHT= 'FDwl' //endglobals from WeatherEffectUtils //globals from WoWErforgedRecordPlayer: constant boolean LIBRARY_WoWErforgedRecordPlayer=true -hashtable WoWErforgedRecordPlayer__h= InitHashtable() +hashtable WoWErforgedRecordPlayer___h= InitHashtable() //endglobals from WoWErforgedRecordPlayer //globals from WoWReforgedAbilityFields: constant boolean LIBRARY_WoWReforgedAbilityFields=true @@ -642,22 +642,22 @@ constant integer ABILITY_FIELD_TYPE_MANA_INTEGER= 111 //endglobals from WoWReforgedAbilityFields //globals from WoWReforgedBarrage: constant boolean LIBRARY_WoWReforgedBarrage=true -trigger WoWReforgedBarrage__learnTrigger= CreateTrigger() +trigger WoWReforgedBarrage___learnTrigger= CreateTrigger() //endglobals from WoWReforgedBarrage //globals from WoWReforgedCages: constant boolean LIBRARY_WoWReforgedCages=true -trigger WoWReforgedCages__deathTrigger= CreateTrigger() +trigger WoWReforgedCages___deathTrigger= CreateTrigger() //endglobals from WoWReforgedCages //globals from WoWReforgedCalendarEvents: constant boolean LIBRARY_WoWReforgedCalendarEvents=true //endglobals from WoWReforgedCalendarEvents //globals from WoWReforgedCarHorn: constant boolean LIBRARY_WoWReforgedCarHorn=true -constant integer WoWReforgedCarHorn__ABILITY_ID= 'A23N' -sound array WoWReforgedCarHorn__hornSound -integer WoWReforgedCarHorn__hornSoundCounter= 0 +constant integer WoWReforgedCarHorn___ABILITY_ID= 'A23N' +sound array WoWReforgedCarHorn___hornSound +integer WoWReforgedCarHorn___hornSoundCounter= 0 -trigger WoWReforgedCarHorn__castTrigger= CreateTrigger() +trigger WoWReforgedCarHorn___castTrigger= CreateTrigger() //endglobals from WoWReforgedCarHorn //globals from WoWReforgedCommandButtons: constant boolean LIBRARY_WoWReforgedCommandButtons=true @@ -665,14 +665,14 @@ constant integer ABILITY_ID_COMMAND_BUTTONS= 'A1X3' //endglobals from WoWReforgedCommandButtons //globals from WoWReforgedDalaranShields: constant boolean LIBRARY_WoWReforgedDalaranShields=true -hashtable WoWReforgedDalaranShields__h= InitHashtable() -weathereffect array WoWReforgedDalaranShields__shieldWeatherEffects -integer WoWReforgedDalaranShields__shieldWeatherEffectsCounter= 1 -group WoWReforgedDalaranShields__powerGenerators= CreateGroup() +hashtable WoWReforgedDalaranShields___h= InitHashtable() +weathereffect array WoWReforgedDalaranShields___shieldWeatherEffects +integer WoWReforgedDalaranShields___shieldWeatherEffectsCounter= 1 +group WoWReforgedDalaranShields___powerGenerators= CreateGroup() //endglobals from WoWReforgedDalaranShields //globals from WoWReforgedDependencyEquivalents: constant boolean LIBRARY_WoWReforgedDependencyEquivalents=true -hashtable WoWReforgedDependencyEquivalents___h= InitHashtable() +hashtable WoWReforgedDependencyEquivalents__h= InitHashtable() //endglobals from WoWReforgedDependencyEquivalents //globals from WoWReforgedDischarge: constant boolean LIBRARY_WoWReforgedDischarge=true @@ -684,15 +684,15 @@ constant integer ELEVATOR_DESTRUCTABLE= 'DTrx' constant integer ELEVATOR_RAISE= 'o07F' constant integer ELEVATOR_LOWER= 'o07G' -trigger WoWReforgedElevator__constructionTrigger= CreateTrigger() -trigger WoWReforgedElevator__sellTrigger= CreateTrigger() -trigger WoWReforgedElevator__deathTrigger= CreateTrigger() -hashtable WoWReforgedElevator__h= InitHashtable() +trigger WoWReforgedElevator___constructionTrigger= CreateTrigger() +trigger WoWReforgedElevator___sellTrigger= CreateTrigger() +trigger WoWReforgedElevator___deathTrigger= CreateTrigger() +hashtable WoWReforgedElevator___h= InitHashtable() //endglobals from WoWReforgedElevator //globals from WoWReforgedFarmer: constant boolean LIBRARY_WoWReforgedFarmer=true -filterfunc WoWReforgedFarmer__f -player WoWReforgedFarmer__owner +filterfunc WoWReforgedFarmer___f +player WoWReforgedFarmer___owner //endglobals from WoWReforgedFarmer //globals from WoWReforgedFelOrcDemonGate: constant boolean LIBRARY_WoWReforgedFelOrcDemonGate=true @@ -703,10 +703,10 @@ constant integer WoWReforgedFelOrcDemonGate_DOOM_GUARD= 'n0KZ' constant integer WoWReforgedFelOrcDemonGate_FEL_STALKER= 'n0L1' constant integer WoWReforgedFelOrcDemonGate_INFERNAL= 'n0L0' -integer array WoWReforgedFelOrcDemonGate__playerKillsCounter -trigger WoWReforgedFelOrcDemonGate__constructedTrigger= CreateTrigger() -trigger WoWReforgedFelOrcDemonGate__deathTrigger= CreateTrigger() -group WoWReforgedFelOrcDemonGate__gates= CreateGroup() +integer array WoWReforgedFelOrcDemonGate___playerKillsCounter +trigger WoWReforgedFelOrcDemonGate___constructedTrigger= CreateTrigger() +trigger WoWReforgedFelOrcDemonGate___deathTrigger= CreateTrigger() +group WoWReforgedFelOrcDemonGate___gates= CreateGroup() //endglobals from WoWReforgedFelOrcDemonGate //globals from WoWReforgedFlamethrower: constant boolean LIBRARY_WoWReforgedFlamethrower=true @@ -724,31 +724,31 @@ constant real WoWReforgedFlamethrower_DISTANCE= 270.0 constant real WoWReforgedFlamethrower_DURATION= 0.05 constant real WoWReforgedFlamethrower_SUMMON_DURATION= 2.0 -group WoWReforgedFlamethrower__casters= CreateGroup() -group WoWReforgedFlamethrower__heroCasters= CreateGroup() -timer WoWReforgedFlamethrower__t= CreateTimer() -boolean WoWReforgedFlamethrower__timerOff= true -effect array WoWReforgedFlamethrower__effects -integer WoWReforgedFlamethrower__effectsCounter= 0 +group WoWReforgedFlamethrower___casters= CreateGroup() +group WoWReforgedFlamethrower___heroCasters= CreateGroup() +timer WoWReforgedFlamethrower___t= CreateTimer() +boolean WoWReforgedFlamethrower___timerOff= true +effect array WoWReforgedFlamethrower___effects +integer WoWReforgedFlamethrower___effectsCounter= 0 //endglobals from WoWReforgedFlamethrower //globals from WoWReforgedGaia: constant boolean LIBRARY_WoWReforgedGaia=true -trigger WoWReforgedGaia__updateFoodTriger= CreateTrigger() +trigger WoWReforgedGaia___updateFoodTriger= CreateTrigger() -player WoWReforgedGaia__tmpPlayer= null +player WoWReforgedGaia___tmpPlayer= null //endglobals from WoWReforgedGaia //globals from WoWReforgedHunter: constant boolean LIBRARY_WoWReforgedHunter=true -filterfunc WoWReforgedHunter__filterIsCritterWithTrophy= null +filterfunc WoWReforgedHunter___filterIsCritterWithTrophy= null -integer array WoWReforgedHunter__trophyUnitTypeIds -integer array WoWReforgedHunter__trophyItemTypeIds -integer WoWReforgedHunter__trophyCounter= 0 +integer array WoWReforgedHunter___trophyUnitTypeIds +integer array WoWReforgedHunter___trophyItemTypeIds +integer WoWReforgedHunter___trophyCounter= 0 //endglobals from WoWReforgedHunter //globals from WoWReforgedIcons: constant boolean LIBRARY_WoWReforgedIcons=true -string array WoWReforgedIcons__raceIcons -string array WoWReforgedIcons__professionIcons +string array WoWReforgedIcons___raceIcons +string array WoWReforgedIcons___professionIcons //endglobals from WoWReforgedIcons //globals from WoWReforgedMapData: constant boolean LIBRARY_WoWReforgedMapData=true @@ -758,12 +758,12 @@ constant boolean LIBRARY_WoWReforgedMarketplace=true //endglobals from WoWReforgedMarketplace //globals from WoWReforgedObjectMappings: constant boolean LIBRARY_WoWReforgedObjectMappings=true -hashtable WoWReforgedObjectMappings___h= InitHashtable() +hashtable WoWReforgedObjectMappings__h= InitHashtable() //endglobals from WoWReforgedObjectMappings //globals from WoWReforgedRandomArtifacts: constant boolean LIBRARY_WoWReforgedRandomArtifacts=true -integer array WoWReforgedRandomArtifacts__abilityIds -integer WoWReforgedRandomArtifacts__abilityIdsCounter= 0 +integer array WoWReforgedRandomArtifacts___abilityIds +integer WoWReforgedRandomArtifacts___abilityIdsCounter= 0 //endglobals from WoWReforgedRandomArtifacts //globals from WoWReforgedSleepingBag: constant boolean LIBRARY_WoWReforgedSleepingBag=true @@ -792,8 +792,8 @@ constant boolean LIBRARY_WoWReforgedTinker=true //endglobals from WoWReforgedTinker //globals from WoWReforgedUnlimitedBagOfFood: constant boolean LIBRARY_WoWReforgedUnlimitedBagOfFood=true -integer array WoWReforgedUnlimitedBagOfFood__ids -integer WoWReforgedUnlimitedBagOfFood__counter= 0 +integer array WoWReforgedUnlimitedBagOfFood___ids +integer WoWReforgedUnlimitedBagOfFood___counter= 0 //endglobals from WoWReforgedUnlimitedBagOfFood //globals from WoWReforgedUpdateBackpackUIEvaluate: constant boolean LIBRARY_WoWReforgedUpdateBackpackUIEvaluate=true @@ -832,7 +832,7 @@ constant boolean LIBRARY_WorldBounds=true constant boolean LIBRARY_Challenge=true constant integer Challenge_ABILITY_ID= 'A1NO' -trigger Challenge___castTrigger= CreateTrigger() +trigger Challenge__castTrigger= CreateTrigger() //endglobals from Challenge //globals from CooldownReduction: constant boolean LIBRARY_CooldownReduction=true @@ -855,7 +855,7 @@ constant boolean LIBRARY_Decay=true constant integer Decay_ABILITY_ID= 'A1BP' constant integer Decay_ABILITY_ID_ITEM= 'A1BR' -trigger Decay___castTrigger= CreateTrigger() +trigger Decay__castTrigger= CreateTrigger() //endglobals from Decay //globals from DiplomacyUIConfig: constant boolean LIBRARY_DiplomacyUIConfig=true @@ -864,40 +864,40 @@ constant boolean LIBRARY_DiplomacyUIConfig=true constant boolean LIBRARY_ForestWord=true constant integer ForestWord_ABILITY_ID= 'A1SY' -integer ForestWord___tmpCounter= 0 -unit ForestWord___tmpCaster= null +integer ForestWord__tmpCounter= 0 +unit ForestWord__tmpCaster= null -trigger ForestWord___castTrigger= CreateTrigger() +trigger ForestWord__castTrigger= CreateTrigger() //endglobals from ForestWord //globals from FormatTimeUtils: constant boolean LIBRARY_FormatTimeUtils=true //endglobals from FormatTimeUtils //globals from HeroAbilitySystem: constant boolean LIBRARY_HeroAbilitySystem=true -hashtable HeroAbilitySystem___HeroAbilitiesHashTable= InitHashtable() -hashtable HeroAbilitySystem___HeroAbilitiesMaximumLevelHashTable= InitHashtable() +hashtable HeroAbilitySystem__HeroAbilitiesHashTable= InitHashtable() +hashtable HeroAbilitySystem__HeroAbilitiesMaximumLevelHashTable= InitHashtable() //endglobals from HeroAbilitySystem //globals from HeroReviveEvents: constant boolean LIBRARY_HeroReviveEvents=true constant integer HeroReviveEvents_ORDER_ID_START_REVIVE= 852027 constant integer HeroReviveEvents_ORDER_ID_REVIVE= 852039 -trigger HeroReviveEvents___orderTrigger= CreateTrigger() -trigger HeroReviveEvents___startReviveTrigger= CreateTrigger() -trigger HeroReviveEvents___finishReviveTrigger= CreateTrigger() -group HeroReviveEvents___heroes= CreateGroup() -hashtable HeroReviveEvents___h= InitHashtable() +trigger HeroReviveEvents__orderTrigger= CreateTrigger() +trigger HeroReviveEvents__startReviveTrigger= CreateTrigger() +trigger HeroReviveEvents__finishReviveTrigger= CreateTrigger() +group HeroReviveEvents__heroes= CreateGroup() +hashtable HeroReviveEvents__h= InitHashtable() -trigger array HeroReviveEvents___callbackOrderStartReviveTriggers -integer HeroReviveEvents___callbackStartOrderStartTriggersCounter= 0 -trigger array HeroReviveEvents___callbackOrderCancelReviveTriggers -integer HeroReviveEvents___callbackStartOrderCancelTriggersCounter= 0 -trigger array HeroReviveEvents___callbackStartReviveTriggers -integer HeroReviveEvents___callbackStartReviveTriggersCounter= 0 -trigger array HeroReviveEvents___callbackFinishReviveTriggers -integer HeroReviveEvents___callbackFinishReviveTriggersCounter= 0 -unit HeroReviveEvents___triggerReviveAltar= null -unit HeroReviveEvents___triggerReviveHero= null +trigger array HeroReviveEvents__callbackOrderStartReviveTriggers +integer HeroReviveEvents__callbackStartOrderStartTriggersCounter= 0 +trigger array HeroReviveEvents__callbackOrderCancelReviveTriggers +integer HeroReviveEvents__callbackStartOrderCancelTriggersCounter= 0 +trigger array HeroReviveEvents__callbackStartReviveTriggers +integer HeroReviveEvents__callbackStartReviveTriggersCounter= 0 +trigger array HeroReviveEvents__callbackFinishReviveTriggers +integer HeroReviveEvents__callbackFinishReviveTriggersCounter= 0 +unit HeroReviveEvents__triggerReviveAltar= null +unit HeroReviveEvents__triggerReviveHero= null //endglobals from HeroReviveEvents //globals from ItemUnstackSystem: constant boolean LIBRARY_ItemUnstackSystem=true @@ -918,27 +918,27 @@ group ItemUnstackSystem__disabledUnits= CreateGroup() //globals from Jump: constant boolean LIBRARY_Jump=true // Tolerance distance for pathability -constant real Jump___TOL= 1 +constant real Jump__TOL= 1 // Minimum flying heigh for colliding with units. If set to 0 then won't collide with units. -constant real Jump___U_COL_Z= 96 +constant real Jump__U_COL_Z= 96 // Collision distance with units. Uses this if GetUnitCollision library is not used -constant real Jump___U_COL_D= 96 +constant real Jump__U_COL_D= 96 // Collision distance with destructables. If set to 0 then won't collide with destructables. -constant real Jump___D_COL_D= 96 +constant real Jump__D_COL_D= 96 // Maximum collision radius of units in the map. 196 for tier 3 Town Halls etc. -constant real Jump___MAX_RAD= 196 +constant real Jump__MAX_RAD= 196 // Moves the unit to nearest pathable point when landing -constant boolean Jump___PATHING_LAND= false +constant boolean Jump__PATHING_LAND= false // Is the turn speed locked when jumping -constant boolean Jump___LOCK_FACING= true +constant boolean Jump__LOCK_FACING= true -rect Jump___rct= Rect(0, 0, 0, 0) -group Jump___enu= CreateGroup() -location Jump___loc= Location(0, 0) +rect Jump__rct= Rect(0, 0, 0, 0) +group Jump__enu= CreateGroup() +location Jump__loc= Location(0, 0) real EVENT_JUMP_FINISH= 0 unit EVENT_JUMP_UNIT= null -real Jump___flh= 0 -boolean Jump___b= false +real Jump__flh= 0 +boolean Jump__b= false //endglobals from Jump //globals from Knockback: constant boolean LIBRARY_Knockback=true @@ -961,18 +961,18 @@ constant boolean LIBRARY_MassSpell=true constant integer MassSpell_DUMMY_UNIT_TYPE_ID= 'h0PY' constant real MassSpell_DUMMY_REMOVAL_DELAY= 4.00 -hashtable MassSpell___h= InitHashtable() -trigger MassSpell___channelTrigger= CreateTrigger() +hashtable MassSpell__h= InitHashtable() +trigger MassSpell__channelTrigger= CreateTrigger() -unit MassSpell___filterCaster= null -integer MassSpell___filterAbilityId= 0 +unit MassSpell__filterCaster= null +integer MassSpell__filterAbilityId= 0 //endglobals from MassSpell //globals from MindControl: constant boolean LIBRARY_MindControl=true constant integer MindControl_ABILITY_ID= 'A22T' -trigger MindControl___castTrigger= CreateTrigger() -hashtable MindControl___h= InitHashtable() -force MindControl___notAllowedPlayers= CreateForce() +trigger MindControl__castTrigger= CreateTrigger() +hashtable MindControl__h= InitHashtable() +force MindControl__notAllowedPlayers= CreateForce() //endglobals from MindControl //globals from MissileEffect: constant boolean LIBRARY_MissileEffect=true @@ -1049,7 +1049,7 @@ trigger NewsUI___chatCommandTrigger= CreateTrigger() //endglobals from NewsUI //globals from ObjectDataFields: constant boolean LIBRARY_ObjectDataFields=true -hashtable ObjectDataFields___h= InitHashtable() +hashtable ObjectDataFields__h= InitHashtable() // Additional fields: //constant integer OBJECT_DATA_FIELD_UMKI = 'umki' // Makeitems @@ -1066,11 +1066,11 @@ constant integer OBJECT_DATA_FIELD_UCAM= 'ucam' //endglobals from ObjectDataFields //globals from PagedButtonsConfig: constant boolean LIBRARY_PagedButtonsConfig=true -hashtable PagedButtonsConfig___h= InitHashtable() +hashtable PagedButtonsConfig__h= InitHashtable() //endglobals from PagedButtonsConfig //globals from PlayerColorUtils: constant boolean LIBRARY_PlayerColorUtils=true -string array PlayerColorUtils___PlayerColorNames +string array PlayerColorUtils__PlayerColorNames //endglobals from PlayerColorUtils //globals from PluginSpellEffect: constant boolean LIBRARY_PluginSpellEffect=true @@ -1079,8 +1079,8 @@ constant boolean LIBRARY_PluginSpellEffect=true constant boolean LIBRARY_ReduceFood=true constant integer ReduceFood_BUFF_ABILITY_ID= 'A154' -hashtable ReduceFood___h= InitHashtable() -group ReduceFood___targets= CreateGroup() +hashtable ReduceFood__h= InitHashtable() +group ReduceFood__targets= CreateGroup() //endglobals from ReduceFood //globals from RegisterNativeEvent: constant boolean LIBRARY_RegisterNativeEvent=true @@ -1168,8 +1168,8 @@ constant boolean LIBRARY_StringAdvanced=true constant boolean LIBRARY_Stupidity=true constant integer Stupidity_BUFF_ABILITY_ID= 'A16X' -hashtable Stupidity___h= InitHashtable() -group Stupidity___targets= CreateGroup() +hashtable Stupidity__h= InitHashtable() +group Stupidity__targets= CreateGroup() //endglobals from Stupidity //globals from Tenacity: constant boolean LIBRARY_Tenacity=true @@ -1257,10 +1257,10 @@ constant integer EVENT_UNIT_INDEX= 0 constant integer EVENT_UNIT_DEINDEX= 1 // System variables -trigger array UnitDex___IndexTrig -integer UnitDex___Index= 0 -real UnitDex___E=- 1 -boolexpr UnitDex___FilterEnter +trigger array UnitDex__IndexTrig +integer UnitDex__Index= 0 +real UnitDex__E=- 1 +boolexpr UnitDex__FilterEnter //endglobals from UnitDex //globals from UnitGroupRespawnSystemConfig: constant boolean LIBRARY_UnitGroupRespawnSystemConfig=true @@ -1283,40 +1283,40 @@ constant boolean UnitGroupRespawnSystemConfig_AUTO_ADDED_DROP_RANDOM_ITEMS= true constant boolean UnitGroupRespawnSystemConfig_GET_UNIT_LEVEL_BY_TYPE= true // Caches the unit levels for unit types. -hashtable UnitGroupRespawnSystemConfig___respawnUnitLevelsHashTable= InitHashtable() +hashtable UnitGroupRespawnSystemConfig__respawnUnitLevelsHashTable= InitHashtable() //endglobals from UnitGroupRespawnSystemConfig //globals from WaterGround: constant boolean LIBRARY_WaterGround=true //endglobals from WaterGround //globals from WoWReforgedAccount: constant boolean LIBRARY_WoWReforgedAccount=true -integer array WoWReforgedAccount__playerAccount +integer array WoWReforgedAccount___playerAccount -integer array WoWReforgedAccount__accounts -integer WoWReforgedAccount__accountsCounter= 0 +integer array WoWReforgedAccount___accounts +integer WoWReforgedAccount___accountsCounter= 0 -hashtable WoWReforgedAccount__h= InitHashtable() +hashtable WoWReforgedAccount___h= InitHashtable() //endglobals from WoWReforgedAccount //globals from WoWReforgedAttributes: constant boolean LIBRARY_WoWReforgedAttributes=true //endglobals from WoWReforgedAttributes //globals from WoWReforgedBan: constant boolean LIBRARY_WoWReforgedBan=true -integer WoWReforgedBan__banCount= 0 -string array WoWReforgedBan__bans -string array WoWReforgedBan__bansReasons +integer WoWReforgedBan___banCount= 0 +string array WoWReforgedBan___bans +string array WoWReforgedBan___bansReasons //endglobals from WoWReforgedBan //globals from WoWReforgedCombiner: constant boolean LIBRARY_WoWReforgedCombiner=true -constant integer WoWReforgedCombiner___ABILITY_ID_INSPECT= 'A1OC' -constant integer WoWReforgedCombiner___ABILITY_ID_MARK_1= 'A1OD' -constant integer WoWReforgedCombiner___ABILITY_ID_MARK_2= 'A1OE' -constant integer WoWReforgedCombiner___ABILITY_ID_MARK_3= 'A1OF' -constant integer WoWReforgedCombiner___ABILITY_ID_MARK_4= 'A1OG' -constant integer WoWReforgedCombiner___ABILITY_ID_TRANSFER= 'A1OH' - -hashtable WoWReforgedCombiner___h= InitHashtable() -trigger WoWReforgedCombiner___castTrigger= CreateTrigger() +constant integer WoWReforgedCombiner__ABILITY_ID_INSPECT= 'A1OC' +constant integer WoWReforgedCombiner__ABILITY_ID_MARK_1= 'A1OD' +constant integer WoWReforgedCombiner__ABILITY_ID_MARK_2= 'A1OE' +constant integer WoWReforgedCombiner__ABILITY_ID_MARK_3= 'A1OF' +constant integer WoWReforgedCombiner__ABILITY_ID_MARK_4= 'A1OG' +constant integer WoWReforgedCombiner__ABILITY_ID_TRANSFER= 'A1OH' + +hashtable WoWReforgedCombiner__h= InitHashtable() +trigger WoWReforgedCombiner__castTrigger= CreateTrigger() //endglobals from WoWReforgedCombiner //globals from WoWReforgedCredits: constant boolean LIBRARY_WoWReforgedCredits=true @@ -1332,12 +1332,12 @@ constant integer WoWReforgedFel_ITEM_ABILITY_ID= 'A1WS' constant integer WoWReforgedFel_UNIT_ABILITY_ID= 'A11K' constant integer WoWReforgedFel_ATTACK_TYPE_CHAOS_VALUE= 5 -unit WoWReforgedFel__tmpCaster= null -real WoWReforgedFel__tmpDuration= 0.0 +unit WoWReforgedFel___tmpCaster= null +real WoWReforgedFel___tmpDuration= 0.0 -trigger WoWReforgedFel__castTrigger= CreateTrigger() -hashtable WoWReforgedFel__h= InitHashtable() -group WoWReforgedFel__casters= CreateGroup() +trigger WoWReforgedFel___castTrigger= CreateTrigger() +hashtable WoWReforgedFel___h= InitHashtable() +group WoWReforgedFel___casters= CreateGroup() //endglobals from WoWReforgedFel //globals from WoWReforgedFisherman: constant boolean LIBRARY_WoWReforgedFisherman=true @@ -1361,16 +1361,16 @@ constant boolean LIBRARY_WoWReforgedLearnableSkills=true constant integer RESKILL_HERO_LEVEL= 75 constant integer RESKILL_MAX_SLOTS= 5 -integer array WoWReforgedLearnableSkills___learnableSkillLearnItemTypeId -integer array WoWReforgedLearnableSkills___learnableSkillLearnAbilityId -integer array WoWReforgedLearnableSkills___learnableSkillAbilityId -integer array WoWReforgedLearnableSkills___learnableSkillIconAbilityId -integer array WoWReforgedLearnableSkills___learnableSkillSlot -boolean array WoWReforgedLearnableSkills___learnableSkillForbidEquipmentBag -integer WoWReforgedLearnableSkills___learnableSkillCounter= 0 +integer array WoWReforgedLearnableSkills__learnableSkillLearnItemTypeId +integer array WoWReforgedLearnableSkills__learnableSkillLearnAbilityId +integer array WoWReforgedLearnableSkills__learnableSkillAbilityId +integer array WoWReforgedLearnableSkills__learnableSkillIconAbilityId +integer array WoWReforgedLearnableSkills__learnableSkillSlot +boolean array WoWReforgedLearnableSkills__learnableSkillForbidEquipmentBag +integer WoWReforgedLearnableSkills__learnableSkillCounter= 0 -trigger WoWReforgedLearnableSkills___learnTrigger= CreateTrigger() -trigger WoWReforgedLearnableSkills___unlearnTrigger= CreateTrigger() +trigger WoWReforgedLearnableSkills__learnTrigger= CreateTrigger() +trigger WoWReforgedLearnableSkills__unlearnTrigger= CreateTrigger() //endglobals from WoWReforgedLearnableSkills //globals from WoWReforgedLevers: constant boolean LIBRARY_WoWReforgedLevers=true @@ -1378,14 +1378,14 @@ constant integer LEVER_TYPE_GATE= 0 constant integer LEVER_TYPE_BRIDGE= 1 constant integer LEVER_TYPE_PORTAL= 2 -integer array WoWReforgedLevers__levers -integer WoWReforgedLevers__leversCount= 0 +integer array WoWReforgedLevers___levers +integer WoWReforgedLevers___leversCount= 0 -hashtable WoWReforgedLevers__h= InitHashtable() -trigger WoWReforgedLevers__sellTrigger= CreateTrigger() +hashtable WoWReforgedLevers___h= InitHashtable() +trigger WoWReforgedLevers___sellTrigger= CreateTrigger() -constant integer WoWReforgedLevers__KEY_COUNT= 0 -constant integer WoWReforgedLevers__KEY_INDEX= 1 +constant integer WoWReforgedLevers___KEY_COUNT= 0 +constant integer WoWReforgedLevers___KEY_INDEX= 1 //endglobals from WoWReforgedLevers //globals from WoWReforgedQuests: constant boolean LIBRARY_WoWReforgedQuests=true @@ -1408,8 +1408,8 @@ constant boolean LIBRARY_WoWReforgedRefund=true //endglobals from WoWReforgedRefund //globals from WoWReforgedTextTag: constant boolean LIBRARY_WoWReforgedTextTag=true -player WoWReforgedTextTag__tmpPlayer= Player(0) -boolean WoWReforgedTextTag__tmpShow= false +player WoWReforgedTextTag___tmpPlayer= Player(0) +boolean WoWReforgedTextTag___tmpShow= false //endglobals from WoWReforgedTextTag //globals from WoWReforgedTreeUtils: constant boolean LIBRARY_WoWReforgedTreeUtils=true @@ -1481,25 +1481,25 @@ constant real DiplomacyUI_TOOLTIP_Y= 0.50 constant real DiplomacyUI_TOOLTIP_WIDTH= 0.20 constant real DiplomacyUI_TOOLTIP_HEIGHT= 0.6 -framehandle DiplomacyUI___Background -framehandle DiplomacyUI___Title -framehandle DiplomacyUI___TableTitle -framehandle array DiplomacyUI___ColumnTitles -framehandle array DiplomacyUI___RowTitles -framehandle array DiplomacyUI___Cells -framehandle array DiplomacyUI___CellsTooltip -framehandle DiplomacyUI___CancelButton -framehandle DiplomacyUI___ApplyButton - -force DiplomacyUI___allPlayers= null -integer DiplomacyUI___allPlayersCount= 0 -real DiplomacyUI___scale= 1.0 -real DiplomacyUI___indentionX= 0.0 -trigger DiplomacyUI___syncTrigger= CreateTrigger() -trigger DiplomacyUI___chatTrigger= CreateTrigger() -trigger DiplomacyUI___changeTrigger= null -trigger DiplomacyUI___cancelTrigger= null -trigger DiplomacyUI___applyTrigger= null +framehandle DiplomacyUI__Background +framehandle DiplomacyUI__Title +framehandle DiplomacyUI__TableTitle +framehandle array DiplomacyUI__ColumnTitles +framehandle array DiplomacyUI__RowTitles +framehandle array DiplomacyUI__Cells +framehandle array DiplomacyUI__CellsTooltip +framehandle DiplomacyUI__CancelButton +framehandle DiplomacyUI__ApplyButton + +force DiplomacyUI__allPlayers= null +integer DiplomacyUI__allPlayersCount= 0 +real DiplomacyUI__scale= 1.0 +real DiplomacyUI__indentionX= 0.0 +trigger DiplomacyUI__syncTrigger= CreateTrigger() +trigger DiplomacyUI__chatTrigger= CreateTrigger() +trigger DiplomacyUI__changeTrigger= null +trigger DiplomacyUI__cancelTrigger= null +trigger DiplomacyUI__applyTrigger= null //endglobals from DiplomacyUI //globals from DrainResources: constant boolean LIBRARY_DrainResources=true @@ -1507,11 +1507,11 @@ constant real DrainResources_TIMER_INTERVAL= 1.0 constant integer DrainResources_ABILITY_ID= 'A17J' constant integer DrainResources_ABILITY_ID_ITEM= 'A18J' -hashtable DrainResources___h= InitHashtable() -group DrainResources___casters= CreateGroup() -timer DrainResources___t= CreateTimer() -trigger DrainResources___castTrigger= CreateTrigger() -trigger DrainResources___stopTrigger= CreateTrigger() +hashtable DrainResources__h= InitHashtable() +group DrainResources__casters= CreateGroup() +timer DrainResources__t= CreateTimer() +trigger DrainResources__castTrigger= CreateTrigger() +trigger DrainResources__stopTrigger= CreateTrigger() //endglobals from DrainResources //globals from Evasion: constant boolean LIBRARY_Evasion=true @@ -1586,59 +1586,59 @@ constant integer PagedButtons_BUTTON_TYPE_ITEM= 1 constant integer PagedButtons_BUTTON_TYPE_ABILITY= 2 constant integer PagedButtons_BUTTON_TYPE_SPACER= 3 -hashtable PagedButtons___h= InitHashtable() -group PagedButtons___shops= CreateGroup() -trigger PagedButtons___deathTrigger= null -trigger PagedButtons___sellUnitTrigger= CreateTrigger() -trigger PagedButtons___sellItemTrigger= CreateTrigger() -timer PagedButtons___autoUpdateStockTimer= CreateTimer() +hashtable PagedButtons__h= InitHashtable() +group PagedButtons__shops= CreateGroup() +trigger PagedButtons__deathTrigger= null +trigger PagedButtons__sellUnitTrigger= CreateTrigger() +trigger PagedButtons__sellItemTrigger= CreateTrigger() +timer PagedButtons__autoUpdateStockTimer= CreateTimer() // callbacks -trigger array PagedButtons___callbackTriggersChangePageButtons -integer PagedButtons___callbackTriggersChangePageButtonsCounter= 0 -trigger array PagedButtons___callbackTriggersObjectAvailable -integer PagedButtons___callbackTriggersObjectAvailableCounter= 0 -unit PagedButtons___triggerShop= null -integer PagedButtons___triggerPreviousPage= 0 -integer PagedButtons___triggerAvailableObject= 0 +trigger array PagedButtons__callbackTriggersChangePageButtons +integer PagedButtons__callbackTriggersChangePageButtonsCounter= 0 +trigger array PagedButtons__callbackTriggersObjectAvailable +integer PagedButtons__callbackTriggersObjectAvailableCounter= 0 +unit PagedButtons__triggerShop= null +integer PagedButtons__triggerPreviousPage= 0 +integer PagedButtons__triggerAvailableObject= 0 //endglobals from PagedButtons //globals from Push: constant boolean LIBRARY_Push=true -integer Push___FireBallKnockbackType -constant string Push___EFFECT= "Environment\\UndeadBuildingFire\\UndeadLargeBuildingFire1.mdl" -constant string Push___EXPLOSION_EFFECT= "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" +integer Push__FireBallKnockbackType +constant string Push__EFFECT= "Environment\\UndeadBuildingFire\\UndeadLargeBuildingFire1.mdl" +constant string Push__EXPLOSION_EFFECT= "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" //endglobals from Push //globals from Queue: constant boolean LIBRARY_Queue=true // Set this to true if hero revivals should appear in the queue. Requires HeroReviveEvents. constant boolean Queue_QUEUE_HERO_REVIVALS= true -constant string Queue___EMPTY_STRING= "Default string" - -trigger Queue___cancelTrainTrigger= CreateTrigger() -trigger Queue___finishTrainTrigger= CreateTrigger() -trigger Queue___cancelResearchTrigger= CreateTrigger() -trigger Queue___finishResearchTrigger= CreateTrigger() -trigger Queue___cancelUpgradeTrigger= CreateTrigger() -trigger Queue___finishUpgradeTrigger= CreateTrigger() -trigger Queue___startConstructTrigger= CreateTrigger() -trigger Queue___finishConstructTrigger= CreateTrigger() -trigger Queue___orderReviveStartTrigger= CreateTrigger() -trigger Queue___orderReviveCancelTrigger= CreateTrigger() -trigger Queue___finishReviveTrigger= CreateTrigger() -trigger Queue___orderTrigger= CreateTrigger() -trigger Queue___deathTrigger= CreateTrigger() - -integer array Queue___playerQueue -boolean array Queue___isEnabledForPlayer - -hashtable Queue___h= InitHashtable() -group Queue___constructions= CreateGroup() +constant string Queue__EMPTY_STRING= "Default string" + +trigger Queue__cancelTrainTrigger= CreateTrigger() +trigger Queue__finishTrainTrigger= CreateTrigger() +trigger Queue__cancelResearchTrigger= CreateTrigger() +trigger Queue__finishResearchTrigger= CreateTrigger() +trigger Queue__cancelUpgradeTrigger= CreateTrigger() +trigger Queue__finishUpgradeTrigger= CreateTrigger() +trigger Queue__startConstructTrigger= CreateTrigger() +trigger Queue__finishConstructTrigger= CreateTrigger() +trigger Queue__orderReviveStartTrigger= CreateTrigger() +trigger Queue__orderReviveCancelTrigger= CreateTrigger() +trigger Queue__finishReviveTrigger= CreateTrigger() +trigger Queue__orderTrigger= CreateTrigger() +trigger Queue__deathTrigger= CreateTrigger() + +integer array Queue__playerQueue +boolean array Queue__isEnabledForPlayer + +hashtable Queue__h= InitHashtable() +group Queue__constructions= CreateGroup() // callbacks -trigger array Queue___callbackTriggers -integer Queue___callbackTriggersCount= 0 -unit Queue___triggerUnit= null -integer Queue___triggerId= 0 +trigger array Queue__callbackTriggers +integer Queue__callbackTriggersCount= 0 +unit Queue__triggerUnit= null +integer Queue__triggerId= 0 //endglobals from Queue //globals from ResourcesChatCommands: constant boolean LIBRARY_ResourcesChatCommands=true @@ -1714,19 +1714,19 @@ constant boolean LIBRARY_SpellVamp=true //endglobals from SpellVamp //globals from Taunts: constant boolean LIBRARY_Taunts=true -hashtable Taunts___h= InitHashtable() +hashtable Taunts__h= InitHashtable() -trigger Taunts___TauntsEnableChatTrigger= CreateTrigger() -trigger Taunts___TauntsDisableChatTrigger= CreateTrigger() -trigger Taunts___TauntsListChatTrigger= CreateTrigger() +trigger Taunts__TauntsEnableChatTrigger= CreateTrigger() +trigger Taunts__TauntsDisableChatTrigger= CreateTrigger() +trigger Taunts__TauntsListChatTrigger= CreateTrigger() -boolean array Taunts___TauntsEnabled +boolean array Taunts__TauntsEnabled -integer Taunts___TauntsCount= 0 -string array Taunts___TauntChatCommands -string array Taunts___TauntTexts -sound array Taunts___TauntSounds -trigger array Taunts___TauntsChatTrigger +integer Taunts__TauntsCount= 0 +string array Taunts__TauntChatCommands +string array Taunts__TauntTexts +sound array Taunts__TauntSounds +trigger array Taunts__TauntsChatTrigger //endglobals from Taunts //globals from TenacityUtils: constant boolean LIBRARY_TenacityUtils=true @@ -1804,49 +1804,49 @@ constant integer UNIT_RESPAWN_TYPE_UNIT= 0 constant integer UNIT_RESPAWN_TYPE_UNITPOOL= 1 constant integer UNIT_RESPAWN_TYPE_RANDOM_CREEP_LEVEL= 2 -integer UnitGroupRespawnSystem___respawnUnitCounter= 0 -integer UnitGroupRespawnSystem___respawnUnitFreeIndex= 1 -boolean array UnitGroupRespawnSystem___respawnUnitIsValid -integer array UnitGroupRespawnSystem___respawnUnitType -unit array UnitGroupRespawnSystem___respawnUnitUnit -integer array UnitGroupRespawnSystem___respawnUnitHandleId -integer array UnitGroupRespawnSystem___respawnUnitUnitTypeId -unitpool array UnitGroupRespawnSystem___respawnUnitPool -integer array UnitGroupRespawnSystem___respawnUnitRandomCreepLevel -player array UnitGroupRespawnSystem___respawnUnitOwner -real array UnitGroupRespawnSystem___respawnUnitFacing -real array UnitGroupRespawnSystem___respawnUnitX -real array UnitGroupRespawnSystem___respawnUnitY -boolean array UnitGroupRespawnSystem___respawnUnitUseDyingLoc -timer array UnitGroupRespawnSystem___respawnUnitTimer -real array UnitGroupRespawnSystem___respawnUnitTimeout -boolean array UnitGroupRespawnSystem___respawnUnitEnabled -integer array UnitGroupRespawnSystem___respawnUnitGroupIndex -boolean array UnitGroupRespawnSystem___respawnUnitReadyForRespawn - -integer UnitGroupRespawnSystem___callbackRespawnTriggersCounter= 0 -trigger array UnitGroupRespawnSystem___callbackRespawnTriggers - -integer UnitGroupRespawnSystem___callbackRespawnStartsTriggersCounter= 0 -trigger array UnitGroupRespawnSystem___callbackRespawnStartsTriggers - -unit UnitGroupRespawnSystem___callbackUnit= null -integer UnitGroupRespawnSystem___callbackIndex= - 1 - -integer UnitGroupRespawnSystem___respawnUnitGroupCounter= 0 -integer UnitGroupRespawnSystem___respawnUnitGroupFreeIndex= 1 -boolean array UnitGroupRespawnSystem___respawnUnitGroupIsValid -group array UnitGroupRespawnSystem___respawnUnitGroup -timer array UnitGroupRespawnSystem___respawnUnitGroupTimer -real array UnitGroupRespawnSystem___respawnUnitGroupTimeout -boolean array UnitGroupRespawnSystem___respawnUnitGroupEnabled -boolean array UnitGroupRespawnSystem___respawnUnitGroupItemDropEnabled - -trigger UnitGroupRespawnSystem___unitDeathOrCharmOrRescueTrigger= CreateTrigger() -hashtable UnitGroupRespawnSystem___respawnUnitHashTable= InitHashtable() - -unit UnitGroupRespawnSystem___filterUnit= null -force UnitGroupRespawnSystem___filterForce= null +integer UnitGroupRespawnSystem__respawnUnitCounter= 0 +integer UnitGroupRespawnSystem__respawnUnitFreeIndex= 1 +boolean array UnitGroupRespawnSystem__respawnUnitIsValid +integer array UnitGroupRespawnSystem__respawnUnitType +unit array UnitGroupRespawnSystem__respawnUnitUnit +integer array UnitGroupRespawnSystem__respawnUnitHandleId +integer array UnitGroupRespawnSystem__respawnUnitUnitTypeId +unitpool array UnitGroupRespawnSystem__respawnUnitPool +integer array UnitGroupRespawnSystem__respawnUnitRandomCreepLevel +player array UnitGroupRespawnSystem__respawnUnitOwner +real array UnitGroupRespawnSystem__respawnUnitFacing +real array UnitGroupRespawnSystem__respawnUnitX +real array UnitGroupRespawnSystem__respawnUnitY +boolean array UnitGroupRespawnSystem__respawnUnitUseDyingLoc +timer array UnitGroupRespawnSystem__respawnUnitTimer +real array UnitGroupRespawnSystem__respawnUnitTimeout +boolean array UnitGroupRespawnSystem__respawnUnitEnabled +integer array UnitGroupRespawnSystem__respawnUnitGroupIndex +boolean array UnitGroupRespawnSystem__respawnUnitReadyForRespawn + +integer UnitGroupRespawnSystem__callbackRespawnTriggersCounter= 0 +trigger array UnitGroupRespawnSystem__callbackRespawnTriggers + +integer UnitGroupRespawnSystem__callbackRespawnStartsTriggersCounter= 0 +trigger array UnitGroupRespawnSystem__callbackRespawnStartsTriggers + +unit UnitGroupRespawnSystem__callbackUnit= null +integer UnitGroupRespawnSystem__callbackIndex= - 1 + +integer UnitGroupRespawnSystem__respawnUnitGroupCounter= 0 +integer UnitGroupRespawnSystem__respawnUnitGroupFreeIndex= 1 +boolean array UnitGroupRespawnSystem__respawnUnitGroupIsValid +group array UnitGroupRespawnSystem__respawnUnitGroup +timer array UnitGroupRespawnSystem__respawnUnitGroupTimer +real array UnitGroupRespawnSystem__respawnUnitGroupTimeout +boolean array UnitGroupRespawnSystem__respawnUnitGroupEnabled +boolean array UnitGroupRespawnSystem__respawnUnitGroupItemDropEnabled + +trigger UnitGroupRespawnSystem__unitDeathOrCharmOrRescueTrigger= CreateTrigger() +hashtable UnitGroupRespawnSystem__respawnUnitHashTable= InitHashtable() + +unit UnitGroupRespawnSystem__filterUnit= null +force UnitGroupRespawnSystem__filterForce= null //endglobals from UnitGroupRespawnSystem //globals from Utilities: constant boolean LIBRARY_Utilities=true @@ -1903,69 +1903,69 @@ constant boolean LIBRARY_WoWReforgedAutoSkill=true //endglobals from WoWReforgedAutoSkill //globals from WoWReforgedChangeLog: constant boolean LIBRARY_WoWReforgedChangeLog=true -quest array WoWReforgedChangeLog__versionQuests -integer WoWReforgedChangeLog__versionQuestsCounter= 0 +quest array WoWReforgedChangeLog___versionQuests +integer WoWReforgedChangeLog___versionQuestsCounter= 0 //endglobals from WoWReforgedChangeLog //globals from WoWReforgedDayNightCycleEffects: constant boolean LIBRARY_WoWReforgedDayNightCycleEffects=true -boolean WoWReforgedDayNightCycleEffects__effectsIsDaytime= false -filterfunc WoWReforgedDayNightCycleEffects__filter= null -trigger WoWReforgedDayNightCycleEffects__dayEffectsTrigger= null -trigger WoWReforgedDayNightCycleEffects__nightEffectsTrigger= null - -integer array WoWReforgedDayNightCycleEffects__destructableIds -boolean array WoWReforgedDayNightCycleEffects__destructableHide -real array WoWReforgedDayNightCycleEffects__destructableHideDelay -integer WoWReforgedDayNightCycleEffects__destructableIdsCounter= 0 - -integer array WoWReforgedDayNightCycleEffects__doodadIds -string array WoWReforgedDayNightCycleEffects__doodadDayAnimNames -string array WoWReforgedDayNightCycleEffects__doodadNightAnimNames -integer WoWReforgedDayNightCycleEffects__doodadIdsCounter= 0 +boolean WoWReforgedDayNightCycleEffects___effectsIsDaytime= false +filterfunc WoWReforgedDayNightCycleEffects___filter= null +trigger WoWReforgedDayNightCycleEffects___dayEffectsTrigger= null +trigger WoWReforgedDayNightCycleEffects___nightEffectsTrigger= null + +integer array WoWReforgedDayNightCycleEffects___destructableIds +boolean array WoWReforgedDayNightCycleEffects___destructableHide +real array WoWReforgedDayNightCycleEffects___destructableHideDelay +integer WoWReforgedDayNightCycleEffects___destructableIdsCounter= 0 + +integer array WoWReforgedDayNightCycleEffects___doodadIds +string array WoWReforgedDayNightCycleEffects___doodadDayAnimNames +string array WoWReforgedDayNightCycleEffects___doodadNightAnimNames +integer WoWReforgedDayNightCycleEffects___doodadIdsCounter= 0 //endglobals from WoWReforgedDayNightCycleEffects //globals from WoWReforgedHeroSkills: constant boolean LIBRARY_WoWReforgedHeroSkills=true // skills/ability IDs -hashtable WoWReforgedHeroSkills___h= InitHashtable() +hashtable WoWReforgedHeroSkills__h= InitHashtable() // skill levels -hashtable WoWReforgedHeroSkills___h2= InitHashtable() -trigger WoWReforgedHeroSkills___learnTrigger= CreateTrigger() -trigger WoWReforgedHeroSkills___unlearnTrigger= CreateTrigger() +hashtable WoWReforgedHeroSkills__h2= InitHashtable() +trigger WoWReforgedHeroSkills__learnTrigger= CreateTrigger() +trigger WoWReforgedHeroSkills__unlearnTrigger= CreateTrigger() //endglobals from WoWReforgedHeroSkills //globals from WoWReforgedHousing: constant boolean LIBRARY_WoWReforgedHousing=true -integer array WoWReforgedHousing__housings -integer WoWReforgedHousing__housingsCounter= 0 -trigger WoWReforgedHousing__sellItemTrigger= CreateTrigger() -trigger WoWReforgedHousing__sellUnitTrigger= CreateTrigger() -trigger WoWReforgedHousing__useItemTrigger= CreateTrigger() -trigger WoWReforgedHousing__chatTrigger= CreateTrigger() -trigger WoWReforgedHousing__castTrigger= CreateTrigger() +integer array WoWReforgedHousing___housings +integer WoWReforgedHousing___housingsCounter= 0 +trigger WoWReforgedHousing___sellItemTrigger= CreateTrigger() +trigger WoWReforgedHousing___sellUnitTrigger= CreateTrigger() +trigger WoWReforgedHousing___useItemTrigger= CreateTrigger() +trigger WoWReforgedHousing___chatTrigger= CreateTrigger() +trigger WoWReforgedHousing___castTrigger= CreateTrigger() //endglobals from WoWReforgedHousing //globals from WoWReforgedMiner: constant boolean LIBRARY_WoWReforgedMiner=true -integer array WoWReforgedMiner__oreItemTypeIds -integer WoWReforgedMiner__oreItemTypeIdsCounter= 0 +integer array WoWReforgedMiner___oreItemTypeIds +integer WoWReforgedMiner___oreItemTypeIdsCounter= 0 -integer array WoWReforgedMiner__gemItemTypeIds -integer WoWReforgedMiner__gemItemTypeIdsCounter= 0 +integer array WoWReforgedMiner___gemItemTypeIds +integer WoWReforgedMiner___gemItemTypeIdsCounter= 0 -integer array WoWReforgedMiner__mineralResources -integer WoWReforgedMiner__mineralResourcesCounter= 0 +integer array WoWReforgedMiner___mineralResources +integer WoWReforgedMiner___mineralResourcesCounter= 0 //endglobals from WoWReforgedMiner //globals from WoWReforgedNpcs: constant boolean LIBRARY_WoWReforgedNpcs=true -integer array WoWReforgedNpcs__npcUnitTypeIds -integer WoWReforgedNpcs__npcUnitTypeIdsCount= 0 -integer WoWReforgedNpcs__filterUnitTypeId= 0 +integer array WoWReforgedNpcs___npcUnitTypeIds +integer WoWReforgedNpcs___npcUnitTypeIdsCount= 0 +integer WoWReforgedNpcs___filterUnitTypeId= 0 //endglobals from WoWReforgedNpcs //globals from WoWReforgedPagedButtonsConfig: constant boolean LIBRARY_WoWReforgedPagedButtonsConfig=true //endglobals from WoWReforgedPagedButtonsConfig //globals from WoWReforgedProspector: constant boolean LIBRARY_WoWReforgedProspector=true -integer array WoWReforgedProspector__goldItemTypeIds -integer WoWReforgedProspector__goldItemTypeIdsCounter= 0 +integer array WoWReforgedProspector___goldItemTypeIds +integer WoWReforgedProspector___goldItemTypeIdsCounter= 0 //endglobals from WoWReforgedProspector //globals from AStructCoreInterfaceThirdPersonCamera: constant boolean LIBRARY_AStructCoreInterfaceThirdPersonCamera=true @@ -1985,62 +1985,62 @@ constant integer Crafting_DISASSEMBLE_ABILITY_ID= 'A1DP' // This interval defines how often the stocks are updated and start again with their start delay. constant real Crafting_UPDATE_INTERVAL= 20.0 -integer array Crafting___recipesItemTypeIds -integer array Crafting___recipesUIItemTypeIds -boolean array Crafting___recipesIsUnit -boolean array Crafting___recipesIsSpacer -string array Crafting___recipesPageName -boolean array Crafting___recipesNotAvailableForPlayer -integer array Crafting___recipesMinRequirements -integer array Crafting___recipesRequirementCounters -integer array Crafting___recipesRequirementItemTypeIds -integer array Crafting___recipesRequirementCharges -boolean array Crafting___recipesRequirementConsume -integer Crafting___recipesCounter= 0 +integer array Crafting__recipesItemTypeIds +integer array Crafting__recipesUIItemTypeIds +boolean array Crafting__recipesIsUnit +boolean array Crafting__recipesIsSpacer +string array Crafting__recipesPageName +boolean array Crafting__recipesNotAvailableForPlayer +integer array Crafting__recipesMinRequirements +integer array Crafting__recipesRequirementCounters +integer array Crafting__recipesRequirementItemTypeIds +integer array Crafting__recipesRequirementCharges +boolean array Crafting__recipesRequirementConsume +integer Crafting__recipesCounter= 0 // callbacks -integer Crafting___recipeRequirementCallback= 0 -trigger Crafting___recipeRequirementCallbackTrigger= null -trigger Crafting___recipeShowCallbackTrigger= null -trigger array Crafting___craftingCallbackTriggers -integer Crafting___craftingCallbackTriggersCounter= 0 -trigger array Crafting___craftingCallbackUnitTriggers -integer Crafting___craftingCallbackUnitTriggersCounter= 0 -trigger array Crafting___disassembleCallbackTriggers -integer Crafting___disassembleCallbackTriggersCounter= 0 - -integer Crafting___lastCreatedRecipe= 0 - -integer Crafting___triggerRecipe= 0 -unit Crafting___triggerCraftingUnit= null -item Crafting___triggerCraftedItem= null -unit Crafting___triggerCraftedUnit= null -integer Crafting___triggerCraftedCharges= 0 - -group Crafting___itemCraftingUnits= CreateGroup() -trigger Crafting___pickupTrigger= CreateTrigger() -trigger Crafting___dropTrigger= CreateTrigger() -trigger Crafting___itemCraftTrigger= CreateTrigger() -trigger Crafting___itemDisassembleTrigger= CreateTrigger() - -hashtable Crafting___itemCraftingUnitsHashTable= InitHashtable() -trigger Crafting___itemCraftingChangePageTrigger= CreateTrigger() -timer Crafting___itemCraftingStockUpdateTimer= CreateTimer() +integer Crafting__recipeRequirementCallback= 0 +trigger Crafting__recipeRequirementCallbackTrigger= null +trigger Crafting__recipeShowCallbackTrigger= null +trigger array Crafting__craftingCallbackTriggers +integer Crafting__craftingCallbackTriggersCounter= 0 +trigger array Crafting__craftingCallbackUnitTriggers +integer Crafting__craftingCallbackUnitTriggersCounter= 0 +trigger array Crafting__disassembleCallbackTriggers +integer Crafting__disassembleCallbackTriggersCounter= 0 + +integer Crafting__lastCreatedRecipe= 0 + +integer Crafting__triggerRecipe= 0 +unit Crafting__triggerCraftingUnit= null +item Crafting__triggerCraftedItem= null +unit Crafting__triggerCraftedUnit= null +integer Crafting__triggerCraftedCharges= 0 + +group Crafting__itemCraftingUnits= CreateGroup() +trigger Crafting__pickupTrigger= CreateTrigger() +trigger Crafting__dropTrigger= CreateTrigger() +trigger Crafting__itemCraftTrigger= CreateTrigger() +trigger Crafting__itemDisassembleTrigger= CreateTrigger() + +hashtable Crafting__itemCraftingUnitsHashTable= InitHashtable() +trigger Crafting__itemCraftingChangePageTrigger= CreateTrigger() +timer Crafting__itemCraftingStockUpdateTimer= CreateTimer() // update food available -trigger Crafting___trainStartTrigger= CreateTrigger() -trigger Crafting___trainCancelTrigger= CreateTrigger() -trigger Crafting___sellTrigger= CreateTrigger() -trigger Crafting___reviveStartTrigger= CreateTrigger() -trigger Crafting___reviveCancelTrigger= CreateTrigger() -trigger Crafting___deathTrigger= CreateTrigger() - - -constant integer Crafting___HASHTABLE_KEY_PAGE= 0 -constant integer Crafting___HASHTABLE_KEY_GROUP= 1 -constant integer Crafting___HASHTABLE_KEY_DISABLED_RECIPES= 2 -unit Crafting___tmpUnit= null -integer Crafting___tmpInteger0= 0 +trigger Crafting__trainStartTrigger= CreateTrigger() +trigger Crafting__trainCancelTrigger= CreateTrigger() +trigger Crafting__sellTrigger= CreateTrigger() +trigger Crafting__reviveStartTrigger= CreateTrigger() +trigger Crafting__reviveCancelTrigger= CreateTrigger() +trigger Crafting__deathTrigger= CreateTrigger() + + +constant integer Crafting__HASHTABLE_KEY_PAGE= 0 +constant integer Crafting__HASHTABLE_KEY_GROUP= 1 +constant integer Crafting__HASHTABLE_KEY_DISABLED_RECIPES= 2 +unit Crafting__tmpUnit= null +integer Crafting__tmpInteger0= 0 //endglobals from Crafting //globals from CriticalStrike: constant boolean LIBRARY_CriticalStrike=true @@ -2297,57 +2297,57 @@ constant real PagedButtonsUI_BOTTOM_BUTTONS_Y= 0.203 constant real PagedButtonsUI_CLOSE_BUTTON_WIDTH= 0.12 constant real PagedButtonsUI_CLOSE_BUTTON_HEIGHT= 0.03 -boolean array PagedButtonsUI___enabledForPlayer -boolean array PagedButtonsUI___UIVisible -unit array PagedButtonsUI___UIShop -integer array PagedButtonsUI___PagesIndex -framehandle PagedButtonsUI___BackgroundFrame -framehandle PagedButtonsUI___TitleFrame -framehandle array PagedButtonsUI___SlotFrame -framehandle array PagedButtonsUI___SlotBackdropFrame -framehandle array PagedButtonsUI___SlotChargesBackgroundFrame -framehandle array PagedButtonsUI___SlotChargesFrame -framehandle array PagedButtonsUI___SlotPageBackgroundFrame -framehandle array PagedButtonsUI___SlotPageFrame -trigger array PagedButtonsUI___SlotClickTrigger -trigger array PagedButtonsUI___SlotTooltipOnTrigger -trigger array PagedButtonsUI___SlotTooltipOffTrigger -framehandle PagedButtonsUI___TooltipFrame -framehandle PagedButtonsUI___PageNameText -framehandle PagedButtonsUI___TooltipIcon -framehandle PagedButtonsUI___SummonFrame -framehandle PagedButtonsUI___ItemGoldFrame -framehandle PagedButtonsUI___ItemGoldIconFrame -framehandle PagedButtonsUI___ItemLumberFrame -framehandle PagedButtonsUI___ItemLumberIconFrame -framehandle PagedButtonsUI___ItemFoodFrame -framehandle PagedButtonsUI___ItemFoodIconFrame -framehandle PagedButtonsUI___TooltipText -framehandle PagedButtonsUI___PreviewSprite= null -effect PagedButtonsUI___PreviewEffect= null -framehandle PagedButtonsUI___NextPagesButton -trigger PagedButtonsUI___NextPagesTrigger -framehandle PagedButtonsUI___PreviousPagesButton -trigger PagedButtonsUI___PreviousPagesTrigger -framehandle PagedButtonsUI___Checkbox -trigger PagedButtonsUI___CheckedTrigger -trigger PagedButtonsUI___UncheckedTrigger -framehandle PagedButtonsUI___CloseButton -trigger PagedButtonsUI___CloseTrigger - -boolean PagedButtonsUI___checked= false +boolean array PagedButtonsUI__enabledForPlayer +boolean array PagedButtonsUI__UIVisible +unit array PagedButtonsUI__UIShop +integer array PagedButtonsUI__PagesIndex +framehandle PagedButtonsUI__BackgroundFrame +framehandle PagedButtonsUI__TitleFrame +framehandle array PagedButtonsUI__SlotFrame +framehandle array PagedButtonsUI__SlotBackdropFrame +framehandle array PagedButtonsUI__SlotChargesBackgroundFrame +framehandle array PagedButtonsUI__SlotChargesFrame +framehandle array PagedButtonsUI__SlotPageBackgroundFrame +framehandle array PagedButtonsUI__SlotPageFrame +trigger array PagedButtonsUI__SlotClickTrigger +trigger array PagedButtonsUI__SlotTooltipOnTrigger +trigger array PagedButtonsUI__SlotTooltipOffTrigger +framehandle PagedButtonsUI__TooltipFrame +framehandle PagedButtonsUI__PageNameText +framehandle PagedButtonsUI__TooltipIcon +framehandle PagedButtonsUI__SummonFrame +framehandle PagedButtonsUI__ItemGoldFrame +framehandle PagedButtonsUI__ItemGoldIconFrame +framehandle PagedButtonsUI__ItemLumberFrame +framehandle PagedButtonsUI__ItemLumberIconFrame +framehandle PagedButtonsUI__ItemFoodFrame +framehandle PagedButtonsUI__ItemFoodIconFrame +framehandle PagedButtonsUI__TooltipText +framehandle PagedButtonsUI__PreviewSprite= null +effect PagedButtonsUI__PreviewEffect= null +framehandle PagedButtonsUI__NextPagesButton +trigger PagedButtonsUI__NextPagesTrigger +framehandle PagedButtonsUI__PreviousPagesButton +trigger PagedButtonsUI__PreviousPagesTrigger +framehandle PagedButtonsUI__Checkbox +trigger PagedButtonsUI__CheckedTrigger +trigger PagedButtonsUI__UncheckedTrigger +framehandle PagedButtonsUI__CloseButton +trigger PagedButtonsUI__CloseTrigger + +boolean PagedButtonsUI__checked= false // static if (SHOW_PREVIEW_MODELS) then -real array PagedButtonsUI___previewModelX -real array PagedButtonsUI___previewModelY -real array PagedButtonsUI___previewModelScale -string array PagedButtonsUI___previewModelFile +real array PagedButtonsUI__previewModelX +real array PagedButtonsUI__previewModelY +real array PagedButtonsUI__previewModelScale +string array PagedButtonsUI__previewModelFile //endif -hashtable PagedButtonsUI___h= InitHashtable() -trigger PagedButtonsUI___SyncTrigger= CreateTrigger() -trigger PagedButtonsUI___selectionTrigger= CreateTrigger() -trigger PagedButtonsUI___changePageButtonsTrigger= CreateTrigger() -trigger PagedButtonsUI___deathTrigger= CreateTrigger() +hashtable PagedButtonsUI__h= InitHashtable() +trigger PagedButtonsUI__SyncTrigger= CreateTrigger() +trigger PagedButtonsUI__selectionTrigger= CreateTrigger() +trigger PagedButtonsUI__changePageButtonsTrigger= CreateTrigger() +trigger PagedButtonsUI__deathTrigger= CreateTrigger() //endglobals from PagedButtonsUI //globals from QueueUI: constant boolean LIBRARY_QueueUI=true @@ -2367,23 +2367,23 @@ constant real QueueUI_TOOLTIP_FONT_HEIGHT= 0.009 constant string QueueUI_CHECKBOX_TOOLTIP_HIDE= "Hide" constant string QueueUI_CHECKBOX_TOOLTIP_SHOW= "Show" -boolean array QueueUI___enabledForPlayer -trigger QueueUI___CheckboxCheckedTrigger -trigger QueueUI___CheckboxUncheckedTrigger -framehandle QueueUI___Checkbox -framehandle QueueUI___CheckboxTooltip -framehandle array QueueUI___SlotFrame -framehandle array QueueUI___SlotBackdropFrame -framehandle array QueueUI___SlotChargesBackdropFrame -framehandle array QueueUI___SlotChargesFrame -framehandle array QueueUI___SlotTooltip -trigger array QueueUI___SlotClickTrigger - -boolean array QueueUI___checked - -hashtable QueueUI___h= InitHashtable() -trigger QueueUI___syncTrigger= CreateTrigger() -trigger QueueUI___queueTrigger= CreateTrigger() +boolean array QueueUI__enabledForPlayer +trigger QueueUI__CheckboxCheckedTrigger +trigger QueueUI__CheckboxUncheckedTrigger +framehandle QueueUI__Checkbox +framehandle QueueUI__CheckboxTooltip +framehandle array QueueUI__SlotFrame +framehandle array QueueUI__SlotBackdropFrame +framehandle array QueueUI__SlotChargesBackdropFrame +framehandle array QueueUI__SlotChargesFrame +framehandle array QueueUI__SlotTooltip +trigger array QueueUI__SlotClickTrigger + +boolean array QueueUI__checked + +hashtable QueueUI__h= InitHashtable() +trigger QueueUI__syncTrigger= CreateTrigger() +trigger QueueUI__queueTrigger= CreateTrigger() //endglobals from QueueUI //globals from ResourcesGui: constant boolean LIBRARY_ResourcesGui=true @@ -2442,18 +2442,18 @@ constant integer Tunnel_UNIT_TYPE_ID= 'u028' constant integer Tunnel_UNIT_TYPE_ID_2= 'u03F' constant integer Tunnel_REGENERATION_ABILITY_ID= 'A1DK' -group Tunnel___loaded= CreateGroup() -group Tunnel___copies= CreateGroup() -trigger Tunnel___loadTrigger= CreateTrigger() -trigger Tunnel___constructionTrigger= CreateTrigger() -hashtable Tunnel___h= InitHashtable() +group Tunnel__loaded= CreateGroup() +group Tunnel__copies= CreateGroup() +trigger Tunnel__loadTrigger= CreateTrigger() +trigger Tunnel__constructionTrigger= CreateTrigger() +hashtable Tunnel__h= InitHashtable() -unit Tunnel___tmpUnit= null +unit Tunnel__tmpUnit= null -constant integer Tunnel___KEY_SOURCE= 0 -constant integer Tunnel___KEY_TUNNEL= 1 -constant integer Tunnel___KEY_X= 2 -constant integer Tunnel___KEY_Y= 3 +constant integer Tunnel__KEY_SOURCE= 0 +constant integer Tunnel__KEY_TUNNEL= 1 +constant integer Tunnel__KEY_X= 2 +constant integer Tunnel__KEY_Y= 3 //endglobals from Tunnel //globals from WoWReforgedCrates: constant boolean LIBRARY_WoWReforgedCrates=true @@ -2481,8 +2481,8 @@ constant boolean LIBRARY_DamageInterfaceUtils=true //globals from Demoralize: constant boolean LIBRARY_Demoralize=true constant integer Demoralize_ABILITY_ID= 'A1Z3' -trigger Demoralize___castTrigger= CreateTrigger() -player Demoralize___tmpPlayer= null +trigger Demoralize__castTrigger= CreateTrigger() +player Demoralize__tmpPlayer= null //endglobals from Demoralize //globals from HolyNova: constant boolean LIBRARY_HolyNova=true @@ -2490,40 +2490,40 @@ constant integer HolyNova_ABILITY_ID= 'A1NH' constant integer HolyNova_ABILITY_ID_2= 'A1ON' constant integer HolyNova_ABILITY_ID_3= 'A118' -unit HolyNova___tmpCaster= null +unit HolyNova__tmpCaster= null -trigger HolyNova___castTrigger= CreateTrigger() +trigger HolyNova__castTrigger= CreateTrigger() //endglobals from HolyNova //globals from MassDevour: constant boolean LIBRARY_MassDevour=true -constant real MassDevour___RANGE= 512.0 -constant integer MassDevour___ABILITY_ID= 'A10L' -constant integer MassDevour___BUFF_ABILITY_ID= 'A0Y1' -constant integer MassDevour___DUMMY_ID= 'h0H7' +constant real MassDevour__RANGE= 512.0 +constant integer MassDevour__ABILITY_ID= 'A10L' +constant integer MassDevour__BUFF_ABILITY_ID= 'A0Y1' +constant integer MassDevour__DUMMY_ID= 'h0H7' -constant integer MassDevour___DUMMY_DEVOUR_ABILITY_ID= 'A10N' -constant integer MassDevour___DUMMY_DEVOUR_CARGO_ABILITY_ID= 'A10M' +constant integer MassDevour__DUMMY_DEVOUR_ABILITY_ID= 'A10N' +constant integer MassDevour__DUMMY_DEVOUR_CARGO_ABILITY_ID= 'A10M' -constant string MassDevour___DUMMY_DEVOUR_ORDER= "creepdevour" +constant string MassDevour__DUMMY_DEVOUR_ORDER= "creepdevour" -hashtable MassDevour___h= InitHashtable() -trigger MassDevour___castTrigger= CreateTrigger() -trigger MassDevour___deathTriggerCaster= CreateTrigger() -trigger MassDevour___deathTriggerTarget= CreateTrigger() -group MassDevour___casters= CreateGroup() -group MassDevour___targets= CreateGroup() +hashtable MassDevour__h= InitHashtable() +trigger MassDevour__castTrigger= CreateTrigger() +trigger MassDevour__deathTriggerCaster= CreateTrigger() +trigger MassDevour__deathTriggerTarget= CreateTrigger() +group MassDevour__casters= CreateGroup() +group MassDevour__targets= CreateGroup() // keys for targets -constant integer MassDevour___KEY_CASTER= 0 -constant integer MassDevour___KEY_DUMMY= 1 +constant integer MassDevour__KEY_CASTER= 0 +constant integer MassDevour__KEY_DUMMY= 1 // keys for casters -constant integer MassDevour___KEY_DUMMIES= 0 +constant integer MassDevour__KEY_DUMMIES= 0 -unit MassDevour___c= null -player MassDevour___owner= null -group MassDevour___dummies= null -unit MassDevour___tmpCaster= null +unit MassDevour__c= null +player MassDevour__owner= null +group MassDevour__dummies= null +unit MassDevour__tmpCaster= null //endglobals from MassDevour //globals from NewBonus: constant boolean LIBRARY_NewBonus=true @@ -2606,20 +2606,20 @@ constant abilityreallevelfield NewBonus__LIFE_STEAL_FIELD= ABILITY_RLF_LIFE_STOL constant boolean LIBRARY_Parry=true constant integer Parry_ABILITY_ID= 'A1Z5' constant integer Parry_BUFF_ABILITY_ID= 'A1Z7' -trigger Parry___castTrigger= CreateTrigger() -trigger Parry___attackTrigger= CreateTrigger() -group Parry___casters= CreateGroup() -hashtable Parry___h= InitHashtable() +trigger Parry__castTrigger= CreateTrigger() +trigger Parry__attackTrigger= CreateTrigger() +group Parry__casters= CreateGroup() +hashtable Parry__h= InitHashtable() //endglobals from Parry //globals from PhoenixEgg: constant boolean LIBRARY_PhoenixEgg=true constant integer PhoenixEgg_UNIT_TYPE_ID= 'h0VE' constant integer PhoenixEgg_ABILITY_ID= 'A1ZP' constant integer PhoenixEgg_ABILITY_ID_2= 'A24J' -trigger PhoenixEgg___summonTrigger= CreateTrigger() -trigger PhoenixEgg___deathTrigger= CreateTrigger() -group PhoenixEgg___eggs= CreateGroup() -hashtable PhoenixEgg___h= InitHashtable() +trigger PhoenixEgg__summonTrigger= CreateTrigger() +trigger PhoenixEgg__deathTrigger= CreateTrigger() +group PhoenixEgg__eggs= CreateGroup() +hashtable PhoenixEgg__h= InitHashtable() //endglobals from PhoenixEgg //globals from Railway: constant boolean LIBRARY_Railway=true @@ -2690,39 +2690,39 @@ constant boolean LIBRARY_SummonWall=true constant integer SummonWall_ABILITY_ID= 'A1E3' constant integer SummonWall_UNIT_TYPE_ID= 'h0P8' -trigger SummonWall___castTrigger= CreateTrigger() +trigger SummonWall__castTrigger= CreateTrigger() //endglobals from SummonWall //globals from TailSwipe: constant boolean LIBRARY_TailSwipe=true constant integer TailSwipe_ABILITY_ID= 'A1QI' integer TailSwipe_kbType= 0 -trigger TailSwipe___castTrigger= CreateTrigger() -player TailSwipe___tmpPlayer= null +trigger TailSwipe__castTrigger= CreateTrigger() +player TailSwipe__tmpPlayer= null //endglobals from TailSwipe //globals from Telekinesis: constant boolean LIBRARY_Telekinesis=true -constant real Telekinesis___MAX_DISTANCE= 700.0 -constant integer Telekinesis___ABILITY_ID= 'A0XZ' -constant integer Telekinesis___BUFF_ABILITY_ID= 'A0Y1' -constant integer Telekinesis___ITEM_ABILITY_ID= 'A1VM' +constant real Telekinesis__MAX_DISTANCE= 700.0 +constant integer Telekinesis__ABILITY_ID= 'A0XZ' +constant integer Telekinesis__BUFF_ABILITY_ID= 'A0Y1' +constant integer Telekinesis__ITEM_ABILITY_ID= 'A1VM' -hashtable Telekinesis___h= InitHashtable() -trigger Telekinesis___castTrigger= CreateTrigger() -group Telekinesis___casters= CreateGroup() +hashtable Telekinesis__h= InitHashtable() +trigger Telekinesis__castTrigger= CreateTrigger() +group Telekinesis__casters= CreateGroup() -constant integer Telekinesis___KEY_TARGET= 0 -constant integer Telekinesis___KEY_TARGET_TYPE= 1 +constant integer Telekinesis__KEY_TARGET= 0 +constant integer Telekinesis__KEY_TARGET_TYPE= 1 -constant integer Telekinesis___TARGET_TYPE_UNIT= 0 -constant integer Telekinesis___TARGET_TYPE_ITEM= 1 -constant integer Telekinesis___TARGET_TYPE_DESTRUCTABLE= 2 +constant integer Telekinesis__TARGET_TYPE_UNIT= 0 +constant integer Telekinesis__TARGET_TYPE_ITEM= 1 +constant integer Telekinesis__TARGET_TYPE_DESTRUCTABLE= 2 //endglobals from Telekinesis //globals from WoWReforgedFelOrcPiggery: constant boolean LIBRARY_WoWReforgedFelOrcPiggery=true constant integer WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_PIG_FARM= 'n0K3' constant integer WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_FEL_BOAR= 'n0KV' -trigger WoWReforgedFelOrcPiggery__constructedTrigger= CreateTrigger() -trigger WoWReforgedFelOrcPiggery__gatherTrigger= CreateTrigger() +trigger WoWReforgedFelOrcPiggery___constructedTrigger= CreateTrigger() +trigger WoWReforgedFelOrcPiggery___gatherTrigger= CreateTrigger() //endglobals from WoWReforgedFelOrcPiggery //globals from WoWReforgedProfessions: constant boolean LIBRARY_WoWReforgedProfessions=true @@ -2745,21 +2745,21 @@ constant integer PROFESSION_RANK_FINAL= PROFESSION_RANK_DOCTOR constant integer PROFESSION_MAX_CRAFTED= 4 -integer WoWReforgedProfessions___professionsCounter= 0 -integer array WoWReforgedProfessions___professions +integer WoWReforgedProfessions__professionsCounter= 0 +integer array WoWReforgedProfessions__professions -integer WoWReforgedProfessions___tmpRankCounter= PROFESSION_RANK_NOVICE +integer WoWReforgedProfessions__tmpRankCounter= PROFESSION_RANK_NOVICE -trigger WoWReforgedProfessions___castTrigger= CreateTrigger() +trigger WoWReforgedProfessions__castTrigger= CreateTrigger() //endglobals from WoWReforgedProfessions //globals from WoWReforgedRailRoad: constant boolean LIBRARY_WoWReforgedRailRoad=true //endglobals from WoWReforgedRailRoad //globals from WoWReforgedTradingPosts: constant boolean LIBRARY_WoWReforgedTradingPosts=true -trigger WoWReforgedTradingPosts__gatherTrigger= CreateTrigger() -integer array WoWReforgedTradingPosts__tradingPostResource -integer WoWReforgedTradingPosts__tradingPostResourceCount= 0 +trigger WoWReforgedTradingPosts___gatherTrigger= CreateTrigger() +integer array WoWReforgedTradingPosts___tradingPostResource +integer WoWReforgedTradingPosts___tradingPostResourceCount= 0 //endglobals from WoWReforgedTradingPosts //globals from NewBonusUtils: constant boolean LIBRARY_NewBonusUtils=true @@ -2801,12 +2801,12 @@ constant integer PROFESSION_BOOKS_SHOP= 'n06R' constant boolean LIBRARY_AuraSystem=true constant real AuraSystem_TIMER_UPDATE_INTERVAL= 0.5 constant real AuraSystem_BUFF_DURATION= 0.5 -hashtable AuraSystem___h= InitHashtable() -timer AuraSystem___t= CreateTimer() -trigger AuraSystem___learnTrigger= CreateTrigger() -trigger AuraSystem___unlearnTrigger= CreateTrigger() +hashtable AuraSystem__h= InitHashtable() +timer AuraSystem__t= CreateTimer() +trigger AuraSystem__learnTrigger= CreateTrigger() +trigger AuraSystem__unlearnTrigger= CreateTrigger() -integer AuraSystem___tmpAura= 0 +integer AuraSystem__tmpAura= 0 //endglobals from AuraSystem //globals from HighElfDiurnal: constant boolean LIBRARY_HighElfDiurnal=true @@ -2835,31 +2835,31 @@ constant integer ITEM_TYPE_ID_ORANGE= 'I0U3' constant integer ITEM_TYPE_ID_LEMON= 'I0U2' constant integer ITEM_TYPE_ID_MEAT= 'I0X1' -integer array WowReforgedCook__foodItemTypeIds -integer WowReforgedCook__foodItemTypeIdsCounter= 0 +integer array WowReforgedCook___foodItemTypeIds +integer WowReforgedCook___foodItemTypeIdsCounter= 0 //endglobals from WowReforgedCook //globals from WoWReforgedUtils: constant boolean LIBRARY_WoWReforgedUtils=true -trigger WoWReforgedUtils___levelTrigger= CreateTrigger() -boolean WoWReforgedUtils___initialized= false -boolean WoWReforgedUtils___isInSinglePlayer= true -player WoWReforgedUtils___tmpPlayer= null +trigger WoWReforgedUtils__levelTrigger= CreateTrigger() +boolean WoWReforgedUtils__initialized= false +boolean WoWReforgedUtils__isInSinglePlayer= true +player WoWReforgedUtils__tmpPlayer= null integer auraFilterFunc= 0 //endglobals from WoWReforgedUtils //globals from JumpSpellvJASSJangoFett: constant boolean LIBRARY_JumpSpellvJASSJangoFett=true -string JumpSpellvJASSJangoFett__EFF= "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" -constant integer JumpSpellvJASSJangoFett__AID= 'A0M2' -constant integer JumpSpellvJASSJangoFett__AID2= 'A0MC' -constant integer JumpSpellvJASSJangoFett__AID3= 'A1QJ' -constant integer JumpSpellvJASSJangoFett__DID= 'e000' -constant integer JumpSpellvJASSJangoFett__OID= 852121 -group JumpSpellvJASSJangoFett__ENU= CreateGroup() -constant real JumpSpellvJASSJangoFett__GRAVITY= 100 -constant real JumpSpellvJASSJangoFett__SPEED= 500 -constant real JumpSpellvJASSJangoFett__MAX_HEIGHT= 250 -constant real JumpSpellvJASSJangoFett__AOE= 200 -rect JumpSpellvJASSJangoFett__REC= Rect(0, 0, 0, 0) +string JumpSpellvJASSJangoFett___EFF= "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" +constant integer JumpSpellvJASSJangoFett___AID= 'A0M2' +constant integer JumpSpellvJASSJangoFett___AID2= 'A0MC' +constant integer JumpSpellvJASSJangoFett___AID3= 'A1QJ' +constant integer JumpSpellvJASSJangoFett___DID= 'e000' +constant integer JumpSpellvJASSJangoFett___OID= 852121 +group JumpSpellvJASSJangoFett___ENU= CreateGroup() +constant real JumpSpellvJASSJangoFett___GRAVITY= 100 +constant real JumpSpellvJASSJangoFett___SPEED= 500 +constant real JumpSpellvJASSJangoFett___MAX_HEIGHT= 250 +constant real JumpSpellvJASSJangoFett___AOE= 200 +rect JumpSpellvJASSJangoFett___REC= Rect(0, 0, 0, 0) //endglobals from JumpSpellvJASSJangoFett //globals from SaveCodeSystem: constant boolean LIBRARY_SaveCodeSystem=true @@ -2882,46 +2882,46 @@ integer SpellsSlideKnockbackType_kbType= 0 //endglobals from SpellsSlideKnockbackType //globals from WoWReforgedBanners: constant boolean LIBRARY_WoWReforgedBanners=true -integer array WoWReforgedBanners___skinItemTypeId -integer array WoWReforgedBanners___skinUnitTypeId -integer WoWReforgedBanners___skinCounter= 0 +integer array WoWReforgedBanners__skinItemTypeId +integer array WoWReforgedBanners__skinUnitTypeId +integer WoWReforgedBanners__skinCounter= 0 -trigger WoWReforgedBanners___constructionTrigger= CreateTrigger() -trigger WoWReforgedBanners___summonTrigger= CreateTrigger() -trigger WoWReforgedBanners___deathTrigger= CreateTrigger() +trigger WoWReforgedBanners__constructionTrigger= CreateTrigger() +trigger WoWReforgedBanners__summonTrigger= CreateTrigger() +trigger WoWReforgedBanners__deathTrigger= CreateTrigger() //endglobals from WoWReforgedBanners //globals from WoWReforgedBosses: constant boolean LIBRARY_WoWReforgedBosses=true -trigger WoWReforgedBosses___bossDeathTrigger= CreateTrigger() +trigger WoWReforgedBosses__bossDeathTrigger= CreateTrigger() -integer WoWReforgedBosses___legendaryItemsCounter= 0 -integer array WoWReforgedBosses___legendaryItemTypeId -unit array WoWReforgedBosses___legendaryItemBoss -unit array WoWReforgedBosses___legendaryItemBuilding -rect array WoWReforgedBosses___legendaryItemRect +integer WoWReforgedBosses__legendaryItemsCounter= 0 +integer array WoWReforgedBosses__legendaryItemTypeId +unit array WoWReforgedBosses__legendaryItemBoss +unit array WoWReforgedBosses__legendaryItemBuilding +rect array WoWReforgedBosses__legendaryItemRect //endglobals from WoWReforgedBosses //globals from WoWReforgedCamera: constant boolean LIBRARY_WoWReforgedCamera=true //endglobals from WoWReforgedCamera //globals from WoWReforgedClanShop: constant boolean LIBRARY_WoWReforgedClanShop=true -filterfunc WoWReforgedClanShop___filterIsClanShop= null +filterfunc WoWReforgedClanShop__filterIsClanShop= null -integer array WoWReforgedClanShop___clanBanners -integer WoWReforgedClanShop___clanBannersCount= 0 +integer array WoWReforgedClanShop__clanBanners +integer WoWReforgedClanShop__clanBannersCount= 0 -integer array WoWReforgedClanShop___clanSoundsItemTypeIds -sound array WoWReforgedClanShop___clanSoundsSounds -integer WoWReforgedClanShop___clanSoundsCount= 0 +integer array WoWReforgedClanShop__clanSoundsItemTypeIds +sound array WoWReforgedClanShop__clanSoundsSounds +integer WoWReforgedClanShop__clanSoundsCount= 0 -trigger WoWReforgedClanShop___sellTrigger= CreateTrigger() +trigger WoWReforgedClanShop__sellTrigger= CreateTrigger() //endglobals from WoWReforgedClanShop //globals from WoWReforgedEquipmentBags: constant boolean LIBRARY_WoWReforgedEquipmentBags=true -hashtable WoWReforgedEquipmentBags___h= InitHashtable() -hashtable WoWReforgedEquipmentBags___stackingHashTable= InitHashtable() -integer array WoWReforgedEquipmentBags___registeredItemTypeIds -integer WoWReforgedEquipmentBags___registeredItemTypeIdsCounter= 0 +hashtable WoWReforgedEquipmentBags__h= InitHashtable() +hashtable WoWReforgedEquipmentBags__stackingHashTable= InitHashtable() +integer array WoWReforgedEquipmentBags__registeredItemTypeIds +integer WoWReforgedEquipmentBags__registeredItemTypeIdsCounter= 0 constant integer MAX_EQUIPMENT_BAGS= 3 //endglobals from WoWReforgedEquipmentBags @@ -2943,15 +2943,15 @@ constant real Interval= 0.04 //endglobals from WoWReforgedKnockbackSimple //globals from WoWReforgedLearnableSkillsShop: constant boolean LIBRARY_WoWReforgedLearnableSkillsShop=true -trigger WoWReforgedLearnableSkillsShop___sellTrigger= CreateTrigger() -trigger WoWReforgedLearnableSkillsShop___constructionTrigger= CreateTrigger() -trigger WoWReforgedLearnableSkillsShop___summonTrigger= CreateTrigger() -trigger WoWReforgedLearnableSkillsShop___deathTrigger= CreateTrigger() -timer array WoWReforgedLearnableSkillsShop___cooldownTimer +trigger WoWReforgedLearnableSkillsShop__sellTrigger= CreateTrigger() +trigger WoWReforgedLearnableSkillsShop__constructionTrigger= CreateTrigger() +trigger WoWReforgedLearnableSkillsShop__summonTrigger= CreateTrigger() +trigger WoWReforgedLearnableSkillsShop__deathTrigger= CreateTrigger() +timer array WoWReforgedLearnableSkillsShop__cooldownTimer //endglobals from WoWReforgedLearnableSkillsShop //globals from WoWReforgedProfessionsTavern: constant boolean LIBRARY_WoWReforgedProfessionsTavern=true -trigger WoWReforgedProfessionsTavern___sellTrigger= CreateTrigger() +trigger WoWReforgedProfessionsTavern__sellTrigger= CreateTrigger() //endglobals from WoWReforgedProfessionsTavern //globals from WoWReforgedResurrectionStone: constant boolean LIBRARY_WoWReforgedResurrectionStone=true @@ -2959,49 +2959,49 @@ constant integer ITEM_ACTIVATE_RESURRECTION_STONE= 'I147' constant integer ITEM_DEACTIVATE_RESURRECTION_STONE= 'I14A' constant real RESURRECTION_TIME= 30.0 -integer array WoWReforgedResurrectionStone__resurrectionStones -integer WoWReforgedResurrectionStone__resurrectionStonesCounter= 0 +integer array WoWReforgedResurrectionStone___resurrectionStones +integer WoWReforgedResurrectionStone___resurrectionStonesCounter= 0 -trigger WoWReforgedResurrectionStone__deathTrigger= CreateTrigger() -trigger WoWReforgedResurrectionStone__reviveTrigger= CreateTrigger() -trigger WoWReforgedResurrectionStone__chatTrigger= CreateTrigger() -hashtable WoWReforgedResurrectionStone__h= InitHashtable() +trigger WoWReforgedResurrectionStone___deathTrigger= CreateTrigger() +trigger WoWReforgedResurrectionStone___reviveTrigger= CreateTrigger() +trigger WoWReforgedResurrectionStone___chatTrigger= CreateTrigger() +hashtable WoWReforgedResurrectionStone___h= InitHashtable() -integer array WoWReforgedResurrectionStone__heroResurrectionStones -timer array WoWReforgedResurrectionStone__heroResurrectionTimers +integer array WoWReforgedResurrectionStone___heroResurrectionStones +timer array WoWReforgedResurrectionStone___heroResurrectionTimers //endglobals from WoWReforgedResurrectionStone //globals from WoWReforgedSkins: constant boolean LIBRARY_WoWReforgedSkins=true -integer array WoWReforgedSkins___skinItemTypeId -integer array WoWReforgedSkins___skinUnitTypeId -integer WoWReforgedSkins___skinCounter= 0 - -trigger WoWReforgedSkins___sellTrigger= CreateTrigger() -trigger WoWReforgedSkins___constructionTrigger= CreateTrigger() -trigger WoWReforgedSkins___summonTrigger= CreateTrigger() -trigger WoWReforgedSkins___deathTrigger= CreateTrigger() +integer array WoWReforgedSkins__skinItemTypeId +integer array WoWReforgedSkins__skinUnitTypeId +integer WoWReforgedSkins__skinCounter= 0 + +trigger WoWReforgedSkins__sellTrigger= CreateTrigger() +trigger WoWReforgedSkins__constructionTrigger= CreateTrigger() +trigger WoWReforgedSkins__summonTrigger= CreateTrigger() +trigger WoWReforgedSkins__deathTrigger= CreateTrigger() //endglobals from WoWReforgedSkins //globals from WoWReforgedSummonedUnits: constant boolean LIBRARY_WoWReforgedSummonedUnits=true -group array WoWReforgedSummonedUnits__summonedUnits -trigger WoWReforgedSummonedUnits__summonTrigger= CreateTrigger() -trigger WoWReforgedSummonedUnits__deathTrigger= CreateTrigger() -trigger WoWReforgedSummonedUnits__changeOwnerTrigger= CreateTrigger() -trigger WoWReforgedSummonedUnits__selectTrigger= CreateTrigger() +group array WoWReforgedSummonedUnits___summonedUnits +trigger WoWReforgedSummonedUnits___summonTrigger= CreateTrigger() +trigger WoWReforgedSummonedUnits___deathTrigger= CreateTrigger() +trigger WoWReforgedSummonedUnits___changeOwnerTrigger= CreateTrigger() +trigger WoWReforgedSummonedUnits___selectTrigger= CreateTrigger() //endglobals from WoWReforgedSummonedUnits //globals from WoWReforgedVIPs: constant boolean LIBRARY_WoWReforgedVIPs=true -integer WoWReforgedVIPs___vipCounter= 0 -string array WoWReforgedVIPs___vips +integer WoWReforgedVIPs__vipCounter= 0 +string array WoWReforgedVIPs__vips -force WoWReforgedVIPs___vipPlayers= CreateForce() +force WoWReforgedVIPs__vipPlayers= CreateForce() //endglobals from WoWReforgedVIPs //globals from WowReforgedRespawnUtils: constant boolean LIBRARY_WowReforgedRespawnUtils=true //endglobals from WowReforgedRespawnUtils //globals from WoWReforgedAiPlayersUi: constant boolean LIBRARY_WoWReforgedAiPlayersUi=true -constant string WoWReforgedAiPlayersUi__PREFIX= "AiPlayersUi" +constant string WoWReforgedAiPlayersUi___PREFIX= "AiPlayersUi" constant integer AI_PLAYERS_UI_MAX_PLAYERS= 1 @@ -3164,121 +3164,121 @@ constant integer AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_GOLEM_SCULPTOR= 15 constant integer AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_WARLOCK= 16 constant integer AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ASTROMANCER= 17 -integer WoWReforgedAiPlayersUi__Counter= 0 -integer WoWReforgedAiPlayersUi__MaxPages= 0 -force WoWReforgedAiPlayersUi__Force= CreateForce() -integer WoWReforgedAiPlayersUi__Page= 0 +integer WoWReforgedAiPlayersUi___Counter= 0 +integer WoWReforgedAiPlayersUi___MaxPages= 0 +force WoWReforgedAiPlayersUi___Force= CreateForce() +integer WoWReforgedAiPlayersUi___Page= 0 -framehandle WoWReforgedAiPlayersUi__BackgroundFrame -framehandle WoWReforgedAiPlayersUi__TitleFrame +framehandle WoWReforgedAiPlayersUi___BackgroundFrame +framehandle WoWReforgedAiPlayersUi___TitleFrame // header line -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnPlayerName -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnColor -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnTeam -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnHero -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevel -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnStartLocation -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnRace -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnProfession -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnStartGold -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnStartLumber -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimit -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolution -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnStartImprovedPowerGenerator -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnStartImprovedCreepHunter -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnStartImprovedNavy -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayers -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnHeroes -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnExpansions -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnSharedControl -framehandle WoWReforgedAiPlayersUi__LabelFrameColumnDifficulty +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnPlayerName +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnColor +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnTeam +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnHero +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevel +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnStartLocation +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnRace +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnProfession +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnStartGold +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnStartLumber +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimit +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolution +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnStartImprovedPowerGenerator +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnStartImprovedCreepHunter +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnStartImprovedNavy +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayers +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnHeroes +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnExpansions +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnSharedControl +framehandle WoWReforgedAiPlayersUi___LabelFrameColumnDifficulty // sync data -string array WoWReforgedAiPlayersUi__PlayerNames -integer array WoWReforgedAiPlayersUi__Color -integer array WoWReforgedAiPlayersUi__Teams -integer array WoWReforgedAiPlayersUi__Heroes -integer array WoWReforgedAiPlayersUi__HeroStartLevels -integer array WoWReforgedAiPlayersUi__StartLocations -integer array WoWReforgedAiPlayersUi__Races -integer array WoWReforgedAiPlayersUi__Professions -integer array WoWReforgedAiPlayersUi__StartGold -integer array WoWReforgedAiPlayersUi__StartLumber -integer array WoWReforgedAiPlayersUi__FoodLimit -integer array WoWReforgedAiPlayersUi__StartEvolution -integer array WoWReforgedAiPlayersUi__AttackPlayers -integer array WoWReforgedAiPlayersUi__HeroesCount -integer array WoWReforgedAiPlayersUi__Expansions -integer array WoWReforgedAiPlayersUi__SharedControl -integer array WoWReforgedAiPlayersUi__Difficulty -boolean array WoWReforgedAiPlayersUi__SyncDone - -trigger WoWReforgedAiPlayersUi__SyncTrigger +string array WoWReforgedAiPlayersUi___PlayerNames +integer array WoWReforgedAiPlayersUi___Color +integer array WoWReforgedAiPlayersUi___Teams +integer array WoWReforgedAiPlayersUi___Heroes +integer array WoWReforgedAiPlayersUi___HeroStartLevels +integer array WoWReforgedAiPlayersUi___StartLocations +integer array WoWReforgedAiPlayersUi___Races +integer array WoWReforgedAiPlayersUi___Professions +integer array WoWReforgedAiPlayersUi___StartGold +integer array WoWReforgedAiPlayersUi___StartLumber +integer array WoWReforgedAiPlayersUi___FoodLimit +integer array WoWReforgedAiPlayersUi___StartEvolution +integer array WoWReforgedAiPlayersUi___AttackPlayers +integer array WoWReforgedAiPlayersUi___HeroesCount +integer array WoWReforgedAiPlayersUi___Expansions +integer array WoWReforgedAiPlayersUi___SharedControl +integer array WoWReforgedAiPlayersUi___Difficulty +boolean array WoWReforgedAiPlayersUi___SyncDone + +trigger WoWReforgedAiPlayersUi___SyncTrigger // async -integer array WoWReforgedAiPlayersUi__SharedControlAsync +integer array WoWReforgedAiPlayersUi___SharedControlAsync // player lines -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUpFrame -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDownFrame -integer array WoWReforgedAiPlayersUi__ColorLocal -trigger array WoWReforgedAiPlayersUi__ColorPopupMenuTrigger -trigger array WoWReforgedAiPlayersUi__ColorUpTrigger -trigger array WoWReforgedAiPlayersUi__ColorDownTrigger -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUpFrame -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDownFrame -trigger array WoWReforgedAiPlayersUi__HeroUpTrigger -trigger array WoWReforgedAiPlayersUi__HeroDownTrigger -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUpFrame -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDownFrame -trigger array WoWReforgedAiPlayersUi__RaceUpTrigger -trigger array WoWReforgedAiPlayersUi__RaceDownTrigger -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnStartImprovedPowerGeneratorEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnStartImprovedCreepHunterEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnStartImprovedNavyEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox -framehandle array WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit -trigger array WoWReforgedAiPlayersUi__checkSharedControlTrigger -trigger array WoWReforgedAiPlayersUi__uncheckSharedControlTrigger +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUpFrame +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDownFrame +integer array WoWReforgedAiPlayersUi___ColorLocal +trigger array WoWReforgedAiPlayersUi___ColorPopupMenuTrigger +trigger array WoWReforgedAiPlayersUi___ColorUpTrigger +trigger array WoWReforgedAiPlayersUi___ColorDownTrigger +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUpFrame +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDownFrame +trigger array WoWReforgedAiPlayersUi___HeroUpTrigger +trigger array WoWReforgedAiPlayersUi___HeroDownTrigger +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUpFrame +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDownFrame +trigger array WoWReforgedAiPlayersUi___RaceUpTrigger +trigger array WoWReforgedAiPlayersUi___RaceDownTrigger +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnStartImprovedPowerGeneratorEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnStartImprovedCreepHunterEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnStartImprovedNavyEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox +framehandle array WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit +trigger array WoWReforgedAiPlayersUi___checkSharedControlTrigger +trigger array WoWReforgedAiPlayersUi___uncheckSharedControlTrigger // bottom buttons -framehandle WoWReforgedAiPlayersUi__PreviousPageButton -trigger WoWReforgedAiPlayersUi__PreviousPageTrigger +framehandle WoWReforgedAiPlayersUi___PreviousPageButton +trigger WoWReforgedAiPlayersUi___PreviousPageTrigger -framehandle WoWReforgedAiPlayersUi__NextPageButton -trigger WoWReforgedAiPlayersUi__NextPageTrigger +framehandle WoWReforgedAiPlayersUi___NextPageButton +trigger WoWReforgedAiPlayersUi___NextPageTrigger -framehandle WoWReforgedAiPlayersUi__ApplyButton -trigger WoWReforgedAiPlayersUi__ApplyTrigger +framehandle WoWReforgedAiPlayersUi___ApplyButton +trigger WoWReforgedAiPlayersUi___ApplyTrigger //endglobals from WoWReforgedAiPlayersUi //globals from WoWReforgedArmorer: constant boolean LIBRARY_WoWReforgedArmorer=true -constant integer WoWReforgedArmorer__ABILITY_ID= 'A104' -trigger WoWReforgedArmorer__castTrigger= CreateTrigger() +constant integer WoWReforgedArmorer___ABILITY_ID= 'A104' +trigger WoWReforgedArmorer___castTrigger= CreateTrigger() //endglobals from WoWReforgedArmorer //globals from WoWReforgedCraftingStash: constant boolean LIBRARY_WoWReforgedCraftingStash=true @@ -3325,16 +3325,16 @@ constant boolean LIBRARY_WoWReforgedHeroUtils=true //endglobals from WoWReforgedHeroUtils //globals from WoWReforgedHeroesTavern: constant boolean LIBRARY_WoWReforgedHeroesTavern=true -unit WoWReforgedHeroesTavern___tmpUnit= null -integer WoWReforgedHeroesTavern___index= 0 -string WoWReforgedHeroesTavern___tmpString= null +unit WoWReforgedHeroesTavern__tmpUnit= null +integer WoWReforgedHeroesTavern__index= 0 +string WoWReforgedHeroesTavern__tmpString= null -trigger WoWReforgedHeroesTavern___sellTrigger= CreateTrigger() +trigger WoWReforgedHeroesTavern__sellTrigger= CreateTrigger() //endglobals from WoWReforgedHeroesTavern //globals from WoWReforgedInscriptor: constant boolean LIBRARY_WoWReforgedInscriptor=true -hashtable WoWReforgedInscriptor__h= InitHashtable() -group WoWReforgedInscriptor__targets= CreateGroup() +hashtable WoWReforgedInscriptor___h= InitHashtable() +group WoWReforgedInscriptor___targets= CreateGroup() constant integer INSCRIPTOR_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS= 1 constant integer INSCRIPTOR_SYSTEM_KEY_DAMAGE_BONUS= 2 @@ -3367,32 +3367,32 @@ constant integer INSCRIPTOR_HIT_POINTS_BONUS_DOCTOR= 300 constant integer INSCRIPTION_HERO_SPELL= 'A1YB' -trigger WoWReforgedInscriptor__pickupItemTrigger= CreateTrigger() -trigger WoWReforgedInscriptor__dropItemTrigger= CreateTrigger() -trigger WoWReforgedInscriptor__learnTrigger= CreateTrigger() +trigger WoWReforgedInscriptor___pickupItemTrigger= CreateTrigger() +trigger WoWReforgedInscriptor___dropItemTrigger= CreateTrigger() +trigger WoWReforgedInscriptor___learnTrigger= CreateTrigger() //endglobals from WoWReforgedInscriptor //globals from WoWReforgedMounts: constant boolean LIBRARY_WoWReforgedMounts=true -constant integer WoWReforgedMounts__MAX_ABILITIES= 8 -hashtable WoWReforgedMounts__h= InitHashtable() -integer array WoWReforgedMounts__mountData1 -integer array WoWReforgedMounts__mountData2 -integer array WoWReforgedMounts__mountData3 - -constant integer WoWReforgedMounts__KEY_MOUNT= 0 -constant integer WoWReforgedMounts__KEY_HERO= 1 +constant integer WoWReforgedMounts___MAX_ABILITIES= 8 +hashtable WoWReforgedMounts___h= InitHashtable() +integer array WoWReforgedMounts___mountData1 +integer array WoWReforgedMounts___mountData2 +integer array WoWReforgedMounts___mountData3 + +constant integer WoWReforgedMounts___KEY_MOUNT= 0 +constant integer WoWReforgedMounts___KEY_HERO= 1 constant integer WoWReforgedMounts_MOUNTS_HERO_LEVEL= 20 constant integer WoWReforgedMounts_MOUNTS_CAGE= 'o04H' -integer array WoWReforgedMounts__mountTypes -integer WoWReforgedMounts__mountTypesCounter= 0 +integer array WoWReforgedMounts___mountTypes +integer WoWReforgedMounts___mountTypesCounter= 0 -trigger WoWReforgedMounts__sellTrigger= CreateTrigger() -trigger WoWReforgedMounts__levelTrigger= CreateTrigger() -trigger WoWReforgedMounts__summonTrigger= CreateTrigger() -trigger WoWReforgedMounts__constructionTrigger= CreateTrigger() -boolean array WoWReforgedMounts__playerHasMounts -integer WoWReforgedMounts__tmpAbilityId= 0 +trigger WoWReforgedMounts___sellTrigger= CreateTrigger() +trigger WoWReforgedMounts___levelTrigger= CreateTrigger() +trigger WoWReforgedMounts___summonTrigger= CreateTrigger() +trigger WoWReforgedMounts___constructionTrigger= CreateTrigger() +boolean array WoWReforgedMounts___playerHasMounts +integer WoWReforgedMounts___tmpAbilityId= 0 constant integer WoWReforgedMounts_RUNNING_WILD_ITEM_TYPE_ID= 'I0HU' constant integer WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATH_KNIGHT= 'A11Y' constant integer WoWReforgedMounts_WORGEN_DEATH_KNIGHT= 'U01K' @@ -3486,42 +3486,42 @@ constant integer RACE_OBJECT_TYPE_SHIP_SPECIAL_2= 74 constant integer RACE_MAX_OBJECT_TYPES= 75 -hashtable WoWReforgedRaces___objectTypeHashTable= InitHashtable() -hashtable WoWReforgedRaces___objectTypeIdHashTable= InitHashtable() +hashtable WoWReforgedRaces__objectTypeHashTable= InitHashtable() +hashtable WoWReforgedRaces__objectTypeIdHashTable= InitHashtable() -integer array WoWReforgedRaces___objectTypeCreeps -integer WoWReforgedRaces___objectTypeCreepsCounter= 0 +integer array WoWReforgedRaces__objectTypeCreeps +integer WoWReforgedRaces__objectTypeCreepsCounter= 0 -integer array WoWReforgedRaces___objectTypeNeutralUnits -integer WoWReforgedRaces___objectTypeNeutralUnitsCounter= 0 +integer array WoWReforgedRaces__objectTypeNeutralUnits +integer WoWReforgedRaces__objectTypeNeutralUnitsCounter= 0 -integer array WoWReforgedRaces___objectTypeNeutralBuildings -integer WoWReforgedRaces___objectTypeNeutralBuildingsCounter= 0 +integer array WoWReforgedRaces__objectTypeNeutralBuildings +integer WoWReforgedRaces__objectTypeNeutralBuildingsCounter= 0 -integer array WoWReforgedRaces___objectTypeAbilities -integer array WoWReforgedRaces___objectTypeAbilitiesLevels -integer array WoWReforgedRaces___objectTypeAbilitiesRace -integer WoWReforgedRaces___objectTypeAbilitiesCounter= 0 +integer array WoWReforgedRaces__objectTypeAbilities +integer array WoWReforgedRaces__objectTypeAbilitiesLevels +integer array WoWReforgedRaces__objectTypeAbilitiesRace +integer WoWReforgedRaces__objectTypeAbilitiesCounter= 0 //endglobals from WoWReforgedRaces //globals from WoWReforgedStandardHeroAbilities: constant boolean LIBRARY_WoWReforgedStandardHeroAbilities=true -integer array WoWReforgedStandardHeroAbilities___standardHeroAbilities -integer WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter= 0 - -trigger WoWReforgedStandardHeroAbilities___sellTrigger= CreateTrigger() -trigger WoWReforgedStandardHeroAbilities___constructionTrigger= CreateTrigger() -trigger WoWReforgedStandardHeroAbilities___summonTrigger= CreateTrigger() -trigger WoWReforgedStandardHeroAbilities___deathTrigger= CreateTrigger() -trigger WoWReforgedStandardHeroAbilities___levelTrigger= CreateTrigger() +integer array WoWReforgedStandardHeroAbilities__standardHeroAbilities +integer WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter= 0 + +trigger WoWReforgedStandardHeroAbilities__sellTrigger= CreateTrigger() +trigger WoWReforgedStandardHeroAbilities__constructionTrigger= CreateTrigger() +trigger WoWReforgedStandardHeroAbilities__summonTrigger= CreateTrigger() +trigger WoWReforgedStandardHeroAbilities__deathTrigger= CreateTrigger() +trigger WoWReforgedStandardHeroAbilities__levelTrigger= CreateTrigger() //endglobals from WoWReforgedStandardHeroAbilities //globals from WoWReforgedStats: constant boolean LIBRARY_WoWReforgedStats=true -integer WoWReforgedStats__currentRow= 1 +integer WoWReforgedStats___currentRow= 1 //endglobals from WoWReforgedStats //globals from WoWReforgedWeaponSmith: constant boolean LIBRARY_WoWReforgedWeaponSmith=true -constant integer WoWReforgedWeaponSmith__ABILITY_ID= 'A106' -trigger WoWReforgedWeaponSmith__castTrigger= CreateTrigger() +constant integer WoWReforgedWeaponSmith___ABILITY_ID= 'A106' +trigger WoWReforgedWeaponSmith___castTrigger= CreateTrigger() //endglobals from WoWReforgedWeaponSmith //globals from CinematicsRaces: constant boolean LIBRARY_CinematicsRaces=true @@ -3554,54 +3554,54 @@ integer SaveObjectResearchCounter= 1 //endglobals from SaveCodeObjectSystem //globals from WoWReforgedAchievements: constant boolean LIBRARY_WoWReforgedAchievements=true -group array WoWReforgedAchievements__conquerorTownHalls -integer WoWReforgedAchievements__questsCompleted= 0 -integer WoWReforgedAchievements__playersDefeated= 0 -integer array WoWReforgedAchievements__playerHeroKills -hashtable WoWReforgedAchievements__bossKillsHashTable= InitHashtable() -boolean array WoWReforgedAchievements__playerBossKillAchievements -hashtable WoWReforgedAchievements__unitTypeKillsHashTable= InitHashtable() -boolean array WoWReforgedAchievements__playerHasEveryCreepTypeAchievement -integer WoWReforgedAchievements__treesKilled= 0 -real array WoWReforgedAchievements__playerDamageTaken -real array WoWReforgedAchievements__playerDamageCaused -trigger WoWReforgedAchievements__damageTrigger= CreateTrigger() -boolean array WoWReforgedAchievements__playerOverpopulation -integer array WoWReforgedAchievements__playerLockPicks -integer array WoWReforgedAchievements__playerPickPockets -integer array WoWReforgedAchievements__playerHeroDeaths -integer array WoWReforgedAchievements__playerUndeadKills -integer array WoWReforgedAchievements__playerNonUndeadKills -integer array WoWReforgedAchievements__playerCitizenKills -integer array WoWReforgedAchievements__playerOil -boolean array WoWReforgedAchievements__playerCompletedAllAchievements -integer array WoWReforgedAchievements__playerPropertyCounter -integer array WoWReforgedAchievements__playerZonesCounter -integer array WoWReforgedAchievements__playerRacingTracks -trigger WoWReforgedAchievements__constructionFinishedTrigger= CreateTrigger() -trigger WoWReforgedAchievements__deathTrigger= CreateTrigger() -trigger WoWReforgedAchievements__gatherTrigger= CreateTrigger() - -integer WoWReforgedAchievements__achievementsCounter= 0 -integer array WoWReforgedAchievements__achievements +group array WoWReforgedAchievements___conquerorTownHalls +integer WoWReforgedAchievements___questsCompleted= 0 +integer WoWReforgedAchievements___playersDefeated= 0 +integer array WoWReforgedAchievements___playerHeroKills +hashtable WoWReforgedAchievements___bossKillsHashTable= InitHashtable() +boolean array WoWReforgedAchievements___playerBossKillAchievements +hashtable WoWReforgedAchievements___unitTypeKillsHashTable= InitHashtable() +boolean array WoWReforgedAchievements___playerHasEveryCreepTypeAchievement +integer WoWReforgedAchievements___treesKilled= 0 +real array WoWReforgedAchievements___playerDamageTaken +real array WoWReforgedAchievements___playerDamageCaused +trigger WoWReforgedAchievements___damageTrigger= CreateTrigger() +boolean array WoWReforgedAchievements___playerOverpopulation +integer array WoWReforgedAchievements___playerLockPicks +integer array WoWReforgedAchievements___playerPickPockets +integer array WoWReforgedAchievements___playerHeroDeaths +integer array WoWReforgedAchievements___playerUndeadKills +integer array WoWReforgedAchievements___playerNonUndeadKills +integer array WoWReforgedAchievements___playerCitizenKills +integer array WoWReforgedAchievements___playerOil +boolean array WoWReforgedAchievements___playerCompletedAllAchievements +integer array WoWReforgedAchievements___playerPropertyCounter +integer array WoWReforgedAchievements___playerZonesCounter +integer array WoWReforgedAchievements___playerRacingTracks +trigger WoWReforgedAchievements___constructionFinishedTrigger= CreateTrigger() +trigger WoWReforgedAchievements___deathTrigger= CreateTrigger() +trigger WoWReforgedAchievements___gatherTrigger= CreateTrigger() + +integer WoWReforgedAchievements___achievementsCounter= 0 +integer array WoWReforgedAchievements___achievements //endglobals from WoWReforgedAchievements //globals from WoWReforgedAlchemistLab: constant boolean LIBRARY_WoWReforgedAlchemistLab=true constant integer ABILITY_ID_CONVERT_UNIT= 'A16S' constant integer ABILITY_ID_CONVERT_ITEM= 'A1BI' -trigger WoWReforgedAlchemistLab__constructionTrigger= CreateTrigger() -trigger WoWReforgedAlchemistLab__sellTrigger= CreateTrigger() -trigger WoWReforgedAlchemistLab__castTrigger= CreateTrigger() -trigger array WoWReforgedAlchemistLab__convertTriggers -integer WoWReforgedAlchemistLab__convertTriggersCounter= 0 -unit WoWReforgedAlchemistLab__triggerConverter= null -unit WoWReforgedAlchemistLab__triggerReplacingUnit= null -item WoWReforgedAlchemistLab__triggerReplacingItem= null +trigger WoWReforgedAlchemistLab___constructionTrigger= CreateTrigger() +trigger WoWReforgedAlchemistLab___sellTrigger= CreateTrigger() +trigger WoWReforgedAlchemistLab___castTrigger= CreateTrigger() +trigger array WoWReforgedAlchemistLab___convertTriggers +integer WoWReforgedAlchemistLab___convertTriggersCounter= 0 +unit WoWReforgedAlchemistLab___triggerConverter= null +unit WoWReforgedAlchemistLab___triggerReplacingUnit= null +item WoWReforgedAlchemistLab___triggerReplacingItem= null //endglobals from WoWReforgedAlchemistLab //globals from WoWReforgedAltars: constant boolean LIBRARY_WoWReforgedAltars=true -player WoWReforgedAltars__filterPlayer= null +player WoWReforgedAltars___filterPlayer= null //endglobals from WoWReforgedAltars //globals from WoWReforgedBuilder: constant boolean LIBRARY_WoWReforgedBuilder=true @@ -3613,17 +3613,17 @@ constant integer ITEM_TYPE_ID_NEUTRAL_PASSIVE= 'I0W1' constant integer ITEM_TYPE_ID_COLOR_RED= 'I0W2' -integer array WoWReforgedBuilder___targetPlayerIndex +integer array WoWReforgedBuilder__targetPlayerIndex -trigger WoWReforgedBuilder___sellTrigger= CreateTrigger() -trigger WoWReforgedBuilder___orderTrigger= CreateTrigger() -trigger WoWReforgedBuilder___orderTargetTrigger= CreateTrigger() +trigger WoWReforgedBuilder__sellTrigger= CreateTrigger() +trigger WoWReforgedBuilder__orderTrigger= CreateTrigger() +trigger WoWReforgedBuilder__orderTargetTrigger= CreateTrigger() //endglobals from WoWReforgedBuilder //globals from WoWReforgedClans: constant boolean LIBRARY_WoWReforgedClans=true constant integer SAVE_CODE_MAX_CLAN_MEMBERS= 6 -timer WoWReforgedClans___clanResourceTimer= CreateTimer() -boolean WoWReforgedClans___clanResourceTimerStarted= false +timer WoWReforgedClans__clanResourceTimer= CreateTimer() +boolean WoWReforgedClans__clanResourceTimerStarted= false //endglobals from WoWReforgedClans //globals from WoWReforgedCreeps: constant boolean LIBRARY_WoWReforgedCreeps=true @@ -3633,7 +3633,7 @@ constant boolean LIBRARY_WoWReforgedRacesLimits=true //endglobals from WoWReforgedRacesLimits //globals from WoWReforgedRacesTavern: constant boolean LIBRARY_WoWReforgedRacesTavern=true -trigger WoWReforgedRacesTavern___sellTrigger= CreateTrigger() +trigger WoWReforgedRacesTavern__sellTrigger= CreateTrigger() //endglobals from WoWReforgedRacesTavern //globals from WoWReforgedRecreateHeroItems: constant boolean LIBRARY_WoWReforgedRecreateHeroItems=true @@ -3660,15 +3660,15 @@ constant integer RANDOM_WATER_MINE= 'n0DT' constant integer WATER_OIL_PLATFORM= 'n0DU' constant integer FLOTSAM= 'n0DJ' -integer WoWReforgedResources___maxMines= 0 -integer array WoWReforgedResources___mineTypes -integer array WoWReforgedResources___mineResource -integer array WoWReforgedResources___mineStartAmount +integer WoWReforgedResources__maxMines= 0 +integer array WoWReforgedResources__mineTypes +integer array WoWReforgedResources__mineResource +integer array WoWReforgedResources__mineStartAmount -integer WoWReforgedResources___maxWaterMines= 0 -integer array WoWReforgedResources___waterMineTypes -integer array WoWReforgedResources___waterMineResource -integer array WoWReforgedResources___waterMineStartAmount +integer WoWReforgedResources__maxWaterMines= 0 +integer array WoWReforgedResources__waterMineTypes +integer array WoWReforgedResources__waterMineResource +integer array WoWReforgedResources__waterMineStartAmount //endglobals from WoWReforgedResources //globals from WoWReforgedSaddle: constant boolean LIBRARY_WoWReforgedSaddle=true @@ -3682,38 +3682,38 @@ constant integer SCEPTERS_SHOP= 'n06Q' //endglobals from WoWReforgedSceptersShop //globals from WoWReforgedThievesGuild: constant boolean LIBRARY_WoWReforgedThievesGuild=true -trigger WoWReforgedThievesGuild__deathTrigger= CreateTrigger() -trigger WoWReforgedThievesGuild__changesOwnerTrigger= CreateTrigger() -trigger WoWReforgedThievesGuild__constructFinishTrigger= CreateTrigger() -trigger WoWReforgedThievesGuild__sellUnitTrigger= CreateTrigger() -trigger WoWReforgedThievesGuild__sellItemTrigger= CreateTrigger() +trigger WoWReforgedThievesGuild___deathTrigger= CreateTrigger() +trigger WoWReforgedThievesGuild___changesOwnerTrigger= CreateTrigger() +trigger WoWReforgedThievesGuild___constructFinishTrigger= CreateTrigger() +trigger WoWReforgedThievesGuild___sellUnitTrigger= CreateTrigger() +trigger WoWReforgedThievesGuild___sellItemTrigger= CreateTrigger() -timer WoWReforgedThievesGuild__stockUpdateTimer= CreateTimer() +timer WoWReforgedThievesGuild___stockUpdateTimer= CreateTimer() -group WoWReforgedThievesGuild__thievesGuilds= CreateGroup() -unit WoWReforgedThievesGuild__tmpUnit= null -player WoWReforgedThievesGuild__tmpPreviousOwner= null +group WoWReforgedThievesGuild___thievesGuilds= CreateGroup() +unit WoWReforgedThievesGuild___tmpUnit= null +player WoWReforgedThievesGuild___tmpPreviousOwner= null //endglobals from WoWReforgedThievesGuild //globals from WoWReforgedWitchHut: constant boolean LIBRARY_WoWReforgedWitchHut=true constant integer WoWReforgedWitchHut_UNIT_TYPE= 'o05F' constant integer WoWReforgedWitchHut_UNIT_TYPE_REMOVE_ABILITIES= 'u01W' -hashtable WoWReforgedWitchHut__h= InitHashtable() -integer array WoWReforgedWitchHut__unitTypeIds -integer array WoWReforgedWitchHut__abilityIds -integer WoWReforgedWitchHut__unitTypeIdsCounter= 0 -group WoWReforgedWitchHut__witchHuts= CreateGroup() -trigger WoWReforgedWitchHut__constructionTrigger= CreateTrigger() -trigger WoWReforgedWitchHut__deathTrigger= CreateTrigger() -trigger WoWReforgedWitchHut__sellTrigger= CreateTrigger() +hashtable WoWReforgedWitchHut___h= InitHashtable() +integer array WoWReforgedWitchHut___unitTypeIds +integer array WoWReforgedWitchHut___abilityIds +integer WoWReforgedWitchHut___unitTypeIdsCounter= 0 +group WoWReforgedWitchHut___witchHuts= CreateGroup() +trigger WoWReforgedWitchHut___constructionTrigger= CreateTrigger() +trigger WoWReforgedWitchHut___deathTrigger= CreateTrigger() +trigger WoWReforgedWitchHut___sellTrigger= CreateTrigger() //endglobals from WoWReforgedWitchHut //globals from WoWReforgedWrapUp: constant boolean LIBRARY_WoWReforgedWrapUp=true -trigger WoWReforgedWrapUp___constructionTrigger= CreateTrigger() -trigger WoWReforgedWrapUp___deathTrigger= CreateTrigger() -group WoWReforgedWrapUp___constructedBuildings= CreateGroup() -player WoWReforgedWrapUp___tmpPlayer= null +trigger WoWReforgedWrapUp__constructionTrigger= CreateTrigger() +trigger WoWReforgedWrapUp__deathTrigger= CreateTrigger() +group WoWReforgedWrapUp__constructedBuildings= CreateGroup() +player WoWReforgedWrapUp__tmpPlayer= null //endglobals from WoWReforgedWrapUp //globals from WowReforgedMultiply: constant boolean LIBRARY_WowReforgedMultiply=true @@ -3721,26 +3721,26 @@ constant integer WowReforgedMultiply_ABILITY_ID= 'A184' constant integer WowReforgedMultiply_BUFF_ID= 'BFig' constant real WowReforgedMultiply_DURATION= 60.0 -trigger WowReforgedMultiply__castTrigger= CreateTrigger() +trigger WowReforgedMultiply___castTrigger= CreateTrigger() //endglobals from WowReforgedMultiply //globals from MaxHpResearch: constant boolean LIBRARY_MaxHpResearch=true -integer array MaxHpResearch___researches -integer MaxHpResearch___researchesCounter= 0 +integer array MaxHpResearch__researches +integer MaxHpResearch__researchesCounter= 0 -integer MaxHpResearch___filterResearch= 0 +integer MaxHpResearch__filterResearch= 0 -trigger MaxHpResearch___trainTrigger= CreateTrigger() -trigger MaxHpResearch___summonTrigger= CreateTrigger() -trigger MaxHpResearch___sellTrigger= CreateTrigger() -trigger MaxHpResearch___changeOwnerTrigger= CreateTrigger() -trigger MaxHpResearch___researchTrigger= CreateTrigger() -trigger MaxHpResearch___upgradeTrigger= CreateTrigger() +trigger MaxHpResearch__trainTrigger= CreateTrigger() +trigger MaxHpResearch__summonTrigger= CreateTrigger() +trigger MaxHpResearch__sellTrigger= CreateTrigger() +trigger MaxHpResearch__changeOwnerTrigger= CreateTrigger() +trigger MaxHpResearch__researchTrigger= CreateTrigger() +trigger MaxHpResearch__upgradeTrigger= CreateTrigger() //endglobals from MaxHpResearch //globals from WoWReforgedArena: constant boolean LIBRARY_WoWReforgedArena=true -integer array WoWReforgedArena__tickets -integer WoWReforgedArena__ticketsCounter= 0 +integer array WoWReforgedArena___tickets +integer WoWReforgedArena___ticketsCounter= 0 //endglobals from WoWReforgedArena //globals from WoWReforgedCheats: constant boolean LIBRARY_WoWReforgedCheats=true @@ -3750,12 +3750,12 @@ constant boolean LIBRARY_WoWReforgedHunterSaveCodes=true //endglobals from WoWReforgedHunterSaveCodes //globals from WoWReforgedItemSets: constant boolean LIBRARY_WoWReforgedItemSets=true -integer array WoWReforgedItemSets__itemSets -integer WoWReforgedItemSets__itemSetsCounter= 0 +integer array WoWReforgedItemSets___itemSets +integer WoWReforgedItemSets___itemSetsCounter= 0 -trigger WoWReforgedItemSets__pickupTrigger= CreateTrigger() -trigger WoWReforgedItemSets__dropTrigger= CreateTrigger() -hashtable WoWReforgedItemSets__h= InitHashtable() +trigger WoWReforgedItemSets___pickupTrigger= CreateTrigger() +trigger WoWReforgedItemSets___dropTrigger= CreateTrigger() +hashtable WoWReforgedItemSets___h= InitHashtable() //endglobals from WoWReforgedItemSets //globals from WoWReforgedRacing: constant boolean LIBRARY_WoWReforgedRacing=true @@ -3763,24 +3763,24 @@ constant integer WoWReforgedRacing_MAX_CHECKPOINTS= 100 constant real WoWReforgedRacing_CHECKPOINT_RADIUS= 100.0 constant string WoWReforgedRacing_CHECKPOINT_TARGET_EFFECT= "Abilities\\Spells\\Other\\Aneu\\AneuTarget.mdl" -integer WoWReforgedRacing__currentRacingTrack= 0 -player WoWReforgedRacing__firstPlace= null -player WoWReforgedRacing__secondPlace= null -player WoWReforgedRacing__thirdPlace= null -timer WoWReforgedRacing__currentRacingTrackTimer= CreateTimer() -timerdialog WoWReforgedRacing__currentRacingTrackTimerDialog= null -integer array WoWReforgedRacing__racingTracks -integer WoWReforgedRacing__racingTracksCounter= 0 -trigger WoWReforgedRacing__sellItemTrigger= CreateTrigger() -trigger WoWReforgedRacing__enterCheckpointTrigger= CreateTrigger() -hashtable WoWReforgedRacing__h= InitHashtable() +integer WoWReforgedRacing___currentRacingTrack= 0 +player WoWReforgedRacing___firstPlace= null +player WoWReforgedRacing___secondPlace= null +player WoWReforgedRacing___thirdPlace= null +timer WoWReforgedRacing___currentRacingTrackTimer= CreateTimer() +timerdialog WoWReforgedRacing___currentRacingTrackTimerDialog= null +integer array WoWReforgedRacing___racingTracks +integer WoWReforgedRacing___racingTracksCounter= 0 +trigger WoWReforgedRacing___sellItemTrigger= CreateTrigger() +trigger WoWReforgedRacing___enterCheckpointTrigger= CreateTrigger() +hashtable WoWReforgedRacing___h= InitHashtable() //endglobals from WoWReforgedRacing //globals from WoWReforgedResearches: constant boolean LIBRARY_WoWReforgedResearches=true -integer array WoWReforgedResearches__researches -integer WoWReforgedResearches__researchesCounter= 0 +integer array WoWReforgedResearches___researches +integer WoWReforgedResearches___researchesCounter= 0 -integer WoWReforgedResearches__lastCreatedResearch= 0 +integer WoWReforgedResearches___lastCreatedResearch= 0 //endglobals from WoWReforgedResearches //globals from WoWReforgedZones: constant boolean LIBRARY_WoWReforgedZones=true @@ -3799,14 +3799,14 @@ constant integer MAX_ZONE_RECTS= 10 constant integer ZONE_TYPE_ZONE= 0 constant integer ZONE_TYPE_WORLD= 1 constant integer ZONE_TYPE_CONTINENT= 2 -integer array WoWReforgedZones__zones -integer WoWReforgedZones__zonesCounter= 0 +integer array WoWReforgedZones___zones +integer WoWReforgedZones___zonesCounter= 0 -trigger WoWReforgedZones__enterTrigger= CreateTrigger() +trigger WoWReforgedZones___enterTrigger= CreateTrigger() -integer WoWReforgedZones__currentWorld= 0 -integer WoWReforgedZones__currentContinent= 0 -integer WoWReforgedZones__currentZone= 0 +integer WoWReforgedZones___currentWorld= 0 +integer WoWReforgedZones___currentContinent= 0 +integer WoWReforgedZones___currentZone= 0 //endglobals from WoWReforgedZones //globals from WoWReforgedAllRaces: constant boolean LIBRARY_WoWReforgedAllRaces=true @@ -3845,37 +3845,37 @@ constant integer OCTOBER= 10 constant integer NOVEMBER= 11 constant integer DECEMBER= 12 -trigger WoWReforgedCalendar__changeDayTrigger= CreateTrigger() -timer WoWReforgedCalendar__changeSecondTimer= CreateTimer() -region WoWReforgedCalendar__rainyRegion= null -weathereffect array WoWReforgedCalendar__weather -integer array WoWReforgedCalendar__weatherEffectIds -integer WoWReforgedCalendar__days= SUMMER_DAY -integer WoWReforgedCalendar__years= 24 -integer WoWReforgedCalendar__season= SEASON_WINTER +trigger WoWReforgedCalendar___changeDayTrigger= CreateTrigger() +timer WoWReforgedCalendar___changeSecondTimer= CreateTimer() +region WoWReforgedCalendar___rainyRegion= null +weathereffect array WoWReforgedCalendar___weather +integer array WoWReforgedCalendar___weatherEffectIds +integer WoWReforgedCalendar___days= SUMMER_DAY +integer WoWReforgedCalendar___years= 24 +integer WoWReforgedCalendar___season= SEASON_WINTER -boolean WoWReforgedCalendar__seasonsEnabled= true +boolean WoWReforgedCalendar___seasonsEnabled= true -boolean WoWReforgedCalendar__easterTrees= false -boolean WoWReforgedCalendar__christmasTrees= false -effect array WoWReforgedCalendar__newYearEffects +boolean WoWReforgedCalendar___easterTrees= false +boolean WoWReforgedCalendar___christmasTrees= false +effect array WoWReforgedCalendar___newYearEffects -boolean WoWReforgedCalendar__weatherRunning= false -timer WoWReforgedCalendar__weatherTimer= CreateTimer() -timer WoWReforgedCalendar__thunderTimer= CreateTimer() +boolean WoWReforgedCalendar___weatherRunning= false +timer WoWReforgedCalendar___weatherTimer= CreateTimer() +timer WoWReforgedCalendar___thunderTimer= CreateTimer() -integer array WoWReforgedCalendar__tileMappings -integer WoWReforgedCalendar__tileMappingsCounter= 0 +integer array WoWReforgedCalendar___tileMappings +integer WoWReforgedCalendar___tileMappingsCounter= 0 -integer array WoWReforgedCalendar__calendarEvents -integer WoWReforgedCalendar__calendarEventsCounter= 0 +integer array WoWReforgedCalendar___calendarEvents +integer WoWReforgedCalendar___calendarEventsCounter= 0 -hashtable WoWReforgedCalendar__h= InitHashtable() +hashtable WoWReforgedCalendar___h= InitHashtable() -filterfunc WoWReforgedCalendar__filterIsMineWithResourceWaterNotFull= null -integer WoWReforgedCalendar__sourceSeason= 0 -integer WoWReforgedCalendar__targetSeason= 0 -filterfunc WoWReforgedCalendar__treeFilter= null +filterfunc WoWReforgedCalendar___filterIsMineWithResourceWaterNotFull= null +integer WoWReforgedCalendar___sourceSeason= 0 +integer WoWReforgedCalendar___targetSeason= 0 +filterfunc WoWReforgedCalendar___treeFilter= null integer easter= 0 integer christmas= 0 integer newyear= 0 @@ -3887,9 +3887,9 @@ integer carnival= 0 constant boolean LIBRARY_WoWReforgedMassForestation=true constant integer WoWReforgedMassForestation_ABILITY_ID= 'A22J' constant integer WoWReforgedMassForestation_ABILITY_ID_2= 'A17G' -trigger WoWReforgedMassForestation__castTrigger= CreateTrigger() -integer WoWReforgedMassForestation__abilityLevel= 0 -player WoWReforgedMassForestation__owner= null +trigger WoWReforgedMassForestation___castTrigger= CreateTrigger() +integer WoWReforgedMassForestation___abilityLevel= 0 +player WoWReforgedMassForestation___owner= null //endglobals from WoWReforgedMassForestation //globals from WoWReforgedMaxHpResearch: constant boolean LIBRARY_WoWReforgedMaxHpResearch=true @@ -3897,19 +3897,19 @@ constant boolean LIBRARY_WoWReforgedMaxHpResearch=true //globals from WoWReforgedPings: constant boolean LIBRARY_WoWReforgedPings=true constant real PING_DURATION= 5.0 -player WoWReforgedPings__owner= null +player WoWReforgedPings___owner= null //endglobals from WoWReforgedPings //globals from WoWReforgedPortals: constant boolean LIBRARY_WoWReforgedPortals=true -boolean WoWReforgedPortals__initialized= false -trigger WoWReforgedPortals__constructFinishedTrigger= CreateTrigger() +boolean WoWReforgedPortals___initialized= false +trigger WoWReforgedPortals___constructFinishedTrigger= CreateTrigger() //endglobals from WoWReforgedPortals //globals from WoWReforgedCalendarMultiboard: constant boolean LIBRARY_WoWReforgedCalendarMultiboard=true -constant real WoWReforgedCalendarMultiboard__SIZE= 0.06 +constant real WoWReforgedCalendarMultiboard___SIZE= 0.06 -multiboard WoWReforgedCalendarMultiboard__m= null -timer WoWReforgedCalendarMultiboard__t= CreateTimer() +multiboard WoWReforgedCalendarMultiboard___m= null +timer WoWReforgedCalendarMultiboard___t= CreateTimer() //endglobals from WoWReforgedCalendarMultiboard //globals from WoWReforgedProperties: constant boolean LIBRARY_WoWReforgedProperties=true @@ -3919,13 +3919,13 @@ constant integer WoWReforgedProperties_UNLOAD_ABILITY_ID= 'S01P' constant integer WoWReforgedProperties_SELECT_UNIT_ABILITY_ID= 'Ane2' constant integer WoWReforgedProperties_SELECT_HERO_ABILITY_ID= 'Aneu' -trigger WoWReforgedProperties__purchaseTrigger= CreateTrigger() +trigger WoWReforgedProperties___purchaseTrigger= CreateTrigger() -integer array WoWReforgedProperties__properties -integer WoWReforgedProperties__propertiesCounter= 0 +integer array WoWReforgedProperties___properties +integer WoWReforgedProperties___propertiesCounter= 0 -group WoWReforgedProperties__properiesGroup= CreateGroup() -hashtable WoWReforgedProperties__h= InitHashtable() +group WoWReforgedProperties___properiesGroup= CreateGroup() +hashtable WoWReforgedProperties___h= InitHashtable() //endglobals from WoWReforgedProperties //globals from WoWReforgedItemCheck: constant boolean LIBRARY_WoWReforgedItemCheck=true @@ -3954,109 +3954,109 @@ constant integer A_ORDER_ID_USE_SLOT_4= 852012 constant integer A_ORDER_ID_USE_SLOT_5= 852013 // item slot data -integer array WoWReforgedBackpacks___BackpackItemType -integer array WoWReforgedBackpacks___BackpackItemCharges -boolean array WoWReforgedBackpacks___BackpackItemPawnable -boolean array WoWReforgedBackpacks___BackpackItemInvulnerable -string array WoWReforgedBackpacks___BackpackItemName -string array WoWReforgedBackpacks___BackpackItemDescription -string array WoWReforgedBackpacks___BackpackItemTooltip -string array WoWReforgedBackpacks___BackpackItemTooltipExtended -player array WoWReforgedBackpacks___BackpackItemPlayer +integer array WoWReforgedBackpacks__BackpackItemType +integer array WoWReforgedBackpacks__BackpackItemCharges +boolean array WoWReforgedBackpacks__BackpackItemPawnable +boolean array WoWReforgedBackpacks__BackpackItemInvulnerable +string array WoWReforgedBackpacks__BackpackItemName +string array WoWReforgedBackpacks__BackpackItemDescription +string array WoWReforgedBackpacks__BackpackItemTooltip +string array WoWReforgedBackpacks__BackpackItemTooltipExtended +player array WoWReforgedBackpacks__BackpackItemPlayer // player data -unit array WoWReforgedBackpacks___Backpack -integer array WoWReforgedBackpacks___BackpackPageNumber -trigger array WoWReforgedBackpacks___BackpackTriggerChangePage -trigger array WoWReforgedBackpacks___BackpackTriggerPickup -trigger array WoWReforgedBackpacks___BackpackTriggerDrop -trigger array WoWReforgedBackpacks___BackpackTriggerMove -trigger array WoWReforgedBackpacks___BackpackTriggerOrder -item array WoWReforgedBackpacks___BackpackTargetItem -boolean array WoWReforgedBackpacks___BackpackPlayerBagInfo - -boolean WoWReforgedBackpacks___BackpackPickupTimerHasStarted= false - -timer WoWReforgedBackpacks___BackpackPickupTimer= CreateTimer() -timer WoWReforgedBackpacks___BackpackUpdateLocationTimer= CreateTimer() +unit array WoWReforgedBackpacks__Backpack +integer array WoWReforgedBackpacks__BackpackPageNumber +trigger array WoWReforgedBackpacks__BackpackTriggerChangePage +trigger array WoWReforgedBackpacks__BackpackTriggerPickup +trigger array WoWReforgedBackpacks__BackpackTriggerDrop +trigger array WoWReforgedBackpacks__BackpackTriggerMove +trigger array WoWReforgedBackpacks__BackpackTriggerOrder +item array WoWReforgedBackpacks__BackpackTargetItem +boolean array WoWReforgedBackpacks__BackpackPlayerBagInfo + +boolean WoWReforgedBackpacks__BackpackPickupTimerHasStarted= false + +timer WoWReforgedBackpacks__BackpackPickupTimer= CreateTimer() +timer WoWReforgedBackpacks__BackpackUpdateLocationTimer= CreateTimer() //endglobals from WoWReforgedBackpacks //globals from WoWReforgedBackpackUI: constant boolean LIBRARY_WoWReforgedBackpackUI=true -constant real WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE= 0.02818 -constant real WoWReforgedBackpackUI__BACKPACK_UI_CHARGES_BACKGROUND_SIZE= 0.014 -constant real WoWReforgedBackpackUI__BACKPACK_UI_CHARGES_POS= 0.003 -constant real WoWReforgedBackpackUI__BACKPACK_UI_CHARGES_SIZE= 0.02 -constant real WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SPACE= 0.005 - -constant real WoWReforgedBackpackUI__UI_SLOT_X= 0.03 -constant real WoWReforgedBackpackUI__UI_SLOT_Y= 0.53 - -constant real WoWReforgedBackpackUI__UI_CHECKBOX_X= 0.48 -constant real WoWReforgedBackpackUI__UI_CHECKBOX_Y= 0.20 -constant real WoWReforgedBackpackUI__UI_CHECKBOX_SIZE= 0.02818 - -constant real WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_X= 0.62 -constant real WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_Y= 0.54 -constant real WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_WIDTH= 0.16 -constant real WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_HEIGHT= 0.34 - -constant real WoWReforgedBackpackUI__UI_TOOLTIP_X= 0.639 -constant real WoWReforgedBackpackUI__UI_TOOLTIP_Y= 0.47 -constant real WoWReforgedBackpackUI__UI_TOOLTIP_WIDTH= 0.14 -constant real WoWReforgedBackpackUI__UI_TOOLTIP_HEIGHT= 0.6 - -constant real WoWReforgedBackpackUI__UI_TOOLTIP_ICON_X= WoWReforgedBackpackUI__UI_TOOLTIP_X -constant real WoWReforgedBackpackUI__UI_TOOLTIP_ICON_Y= 0.50 -constant real WoWReforgedBackpackUI__UI_TOOLTIP_ICON_SIZE= 0.02 - -boolean array WoWReforgedBackpackUI__BackpackUIVisible -framehandle WoWReforgedBackpackUI__BackpackBackgroundFrame -framehandle WoWReforgedBackpackUI__BackpackTitleFrame -framehandle array WoWReforgedBackpackUI__BackpackItemFrame -framehandle array WoWReforgedBackpackUI__BackpackItemBackdropFrame -framehandle array WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame -framehandle array WoWReforgedBackpackUI__BackpackItemChargesFrame -framehandle array WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame -framehandle array WoWReforgedBackpackUI__BackpackItemBagFrame -trigger array WoWReforgedBackpackUI__BackpackItemTrigger -trigger array WoWReforgedBackpackUI__BackpackItemTooltipOnTrigger -trigger array WoWReforgedBackpackUI__BackpackItemTooltipOffTrigger -framehandle WoWReforgedBackpackUI__BackpackTooltipFrame -framehandle WoWReforgedBackpackUI__BackpackTooltipIcon -framehandle WoWReforgedBackpackUI__BackpackTooltipModel -framehandle WoWReforgedBackpackUI__BackpackItemGoldFrame -framehandle WoWReforgedBackpackUI__BackpackItemGoldIconFrame -framehandle WoWReforgedBackpackUI__BackpackTooltipText -framehandle WoWReforgedBackpackUI__Checkbox -trigger WoWReforgedBackpackUI__CheckTrigger -trigger WoWReforgedBackpackUI__UncheckTrigger -trigger WoWReforgedBackpackUI__CheckboxTooltipOnTrigger -trigger WoWReforgedBackpackUI__CheckboxTooltipOffTrigger -framehandle WoWReforgedBackpackUI__BackpackCloseButton -trigger WoWReforgedBackpackUI__BackpackCloseTrigger -trigger WoWReforgedBackpackUI__BackpackSyncTrigger -boolean array WoWReforgedBackpackUI__Checked +constant real WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE= 0.02818 +constant real WoWReforgedBackpackUI___BACKPACK_UI_CHARGES_BACKGROUND_SIZE= 0.014 +constant real WoWReforgedBackpackUI___BACKPACK_UI_CHARGES_POS= 0.003 +constant real WoWReforgedBackpackUI___BACKPACK_UI_CHARGES_SIZE= 0.02 +constant real WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SPACE= 0.005 + +constant real WoWReforgedBackpackUI___UI_SLOT_X= 0.03 +constant real WoWReforgedBackpackUI___UI_SLOT_Y= 0.53 + +constant real WoWReforgedBackpackUI___UI_CHECKBOX_X= 0.48 +constant real WoWReforgedBackpackUI___UI_CHECKBOX_Y= 0.20 +constant real WoWReforgedBackpackUI___UI_CHECKBOX_SIZE= 0.02818 + +constant real WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_X= 0.62 +constant real WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_Y= 0.54 +constant real WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_WIDTH= 0.16 +constant real WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_HEIGHT= 0.34 + +constant real WoWReforgedBackpackUI___UI_TOOLTIP_X= 0.639 +constant real WoWReforgedBackpackUI___UI_TOOLTIP_Y= 0.47 +constant real WoWReforgedBackpackUI___UI_TOOLTIP_WIDTH= 0.14 +constant real WoWReforgedBackpackUI___UI_TOOLTIP_HEIGHT= 0.6 + +constant real WoWReforgedBackpackUI___UI_TOOLTIP_ICON_X= WoWReforgedBackpackUI___UI_TOOLTIP_X +constant real WoWReforgedBackpackUI___UI_TOOLTIP_ICON_Y= 0.50 +constant real WoWReforgedBackpackUI___UI_TOOLTIP_ICON_SIZE= 0.02 + +boolean array WoWReforgedBackpackUI___BackpackUIVisible +framehandle WoWReforgedBackpackUI___BackpackBackgroundFrame +framehandle WoWReforgedBackpackUI___BackpackTitleFrame +framehandle array WoWReforgedBackpackUI___BackpackItemFrame +framehandle array WoWReforgedBackpackUI___BackpackItemBackdropFrame +framehandle array WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame +framehandle array WoWReforgedBackpackUI___BackpackItemChargesFrame +framehandle array WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame +framehandle array WoWReforgedBackpackUI___BackpackItemBagFrame +trigger array WoWReforgedBackpackUI___BackpackItemTrigger +trigger array WoWReforgedBackpackUI___BackpackItemTooltipOnTrigger +trigger array WoWReforgedBackpackUI___BackpackItemTooltipOffTrigger +framehandle WoWReforgedBackpackUI___BackpackTooltipFrame +framehandle WoWReforgedBackpackUI___BackpackTooltipIcon +framehandle WoWReforgedBackpackUI___BackpackTooltipModel +framehandle WoWReforgedBackpackUI___BackpackItemGoldFrame +framehandle WoWReforgedBackpackUI___BackpackItemGoldIconFrame +framehandle WoWReforgedBackpackUI___BackpackTooltipText +framehandle WoWReforgedBackpackUI___Checkbox +trigger WoWReforgedBackpackUI___CheckTrigger +trigger WoWReforgedBackpackUI___UncheckTrigger +trigger WoWReforgedBackpackUI___CheckboxTooltipOnTrigger +trigger WoWReforgedBackpackUI___CheckboxTooltipOffTrigger +framehandle WoWReforgedBackpackUI___BackpackCloseButton +trigger WoWReforgedBackpackUI___BackpackCloseTrigger +trigger WoWReforgedBackpackUI___BackpackSyncTrigger +boolean array WoWReforgedBackpackUI___Checked //endglobals from WoWReforgedBackpackUI //globals from WoWReforgedComputer: constant boolean LIBRARY_WoWReforgedComputer=true constant integer WoWReforgedComputer_MAX_WORKERS_PER_MINE= 5 -integer WoWReforgedComputer__autoLoadMineCounter= 0 -group WoWReforgedComputer__autoLoadMineWorkers= null -unit array WoWReforgedComputer__ghoul +integer WoWReforgedComputer___autoLoadMineCounter= 0 +group WoWReforgedComputer___autoLoadMineWorkers= null +unit array WoWReforgedComputer___ghoul //endglobals from WoWReforgedComputer //globals from WoWReforgedDemigod: constant boolean LIBRARY_WoWReforgedDemigod=true //endglobals from WoWReforgedDemigod //globals from WoWReforgedHeroTransformation: constant boolean LIBRARY_WoWReforgedHeroTransformation=true -trigger WoWReforgedHeroTransformation__pickupTrigger= CreateTrigger() -trigger WoWReforgedHeroTransformation__dropTrigger= CreateTrigger() -trigger WoWReforgedHeroTransformation__castTrigger= CreateTrigger() -integer array WoWReforgedHeroTransformation__types -integer WoWReforgedHeroTransformation__typesCounter= 0 - -constant integer WoWReforgedHeroTransformation__MAX_HEROES= 3 -integer array WoWReforgedHeroTransformation__playerHeroOriginalUnitTypeId +trigger WoWReforgedHeroTransformation___pickupTrigger= CreateTrigger() +trigger WoWReforgedHeroTransformation___dropTrigger= CreateTrigger() +trigger WoWReforgedHeroTransformation___castTrigger= CreateTrigger() +integer array WoWReforgedHeroTransformation___types +integer WoWReforgedHeroTransformation___typesCounter= 0 + +constant integer WoWReforgedHeroTransformation___MAX_HEROES= 3 +integer array WoWReforgedHeroTransformation___playerHeroOriginalUnitTypeId //endglobals from WoWReforgedHeroTransformation //globals from WoWReforgedItemUtils: constant boolean LIBRARY_WoWReforgedItemUtils=true @@ -4087,23 +4087,23 @@ constant integer WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED= 1 constant integer WoWReforgedEquipment_CATEGORY_TYPE_RANGE= 2 constant integer WoWReforgedEquipment_CATEGORY_TYPE_MAX= 3 -hashtable WoWReforgedEquipment___h= InitHashtable() -hashtable WoWReforgedEquipment___h2= InitHashtable() +hashtable WoWReforgedEquipment__h= InitHashtable() +hashtable WoWReforgedEquipment__h2= InitHashtable() -trigger WoWReforgedEquipment___pickupTrigger= CreateTrigger() -trigger WoWReforgedEquipment___dropTrigger= CreateTrigger() -trigger WoWReforgedEquipment___attackTrigger= CreateTrigger() +trigger WoWReforgedEquipment__pickupTrigger= CreateTrigger() +trigger WoWReforgedEquipment__dropTrigger= CreateTrigger() +trigger WoWReforgedEquipment__attackTrigger= CreateTrigger() -integer array WoWReforgedEquipment___equipmentItemTypeId -string array WoWReforgedEquipment___equipmentItemTypeCategoryName -integer array WoWReforgedEquipment___equipmentItemTypeCategory -boolean array WoWReforgedEquipment___equipmentItemTypeCategoryType -integer array WoWReforgedEquipment___equipmentItemTypeAnimation -integer WoWReforgedEquipment___equipmentTypesCounter= 1 +integer array WoWReforgedEquipment__equipmentItemTypeId +string array WoWReforgedEquipment__equipmentItemTypeCategoryName +integer array WoWReforgedEquipment__equipmentItemTypeCategory +boolean array WoWReforgedEquipment__equipmentItemTypeCategoryType +integer array WoWReforgedEquipment__equipmentItemTypeAnimation +integer WoWReforgedEquipment__equipmentTypesCounter= 1 //endglobals from WoWReforgedEquipment //globals from WoWReforgedSaveCodes: constant boolean LIBRARY_WoWReforgedSaveCodes=true -integer WoWReforgedSaveCodes___gameSeed= GetRandomInt(0, 100000) +integer WoWReforgedSaveCodes__gameSeed= GetRandomInt(0, 100000) integer SAVE_CODE_TYPE_HEROES= 0 integer SAVE_CODE_TYPE_ITEMS= 1 @@ -4117,7 +4117,7 @@ integer SAVE_CODE_TYPE_LETTER= 7 string array generatedSaveCodes integer generatedSaveCodesCounter= 0 constant integer SAVE_CODE_MAX_BUILDINGS= 8 -integer WoWReforgedSaveCodes___tmpFilterId= 0 +integer WoWReforgedSaveCodes__tmpFilterId= 0 constant integer SAVE_CODE_MAX_UNITS= 10 constant integer SAVE_CODE_MAX_RESEARCHES= 10 constant string SAVE_AND_LOAD_AUTO_PREFIX= "SaveAndLoadAuto" @@ -4126,44 +4126,44 @@ integer array SaveAndLoadAutoSyncCounter //endglobals from WoWReforgedSaveCodes //globals from WoWReforgedSkillUI: constant boolean LIBRARY_WoWReforgedSkillUI=true -constant string WoWReforgedSkillUI__PREFIX= "SkillUI" - -constant real WoWReforgedSkillUI__X= 0.493 -constant real WoWReforgedSkillUI__Y= 0.08 -constant real WoWReforgedSkillUI__WIDTH= 0.01 -constant real WoWReforgedSkillUI__HEIGHT= 0.01 -constant real WoWReforgedSkillUI__SPACING= 0.003 - -constant real WoWReforgedSkillUI__Y2= 0.06 - -constant real WoWReforgedSkillUI__Y3= 0.0325 - -constant real WoWReforgedSkillUI__TOGGLE_X= 0.4 -constant real WoWReforgedSkillUI__TOGGLE_Y= 0.035 - -constant real WoWReforgedSkillUI__ATTRIBUTE_POINTS_X= WoWReforgedSkillUI__TOGGLE_X + WoWReforgedSkillUI__WIDTH + 0.01 -constant real WoWReforgedSkillUI__ATTRIBUTE_POINTS_WIDTH= 0.08 - -hashtable WoWReforgedSkillUI__h= InitHashtable() -framehandle array WoWReforgedSkillUI__IconFrameUp -framehandle array WoWReforgedSkillUI__IconFrameUpFrame -framehandle array WoWReforgedSkillUI__IconFrameDown -framehandle array WoWReforgedSkillUI__IconFrameDownFrame -trigger array WoWReforgedSkillUI__upTrigger -trigger array WoWReforgedSkillUI__downTrigger -framehandle WoWReforgedSkillUI__IconFrameToggle -framehandle WoWReforgedSkillUI__IconFrameToggleFrame -framehandle WoWReforgedSkillUI__IconFrameAttributePoints -trigger WoWReforgedSkillUI__toggleTrigger -trigger WoWReforgedSkillUI__syncTrigger= CreateTrigger() -trigger WoWReforgedSkillUI__selectionTrigger= CreateTrigger() -trigger WoWReforgedSkillUI__deselectionTrigger= CreateTrigger() -trigger WoWReforgedSkillUI__loadTrigger= CreateTrigger() -unit array WoWReforgedSkillUI__currentHero -boolean array WoWReforgedSkillUI__hidden - -player WoWReforgedSkillUI__tmpPlayer= null -trigger WoWReforgedSkillUI__tmpTrigger= CreateTrigger() +constant string WoWReforgedSkillUI___PREFIX= "SkillUI" + +constant real WoWReforgedSkillUI___X= 0.493 +constant real WoWReforgedSkillUI___Y= 0.08 +constant real WoWReforgedSkillUI___WIDTH= 0.01 +constant real WoWReforgedSkillUI___HEIGHT= 0.01 +constant real WoWReforgedSkillUI___SPACING= 0.003 + +constant real WoWReforgedSkillUI___Y2= 0.06 + +constant real WoWReforgedSkillUI___Y3= 0.0325 + +constant real WoWReforgedSkillUI___TOGGLE_X= 0.4 +constant real WoWReforgedSkillUI___TOGGLE_Y= 0.035 + +constant real WoWReforgedSkillUI___ATTRIBUTE_POINTS_X= WoWReforgedSkillUI___TOGGLE_X + WoWReforgedSkillUI___WIDTH + 0.01 +constant real WoWReforgedSkillUI___ATTRIBUTE_POINTS_WIDTH= 0.08 + +hashtable WoWReforgedSkillUI___h= InitHashtable() +framehandle array WoWReforgedSkillUI___IconFrameUp +framehandle array WoWReforgedSkillUI___IconFrameUpFrame +framehandle array WoWReforgedSkillUI___IconFrameDown +framehandle array WoWReforgedSkillUI___IconFrameDownFrame +trigger array WoWReforgedSkillUI___upTrigger +trigger array WoWReforgedSkillUI___downTrigger +framehandle WoWReforgedSkillUI___IconFrameToggle +framehandle WoWReforgedSkillUI___IconFrameToggleFrame +framehandle WoWReforgedSkillUI___IconFrameAttributePoints +trigger WoWReforgedSkillUI___toggleTrigger +trigger WoWReforgedSkillUI___syncTrigger= CreateTrigger() +trigger WoWReforgedSkillUI___selectionTrigger= CreateTrigger() +trigger WoWReforgedSkillUI___deselectionTrigger= CreateTrigger() +trigger WoWReforgedSkillUI___loadTrigger= CreateTrigger() +unit array WoWReforgedSkillUI___currentHero +boolean array WoWReforgedSkillUI___hidden + +player WoWReforgedSkillUI___tmpPlayer= null +trigger WoWReforgedSkillUI___tmpTrigger= CreateTrigger() //endglobals from WoWReforgedSkillUI //globals from WoWReforgedUpdateBackpackUI: constant boolean LIBRARY_WoWReforgedUpdateBackpackUI=true @@ -4172,9 +4172,9 @@ trigger updateBackpackUITrigger= CreateTrigger() //endglobals from WoWReforgedUpdateBackpackUI //globals from WoWReforgedArmory: constant boolean LIBRARY_WoWReforgedArmory=true -trigger WoWReforgedArmory___sellTrigger= CreateTrigger() -trigger WoWReforgedArmory___constructionTrigger= CreateTrigger() -trigger WoWReforgedArmory___summonTrigger= CreateTrigger() +trigger WoWReforgedArmory__sellTrigger= CreateTrigger() +trigger WoWReforgedArmory__constructionTrigger= CreateTrigger() +trigger WoWReforgedArmory__summonTrigger= CreateTrigger() //endglobals from WoWReforgedArmory //globals from WoWReforgedCheatsSaveCodes: constant boolean LIBRARY_WoWReforgedCheatsSaveCodes=true @@ -4235,43 +4235,13 @@ string WoWReforgedSaveCodesAll__tmpString= "" //endglobals from WoWReforgedSaveCodesAll //globals from WoWReforgedStartLocations: constant boolean LIBRARY_WoWReforgedStartLocations=true -integer array WoWReforgedStartLocations__startLocationsItemTypeIds -real array WoWReforgedStartLocations__startLocationsX -real array WoWReforgedStartLocations__startLocationsY -real array WoWReforgedStartLocations__startLocationsFacing -boolean array WoWReforgedStartLocations__startLocationsIsClanArea -integer WoWReforgedStartLocations__startLocationsCounter= 0 +integer array WoWReforgedStartLocations___startLocationsItemTypeIds +real array WoWReforgedStartLocations___startLocationsX +real array WoWReforgedStartLocations___startLocationsY +real array WoWReforgedStartLocations___startLocationsFacing +boolean array WoWReforgedStartLocations___startLocationsIsClanArea +integer WoWReforgedStartLocations___startLocationsCounter= 0 //endglobals from WoWReforgedStartLocations -//globals from WoWReforgedWebsite: -constant boolean LIBRARY_WoWReforgedWebsite=true -constant integer WoWReforgedWebsite__MAX_ABILITIES= 15 - -trigger WoWReforgedWebsite__chatCommandTrigger= CreateTrigger() - -string WoWReforgedWebsite__tmpSource= "" -string WoWReforgedWebsite__tmpMatch= "" -string WoWReforgedWebsite__tmpReplacement= "" -string WoWReforgedWebsite__tmpResult= "" - -string WoWReforgedWebsite__tmpTooltip= "" - -integer WoWReforgedWebsite__tmpInteger= 0 -integer WoWReforgedWebsite__tmpInteger2= 0 -integer WoWReforgedWebsite__tmpInteger3= 0 -unit WoWReforgedWebsite__tmpUnit= null -string WoWReforgedWebsite__tmpString= "" -item WoWReforgedWebsite__tmpItem= null - - // prevent generating the same IDs multiple times -integer array WoWReforgedWebsite__generatedIds -integer WoWReforgedWebsite__generatedIdsCounter= 0 - -string array WoWReforgedWebsite__generatedIdsStrings -integer WoWReforgedWebsite__generatedIdsStringsCounter= 0 -integer array WoWReforgedWebsite__ignoredAbilities -integer WoWReforgedWebsite__ignoredAbilitiesCounter= 0 -integer WoWReforgedWebsite__tmpSpellIndex= 0 -//endglobals from WoWReforgedWebsite //globals from WoWReforgedPlayerInfos: constant boolean LIBRARY_WoWReforgedPlayerInfos=true //endglobals from WoWReforgedPlayerInfos @@ -4459,7 +4429,7 @@ trigger WoWReforgedSaveCodeUI___SyncTrigger //endglobals from WoWReforgedSaveCodeUI //globals from WoWReforgedStartLocationsTavern: constant boolean LIBRARY_WoWReforgedStartLocationsTavern=true -trigger WoWReforgedStartLocationsTavern___sellTrigger= CreateTrigger() +trigger WoWReforgedStartLocationsTavern__sellTrigger= CreateTrigger() //endglobals from WoWReforgedStartLocationsTavern //globals from WoWReforgedActionsBarUI: constant boolean LIBRARY_WoWReforgedActionsBarUI=true @@ -4578,14 +4548,14 @@ constant boolean LIBRARY_WoWReforgedCinematic=true constant string WoWReforgedCinematic_PREFIX_X= "CINEMATIC_X" constant string WoWReforgedCinematic_PREFIX_Y= "CINEMATIC_Y" -group array WoWReforgedCinematic__playerSelections -boolean array WoWReforgedCinematic__playerQueueUIEnabled -real array WoWReforgedCinematic__playerCameraX -real array WoWReforgedCinematic__playerCameraY +group array WoWReforgedCinematic___playerSelections +boolean array WoWReforgedCinematic___playerQueueUIEnabled +real array WoWReforgedCinematic___playerCameraX +real array WoWReforgedCinematic___playerCameraY -trigger WoWReforgedCinematic__syncTrigger= CreateTrigger() -group WoWReforgedCinematic__actors= CreateGroup() -group WoWReforgedCinematic__paused= CreateGroup() +trigger WoWReforgedCinematic___syncTrigger= CreateTrigger() +group WoWReforgedCinematic___actors= CreateGroup() +group WoWReforgedCinematic___paused= CreateGroup() //endglobals from WoWReforgedCinematic //globals from WoWReforgedRacesUI: constant boolean LIBRARY_WoWReforgedRacesUI=true @@ -9283,12 +9253,12 @@ trigger array s__UserMouse_posDetector integer array s__UserMouse_mouseClickCount real array s__UserMouse_mouseX real array s__UserMouse_mouseY -constant integer si__QueueUIConfig___Tech=17 -integer si__QueueUIConfig___Tech_F=0 -integer si__QueueUIConfig___Tech_I=0 -integer array si__QueueUIConfig___Tech_V -string array s__QueueUIConfig___Tech_name -string array s__QueueUIConfig___Tech_icon +constant integer si__QueueUIConfig__Tech=17 +integer si__QueueUIConfig__Tech_F=0 +integer si__QueueUIConfig__Tech_I=0 +integer array si__QueueUIConfig__Tech_V +string array s__QueueUIConfig__Tech_name +string array s__QueueUIConfig__Tech_icon constant integer si__Table__dex=18 constant integer si__Table__handles=19 constant integer si__Table__agents=20 @@ -9358,8 +9328,8 @@ integer s__WorldBounds_centerY rect s__WorldBounds_world region s__WorldBounds_worldRegion constant integer si__CooldownReduction__AbilityList=69 -integer s__CooldownReduction__AbilityList_Alloc___instanceCount= 0 -integer array s__CooldownReduction__AbilityList_Alloc___recycle +integer s__CooldownReduction__AbilityList_Alloc__instanceCount= 0 +integer array s__CooldownReduction__AbilityList_Alloc__recycle integer array s__CooldownReduction__AbilityList_next integer array s__CooldownReduction__AbilityList_prev unit array s__CooldownReduction__AbilityList_unit @@ -9476,8 +9446,8 @@ integer s__Knockback_temp= 0 rect s__Knockback_destRect= Rect(0, 0, 1, 1) real s__Knockback_tx= 0.00 real s__Knockback_ty= 0.00 -boolean s__Knockback_ListModule_List___destroying= false -boolean array s__Knockback_ListModule_List___inlist +boolean s__Knockback_ListModule_List__destroying= false +boolean array s__Knockback_ListModule_List__inlist integer s__Knockback_count= 0 integer array s__Knockback_next integer array s__Knockback_prev @@ -9491,8 +9461,8 @@ filterfunc array s__MassSpell_filter constant integer si__MissileEffect__Effect=78 integer array s__MissileEffect__Effect_next integer array s__MissileEffect__Effect_prev -integer s__MissileEffect__Effect_Alloc___instanceCount= 0 -integer array s__MissileEffect__Effect_Alloc___recycle +integer s__MissileEffect__Effect_Alloc__instanceCount= 0 +integer array s__MissileEffect__Effect_Alloc__recycle real array s__MissileEffect__Effect_x real array s__MissileEffect__Effect_y real array s__MissileEffect__Effect_z @@ -9582,8 +9552,8 @@ integer s__Resource_resourcesCount= 0 constant integer si__SpellEffectEvent__S=88 integer s__SpellEffectEvent__S_tb constant integer si__Tenacity__List=89 -integer s__Tenacity__List_Alloc___instanceCount= 0 -integer array s__Tenacity__List_Alloc___recycle +integer s__Tenacity__List_Alloc__instanceCount= 0 +integer array s__Tenacity__List_Alloc__recycle integer array s__Tenacity__List_next integer array s__Tenacity__List_prev real array s__Tenacity__List_tenacity @@ -9678,10 +9648,10 @@ integer array s__UnitDex_List constant integer s__UnitDex_DETECT_LEAVE_ABILITY= 'A02Z' constant boolean s__UnitDex_ALLOW_DEBUGGING= true integer s__UnitDex_Counter= 0 -constant integer si__UnitGroupRespawnSystemConfig___S=99 -integer si__UnitGroupRespawnSystemConfig___S_F=0 -integer si__UnitGroupRespawnSystemConfig___S_I=0 -integer array si__UnitGroupRespawnSystemConfig___S_V +constant integer si__UnitGroupRespawnSystemConfig__S=99 +integer si__UnitGroupRespawnSystemConfig__S_F=0 +integer si__UnitGroupRespawnSystemConfig__S_I=0 +integer array si__UnitGroupRespawnSystemConfig__S_V constant integer si__Account=100 integer si__Account_F=0 integer si__Account_I=0 @@ -10498,8 +10468,8 @@ integer array s__CrowdControl_type constant integer si__MissileUtils__MGroup=140 integer array s__MissileUtils__MGroup_next integer array s__MissileUtils__MGroup_prev -integer s__MissileUtils__MGroup_Alloc___instanceCount= 0 -integer array s__MissileUtils__MGroup_Alloc___recycle +integer s__MissileUtils__MGroup_Alloc__instanceCount= 0 +integer array s__MissileUtils__MGroup_Alloc__recycle integer array s__MissileUtils__MGroup_missile constant integer si__MissileGroup=141 integer si__MissileGroup_F=0 @@ -10586,13 +10556,13 @@ integer array s__Profession_bookItemTypeId integer array s___Profession_ranks constant integer s___Profession_ranks_size=6 integer array s__Profession_ranks -constant integer si__WoWReforgedTradingPosts__TradingPostResource=155 -integer si__WoWReforgedTradingPosts__TradingPostResource_F=0 -integer si__WoWReforgedTradingPosts__TradingPostResource_I=0 -integer array si__WoWReforgedTradingPosts__TradingPostResource_V -integer array s__WoWReforgedTradingPosts__TradingPostResource_resource -integer array s__WoWReforgedTradingPosts__TradingPostResource_buyUnitTypeId -integer array s__WoWReforgedTradingPosts__TradingPostResource_sellUnitTypeId +constant integer si__WoWReforgedTradingPosts___TradingPostResource=155 +integer si__WoWReforgedTradingPosts___TradingPostResource_F=0 +integer si__WoWReforgedTradingPosts___TradingPostResource_I=0 +integer array si__WoWReforgedTradingPosts___TradingPostResource_V +integer array s__WoWReforgedTradingPosts___TradingPostResource_resource +integer array s__WoWReforgedTradingPosts___TradingPostResource_buyUnitTypeId +integer array s__WoWReforgedTradingPosts___TradingPostResource_sellUnitTypeId constant integer si__NewBonusUtils=156 constant real s__NewBonusUtils_period= 0.03125000 timer s__NewBonusUtils_timer= CreateTimer() @@ -10659,18 +10629,18 @@ constant integer si__JumpingStomp=160 integer si__JumpingStomp_F=0 integer si__JumpingStomp_I=0 integer array si__JumpingStomp_V -constant integer si__WoWReforgedKnockbackSimple__KnockbackS=161 -integer si__WoWReforgedKnockbackSimple__KnockbackS_F=0 -integer si__WoWReforgedKnockbackSimple__KnockbackS_I=0 -integer array si__WoWReforgedKnockbackSimple__KnockbackS_V -unit array s__WoWReforgedKnockbackSimple__KnockbackS_target -real array s__WoWReforgedKnockbackSimple__KnockbackS_d1 -real array s__WoWReforgedKnockbackSimple__KnockbackS_d2 -real array s__WoWReforgedKnockbackSimple__KnockbackS_sin -real array s__WoWReforgedKnockbackSimple__KnockbackS_cos -real array s__WoWReforgedKnockbackSimple__KnockbackS_r -string array s__WoWReforgedKnockbackSimple__KnockbackS_efect -string array s__WoWReforgedKnockbackSimple__KnockbackS_attachmentPoint +constant integer si__WoWReforgedKnockbackSimple___KnockbackS=161 +integer si__WoWReforgedKnockbackSimple___KnockbackS_F=0 +integer si__WoWReforgedKnockbackSimple___KnockbackS_I=0 +integer array si__WoWReforgedKnockbackSimple___KnockbackS_V +unit array s__WoWReforgedKnockbackSimple___KnockbackS_target +real array s__WoWReforgedKnockbackSimple___KnockbackS_d1 +real array s__WoWReforgedKnockbackSimple___KnockbackS_d2 +real array s__WoWReforgedKnockbackSimple___KnockbackS_sin +real array s__WoWReforgedKnockbackSimple___KnockbackS_cos +real array s__WoWReforgedKnockbackSimple___KnockbackS_r +string array s__WoWReforgedKnockbackSimple___KnockbackS_efect +string array s__WoWReforgedKnockbackSimple___KnockbackS_attachmentPoint constant integer si__ResurrectionStone=162 integer si__ResurrectionStone_F=0 integer si__ResurrectionStone_I=0 @@ -10690,25 +10660,25 @@ integer array s__MountData_abilityIdsCount integer array s___MountData_abilityIds constant integer s___MountData_abilityIds_size=8 integer array s__MountData_abilityIds -constant integer si__WoWReforgedMounts__M=165 -integer si__WoWReforgedMounts__M_F=0 -integer si__WoWReforgedMounts__M_I=0 -integer array si__WoWReforgedMounts__M_V -integer array s__WoWReforgedMounts__M_unitTypeId -integer array s__WoWReforgedMounts__M_abilityId -integer array s__WoWReforgedMounts__M_itemTypeId -boolean array s__WoWReforgedMounts__M_bonus -constant integer si__WoWReforgedStandardHeroAbilities___A=166 -integer si__WoWReforgedStandardHeroAbilities___A_F=0 -integer si__WoWReforgedStandardHeroAbilities___A_I=0 -integer array si__WoWReforgedStandardHeroAbilities___A_V -integer array s__WoWReforgedStandardHeroAbilities___A_itemTypeId -integer array s__WoWReforgedStandardHeroAbilities___A_abilityId -integer array s__WoWReforgedStandardHeroAbilities___A_maxLevel -boolean array s__WoWReforgedStandardHeroAbilities___A_requiresVIP -boolean array s__WoWReforgedStandardHeroAbilities___A_requiresReskillable -boolean array s__WoWReforgedStandardHeroAbilities___A_requiresAncientStructure -boolean array s__WoWReforgedStandardHeroAbilities___A_notAvailable +constant integer si__WoWReforgedMounts___M=165 +integer si__WoWReforgedMounts___M_F=0 +integer si__WoWReforgedMounts___M_I=0 +integer array si__WoWReforgedMounts___M_V +integer array s__WoWReforgedMounts___M_unitTypeId +integer array s__WoWReforgedMounts___M_abilityId +integer array s__WoWReforgedMounts___M_itemTypeId +boolean array s__WoWReforgedMounts___M_bonus +constant integer si__WoWReforgedStandardHeroAbilities__A=166 +integer si__WoWReforgedStandardHeroAbilities__A_F=0 +integer si__WoWReforgedStandardHeroAbilities__A_I=0 +integer array si__WoWReforgedStandardHeroAbilities__A_V +integer array s__WoWReforgedStandardHeroAbilities__A_itemTypeId +integer array s__WoWReforgedStandardHeroAbilities__A_abilityId +integer array s__WoWReforgedStandardHeroAbilities__A_maxLevel +boolean array s__WoWReforgedStandardHeroAbilities__A_requiresVIP +boolean array s__WoWReforgedStandardHeroAbilities__A_requiresReskillable +boolean array s__WoWReforgedStandardHeroAbilities__A_requiresAncientStructure +boolean array s__WoWReforgedStandardHeroAbilities__A_notAvailable constant integer si__Achievement=167 integer si__Achievement_F=0 integer si__Achievement_I=0 @@ -10856,14 +10826,14 @@ integer array s__Property_resource integer array s__Property_maxWorkers integer array s__Property_soldRace boolean array s__Property_shipyard -constant integer si__WoWReforgedHeroTransformation__HeroTransformationItemType=189 -integer si__WoWReforgedHeroTransformation__HeroTransformationItemType_F=0 -integer si__WoWReforgedHeroTransformation__HeroTransformationItemType_I=0 -integer array si__WoWReforgedHeroTransformation__HeroTransformationItemType_V -integer array s__WoWReforgedHeroTransformation__HeroTransformationItemType_id -integer array s__WoWReforgedHeroTransformation__HeroTransformationItemType_strengthUnitTypeId -integer array s__WoWReforgedHeroTransformation__HeroTransformationItemType_agilityUnitTypeId -integer array s__WoWReforgedHeroTransformation__HeroTransformationItemType_intelligenceUnitTypeId +constant integer si__WoWReforgedHeroTransformation___HeroTransformationItemType=189 +integer si__WoWReforgedHeroTransformation___HeroTransformationItemType_F=0 +integer si__WoWReforgedHeroTransformation___HeroTransformationItemType_I=0 +integer array si__WoWReforgedHeroTransformation___HeroTransformationItemType_V +integer array s__WoWReforgedHeroTransformation___HeroTransformationItemType_id +integer array s__WoWReforgedHeroTransformation___HeroTransformationItemType_strengthUnitTypeId +integer array s__WoWReforgedHeroTransformation___HeroTransformationItemType_agilityUnitTypeId +integer array s__WoWReforgedHeroTransformation___HeroTransformationItemType_intelligenceUnitTypeId integer array s__TimerUtils__data timer array s__TimerUtils__tT integer array s__s__AArrowKeys_m_playerArrowKeys @@ -10916,7 +10886,7 @@ trigger st__Missiles_reset trigger st__Missiles_move trigger st__Queue_onDestroy trigger st__TenacityUtils_addTimed -trigger st__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer +trigger st__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer trigger st__ResetCooldown_reset trigger st__TimedAbility_add trigger st__EffectSpam_spam @@ -12932,32 +12902,32 @@ function s__AArrowKeys_deallocate takes integer this returns nothing set si__AArrowKeys_F=this endfunction -//Generated allocator of WoWReforgedHeroTransformation__HeroTransformationItemType -function s__WoWReforgedHeroTransformation__HeroTransformationItemType__allocate takes nothing returns integer - local integer this=si__WoWReforgedHeroTransformation__HeroTransformationItemType_F +//Generated allocator of WoWReforgedHeroTransformation___HeroTransformationItemType +function s__WoWReforgedHeroTransformation___HeroTransformationItemType__allocate takes nothing returns integer + local integer this=si__WoWReforgedHeroTransformation___HeroTransformationItemType_F if (this!=0) then - set si__WoWReforgedHeroTransformation__HeroTransformationItemType_F=si__WoWReforgedHeroTransformation__HeroTransformationItemType_V[this] + set si__WoWReforgedHeroTransformation___HeroTransformationItemType_F=si__WoWReforgedHeroTransformation___HeroTransformationItemType_V[this] else - set si__WoWReforgedHeroTransformation__HeroTransformationItemType_I=si__WoWReforgedHeroTransformation__HeroTransformationItemType_I+1 - set this=si__WoWReforgedHeroTransformation__HeroTransformationItemType_I + set si__WoWReforgedHeroTransformation___HeroTransformationItemType_I=si__WoWReforgedHeroTransformation___HeroTransformationItemType_I+1 + set this=si__WoWReforgedHeroTransformation___HeroTransformationItemType_I endif if (this>8190) then return 0 endif - set si__WoWReforgedHeroTransformation__HeroTransformationItemType_V[this]=-1 + set si__WoWReforgedHeroTransformation___HeroTransformationItemType_V[this]=-1 return this endfunction -//Generated destructor of WoWReforgedHeroTransformation__HeroTransformationItemType -function s__WoWReforgedHeroTransformation__HeroTransformationItemType_deallocate takes integer this returns nothing +//Generated destructor of WoWReforgedHeroTransformation___HeroTransformationItemType +function s__WoWReforgedHeroTransformation___HeroTransformationItemType_deallocate takes integer this returns nothing if this==null then return - elseif (si__WoWReforgedHeroTransformation__HeroTransformationItemType_V[this]!=-1) then + elseif (si__WoWReforgedHeroTransformation___HeroTransformationItemType_V[this]!=-1) then return endif - set si__WoWReforgedHeroTransformation__HeroTransformationItemType_V[this]=si__WoWReforgedHeroTransformation__HeroTransformationItemType_F - set si__WoWReforgedHeroTransformation__HeroTransformationItemType_F=this + set si__WoWReforgedHeroTransformation___HeroTransformationItemType_V[this]=si__WoWReforgedHeroTransformation___HeroTransformationItemType_F + set si__WoWReforgedHeroTransformation___HeroTransformationItemType_F=this endfunction //Generated allocator of Property @@ -13280,60 +13250,60 @@ function s__Achievement_deallocate takes integer this returns nothing set si__Achievement_F=this endfunction -//Generated allocator of WoWReforgedStandardHeroAbilities___A -function s__WoWReforgedStandardHeroAbilities___A__allocate takes nothing returns integer - local integer this=si__WoWReforgedStandardHeroAbilities___A_F +//Generated allocator of WoWReforgedStandardHeroAbilities__A +function s__WoWReforgedStandardHeroAbilities__A__allocate takes nothing returns integer + local integer this=si__WoWReforgedStandardHeroAbilities__A_F if (this!=0) then - set si__WoWReforgedStandardHeroAbilities___A_F=si__WoWReforgedStandardHeroAbilities___A_V[this] + set si__WoWReforgedStandardHeroAbilities__A_F=si__WoWReforgedStandardHeroAbilities__A_V[this] else - set si__WoWReforgedStandardHeroAbilities___A_I=si__WoWReforgedStandardHeroAbilities___A_I+1 - set this=si__WoWReforgedStandardHeroAbilities___A_I + set si__WoWReforgedStandardHeroAbilities__A_I=si__WoWReforgedStandardHeroAbilities__A_I+1 + set this=si__WoWReforgedStandardHeroAbilities__A_I endif if (this>8190) then return 0 endif - set si__WoWReforgedStandardHeroAbilities___A_V[this]=-1 + set si__WoWReforgedStandardHeroAbilities__A_V[this]=-1 return this endfunction -//Generated destructor of WoWReforgedStandardHeroAbilities___A -function s__WoWReforgedStandardHeroAbilities___A_deallocate takes integer this returns nothing +//Generated destructor of WoWReforgedStandardHeroAbilities__A +function s__WoWReforgedStandardHeroAbilities__A_deallocate takes integer this returns nothing if this==null then return - elseif (si__WoWReforgedStandardHeroAbilities___A_V[this]!=-1) then + elseif (si__WoWReforgedStandardHeroAbilities__A_V[this]!=-1) then return endif - set si__WoWReforgedStandardHeroAbilities___A_V[this]=si__WoWReforgedStandardHeroAbilities___A_F - set si__WoWReforgedStandardHeroAbilities___A_F=this + set si__WoWReforgedStandardHeroAbilities__A_V[this]=si__WoWReforgedStandardHeroAbilities__A_F + set si__WoWReforgedStandardHeroAbilities__A_F=this endfunction -//Generated allocator of WoWReforgedMounts__M -function s__WoWReforgedMounts__M__allocate takes nothing returns integer - local integer this=si__WoWReforgedMounts__M_F +//Generated allocator of WoWReforgedMounts___M +function s__WoWReforgedMounts___M__allocate takes nothing returns integer + local integer this=si__WoWReforgedMounts___M_F if (this!=0) then - set si__WoWReforgedMounts__M_F=si__WoWReforgedMounts__M_V[this] + set si__WoWReforgedMounts___M_F=si__WoWReforgedMounts___M_V[this] else - set si__WoWReforgedMounts__M_I=si__WoWReforgedMounts__M_I+1 - set this=si__WoWReforgedMounts__M_I + set si__WoWReforgedMounts___M_I=si__WoWReforgedMounts___M_I+1 + set this=si__WoWReforgedMounts___M_I endif if (this>8190) then return 0 endif - set si__WoWReforgedMounts__M_V[this]=-1 + set si__WoWReforgedMounts___M_V[this]=-1 return this endfunction -//Generated destructor of WoWReforgedMounts__M -function s__WoWReforgedMounts__M_deallocate takes integer this returns nothing +//Generated destructor of WoWReforgedMounts___M +function s__WoWReforgedMounts___M_deallocate takes integer this returns nothing if this==null then return - elseif (si__WoWReforgedMounts__M_V[this]!=-1) then + elseif (si__WoWReforgedMounts___M_V[this]!=-1) then return endif - set si__WoWReforgedMounts__M_V[this]=si__WoWReforgedMounts__M_F - set si__WoWReforgedMounts__M_F=this + set si__WoWReforgedMounts___M_V[this]=si__WoWReforgedMounts___M_F + set si__WoWReforgedMounts___M_F=this endfunction //Generated allocator of MountData @@ -13395,32 +13365,32 @@ function s__ResurrectionStone_deallocate takes integer this returns nothing set si__ResurrectionStone_F=this endfunction -//Generated allocator of WoWReforgedKnockbackSimple__KnockbackS -function s__WoWReforgedKnockbackSimple__KnockbackS__allocate takes nothing returns integer - local integer this=si__WoWReforgedKnockbackSimple__KnockbackS_F +//Generated allocator of WoWReforgedKnockbackSimple___KnockbackS +function s__WoWReforgedKnockbackSimple___KnockbackS__allocate takes nothing returns integer + local integer this=si__WoWReforgedKnockbackSimple___KnockbackS_F if (this!=0) then - set si__WoWReforgedKnockbackSimple__KnockbackS_F=si__WoWReforgedKnockbackSimple__KnockbackS_V[this] + set si__WoWReforgedKnockbackSimple___KnockbackS_F=si__WoWReforgedKnockbackSimple___KnockbackS_V[this] else - set si__WoWReforgedKnockbackSimple__KnockbackS_I=si__WoWReforgedKnockbackSimple__KnockbackS_I+1 - set this=si__WoWReforgedKnockbackSimple__KnockbackS_I + set si__WoWReforgedKnockbackSimple___KnockbackS_I=si__WoWReforgedKnockbackSimple___KnockbackS_I+1 + set this=si__WoWReforgedKnockbackSimple___KnockbackS_I endif if (this>8190) then return 0 endif - set si__WoWReforgedKnockbackSimple__KnockbackS_V[this]=-1 + set si__WoWReforgedKnockbackSimple___KnockbackS_V[this]=-1 return this endfunction -//Generated destructor of WoWReforgedKnockbackSimple__KnockbackS -function s__WoWReforgedKnockbackSimple__KnockbackS_deallocate takes integer this returns nothing +//Generated destructor of WoWReforgedKnockbackSimple___KnockbackS +function s__WoWReforgedKnockbackSimple___KnockbackS_deallocate takes integer this returns nothing if this==null then return - elseif (si__WoWReforgedKnockbackSimple__KnockbackS_V[this]!=-1) then + elseif (si__WoWReforgedKnockbackSimple___KnockbackS_V[this]!=-1) then return endif - set si__WoWReforgedKnockbackSimple__KnockbackS_V[this]=si__WoWReforgedKnockbackSimple__KnockbackS_F - set si__WoWReforgedKnockbackSimple__KnockbackS_F=this + set si__WoWReforgedKnockbackSimple___KnockbackS_V[this]=si__WoWReforgedKnockbackSimple___KnockbackS_F + set si__WoWReforgedKnockbackSimple___KnockbackS_F=this endfunction //Generated allocator of JumpingStomp @@ -13551,32 +13521,32 @@ function s__Attributes___A_deallocate takes integer this returns nothing set si__Attributes___A_F=this endfunction -//Generated allocator of WoWReforgedTradingPosts__TradingPostResource -function s__WoWReforgedTradingPosts__TradingPostResource__allocate takes nothing returns integer - local integer this=si__WoWReforgedTradingPosts__TradingPostResource_F +//Generated allocator of WoWReforgedTradingPosts___TradingPostResource +function s__WoWReforgedTradingPosts___TradingPostResource__allocate takes nothing returns integer + local integer this=si__WoWReforgedTradingPosts___TradingPostResource_F if (this!=0) then - set si__WoWReforgedTradingPosts__TradingPostResource_F=si__WoWReforgedTradingPosts__TradingPostResource_V[this] + set si__WoWReforgedTradingPosts___TradingPostResource_F=si__WoWReforgedTradingPosts___TradingPostResource_V[this] else - set si__WoWReforgedTradingPosts__TradingPostResource_I=si__WoWReforgedTradingPosts__TradingPostResource_I+1 - set this=si__WoWReforgedTradingPosts__TradingPostResource_I + set si__WoWReforgedTradingPosts___TradingPostResource_I=si__WoWReforgedTradingPosts___TradingPostResource_I+1 + set this=si__WoWReforgedTradingPosts___TradingPostResource_I endif if (this>8190) then return 0 endif - set si__WoWReforgedTradingPosts__TradingPostResource_V[this]=-1 + set si__WoWReforgedTradingPosts___TradingPostResource_V[this]=-1 return this endfunction -//Generated destructor of WoWReforgedTradingPosts__TradingPostResource -function s__WoWReforgedTradingPosts__TradingPostResource_deallocate takes integer this returns nothing +//Generated destructor of WoWReforgedTradingPosts___TradingPostResource +function s__WoWReforgedTradingPosts___TradingPostResource_deallocate takes integer this returns nothing if this==null then return - elseif (si__WoWReforgedTradingPosts__TradingPostResource_V[this]!=-1) then + elseif (si__WoWReforgedTradingPosts___TradingPostResource_V[this]!=-1) then return endif - set si__WoWReforgedTradingPosts__TradingPostResource_V[this]=si__WoWReforgedTradingPosts__TradingPostResource_F - set si__WoWReforgedTradingPosts__TradingPostResource_F=this + set si__WoWReforgedTradingPosts___TradingPostResource_V[this]=si__WoWReforgedTradingPosts___TradingPostResource_F + set si__WoWReforgedTradingPosts___TradingPostResource_F=this endfunction //Generated allocator of Profession @@ -14776,8 +14746,8 @@ function s__ResetCooldown_deallocate takes integer this returns nothing set si__ResetCooldown_F=this endfunction -//Generated method caller for UnitEventEx__UnitEventEx.UnitEventEx__UnitEventExCore___resurrectionTimer -function sc__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer takes nothing returns nothing +//Generated method caller for UnitEventEx__UnitEventEx.UnitEventEx__UnitEventExCore__resurrectionTimer +function sc__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer takes nothing returns nothing set UnitEventEx__rezCheck=false call DestroyTimer(GetExpiredTimer()) endfunction @@ -16143,32 +16113,32 @@ function s__Account_deallocate takes integer this returns nothing set si__Account_F=this endfunction -//Generated allocator of UnitGroupRespawnSystemConfig___S -function s__UnitGroupRespawnSystemConfig___S__allocate takes nothing returns integer - local integer this=si__UnitGroupRespawnSystemConfig___S_F +//Generated allocator of UnitGroupRespawnSystemConfig__S +function s__UnitGroupRespawnSystemConfig__S__allocate takes nothing returns integer + local integer this=si__UnitGroupRespawnSystemConfig__S_F if (this!=0) then - set si__UnitGroupRespawnSystemConfig___S_F=si__UnitGroupRespawnSystemConfig___S_V[this] + set si__UnitGroupRespawnSystemConfig__S_F=si__UnitGroupRespawnSystemConfig__S_V[this] else - set si__UnitGroupRespawnSystemConfig___S_I=si__UnitGroupRespawnSystemConfig___S_I+1 - set this=si__UnitGroupRespawnSystemConfig___S_I + set si__UnitGroupRespawnSystemConfig__S_I=si__UnitGroupRespawnSystemConfig__S_I+1 + set this=si__UnitGroupRespawnSystemConfig__S_I endif if (this>8190) then return 0 endif - set si__UnitGroupRespawnSystemConfig___S_V[this]=-1 + set si__UnitGroupRespawnSystemConfig__S_V[this]=-1 return this endfunction -//Generated destructor of UnitGroupRespawnSystemConfig___S -function s__UnitGroupRespawnSystemConfig___S_deallocate takes integer this returns nothing +//Generated destructor of UnitGroupRespawnSystemConfig__S +function s__UnitGroupRespawnSystemConfig__S_deallocate takes integer this returns nothing if this==null then return - elseif (si__UnitGroupRespawnSystemConfig___S_V[this]!=-1) then + elseif (si__UnitGroupRespawnSystemConfig__S_V[this]!=-1) then return endif - set si__UnitGroupRespawnSystemConfig___S_V[this]=si__UnitGroupRespawnSystemConfig___S_F - set si__UnitGroupRespawnSystemConfig___S_F=this + set si__UnitGroupRespawnSystemConfig__S_V[this]=si__UnitGroupRespawnSystemConfig__S_F + set si__UnitGroupRespawnSystemConfig__S_F=this endfunction //Generated allocator of TurretSystem__S @@ -16647,7 +16617,7 @@ function s__Knockback__allocate takes nothing returns integer set s__Knockback_onEndAction[this]= 0 set s__Knockback_onTargetDeathAction[this]= 0 set s__Knockback_filterFunc[this]= 0 - set s__Knockback_ListModule_List___inlist[this]= false + set s__Knockback_ListModule_List__inlist[this]= false set s__Knockback_next[this]= 0 set s__Knockback_prev[this]= 0 set si__Knockback_V[this]=-1 @@ -16790,32 +16760,32 @@ function s__DependencyEquivalents_deallocate takes integer this returns nothing set si__DependencyEquivalents_F=this endfunction -//Generated allocator of QueueUIConfig___Tech -function s__QueueUIConfig___Tech__allocate takes nothing returns integer - local integer this=si__QueueUIConfig___Tech_F +//Generated allocator of QueueUIConfig__Tech +function s__QueueUIConfig__Tech__allocate takes nothing returns integer + local integer this=si__QueueUIConfig__Tech_F if (this!=0) then - set si__QueueUIConfig___Tech_F=si__QueueUIConfig___Tech_V[this] + set si__QueueUIConfig__Tech_F=si__QueueUIConfig__Tech_V[this] else - set si__QueueUIConfig___Tech_I=si__QueueUIConfig___Tech_I+1 - set this=si__QueueUIConfig___Tech_I + set si__QueueUIConfig__Tech_I=si__QueueUIConfig__Tech_I+1 + set this=si__QueueUIConfig__Tech_I endif if (this>8190) then return 0 endif - set si__QueueUIConfig___Tech_V[this]=-1 + set si__QueueUIConfig__Tech_V[this]=-1 return this endfunction -//Generated destructor of QueueUIConfig___Tech -function s__QueueUIConfig___Tech_deallocate takes integer this returns nothing +//Generated destructor of QueueUIConfig__Tech +function s__QueueUIConfig__Tech_deallocate takes integer this returns nothing if this==null then return - elseif (si__QueueUIConfig___Tech_V[this]!=-1) then + elseif (si__QueueUIConfig__Tech_V[this]!=-1) then return endif - set si__QueueUIConfig___Tech_V[this]=si__QueueUIConfig___Tech_F - set si__QueueUIConfig___Tech_F=this + set si__QueueUIConfig__Tech_V[this]=si__QueueUIConfig__Tech_F + set si__QueueUIConfig__Tech_F=this endfunction //Generated allocator of ItemRespawnSystem__S @@ -17813,47 +17783,47 @@ endfunction function h__RemoveUnit takes unit a0 returns nothing //hook: Attributes___HookRemoveUnit call sc___prototype10_evaluate(1,a0) - //hook: HeroUtils___RemoveUnitHook + //hook: HeroUtils__RemoveUnitHook call sc___prototype10_evaluate(2,a0) //hook: IdleWorkersSystem__RemoveUnitHook call sc___prototype10_evaluate(3,a0) //hook: ItemOrbOfLight___RemoveUnitHook call sc___prototype10_evaluate(4,a0) - //hook: WoWReforgedFelOrcDemonGate__RemoveUnitHook + //hook: WoWReforgedFelOrcDemonGate___RemoveUnitHook call sc___prototype10_evaluate(5,a0) - //hook: WoWReforgedFlamethrower__RemoveUnitHook + //hook: WoWReforgedFlamethrower___RemoveUnitHook call sc___prototype10_evaluate(6,a0) - //hook: HeroReviveEvents___RemoveUnitHook + //hook: HeroReviveEvents__RemoveUnitHook call sc___prototype10_evaluate(7,a0) //hook: Resources___RemoveUnitHook call sc___prototype10_evaluate(8,a0) //hook: TurretSystemRemoveVehicle call sc___prototype16_evaluate(1,a0) - //hook: WoWReforgedCombiner___RemoveUnitHook + //hook: WoWReforgedCombiner__RemoveUnitHook call sc___prototype10_evaluate(9,a0) - //hook: WoWReforgedFel__RemoveUnitHook + //hook: WoWReforgedFel___RemoveUnitHook call sc___prototype10_evaluate(10,a0) //hook: DisablePagedButtons call sc___prototype16_evaluate(2,a0) - //hook: Queue___ClearSourceCounterExtended + //hook: Queue__ClearSourceCounterExtended call sc___prototype10_evaluate(11,a0) - //hook: UnitGroupRespawnSystem___RemoveUnitCleanup + //hook: UnitGroupRespawnSystem__RemoveUnitCleanup call sc___prototype10_evaluate(12,a0) //hook: ResourcesGui___RemoveUnitHook call sc___prototype10_evaluate(13,a0) - //hook: Tunnel___RemoveUnitHook + //hook: Tunnel__RemoveUnitHook call sc___prototype10_evaluate(14,a0) - //hook: MassDevour___RemoveUnitMassDevour + //hook: MassDevour__RemoveUnitMassDevour call sc___prototype10_evaluate(15,a0) - //hook: Parry___RemoveUnitHook + //hook: Parry__RemoveUnitHook call sc___prototype10_evaluate(16,a0) - //hook: PhoenixEgg___RemoveUnitHook + //hook: PhoenixEgg__RemoveUnitHook call sc___prototype10_evaluate(17,a0) //hook: Railway___RemoveUnitHook call sc___prototype10_evaluate(18,a0) //hook: RayConfig___RemoveUnitHook call sc___prototype10_evaluate(19,a0) - //hook: Telekinesis___RemoveUnitTelekinesis + //hook: Telekinesis__RemoveUnitTelekinesis call sc___prototype10_evaluate(20,a0) //hook: Ray___RemoveUnitHook call sc___prototype10_evaluate(21,a0) @@ -17861,21 +17831,21 @@ function h__RemoveUnit takes unit a0 returns nothing call sc___prototype10_evaluate(22,a0) //hook: WoWReforgedOldHorde___RemoveDeathKnightHook call sc___prototype10_evaluate(23,a0) - //hook: WoWReforgedSummonedUnits__RemoveUnitHook + //hook: WoWReforgedSummonedUnits___RemoveUnitHook call sc___prototype10_evaluate(24,a0) //hook: WoWReforgedEnchanter__EnchanterSystemRemoveUnit call sc___prototype10_evaluate(25,a0) - //hook: WoWReforgedInscriptor__InscriptorSystemRemoveUnit + //hook: WoWReforgedInscriptor___InscriptorSystemRemoveUnit call sc___prototype10_evaluate(26,a0) - //hook: WoWReforgedThievesGuild__RemoveUnitHook + //hook: WoWReforgedThievesGuild___RemoveUnitHook call sc___prototype10_evaluate(27,a0) - //hook: WoWReforgedWitchHut__HookRemoveUnit + //hook: WoWReforgedWitchHut___HookRemoveUnit call sc___prototype10_evaluate(28,a0) - //hook: WoWReforgedWrapUp___HookRemoveConstructedBuilding + //hook: WoWReforgedWrapUp__HookRemoveConstructedBuilding call sc___prototype10_evaluate(29,a0) - //hook: WoWReforgedItemSets__ClearUnitHasItemSet + //hook: WoWReforgedItemSets___ClearUnitHasItemSet call sc___prototype10_evaluate(30,a0) - //hook: WoWReforgedEquipment___RemoveUnitHook + //hook: WoWReforgedEquipment__RemoveUnitHook call sc___prototype10_evaluate(31,a0) call RemoveUnit(a0) endfunction @@ -17930,49 +17900,49 @@ function h__DestroyQuestBJ takes quest a0 returns nothing call DestroyQuestBJ(a0) endfunction function h__SetTextTagText takes texttag a0, string a1, real a2 returns nothing - //hook: TextTagUtils___SetTextTagTextHook + //hook: TextTagUtils__SetTextTagTextHook call sc___prototype132_evaluate(1,a0,a1,a2) call SetTextTagText(a0,a1,a2) endfunction function h__DestroyTextTag takes texttag a0 returns nothing - //hook: TextTagUtils___DestroyTextTagHook + //hook: TextTagUtils__DestroyTextTagHook call sc___prototype131_evaluate(1,a0) call DestroyTextTag(a0) endfunction function h__SetTextTagPermanent takes texttag a0, boolean a1 returns nothing - //hook: TextTagUtils___SetTextTagPermanentHook + //hook: TextTagUtils__SetTextTagPermanentHook call sc___prototype133_evaluate(1,a0,a1) call SetTextTagPermanent(a0,a1) endfunction function h__SetTextTagPermanentBJ takes texttag a0, boolean a1 returns nothing - //hook: TextTagUtils___SetTextTagPermanentHook + //hook: TextTagUtils__SetTextTagPermanentHook call sc___prototype133_evaluate(1,a0,a1) call SetTextTagPermanentBJ(a0,a1) endfunction function h__SetPlayerTechResearched takes player a0, integer a1, integer a2 returns nothing - //hook: UnitTypeUtils___HookSetPlayerTechResearched + //hook: UnitTypeUtils__HookSetPlayerTechResearched call sc___prototype92_evaluate(1,a0,a1,a2) - //hook: WoWReforgedEvolution__HookSetPlayerTechResearched + //hook: WoWReforgedEvolution___HookSetPlayerTechResearched call sc___prototype92_evaluate(4,a0,a1,a2) - //hook: MaxHpResearch___HookSetPlayerTechResearched + //hook: MaxHpResearch__HookSetPlayerTechResearched call sc___prototype92_evaluate(7,a0,a1,a2) call SetPlayerTechResearched(a0,a1,a2) endfunction function h__AddPlayerTechResearched takes player a0, integer a1, integer a2 returns nothing - //hook: UnitTypeUtils___HookAddPlayerTechResearched + //hook: UnitTypeUtils__HookAddPlayerTechResearched call sc___prototype92_evaluate(2,a0,a1,a2) - //hook: WoWReforgedEvolution__HookAddPlayerTechResearched + //hook: WoWReforgedEvolution___HookAddPlayerTechResearched call sc___prototype92_evaluate(5,a0,a1,a2) - //hook: MaxHpResearch___HookAddPlayerTechResearched + //hook: MaxHpResearch__HookAddPlayerTechResearched call sc___prototype92_evaluate(8,a0,a1,a2) call AddPlayerTechResearched(a0,a1,a2) endfunction function h__BlzDecPlayerTechResearched takes player a0, integer a1, integer a2 returns nothing - //hook: UnitTypeUtils___HookBlzDecPlayerTechResearched + //hook: UnitTypeUtils__HookBlzDecPlayerTechResearched call sc___prototype92_evaluate(3,a0,a1,a2) - //hook: WoWReforgedEvolution__HookBlzDecPlayerTechResearched + //hook: WoWReforgedEvolution___HookBlzDecPlayerTechResearched call sc___prototype92_evaluate(6,a0,a1,a2) - //hook: MaxHpResearch___HookBlzDecPlayerTechResearched + //hook: MaxHpResearch__HookBlzDecPlayerTechResearched call sc___prototype92_evaluate(9,a0,a1,a2) call BlzDecPlayerTechResearched(a0,a1,a2) endfunction @@ -18054,27 +18024,27 @@ function h__GroupAddUnitSimple takes unit a0, group a1 returns nothing call GroupAddUnitSimple(a0,a1) endfunction function h__QuestSetCompletedBJ takes quest a0, boolean a1 returns nothing - //hook: WoWReforgedAchievements__QuestSetCompletedBJHook + //hook: WoWReforgedAchievements___QuestSetCompletedBJHook call sc___prototype457_evaluate(1,a0,a1) call QuestSetCompletedBJ(a0,a1) endfunction function h__WaygateActivate takes unit a0, boolean a1 returns nothing - //hook: WoWReforgedPortals__HookWaygateActivate + //hook: WoWReforgedPortals___HookWaygateActivate call sc___prototype147_evaluate(1,a0,a1) call WaygateActivate(a0,a1) endfunction function h__WaygateActivateBJ takes boolean a0, unit a1 returns nothing - //hook: WoWReforgedPortals__HookWaygateActivateBJ + //hook: WoWReforgedPortals___HookWaygateActivateBJ call sc___prototype480_evaluate(1,a0,a1) call WaygateActivateBJ(a0,a1) endfunction function h__WaygateSetDestination takes unit a0, real a1, real a2 returns nothing - //hook: WoWReforgedPortals__HookWaygateSetDestination + //hook: WoWReforgedPortals___HookWaygateSetDestination call sc___prototype244_evaluate(1,a0,a1,a2) call WaygateSetDestination(a0,a1,a2) endfunction function h__WaygateSetDestinationLocBJ takes unit a0, location a1 returns nothing - //hook: WoWReforgedPortals__HookWaygateSetDestinationLocBJ + //hook: WoWReforgedPortals___HookWaygateSetDestinationLocBJ call sc___prototype481_evaluate(1,a0,a1) call WaygateSetDestinationLocBJ(a0,a1) endfunction @@ -18546,7 +18516,7 @@ endfunction return a endfunction //Implemented from module Ascii___Init: - function s__Ascii___Inits_Ascii___Init___onInit takes nothing returns nothing + function s__Ascii___Inits_Ascii___Init__onInit takes nothing returns nothing set Ascii___i[966]=8 set Ascii___i[1110]=9 set Ascii___i[1621]=10 @@ -19351,7 +19321,7 @@ endfunction //Implemented from module BlackArrowSystem__Init: - function s__BlackArrowSystem__S_BlackArrowSystem__Init___onInit takes nothing returns nothing + function s__BlackArrowSystem__S_BlackArrowSystem__Init__onInit takes nothing returns nothing call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem__BlackArrowDamageTrigger, EVENT_PLAYER_UNIT_DAMAGED) call TriggerAddCondition(BlackArrowSystem__BlackArrowDamageTrigger, Condition(function BlackArrowSystem__TriggerConditionDamage)) call TriggerAddAction(BlackArrowSystem__BlackArrowDamageTrigger, function BlackArrowSystem__TriggerActionDamage) @@ -19639,16 +19609,16 @@ function Corpse takes integer abilityId,unit caster,real x,real y returns nothin call CreateCorpse(GetOwningPlayer(caster), 'ucry', x, y, 0.0) endfunction -function Corpse___TriggerConditionCast takes nothing returns boolean +function Corpse__TriggerConditionCast takes nothing returns boolean if ( GetSpellAbilityId() == Corpse_ABILITY_ID_ITEM or GetSpellAbilityId() == Corpse_ABILITY_ID ) then call Corpse(GetSpellAbilityId() , GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY()) endif return false endfunction -function Corpse___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Corpse___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(Corpse___castTrigger, Condition(function Corpse___TriggerConditionCast)) +function Corpse__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Corpse__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(Corpse__castTrigger, Condition(function Corpse__TriggerConditionCast)) endfunction @@ -20077,7 +20047,7 @@ endfunction endfunction //Implemented from module FileIO___FileInit: - function s__File_FileIO___FileInit___onInit takes nothing returns nothing + function s__File_FileIO___FileInit__onInit takes nothing returns nothing local string originalTooltip // We can't use a single ability with multiple levels because @@ -20310,11 +20280,11 @@ endfunction function GetAllPlayingUsers takes nothing returns force - return ForceUtils___allPlayingUsers + return ForceUtils__allPlayingUsers endfunction function GetAllPlayingUsersCount takes nothing returns integer - return ForceUtils___allPlayingUsersCounter + return ForceUtils__allPlayingUsersCounter endfunction function TriggerRegisterAnyUserEvent takes trigger whichTrigger,playerevent whichPlayerEvent returns nothing @@ -20331,17 +20301,17 @@ function TriggerRegisterAnyUserEvent takes trigger whichTrigger,playerevent whic endloop endfunction -function ForceUtils___TriggerConditionPlayerLeaves takes nothing returns boolean - call ForceRemovePlayer(ForceUtils___allPlayingUsers, GetTriggerPlayer()) - set ForceUtils___allPlayingUsersCounter=ForceUtils___allPlayingUsersCounter - 1 +function ForceUtils__TriggerConditionPlayerLeaves takes nothing returns boolean + call ForceRemovePlayer(ForceUtils__allPlayingUsers, GetTriggerPlayer()) + set ForceUtils__allPlayingUsersCounter=ForceUtils__allPlayingUsersCounter - 1 return false endfunction -function ForceUtils___Init takes nothing returns nothing - call ForceAddPlayingUserPlayers(ForceUtils___allPlayingUsers) - set ForceUtils___allPlayingUsersCounter=CountPlayersInForceBJ(ForceUtils___allPlayingUsers) - call TriggerRegisterAnyUserEvent(ForceUtils___leaveTrigger , EVENT_PLAYER_LEAVE) - call TriggerAddCondition(ForceUtils___leaveTrigger, Condition(function ForceUtils___TriggerConditionPlayerLeaves)) +function ForceUtils__Init takes nothing returns nothing + call ForceAddPlayingUserPlayers(ForceUtils__allPlayingUsers) + set ForceUtils__allPlayingUsersCounter=CountPlayersInForceBJ(ForceUtils__allPlayingUsers) + call TriggerRegisterAnyUserEvent(ForceUtils__leaveTrigger , EVENT_PLAYER_LEAVE) + call TriggerAddCondition(ForceUtils__leaveTrigger, Condition(function ForceUtils__TriggerConditionPlayerLeaves)) endfunction @@ -20415,7 +20385,7 @@ endfunction //Implemented from module GameStatus___GameStatusInit: - function s__GameStatus___GameStatus_GameStatus___GameStatusInit___onInit takes nothing returns nothing + function s__GameStatus___GameStatus_GameStatus___GameStatusInit__onInit takes nothing returns nothing local player firstPlayer local unit u local boolean selected @@ -20930,21 +20900,21 @@ endfunction function TriggerRegisterHeroUnskillEvent takes trigger whichTrigger returns nothing - set HeroUtils___unskillTrigger[HeroUtils___unskillTriggerCounter]=whichTrigger - set HeroUtils___unskillTriggerCounter=HeroUtils___unskillTriggerCounter + 1 + set HeroUtils__unskillTrigger[HeroUtils__unskillTriggerCounter]=whichTrigger + set HeroUtils__unskillTriggerCounter=HeroUtils__unskillTriggerCounter + 1 endfunction function GetTriggerUnskilledHero takes nothing returns unit - return HeroUtils___unskilledHero + return HeroUtils__unskilledHero endfunction -function HeroUtils___ExecuteEvaluateCallbackUnskillTriggers takes unit hero returns nothing +function HeroUtils__ExecuteEvaluateCallbackUnskillTriggers takes unit hero returns nothing local integer i= 0 - set HeroUtils___unskilledHero=hero + set HeroUtils__unskilledHero=hero loop - exitwhen ( i == HeroUtils___unskillTriggerCounter ) - if ( IsTriggerEnabled(HeroUtils___unskillTrigger[i]) ) then - call ConditionalTriggerExecute(HeroUtils___unskillTrigger[i]) + exitwhen ( i == HeroUtils__unskillTriggerCounter ) + if ( IsTriggerEnabled(HeroUtils__unskillTrigger[i]) ) then + call ConditionalTriggerExecute(HeroUtils__unskillTrigger[i]) endif set i=i + 1 endloop @@ -20956,42 +20926,42 @@ function UnskillHero takes unit hero returns nothing call UnitAddItemById(hero, HeroUtils_TOME_OF_RETRAINING) endif - call HeroUtils___ExecuteEvaluateCallbackUnskillTriggers(hero) + call HeroUtils__ExecuteEvaluateCallbackUnskillTriggers(hero) endfunction function GetPreviousHeroLevel takes unit hero returns integer - return IMaxBJ(LoadInteger(HeroUtils___h, GetHandleId(hero), 0), 1) + return IMaxBJ(LoadInteger(HeroUtils__h, GetHandleId(hero), 0), 1) endfunction function GetGainedHeroLevels takes unit hero returns integer - return GetHeroLevel(hero) - (IMaxBJ(LoadInteger(HeroUtils___h, GetHandleId((hero)), 0), 1)) // INLINED!! + return GetHeroLevel(hero) - (IMaxBJ(LoadInteger(HeroUtils__h, GetHandleId((hero)), 0), 1)) // INLINED!! endfunction function CopyHeroLevelGainData takes integer sourceHandleId,integer targetHandleId returns nothing - call SaveInteger(HeroUtils___h, targetHandleId, 0, LoadInteger(HeroUtils___h, sourceHandleId, 0)) - call SaveInteger(HeroUtils___h, targetHandleId, 1, LoadInteger(HeroUtils___h, sourceHandleId, 1)) + call SaveInteger(HeroUtils__h, targetHandleId, 0, LoadInteger(HeroUtils__h, sourceHandleId, 0)) + call SaveInteger(HeroUtils__h, targetHandleId, 1, LoadInteger(HeroUtils__h, sourceHandleId, 1)) endfunction -function HeroUtils___TriggerConditionLevel takes nothing returns boolean +function HeroUtils__TriggerConditionLevel takes nothing returns boolean local unit levelingUnit= GetLevelingUnit() local integer handleId= GetHandleId(levelingUnit) - call SaveInteger(HeroUtils___h, handleId, 0, LoadInteger(HeroUtils___h, handleId, 1)) - call SaveInteger(HeroUtils___h, handleId, 1, GetHeroLevel(levelingUnit)) + call SaveInteger(HeroUtils__h, handleId, 0, LoadInteger(HeroUtils__h, handleId, 1)) + call SaveInteger(HeroUtils__h, handleId, 1, GetHeroLevel(levelingUnit)) set levelingUnit=null return false endfunction -function HeroUtils___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(HeroUtils___levelTrigger, EVENT_PLAYER_HERO_LEVEL) - call TriggerAddCondition(HeroUtils___levelTrigger, Condition(function HeroUtils___TriggerConditionLevel)) +function HeroUtils__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(HeroUtils__levelTrigger, EVENT_PLAYER_HERO_LEVEL) + call TriggerAddCondition(HeroUtils__levelTrigger, Condition(function HeroUtils__TriggerConditionLevel)) endfunction -function HeroUtils___RemoveUnitHook takes unit whichUnit returns nothing - call FlushChildHashtable(HeroUtils___h, GetHandleId(whichUnit)) +function HeroUtils__RemoveUnitHook takes unit whichUnit returns nothing + call FlushChildHashtable(HeroUtils__h, GetHandleId(whichUnit)) endfunction -//processed hook: hook RemoveUnit HeroUtils___RemoveUnitHook +//processed hook: hook RemoveUnit HeroUtils__RemoveUnitHook //library HeroUtils ends @@ -21004,7 +20974,7 @@ function InitHost takes nothing returns nothing loop set slotPlayer=Player(i) if ( GetPlayerController(slotPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING ) then - set HostUtils___Host=Player(i) + set HostUtils__Host=Player(i) exitwhen ( true ) endif set slotPlayer=null @@ -21013,16 +20983,16 @@ function InitHost takes nothing returns nothing endloop endfunction -function HostUtils___Init takes nothing returns nothing +function HostUtils__Init takes nothing returns nothing call InitHost() endfunction function GetHost takes nothing returns player - if ( HostUtils___Host == null or GetPlayerSlotState(HostUtils___Host) != PLAYER_SLOT_STATE_PLAYING ) then + if ( HostUtils__Host == null or GetPlayerSlotState(HostUtils__Host) != PLAYER_SLOT_STATE_PLAYING ) then call InitHost() endif - return HostUtils___Host + return HostUtils__Host endfunction @@ -21578,7 +21548,7 @@ endfunction //Implemented from module ItemRespawnSystem__Init: - function s__ItemRespawnSystem__S_ItemRespawnSystem__Init___onInit takes nothing returns nothing + function s__ItemRespawnSystem__S_ItemRespawnSystem__Init__onInit takes nothing returns nothing call TriggerRegisterAnyUnitEventBJ(ItemRespawnSystem__pickupItemTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) call TriggerAddCondition(ItemRespawnSystem__pickupItemTrigger, Condition(function ItemRespawnSystem__TriggerConditionRespawnItem)) call TriggerAddAction(ItemRespawnSystem__pickupItemTrigger, function ItemRespawnSystem__TriggerActionRespawnItem) @@ -21617,20 +21587,20 @@ endfunction // https://www.hiveworkshop.com/threads/detecting-item-price.120355/ // This is the x position where we create the dummy units. Dont place it in the water. -function ItemTypeUtils___GetShopDummyX takes nothing returns real +function ItemTypeUtils__GetShopDummyX takes nothing returns real return GetRectCenterX(gg_rct_Evolution_Dummy_Area) endfunction // This is the y position where we create the dummy units. Dont place it in the water. -function ItemTypeUtils___GetShopDummyY takes nothing returns real +function ItemTypeUtils__GetShopDummyY takes nothing returns real return GetRectCenterY(gg_rct_Evolution_Dummy_Area) endfunction function GetItemValueGoldFresh takes integer i returns integer local real x= (GetRectCenterX(gg_rct_Evolution_Dummy_Area)) // INLINED!! local real y= (GetRectCenterY(gg_rct_Evolution_Dummy_Area)) // INLINED!! - local unit u1= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils___SHOP, x, y, 0) - local unit u2= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils___SELL_UNIT, x, y - 100, 90) + local unit u1= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils__SHOP, x, y, 0) + local unit u2= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils__SELL_UNIT, x, y - 100, 90) local item a= UnitAddItemById(u2, i) local integer g1= GetPlayerState(Player(PLAYER_NEUTRAL_PASSIVE), PLAYER_STATE_RESOURCE_GOLD) local integer g2= 0 @@ -21647,17 +21617,17 @@ function GetItemValueGoldFresh takes integer i returns integer endfunction function GetItemValueGold takes integer i returns integer - if ( not HaveSavedInteger(ItemTypeUtils___h, i, ItemTypeUtils___KEY_VALUE_GOLD) ) then - call SaveInteger(ItemTypeUtils___h, i, ItemTypeUtils___KEY_VALUE_GOLD, GetItemValueGoldFresh(i)) + if ( not HaveSavedInteger(ItemTypeUtils__h, i, ItemTypeUtils__KEY_VALUE_GOLD) ) then + call SaveInteger(ItemTypeUtils__h, i, ItemTypeUtils__KEY_VALUE_GOLD, GetItemValueGoldFresh(i)) endif - return LoadInteger(ItemTypeUtils___h, i, ItemTypeUtils___KEY_VALUE_GOLD) + return LoadInteger(ItemTypeUtils__h, i, ItemTypeUtils__KEY_VALUE_GOLD) endfunction function GetItemValueLumberFresh takes integer i returns integer local real x= (GetRectCenterX(gg_rct_Evolution_Dummy_Area)) // INLINED!! local real y= (GetRectCenterY(gg_rct_Evolution_Dummy_Area)) // INLINED!! - local unit u1= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils___SHOP, x, y, 0) - local unit u2= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils___SELL_UNIT, x, y - 100, 90) + local unit u1= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils__SHOP, x, y, 0) + local unit u2= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), ItemTypeUtils__SELL_UNIT, x, y - 100, 90) local item a= UnitAddItemById(u2, i) local integer g1= GetPlayerState(Player(PLAYER_NEUTRAL_PASSIVE), PLAYER_STATE_RESOURCE_LUMBER) local integer g2= 0 @@ -21674,10 +21644,10 @@ function GetItemValueLumberFresh takes integer i returns integer endfunction function GetItemValueLumber takes integer i returns integer - if ( not HaveSavedInteger(ItemTypeUtils___h, i, ItemTypeUtils___KEY_VALUE_LUMBER) ) then - call SaveInteger(ItemTypeUtils___h, i, ItemTypeUtils___KEY_VALUE_LUMBER, GetItemValueLumberFresh(i)) + if ( not HaveSavedInteger(ItemTypeUtils__h, i, ItemTypeUtils__KEY_VALUE_LUMBER) ) then + call SaveInteger(ItemTypeUtils__h, i, ItemTypeUtils__KEY_VALUE_LUMBER, GetItemValueLumberFresh(i)) endif - return LoadInteger(ItemTypeUtils___h, i, ItemTypeUtils___KEY_VALUE_LUMBER) + return LoadInteger(ItemTypeUtils__h, i, ItemTypeUtils__KEY_VALUE_LUMBER) endfunction function GetItemTypePerishableFresh takes integer i returns boolean @@ -21690,10 +21660,10 @@ function GetItemTypePerishableFresh takes integer i returns boolean endfunction function GetItemTypePerishable takes integer i returns boolean - if ( not HaveSavedBoolean(ItemTypeUtils___h, i, ItemTypeUtils___KEY_PERISHABLE) ) then - call SaveBoolean(ItemTypeUtils___h, i, ItemTypeUtils___KEY_PERISHABLE, GetItemTypePerishableFresh(i)) + if ( not HaveSavedBoolean(ItemTypeUtils__h, i, ItemTypeUtils__KEY_PERISHABLE) ) then + call SaveBoolean(ItemTypeUtils__h, i, ItemTypeUtils__KEY_PERISHABLE, GetItemTypePerishableFresh(i)) endif - return LoadBoolean(ItemTypeUtils___h, i, ItemTypeUtils___KEY_PERISHABLE) + return LoadBoolean(ItemTypeUtils__h, i, ItemTypeUtils__KEY_PERISHABLE) endfunction function GetItemTypeModelFresh takes integer i returns string @@ -21706,10 +21676,10 @@ function GetItemTypeModelFresh takes integer i returns string endfunction function GetItemTypeModel takes integer i returns string - if ( not HaveSavedString(ItemTypeUtils___h, i, ItemTypeUtils___KEY_MODEL) ) then - call SaveStr(ItemTypeUtils___h, i, ItemTypeUtils___KEY_MODEL, GetItemTypeModelFresh(i)) + if ( not HaveSavedString(ItemTypeUtils__h, i, ItemTypeUtils__KEY_MODEL) ) then + call SaveStr(ItemTypeUtils__h, i, ItemTypeUtils__KEY_MODEL, GetItemTypeModelFresh(i)) endif - return LoadStr(ItemTypeUtils___h, i, ItemTypeUtils___KEY_MODEL) + return LoadStr(ItemTypeUtils__h, i, ItemTypeUtils__KEY_MODEL) endfunction function GetItemTypeIconFresh takes integer i returns string @@ -21722,10 +21692,10 @@ function GetItemTypeIconFresh takes integer i returns string endfunction function GetItemTypeIcon takes integer i returns string - if ( not HaveSavedString(ItemTypeUtils___h, i, ItemTypeUtils___KEY_ICON) ) then - call SaveStr(ItemTypeUtils___h, i, ItemTypeUtils___KEY_ICON, GetItemTypeIconFresh(i)) + if ( not HaveSavedString(ItemTypeUtils__h, i, ItemTypeUtils__KEY_ICON) ) then + call SaveStr(ItemTypeUtils__h, i, ItemTypeUtils__KEY_ICON, GetItemTypeIconFresh(i)) endif - return LoadStr(ItemTypeUtils___h, i, ItemTypeUtils___KEY_ICON) + return LoadStr(ItemTypeUtils__h, i, ItemTypeUtils__KEY_ICON) endfunction @@ -21780,26 +21750,26 @@ function RemoveAllItemsOfTypeId takes unit whichUnit,integer itemId returns inte endfunction -function ItemUtils___FilterIsItemOfType takes nothing returns boolean - if ( GetItemTypeId(GetFilterItem()) == ItemUtils___filterItemTypeId ) then - set ItemUtils___countFilteredItems=ItemUtils___countFilteredItems + 1 +function ItemUtils__FilterIsItemOfType takes nothing returns boolean + if ( GetItemTypeId(GetFilterItem()) == ItemUtils__filterItemTypeId ) then + set ItemUtils__countFilteredItems=ItemUtils__countFilteredItems + 1 endif return false endfunction function CountItemsOfTypeIdAllEx takes rect whichRect,integer itemTypeId returns integer - set ItemUtils___filterItemTypeId=itemTypeId - set ItemUtils___countFilteredItems=0 - call EnumItemsInRect(whichRect, ItemUtils___filterIsItemOfType, null) - return ItemUtils___countFilteredItems + set ItemUtils__filterItemTypeId=itemTypeId + set ItemUtils__countFilteredItems=0 + call EnumItemsInRect(whichRect, ItemUtils__filterIsItemOfType, null) + return ItemUtils__countFilteredItems endfunction function CountItemsOfTypeIdAll takes integer itemTypeId returns integer return CountItemsOfTypeIdAllEx(GetPlayableMapRect() , itemTypeId) endfunction -function ItemUtils___Init takes nothing returns nothing - set ItemUtils___filterIsItemOfType=Filter(function ItemUtils___FilterIsItemOfType) +function ItemUtils__Init takes nothing returns nothing + set ItemUtils__filterIsItemOfType=Filter(function ItemUtils__FilterIsItemOfType) endfunction @@ -22367,16 +22337,16 @@ endfunction endfunction //Implemented from module MouseUtils___Init: - function s__UserMouse_MouseUtils___Init___invokeTimerInit takes nothing returns nothing + function s__UserMouse_MouseUtils___Init__invokeTimerInit takes nothing returns nothing call PauseTimer(GetExpiredTimer()) call DestroyTimer(GetExpiredTimer()) call s__UserMouse_initCallback() // INLINED!! endfunction - function s__UserMouse_MouseUtils___Init___onInit takes nothing returns nothing + function s__UserMouse_MouseUtils___Init__onInit takes nothing returns nothing set s__UserMouse_evTrigger[EVENT_MOUSE_UP]=CreateTrigger() set s__UserMouse_evTrigger[EVENT_MOUSE_DOWN]=CreateTrigger() set s__UserMouse_evTrigger[EVENT_MOUSE_MOVE]=CreateTrigger() - call TimerStart(CreateTimer(), 0.00, false, function s__UserMouse_MouseUtils___Init___invokeTimerInit) + call TimerStart(CreateTimer(), 0.00, false, function s__UserMouse_MouseUtils___Init__invokeTimerInit) endfunction function GetPlayerMouseX takes player p returns real return s__UserMouse_mouseX[s__UserMouse__staticgetindex(p)] @@ -22462,9 +22432,9 @@ endfunction function AddQuestItemToQuest takes quest whichQuest,questitem whichQuestItem returns integer local integer handleId= GetHandleId(whichQuest) - local integer counter= LoadInteger(QuestUtils___h, handleId, QuestUtils___KEY_COUNTER) - call SaveQuestItemHandle(QuestUtils___h, handleId, counter, whichQuestItem) - call SaveInteger(QuestUtils___h, handleId, QuestUtils___KEY_COUNTER, counter + 1) + local integer counter= LoadInteger(QuestUtils__h, handleId, QuestUtils__KEY_COUNTER) + call SaveQuestItemHandle(QuestUtils__h, handleId, counter, whichQuestItem) + call SaveInteger(QuestUtils__h, handleId, QuestUtils__KEY_COUNTER, counter + 1) return counter endfunction @@ -22488,47 +22458,47 @@ endfunction function QuestGetTitle takes quest whichQuest returns string local integer handleId= GetHandleId(whichQuest) - return LoadStr(QuestUtils___h, handleId, QuestUtils___KEY_TITLE) + return LoadStr(QuestUtils__h, handleId, QuestUtils__KEY_TITLE) endfunction function QuestGetDescription takes quest whichQuest returns string local integer handleId= GetHandleId(whichQuest) - return LoadStr(QuestUtils___h, handleId, QuestUtils___KEY_DESCRIPTION) + return LoadStr(QuestUtils__h, handleId, QuestUtils__KEY_DESCRIPTION) endfunction function QuestGetItemCount takes quest whichQuest returns integer local integer handleId= GetHandleId(whichQuest) - return LoadInteger(QuestUtils___h, handleId, QuestUtils___KEY_COUNTER) + return LoadInteger(QuestUtils__h, handleId, QuestUtils__KEY_COUNTER) endfunction function QuestGetItem takes quest whichQuest,integer index returns questitem local integer handleId= GetHandleId(whichQuest) - return LoadQuestItemHandle(QuestUtils___h, handleId, index) + return LoadQuestItemHandle(QuestUtils__h, handleId, index) endfunction function QuestItemGetDescription takes questitem whichQuestItem returns string local integer handleId= GetHandleId(whichQuestItem) - return LoadStr(QuestUtils___h, handleId, QuestUtils___KEY_DESCRIPTION) + return LoadStr(QuestUtils__h, handleId, QuestUtils__KEY_DESCRIPTION) endfunction function QuestSetTitleHook takes quest whichQuest,string title returns nothing local integer handleId= GetHandleId(whichQuest) - call SaveStr(QuestUtils___h, handleId, QuestUtils___KEY_TITLE, title) + call SaveStr(QuestUtils__h, handleId, QuestUtils__KEY_TITLE, title) endfunction function QuestSetDescriptionHook takes quest whichQuest,string description returns nothing local integer handleId= GetHandleId(whichQuest) - call SaveStr(QuestUtils___h, handleId, QuestUtils___KEY_DESCRIPTION, description) + call SaveStr(QuestUtils__h, handleId, QuestUtils__KEY_DESCRIPTION, description) endfunction function QuestItemSetDescriptionHook takes questitem whichQuestItem,string description returns nothing local integer handleId= GetHandleId(whichQuestItem) - call SaveStr(QuestUtils___h, handleId, QuestUtils___KEY_DESCRIPTION, description) + call SaveStr(QuestUtils__h, handleId, QuestUtils__KEY_DESCRIPTION, description) endfunction function DestroyQuestHook takes quest whichQuest returns nothing local integer handleId= GetHandleId(whichQuest) - call FlushChildHashtable(QuestUtils___h, handleId) + call FlushChildHashtable(QuestUtils__h, handleId) endfunction //processed hook: hook QuestSetTitle QuestSetTitleHook @@ -22546,54 +22516,54 @@ endfunction -function QueueUIConfig___AddTech takes integer id,string name,string icon returns nothing - local integer this= s__QueueUIConfig___Tech__allocate() - local integer level= LoadInteger(QueueUIConfig___h, id, QueueUIConfig___KEY_LEVELS) - set s__QueueUIConfig___Tech_name[this]=name - set s__QueueUIConfig___Tech_icon[this]=icon - call SaveInteger(QueueUIConfig___h, id, QueueUIConfig___KEY_LEVEL_1 + level, this) - call SaveInteger(QueueUIConfig___h, id, QueueUIConfig___KEY_LEVELS, level + 1) +function QueueUIConfig__AddTech takes integer id,string name,string icon returns nothing + local integer this= s__QueueUIConfig__Tech__allocate() + local integer level= LoadInteger(QueueUIConfig__h, id, QueueUIConfig__KEY_LEVELS) + set s__QueueUIConfig__Tech_name[this]=name + set s__QueueUIConfig__Tech_icon[this]=icon + call SaveInteger(QueueUIConfig__h, id, QueueUIConfig__KEY_LEVEL_1 + level, this) + call SaveInteger(QueueUIConfig__h, id, QueueUIConfig__KEY_LEVELS, level + 1) endfunction -function QueueUIConfig___GetTech takes integer id,player whichPlayer returns integer +function QueueUIConfig__GetTech takes integer id,player whichPlayer returns integer local integer level= GetPlayerTechCount(whichPlayer, id, true) if ( level > 0 ) then - return LoadInteger(QueueUIConfig___h, id, level) // start with level 1 + return LoadInteger(QueueUIConfig__h, id, level) // start with level 1 endif return 0 endfunction function QueueUIConfig_GetName takes integer id,player whichPlayer returns string - local integer tech= QueueUIConfig___GetTech(id , whichPlayer) + local integer tech= QueueUIConfig__GetTech(id , whichPlayer) if ( tech != 0 ) then - return s__QueueUIConfig___Tech_name[tech] + return s__QueueUIConfig__Tech_name[tech] endif return GetObjectName(id) endfunction function QueueUIConfig_GetIcon takes integer id,player whichPlayer returns string - local integer tech= QueueUIConfig___GetTech(id , whichPlayer) + local integer tech= QueueUIConfig__GetTech(id , whichPlayer) if ( tech != 0 ) then - return s__QueueUIConfig___Tech_icon[tech] + return s__QueueUIConfig__Tech_icon[tech] endif return BlzGetAbilityIcon(id) endfunction -function QueueUIConfig___Init takes nothing returns nothing +function QueueUIConfig__Init takes nothing returns nothing // Human - call QueueUIConfig___AddTech('Rhme' , "Steel Forged Swords" , "ReplaceableTextures\\CommandButtons\\BTNThoriumMelee.blp") - call QueueUIConfig___AddTech('Rhme' , "Mithril Forged Swords" , "ReplaceableTextures\\CommandButtons\\BTNArcaniteMelee.blp") - call QueueUIConfig___AddTech('Rhra' , "Refined Gunpowder" , "ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpTwo.blp") - call QueueUIConfig___AddTech('Rhra' , "Imbued Gunpowder" , "ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpThree.blp") - call QueueUIConfig___AddTech('Rhla' , "Reinforced Leather Armor" , "ReplaceableTextures\\CommandButtons\\BTNLeatherUpgradeTwo.blp") - call QueueUIConfig___AddTech('Rhla' , "Dragonhide Armor" , "ReplaceableTextures\\CommandButtons\\BTNLeatherUpgradeThree.blp") - call QueueUIConfig___AddTech('Rhar' , "Steel Plating" , "ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpTwo.blp") - call QueueUIConfig___AddTech('Rhar' , "Mithril Plating" , "ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpThree.blp") - call QueueUIConfig___AddTech('Rhlh' , "Advanced Lumber Harvesting" , "ReplaceableTextures\\CommandButtons\\BTNHumanLumberUpgrade2.blp") - call QueueUIConfig___AddTech('Rhac' , "Advanced Masonry" , "ReplaceableTextures\\CommandButtons\\BTNArcaniteArchitecture.blp") - call QueueUIConfig___AddTech('Rhac' , "Imbued Masonry" , "ReplaceableTextures\\CommandButtons\\BTNImbuedMasonry.blp") - call QueueUIConfig___AddTech('Rhpt' , "Priest Master Training" , "ReplaceableTextures\\CommandButtons\\BTNPriestMaster.blp") - call QueueUIConfig___AddTech('Rhst' , "Sorceress Master Training" , "ReplaceableTextures\\CommandButtons\\BTNSorceressMaster.blp") + call QueueUIConfig__AddTech('Rhme' , "Steel Forged Swords" , "ReplaceableTextures\\CommandButtons\\BTNThoriumMelee.blp") + call QueueUIConfig__AddTech('Rhme' , "Mithril Forged Swords" , "ReplaceableTextures\\CommandButtons\\BTNArcaniteMelee.blp") + call QueueUIConfig__AddTech('Rhra' , "Refined Gunpowder" , "ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpTwo.blp") + call QueueUIConfig__AddTech('Rhra' , "Imbued Gunpowder" , "ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpThree.blp") + call QueueUIConfig__AddTech('Rhla' , "Reinforced Leather Armor" , "ReplaceableTextures\\CommandButtons\\BTNLeatherUpgradeTwo.blp") + call QueueUIConfig__AddTech('Rhla' , "Dragonhide Armor" , "ReplaceableTextures\\CommandButtons\\BTNLeatherUpgradeThree.blp") + call QueueUIConfig__AddTech('Rhar' , "Steel Plating" , "ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpTwo.blp") + call QueueUIConfig__AddTech('Rhar' , "Mithril Plating" , "ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpThree.blp") + call QueueUIConfig__AddTech('Rhlh' , "Advanced Lumber Harvesting" , "ReplaceableTextures\\CommandButtons\\BTNHumanLumberUpgrade2.blp") + call QueueUIConfig__AddTech('Rhac' , "Advanced Masonry" , "ReplaceableTextures\\CommandButtons\\BTNArcaniteArchitecture.blp") + call QueueUIConfig__AddTech('Rhac' , "Imbued Masonry" , "ReplaceableTextures\\CommandButtons\\BTNImbuedMasonry.blp") + call QueueUIConfig__AddTech('Rhpt' , "Priest Master Training" , "ReplaceableTextures\\CommandButtons\\BTNPriestMaster.blp") + call QueueUIConfig__AddTech('Rhst' , "Sorceress Master Training" , "ReplaceableTextures\\CommandButtons\\BTNSorceressMaster.blp") endfunction @@ -24184,10 +24154,10 @@ endfunction function AddTextTag takes texttag t returns nothing local integer handleId= GetHandleId(t) - if ( not HaveSavedHandle(TextTagUtils___h, handleId, 0) ) then - set TextTagUtils___allTextTags[TextTagUtils___allTextTagsCounter]=t - set TextTagUtils___allTextTagsCounter=TextTagUtils___allTextTagsCounter + 1 - call SaveTextTagHandle(TextTagUtils___h, handleId, 0, t) + if ( not HaveSavedHandle(TextTagUtils__h, handleId, 0) ) then + set TextTagUtils__allTextTags[TextTagUtils__allTextTagsCounter]=t + set TextTagUtils__allTextTagsCounter=TextTagUtils__allTextTagsCounter + 1 + call SaveTextTagHandle(TextTagUtils__h, handleId, 0, t) endif endfunction @@ -24195,58 +24165,58 @@ function AddLastCreatedTextTag takes nothing returns nothing call AddTextTag(GetLastCreatedTextTag()) endfunction -function TextTagUtils___SetTextTagTextHook takes texttag t,string s,real height returns nothing +function TextTagUtils__SetTextTagTextHook takes texttag t,string s,real height returns nothing call AddTextTag(t) endfunction -function TextTagUtils___RemoveTextTagFromAll takes texttag t returns nothing +function TextTagUtils__RemoveTextTagFromAll takes texttag t returns nothing local boolean found= false local integer i= 0 loop - exitwhen ( i >= TextTagUtils___allTextTagsCounter ) + exitwhen ( i >= TextTagUtils__allTextTagsCounter ) if ( found ) then - set TextTagUtils___allTextTags[i - 1]=TextTagUtils___allTextTags[i] - elseif ( TextTagUtils___allTextTags[i] == t ) then + set TextTagUtils__allTextTags[i - 1]=TextTagUtils__allTextTags[i] + elseif ( TextTagUtils__allTextTags[i] == t ) then set found=true endif set i=i + 1 endloop endfunction -function TextTagUtils___DestroyTextTagHook takes texttag t returns nothing +function TextTagUtils__DestroyTextTagHook takes texttag t returns nothing local integer handleId= GetHandleId(t) - if ( HaveSavedHandle(TextTagUtils___h, handleId, 0) ) then - call TextTagUtils___RemoveTextTagFromAll(t) - call FlushChildHashtable(TextTagUtils___h, handleId) + if ( HaveSavedHandle(TextTagUtils__h, handleId, 0) ) then + call TextTagUtils__RemoveTextTagFromAll(t) + call FlushChildHashtable(TextTagUtils__h, handleId) endif endfunction -function TextTagUtils___SetTextTagPermanentHook takes texttag t,boolean permanent returns nothing +function TextTagUtils__SetTextTagPermanentHook takes texttag t,boolean permanent returns nothing local integer handleId= GetHandleId(t) - if ( not permanent and HaveSavedHandle(TextTagUtils___h, handleId, 0) ) then - call TextTagUtils___RemoveTextTagFromAll(t) - call FlushChildHashtable(TextTagUtils___h, handleId) + if ( not permanent and HaveSavedHandle(TextTagUtils__h, handleId, 0) ) then + call TextTagUtils__RemoveTextTagFromAll(t) + call FlushChildHashtable(TextTagUtils__h, handleId) endif endfunction function GetEnumTextTag takes nothing returns texttag - return TextTagUtils___enumTextTag + return TextTagUtils__enumTextTag endfunction function ForAllTextTags takes code f returns nothing local integer i= 0 loop - exitwhen ( i >= TextTagUtils___allTextTagsCounter ) - set TextTagUtils___enumTextTag=TextTagUtils___allTextTags[i] + exitwhen ( i >= TextTagUtils__allTextTagsCounter ) + set TextTagUtils__enumTextTag=TextTagUtils__allTextTags[i] call ForForce(bj_FORCE_PLAYER[0], (f)) // INLINED!! set i=i + 1 endloop endfunction -//processed hook: hook SetTextTagText TextTagUtils___SetTextTagTextHook -//processed hook: hook DestroyTextTag TextTagUtils___DestroyTextTagHook -//processed hook: hook SetTextTagPermanent TextTagUtils___SetTextTagPermanentHook -//processed hook: hook SetTextTagPermanentBJ TextTagUtils___SetTextTagPermanentHook +//processed hook: hook SetTextTagText TextTagUtils__SetTextTagTextHook +//processed hook: hook DestroyTextTag TextTagUtils__DestroyTextTagHook +//processed hook: hook SetTextTagPermanent TextTagUtils__SetTextTagPermanentHook +//processed hook: hook SetTextTagPermanentBJ TextTagUtils__SetTextTagPermanentHook //library TextTagUtils ends @@ -24579,147 +24549,147 @@ endfunction -function UnitTypeUtils___Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer +function UnitTypeUtils__Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer return ( ( Value1 * MaxValue2 ) + Value2 ) endfunction -function UnitTypeUtils___InvalidateCache takes nothing returns nothing - call FlushParentHashtable(UnitTypeUtils___cache) +function UnitTypeUtils__InvalidateCache takes nothing returns nothing + call FlushParentHashtable(UnitTypeUtils__cache) endfunction -function UnitTypeUtils___GetParentKey takes player whichPlayer,integer k returns integer - return UnitTypeUtils___Index2D(GetPlayerId(whichPlayer) , k , UnitTypeUtils___MAX_KEYS) +function UnitTypeUtils__GetParentKey takes player whichPlayer,integer k returns integer + return UnitTypeUtils__Index2D(GetPlayerId(whichPlayer) , k , UnitTypeUtils__MAX_KEYS) endfunction -function UnitTypeUtils___InvalidatePlayerCache takes player whichPlayer returns nothing +function UnitTypeUtils__InvalidatePlayerCache takes player whichPlayer returns nothing local integer i= 0 loop - exitwhen ( i == UnitTypeUtils___MAX_KEYS ) - call FlushChildHashtable(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((whichPlayer )) , ( i) , UnitTypeUtils___MAX_KEYS))) // INLINED!! + exitwhen ( i == UnitTypeUtils__MAX_KEYS ) + call FlushChildHashtable(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((whichPlayer )) , ( i) , UnitTypeUtils__MAX_KEYS))) // INLINED!! set i=i + 1 endloop endfunction -function UnitTypeUtils___HookSetPlayerTechResearched takes player whichPlayer,integer techid,integer setToLevel returns nothing - call UnitTypeUtils___InvalidatePlayerCache(whichPlayer) +function UnitTypeUtils__HookSetPlayerTechResearched takes player whichPlayer,integer techid,integer setToLevel returns nothing + call UnitTypeUtils__InvalidatePlayerCache(whichPlayer) endfunction -function UnitTypeUtils___HookAddPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing - call UnitTypeUtils___InvalidatePlayerCache(whichPlayer) +function UnitTypeUtils__HookAddPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing + call UnitTypeUtils__InvalidatePlayerCache(whichPlayer) endfunction -function UnitTypeUtils___HookBlzDecPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing - call UnitTypeUtils___InvalidatePlayerCache(whichPlayer) +function UnitTypeUtils__HookBlzDecPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing + call UnitTypeUtils__InvalidatePlayerCache(whichPlayer) endfunction -function UnitTypeUtils___HookFunctionSetPlayerTechResearched takes integer techid,integer levels,player whichPlayer returns nothing - call UnitTypeUtils___InvalidatePlayerCache(whichPlayer) +function UnitTypeUtils__HookFunctionSetPlayerTechResearched takes integer techid,integer levels,player whichPlayer returns nothing + call UnitTypeUtils__InvalidatePlayerCache(whichPlayer) endfunction -//processed hook: hook SetPlayerTechResearched UnitTypeUtils___HookSetPlayerTechResearched -//processed hook: hook AddPlayerTechResearched UnitTypeUtils___HookAddPlayerTechResearched -//processed hook: hook BlzDecPlayerTechResearched UnitTypeUtils___HookBlzDecPlayerTechResearched +//processed hook: hook SetPlayerTechResearched UnitTypeUtils__HookSetPlayerTechResearched +//processed hook: hook AddPlayerTechResearched UnitTypeUtils__HookAddPlayerTechResearched +//processed hook: hook BlzDecPlayerTechResearched UnitTypeUtils__HookBlzDecPlayerTechResearched -function UnitTypeUtils___TriggerConditionResearchFinish takes nothing returns boolean - call UnitTypeUtils___InvalidatePlayerCache(GetOwningPlayer(GetTriggerUnit())) +function UnitTypeUtils__TriggerConditionResearchFinish takes nothing returns boolean + call UnitTypeUtils__InvalidatePlayerCache(GetOwningPlayer(GetTriggerUnit())) return false endfunction -function UnitTypeUtils___TriggerConditionChangeOwner takes nothing returns boolean - call UnitTypeUtils___InvalidatePlayerCache(GetOwningPlayer(GetChangingUnit())) +function UnitTypeUtils__TriggerConditionChangeOwner takes nothing returns boolean + call UnitTypeUtils__InvalidatePlayerCache(GetOwningPlayer(GetChangingUnit())) return false endfunction -function UnitTypeUtils___Init takes nothing returns nothing +function UnitTypeUtils__Init takes nothing returns nothing //set OWNER = Player(PLAYER_NEUTRAL_AGGRESSIVE) - set UnitTypeUtils___X=GetRectCenterX(gg_rct_Evolution_Dummy_Area) - set UnitTypeUtils___Y=GetRectCenterY(gg_rct_Evolution_Dummy_Area) - call TriggerRegisterAnyUnitEventBJ(UnitTypeUtils___researchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) - call TriggerAddCondition(UnitTypeUtils___researchTrigger, Condition(function UnitTypeUtils___TriggerConditionResearchFinish)) - call TriggerRegisterAnyUnitEventBJ(UnitTypeUtils___changeOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) - call TriggerAddCondition(UnitTypeUtils___changeOwnerTrigger, Condition(function UnitTypeUtils___TriggerConditionChangeOwner)) + set UnitTypeUtils__X=GetRectCenterX(gg_rct_Evolution_Dummy_Area) + set UnitTypeUtils__Y=GetRectCenterY(gg_rct_Evolution_Dummy_Area) + call TriggerRegisterAnyUnitEventBJ(UnitTypeUtils__researchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) + call TriggerAddCondition(UnitTypeUtils__researchTrigger, Condition(function UnitTypeUtils__TriggerConditionResearchFinish)) + call TriggerRegisterAnyUnitEventBJ(UnitTypeUtils__changeOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) + call TriggerAddCondition(UnitTypeUtils__changeOwnerTrigger, Condition(function UnitTypeUtils__TriggerConditionChangeOwner)) endfunction -function UnitTypeUtils___CreateDummy takes integer unitTypeId,player owner returns unit - return CreateUnit(owner, unitTypeId, UnitTypeUtils___X, UnitTypeUtils___Y, 0.0) +function UnitTypeUtils__CreateDummy takes integer unitTypeId,player owner returns unit + return CreateUnit(owner, unitTypeId, UnitTypeUtils__X, UnitTypeUtils__Y, 0.0) endfunction function GetUnitLevelByTypeFresh takes integer unitTypeId,player owner returns integer - local unit dummy= UnitTypeUtils___CreateDummy(unitTypeId , owner) + local unit dummy= UnitTypeUtils__CreateDummy(unitTypeId , owner) local integer result= BlzGetUnitIntegerField(dummy, UNIT_IF_LEVEL) - call SaveInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_LEVEL) , UnitTypeUtils___MAX_KEYS)), unitTypeId, result) // INLINED!! + call SaveInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_LEVEL) , UnitTypeUtils__MAX_KEYS)), unitTypeId, result) // INLINED!! call h__RemoveUnit(dummy) set dummy=null return result endfunction function GetUnitLevelByType takes integer unitTypeId,player owner returns integer - if ( HaveSavedInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_LEVEL) , UnitTypeUtils___MAX_KEYS)), unitTypeId) ) then // INLINED!! - return LoadInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_LEVEL) , UnitTypeUtils___MAX_KEYS)), unitTypeId) // INLINED!! + if ( HaveSavedInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_LEVEL) , UnitTypeUtils__MAX_KEYS)), unitTypeId) ) then // INLINED!! + return LoadInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_LEVEL) , UnitTypeUtils__MAX_KEYS)), unitTypeId) // INLINED!! endif return GetUnitLevelByTypeFresh(unitTypeId , owner) endfunction function GetUnitDefenseByTypeFresh takes integer unitTypeId,player owner returns real - local unit dummy= UnitTypeUtils___CreateDummy(unitTypeId , owner) + local unit dummy= UnitTypeUtils__CreateDummy(unitTypeId , owner) local real result= BlzGetUnitRealField(dummy, UNIT_RF_DEFENSE) - call SaveReal(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DEFENSE) , UnitTypeUtils___MAX_KEYS)), unitTypeId, result) // INLINED!! + call SaveReal(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DEFENSE) , UnitTypeUtils__MAX_KEYS)), unitTypeId, result) // INLINED!! call h__RemoveUnit(dummy) set dummy=null return result endfunction function GetUnitDefenseByType takes integer unitTypeId,player owner returns real - if ( HaveSavedReal(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DEFENSE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) ) then // INLINED!! - return LoadReal(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DEFENSE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) // INLINED!! + if ( HaveSavedReal(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DEFENSE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) ) then // INLINED!! + return LoadReal(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DEFENSE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) // INLINED!! endif return GetUnitDefenseByTypeFresh(unitTypeId , owner) endfunction function GetUnitDamageTypeByTypeFresh takes integer unitTypeId,player owner returns integer - local unit dummy= UnitTypeUtils___CreateDummy(unitTypeId , owner) + local unit dummy= UnitTypeUtils__CreateDummy(unitTypeId , owner) local integer result= BlzGetUnitWeaponIntegerField(dummy, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0) - call SaveInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DAMAGE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId, result) // INLINED!! + call SaveInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DAMAGE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId, result) // INLINED!! call h__RemoveUnit(dummy) set dummy=null return result endfunction function GetUnitDamageTypeByType takes integer unitTypeId,player owner returns integer - if ( HaveSavedInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DAMAGE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) ) then // INLINED!! - return LoadInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DAMAGE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) // INLINED!! + if ( HaveSavedInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DAMAGE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) ) then // INLINED!! + return LoadInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DAMAGE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) // INLINED!! endif return GetUnitDamageTypeByTypeFresh(unitTypeId , owner) endfunction function GetUnitDefenseTypeByTypeFresh takes integer unitTypeId,player owner returns integer - local unit dummy= UnitTypeUtils___CreateDummy(unitTypeId , owner) + local unit dummy= UnitTypeUtils__CreateDummy(unitTypeId , owner) local integer result= BlzGetUnitIntegerField(dummy, UNIT_IF_DEFENSE_TYPE) - call SaveInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DEFENSE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId, result) // INLINED!! + call SaveInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DEFENSE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId, result) // INLINED!! call h__RemoveUnit(dummy) set dummy=null return result endfunction function GetUnitDefenseTypeByType takes integer unitTypeId,player owner returns integer - if ( HaveSavedInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DEFENSE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) ) then // INLINED!! - return LoadInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_DEFENSE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) // INLINED!! + if ( HaveSavedInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DEFENSE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) ) then // INLINED!! + return LoadInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_DEFENSE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) // INLINED!! endif return GetUnitDefenseTypeByTypeFresh(unitTypeId , owner) endfunction function GetUnitMovementTypeByTypeFresh takes integer unitTypeId,player owner returns integer - local unit dummy= UnitTypeUtils___CreateDummy(unitTypeId , owner) + local unit dummy= UnitTypeUtils__CreateDummy(unitTypeId , owner) local integer result= BlzGetUnitIntegerField(dummy, UNIT_IF_MOVE_TYPE) - call SaveInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_MOVE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId, result) // INLINED!! + call SaveInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_MOVE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId, result) // INLINED!! call h__RemoveUnit(dummy) set dummy=null return result endfunction function GetUnitMovementTypeByType takes integer unitTypeId,player owner returns integer - if ( HaveSavedInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_MOVE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) ) then // INLINED!! - return LoadInteger(UnitTypeUtils___cache, (UnitTypeUtils___Index2D(GetPlayerId((owner )) , ( UnitTypeUtils___KEY_MOVE_TYPE) , UnitTypeUtils___MAX_KEYS)), unitTypeId) // INLINED!! + if ( HaveSavedInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_MOVE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) ) then // INLINED!! + return LoadInteger(UnitTypeUtils__cache, (UnitTypeUtils__Index2D(GetPlayerId((owner )) , ( UnitTypeUtils__KEY_MOVE_TYPE) , UnitTypeUtils__MAX_KEYS)), unitTypeId) // INLINED!! endif return GetUnitMovementTypeByTypeFresh(unitTypeId , owner) endfunction @@ -25354,11 +25324,11 @@ endfunction function GetMusicFromRecordPlayer takes unit recordPlayer returns sound - return LoadSoundHandle(WoWErforgedRecordPlayer__h, GetHandleId(recordPlayer), 0) + return LoadSoundHandle(WoWErforgedRecordPlayer___h, GetHandleId(recordPlayer), 0) endfunction function StopMusicFromRecordPlayer takes unit recordPlayer returns nothing - local sound s= (LoadSoundHandle(WoWErforgedRecordPlayer__h, GetHandleId((recordPlayer)), 0)) // INLINED!! + local sound s= (LoadSoundHandle(WoWErforgedRecordPlayer___h, GetHandleId((recordPlayer)), 0)) // INLINED!! if ( s != null ) then call StopSound(s, false, false) endif @@ -25366,13 +25336,13 @@ endfunction function PlayMusicFromRecordPlayer takes unit recordPlayer,sound s returns nothing call StopMusicFromRecordPlayer(recordPlayer) - call SaveSoundHandle(WoWErforgedRecordPlayer__h, GetHandleId(recordPlayer), 0, s) + call SaveSoundHandle(WoWErforgedRecordPlayer___h, GetHandleId(recordPlayer), 0, s) call PlaySoundOnUnitBJ(s, 100.0, recordPlayer) endfunction function FlushRecordPlayer takes unit recordPlayer returns nothing call StopMusicFromRecordPlayer(recordPlayer) - call FlushChildHashtable(WoWErforgedRecordPlayer__h, GetHandleId(recordPlayer)) + call FlushChildHashtable(WoWErforgedRecordPlayer___h, GetHandleId(recordPlayer)) endfunction @@ -25493,7 +25463,7 @@ endfunction //library WoWReforgedBarrage: -function WoWReforgedBarrage__TriggerConditionHeroSkill takes nothing returns boolean +function WoWReforgedBarrage___TriggerConditionHeroSkill takes nothing returns boolean if ( GetLearnedSkill() == 'A1OQ' or GetLearnedSkill() == 'A0J9' or GetLearnedSkill() == 'A24L' ) then call BlzSetAbilityStringLevelField(BlzGetUnitAbility(GetTriggerUnit(), GetLearnedSkill()), ABILITY_SLF_MISSILE_ART, 0, BlzGetUnitWeaponStringField(GetTriggerUnit(), UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, 0)) //call BJDebugMsg("Change missile for Barrage to: " + BlzGetUnitWeaponStringField(GetTriggerUnit(), UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, 0)) @@ -25501,9 +25471,9 @@ function WoWReforgedBarrage__TriggerConditionHeroSkill takes nothing returns boo return false endfunction -function WoWReforgedBarrage__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBarrage__learnTrigger, EVENT_PLAYER_HERO_SKILL) - call TriggerAddCondition(WoWReforgedBarrage__learnTrigger, Condition(function WoWReforgedBarrage__TriggerConditionHeroSkill)) +function WoWReforgedBarrage___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBarrage___learnTrigger, EVENT_PLAYER_HERO_SKILL) + call TriggerAddCondition(WoWReforgedBarrage___learnTrigger, Condition(function WoWReforgedBarrage___TriggerConditionHeroSkill)) endfunction @@ -25511,7 +25481,7 @@ endfunction //library WoWReforgedCages: -function WoWReforgedCages__SpawnRandomCreep takes unit cage,unit killer returns unit +function WoWReforgedCages___SpawnRandomCreep takes unit cage,unit killer returns unit local player owner= GetOwningPlayer(killer) local unit creep= null if ( killer == null ) then @@ -25523,16 +25493,16 @@ function WoWReforgedCages__SpawnRandomCreep takes unit cage,unit killer returns return creep endfunction -function WoWReforgedCages__TriggerConditionDeath takes nothing returns boolean +function WoWReforgedCages___TriggerConditionDeath takes nothing returns boolean if ( GetUnitTypeId(GetTriggerUnit()) == CAGE ) then - call WoWReforgedCages__SpawnRandomCreep(GetTriggerUnit() , GetKillingUnit()) + call WoWReforgedCages___SpawnRandomCreep(GetTriggerUnit() , GetKillingUnit()) endif return false endfunction -function WoWReforgedCages__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedCages__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedCages__deathTrigger, Condition(function WoWReforgedCages__TriggerConditionDeath)) +function WoWReforgedCages___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedCages___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedCages___deathTrigger, Condition(function WoWReforgedCages___TriggerConditionDeath)) endfunction @@ -25564,31 +25534,31 @@ endfunction //library WoWReforgedCarHorn: -function WoWReforgedCarHorn__PlayCarHornSound takes unit whichUnit returns nothing - local integer r= GetRandomInt(0, WoWReforgedCarHorn__hornSoundCounter - 1) - call PlaySoundOnUnitBJ(WoWReforgedCarHorn__hornSound[r], 100.0, whichUnit) +function WoWReforgedCarHorn___PlayCarHornSound takes unit whichUnit returns nothing + local integer r= GetRandomInt(0, WoWReforgedCarHorn___hornSoundCounter - 1) + call PlaySoundOnUnitBJ(WoWReforgedCarHorn___hornSound[r], 100.0, whichUnit) endfunction -function WoWReforgedCarHorn__AddHornSound takes sound whichSound returns nothing - set WoWReforgedCarHorn__hornSound[WoWReforgedCarHorn__hornSoundCounter]=whichSound - set WoWReforgedCarHorn__hornSoundCounter=WoWReforgedCarHorn__hornSoundCounter + 1 +function WoWReforgedCarHorn___AddHornSound takes sound whichSound returns nothing + set WoWReforgedCarHorn___hornSound[WoWReforgedCarHorn___hornSoundCounter]=whichSound + set WoWReforgedCarHorn___hornSoundCounter=WoWReforgedCarHorn___hornSoundCounter + 1 endfunction -function WoWReforgedCarHorn__TriggerConditionCast takes nothing returns boolean - if ( GetSpellAbilityId() == WoWReforgedCarHorn__ABILITY_ID ) then - call WoWReforgedCarHorn__PlayCarHornSound(GetTriggerUnit()) +function WoWReforgedCarHorn___TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == WoWReforgedCarHorn___ABILITY_ID ) then + call WoWReforgedCarHorn___PlayCarHornSound(GetTriggerUnit()) endif return false endfunction -function WoWReforgedCarHorn__Init takes nothing returns nothing - call WoWReforgedCarHorn__AddHornSound(gg_snd_War3CarHonk02) - call WoWReforgedCarHorn__AddHornSound(gg_snd_War3CarHonk03) - call WoWReforgedCarHorn__AddHornSound(gg_snd_War3CarHonk05) - call WoWReforgedCarHorn__AddHornSound(gg_snd_War3CarHonk08) +function WoWReforgedCarHorn___Init takes nothing returns nothing + call WoWReforgedCarHorn___AddHornSound(gg_snd_War3CarHonk02) + call WoWReforgedCarHorn___AddHornSound(gg_snd_War3CarHonk03) + call WoWReforgedCarHorn___AddHornSound(gg_snd_War3CarHonk05) + call WoWReforgedCarHorn___AddHornSound(gg_snd_War3CarHonk08) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedCarHorn__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(WoWReforgedCarHorn__castTrigger, Condition(function WoWReforgedCarHorn__TriggerConditionCast)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedCarHorn___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(WoWReforgedCarHorn___castTrigger, Condition(function WoWReforgedCarHorn___TriggerConditionCast)) endfunction @@ -25630,27 +25600,27 @@ endfunction //library WoWReforgedDalaranShields: -function WoWReforgedDalaranShields__AddShieldWeatherEffect takes weathereffect w returns integer - local integer index= WoWReforgedDalaranShields__shieldWeatherEffectsCounter - set WoWReforgedDalaranShields__shieldWeatherEffects[index]=w - set WoWReforgedDalaranShields__shieldWeatherEffectsCounter=WoWReforgedDalaranShields__shieldWeatherEffectsCounter + 1 +function WoWReforgedDalaranShields___AddShieldWeatherEffect takes weathereffect w returns integer + local integer index= WoWReforgedDalaranShields___shieldWeatherEffectsCounter + set WoWReforgedDalaranShields___shieldWeatherEffects[index]=w + set WoWReforgedDalaranShields___shieldWeatherEffectsCounter=WoWReforgedDalaranShields___shieldWeatherEffectsCounter + 1 return index endfunction -function WoWReforgedDalaranShields__GetShieldWeatherEffect takes integer index returns weathereffect - return WoWReforgedDalaranShields__shieldWeatherEffects[index] +function WoWReforgedDalaranShields___GetShieldWeatherEffect takes integer index returns weathereffect + return WoWReforgedDalaranShields___shieldWeatherEffects[index] endfunction -function WoWReforgedDalaranShields__FreeShieldWeatherEffect takes integer index returns nothing +function WoWReforgedDalaranShields___FreeShieldWeatherEffect takes integer index returns nothing local integer i= index local integer j= i + 1 loop - exitwhen ( j >= WoWReforgedDalaranShields__shieldWeatherEffectsCounter ) - set WoWReforgedDalaranShields__shieldWeatherEffects[i]=WoWReforgedDalaranShields__shieldWeatherEffects[j] + exitwhen ( j >= WoWReforgedDalaranShields___shieldWeatherEffectsCounter ) + set WoWReforgedDalaranShields___shieldWeatherEffects[i]=WoWReforgedDalaranShields___shieldWeatherEffects[j] set i=i + 1 set j=i + 1 endloop - set WoWReforgedDalaranShields__shieldWeatherEffectsCounter=i + set WoWReforgedDalaranShields___shieldWeatherEffectsCounter=i endfunction function EnableDalaranShield takes unit powerGenerator returns nothing @@ -25659,9 +25629,9 @@ function EnableDalaranShield takes unit powerGenerator returns nothing local rect where= GetRectFromCircleBJ(pos, 500.0) local weathereffect w= AddWeatherEffect(where, 'MEds') call EnableWeatherEffect(w, true) - call GroupAddUnit(WoWReforgedDalaranShields__powerGenerators, powerGenerator) - call SaveRectHandle(WoWReforgedDalaranShields__h, handleId, 0, where) - call SaveInteger(WoWReforgedDalaranShields__h, handleId, 1, WoWReforgedDalaranShields__AddShieldWeatherEffect(w)) + call GroupAddUnit(WoWReforgedDalaranShields___powerGenerators, powerGenerator) + call SaveRectHandle(WoWReforgedDalaranShields___h, handleId, 0, where) + call SaveInteger(WoWReforgedDalaranShields___h, handleId, 1, WoWReforgedDalaranShields___AddShieldWeatherEffect(w)) call RemoveLocation(pos) set pos=null set where=null @@ -25670,22 +25640,22 @@ endfunction function GetDalaranShieldRect takes unit powerGenerator returns rect local integer handleId= GetHandleId(powerGenerator) - return LoadRectHandle(WoWReforgedDalaranShields__h, handleId, 0) + return LoadRectHandle(WoWReforgedDalaranShields___h, handleId, 0) endfunction function DisableDalaranShield takes unit powerGenerator returns nothing local integer handleId= GetHandleId(powerGenerator) - local integer weatherEffectIndex= LoadInteger(WoWReforgedDalaranShields__h, handleId, 1) + local integer weatherEffectIndex= LoadInteger(WoWReforgedDalaranShields___h, handleId, 1) local weathereffect w= null - local rect where= LoadRectHandle(WoWReforgedDalaranShields__h, handleId, 0) + local rect where= LoadRectHandle(WoWReforgedDalaranShields___h, handleId, 0) if ( weatherEffectIndex > 0 ) then - set w=(WoWReforgedDalaranShields__shieldWeatherEffects[(weatherEffectIndex)]) // INLINED!! + set w=(WoWReforgedDalaranShields___shieldWeatherEffects[(weatherEffectIndex)]) // INLINED!! if ( w != null ) then call EnableWeatherEffect(w, false) call RemoveWeatherEffect(w) endif - call WoWReforgedDalaranShields__FreeShieldWeatherEffect(weatherEffectIndex) + call WoWReforgedDalaranShields___FreeShieldWeatherEffect(weatherEffectIndex) set w=null endif @@ -25694,19 +25664,19 @@ function DisableDalaranShield takes unit powerGenerator returns nothing set where=null endif - call GroupRemoveUnit(WoWReforgedDalaranShields__powerGenerators, powerGenerator) + call GroupRemoveUnit(WoWReforgedDalaranShields___powerGenerators, powerGenerator) endfunction function IsDalaranShieldEnabled takes unit powerGenerator returns boolean - return IsUnitInGroup(powerGenerator, WoWReforgedDalaranShields__powerGenerators) + return IsUnitInGroup(powerGenerator, WoWReforgedDalaranShields___powerGenerators) endfunction function DalaranShieldsAreEmpty takes nothing returns boolean - return BlzGroupGetSize(WoWReforgedDalaranShields__powerGenerators) == 0 + return BlzGroupGetSize(WoWReforgedDalaranShields___powerGenerators) == 0 endfunction function GroupAddDalaranShields takes group destGroup returns nothing - call GroupAddGroup(WoWReforgedDalaranShields__powerGenerators, destGroup) + call GroupAddGroup(WoWReforgedDalaranShields___powerGenerators, destGroup) endfunction @@ -25728,14 +25698,14 @@ endfunction endfunction function GetDependencyEquivalents takes integer id returns integer - return LoadInteger(WoWReforgedDependencyEquivalents___h, id, 0) + return LoadInteger(WoWReforgedDependencyEquivalents__h, id, 0) endfunction function AddDependencyEquivalentsSingle takes integer id,integer other,boolean primary returns nothing - local integer d= (LoadInteger(WoWReforgedDependencyEquivalents___h, (id), 0)) // INLINED!! + local integer d= (LoadInteger(WoWReforgedDependencyEquivalents__h, (id), 0)) // INLINED!! if ( d == 0 ) then set d=s__DependencyEquivalents__allocate() - call SaveInteger(WoWReforgedDependencyEquivalents___h, id, 0, d) + call SaveInteger(WoWReforgedDependencyEquivalents__h, id, 0, d) endif set s__DependencyEquivalents_primary[d]=primary set s___DependencyEquivalents_ids[s__DependencyEquivalents_ids[d]+s__DependencyEquivalents_count[d]]=other @@ -25748,7 +25718,7 @@ function AddDependencyEquivalents takes integer id,integer other returns nothing endfunction function IsDependencyEquivalent takes integer id,integer other returns boolean - local integer d= (LoadInteger(WoWReforgedDependencyEquivalents___h, (id), 0)) // INLINED!! + local integer d= (LoadInteger(WoWReforgedDependencyEquivalents__h, (id), 0)) // INLINED!! if ( d != 0 ) then return s__DependencyEquivalents_contains(d,other) endif @@ -25757,12 +25727,12 @@ function IsDependencyEquivalent takes integer id,integer other returns boolean endfunction function GetPrimaryDependencyEquivalent takes integer id returns integer - local integer d= (LoadInteger(WoWReforgedDependencyEquivalents___h, (id), 0)) // INLINED!! + local integer d= (LoadInteger(WoWReforgedDependencyEquivalents__h, (id), 0)) // INLINED!! local integer i= 0 if ( d != 0 and not s__DependencyEquivalents_primary[d] and s__DependencyEquivalents_count[d] > 0 ) then loop exitwhen ( i >= s__DependencyEquivalents_count[d] ) - if ( s__DependencyEquivalents_primary[(LoadInteger(WoWReforgedDependencyEquivalents___h, (s___DependencyEquivalents_ids[s__DependencyEquivalents_ids[d]+i]), 0))] ) then // INLINED!! + if ( s__DependencyEquivalents_primary[(LoadInteger(WoWReforgedDependencyEquivalents__h, (s___DependencyEquivalents_ids[s__DependencyEquivalents_ids[d]+i]), 0))] ) then // INLINED!! return s___DependencyEquivalents_ids[s__DependencyEquivalents_ids[d]+i] endif set i=i + 1 @@ -25772,7 +25742,7 @@ function GetPrimaryDependencyEquivalent takes integer id returns integer return id endfunction -function WoWReforgedDependencyEquivalents___Init takes nothing returns nothing +function WoWReforgedDependencyEquivalents__Init takes nothing returns nothing // Clan call AddDependencyEquivalents(CLAN_HALL , CLAN_HALL_KING_CASTLE) call AddDependencyEquivalents(CLAN_HALL , CLAN_HALL_MANSION) @@ -25898,24 +25868,24 @@ endfunction //library WoWReforgedElevator: -function WoWReforgedElevator__GetElevator takes unit building returns destructable - return LoadDestructableHandle(WoWReforgedElevator__h, GetHandleId(building), 0) +function WoWReforgedElevator___GetElevator takes unit building returns destructable + return LoadDestructableHandle(WoWReforgedElevator___h, GetHandleId(building), 0) endfunction -function WoWReforgedElevator__TriggerConditionConstructionFinished takes nothing returns boolean +function WoWReforgedElevator___TriggerConditionConstructionFinished takes nothing returns boolean local unit building= GetConstructedStructure() if ( GetUnitTypeId(building) == ELEVATOR ) then - call SaveDestructableHandle(WoWReforgedElevator__h, GetHandleId(building), 0, CreateDestructable(ELEVATOR_DESTRUCTABLE, GetUnitX(building), GetUnitY(building), 0.0, 1.0, 0)) - call SetDestructableInvulnerable((LoadDestructableHandle(WoWReforgedElevator__h, GetHandleId((building)), 0)), true) // INLINED!! + call SaveDestructableHandle(WoWReforgedElevator___h, GetHandleId(building), 0, CreateDestructable(ELEVATOR_DESTRUCTABLE, GetUnitX(building), GetUnitY(building), 0.0, 1.0, 0)) + call SetDestructableInvulnerable((LoadDestructableHandle(WoWReforgedElevator___h, GetHandleId((building)), 0)), true) // INLINED!! endif set building=null return false endfunction -function WoWReforgedElevator__TriggerConditionSell takes nothing returns boolean +function WoWReforgedElevator___TriggerConditionSell takes nothing returns boolean local unit shop= GetSellingUnit() local player owner= GetOwningPlayer(shop) - local destructable elevator= (LoadDestructableHandle(WoWReforgedElevator__h, GetHandleId((shop)), 0)) // INLINED!! + local destructable elevator= (LoadDestructableHandle(WoWReforgedElevator___h, GetHandleId((shop)), 0)) // INLINED!! local unit action= GetSoldUnit() local integer actionType= GetUnitTypeId(action) if ( GetUnitTypeId(shop) == ELEVATOR ) then @@ -25942,27 +25912,27 @@ function WoWReforgedElevator__TriggerConditionSell takes nothing returns boolean return false endfunction -function WoWReforgedElevator__TriggerConditionDeath takes nothing returns boolean +function WoWReforgedElevator___TriggerConditionDeath takes nothing returns boolean local unit dyingUnit= GetDyingUnit() - local destructable elevator= (LoadDestructableHandle(WoWReforgedElevator__h, GetHandleId((dyingUnit)), 0)) // INLINED!! + local destructable elevator= (LoadDestructableHandle(WoWReforgedElevator___h, GetHandleId((dyingUnit)), 0)) // INLINED!! if ( GetUnitTypeId(dyingUnit) == ELEVATOR ) then call RemoveDestructable(elevator) - call FlushChildHashtable(WoWReforgedElevator__h, GetHandleId(dyingUnit)) + call FlushChildHashtable(WoWReforgedElevator___h, GetHandleId(dyingUnit)) endif set dyingUnit=null set elevator=null return false endfunction -function WoWReforgedElevator__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedElevator__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedElevator__constructionTrigger, Condition(function WoWReforgedElevator__TriggerConditionConstructionFinished)) +function WoWReforgedElevator___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedElevator___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedElevator___constructionTrigger, Condition(function WoWReforgedElevator___TriggerConditionConstructionFinished)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedElevator__sellTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(WoWReforgedElevator__sellTrigger, Condition(function WoWReforgedElevator__TriggerConditionSell)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedElevator___sellTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(WoWReforgedElevator___sellTrigger, Condition(function WoWReforgedElevator___TriggerConditionSell)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedElevator__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedElevator__deathTrigger, Condition(function WoWReforgedElevator__TriggerConditionDeath)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedElevator___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedElevator___deathTrigger, Condition(function WoWReforgedElevator___TriggerConditionDeath)) endfunction @@ -25970,15 +25940,15 @@ endfunction //library WoWReforgedFarmer: -function WoWReforgedFarmer__FilterIsWaterSupply takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == WATER_SUPPLY and GetOwningPlayer(GetFilterUnit()) == WoWReforgedFarmer__owner +function WoWReforgedFarmer___FilterIsWaterSupply takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == WATER_SUPPLY and GetOwningPlayer(GetFilterUnit()) == WoWReforgedFarmer___owner endfunction function ApplySeedChargesToLastCreatedItem takes nothing returns nothing local group g= CreateGroup() local item i= GetLastCreatedItem() - set WoWReforgedFarmer__owner=GetOwningPlayer(GetTriggerUnit()) - call GroupEnumUnitsInRange(g, GetItemX(i), GetItemY(i), 400.0, WoWReforgedFarmer__f) + set WoWReforgedFarmer___owner=GetOwningPlayer(GetTriggerUnit()) + call GroupEnumUnitsInRange(g, GetItemX(i), GetItemY(i), 400.0, WoWReforgedFarmer___f) call SetItemCharges(i, 1 + BlzGroupGetSize(g)) call GroupClear(g) call DestroyGroup(g) @@ -25986,8 +25956,8 @@ function ApplySeedChargesToLastCreatedItem takes nothing returns nothing set i=null endfunction -function WoWReforgedFarmer__Init takes nothing returns nothing - set WoWReforgedFarmer__f=Filter(function WoWReforgedFarmer__FilterIsWaterSupply) +function WoWReforgedFarmer___Init takes nothing returns nothing + set WoWReforgedFarmer___f=Filter(function WoWReforgedFarmer___FilterIsWaterSupply) endfunction @@ -25995,20 +25965,20 @@ endfunction //library WoWReforgedFelOrcDemonGate: -function WoWReforgedFelOrcDemonGate__TriggerConditionConstructed takes nothing returns boolean +function WoWReforgedFelOrcDemonGate___TriggerConditionConstructed takes nothing returns boolean if ( GetUnitTypeId(GetConstructedStructure()) == WoWReforgedFelOrcDemonGate_UNIT_TYPE_ID ) then - call GroupAddUnit(WoWReforgedFelOrcDemonGate__gates, GetConstructedStructure()) + call GroupAddUnit(WoWReforgedFelOrcDemonGate___gates, GetConstructedStructure()) endif return false endfunction -function WoWReforgedFelOrcDemonGate__UpdateDemonGates takes player whichPlayer,integer count returns nothing +function WoWReforgedFelOrcDemonGate___UpdateDemonGates takes player whichPlayer,integer count returns nothing local integer i= 0 - local integer max= BlzGroupGetSize(WoWReforgedFelOrcDemonGate__gates) + local integer max= BlzGroupGetSize(WoWReforgedFelOrcDemonGate___gates) local unit u= null loop exitwhen ( i == max ) - set u=BlzGroupUnitAt(WoWReforgedFelOrcDemonGate__gates, i) + set u=BlzGroupUnitAt(WoWReforgedFelOrcDemonGate___gates, i) if ( GetOwningPlayer(u) == whichPlayer ) then call BlzSetUnitName(u, GetObjectName(GetUnitTypeId(u)) + " (" + I2S(count) + ")") endif @@ -26017,13 +25987,13 @@ function WoWReforgedFelOrcDemonGate__UpdateDemonGates takes player whichPlayer,i endloop endfunction -function WoWReforgedFelOrcDemonGate__IncreaseDemonGates takes player whichPlayer,integer count returns nothing +function WoWReforgedFelOrcDemonGate___IncreaseDemonGates takes player whichPlayer,integer count returns nothing local integer i= 0 - local integer max= BlzGroupGetSize(WoWReforgedFelOrcDemonGate__gates) + local integer max= BlzGroupGetSize(WoWReforgedFelOrcDemonGate___gates) local unit u= null loop exitwhen ( i == max ) - set u=BlzGroupUnitAt(WoWReforgedFelOrcDemonGate__gates, i) + set u=BlzGroupUnitAt(WoWReforgedFelOrcDemonGate___gates, i) if ( GetOwningPlayer(u) == whichPlayer ) then call AddUnitToStock(u, WoWReforgedFelOrcDemonGate_FEL_STALKER, count, count) call AddUnitToStock(u, WoWReforgedFelOrcDemonGate_INFERNAL, count, count) @@ -26034,45 +26004,45 @@ function WoWReforgedFelOrcDemonGate__IncreaseDemonGates takes player whichPlayer endloop endfunction -function WoWReforgedFelOrcDemonGate__TriggerConditionDeath takes nothing returns boolean +function WoWReforgedFelOrcDemonGate___TriggerConditionDeath takes nothing returns boolean local integer count= 0 - if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedFelOrcDemonGate__gates) ) then - call GroupRemoveUnit(WoWReforgedFelOrcDemonGate__gates, GetTriggerUnit()) + if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedFelOrcDemonGate___gates) ) then + call GroupRemoveUnit(WoWReforgedFelOrcDemonGate___gates, GetTriggerUnit()) endif if ( GetUnitFoodUsed(GetTriggerUnit()) > 0 and GetKillingUnit() != null and GetOwningPlayer(GetKillingUnit()) != GetOwningPlayer(GetTriggerUnit()) and not IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(GetKillingUnit())) ) then - set WoWReforgedFelOrcDemonGate__playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=WoWReforgedFelOrcDemonGate__playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] + GetUnitFoodUsed(GetTriggerUnit()) - set count=WoWReforgedFelOrcDemonGate__playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] / ( 30 - GetPlayerTechCountSimple(WoWReforgedFelOrcDemonGate_RESEARCH_ID, GetOwningPlayer(GetKillingUnit())) * 5 ) - call WoWReforgedFelOrcDemonGate__UpdateDemonGates(GetOwningPlayer(GetKillingUnit()) , count) + set WoWReforgedFelOrcDemonGate___playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=WoWReforgedFelOrcDemonGate___playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] + GetUnitFoodUsed(GetTriggerUnit()) + set count=WoWReforgedFelOrcDemonGate___playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] / ( 30 - GetPlayerTechCountSimple(WoWReforgedFelOrcDemonGate_RESEARCH_ID, GetOwningPlayer(GetKillingUnit())) * 5 ) + call WoWReforgedFelOrcDemonGate___UpdateDemonGates(GetOwningPlayer(GetKillingUnit()) , count) if ( count > 0 ) then - call WoWReforgedFelOrcDemonGate__IncreaseDemonGates(GetOwningPlayer(GetKillingUnit()) , count) - set WoWReforgedFelOrcDemonGate__playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=ModuloInteger(WoWReforgedFelOrcDemonGate__playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))], 30) + call WoWReforgedFelOrcDemonGate___IncreaseDemonGates(GetOwningPlayer(GetKillingUnit()) , count) + set WoWReforgedFelOrcDemonGate___playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=ModuloInteger(WoWReforgedFelOrcDemonGate___playerKillsCounter[GetPlayerId(GetOwningPlayer(GetKillingUnit()))], 30) endif endif return false endfunction -function WoWReforgedFelOrcDemonGate__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedFelOrcDemonGate__constructedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedFelOrcDemonGate__constructedTrigger, Condition(function WoWReforgedFelOrcDemonGate__TriggerConditionConstructed)) +function WoWReforgedFelOrcDemonGate___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedFelOrcDemonGate___constructedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedFelOrcDemonGate___constructedTrigger, Condition(function WoWReforgedFelOrcDemonGate___TriggerConditionConstructed)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedFelOrcDemonGate__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedFelOrcDemonGate__deathTrigger, Condition(function WoWReforgedFelOrcDemonGate__TriggerConditionDeath)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedFelOrcDemonGate___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedFelOrcDemonGate___deathTrigger, Condition(function WoWReforgedFelOrcDemonGate___TriggerConditionDeath)) endfunction -function WoWReforgedFelOrcDemonGate__RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, WoWReforgedFelOrcDemonGate__gates) ) then - call GroupRemoveUnit(WoWReforgedFelOrcDemonGate__gates, whichUnit) +function WoWReforgedFelOrcDemonGate___RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, WoWReforgedFelOrcDemonGate___gates) ) then + call GroupRemoveUnit(WoWReforgedFelOrcDemonGate___gates, whichUnit) endif endfunction -//processed hook: hook RemoveUnit WoWReforgedFelOrcDemonGate__RemoveUnitHook +//processed hook: hook RemoveUnit WoWReforgedFelOrcDemonGate___RemoveUnitHook //library WoWReforgedFelOrcDemonGate ends //library WoWReforgedFlamethrower: -function WoWReforgedFlamethrower__RemoveFlamethrowerCharge takes unit caster returns boolean +function WoWReforgedFlamethrower___RemoveFlamethrowerCharge takes unit caster returns boolean local item slotItem= null local integer i= 0 loop @@ -26092,7 +26062,7 @@ function WoWReforgedFlamethrower__RemoveFlamethrowerCharge takes unit caster ret return false endfunction -function WoWReforgedFlamethrower__RemoveFlamethrowerMana takes unit caster returns boolean +function WoWReforgedFlamethrower___RemoveFlamethrowerMana takes unit caster returns boolean local real currentMana= GetUnitState(caster, UNIT_STATE_MANA) if ( currentMana > WoWReforgedFlamethrower_HERO_MANA_COST ) then call SetUnitState(caster, UNIT_STATE_MANA, currentMana - WoWReforgedFlamethrower_HERO_MANA_COST) @@ -26101,56 +26071,56 @@ function WoWReforgedFlamethrower__RemoveFlamethrowerMana takes unit caster retur return false endfunction -function WoWReforgedFlamethrower__PolarProjectionX takes real x,real angle,real distance returns real +function WoWReforgedFlamethrower___PolarProjectionX takes real x,real angle,real distance returns real return x + distance * Cos(angle * bj_DEGTORAD) endfunction -function WoWReforgedFlamethrower__PolarProjectionY takes real y,real angle,real distance returns real +function WoWReforgedFlamethrower___PolarProjectionY takes real y,real angle,real distance returns real return y + distance * Sin(angle * bj_DEGTORAD) endfunction -function WoWReforgedFlamethrower__HasNoCasters takes nothing returns boolean - return BlzGroupGetSize(WoWReforgedFlamethrower__casters) == 0 and BlzGroupGetSize(WoWReforgedFlamethrower__heroCasters) == 0 +function WoWReforgedFlamethrower___HasNoCasters takes nothing returns boolean + return BlzGroupGetSize(WoWReforgedFlamethrower___casters) == 0 and BlzGroupGetSize(WoWReforgedFlamethrower___heroCasters) == 0 endfunction -function WoWReforgedFlamethrower__RemoveEffects takes nothing returns nothing +function WoWReforgedFlamethrower___RemoveEffects takes nothing returns nothing local integer i= 0 loop - exitwhen ( i == WoWReforgedFlamethrower__effectsCounter ) - call DestroyEffect(WoWReforgedFlamethrower__effects[i]) - set WoWReforgedFlamethrower__effects[i]=null + exitwhen ( i == WoWReforgedFlamethrower___effectsCounter ) + call DestroyEffect(WoWReforgedFlamethrower___effects[i]) + set WoWReforgedFlamethrower___effects[i]=null set i=i + 1 endloop - set WoWReforgedFlamethrower__effectsCounter=0 + set WoWReforgedFlamethrower___effectsCounter=0 endfunction -function WoWReforgedFlamethrower__CheckToStopTimer takes nothing returns nothing - if ( (BlzGroupGetSize(WoWReforgedFlamethrower__casters) == 0 and BlzGroupGetSize(WoWReforgedFlamethrower__heroCasters) == 0) ) then // INLINED!! - call PauseTimer(WoWReforgedFlamethrower__t) - set WoWReforgedFlamethrower__timerOff=true - call WoWReforgedFlamethrower__RemoveEffects() +function WoWReforgedFlamethrower___CheckToStopTimer takes nothing returns nothing + if ( (BlzGroupGetSize(WoWReforgedFlamethrower___casters) == 0 and BlzGroupGetSize(WoWReforgedFlamethrower___heroCasters) == 0) ) then // INLINED!! + call PauseTimer(WoWReforgedFlamethrower___t) + set WoWReforgedFlamethrower___timerOff=true + call WoWReforgedFlamethrower___RemoveEffects() endif endfunction -function WoWReforgedFlamethrower__TimerFunctionFire takes nothing returns nothing +function WoWReforgedFlamethrower___TimerFunctionFire takes nothing returns nothing local unit caster= null local real face= 0.0 local unit dummy= null - local integer count= BlzGroupGetSize(WoWReforgedFlamethrower__casters) + local integer count= BlzGroupGetSize(WoWReforgedFlamethrower___casters) local group toRemove= CreateGroup() local integer i= 0 - call WoWReforgedFlamethrower__RemoveEffects() + call WoWReforgedFlamethrower___RemoveEffects() loop exitwhen ( i == count ) - set caster=BlzGroupUnitAt(WoWReforgedFlamethrower__casters, i) - if ( WoWReforgedFlamethrower__RemoveFlamethrowerCharge(caster) ) then + set caster=BlzGroupUnitAt(WoWReforgedFlamethrower___casters, i) + if ( WoWReforgedFlamethrower___RemoveFlamethrowerCharge(caster) ) then set face=GetUnitFacing(caster) - set dummy=CreateUnit(GetOwningPlayer(caster), WoWReforgedFlamethrower_DUMMY_UNIT_TYPE_ID, WoWReforgedFlamethrower__PolarProjectionX(GetUnitX(caster) , face , WoWReforgedFlamethrower_DISTANCE), WoWReforgedFlamethrower__PolarProjectionY(GetUnitY(caster) , face , WoWReforgedFlamethrower_DISTANCE), face) + set dummy=CreateUnit(GetOwningPlayer(caster), WoWReforgedFlamethrower_DUMMY_UNIT_TYPE_ID, WoWReforgedFlamethrower___PolarProjectionX(GetUnitX(caster) , face , WoWReforgedFlamethrower_DISTANCE), WoWReforgedFlamethrower___PolarProjectionY(GetUnitY(caster) , face , WoWReforgedFlamethrower_DISTANCE), face) call IssuePointOrder(dummy, "attackground", GetUnitX(dummy), GetUnitY(dummy)) call UnitApplyTimedLife(dummy, 0, WoWReforgedFlamethrower_SUMMON_DURATION) - set WoWReforgedFlamethrower__effects[WoWReforgedFlamethrower__effectsCounter]=AddSpecialEffectTarget(WoWReforgedFlamethrower_EFFECT_PATH, caster, WoWReforgedFlamethrower_EFFECT_ATTACHMENT_POINT) - call BlzSetSpecialEffectScale(WoWReforgedFlamethrower__effects[WoWReforgedFlamethrower__effectsCounter], WoWReforgedFlamethrower_EFFECT_SCALE) - set WoWReforgedFlamethrower__effectsCounter=WoWReforgedFlamethrower__effectsCounter + 1 + set WoWReforgedFlamethrower___effects[WoWReforgedFlamethrower___effectsCounter]=AddSpecialEffectTarget(WoWReforgedFlamethrower_EFFECT_PATH, caster, WoWReforgedFlamethrower_EFFECT_ATTACHMENT_POINT) + call BlzSetSpecialEffectScale(WoWReforgedFlamethrower___effects[WoWReforgedFlamethrower___effectsCounter], WoWReforgedFlamethrower_EFFECT_SCALE) + set WoWReforgedFlamethrower___effectsCounter=WoWReforgedFlamethrower___effectsCounter + 1 set dummy=null //call BJDebugMsg("Flamethrower damage.") else @@ -26159,24 +26129,24 @@ function WoWReforgedFlamethrower__TimerFunctionFire takes nothing returns nothin set caster=null set i=i + 1 endloop - call GroupRemoveGroup(toRemove, WoWReforgedFlamethrower__casters) + call GroupRemoveGroup(toRemove, WoWReforgedFlamethrower___casters) call GroupClear(toRemove) set i=0 - set count=BlzGroupGetSize(WoWReforgedFlamethrower__heroCasters) + set count=BlzGroupGetSize(WoWReforgedFlamethrower___heroCasters) loop exitwhen ( i == count ) - set caster=BlzGroupUnitAt(WoWReforgedFlamethrower__heroCasters, i) - if ( WoWReforgedFlamethrower__RemoveFlamethrowerMana(caster) ) then + set caster=BlzGroupUnitAt(WoWReforgedFlamethrower___heroCasters, i) + if ( WoWReforgedFlamethrower___RemoveFlamethrowerMana(caster) ) then set face=GetUnitFacing(caster) - set dummy=CreateUnit(GetOwningPlayer(caster), WoWReforgedFlamethrower_HERO_DUMMY_UNIT_TYPE_ID, WoWReforgedFlamethrower__PolarProjectionX(GetUnitX(caster) , face , WoWReforgedFlamethrower_DISTANCE), WoWReforgedFlamethrower__PolarProjectionY(GetUnitY(caster) , face , WoWReforgedFlamethrower_DISTANCE), face) + set dummy=CreateUnit(GetOwningPlayer(caster), WoWReforgedFlamethrower_HERO_DUMMY_UNIT_TYPE_ID, WoWReforgedFlamethrower___PolarProjectionX(GetUnitX(caster) , face , WoWReforgedFlamethrower_DISTANCE), WoWReforgedFlamethrower___PolarProjectionY(GetUnitY(caster) , face , WoWReforgedFlamethrower_DISTANCE), face) call SetUnitAbilityLevel(dummy, WoWReforgedFlamethrower_HERO_IMMOLATION_ABILITY_ID, GetUnitAbilityLevel(caster, WoWReforgedFlamethrower_HERO_ABILITY_ID)) call SetUnitAbilityLevel(dummy, WoWReforgedFlamethrower_HERO_BURNING_OIL_ABILITY_ID, GetUnitAbilityLevel(caster, WoWReforgedFlamethrower_HERO_ABILITY_ID)) call IssuePointOrder(dummy, "attackground", GetUnitX(dummy), GetUnitY(dummy)) call UnitApplyTimedLife(dummy, 0, WoWReforgedFlamethrower_SUMMON_DURATION) - set WoWReforgedFlamethrower__effects[WoWReforgedFlamethrower__effectsCounter]=AddSpecialEffectTarget(WoWReforgedFlamethrower_EFFECT_PATH, caster, WoWReforgedFlamethrower_EFFECT_ATTACHMENT_POINT) - call BlzSetSpecialEffectScale(WoWReforgedFlamethrower__effects[WoWReforgedFlamethrower__effectsCounter], WoWReforgedFlamethrower_EFFECT_SCALE) - set WoWReforgedFlamethrower__effectsCounter=WoWReforgedFlamethrower__effectsCounter + 1 + set WoWReforgedFlamethrower___effects[WoWReforgedFlamethrower___effectsCounter]=AddSpecialEffectTarget(WoWReforgedFlamethrower_EFFECT_PATH, caster, WoWReforgedFlamethrower_EFFECT_ATTACHMENT_POINT) + call BlzSetSpecialEffectScale(WoWReforgedFlamethrower___effects[WoWReforgedFlamethrower___effectsCounter], WoWReforgedFlamethrower_EFFECT_SCALE) + set WoWReforgedFlamethrower___effectsCounter=WoWReforgedFlamethrower___effectsCounter + 1 set dummy=null //call BJDebugMsg("Flamethrower damage.") else @@ -26185,9 +26155,9 @@ function WoWReforgedFlamethrower__TimerFunctionFire takes nothing returns nothin set caster=null set i=i + 1 endloop - call GroupRemoveGroup(toRemove, WoWReforgedFlamethrower__heroCasters) + call GroupRemoveGroup(toRemove, WoWReforgedFlamethrower___heroCasters) - call WoWReforgedFlamethrower__CheckToStopTimer() + call WoWReforgedFlamethrower___CheckToStopTimer() call GroupClear(toRemove) call DestroyGroup(toRemove) @@ -26195,51 +26165,51 @@ function WoWReforgedFlamethrower__TimerFunctionFire takes nothing returns nothin endfunction function ToggleFlamethrower takes unit caster returns boolean - if ( IsUnitInGroup(caster, WoWReforgedFlamethrower__casters) ) then + if ( IsUnitInGroup(caster, WoWReforgedFlamethrower___casters) ) then //call BJDebugMsg("Disable flamethrower.") - call GroupRemoveUnit(WoWReforgedFlamethrower__casters, caster) - call WoWReforgedFlamethrower__CheckToStopTimer() + call GroupRemoveUnit(WoWReforgedFlamethrower___casters, caster) + call WoWReforgedFlamethrower___CheckToStopTimer() return false endif - call GroupAddUnit(WoWReforgedFlamethrower__casters, caster) + call GroupAddUnit(WoWReforgedFlamethrower___casters, caster) //call BJDebugMsg("Enable flamethrower.") - if ( WoWReforgedFlamethrower__timerOff ) then - call WoWReforgedFlamethrower__TimerFunctionFire() - call TimerStart(WoWReforgedFlamethrower__t, WoWReforgedFlamethrower_DURATION, true, function WoWReforgedFlamethrower__TimerFunctionFire) - set WoWReforgedFlamethrower__timerOff=false + if ( WoWReforgedFlamethrower___timerOff ) then + call WoWReforgedFlamethrower___TimerFunctionFire() + call TimerStart(WoWReforgedFlamethrower___t, WoWReforgedFlamethrower_DURATION, true, function WoWReforgedFlamethrower___TimerFunctionFire) + set WoWReforgedFlamethrower___timerOff=false endif return true endfunction function ToggleFlamethrowerHero takes unit caster returns boolean - if ( IsUnitInGroup(caster, WoWReforgedFlamethrower__heroCasters) ) then + if ( IsUnitInGroup(caster, WoWReforgedFlamethrower___heroCasters) ) then //call BJDebugMsg("Disable flamethrower.") - call GroupRemoveUnit(WoWReforgedFlamethrower__heroCasters, caster) - call WoWReforgedFlamethrower__CheckToStopTimer() + call GroupRemoveUnit(WoWReforgedFlamethrower___heroCasters, caster) + call WoWReforgedFlamethrower___CheckToStopTimer() return false endif - call GroupAddUnit(WoWReforgedFlamethrower__heroCasters, caster) + call GroupAddUnit(WoWReforgedFlamethrower___heroCasters, caster) //call BJDebugMsg("Enable flamethrower.") - if ( WoWReforgedFlamethrower__timerOff ) then - call WoWReforgedFlamethrower__TimerFunctionFire() - call TimerStart(WoWReforgedFlamethrower__t, WoWReforgedFlamethrower_DURATION, true, function WoWReforgedFlamethrower__TimerFunctionFire) - set WoWReforgedFlamethrower__timerOff=false + if ( WoWReforgedFlamethrower___timerOff ) then + call WoWReforgedFlamethrower___TimerFunctionFire() + call TimerStart(WoWReforgedFlamethrower___t, WoWReforgedFlamethrower_DURATION, true, function WoWReforgedFlamethrower___TimerFunctionFire) + set WoWReforgedFlamethrower___timerOff=false endif return true endfunction -function WoWReforgedFlamethrower__RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, WoWReforgedFlamethrower__casters) ) then +function WoWReforgedFlamethrower___RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, WoWReforgedFlamethrower___casters) ) then call ToggleFlamethrower(whichUnit) endif - if ( IsUnitInGroup(whichUnit, WoWReforgedFlamethrower__heroCasters) ) then + if ( IsUnitInGroup(whichUnit, WoWReforgedFlamethrower___heroCasters) ) then call ToggleFlamethrowerHero(whichUnit) endif endfunction -//processed hook: hook RemoveUnit WoWReforgedFlamethrower__RemoveUnitHook +//processed hook: hook RemoveUnit WoWReforgedFlamethrower___RemoveUnitHook //library WoWReforgedFlamethrower ends @@ -26267,20 +26237,20 @@ function UpdateGaiaUnitForAllPlayers takes unit whichUnit returns nothing endfunction -function WoWReforgedGaia__ForGroupUpdateForPlayer takes nothing returns nothing - call UpdateGaiaUnitForPlayer(GetEnumUnit() , WoWReforgedGaia__tmpPlayer) +function WoWReforgedGaia___ForGroupUpdateForPlayer takes nothing returns nothing + call UpdateGaiaUnitForPlayer(GetEnumUnit() , WoWReforgedGaia___tmpPlayer) endfunction function UpdateAllGaiaUnitsForPlayer takes player whichPlayer returns nothing local group allUnits= GetUnitsOfPlayerAll(udg_Gaia) - set WoWReforgedGaia__tmpPlayer=whichPlayer - call ForGroup(allUnits, function WoWReforgedGaia__ForGroupUpdateForPlayer) + set WoWReforgedGaia___tmpPlayer=whichPlayer + call ForGroup(allUnits, function WoWReforgedGaia___ForGroupUpdateForPlayer) call GroupClear(allUnits) call DestroyGroup(allUnits) set allUnits=null endfunction -function WoWReforgedGaia__TriggerConditionUpdateFood takes nothing returns boolean +function WoWReforgedGaia___TriggerConditionUpdateFood takes nothing returns boolean local player owner= GetOwningPlayer(GetTriggerUnit()) if ( GetTriggerEventId() == EVENT_PLAYER_UNIT_SELL ) then set owner=GetOwningPlayer(GetSoldUnit()) @@ -26295,13 +26265,13 @@ function WoWReforgedGaia__TriggerConditionUpdateFood takes nothing returns boole return false endfunction -function WoWReforgedGaia__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia__updateFoodTriger, EVENT_PLAYER_UNIT_TRAIN_FINISH) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia__updateFoodTriger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia__updateFoodTriger, EVENT_PLAYER_UNIT_SELL) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia__updateFoodTriger, EVENT_PLAYER_UNIT_DEATH) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia__updateFoodTriger, EVENT_PLAYER_HERO_REVIVE_FINISH) - call TriggerAddCondition(WoWReforgedGaia__updateFoodTriger, Condition(function WoWReforgedGaia__TriggerConditionUpdateFood)) +function WoWReforgedGaia___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia___updateFoodTriger, EVENT_PLAYER_UNIT_TRAIN_FINISH) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia___updateFoodTriger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia___updateFoodTriger, EVENT_PLAYER_UNIT_SELL) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia___updateFoodTriger, EVENT_PLAYER_UNIT_DEATH) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedGaia___updateFoodTriger, EVENT_PLAYER_HERO_REVIVE_FINISH) + call TriggerAddCondition(WoWReforgedGaia___updateFoodTriger, Condition(function WoWReforgedGaia___TriggerConditionUpdateFood)) call TryInitRescuableTriggersBJ() endfunction @@ -26312,26 +26282,26 @@ endfunction function GetTrophyCounter takes nothing returns integer - return WoWReforgedHunter__trophyCounter + return WoWReforgedHunter___trophyCounter endfunction function GetTrophyUnitTypeId takes integer index returns integer - return WoWReforgedHunter__trophyUnitTypeIds[index] + return WoWReforgedHunter___trophyUnitTypeIds[index] endfunction function GetTrophyItemTypeId takes integer index returns integer - return WoWReforgedHunter__trophyItemTypeIds[index] + return WoWReforgedHunter___trophyItemTypeIds[index] endfunction function GetRandomTrophyItemTypeId takes nothing returns integer - return WoWReforgedHunter__trophyItemTypeIds[GetRandomInt(0, WoWReforgedHunter__trophyCounter - 1)] + return WoWReforgedHunter___trophyItemTypeIds[GetRandomInt(0, WoWReforgedHunter___trophyCounter - 1)] endfunction function IsCritter takes integer unitTypeId returns boolean local integer i= 0 loop - exitwhen ( i == WoWReforgedHunter__trophyCounter ) - if ( WoWReforgedHunter__trophyUnitTypeIds[i] == unitTypeId ) then + exitwhen ( i == WoWReforgedHunter___trophyCounter ) + if ( WoWReforgedHunter___trophyUnitTypeIds[i] == unitTypeId ) then return true endif set i=i + 1 @@ -26346,8 +26316,8 @@ endfunction function IsTrophy takes integer itemTypeId returns boolean local integer i= 0 loop - exitwhen ( i == WoWReforgedHunter__trophyCounter ) - if ( WoWReforgedHunter__trophyItemTypeIds[i] == itemTypeId ) then + exitwhen ( i == WoWReforgedHunter___trophyCounter ) + if ( WoWReforgedHunter___trophyItemTypeIds[i] == itemTypeId ) then return true endif set i=i + 1 @@ -26358,9 +26328,9 @@ endfunction function GetUnitTypeIdTrophy takes integer unitTypeId returns integer local integer i= 0 loop - exitwhen ( i == WoWReforgedHunter__trophyCounter ) - if ( WoWReforgedHunter__trophyUnitTypeIds[i] == unitTypeId ) then - return WoWReforgedHunter__trophyItemTypeIds[i] + exitwhen ( i == WoWReforgedHunter___trophyCounter ) + if ( WoWReforgedHunter___trophyUnitTypeIds[i] == unitTypeId ) then + return WoWReforgedHunter___trophyItemTypeIds[i] endif set i=i + 1 endloop @@ -26368,10 +26338,10 @@ function GetUnitTypeIdTrophy takes integer unitTypeId returns integer endfunction function AddTrophy takes integer unitTypeId,integer itemTypeId returns integer - local integer index= WoWReforgedHunter__trophyCounter - set WoWReforgedHunter__trophyUnitTypeIds[index]=unitTypeId - set WoWReforgedHunter__trophyItemTypeIds[index]=itemTypeId - set WoWReforgedHunter__trophyCounter=WoWReforgedHunter__trophyCounter + 1 + local integer index= WoWReforgedHunter___trophyCounter + set WoWReforgedHunter___trophyUnitTypeIds[index]=unitTypeId + set WoWReforgedHunter___trophyItemTypeIds[index]=itemTypeId + set WoWReforgedHunter___trophyCounter=WoWReforgedHunter___trophyCounter + 1 return index endfunction @@ -26398,19 +26368,19 @@ function DuplicateTrophies takes unit whichUnit returns nothing set slotItem=null set i=i + 1 endloop - call UnitDropItem(whichUnit, (WoWReforgedHunter__trophyItemTypeIds[GetRandomInt(0, WoWReforgedHunter__trophyCounter - 1)])) // INLINED!! - call UnitDropItem(whichUnit, (WoWReforgedHunter__trophyItemTypeIds[GetRandomInt(0, WoWReforgedHunter__trophyCounter - 1)])) // INLINED!! + call UnitDropItem(whichUnit, (WoWReforgedHunter___trophyItemTypeIds[GetRandomInt(0, WoWReforgedHunter___trophyCounter - 1)])) // INLINED!! + call UnitDropItem(whichUnit, (WoWReforgedHunter___trophyItemTypeIds[GetRandomInt(0, WoWReforgedHunter___trophyCounter - 1)])) // INLINED!! endfunction function TrophiesInfo takes player whichPlayer returns string local string msg= "Trophies: " local integer i= 0 loop - exitwhen ( i == WoWReforgedHunter__trophyCounter ) + exitwhen ( i == WoWReforgedHunter___trophyCounter ) if ( i > 0 ) then set msg=msg + ", " endif - set msg=msg + GetObjectName(WoWReforgedHunter__trophyItemTypeIds[i]) + " (" + GetObjectName(WoWReforgedHunter__trophyUnitTypeIds[i]) + ")" + set msg=msg + GetObjectName(WoWReforgedHunter___trophyItemTypeIds[i]) + " (" + GetObjectName(WoWReforgedHunter___trophyUnitTypeIds[i]) + ")" set i=i + 1 endloop return msg @@ -26422,7 +26392,7 @@ function TrackCittersAndTrophies takes unit caster returns nothing local integer max= 0 local unit u= null local player owner= GetOwningPlayer(caster) - call GroupEnumUnitsInRange(g, GetUnitX(caster), GetUnitY(caster), 512.0, WoWReforgedHunter__filterIsCritterWithTrophy) + call GroupEnumUnitsInRange(g, GetUnitX(caster), GetUnitY(caster), 512.0, WoWReforgedHunter___filterIsCritterWithTrophy) set max=BlzGroupGetSize(g) set i=0 loop @@ -26438,12 +26408,12 @@ function TrackCittersAndTrophies takes unit caster returns nothing set caster=null endfunction -function WoWReforgedHunter__IsCritterWithTrophy takes nothing returns boolean +function WoWReforgedHunter___IsCritterWithTrophy takes nothing returns boolean return (GetUnitTypeIdTrophy((GetUnitTypeId(GetFilterUnit()))) != 0) // INLINED!! endfunction -function WoWReforgedHunter__Init takes nothing returns nothing - set WoWReforgedHunter__filterIsCritterWithTrophy=Filter(function WoWReforgedHunter__IsCritterWithTrophy) +function WoWReforgedHunter___Init takes nothing returns nothing + set WoWReforgedHunter___filterIsCritterWithTrophy=Filter(function WoWReforgedHunter___IsCritterWithTrophy) call AddTrophy(STAG , ITEM_ANTLER) call AddTrophy(PIG , ITEM_PIG_SKIN) @@ -26478,27 +26448,27 @@ endfunction function AddRaceIcon takes integer whichRace,string icon returns nothing - set WoWReforgedIcons__raceIcons[whichRace]=icon + set WoWReforgedIcons___raceIcons[whichRace]=icon endfunction function GetIconByRace takes integer whichRace returns string - if ( whichRace == udg_RaceNone or WoWReforgedIcons__raceIcons[whichRace] == null or WoWReforgedIcons__raceIcons[whichRace] == "" ) then + if ( whichRace == udg_RaceNone or WoWReforgedIcons___raceIcons[whichRace] == null or WoWReforgedIcons___raceIcons[whichRace] == "" ) then return "ReplaceableTextures\\WorldEditUI\\Editor-Random-Unit.blp" endif - return WoWReforgedIcons__raceIcons[whichRace] + return WoWReforgedIcons___raceIcons[whichRace] endfunction function AddProfessionIcon takes integer profession,string icon returns nothing - set WoWReforgedIcons__professionIcons[profession]=icon + set WoWReforgedIcons___professionIcons[profession]=icon endfunction function GetIconByProfession takes integer profession returns string - if ( profession == udg_ProfessionNone or WoWReforgedIcons__professionIcons[profession] == null or WoWReforgedIcons__professionIcons[profession] == "" ) then + if ( profession == udg_ProfessionNone or WoWReforgedIcons___professionIcons[profession] == null or WoWReforgedIcons___professionIcons[profession] == "" ) then return "ReplaceableTextures\\WorldEditUI\\Editor-Random-Unit.blp" endif - return WoWReforgedIcons__professionIcons[profession] + return WoWReforgedIcons___professionIcons[profession] endfunction function AddUnitTypeIcon takes integer unitTypeId,string icon returns nothing @@ -26650,7 +26620,7 @@ endfunction //library WoWReforgedMapData ends //library WoWReforgedMarketplace: -function WoWReforgedMarketplace__IsMarketplace takes nothing returns boolean +function WoWReforgedMarketplace___IsMarketplace takes nothing returns boolean return GetUnitTypeId(GetFilterUnit()) == 'n0IW' endfunction @@ -26661,7 +26631,7 @@ function UpdateEachStockBuildingHook takes itemtype iType,integer iLevel returns set bj_stockPickedItemLevel=iLevel set g=CreateGroup() - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedMarketplace__IsMarketplace)) + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedMarketplace___IsMarketplace)) call ForGroup(g, function UpdateEachStockBuildingEnum) call DestroyGroup(g) set g=null @@ -26675,15 +26645,15 @@ endfunction function AddObjectMapping takes integer id,integer mapping returns nothing - call SaveInteger(WoWReforgedObjectMappings___h, id, 0, mapping) - call SaveInteger(WoWReforgedObjectMappings___h, mapping, 0, id) + call SaveInteger(WoWReforgedObjectMappings__h, id, 0, mapping) + call SaveInteger(WoWReforgedObjectMappings__h, mapping, 0, id) endfunction function GetObjectMapping takes integer id returns integer - return LoadInteger(WoWReforgedObjectMappings___h, id, 0) + return LoadInteger(WoWReforgedObjectMappings__h, id, 0) endfunction -function WoWReforgedObjectMappings___Init takes nothing returns nothing +function WoWReforgedObjectMappings__Init takes nothing returns nothing call AddObjectMapping(POWER_GENERATOR , ITEM_TINY_POWER_GENERATOR) call AddObjectMapping(PORTAL , ITEM_TINY_PORTAL) call AddObjectMapping(RESEARCH_TENT , ITEM_TINY_RESEARCH_TENT) @@ -26722,31 +26692,31 @@ endfunction //library WoWReforgedRandomArtifacts: -function WoWReforgedRandomArtifacts__RegisterItemAbility takes integer abilityId returns nothing - set WoWReforgedRandomArtifacts__abilityIds[WoWReforgedRandomArtifacts__abilityIdsCounter]=abilityId - set WoWReforgedRandomArtifacts__abilityIdsCounter=WoWReforgedRandomArtifacts__abilityIdsCounter + 1 +function WoWReforgedRandomArtifacts___RegisterItemAbility takes integer abilityId returns nothing + set WoWReforgedRandomArtifacts___abilityIds[WoWReforgedRandomArtifacts___abilityIdsCounter]=abilityId + set WoWReforgedRandomArtifacts___abilityIdsCounter=WoWReforgedRandomArtifacts___abilityIdsCounter + 1 endfunction -function WoWReforgedRandomArtifacts__Init takes nothing returns nothing - call WoWReforgedRandomArtifacts__RegisterItemAbility('AIt6') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AIt9') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AId0') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AId4') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AId5') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AId7') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AIx1') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AIx2') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AIx3') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AIx4') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AI2m') - call WoWReforgedRandomArtifacts__RegisterItemAbility('AIl2') +function WoWReforgedRandomArtifacts___Init takes nothing returns nothing + call WoWReforgedRandomArtifacts___RegisterItemAbility('AIt6') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AIt9') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AId0') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AId4') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AId5') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AId7') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AIx1') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AIx2') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AIx3') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AIx4') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AI2m') + call WoWReforgedRandomArtifacts___RegisterItemAbility('AIl2') endfunction function RandomizeItemAbility takes item whichItem returns nothing if ( BlzGetItemAbilityByIndex(whichItem, 1) != null ) then call BlzItemRemoveAbility(whichItem, BlzGetAbilityId(BlzGetItemAbilityByIndex(whichItem, 1))) endif - call BlzItemAddAbility(whichItem, WoWReforgedRandomArtifacts__abilityIds[GetRandomInt(0, WoWReforgedRandomArtifacts__abilityIdsCounter - 1)]) + call BlzItemAddAbility(whichItem, WoWReforgedRandomArtifacts___abilityIds[GetRandomInt(0, WoWReforgedRandomArtifacts___abilityIdsCounter - 1)]) endfunction function InitialRandomizeItemAbility takes item whichItem returns nothing @@ -26759,20 +26729,20 @@ endfunction //library WoWReforgedRandomArtifacts ends //library WoWReforgedSleepingBag: -function WoWReforgedSleepingBag__FilterIsHero takes nothing returns boolean +function WoWReforgedSleepingBag___FilterIsHero takes nothing returns boolean return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) endfunction -function WoWReforgedSleepingBag__HealHeroesEnum takes nothing returns nothing +function WoWReforgedSleepingBag___HealHeroesEnum takes nothing returns nothing call SetUnitLifePercentBJ(GetEnumUnit(), 100.0) call SetUnitManaPercentBJ(GetEnumUnit(), 100.0) endfunction function SleepingBag takes unit caster,real whatTime returns nothing local group heroes= CreateGroup() - call GroupEnumUnitsInRect(heroes, GetPlayableMapRect(), Filter(function WoWReforgedSleepingBag__FilterIsHero)) + call GroupEnumUnitsInRect(heroes, GetPlayableMapRect(), Filter(function WoWReforgedSleepingBag___FilterIsHero)) call SetTimeOfDay(whatTime) - call ForGroup(heroes, function WoWReforgedSleepingBag__HealHeroesEnum) + call ForGroup(heroes, function WoWReforgedSleepingBag___HealHeroesEnum) call GroupClear(heroes) call DestroyGroup(heroes) set heroes=null @@ -26863,7 +26833,7 @@ endfunction //library WoWReforgedTerrain ends //library WoWReforgedTinker: -function WoWReforgedTinker__PrintDebug takes unit hero returns nothing +function WoWReforgedTinker___PrintDebug takes unit hero returns nothing local integer clusterRocketsLevel= GetUnitAbilityLevel(hero, 'ANcs') local integer pocketFactoryLevel= GetUnitAbilityLevel(hero, 'ANsy') local integer roboGoblinLevel= GetUnitAbilityLevel(hero, 'ANrg') @@ -26913,32 +26883,32 @@ endfunction //library WoWReforgedUnlimitedBagOfFood: -function WoWReforgedUnlimitedBagOfFood__GetRandomId takes nothing returns integer - return WoWReforgedUnlimitedBagOfFood__ids[GetRandomInt(0, WoWReforgedUnlimitedBagOfFood__counter)] +function WoWReforgedUnlimitedBagOfFood___GetRandomId takes nothing returns integer + return WoWReforgedUnlimitedBagOfFood___ids[GetRandomInt(0, WoWReforgedUnlimitedBagOfFood___counter)] endfunction function UnlimitedBagOfFood takes unit whichUnit returns nothing - call UnitAddItemById(whichUnit, (WoWReforgedUnlimitedBagOfFood__ids[GetRandomInt(0, WoWReforgedUnlimitedBagOfFood__counter)])) // INLINED!! + call UnitAddItemById(whichUnit, (WoWReforgedUnlimitedBagOfFood___ids[GetRandomInt(0, WoWReforgedUnlimitedBagOfFood___counter)])) // INLINED!! endfunction -function WoWReforgedUnlimitedBagOfFood__AddId takes integer id returns nothing - set WoWReforgedUnlimitedBagOfFood__ids[WoWReforgedUnlimitedBagOfFood__counter]=id - set WoWReforgedUnlimitedBagOfFood__counter=WoWReforgedUnlimitedBagOfFood__counter + 1 +function WoWReforgedUnlimitedBagOfFood___AddId takes integer id returns nothing + set WoWReforgedUnlimitedBagOfFood___ids[WoWReforgedUnlimitedBagOfFood___counter]=id + set WoWReforgedUnlimitedBagOfFood___counter=WoWReforgedUnlimitedBagOfFood___counter + 1 endfunction -function WoWReforgedUnlimitedBagOfFood__Init takes nothing returns nothing - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_BUNDLE_OF_WHEAT) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_APPLE) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_BANANA) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_CHERRY) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_FISH) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_GARLIC) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_LEMON) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_MEAT) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_ORANGE) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_PLUM) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_PUMPKIN) - call WoWReforgedUnlimitedBagOfFood__AddId(ITEM_WOOL) +function WoWReforgedUnlimitedBagOfFood___Init takes nothing returns nothing + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_BUNDLE_OF_WHEAT) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_APPLE) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_BANANA) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_CHERRY) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_FISH) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_GARLIC) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_LEMON) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_MEAT) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_ORANGE) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_PLUM) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_PUMPKIN) + call WoWReforgedUnlimitedBagOfFood___AddId(ITEM_WOOL) endfunction @@ -27056,7 +27026,7 @@ endfunction //Implemented from module WorldBounds__WorldBoundInit: - function s__WorldBounds_WorldBounds__WorldBoundInit___onInit takes nothing returns nothing + function s__WorldBounds_WorldBounds__WorldBoundInit__onInit takes nothing returns nothing set s__WorldBounds_world=GetWorldBounds() set s__WorldBounds_maxX=R2I(GetRectMaxX(s__WorldBounds_world)) @@ -27087,7 +27057,7 @@ function Challenge takes integer abilityId,unit caster,unit target returns nothi endif endfunction -function Challenge___TriggerConditionCast takes nothing returns boolean +function Challenge__TriggerConditionCast takes nothing returns boolean if ( GetSpellAbilityId() == Challenge_ABILITY_ID ) then if ( GetSpellTargetUnit() != null ) then if ( not IsUnitAlly(GetSpellTargetUnit(), GetOwningPlayer(GetTriggerUnit())) ) then @@ -27106,9 +27076,9 @@ function Challenge___TriggerConditionCast takes nothing returns boolean return false endfunction -function Challenge___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Challenge___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(Challenge___castTrigger, Condition(function Challenge___TriggerConditionCast)) +function Challenge__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Challenge__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(Challenge__castTrigger, Condition(function Challenge__TriggerConditionCast)) endfunction @@ -27166,12 +27136,12 @@ endfunction function s__CooldownReduction__AbilityList_allocate takes nothing returns integer local integer this - if ( s__CooldownReduction__AbilityList_Alloc___recycle[(0)] == 0 ) then - set s__CooldownReduction__AbilityList_Alloc___instanceCount=s__CooldownReduction__AbilityList_Alloc___instanceCount + 1 - set this=s__CooldownReduction__AbilityList_Alloc___instanceCount + if ( s__CooldownReduction__AbilityList_Alloc__recycle[(0)] == 0 ) then + set s__CooldownReduction__AbilityList_Alloc__instanceCount=s__CooldownReduction__AbilityList_Alloc__instanceCount + 1 + set this=s__CooldownReduction__AbilityList_Alloc__instanceCount else - set this=s__CooldownReduction__AbilityList_Alloc___recycle[(0)] - set s__CooldownReduction__AbilityList_Alloc___recycle[(0)]=s__CooldownReduction__AbilityList_Alloc___recycle[s__CooldownReduction__AbilityList_Alloc___recycle[(0)]] + set this=s__CooldownReduction__AbilityList_Alloc__recycle[(0)] + set s__CooldownReduction__AbilityList_Alloc__recycle[(0)]=s__CooldownReduction__AbilityList_Alloc__recycle[s__CooldownReduction__AbilityList_Alloc__recycle[(0)]] endif @@ -27179,8 +27149,8 @@ endfunction endfunction function s__CooldownReduction__AbilityList_deallocate takes integer this returns nothing - set s__CooldownReduction__AbilityList_Alloc___recycle[this]=s__CooldownReduction__AbilityList_Alloc___recycle[(0)] - set s__CooldownReduction__AbilityList_Alloc___recycle[(0)]=this + set s__CooldownReduction__AbilityList_Alloc__recycle[this]=s__CooldownReduction__AbilityList_Alloc__recycle[(0)] + set s__CooldownReduction__AbilityList_Alloc__recycle[(0)]=this endfunction //Implemented from module CooldownReduction__List: @@ -27768,7 +27738,7 @@ endfunction //library Decay: -function Decay___FilterIsCorpse takes nothing returns boolean +function Decay__FilterIsCorpse takes nothing returns boolean return not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and IsUnitDeadBJ(GetFilterUnit()) endfunction @@ -27781,7 +27751,7 @@ function Decay takes integer abilityId,unit caster,real x,real y,real range retu local boolean heroAbility= abilityId == Decay_ABILITY_ID call h__BJDebugMsg("Decay with range " + R2S(range)) call PingMinimap(x, y, 2.0) - call GroupEnumUnitsInRange(targets, x, y, range, Filter(function Decay___FilterIsCorpse)) + call GroupEnumUnitsInRange(targets, x, y, range, Filter(function Decay__FilterIsCorpse)) if ( BlzGroupGetSize(targets) > 0 ) then set i=0 set max=BlzGroupGetSize(targets) @@ -27808,7 +27778,7 @@ function Decay takes integer abilityId,unit caster,real x,real y,real range retu set targets=null endfunction -function Decay___TriggerConditionCast takes nothing returns boolean +function Decay__TriggerConditionCast takes nothing returns boolean if ( GetSpellAbilityId() == Decay_ABILITY_ID ) then call h__BJDebugMsg(GetObjectName(GetSpellAbilityId()) + " with spell level " + I2S(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) + " and range " + R2S(BlzGetAbilityRealLevelField(BlzGetUnitAbility(GetTriggerUnit(), GetSpellAbilityId()), ABILITY_RLF_AREA_OF_EFFECT, GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())))) call Decay(GetSpellAbilityId() , GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY() , BlzGetAbilityRealLevelField(BlzGetUnitAbility(GetTriggerUnit(), GetSpellAbilityId()), ABILITY_RLF_AREA_OF_EFFECT, GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId()))) @@ -27818,9 +27788,9 @@ function Decay___TriggerConditionCast takes nothing returns boolean return false endfunction -function Decay___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Decay___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(Decay___castTrigger, Condition(function Decay___TriggerConditionCast)) +function Decay__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Decay__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(Decay__castTrigger, Condition(function Decay__TriggerConditionCast)) endfunction @@ -27854,20 +27824,20 @@ endfunction //library ForestWord: -function ForestWord___FilterIsTree takes nothing returns boolean +function ForestWord__FilterIsTree takes nothing returns boolean return (IsTree(GetDestructableTypeId((GetFilterDestructable())))) // INLINED!! endfunction -function ForestWord___EnumRegrowTree takes nothing returns nothing - set ForestWord___tmpCounter=ForestWord___tmpCounter + 1 +function ForestWord__EnumRegrowTree takes nothing returns nothing + set ForestWord__tmpCounter=ForestWord__tmpCounter + 1 call SetDestructableLifePercentBJ(GetEnumDestructable(), 100.0) endfunction -function ForestWord___FilterIsAlly takes nothing returns boolean - return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(ForestWord___tmpCaster)) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') == 0 and ( GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) < GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_LIFE) or ( GetUnitState(GetFilterUnit(), UNIT_STATE_MANA) < GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_MANA) ) ) +function ForestWord__FilterIsAlly takes nothing returns boolean + return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(ForestWord__tmpCaster)) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') == 0 and ( GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) < GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_LIFE) or ( GetUnitState(GetFilterUnit(), UNIT_STATE_MANA) < GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_MANA) ) ) endfunction -function ForestWord___GetRectFromCircle takes real centerX,real centerY,real radius returns rect +function ForestWord__GetRectFromCircle takes real centerX,real centerY,real radius returns rect return Rect(centerX - radius, centerY - radius, centerX + radius, centerY + radius) endfunction @@ -27877,7 +27847,7 @@ function ForestWord takes unit caster,integer abilityId returns nothing local real x= GetUnitX(caster) local real y= GetUnitY(caster) local real range= 1500.0 - local rect r= ForestWord___GetRectFromCircle(x , y , range) + local rect r= ForestWord__GetRectFromCircle(x , y , range) local group targets= CreateGroup() local unit target= null local effect array effects @@ -27886,16 +27856,16 @@ function ForestWord takes unit caster,integer abilityId returns nothing local integer i= 0 local real life= 0.0 local real mana= 0.0 - set ForestWord___tmpCounter=0 - call EnumDestructablesInRect(r, Filter(function ForestWord___FilterIsTree), function ForestWord___EnumRegrowTree) + set ForestWord__tmpCounter=0 + call EnumDestructablesInRect(r, Filter(function ForestWord__FilterIsTree), function ForestWord__EnumRegrowTree) call RemoveRect(r) set r=null - if ( ForestWord___tmpCounter > 0 ) then - set life=RMinBJ(100.0, I2R(GetUnitAbilityLevel(caster, abilityId)) * I2R(ForestWord___tmpCounter) * 0.01) - set mana=RMinBJ(100.0, I2R(GetUnitAbilityLevel(caster, abilityId)) * I2R(ForestWord___tmpCounter) * 0.01) + if ( ForestWord__tmpCounter > 0 ) then + set life=RMinBJ(100.0, I2R(GetUnitAbilityLevel(caster, abilityId)) * I2R(ForestWord__tmpCounter) * 0.01) + set mana=RMinBJ(100.0, I2R(GetUnitAbilityLevel(caster, abilityId)) * I2R(ForestWord__tmpCounter) * 0.01) - call GroupEnumUnitsInRange(targets, x, y, range, Filter(function ForestWord___FilterIsAlly)) + call GroupEnumUnitsInRange(targets, x, y, range, Filter(function ForestWord__FilterIsAlly)) set max=BlzGroupGetSize(targets) if ( max > 0 ) then loop @@ -27924,18 +27894,18 @@ function ForestWord takes unit caster,integer abilityId returns nothing set owner=null endfunction -function ForestWord___TriggerConditionCast takes nothing returns boolean +function ForestWord__TriggerConditionCast takes nothing returns boolean return GetSpellAbilityId() == ForestWord_ABILITY_ID endfunction -function ForestWord___TriggerActionCast takes nothing returns nothing +function ForestWord__TriggerActionCast takes nothing returns nothing call ForestWord(GetTriggerUnit() , GetSpellAbilityId()) endfunction -function ForestWord___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(ForestWord___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(ForestWord___castTrigger, Condition(function ForestWord___TriggerConditionCast)) - call TriggerAddAction(ForestWord___castTrigger, function ForestWord___TriggerActionCast) +function ForestWord__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(ForestWord__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(ForestWord__castTrigger, Condition(function ForestWord__TriggerConditionCast)) + call TriggerAddAction(ForestWord__castTrigger, function ForestWord__TriggerActionCast) endfunction @@ -27956,23 +27926,23 @@ endfunction function GetHeroAbilityMaximum takes integer unitTypeId returns integer - return LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, unitTypeId, 0) + 1 + return LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, unitTypeId, 0) + 1 endfunction function GetHeroAbility takes integer unitTypeId,integer index returns integer - return LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, unitTypeId, index) + return LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, unitTypeId, index) endfunction function GetHeroAbilityMaximumLevel takes integer unitTypeId,integer index returns integer - return LoadInteger(HeroAbilitySystem___HeroAbilitiesMaximumLevelHashTable, unitTypeId, index) + return LoadInteger(HeroAbilitySystem__HeroAbilitiesMaximumLevelHashTable, unitTypeId, index) endfunction function GetHeroAbilityIndex takes integer unitTypeId,integer abilityId returns integer local integer i= 1 - local integer max= (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (unitTypeId), 0) + 1) // INLINED!! + local integer max= (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (unitTypeId), 0) + 1) // INLINED!! loop exitwhen ( i >= max ) - if ( (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (unitTypeId ), ( i))) == abilityId ) then // INLINED!! + if ( (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (unitTypeId ), ( i))) == abilityId ) then // INLINED!! return i endif set i=i + 1 @@ -27981,10 +27951,10 @@ function GetHeroAbilityIndex takes integer unitTypeId,integer abilityId returns endfunction function RegisterHeroAbilityEx takes integer unitTypeId,integer abilityId,integer maxLevel returns integer - local integer maxIndex= (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (unitTypeId), 0) + 1) // INLINED!! - call SaveInteger(HeroAbilitySystem___HeroAbilitiesHashTable, unitTypeId, 0, maxIndex) - call SaveInteger(HeroAbilitySystem___HeroAbilitiesHashTable, unitTypeId, maxIndex, abilityId) - call SaveInteger(HeroAbilitySystem___HeroAbilitiesMaximumLevelHashTable, unitTypeId, maxIndex, maxLevel) + local integer maxIndex= (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (unitTypeId), 0) + 1) // INLINED!! + call SaveInteger(HeroAbilitySystem__HeroAbilitiesHashTable, unitTypeId, 0, maxIndex) + call SaveInteger(HeroAbilitySystem__HeroAbilitiesHashTable, unitTypeId, maxIndex, abilityId) + call SaveInteger(HeroAbilitySystem__HeroAbilitiesMaximumLevelHashTable, unitTypeId, maxIndex, maxLevel) return maxIndex endfunction @@ -27997,7 +27967,7 @@ function RemoveHeroAbility takes unit hero,integer abilityId returns boolean local integer level= GetUnitAbilityLevel(hero, abilityId) local integer skillPoints= GetHeroSkillPoints(hero) local integer index= GetHeroAbilityIndex(GetUnitTypeId(hero) , abilityId) - local integer diff= (LoadInteger(HeroAbilitySystem___HeroAbilitiesMaximumLevelHashTable, (GetUnitTypeId(hero) ), ( index))) - level // INLINED!! + local integer diff= (LoadInteger(HeroAbilitySystem__HeroAbilitiesMaximumLevelHashTable, (GetUnitTypeId(hero) ), ( index))) - level // INLINED!! local integer i= 0 if ( index < 1 ) then call h__BJDebugMsg("Invalid ability index " + I2S(index) + " for hero ability " + GetObjectName(abilityId) + " for unit type " + GetObjectName(GetUnitTypeId(hero))) @@ -28024,24 +27994,24 @@ function RemoveHeroAbility takes unit hero,integer abilityId returns boolean endfunction function RemoveAllHeroAbilities takes unit hero returns nothing - local integer max= (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (GetUnitTypeId(hero)), 0) + 1) // INLINED!! + local integer max= (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (GetUnitTypeId(hero)), 0) + 1) // INLINED!! local integer i= 1 loop exitwhen ( i >= max ) - call RemoveHeroAbility(hero , (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i)))) // INLINED!! + call RemoveHeroAbility(hero , (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i)))) // INLINED!! set i=i + 1 endloop endfunction function AddAllHeroAbilities takes unit hero returns nothing - local integer max= (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (GetUnitTypeId(hero)), 0) + 1) // INLINED!! + local integer max= (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (GetUnitTypeId(hero)), 0) + 1) // INLINED!! local integer i= 1 loop exitwhen ( i >= max ) //call BJDebugMsg("Adding hero ability " + GetObjectName(GetHeroAbility(GetUnitTypeId(hero), i))) - if ( GetUnitAbilityLevel(hero, (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i)))) <= 0 ) then // INLINED!! - call UnitAddAbility(hero, (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i)))) // INLINED!! - call SetUnitAbilityLevel(hero, (LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i))), 0) // INLINED!! + if ( GetUnitAbilityLevel(hero, (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i)))) <= 0 ) then // INLINED!! + call UnitAddAbility(hero, (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i)))) // INLINED!! + call SetUnitAbilityLevel(hero, (LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (GetUnitTypeId(hero) ), ( i))), 0) // INLINED!! endif set i=i + 1 endloop @@ -28060,7 +28030,7 @@ function AutoSkillHeroEx takes unit hero,integer unitTypeId returns integer local boolean array slotDoesNotWork //call BJDebugMsg("Maximum hero abilities " + I2S(max) + " for " + GetUnitName(hero)) if ( skillPoints > 0 ) then - set max=(LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (unitTypeId), 0) + 1) // INLINED!! + set max=(LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (unitTypeId), 0) + 1) // INLINED!! loop exitwhen ( i >= skillPoints ) set matched=false @@ -28069,8 +28039,8 @@ function AutoSkillHeroEx takes unit hero,integer unitTypeId returns integer loop exitwhen ( index >= max or matched ) if ( not slotDoesNotWork[index] ) then - set abilityId=(LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (unitTypeId ), ( index))) // INLINED!! - set abilityMaxLevel=(LoadInteger(HeroAbilitySystem___HeroAbilitiesMaximumLevelHashTable, (unitTypeId ), ( index))) // INLINED!! + set abilityId=(LoadInteger(HeroAbilitySystem__HeroAbilitiesHashTable, (unitTypeId ), ( index))) // INLINED!! + set abilityMaxLevel=(LoadInteger(HeroAbilitySystem__HeroAbilitiesMaximumLevelHashTable, (unitTypeId ), ( index))) // INLINED!! set previousLevel=GetUnitAbilityLevel(hero, abilityId) if ( previousLevel < abilityMaxLevel ) then call SelectHeroSkill(hero, abilityId) @@ -28109,86 +28079,86 @@ endfunction function TriggerRegisterHeroReviveOrderStartEvent takes trigger whichTrigger returns nothing - set HeroReviveEvents___callbackOrderStartReviveTriggers[HeroReviveEvents___callbackStartOrderStartTriggersCounter]=whichTrigger - set HeroReviveEvents___callbackStartOrderStartTriggersCounter=HeroReviveEvents___callbackStartOrderStartTriggersCounter + 1 + set HeroReviveEvents__callbackOrderStartReviveTriggers[HeroReviveEvents__callbackStartOrderStartTriggersCounter]=whichTrigger + set HeroReviveEvents__callbackStartOrderStartTriggersCounter=HeroReviveEvents__callbackStartOrderStartTriggersCounter + 1 endfunction function TriggerRegisterHeroReviveOrderCancelEvent takes trigger whichTrigger returns nothing - set HeroReviveEvents___callbackOrderCancelReviveTriggers[HeroReviveEvents___callbackStartOrderCancelTriggersCounter]=whichTrigger - set HeroReviveEvents___callbackStartOrderCancelTriggersCounter=HeroReviveEvents___callbackStartOrderCancelTriggersCounter + 1 + set HeroReviveEvents__callbackOrderCancelReviveTriggers[HeroReviveEvents__callbackStartOrderCancelTriggersCounter]=whichTrigger + set HeroReviveEvents__callbackStartOrderCancelTriggersCounter=HeroReviveEvents__callbackStartOrderCancelTriggersCounter + 1 endfunction function TriggerRegisterHeroReviveStartEvent takes trigger whichTrigger returns nothing - set HeroReviveEvents___callbackStartReviveTriggers[HeroReviveEvents___callbackStartReviveTriggersCounter]=whichTrigger - set HeroReviveEvents___callbackStartReviveTriggersCounter=HeroReviveEvents___callbackStartReviveTriggersCounter + 1 + set HeroReviveEvents__callbackStartReviveTriggers[HeroReviveEvents__callbackStartReviveTriggersCounter]=whichTrigger + set HeroReviveEvents__callbackStartReviveTriggersCounter=HeroReviveEvents__callbackStartReviveTriggersCounter + 1 endfunction function TriggerRegisterHeroReviveFinishEvent takes trigger whichTrigger returns nothing - set HeroReviveEvents___callbackFinishReviveTriggers[HeroReviveEvents___callbackFinishReviveTriggersCounter]=whichTrigger - set HeroReviveEvents___callbackFinishReviveTriggersCounter=HeroReviveEvents___callbackFinishReviveTriggersCounter + 1 + set HeroReviveEvents__callbackFinishReviveTriggers[HeroReviveEvents__callbackFinishReviveTriggersCounter]=whichTrigger + set HeroReviveEvents__callbackFinishReviveTriggersCounter=HeroReviveEvents__callbackFinishReviveTriggersCounter + 1 endfunction function GetTriggerReviveAltar takes nothing returns unit - return HeroReviveEvents___triggerReviveAltar + return HeroReviveEvents__triggerReviveAltar endfunction function GetTriggerReviveHero takes nothing returns unit - return HeroReviveEvents___triggerReviveHero + return HeroReviveEvents__triggerReviveHero endfunction -function HeroReviveEvents___ExecuteCallbacksOrderStartRevive takes unit altar,unit hero returns nothing +function HeroReviveEvents__ExecuteCallbacksOrderStartRevive takes unit altar,unit hero returns nothing local integer i= 0 - set HeroReviveEvents___triggerReviveAltar=altar - set HeroReviveEvents___triggerReviveHero=hero + set HeroReviveEvents__triggerReviveAltar=altar + set HeroReviveEvents__triggerReviveHero=hero loop - exitwhen ( i == HeroReviveEvents___callbackStartOrderStartTriggersCounter ) - if ( IsTriggerEnabled(HeroReviveEvents___callbackOrderStartReviveTriggers[i]) ) then - call ConditionalTriggerExecute(HeroReviveEvents___callbackOrderStartReviveTriggers[i]) + exitwhen ( i == HeroReviveEvents__callbackStartOrderStartTriggersCounter ) + if ( IsTriggerEnabled(HeroReviveEvents__callbackOrderStartReviveTriggers[i]) ) then + call ConditionalTriggerExecute(HeroReviveEvents__callbackOrderStartReviveTriggers[i]) endif set i=i + 1 endloop endfunction -function HeroReviveEvents___ExecuteCallbacksOrderCancelRevive takes unit altar,unit hero returns nothing +function HeroReviveEvents__ExecuteCallbacksOrderCancelRevive takes unit altar,unit hero returns nothing local integer i= 0 - set HeroReviveEvents___triggerReviveAltar=altar - set HeroReviveEvents___triggerReviveHero=hero + set HeroReviveEvents__triggerReviveAltar=altar + set HeroReviveEvents__triggerReviveHero=hero loop - exitwhen ( i == HeroReviveEvents___callbackStartOrderCancelTriggersCounter ) - if ( IsTriggerEnabled(HeroReviveEvents___callbackOrderCancelReviveTriggers[i]) ) then - call ConditionalTriggerExecute(HeroReviveEvents___callbackOrderCancelReviveTriggers[i]) + exitwhen ( i == HeroReviveEvents__callbackStartOrderCancelTriggersCounter ) + if ( IsTriggerEnabled(HeroReviveEvents__callbackOrderCancelReviveTriggers[i]) ) then + call ConditionalTriggerExecute(HeroReviveEvents__callbackOrderCancelReviveTriggers[i]) endif set i=i + 1 endloop endfunction -function HeroReviveEvents___ExecuteCallbacksStartRevive takes unit altar,unit hero returns nothing +function HeroReviveEvents__ExecuteCallbacksStartRevive takes unit altar,unit hero returns nothing local integer i= 0 - set HeroReviveEvents___triggerReviveAltar=altar - set HeroReviveEvents___triggerReviveHero=hero + set HeroReviveEvents__triggerReviveAltar=altar + set HeroReviveEvents__triggerReviveHero=hero loop - exitwhen ( i == HeroReviveEvents___callbackStartReviveTriggersCounter ) - if ( IsTriggerEnabled(HeroReviveEvents___callbackStartReviveTriggers[i]) ) then - call ConditionalTriggerExecute(HeroReviveEvents___callbackStartReviveTriggers[i]) + exitwhen ( i == HeroReviveEvents__callbackStartReviveTriggersCounter ) + if ( IsTriggerEnabled(HeroReviveEvents__callbackStartReviveTriggers[i]) ) then + call ConditionalTriggerExecute(HeroReviveEvents__callbackStartReviveTriggers[i]) endif set i=i + 1 endloop endfunction -function HeroReviveEvents___ExecuteCallbacksFinishRevive takes unit altar,unit hero returns nothing +function HeroReviveEvents__ExecuteCallbacksFinishRevive takes unit altar,unit hero returns nothing local integer i= 0 - set HeroReviveEvents___triggerReviveAltar=altar - set HeroReviveEvents___triggerReviveHero=hero + set HeroReviveEvents__triggerReviveAltar=altar + set HeroReviveEvents__triggerReviveHero=hero loop - exitwhen ( i == HeroReviveEvents___callbackFinishReviveTriggersCounter ) - if ( IsTriggerEnabled(HeroReviveEvents___callbackFinishReviveTriggers[i]) ) then - call ConditionalTriggerExecute(HeroReviveEvents___callbackFinishReviveTriggers[i]) + exitwhen ( i == HeroReviveEvents__callbackFinishReviveTriggersCounter ) + if ( IsTriggerEnabled(HeroReviveEvents__callbackFinishReviveTriggers[i]) ) then + call ConditionalTriggerExecute(HeroReviveEvents__callbackFinishReviveTriggers[i]) endif set i=i + 1 endloop endfunction -function HeroReviveEvents___TriggerConditionOrder takes nothing returns boolean +function HeroReviveEvents__TriggerConditionOrder takes nothing returns boolean local unit altar= GetTriggerUnit() local unit hero= GetOrderTargetUnit() local integer orderId= GetIssuedOrderId() @@ -28196,12 +28166,12 @@ function HeroReviveEvents___TriggerConditionOrder takes nothing returns boolean // https://www.hiveworkshop.com/threads/getting-the-reviving-altar-for-event_unit_hero_revive_start.356746/#post-3645129 if ( orderId == HeroReviveEvents_ORDER_ID_START_REVIVE ) then // save the corresponding altar for the hero - call SaveUnitHandle(HeroReviveEvents___h, GetHandleId(hero), 0, altar) - call HeroReviveEvents___ExecuteCallbacksOrderStartRevive(altar , hero) + call SaveUnitHandle(HeroReviveEvents__h, GetHandleId(hero), 0, altar) + call HeroReviveEvents__ExecuteCallbacksOrderStartRevive(altar , hero) elseif ( orderId == HeroReviveEvents_ORDER_ID_REVIVE ) then // works only with HeroReviveCancelEvent - call FlushChildHashtable(HeroReviveEvents___h, GetHandleId(hero)) - call GroupRemoveUnit(HeroReviveEvents___heroes, hero) - call HeroReviveEvents___ExecuteCallbacksOrderCancelRevive(altar , hero) + call FlushChildHashtable(HeroReviveEvents__h, GetHandleId(hero)) + call GroupRemoveUnit(HeroReviveEvents__heroes, hero) + call HeroReviveEvents__ExecuteCallbacksOrderCancelRevive(altar , hero) endif set altar=null set hero=null @@ -28209,50 +28179,50 @@ function HeroReviveEvents___TriggerConditionOrder takes nothing returns boolean return false endfunction -function HeroReviveEvents___TriggerConditionStartRevive takes nothing returns boolean +function HeroReviveEvents__TriggerConditionStartRevive takes nothing returns boolean local unit hero= GetRevivingUnit() - if ( not IsUnitInGroup(hero, HeroReviveEvents___heroes) ) then - call GroupAddUnit(HeroReviveEvents___heroes, hero) + if ( not IsUnitInGroup(hero, HeroReviveEvents__heroes) ) then + call GroupAddUnit(HeroReviveEvents__heroes, hero) // GetTriggerUnit is not the altar https://www.hiveworkshop.com/threads/getting-the-reviving-altar-for-event_unit_hero_revive_start.356746/ - call HeroReviveEvents___ExecuteCallbacksStartRevive(LoadUnitHandle(HeroReviveEvents___h, GetHandleId(hero), 0) , hero) + call HeroReviveEvents__ExecuteCallbacksStartRevive(LoadUnitHandle(HeroReviveEvents__h, GetHandleId(hero), 0) , hero) endif set hero=null return false endfunction -function HeroReviveEvents___TriggerConditionFinishRevive takes nothing returns boolean +function HeroReviveEvents__TriggerConditionFinishRevive takes nothing returns boolean local unit hero= GetRevivingUnit() - if ( IsUnitInGroup(GetRevivingUnit(), HeroReviveEvents___heroes) ) then - call GroupRemoveUnit(HeroReviveEvents___heroes, hero) - call HeroReviveEvents___ExecuteCallbacksFinishRevive(LoadUnitHandle(HeroReviveEvents___h, GetHandleId(hero), 0) , hero) - call FlushChildHashtable(HeroReviveEvents___h, GetHandleId(hero)) + if ( IsUnitInGroup(GetRevivingUnit(), HeroReviveEvents__heroes) ) then + call GroupRemoveUnit(HeroReviveEvents__heroes, hero) + call HeroReviveEvents__ExecuteCallbacksFinishRevive(LoadUnitHandle(HeroReviveEvents__h, GetHandleId(hero), 0) , hero) + call FlushChildHashtable(HeroReviveEvents__h, GetHandleId(hero)) endif set hero=null return false endfunction -function HeroReviveEvents___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) - call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) - call TriggerAddCondition(HeroReviveEvents___orderTrigger, Condition(function HeroReviveEvents___TriggerConditionOrder)) +function HeroReviveEvents__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents__orderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) + call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents__orderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) + call TriggerAddCondition(HeroReviveEvents__orderTrigger, Condition(function HeroReviveEvents__TriggerConditionOrder)) - call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents___startReviveTrigger, EVENT_PLAYER_HERO_REVIVE_START) - call TriggerAddCondition(HeroReviveEvents___startReviveTrigger, Condition(function HeroReviveEvents___TriggerConditionStartRevive)) + call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents__startReviveTrigger, EVENT_PLAYER_HERO_REVIVE_START) + call TriggerAddCondition(HeroReviveEvents__startReviveTrigger, Condition(function HeroReviveEvents__TriggerConditionStartRevive)) - call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents___finishReviveTrigger, EVENT_PLAYER_HERO_REVIVE_FINISH) - call TriggerAddCondition(HeroReviveEvents___finishReviveTrigger, Condition(function HeroReviveEvents___TriggerConditionFinishRevive)) + call TriggerRegisterAnyUnitEventBJ(HeroReviveEvents__finishReviveTrigger, EVENT_PLAYER_HERO_REVIVE_FINISH) + call TriggerAddCondition(HeroReviveEvents__finishReviveTrigger, Condition(function HeroReviveEvents__TriggerConditionFinishRevive)) endfunction -function HeroReviveEvents___RemoveUnitHook takes unit whichUnit returns nothing - call FlushChildHashtable(HeroReviveEvents___h, GetHandleId(whichUnit)) - if ( IsUnitInGroup(whichUnit, HeroReviveEvents___heroes) ) then - call GroupRemoveUnit(HeroReviveEvents___heroes, whichUnit) +function HeroReviveEvents__RemoveUnitHook takes unit whichUnit returns nothing + call FlushChildHashtable(HeroReviveEvents__h, GetHandleId(whichUnit)) + if ( IsUnitInGroup(whichUnit, HeroReviveEvents__heroes) ) then + call GroupRemoveUnit(HeroReviveEvents__heroes, whichUnit) endif endfunction -//processed hook: hook RemoveUnit HeroReviveEvents___RemoveUnitHook +//processed hook: hook RemoveUnit HeroReviveEvents__RemoveUnitHook //library HeroReviveEvents ends @@ -28543,14 +28513,14 @@ endfunction //library Jump: - function Jump___GetLocZ takes real x,real y returns real - call MoveLocation(Jump___loc, x, y) - return GetLocationZ(Jump___loc) + function Jump__GetLocZ takes real x,real y returns real + call MoveLocation(Jump__loc, x, y) + return GetLocationZ(Jump__loc) endfunction - function Jump___DestructableFilter takes nothing returns boolean - if GetDestructableLife(GetFilterDestructable()) > 0 and GetDestructableOccluderHeight(GetFilterDestructable()) > Jump___flh then - set Jump___b=true + function Jump__DestructableFilter takes nothing returns boolean + if GetDestructableLife(GetFilterDestructable()) > 0 and GetDestructableOccluderHeight(GetFilterDestructable()) > Jump__flh then + set Jump__b=true endif return false endfunction @@ -28590,39 +28560,39 @@ endfunction exitwhen 0 == this set x=GetUnitX(s__Jump_u[this]) + s__Jump_sx[this] set y=GetUnitY(s__Jump_u[this]) + s__Jump_sy[this] - set z=Jump___GetLocZ(x , y) - s__Jump_z0[this] + set z=Jump__GetLocZ(x , y) - s__Jump_z0[this] set s__Jump_t[this]=s__Jump_t[this] + s__Jump_dt[this] set fh=s__Jump_sinZ[this] * s__Jump_t[this] - s__Jump_g[this] * s__Jump_t[this] * s__Jump_t[this] / 2. - z + s__Jump_dfh[this] if s__Jump_t[this] < s__Jump_tEnd[this] then - set Jump___b=false + set Jump__b=false if s__Jump_colDD[this] > 0 then - call SetRect(Jump___rct, x - s__Jump_colDD[this], y - s__Jump_colDD[this], x + s__Jump_colDD[this], y + s__Jump_colDD[this]) - call EnumDestructablesInRect(Jump___rct, Condition(function Jump___DestructableFilter), null) + call SetRect(Jump__rct, x - s__Jump_colDD[this], y - s__Jump_colDD[this], x + s__Jump_colDD[this], y + s__Jump_colDD[this]) + call EnumDestructablesInRect(Jump__rct, Condition(function Jump__DestructableFilter), null) endif - if fh < s__Jump_colUZ[this] and not Jump___b then - set Jump___flh=fh - call GroupEnumUnitsInRange(Jump___enu, x, y, Jump___MAX_RAD, null) - call GroupRemoveUnit(Jump___enu, s__Jump_u[this]) + if fh < s__Jump_colUZ[this] and not Jump__b then + set Jump__flh=fh + call GroupEnumUnitsInRange(Jump__enu, x, y, Jump__MAX_RAD, null) + call GroupRemoveUnit(Jump__enu, s__Jump_u[this]) loop - set un=FirstOfGroup(Jump___enu) - exitwhen un == null or Jump___b + set un=FirstOfGroup(Jump__enu) + exitwhen un == null or Jump__b if IsUnitInRange(un, s__Jump_u[this], s__Jump_col[this] + 1) and not IsUnitType(un, UNIT_TYPE_DEAD) and not IsUnitType(un, UNIT_TYPE_FLYING) then - set Jump___b=true + set Jump__b=true set un=null set s__Jump_sx[this]=0 set s__Jump_sy[this]=0 set s__Jump_endX[this]=GetUnitX(s__Jump_u[this]) set s__Jump_endY[this]=GetUnitY(s__Jump_u[this]) - call GroupClear(Jump___enu) + call GroupClear(Jump__enu) else - call GroupRemoveUnit(Jump___enu, un) + call GroupRemoveUnit(Jump__enu, un) endif endloop - if not Jump___b then + if not Jump__b then call SetUnitX(s__Jump_u[this], x) call SetUnitY(s__Jump_u[this], y) endif - elseif not Jump___b then + elseif not Jump__b then call SetUnitX(s__Jump_u[this], x) call SetUnitY(s__Jump_u[this], y) else @@ -28657,7 +28627,7 @@ endfunction //Implemented from module CTLEnd: return false endfunction - function s__Jump_CTLEnd___onInit takes nothing returns nothing + function s__Jump_CTLEnd__onInit takes nothing returns nothing set s__Jump_rctl32=CTL___A(function s__Jump_ectl32) endfunction @@ -28668,14 +28638,14 @@ endfunction local real angle= Atan2(y1 - y0, x1 - x0) local real dist= SquareRoot(( x1 - x0 ) * ( x1 - x0 ) + ( y1 - y0 ) * ( y1 - y0 )) local real speed= dist / time * 0.031250000 - local real z1= Jump___GetLocZ(x1 , y1) + local real z1= Jump__GetLocZ(x1 , y1) set s__Jump_u[this]=un set s__Jump_t[this]=0 set s__Jump_endX[this]=x1 set s__Jump_endY[this]=y1 set s__Jump_g[this]=gravity - set s__Jump_z0[this]=Jump___GetLocZ(x0 , y0) + set s__Jump_z0[this]=Jump__GetLocZ(x0 , y0) set s__Jump_sx[this]=Cos(angle) * speed set s__Jump_sy[this]=Sin(angle) * speed set s__Jump_dfh[this]=GetUnitDefaultFlyHeight(un) @@ -28683,10 +28653,10 @@ endfunction - set s__Jump_col[this]=Jump___U_COL_D + set s__Jump_col[this]=Jump__U_COL_D - set s__Jump_colDD[this]=Jump___D_COL_D - set s__Jump_colUZ[this]=Jump___U_COL_Z + set s__Jump_colDD[this]=Jump__D_COL_D + set s__Jump_colUZ[this]=Jump__U_COL_Z if s__Jump_z0[this] < z1 then set maxZ=maxZ + z1 - s__Jump_z0[this] @@ -28750,20 +28720,20 @@ endfunction endfunction function s__Knockback_listRemove takes integer this returns nothing - if not s__Knockback_ListModule_List___inlist[this] then + if not s__Knockback_ListModule_List__inlist[this] then return endif - set s__Knockback_ListModule_List___inlist[this]=false + set s__Knockback_ListModule_List__inlist[this]=false set s__Knockback_next[s__Knockback_prev[this]]=s__Knockback_next[this] set s__Knockback_prev[s__Knockback_next[this]]=s__Knockback_prev[this] set s__Knockback_count=s__Knockback_count - 1 endfunction function s__Knockback_listAdd takes integer this returns nothing - if s__Knockback_ListModule_List___inlist[this] or s__Knockback_ListModule_List___destroying then + if s__Knockback_ListModule_List__inlist[this] or s__Knockback_ListModule_List__destroying then return endif - set s__Knockback_ListModule_List___inlist[this]=true + set s__Knockback_ListModule_List__inlist[this]=true set s__Knockback_next[(s__Knockback_prev[(0)])]=this // INLINED!! set s__Knockback_prev[this]=(s__Knockback_prev[(0)]) // INLINED!! set s__Knockback_prev[(0)]=this @@ -28772,13 +28742,13 @@ endfunction function s__Knockback_listDestroy takes nothing returns nothing local integer this= (s__Knockback_prev[(0)]) // INLINED!! - set s__Knockback_ListModule_List___destroying=true + set s__Knockback_ListModule_List__destroying=true loop exitwhen this == 0 call sc__Knockback_deallocate(this) set this=s__Knockback_prev[this] endloop - set s__Knockback_ListModule_List___destroying=false + set s__Knockback_ListModule_List__destroying=false endfunction @@ -29054,33 +29024,33 @@ function AddMassSpell takes integer dummyAbilityId,string dummyAbilityOrder,filt endfunction function RegisterMassSpell takes integer abilityId,integer massSpell returns nothing - call SaveInteger(MassSpell___h, abilityId, 0, massSpell) + call SaveInteger(MassSpell__h, abilityId, 0, massSpell) endfunction function GetMassSpellFilterCaster takes nothing returns unit - return MassSpell___filterCaster + return MassSpell__filterCaster endfunction function GetMassSpellFilterAbilityId takes nothing returns integer - return MassSpell___filterAbilityId + return MassSpell__filterAbilityId endfunction -function MassSpell___LoadMassSpell takes integer abilityId returns integer - return LoadInteger(MassSpell___h, abilityId, 0) +function MassSpell__LoadMassSpell takes integer abilityId returns integer + return LoadInteger(MassSpell__h, abilityId, 0) endfunction -function MassSpell___TriggerConditionMassSpell takes nothing returns boolean - local integer s= (LoadInteger(MassSpell___h, (GetSpellAbilityId()), 0)) // INLINED!! +function MassSpell__TriggerConditionMassSpell takes nothing returns boolean + local integer s= (LoadInteger(MassSpell__h, (GetSpellAbilityId()), 0)) // INLINED!! return s != 0 endfunction -function MassSpell___RemoveUnitEnum takes nothing returns nothing +function MassSpell__RemoveUnitEnum takes nothing returns nothing call h__RemoveUnit(GetEnumUnit()) endfunction -function MassSpell___TriggerActionMassSpell takes nothing returns nothing +function MassSpell__TriggerActionMassSpell takes nothing returns nothing local integer abilityId= GetSpellAbilityId() - local integer s= (LoadInteger(MassSpell___h, (abilityId), 0)) // INLINED!! + local integer s= (LoadInteger(MassSpell__h, (abilityId), 0)) // INLINED!! local group targets= CreateGroup() local group dummies= CreateGroup() local integer max= 0 @@ -29092,8 +29062,8 @@ function MassSpell___TriggerActionMassSpell takes nothing returns nothing local unit dummy= null local unit target= null local boolean hasTargets= false - set MassSpell___filterCaster=caster - set MassSpell___filterAbilityId=abilityId + set MassSpell__filterCaster=caster + set MassSpell__filterAbilityId=abilityId call GroupEnumUnitsInRange(targets, GetSpellTargetX(), GetSpellTargetY(), radius, s__MassSpell_filter[s]) set max=BlzGroupGetSize(targets) set hasTargets=max == 0 @@ -29119,7 +29089,7 @@ function MassSpell___TriggerActionMassSpell takes nothing returns nothing set targets=null if ( hasTargets ) then call TriggerSleepAction(MassSpell_DUMMY_REMOVAL_DELAY) - call ForGroup(dummies, function MassSpell___RemoveUnitEnum) + call ForGroup(dummies, function MassSpell__RemoveUnitEnum) call GroupClear(dummies) endif call DestroyGroup(dummies) @@ -29128,10 +29098,10 @@ function MassSpell___TriggerActionMassSpell takes nothing returns nothing set caster=null endfunction -function MassSpell___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(MassSpell___channelTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(MassSpell___channelTrigger, Condition(function MassSpell___TriggerConditionMassSpell)) - call TriggerAddAction(MassSpell___channelTrigger, function MassSpell___TriggerActionMassSpell) +function MassSpell__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(MassSpell__channelTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(MassSpell__channelTrigger, Condition(function MassSpell__TriggerConditionMassSpell)) + call TriggerAddAction(MassSpell__channelTrigger, function MassSpell__TriggerActionMassSpell) endfunction @@ -29140,43 +29110,43 @@ endfunction function AddNotAllowedPlayerForMindControl takes player whichPlayer returns nothing - call ForceAddPlayer(MindControl___notAllowedPlayers, whichPlayer) + call ForceAddPlayer(MindControl__notAllowedPlayers, whichPlayer) endfunction function ClearNotAllowedPlayerForMindControl takes nothing returns nothing - call ForceClear(MindControl___notAllowedPlayers) + call ForceClear(MindControl__notAllowedPlayers) endfunction -function MindControl___SharedAlliance takes player source,player target,boolean value returns nothing +function MindControl__SharedAlliance takes player source,player target,boolean value returns nothing call SetPlayerAlliance(source, target, ALLIANCE_SHARED_CONTROL, value) call SetPlayerAlliance(source, target, ALLIANCE_SHARED_ADVANCED_CONTROL, value) call SetPlayerAlliance(source, target, ALLIANCE_SHARED_SPELLS, value) endfunction -function MindControl___TimerFunctionExpire takes nothing returns nothing +function MindControl__TimerFunctionExpire takes nothing returns nothing local timer t= GetExpiredTimer() local integer handleId= GetHandleId(t) - local player owner= LoadPlayerHandle(MindControl___h, handleId, 0) - local player targetOwner= LoadPlayerHandle(MindControl___h, handleId, 1) - call MindControl___SharedAlliance(targetOwner , owner , false) + local player owner= LoadPlayerHandle(MindControl__h, handleId, 0) + local player targetOwner= LoadPlayerHandle(MindControl__h, handleId, 1) + call MindControl__SharedAlliance(targetOwner , owner , false) set owner=null set targetOwner=null call PauseTimer(t) - call FlushChildHashtable(MindControl___h, handleId) + call FlushChildHashtable(MindControl__h, handleId) call DestroyTimer(t) set t=null endfunction -function MindControl___MindControlEx takes unit caster,unit target returns nothing +function MindControl__MindControlEx takes unit caster,unit target returns nothing local player owner= GetOwningPlayer(caster) local player targetOwner= GetOwningPlayer(target) local timer t= CreateTimer() local integer handleId= GetHandleId(t) local real duration= 15.0 + I2R(GetUnitAbilityLevel(caster, MindControl_ABILITY_ID)) * 5.0 - call MindControl___SharedAlliance(targetOwner , owner , true) - call SavePlayerHandle(MindControl___h, handleId, 0, owner) - call SavePlayerHandle(MindControl___h, handleId, 1, targetOwner) - call TimerStart(t, duration, false, function MindControl___TimerFunctionExpire) + call MindControl__SharedAlliance(targetOwner , owner , true) + call SavePlayerHandle(MindControl__h, handleId, 0, owner) + call SavePlayerHandle(MindControl__h, handleId, 1, targetOwner) + call TimerStart(t, duration, false, function MindControl__TimerFunctionExpire) set owner=null set targetOwner=null endfunction @@ -29185,8 +29155,8 @@ function MindControl takes unit caster,unit target returns nothing local player owner= GetOwningPlayer(caster) local player targetOwner= GetOwningPlayer(target) if ( not IsUnitAlly(target, owner) ) then - if ( not IsPlayerInForce(targetOwner, MindControl___notAllowedPlayers) ) then - call MindControl___MindControlEx(caster , target) + if ( not IsPlayerInForce(targetOwner, MindControl__notAllowedPlayers) ) then + call MindControl__MindControlEx(caster , target) else call SimError(owner , "Owner " + GetPlayerName(targetOwner) + " is not allowed.") call IssueImmediateOrder(caster, "stop") @@ -29199,16 +29169,16 @@ function MindControl takes unit caster,unit target returns nothing set targetOwner=null endfunction -function MindControl___TriggerConditionCast takes nothing returns boolean +function MindControl__TriggerConditionCast takes nothing returns boolean if ( GetSpellAbilityId() == MindControl_ABILITY_ID ) then call MindControl(GetTriggerUnit() , GetSpellTargetUnit()) endif return false endfunction -function MindControl___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(MindControl___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(MindControl___castTrigger, Condition(function MindControl___TriggerConditionCast)) +function MindControl__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(MindControl__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(MindControl__castTrigger, Condition(function MindControl__TriggerConditionCast)) endfunction @@ -29262,12 +29232,12 @@ endfunction function s__MissileEffect__Effect_allocate takes nothing returns integer local integer this - if ( s__MissileEffect__Effect_Alloc___recycle[(0)] == 0 ) then - set s__MissileEffect__Effect_Alloc___instanceCount=s__MissileEffect__Effect_Alloc___instanceCount + 1 - set this=s__MissileEffect__Effect_Alloc___instanceCount + if ( s__MissileEffect__Effect_Alloc__recycle[(0)] == 0 ) then + set s__MissileEffect__Effect_Alloc__instanceCount=s__MissileEffect__Effect_Alloc__instanceCount + 1 + set this=s__MissileEffect__Effect_Alloc__instanceCount else - set this=s__MissileEffect__Effect_Alloc___recycle[(0)] - set s__MissileEffect__Effect_Alloc___recycle[(0)]=s__MissileEffect__Effect_Alloc___recycle[s__MissileEffect__Effect_Alloc___recycle[(0)]] + set this=s__MissileEffect__Effect_Alloc__recycle[(0)] + set s__MissileEffect__Effect_Alloc__recycle[(0)]=s__MissileEffect__Effect_Alloc__recycle[s__MissileEffect__Effect_Alloc__recycle[(0)]] endif @@ -29275,8 +29245,8 @@ endfunction endfunction function s__MissileEffect__Effect_deallocate takes integer this returns nothing - set s__MissileEffect__Effect_Alloc___recycle[this]=s__MissileEffect__Effect_Alloc___recycle[(0)] - set s__MissileEffect__Effect_Alloc___recycle[(0)]=this + set s__MissileEffect__Effect_Alloc__recycle[this]=s__MissileEffect__Effect_Alloc__recycle[(0)] + set s__MissileEffect__Effect_Alloc__recycle[(0)]=this endfunction @@ -29631,11 +29601,11 @@ endfunction function AddObjectIdBooleanFieldValue takes integer id,integer fieldId,boolean value returns nothing - call SaveBoolean(ObjectDataFields___h, id, fieldId, value) + call SaveBoolean(ObjectDataFields__h, id, fieldId, value) endfunction function GetObjectIdBooleanFieldValue takes integer id,integer fieldId returns boolean - return LoadBoolean(ObjectDataFields___h, id, fieldId) + return LoadBoolean(ObjectDataFields__h, id, fieldId) endfunction @@ -29657,7 +29627,7 @@ function AddPagedButtonsConfig takes integer id,integer heroGoldCost,integer her set s__PagedButtonsConfig_modelScale[c]=modelScale set s__PagedButtonsConfig_modelPath[c]=modelPath - call SaveInteger(PagedButtonsConfig___h, id, 0, c) + call SaveInteger(PagedButtonsConfig__h, id, 0, c) endfunction function AddPagedButtonsConfigHero takes integer id,integer heroGoldCost,integer heroLumberCost,integer stockInitialAfterStartDelay,integer stockMaximum,integer stockReplenishInterval,integer stockStartDelay,string modelPath returns nothing @@ -29671,7 +29641,7 @@ function AddPagedButtonsConfigHero takes integer id,integer heroGoldCost,integer set s__PagedButtonsConfig_modelY[c]=0.26 set s__PagedButtonsConfig_modelScale[c]=0.0002 set s__PagedButtonsConfig_modelPath[c]=modelPath - call SaveInteger(PagedButtonsConfig___h, id, 0, c) + call SaveInteger(PagedButtonsConfig__h, id, 0, c) endfunction function AddPagedButtonsConfigUnit takes integer id,integer stockInitialAfterStartDelay,integer stockMaximum,integer stockReplenishInterval,integer stockStartDelay,string modelPath returns nothing @@ -29685,7 +29655,7 @@ function AddPagedButtonsConfigUnit takes integer id,integer stockInitialAfterSta set s__PagedButtonsConfig_modelY[c]=0.26 set s__PagedButtonsConfig_modelScale[c]=0.0002 set s__PagedButtonsConfig_modelPath[c]=modelPath - call SaveInteger(PagedButtonsConfig___h, id, 0, c) + call SaveInteger(PagedButtonsConfig__h, id, 0, c) endfunction function AddPagedButtonsConfigItem takes integer id,integer stockInitialAfterStartDelay,integer stockMaximum,integer stockReplenishInterval,integer stockStartDelay returns nothing @@ -29700,13 +29670,13 @@ function AddPagedButtonsConfigItem takes integer id,integer stockInitialAfterSta set s__PagedButtonsConfig_modelY[c]=0.26 set s__PagedButtonsConfig_modelScale[c]=0.0007 set s__PagedButtonsConfig_modelPath[c]=GetItemTypeModel(id) - call SaveInteger(PagedButtonsConfig___h, id, 0, c) + call SaveInteger(PagedButtonsConfig__h, id, 0, c) endfunction function GetPagedButtonsConfig takes integer id returns integer - local integer c= LoadInteger(PagedButtonsConfig___h, id, 0) + local integer c= LoadInteger(PagedButtonsConfig__h, id, 0) if ( c == 0 ) then - return LoadInteger(PagedButtonsConfig___h, 0, 0) // 0 is the default config + return LoadInteger(PagedButtonsConfig__h, 0, 0) // 0 is the default config endif return c endfunction @@ -29717,7 +29687,7 @@ function SetPagedButtonsConfigHeroCostsDefault takes integer heroGoldCost,intege set s__PagedButtonsConfig_heroLumberCost[c]=heroLumberCost endfunction -function PagedButtonsConfig___Init takes nothing returns nothing +function PagedButtonsConfig__Init takes nothing returns nothing // Default config which is used if the user does not register any for ID 0. call AddPagedButtonsConfig(0 , 0 , 0 , 1 , 1 , 0 , 0 , 0.0 , 0.0 , 0.0 , "") endfunction @@ -29957,42 +29927,42 @@ function GetPlayerNameColored takes player whichPlayer returns string endfunction -function PlayerColorUtils___Init takes nothing returns nothing - set PlayerColorUtils___PlayerColorNames[0]="RED" - set PlayerColorUtils___PlayerColorNames[1]="BLUE" - set PlayerColorUtils___PlayerColorNames[2]="CYAN" - set PlayerColorUtils___PlayerColorNames[3]="PURPLE" - set PlayerColorUtils___PlayerColorNames[4]="YELLOW" - set PlayerColorUtils___PlayerColorNames[5]="ORANGE" - set PlayerColorUtils___PlayerColorNames[6]="GREEN" - set PlayerColorUtils___PlayerColorNames[7]="PINK" - set PlayerColorUtils___PlayerColorNames[8]="LIGHT_GRAY" - set PlayerColorUtils___PlayerColorNames[9]="LIGHT_BLUE" - set PlayerColorUtils___PlayerColorNames[10]="AQUA" - set PlayerColorUtils___PlayerColorNames[11]="BROWN" - set PlayerColorUtils___PlayerColorNames[12]="MAROON" - set PlayerColorUtils___PlayerColorNames[13]="NAVY" - set PlayerColorUtils___PlayerColorNames[14]="TURQUOISE" - set PlayerColorUtils___PlayerColorNames[15]="VIOLET" - set PlayerColorUtils___PlayerColorNames[16]="WHEAT" - set PlayerColorUtils___PlayerColorNames[17]="PEACH" - set PlayerColorUtils___PlayerColorNames[18]="MINT" - set PlayerColorUtils___PlayerColorNames[19]="LAVENDER" - set PlayerColorUtils___PlayerColorNames[20]="COAL" - set PlayerColorUtils___PlayerColorNames[21]="SNOW" - set PlayerColorUtils___PlayerColorNames[22]="EMERALD" - set PlayerColorUtils___PlayerColorNames[23]="PEANUT" +function PlayerColorUtils__Init takes nothing returns nothing + set PlayerColorUtils__PlayerColorNames[0]="RED" + set PlayerColorUtils__PlayerColorNames[1]="BLUE" + set PlayerColorUtils__PlayerColorNames[2]="CYAN" + set PlayerColorUtils__PlayerColorNames[3]="PURPLE" + set PlayerColorUtils__PlayerColorNames[4]="YELLOW" + set PlayerColorUtils__PlayerColorNames[5]="ORANGE" + set PlayerColorUtils__PlayerColorNames[6]="GREEN" + set PlayerColorUtils__PlayerColorNames[7]="PINK" + set PlayerColorUtils__PlayerColorNames[8]="LIGHT_GRAY" + set PlayerColorUtils__PlayerColorNames[9]="LIGHT_BLUE" + set PlayerColorUtils__PlayerColorNames[10]="AQUA" + set PlayerColorUtils__PlayerColorNames[11]="BROWN" + set PlayerColorUtils__PlayerColorNames[12]="MAROON" + set PlayerColorUtils__PlayerColorNames[13]="NAVY" + set PlayerColorUtils__PlayerColorNames[14]="TURQUOISE" + set PlayerColorUtils__PlayerColorNames[15]="VIOLET" + set PlayerColorUtils__PlayerColorNames[16]="WHEAT" + set PlayerColorUtils__PlayerColorNames[17]="PEACH" + set PlayerColorUtils__PlayerColorNames[18]="MINT" + set PlayerColorUtils__PlayerColorNames[19]="LAVENDER" + set PlayerColorUtils__PlayerColorNames[20]="COAL" + set PlayerColorUtils__PlayerColorNames[21]="SNOW" + set PlayerColorUtils__PlayerColorNames[22]="EMERALD" + set PlayerColorUtils__PlayerColorNames[23]="PEANUT" endfunction function GetPlayerColorName takes player whichPlayer returns string - return StringCase(PlayerColorUtils___PlayerColorNames[GetPlayerId(whichPlayer)], false) + return StringCase(PlayerColorUtils__PlayerColorNames[GetPlayerId(whichPlayer)], false) endfunction function GetPlayerColorFromString takes string whichString returns playercolor local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) - if ( whichString == I2S(i + 1) or ( PlayerColorUtils___PlayerColorNames[i] != null and StringLength(PlayerColorUtils___PlayerColorNames[i]) > 0 and StringCase(whichString, true) == PlayerColorUtils___PlayerColorNames[i] ) or StringStartsWith(GetPlayerName(Player(i)) , whichString) ) then + if ( whichString == I2S(i + 1) or ( PlayerColorUtils__PlayerColorNames[i] != null and StringLength(PlayerColorUtils__PlayerColorNames[i]) > 0 and StringCase(whichString, true) == PlayerColorUtils__PlayerColorNames[i] ) or StringStartsWith(GetPlayerName(Player(i)) , whichString) ) then return ConvertPlayerColor(i) endif set i=i + 1 @@ -30005,7 +29975,7 @@ function GetPlayerFromString takes string whichString returns player local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) - if ( whichString == I2S(i + 1) or ( PlayerColorUtils___PlayerColorNames[i] != null and StringLength(PlayerColorUtils___PlayerColorNames[i]) > 0 and StringCase(whichString, true) == PlayerColorUtils___PlayerColorNames[i] ) or StringStartsWith(GetPlayerName(Player(i)) , whichString) ) then + if ( whichString == I2S(i + 1) or ( PlayerColorUtils__PlayerColorNames[i] != null and StringLength(PlayerColorUtils__PlayerColorNames[i]) > 0 and StringCase(whichString, true) == PlayerColorUtils__PlayerColorNames[i] ) or StringStartsWith(GetPlayerName(Player(i)) , whichString) ) then return Player(i) endif set i=i + 1 @@ -30031,28 +30001,28 @@ endfunction //Implemented from module PluginSpellEffect__Event: - function s__Spell_PluginSpellEffect__Event___GetUnitZ takes unit u returns real + function s__Spell_PluginSpellEffect__Event__GetUnitZ takes unit u returns real call MoveLocation(s__Spell_location, GetUnitX(u), GetUnitY(u)) return GetUnitFlyHeight(u) + GetLocationZ(s__Spell_location) endfunction - function s__Spell_PluginSpellEffect__Event___GetSpellTargetZ takes nothing returns real + function s__Spell_PluginSpellEffect__Event__GetSpellTargetZ takes nothing returns real call MoveLocation(s__Spell_location, s__Spell_x, s__Spell_y) if s__PluginSpellEffect__SUnit_unit[s__Spell_target] != null then - return s__Spell_PluginSpellEffect__Event___GetUnitZ(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) + return s__Spell_PluginSpellEffect__Event__GetUnitZ(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) else return GetLocationZ(s__Spell_location) endif endfunction - function s__Spell_PluginSpellEffect__Event___onCast takes nothing returns nothing + function s__Spell_PluginSpellEffect__Event__onCast takes nothing returns nothing set s__PluginSpellEffect__SUnit_unit[s__Spell_source]=GetTriggerUnit() set s__PluginSpellEffect__SUnit_player[s__Spell_source]=GetOwningPlayer(s__PluginSpellEffect__SUnit_unit[s__Spell_source]) set s__PluginSpellEffect__SUnit_handle[s__Spell_source]=GetHandleId(s__PluginSpellEffect__SUnit_unit[s__Spell_source]) set s__PluginSpellEffect__SUnit_id[s__Spell_source]=GetUnitUserData(s__PluginSpellEffect__SUnit_unit[s__Spell_source]) set s__PluginSpellEffect__SUnit_x[s__Spell_source]=GetUnitX(s__PluginSpellEffect__SUnit_unit[s__Spell_source]) set s__PluginSpellEffect__SUnit_y[s__Spell_source]=GetUnitY(s__PluginSpellEffect__SUnit_unit[s__Spell_source]) - set s__PluginSpellEffect__SUnit_z[s__Spell_source]=s__Spell_PluginSpellEffect__Event___GetUnitZ(s__PluginSpellEffect__SUnit_unit[s__Spell_source]) + set s__PluginSpellEffect__SUnit_z[s__Spell_source]=s__Spell_PluginSpellEffect__Event__GetUnitZ(s__PluginSpellEffect__SUnit_unit[s__Spell_source]) set s__PluginSpellEffect__SUnit_isHero[s__Spell_source]=IsUnitType(s__PluginSpellEffect__SUnit_unit[s__Spell_source], UNIT_TYPE_HERO) set s__PluginSpellEffect__SUnit_isStructure[s__Spell_source]=IsUnitType(s__PluginSpellEffect__SUnit_unit[s__Spell_source], UNIT_TYPE_STRUCTURE) @@ -30062,42 +30032,42 @@ endfunction set s__PluginSpellEffect__SUnit_id[s__Spell_target]=GetUnitUserData(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) set s__PluginSpellEffect__SUnit_x[s__Spell_target]=GetUnitX(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) set s__PluginSpellEffect__SUnit_y[s__Spell_target]=GetUnitY(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) - set s__PluginSpellEffect__SUnit_z[s__Spell_target]=s__Spell_PluginSpellEffect__Event___GetUnitZ(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) + set s__PluginSpellEffect__SUnit_z[s__Spell_target]=s__Spell_PluginSpellEffect__Event__GetUnitZ(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) set s__PluginSpellEffect__SUnit_isHero[s__Spell_target]=IsUnitType(s__PluginSpellEffect__SUnit_unit[s__Spell_target], UNIT_TYPE_HERO) set s__PluginSpellEffect__SUnit_isStructure[s__Spell_target]=IsUnitType(s__PluginSpellEffect__SUnit_unit[s__Spell_target], UNIT_TYPE_STRUCTURE) set s__Spell_x=GetSpellTargetX() set s__Spell_y=GetSpellTargetY() - set s__Spell_z=s__Spell_PluginSpellEffect__Event___GetSpellTargetZ() + set s__Spell_z=s__Spell_PluginSpellEffect__Event__GetSpellTargetZ() set s__Spell_id=GetSpellAbilityId() set s__Spell_level=GetUnitAbilityLevel(s__PluginSpellEffect__SUnit_unit[s__Spell_source], s__Spell_id) set s__Spell_ability=BlzGetUnitAbility(s__PluginSpellEffect__SUnit_unit[s__Spell_source], s__Spell_id) endfunction - function s__Spell_PluginSpellEffect__Event___onInit takes nothing returns nothing + function s__Spell_PluginSpellEffect__Event__onInit takes nothing returns nothing set s__Spell_source=(s__PluginSpellEffect__SUnit__allocate()) // INLINED!! set s__Spell_target=(s__PluginSpellEffect__SUnit__allocate()) // INLINED!! - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT , function s__Spell_PluginSpellEffect__Event___onCast) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT , function s__Spell_PluginSpellEffect__Event__onCast) endfunction //library PluginSpellEffect ends //library ReduceFood: -function ReduceFood___EnableFoodCost takes unit target returns nothing - local timer t= LoadTimerHandle(ReduceFood___h, GetHandleId(target), 0) +function ReduceFood__EnableFoodCost takes unit target returns nothing + local timer t= LoadTimerHandle(ReduceFood__h, GetHandleId(target), 0) call SetUnitUseFood(target, true) - call GroupRemoveUnit(ReduceFood___targets, target) + call GroupRemoveUnit(ReduceFood__targets, target) call UnitRemoveAbility(target, ReduceFood_BUFF_ABILITY_ID) - call FlushChildHashtable(ReduceFood___h, GetHandleId(t)) + call FlushChildHashtable(ReduceFood__h, GetHandleId(t)) call PauseTimer(t) call DestroyTimer(t) - call FlushChildHashtable(ReduceFood___h, GetHandleId(target)) + call FlushChildHashtable(ReduceFood__h, GetHandleId(target)) endfunction -function ReduceFood___TimerFunctionEnableFoodCost takes nothing returns nothing - call ReduceFood___EnableFoodCost(LoadUnitHandle(ReduceFood___h, GetHandleId(GetExpiredTimer()), 0)) +function ReduceFood__TimerFunctionEnableFoodCost takes nothing returns nothing + call ReduceFood__EnableFoodCost(LoadUnitHandle(ReduceFood__h, GetHandleId(GetExpiredTimer()), 0)) endfunction function ReduceFood takes unit caster,integer abilityId,unit target returns nothing @@ -30108,18 +30078,18 @@ function ReduceFood takes unit caster,integer abilityId,unit target returns noth if ( GetUnitFoodUsed(target) <= maxFoodCost ) then call SetUnitUseFood(target, false) - if ( not IsUnitInGroup(target, ReduceFood___targets) ) then - call GroupAddUnit(ReduceFood___targets, target) + if ( not IsUnitInGroup(target, ReduceFood__targets) ) then + call GroupAddUnit(ReduceFood__targets, target) call UnitAddAbility(target, ReduceFood_BUFF_ABILITY_ID) set t=CreateTimer() - call SaveTimerHandle(ReduceFood___h, GetHandleId(target), 0, t) - call SaveUnitHandle(ReduceFood___h, GetHandleId(t), 0, target) + call SaveTimerHandle(ReduceFood__h, GetHandleId(target), 0, t) + call SaveUnitHandle(ReduceFood__h, GetHandleId(t), 0, target) else - set t=LoadTimerHandle(ReduceFood___h, GetHandleId(target), 0) + set t=LoadTimerHandle(ReduceFood__h, GetHandleId(target), 0) call PauseTimer(t) endif - call TimerStart(t, 40.0 + ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 5.0 ), false, function ReduceFood___TimerFunctionEnableFoodCost) + call TimerStart(t, 40.0 + ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 5.0 ), false, function ReduceFood__TimerFunctionEnableFoodCost) else call IssueImmediateOrder(caster, "stop") call SimError(owner , "Maximum food cost of target is too high.") @@ -30127,7 +30097,7 @@ function ReduceFood takes unit caster,integer abilityId,unit target returns noth else if ( not IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) ) then if ( GetUnitAbilityLevel(target, ReduceFood_BUFF_ABILITY_ID) > 0 ) then - call ReduceFood___EnableFoodCost(target) + call ReduceFood__EnableFoodCost(target) else call IssueImmediateOrder(caster, "stop") call SimError(owner , "Target has no disabled food cost.") @@ -30151,7 +30121,7 @@ endfunction //Implemented from module RegisterNativeEvent__NativeEventInit: - function s__RegisterNativeEvent__NativeEvent_RegisterNativeEvent__NativeEventInit___onInit takes nothing returns nothing + function s__RegisterNativeEvent__NativeEvent_RegisterNativeEvent__NativeEventInit__onInit takes nothing returns nothing set s__RegisterNativeEvent__NativeEvent_table=s__TableArray__staticgetindex(0x2000) @@ -31751,7 +31721,7 @@ endfunction endfunction - function s__SpellEffectEvent__S_SpellEffectEvent__M___onInit takes nothing returns nothing + function s__SpellEffectEvent__S_SpellEffectEvent__M__onInit takes nothing returns nothing set s__SpellEffectEvent__S_tb=s__Table_create() @@ -31849,19 +31819,19 @@ endfunction //library Stupidity: -function Stupidity___EnableGainingXP takes unit target returns nothing - local timer t= LoadTimerHandle(Stupidity___h, GetHandleId(target), 0) +function Stupidity__EnableGainingXP takes unit target returns nothing + local timer t= LoadTimerHandle(Stupidity__h, GetHandleId(target), 0) call SuspendHeroXP(target, false) - call GroupRemoveUnit(Stupidity___targets, target) + call GroupRemoveUnit(Stupidity__targets, target) call UnitRemoveAbility(target, Stupidity_BUFF_ABILITY_ID) - call FlushChildHashtable(Stupidity___h, GetHandleId(t)) + call FlushChildHashtable(Stupidity__h, GetHandleId(t)) call PauseTimer(t) call DestroyTimer(t) - call FlushChildHashtable(Stupidity___h, GetHandleId(target)) + call FlushChildHashtable(Stupidity__h, GetHandleId(target)) endfunction -function Stupidity___TimerFunctionEnableGainingXP takes nothing returns nothing - call Stupidity___EnableGainingXP(LoadUnitHandle(Stupidity___h, GetHandleId(GetExpiredTimer()), 0)) +function Stupidity__TimerFunctionEnableGainingXP takes nothing returns nothing + call Stupidity__EnableGainingXP(LoadUnitHandle(Stupidity__h, GetHandleId(GetExpiredTimer()), 0)) endfunction function Stupidity takes unit caster,integer abilityId,unit target returns nothing @@ -31873,18 +31843,18 @@ function Stupidity takes unit caster,integer abilityId,unit target returns nothi if ( not IsSuspendedXP(target) ) then call SuspendHeroXP(target, true) - if ( not IsUnitInGroup(target, Stupidity___targets) ) then - call GroupAddUnit(Stupidity___targets, target) + if ( not IsUnitInGroup(target, Stupidity__targets) ) then + call GroupAddUnit(Stupidity__targets, target) call UnitAddAbility(target, Stupidity_BUFF_ABILITY_ID) set t=CreateTimer() - call SaveTimerHandle(Stupidity___h, GetHandleId(target), 0, t) - call SaveUnitHandle(Stupidity___h, GetHandleId(t), 0, target) + call SaveTimerHandle(Stupidity__h, GetHandleId(target), 0, t) + call SaveUnitHandle(Stupidity__h, GetHandleId(t), 0, target) else - set t=LoadTimerHandle(Stupidity___h, GetHandleId(target), 0) + set t=LoadTimerHandle(Stupidity__h, GetHandleId(target), 0) call PauseTimer(t) endif - call TimerStart(t, 5.0 * ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 5.0 ), false, function Stupidity___TimerFunctionEnableGainingXP) + call TimerStart(t, 5.0 * ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 5.0 ), false, function Stupidity__TimerFunctionEnableGainingXP) else call IssueImmediateOrder(caster, "stop") call SimError(owner , "Target has disabled gaining XP.") @@ -31990,12 +31960,12 @@ endfunction function s__Tenacity__List_allocate takes nothing returns integer local integer this - if ( s__Tenacity__List_Alloc___recycle[(0)] == 0 ) then - set s__Tenacity__List_Alloc___instanceCount=s__Tenacity__List_Alloc___instanceCount + 1 - set this=s__Tenacity__List_Alloc___instanceCount + if ( s__Tenacity__List_Alloc__recycle[(0)] == 0 ) then + set s__Tenacity__List_Alloc__instanceCount=s__Tenacity__List_Alloc__instanceCount + 1 + set this=s__Tenacity__List_Alloc__instanceCount else - set this=s__Tenacity__List_Alloc___recycle[(0)] - set s__Tenacity__List_Alloc___recycle[(0)]=s__Tenacity__List_Alloc___recycle[s__Tenacity__List_Alloc___recycle[(0)]] + set this=s__Tenacity__List_Alloc__recycle[(0)] + set s__Tenacity__List_Alloc__recycle[(0)]=s__Tenacity__List_Alloc__recycle[s__Tenacity__List_Alloc__recycle[(0)]] endif @@ -32003,8 +31973,8 @@ endfunction endfunction function s__Tenacity__List_deallocate takes integer this returns nothing - set s__Tenacity__List_Alloc___recycle[this]=s__Tenacity__List_Alloc___recycle[(0)] - set s__Tenacity__List_Alloc___recycle[(0)]=this + set s__Tenacity__List_Alloc__recycle[this]=s__Tenacity__List_Alloc__recycle[(0)] + set s__Tenacity__List_Alloc__recycle[(0)]=this endfunction //Implemented from module Tenacity__ListModule: @@ -33682,7 +33652,7 @@ endfunction //Implemented from module TurretSystem__Init: - function s__TurretSystem__S_TurretSystem__Init___onInit takes nothing returns nothing + function s__TurretSystem__S_TurretSystem__Init__onInit takes nothing returns nothing call TriggerRegisterAnyUnitEventBJ(TurretSystem__TurretSystemAttackTrigger, EVENT_PLAYER_UNIT_ATTACKED) call TriggerAddCondition(TurretSystem__TurretSystemAttackTrigger, Condition(function TurretSystem__TurretSystemTriggerConditionAttack)) call TriggerAddAction(TurretSystem__TurretSystemAttackTrigger, function TurretSystem__TurretSystemTriggerActionAttack) @@ -33748,23 +33718,23 @@ endfunction endfunction function RegisterUnitIndexEvent takes boolexpr func,integer eventtype returns triggercondition - return TriggerAddCondition(UnitDex___IndexTrig[eventtype], func) + return TriggerAddCondition(UnitDex__IndexTrig[eventtype], func) endfunction function RemoveUnitIndexEvent takes triggercondition c,integer eventtype returns nothing - call TriggerRemoveCondition(UnitDex___IndexTrig[eventtype], c) + call TriggerRemoveCondition(UnitDex__IndexTrig[eventtype], c) endfunction function TriggerRegisterUnitIndexEvent takes trigger t,integer eventtype returns nothing - call TriggerRegisterVariableEvent(t, "UnitDex___E", EQUAL, eventtype) + call TriggerRegisterVariableEvent(t, "UnitDex__E", EQUAL, eventtype) endfunction function OnUnitIndex takes code func returns triggercondition - return TriggerAddCondition(UnitDex___IndexTrig[EVENT_UNIT_INDEX], Filter(func)) + return TriggerAddCondition(UnitDex__IndexTrig[EVENT_UNIT_INDEX], Filter(func)) endfunction function OnUnitDeindex takes code func returns triggercondition - return TriggerAddCondition(UnitDex___IndexTrig[EVENT_UNIT_DEINDEX], Filter(func)) + return TriggerAddCondition(UnitDex__IndexTrig[EVENT_UNIT_DEINDEX], Filter(func)) endfunction @@ -33772,7 +33742,7 @@ endfunction -//Implemented from module UnitDex___UnitDexConfig: +//Implemented from module UnitDex__UnitDexConfig: // The raw code of the leave detection ability. //static constant integer DETECT_LEAVE_ABILITY = 'uDex' @@ -33786,24 +33756,24 @@ endfunction -//Implemented from module UnitDex___UnitDexCore: +//Implemented from module UnitDex__UnitDexCore: function s__UnitDex_Remove takes unit u,boolean runEvents returns boolean local integer i if ( ((s__UnitDex_Unit[((GetUnitUserData(((u)))))]) != null) ) then // INLINED!! set i=(GetUnitUserData((u))) // INLINED!! - set s__UnitDex_List[i]=UnitDex___Index - set UnitDex___Index=i + set s__UnitDex_List[i]=UnitDex__Index + set UnitDex__Index=i call GroupRemoveUnit(s__UnitDex_Group, u) call SetUnitUserData(u, 0) if ( runEvents ) then set s__UnitDex_LastIndex=i - set UnitDex___E=EVENT_UNIT_DEINDEX - call TriggerEvaluate(UnitDex___IndexTrig[EVENT_UNIT_DEINDEX]) - set UnitDex___E=- 1 + set UnitDex__E=EVENT_UNIT_DEINDEX + call TriggerEvaluate(UnitDex__IndexTrig[EVENT_UNIT_DEINDEX]) + set UnitDex__E=- 1 endif set s__UnitDex_Unit[i]=null @@ -33815,7 +33785,7 @@ endfunction return false endfunction - function s__UnitDex_UnitDex___UnitDexCore___onGameStart takes nothing returns nothing + function s__UnitDex_UnitDex__UnitDexCore__onGameStart takes nothing returns nothing local integer i= 1 loop @@ -33823,24 +33793,24 @@ endfunction set s__UnitDex_LastIndex=i - call TriggerEvaluate(UnitDex___IndexTrig[EVENT_UNIT_INDEX]) - set UnitDex___E=EVENT_UNIT_INDEX - set UnitDex___E=- 1 + call TriggerEvaluate(UnitDex__IndexTrig[EVENT_UNIT_INDEX]) + set UnitDex__E=EVENT_UNIT_INDEX + set UnitDex__E=- 1 set i=i + 1 endloop set s__UnitDex_LastIndex=s__UnitDex_Counter set s__UnitDex_Initialized=true - set UnitDex___FilterEnter=null + set UnitDex__FilterEnter=null call DestroyTimer(GetExpiredTimer()) endfunction - function s__UnitDex_UnitDex___UnitDexCore___onEnter takes nothing returns boolean + function s__UnitDex_UnitDex__UnitDexCore__onEnter takes nothing returns boolean local unit u= GetFilterUnit() local integer i= (GetUnitUserData((u))) // INLINED!! - local integer t= UnitDex___Index + local integer t= UnitDex__Index if ( i == 0 and s__UnitDex_Enabled ) then @@ -33869,8 +33839,8 @@ endfunction call UnitMakeAbilityPermanent(u, true, s__UnitDex_DETECT_LEAVE_ABILITY) // Allocate index - if ( UnitDex___Index != 0 ) then - set UnitDex___Index=s__UnitDex_List[t] + if ( UnitDex__Index != 0 ) then + set UnitDex__Index=s__UnitDex_List[t] else set s__UnitDex_Counter=s__UnitDex_Counter + 1 set t=s__UnitDex_Counter @@ -33886,13 +33856,13 @@ endfunction if ( s__UnitDex_Initialized ) then // Execute custom events registered with RegisterUnitIndexEvent - call TriggerEvaluate(UnitDex___IndexTrig[EVENT_UNIT_INDEX]) + call TriggerEvaluate(UnitDex__IndexTrig[EVENT_UNIT_INDEX]) // Handle TriggerRegisterUnitIndexEvent - set UnitDex___E=EVENT_UNIT_INDEX + set UnitDex__E=EVENT_UNIT_INDEX // Reset so the event can occur again - set UnitDex___E=- 1 + set UnitDex__E=- 1 endif endif @@ -33901,7 +33871,7 @@ endfunction return false endfunction - function s__UnitDex_UnitDex___UnitDexCore___onLeave takes nothing returns boolean + function s__UnitDex_UnitDex__UnitDexCore__onLeave takes nothing returns boolean local unit u local integer i @@ -33922,18 +33892,18 @@ endfunction if ( i > 0 and i <= s__UnitDex_Counter and u == (s__UnitDex_Unit[(i)]) ) then // INLINED!! // Recycle the index - set s__UnitDex_List[i]=UnitDex___Index - set UnitDex___Index=i + set s__UnitDex_List[i]=UnitDex__Index + set UnitDex__Index=i set s__UnitDex_LastIndex=i // Remove to group of indexed units call GroupRemoveUnit(s__UnitDex_Group, u) // Execute custom events without any associated triggers - call TriggerEvaluate(UnitDex___IndexTrig[EVENT_UNIT_DEINDEX]) + call TriggerEvaluate(UnitDex__IndexTrig[EVENT_UNIT_DEINDEX]) // Handle TriggerRegisterUnitIndexEvent - set UnitDex___E=EVENT_UNIT_DEINDEX + set UnitDex__E=EVENT_UNIT_DEINDEX // Remove entry call SetUnitUserData(u, 0) @@ -33943,7 +33913,7 @@ endfunction set s__UnitDex_Count=s__UnitDex_Count - 1 // Reset so the event can occur again - set UnitDex___E=- 1 + set UnitDex__E=- 1 endif set u=null @@ -33952,7 +33922,7 @@ endfunction return false endfunction - function s__UnitDex_UnitDex___UnitDexCore___onInit takes nothing returns nothing + function s__UnitDex_UnitDex__UnitDexCore__onInit takes nothing returns nothing local trigger t= CreateTrigger() local integer i= 0 local player p @@ -33967,11 +33937,11 @@ endfunction - set UnitDex___FilterEnter=Filter(function s__UnitDex_UnitDex___UnitDexCore___onEnter) + set UnitDex__FilterEnter=Filter(function s__UnitDex_UnitDex__UnitDexCore__onEnter) // Begin to index units when they enter the map - call TriggerRegisterEnterRegion(CreateTrigger(), s__WorldBounds_worldRegion, UnitDex___FilterEnter) + call TriggerRegisterEnterRegion(CreateTrigger(), s__WorldBounds_worldRegion, UnitDex__FilterEnter) @@ -33979,10 +33949,10 @@ endfunction - call TriggerAddCondition(t, Filter(function s__UnitDex_UnitDex___UnitDexCore___onLeave)) + call TriggerAddCondition(t, Filter(function s__UnitDex_UnitDex__UnitDexCore__onLeave)) - set UnitDex___IndexTrig[EVENT_UNIT_INDEX]=CreateTrigger() - set UnitDex___IndexTrig[EVENT_UNIT_DEINDEX]=CreateTrigger() + set UnitDex__IndexTrig[EVENT_UNIT_INDEX]=CreateTrigger() + set UnitDex__IndexTrig[EVENT_UNIT_DEINDEX]=CreateTrigger() loop set p=Player(i) @@ -34000,7 +33970,7 @@ endfunction // Index preplaced units set i=0 loop - call GroupEnumUnitsOfPlayer(ENUM_GROUP, Player(i), UnitDex___FilterEnter) + call GroupEnumUnitsOfPlayer(ENUM_GROUP, Player(i), UnitDex__FilterEnter) set i=i + 1 @@ -34015,7 +33985,7 @@ endfunction set s__UnitDex_LastIndex=s__UnitDex_Counter // run init triggers - call TimerStart(CreateTimer(), 0.00, false, function s__UnitDex_UnitDex___UnitDexCore___onGameStart) + call TimerStart(CreateTimer(), 0.00, false, function s__UnitDex_UnitDex__UnitDexCore__onGameStart) endfunction @@ -34032,7 +34002,7 @@ endfunction -function UnitGroupRespawnSystemConfig___GetUnitLevelByTypeEx takes integer unitTypeId returns integer +function UnitGroupRespawnSystemConfig__GetUnitLevelByTypeEx takes integer unitTypeId returns integer local unit dummy= CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), unitTypeId, 0.0, 0.0, 0.0) local integer result= BlzGetUnitIntegerField(dummy, UNIT_IF_LEVEL) call h__RemoveUnit(dummy) @@ -34040,23 +34010,23 @@ function UnitGroupRespawnSystemConfig___GetUnitLevelByTypeEx takes integer unitT return result endfunction -function UnitGroupRespawnSystemConfig___GetUnitLevelByType takes integer unitTypeId returns integer - local boolean cached= HaveSavedInteger(UnitGroupRespawnSystemConfig___respawnUnitLevelsHashTable, unitTypeId, 0) +function UnitGroupRespawnSystemConfig__GetUnitLevelByType takes integer unitTypeId returns integer + local boolean cached= HaveSavedInteger(UnitGroupRespawnSystemConfig__respawnUnitLevelsHashTable, unitTypeId, 0) if ( cached ) then - return LoadInteger(UnitGroupRespawnSystemConfig___respawnUnitLevelsHashTable, unitTypeId, 0) + return LoadInteger(UnitGroupRespawnSystemConfig__respawnUnitLevelsHashTable, unitTypeId, 0) endif - return UnitGroupRespawnSystemConfig___GetUnitLevelByTypeEx(unitTypeId) + return UnitGroupRespawnSystemConfig__GetUnitLevelByTypeEx(unitTypeId) endfunction -function UnitGroupRespawnSystemConfig___GetMaxUnitLevelFromGroup takes group whichGroup returns integer +function UnitGroupRespawnSystemConfig__GetMaxUnitLevelFromGroup takes group whichGroup returns integer local integer maxLevel= 0 local integer unitLevel= 0 local integer i= 0 loop exitwhen ( i == BlzGroupGetSize(whichGroup) ) - set unitLevel=UnitGroupRespawnSystemConfig___GetUnitLevelByType(GetUnitTypeId(BlzGroupUnitAt(whichGroup, i))) + set unitLevel=UnitGroupRespawnSystemConfig__GetUnitLevelByType(GetUnitTypeId(BlzGroupUnitAt(whichGroup, i))) @@ -34066,8 +34036,8 @@ function UnitGroupRespawnSystemConfig___GetMaxUnitLevelFromGroup takes group whi return maxLevel endfunction -function UnitGroupRespawnSystemConfig___DropItem takes unit dyingUnit,group whichGroup returns nothing - local integer unitLevel= UnitGroupRespawnSystemConfig___GetMaxUnitLevelFromGroup(whichGroup) +function UnitGroupRespawnSystemConfig__DropItem takes unit dyingUnit,group whichGroup returns nothing + local integer unitLevel= UnitGroupRespawnSystemConfig__GetMaxUnitLevelFromGroup(whichGroup) local integer itemLevel= unitLevel local integer chance= GetRandomInt(0, 100) // 40 percent chance to drop an item with level above or below @@ -34094,13 +34064,13 @@ function UnitGroupRespawnSystemConfig___DropItem takes unit dyingUnit,group whic endif endfunction -function UnitGroupRespawnSystemConfig___DropItemForGroupEx takes integer groupIndex,unit dyingUnit,group whichGroup returns nothing - local integer unitLevel= UnitGroupRespawnSystemConfig___GetMaxUnitLevelFromGroup(whichGroup) +function UnitGroupRespawnSystemConfig__DropItemForGroupEx takes integer groupIndex,unit dyingUnit,group whichGroup returns nothing + local integer unitLevel= UnitGroupRespawnSystemConfig__GetMaxUnitLevelFromGroup(whichGroup) local integer chanceToDrop= GetRandomInt(0, 1) // 50 percent chance to drop an item at all if ( chanceToDrop == 0 ) then - call UnitGroupRespawnSystemConfig___DropItem(dyingUnit , whichGroup) + call UnitGroupRespawnSystemConfig__DropItem(dyingUnit , whichGroup) endif endfunction @@ -34108,13 +34078,13 @@ function UnitGroupRespawnSystemConfig_DropItemForGroup takes integer groupIndex, local integer unitTypeId= GetUnitTypeId(dyingUnit) if ( drop and unitTypeId != FLOTSAM and not IsCritter(unitTypeId) ) then - call UnitGroupRespawnSystemConfig___DropItemForGroupEx(groupIndex , dyingUnit , whichGroup) + call UnitGroupRespawnSystemConfig__DropItemForGroupEx(groupIndex , dyingUnit , whichGroup) endif endfunction -function UnitGroupRespawnSystemConfig___FilterFunctionNoLegendaryArtifact takes nothing returns boolean +function UnitGroupRespawnSystemConfig__FilterFunctionNoLegendaryArtifact takes nothing returns boolean local unit filterUnit= GetFilterUnit() local integer unitTypeId= GetUnitTypeId(filterUnit) local boolean result= IsPlayerInForce(GetOwningPlayer(filterUnit), UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_PLAYERS) and unitTypeId != LEGENDARY_ARTIFACT and unitTypeId != RANDOM_MINE and unitTypeId != RANDOM_WATER_MINE and unitTypeId != CRATES_0 and unitTypeId != CRATES_1 @@ -34124,13 +34094,13 @@ endfunction // Redefine this function to add different preplaced creeps. function UnitGroupRespawnSystemConfig_AddAllUserSpecifiedPreplacedCreeps takes group allCreeps returns nothing - call GroupEnumUnitsInRect(allCreeps, GetPlayableMapRect(), Filter(function UnitGroupRespawnSystemConfig___FilterFunctionNoLegendaryArtifact)) + call GroupEnumUnitsInRect(allCreeps, GetPlayableMapRect(), Filter(function UnitGroupRespawnSystemConfig__FilterFunctionNoLegendaryArtifact)) endfunction -//Implemented from module UnitGroupRespawnSystemConfig___Init: +//Implemented from module UnitGroupRespawnSystemConfig__Init: - function s__UnitGroupRespawnSystemConfig___S_UnitGroupRespawnSystemConfig___Init___onInit takes nothing returns nothing + function s__UnitGroupRespawnSystemConfig__S_UnitGroupRespawnSystemConfig__Init__onInit takes nothing returns nothing call ForceAddPlayer(UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_PLAYERS, Player(PLAYER_NEUTRAL_AGGRESSIVE)) call ForceAddPlayer(UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_PLAYERS, Player(22)) // Creep Heroes, udg_BossesPlayer is not initialized call ForceAddPlayer(UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_PLAYERS, Player(20)) // Gaia, udg_Gaia is not initialized @@ -34166,30 +34136,30 @@ endfunction function IsIdRestricted takes integer id returns boolean - return LoadBoolean(WoWReforgedAccount__h, id, 0) + return LoadBoolean(WoWReforgedAccount___h, id, 0) endfunction -function WoWReforgedAccount__AddAccount takes string name returns integer +function WoWReforgedAccount___AddAccount takes string name returns integer local integer this= s__Account__allocate() set s__Account_name[this]=name - set WoWReforgedAccount__accounts[WoWReforgedAccount__accountsCounter]=this - set WoWReforgedAccount__accountsCounter=WoWReforgedAccount__accountsCounter + 1 + set WoWReforgedAccount___accounts[WoWReforgedAccount___accountsCounter]=this + set WoWReforgedAccount___accountsCounter=WoWReforgedAccount___accountsCounter + 1 return this endfunction -function WoWReforgedAccount__AccountUnlock takes integer a,integer id returns nothing - call SaveBoolean(WoWReforgedAccount__h, id, 0, true) +function WoWReforgedAccount___AccountUnlock takes integer a,integer id returns nothing + call SaveBoolean(WoWReforgedAccount___h, id, 0, true) set s___Account_unlocked[s__Account_unlocked[a]+s__Account_unlockedCounter[a]]=id set s__Account_unlockedCounter[a]=s__Account_unlockedCounter[a] + 1 endfunction -function WoWReforgedAccount__GetAccountByName takes string name returns integer +function WoWReforgedAccount___GetAccountByName takes string name returns integer local integer i= 0 loop - exitwhen ( i == WoWReforgedAccount__accountsCounter ) - if ( s__Account_name[WoWReforgedAccount__accounts[i]] == name ) then - return WoWReforgedAccount__accounts[i] + exitwhen ( i == WoWReforgedAccount___accountsCounter ) + if ( s__Account_name[WoWReforgedAccount___accounts[i]] == name ) then + return WoWReforgedAccount___accounts[i] endif set i=i + 1 endloop @@ -34198,7 +34168,7 @@ endfunction function AccountHasUnlocked takes integer a,integer id returns boolean local integer i= 0 - if ( not (LoadBoolean(WoWReforgedAccount__h, (id), 0)) ) then // INLINED!! + if ( not (LoadBoolean(WoWReforgedAccount___h, (id), 0)) ) then // INLINED!! return true endif loop @@ -34215,14 +34185,14 @@ function GetAllUnlockedAccountNames takes integer id returns string local string result= "" local integer i= 0 local integer counter= 0 - if ( (LoadBoolean(WoWReforgedAccount__h, (id), 0)) ) then // INLINED!! + if ( (LoadBoolean(WoWReforgedAccount___h, (id), 0)) ) then // INLINED!! loop - exitwhen ( i == WoWReforgedAccount__accountsCounter ) - if ( AccountHasUnlocked(WoWReforgedAccount__accounts[i] , id) ) then + exitwhen ( i == WoWReforgedAccount___accountsCounter ) + if ( AccountHasUnlocked(WoWReforgedAccount___accounts[i] , id) ) then if ( counter > 0 ) then set result=result + "," endif - set result=result + s__Account_name[WoWReforgedAccount__accounts[i]] + set result=result + s__Account_name[WoWReforgedAccount___accounts[i]] set counter=counter + 1 endif set i=i + 1 @@ -34234,7 +34204,7 @@ endfunction function ShowUnlockedAccountIds takes player whichPlayer returns nothing local string result= "" local integer playerId= GetPlayerId(whichPlayer) - local integer a= WoWReforgedAccount__playerAccount[playerId] + local integer a= WoWReforgedAccount___playerAccount[playerId] local string name= GetPlayerName(whichPlayer) local integer i= 0 if ( a != 0 ) then @@ -34260,34 +34230,34 @@ endfunction function PlayerHasUnlocked takes player whichPlayer,integer id returns boolean local integer playerId= GetPlayerId(whichPlayer) - if ( not (LoadBoolean(WoWReforgedAccount__h, (id), 0)) ) then // INLINED!! + if ( not (LoadBoolean(WoWReforgedAccount___h, (id), 0)) ) then // INLINED!! return true endif - if ( WoWReforgedAccount__playerAccount[playerId] != 0 ) then - return AccountHasUnlocked(WoWReforgedAccount__playerAccount[playerId] , id) + if ( WoWReforgedAccount___playerAccount[playerId] != 0 ) then + return AccountHasUnlocked(WoWReforgedAccount___playerAccount[playerId] , id) endif return false endfunction -function WoWReforgedAccount__Init takes nothing returns nothing +function WoWReforgedAccount___Init takes nothing returns nothing local integer i= 0 local integer a= 0 // Barade#2569 - set a=WoWReforgedAccount__AddAccount("Barade#2569") - call WoWReforgedAccount__AccountUnlock(a , BARADE) - call WoWReforgedAccount__AccountUnlock(a , AEGWYNN) - call WoWReforgedAccount__AccountUnlock(a , LICH_KING) - call WoWReforgedAccount__AccountUnlock(a , ARTHAS_WIELDING_FROSTMOURNE) - call WoWReforgedAccount__AccountUnlock(a , PHOENIX_MOUNT) - call WoWReforgedAccount__AccountUnlock(a , SNOWY_OWL_MOUNT) - call WoWReforgedAccount__AccountUnlock(a , PHOENIX) - call WoWReforgedAccount__AccountUnlock(a , ITEM_HOUSE_KEY) + set a=WoWReforgedAccount___AddAccount("Barade#2569") + call WoWReforgedAccount___AccountUnlock(a , BARADE) + call WoWReforgedAccount___AccountUnlock(a , AEGWYNN) + call WoWReforgedAccount___AccountUnlock(a , LICH_KING) + call WoWReforgedAccount___AccountUnlock(a , ARTHAS_WIELDING_FROSTMOURNE) + call WoWReforgedAccount___AccountUnlock(a , PHOENIX_MOUNT) + call WoWReforgedAccount___AccountUnlock(a , SNOWY_OWL_MOUNT) + call WoWReforgedAccount___AccountUnlock(a , PHOENIX) + call WoWReforgedAccount___AccountUnlock(a , ITEM_HOUSE_KEY) set i=0 loop exitwhen ( i == bj_MAX_PLAYERS ) - set WoWReforgedAccount__playerAccount[i]=WoWReforgedAccount__GetAccountByName(GetPlayerName(Player(i))) + set WoWReforgedAccount___playerAccount[i]=WoWReforgedAccount___GetAccountByName(GetPlayerName(Player(i))) set i=i + 1 endloop endfunction @@ -34432,33 +34402,33 @@ function GetBanInfo takes nothing returns string local string message= "Bans:\n" local integer i= 0 loop - exitwhen ( i == WoWReforgedBan__banCount ) + exitwhen ( i == WoWReforgedBan___banCount ) if ( i > 0 ) then set message=message + "\n" endif - set message=message + WoWReforgedBan__bans[i] + " - " + WoWReforgedBan__bansReasons[i] + set message=message + WoWReforgedBan___bans[i] + " - " + WoWReforgedBan___bansReasons[i] set i=i + 1 endloop return message endfunction function AddBan takes string account,string reason returns integer - local integer index= WoWReforgedBan__banCount - set WoWReforgedBan__bans[index]=account - set WoWReforgedBan__bansReasons[index]=reason - set WoWReforgedBan__banCount=WoWReforgedBan__banCount + 1 + local integer index= WoWReforgedBan___banCount + set WoWReforgedBan___bans[index]=account + set WoWReforgedBan___bansReasons[index]=reason + set WoWReforgedBan___banCount=WoWReforgedBan___banCount + 1 return index endfunction function GetBan takes integer index returns string - return WoWReforgedBan__bans[index] + return WoWReforgedBan___bans[index] endfunction function GetBanIndex takes string account returns integer local integer i= 0 loop - exitwhen ( i == WoWReforgedBan__banCount ) - if ( (WoWReforgedBan__bans[(i)]) == account ) then // INLINED!! + exitwhen ( i == WoWReforgedBan___banCount ) + if ( (WoWReforgedBan___bans[(i)]) == account ) then // INLINED!! return i endif set i=i + 1 @@ -34466,23 +34436,23 @@ function GetBanIndex takes string account returns integer return - 1 endfunction -function WoWReforgedBan__ForGroupCheckBan takes nothing returns nothing +function WoWReforgedBan___ForGroupCheckBan takes nothing returns nothing local player p= GetEnumPlayer() local string playerName= GetPlayerName(p) local integer index= GetBanIndex(playerName) if ( index != - 1 ) then - call CustomDefeatBJ(p, "Banned!|nReason: " + WoWReforgedBan__bansReasons[index]) - call h__DisplayTextToForce(GetPlayersAll(), playerName + " was kicked from the game for being banned with the reason: " + WoWReforgedBan__bansReasons[index]) + call CustomDefeatBJ(p, "Banned!|nReason: " + WoWReforgedBan___bansReasons[index]) + call h__DisplayTextToForce(GetPlayersAll(), playerName + " was kicked from the game for being banned with the reason: " + WoWReforgedBan___bansReasons[index]) endif set p=null endfunction -function WoWReforgedBan__Init takes nothing returns nothing +function WoWReforgedBan___Init takes nothing returns nothing local force whichForce= CreateForce() call ForceAddPlayingUserPlayers(whichForce) call AddBan("WorldEditX" , "Spamming and killing allies.") - call ForForce(whichForce, function WoWReforgedBan__ForGroupCheckBan) + call ForForce(whichForce, function WoWReforgedBan___ForGroupCheckBan) call ForceClear(whichForce) call DestroyForce(whichForce) set whichForce=null @@ -34493,7 +34463,7 @@ endfunction //library WoWReforgedCombiner: -function WoWReforgedCombiner___InspectItem takes player whichPlayer,item whichItem returns nothing +function WoWReforgedCombiner__InspectItem takes player whichPlayer,item whichItem returns nothing local string msg= GetItemName(whichItem) + ", Level " + I2S(GetItemLevel(whichItem)) local integer i= 0 loop @@ -34506,7 +34476,7 @@ function WoWReforgedCombiner___InspectItem takes player whichPlayer,item whichIt call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, msg) endfunction -function WoWReforgedCombiner___ItemUnusedAbilities takes item whichItem returns integer +function WoWReforgedCombiner__ItemUnusedAbilities takes item whichItem returns integer local integer counter= 0 local integer i= 0 loop @@ -34519,7 +34489,7 @@ function WoWReforgedCombiner___ItemUnusedAbilities takes item whichItem returns return counter endfunction -function WoWReforgedCombiner___GetMaxTransferItemLevel takes unit hero returns integer +function WoWReforgedCombiner__GetMaxTransferItemLevel takes unit hero returns integer local item slotItem= null local integer result= 0 local integer i= 0 @@ -34543,13 +34513,13 @@ function WoWReforgedCombiner___GetMaxTransferItemLevel takes unit hero returns i return result endfunction -function WoWReforgedCombiner___MarkItem takes unit caster,item whichItem,integer abilityIndex returns nothing +function WoWReforgedCombiner__MarkItem takes unit caster,item whichItem,integer abilityIndex returns nothing local integer abilityId= BlzGetAbilityId(BlzGetItemAbilityByIndex(whichItem, abilityIndex)) if ( not IsItemInvulnerable(whichItem) ) then - if ( WoWReforgedCombiner___ItemUnusedAbilities(whichItem) > 0 ) then + if ( WoWReforgedCombiner__ItemUnusedAbilities(whichItem) > 0 ) then if ( abilityId != 0 ) then - call SaveItemHandle(WoWReforgedCombiner___h, GetHandleId(caster), 0, whichItem) - call SaveInteger(WoWReforgedCombiner___h, GetHandleId(caster), 1, abilityIndex) + call SaveItemHandle(WoWReforgedCombiner__h, GetHandleId(caster), 0, whichItem) + call SaveInteger(WoWReforgedCombiner__h, GetHandleId(caster), 1, abilityIndex) call h__DisplayTimedTextToPlayer(GetOwningPlayer(caster), 0.0, 0.0, 6.0, "Marked ability " + GetObjectName(abilityId)) else call SimError(GetOwningPlayer(caster) , "Target item has no ability at index " + I2S(abilityIndex + 1) + ".") @@ -34562,12 +34532,12 @@ function WoWReforgedCombiner___MarkItem takes unit caster,item whichItem,integer endif endfunction -function WoWReforgedCombiner___TransferItemAbilityEx takes unit caster,item sourceItem,integer abilityIndex,item targetItem,integer maxLevel returns nothing +function WoWReforgedCombiner__TransferItemAbilityEx takes unit caster,item sourceItem,integer abilityIndex,item targetItem,integer maxLevel returns nothing local integer abilityId= BlzGetAbilityId(BlzGetItemAbilityByIndex(sourceItem, abilityIndex)) if ( UnitHasItem(caster, sourceItem) ) then if ( GetItemLevel(sourceItem) <= maxLevel ) then if ( BlzGetItemAbilityByIndex(sourceItem, abilityIndex) != null ) then - if ( WoWReforgedCombiner___ItemUnusedAbilities(targetItem) > 0 ) then + if ( WoWReforgedCombiner__ItemUnusedAbilities(targetItem) > 0 ) then if ( ( GetItemCharges(sourceItem) == 0 and GetItemCharges(targetItem) == 0 ) or ( GetItemCharges(sourceItem) > 0 and GetItemCharges(targetItem) > 0 ) ) then call BlzItemAddAbility(targetItem, abilityId) call BlzItemRemoveAbility(sourceItem, abilityId) @@ -34589,47 +34559,47 @@ function WoWReforgedCombiner___TransferItemAbilityEx takes unit caster,item sour endif endfunction -function WoWReforgedCombiner___TransferItemAbility takes unit caster,item targetItem,integer maxLevel returns nothing - local item sourceItem= LoadItemHandle(WoWReforgedCombiner___h, GetHandleId(caster), 0) - local integer abilityIndex= LoadInteger(WoWReforgedCombiner___h, GetHandleId(caster), 1) +function WoWReforgedCombiner__TransferItemAbility takes unit caster,item targetItem,integer maxLevel returns nothing + local item sourceItem= LoadItemHandle(WoWReforgedCombiner__h, GetHandleId(caster), 0) + local integer abilityIndex= LoadInteger(WoWReforgedCombiner__h, GetHandleId(caster), 1) if ( sourceItem != null ) then - call WoWReforgedCombiner___TransferItemAbilityEx(caster , sourceItem , abilityIndex , targetItem , maxLevel) + call WoWReforgedCombiner__TransferItemAbilityEx(caster , sourceItem , abilityIndex , targetItem , maxLevel) set sourceItem=null else call SimError(GetOwningPlayer(caster) , "No marked source item.") endif endfunction -function WoWReforgedCombiner___TriggerConditionCast takes nothing returns boolean +function WoWReforgedCombiner__TriggerConditionCast takes nothing returns boolean local integer abilityId= GetSpellAbilityId() local unit caster= GetTriggerUnit() - if ( abilityId == WoWReforgedCombiner___ABILITY_ID_INSPECT ) then - call WoWReforgedCombiner___InspectItem(GetOwningPlayer(caster) , GetSpellTargetItem()) - elseif ( abilityId == WoWReforgedCombiner___ABILITY_ID_MARK_1 ) then - call WoWReforgedCombiner___MarkItem(caster , GetSpellTargetItem() , 0) - elseif ( abilityId == WoWReforgedCombiner___ABILITY_ID_MARK_2 ) then - call WoWReforgedCombiner___MarkItem(caster , GetSpellTargetItem() , 1) - elseif ( abilityId == WoWReforgedCombiner___ABILITY_ID_MARK_3 ) then - call WoWReforgedCombiner___MarkItem(caster , GetSpellTargetItem() , 2) - elseif ( abilityId == WoWReforgedCombiner___ABILITY_ID_MARK_4 ) then - call WoWReforgedCombiner___MarkItem(caster , GetSpellTargetItem() , 3) - elseif ( abilityId == WoWReforgedCombiner___ABILITY_ID_TRANSFER ) then - call WoWReforgedCombiner___TransferItemAbility(caster , GetSpellTargetItem() , WoWReforgedCombiner___GetMaxTransferItemLevel(caster)) + if ( abilityId == WoWReforgedCombiner__ABILITY_ID_INSPECT ) then + call WoWReforgedCombiner__InspectItem(GetOwningPlayer(caster) , GetSpellTargetItem()) + elseif ( abilityId == WoWReforgedCombiner__ABILITY_ID_MARK_1 ) then + call WoWReforgedCombiner__MarkItem(caster , GetSpellTargetItem() , 0) + elseif ( abilityId == WoWReforgedCombiner__ABILITY_ID_MARK_2 ) then + call WoWReforgedCombiner__MarkItem(caster , GetSpellTargetItem() , 1) + elseif ( abilityId == WoWReforgedCombiner__ABILITY_ID_MARK_3 ) then + call WoWReforgedCombiner__MarkItem(caster , GetSpellTargetItem() , 2) + elseif ( abilityId == WoWReforgedCombiner__ABILITY_ID_MARK_4 ) then + call WoWReforgedCombiner__MarkItem(caster , GetSpellTargetItem() , 3) + elseif ( abilityId == WoWReforgedCombiner__ABILITY_ID_TRANSFER ) then + call WoWReforgedCombiner__TransferItemAbility(caster , GetSpellTargetItem() , WoWReforgedCombiner__GetMaxTransferItemLevel(caster)) endif set caster=null return false endfunction -function WoWReforgedCombiner___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedCombiner___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(WoWReforgedCombiner___castTrigger, Condition(function WoWReforgedCombiner___TriggerConditionCast)) +function WoWReforgedCombiner__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedCombiner__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(WoWReforgedCombiner__castTrigger, Condition(function WoWReforgedCombiner__TriggerConditionCast)) endfunction -function WoWReforgedCombiner___RemoveUnitHook takes unit whichUnit returns nothing - call FlushChildHashtable(WoWReforgedCombiner___h, GetHandleId(whichUnit)) +function WoWReforgedCombiner__RemoveUnitHook takes unit whichUnit returns nothing + call FlushChildHashtable(WoWReforgedCombiner__h, GetHandleId(whichUnit)) endfunction -//processed hook: hook RemoveUnit WoWReforgedCombiner___RemoveUnitHook +//processed hook: hook RemoveUnit WoWReforgedCombiner__RemoveUnitHook //library WoWReforgedCombiner ends @@ -36345,6 +36315,12 @@ function AddAllCredits takes nothing returns nothing call CreateQuestItem(udg_QuestCredits , ("8512590215848: BTNFireSpellBook")) // INLINED!! call CreateQuestItem(udg_QuestCredits , ("LongbowMan: Gypsy Wagon")) // INLINED!! call CreateQuestItem(udg_QuestCredits , ("Sunchips: House Building")) // INLINED!! + call CreateQuestItem(udg_QuestCredits , ("Stefan.K: Magna Aegwynn")) // INLINED!! + call CreateQuestItem(udg_QuestCredits , ("8512590215848: Book with Earth\\Nature Spells")) // INLINED!! + call CreateQuestItem(udg_QuestCredits , ("8512590215848: Book with Water Spells")) // INLINED!! + call CreateQuestItem(udg_QuestCredits , ("Blizzard Entertainment: BTNINV_Misc_Food_11")) // INLINED!! + call CreateQuestItem(udg_QuestCredits , ("bakr: Wyrmrest Temple")) // INLINED!! + call CreateQuestItem(udg_QuestCredits , ("sPy: HolyMissile")) // INLINED!! endfunction @@ -36352,38 +36328,38 @@ endfunction //library WoWReforgedFel: -function WoWReforgedFel__TimerFunctionExpire takes nothing returns nothing +function WoWReforgedFel___TimerFunctionExpire takes nothing returns nothing local timer t= GetExpiredTimer() local integer handleId= GetHandleId(t) - local integer oldAttackType0= LoadInteger(WoWReforgedFel__h, handleId, 1) - local integer oldAttackType1= LoadInteger(WoWReforgedFel__h, handleId, 2) - local unit caster= LoadUnitHandle(WoWReforgedFel__h, handleId, 3) + local integer oldAttackType0= LoadInteger(WoWReforgedFel___h, handleId, 1) + local integer oldAttackType1= LoadInteger(WoWReforgedFel___h, handleId, 2) + local unit caster= LoadUnitHandle(WoWReforgedFel___h, handleId, 3) call BlzSetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0, oldAttackType0) call BlzSetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 1, oldAttackType1) call UnitRemoveAbility(caster, WoWReforgedFel_BUFF_ABILITY_ID) - call GroupRemoveUnit(WoWReforgedFel__casters, caster) + call GroupRemoveUnit(WoWReforgedFel___casters, caster) - call FlushChildHashtable(WoWReforgedFel__h, handleId) + call FlushChildHashtable(WoWReforgedFel___h, handleId) set handleId=GetHandleId(caster) - call FlushChildHashtable(WoWReforgedFel__h, handleId) + call FlushChildHashtable(WoWReforgedFel___h, handleId) call PauseTimer(t) call DestroyTimer(t) set t=null set caster=null endfunction -function WoWReforgedFel__HasAttackTypes takes unit caster returns boolean +function WoWReforgedFel___HasAttackTypes takes unit caster returns boolean return BlzGetUnitWeaponBooleanField(caster, UNIT_WEAPON_BF_ATTACKS_ENABLED, 0) or BlzGetUnitWeaponBooleanField(caster, UNIT_WEAPON_BF_ATTACKS_ENABLED, 1) endfunction -function WoWReforgedFel__HasNoChaosAttackTypeByDefault takes unit caster returns boolean +function WoWReforgedFel___HasNoChaosAttackTypeByDefault takes unit caster returns boolean local integer oldAttackType0= BlzGetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0) local integer oldAttackType1= BlzGetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 1) local integer handleId= GetHandleId(caster) - local boolean first= not HaveSavedHandle(WoWReforgedFel__h, handleId, 0) + local boolean first= not HaveSavedHandle(WoWReforgedFel___h, handleId, 0) return not first or oldAttackType0 != WoWReforgedFel_ATTACK_TYPE_CHAOS_VALUE or oldAttackType1 != WoWReforgedFel_ATTACK_TYPE_CHAOS_VALUE endfunction @@ -36392,43 +36368,43 @@ function Fel takes unit caster,real duration returns nothing local integer oldAttackType0= BlzGetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0) local integer oldAttackType1= BlzGetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 1) local integer handleId= GetHandleId(caster) - local boolean first= not HaveSavedHandle(WoWReforgedFel__h, handleId, 0) + local boolean first= not HaveSavedHandle(WoWReforgedFel___h, handleId, 0) local timer t= null if ( first ) then call BlzSetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0, WoWReforgedFel_ATTACK_TYPE_CHAOS_VALUE) call BlzSetUnitWeaponIntegerField(caster, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 1, WoWReforgedFel_ATTACK_TYPE_CHAOS_VALUE) set t=CreateTimer() else - set t=LoadTimerHandle(WoWReforgedFel__h, handleId, 0) + set t=LoadTimerHandle(WoWReforgedFel___h, handleId, 0) endif - call TimerStart(t, duration, false, function WoWReforgedFel__TimerFunctionExpire) + call TimerStart(t, duration, false, function WoWReforgedFel___TimerFunctionExpire) if ( first ) then - call SaveTimerHandle(WoWReforgedFel__h, handleId, 0, t) + call SaveTimerHandle(WoWReforgedFel___h, handleId, 0, t) set handleId=GetHandleId(t) - call SaveInteger(WoWReforgedFel__h, handleId, 1, oldAttackType0) - call SaveInteger(WoWReforgedFel__h, handleId, 2, oldAttackType1) - call SaveUnitHandle(WoWReforgedFel__h, handleId, 3, caster) - call GroupAddUnit(WoWReforgedFel__casters, caster) + call SaveInteger(WoWReforgedFel___h, handleId, 1, oldAttackType0) + call SaveInteger(WoWReforgedFel___h, handleId, 2, oldAttackType1) + call SaveUnitHandle(WoWReforgedFel___h, handleId, 3, caster) + call GroupAddUnit(WoWReforgedFel___casters, caster) call UnitAddAbility(caster, WoWReforgedFel_BUFF_ABILITY_ID) endif endfunction -function WoWReforgedFel__FilterIsValidTarget takes nothing returns boolean - return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(WoWReforgedFel__tmpCaster)) and WoWReforgedFel__HasAttackTypes(GetFilterUnit()) and WoWReforgedFel__HasNoChaosAttackTypeByDefault(GetFilterUnit()) +function WoWReforgedFel___FilterIsValidTarget takes nothing returns boolean + return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(WoWReforgedFel___tmpCaster)) and WoWReforgedFel___HasAttackTypes(GetFilterUnit()) and WoWReforgedFel___HasNoChaosAttackTypeByDefault(GetFilterUnit()) endfunction -function WoWReforgedFel__ForGroupFunctionFel takes nothing returns nothing - call Fel(GetEnumUnit() , WoWReforgedFel__tmpDuration) +function WoWReforgedFel___ForGroupFunctionFel takes nothing returns nothing + call Fel(GetEnumUnit() , WoWReforgedFel___tmpDuration) endfunction function MassFel takes unit caster,real x,real y,real duration returns nothing local group targets= CreateGroup() - set WoWReforgedFel__tmpCaster=caster - call GroupEnumUnitsInRange(targets, x, y, 512.0, Filter(function WoWReforgedFel__FilterIsValidTarget)) + set WoWReforgedFel___tmpCaster=caster + call GroupEnumUnitsInRange(targets, x, y, 512.0, Filter(function WoWReforgedFel___FilterIsValidTarget)) if ( BlzGroupGetSize(targets) > 0 ) then - set WoWReforgedFel__tmpDuration=duration - call ForGroup(targets, function WoWReforgedFel__ForGroupFunctionFel) + set WoWReforgedFel___tmpDuration=duration + call ForGroup(targets, function WoWReforgedFel___ForGroupFunctionFel) else call IssueImmediateOrder(caster, "stop") call SimError(GetOwningPlayer(caster) , "No valid targets.") @@ -36439,15 +36415,15 @@ function MassFel takes unit caster,real x,real y,real duration returns nothing set targets=null endfunction -function WoWReforgedFel__TriggerConditionCast takes nothing returns boolean +function WoWReforgedFel___TriggerConditionCast takes nothing returns boolean local integer abilityId= GetSpellAbilityId() if ( abilityId == WoWReforgedFel_FEL_ORC_ABILITY_ID ) then call Fel(GetTriggerUnit() , BlzGetAbilityRealLevelField(BlzGetUnitAbility(GetTriggerUnit(), abilityId), ABILITY_RLF_DURATION_NORMAL, GetUnitAbilityLevel(GetTriggerUnit(), abilityId))) elseif ( abilityId == WoWReforgedFel_FEL_ABILITY_ID or abilityId == WoWReforgedFel_UNIT_ABILITY_ID ) then call Fel(GetSpellTargetUnit() , GetUnitAbilityLevel(GetTriggerUnit(), abilityId) * 2.0 + 20.0) elseif ( abilityId == WoWReforgedFel_ITEM_ABILITY_ID ) then - if ( WoWReforgedFel__HasAttackTypes(GetSpellTargetUnit()) ) then - if ( WoWReforgedFel__HasNoChaosAttackTypeByDefault(GetSpellTargetUnit()) ) then + if ( WoWReforgedFel___HasAttackTypes(GetSpellTargetUnit()) ) then + if ( WoWReforgedFel___HasNoChaosAttackTypeByDefault(GetSpellTargetUnit()) ) then call Fel(GetSpellTargetUnit() , GetUnitAbilityLevel(GetTriggerUnit(), abilityId) * 2.0 + 20.0) else call SimError(GetOwningPlayer(GetSpellTargetUnit()) , "Target already has Chaos attack.") @@ -36461,36 +36437,36 @@ function WoWReforgedFel__TriggerConditionCast takes nothing returns boolean return false endfunction -function WoWReforgedFel__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedFel__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(WoWReforgedFel__castTrigger, Condition(function WoWReforgedFel__TriggerConditionCast)) +function WoWReforgedFel___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedFel___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(WoWReforgedFel___castTrigger, Condition(function WoWReforgedFel___TriggerConditionCast)) endfunction -function WoWReforgedFel__FlushCaster takes unit caster returns nothing +function WoWReforgedFel___FlushCaster takes unit caster returns nothing local integer handleId= GetHandleId(caster) - local timer t= LoadTimerHandle(WoWReforgedFel__h, handleId, 0) - call GroupRemoveUnit(WoWReforgedFel__casters, caster) - call FlushChildHashtable(WoWReforgedFel__h, handleId) + local timer t= LoadTimerHandle(WoWReforgedFel___h, handleId, 0) + call GroupRemoveUnit(WoWReforgedFel___casters, caster) + call FlushChildHashtable(WoWReforgedFel___h, handleId) set handleId=GetHandleId(t) - call FlushChildHashtable(WoWReforgedFel__h, handleId) + call FlushChildHashtable(WoWReforgedFel___h, handleId) call PauseTimer(t) call DestroyTimer(t) set t=null endfunction -function WoWReforgedFel__RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, WoWReforgedFel__casters) ) then - call WoWReforgedFel__FlushCaster(whichUnit) +function WoWReforgedFel___RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, WoWReforgedFel___casters) ) then + call WoWReforgedFel___FlushCaster(whichUnit) endif endfunction -//processed hook: hook RemoveUnit WoWReforgedFel__RemoveUnitHook +//processed hook: hook RemoveUnit WoWReforgedFel___RemoveUnitHook //library WoWReforgedFel ends //library WoWReforgedFisherman: -function WoWReforgedFisherman__ShowFishFloatingText takes unit hero,item whichItem returns nothing +function WoWReforgedFisherman___ShowFishFloatingText takes unit hero,item whichItem returns nothing local force whichForce= CreateForce() call ForceAddPlayer(whichForce, GetOwningPlayer(hero)) call ShowFadingTextTagForForce((whichForce ) , ( "+" + I2S(GetItemCharges(whichItem)) + " " + GetItemName(whichItem) ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 0 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! @@ -36499,7 +36475,7 @@ function WoWReforgedFisherman__ShowFishFloatingText takes unit hero,item whichIt set whichForce=null endfunction -function WoWReforgedFisherman__ShowNoFishFloatingText takes unit hero returns nothing +function WoWReforgedFisherman___ShowNoFishFloatingText takes unit hero returns nothing local force whichForce= CreateForce() call ForceAddPlayer(whichForce, GetOwningPlayer(hero)) call ShowFadingTextTagForForce((whichForce ) , ( "No fish!" ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 0 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! @@ -36516,11 +36492,11 @@ function CreateFishForFishingRod takes unit hero returns item call SetItemCharges(whichItem, GetItemCharges(whichItem) + GetLuckRandomInt(hero , 2 , 6)) endif - call WoWReforgedFisherman__ShowFishFloatingText(hero , whichItem) + call WoWReforgedFisherman___ShowFishFloatingText(hero , whichItem) return whichItem else - call WoWReforgedFisherman__ShowNoFishFloatingText(hero) + call WoWReforgedFisherman___ShowNoFishFloatingText(hero) endif return null @@ -36605,45 +36581,45 @@ endfunction function GetLearnableSkillMax takes nothing returns integer - return WoWReforgedLearnableSkills___learnableSkillCounter + return WoWReforgedLearnableSkills__learnableSkillCounter endfunction function IsLearnableSkillValid takes integer index returns boolean - return index >= 0 and index < WoWReforgedLearnableSkills___learnableSkillCounter + return index >= 0 and index < WoWReforgedLearnableSkills__learnableSkillCounter endfunction function GetLearnableSkillLearnItemTypeId takes integer index returns integer - return WoWReforgedLearnableSkills___learnableSkillLearnItemTypeId[index] + return WoWReforgedLearnableSkills__learnableSkillLearnItemTypeId[index] endfunction function GetLearnableSkillLearnAbilityId takes integer index returns integer - return WoWReforgedLearnableSkills___learnableSkillLearnAbilityId[index] + return WoWReforgedLearnableSkills__learnableSkillLearnAbilityId[index] endfunction function GetLearnableSkillAbilityId takes integer index returns integer - return WoWReforgedLearnableSkills___learnableSkillAbilityId[index] + return WoWReforgedLearnableSkills__learnableSkillAbilityId[index] endfunction function GetLearnableSkillIconAbilityId takes integer index returns integer - return WoWReforgedLearnableSkills___learnableSkillIconAbilityId[index] + return WoWReforgedLearnableSkills__learnableSkillIconAbilityId[index] endfunction function GetLearnableSkillForbidEquipmentBag takes integer index returns boolean - return WoWReforgedLearnableSkills___learnableSkillForbidEquipmentBag[index] + return WoWReforgedLearnableSkills__learnableSkillForbidEquipmentBag[index] endfunction function GetLearnableSkillSlot takes integer index returns integer - return WoWReforgedLearnableSkills___learnableSkillSlot[index] + return WoWReforgedLearnableSkills__learnableSkillSlot[index] endfunction function GetRandomLearnableSkillIndex takes integer unitTypeId,integer slot returns integer local integer i= 0 - local integer max= (WoWReforgedLearnableSkills___learnableSkillCounter) // INLINED!! + local integer max= (WoWReforgedLearnableSkills__learnableSkillCounter) // INLINED!! local integer array indices local integer indicesCounter= 0 loop exitwhen ( i == max ) - if ( (WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) == slot and ( not (WoWReforgedLearnableSkills___learnableSkillForbidEquipmentBag[(i)]) or unitTypeId != EQUIPMENT_BAG ) ) then // INLINED!! + if ( (WoWReforgedLearnableSkills__learnableSkillSlot[(i)]) == slot and ( not (WoWReforgedLearnableSkills__learnableSkillForbidEquipmentBag[(i)]) or unitTypeId != EQUIPMENT_BAG ) ) then // INLINED!! set indices[indicesCounter]=i set indicesCounter=indicesCounter + 1 endif @@ -36657,14 +36633,14 @@ function GetRandomLearnableSkillIndex takes integer unitTypeId,integer slot retu endfunction function AddLearnableSkillEx takes integer learnItemTypeId,integer learnAbilityId,integer abilityId,integer iconAbilityId,integer slot,boolean forbidEquipmentBag returns integer - local integer index= WoWReforgedLearnableSkills___learnableSkillCounter - set WoWReforgedLearnableSkills___learnableSkillLearnItemTypeId[index]=learnItemTypeId - set WoWReforgedLearnableSkills___learnableSkillLearnAbilityId[index]=learnAbilityId - set WoWReforgedLearnableSkills___learnableSkillAbilityId[index]=abilityId - set WoWReforgedLearnableSkills___learnableSkillIconAbilityId[index]=iconAbilityId - set WoWReforgedLearnableSkills___learnableSkillSlot[index]=slot - set WoWReforgedLearnableSkills___learnableSkillForbidEquipmentBag[index]=forbidEquipmentBag - set WoWReforgedLearnableSkills___learnableSkillCounter=WoWReforgedLearnableSkills___learnableSkillCounter + 1 + local integer index= WoWReforgedLearnableSkills__learnableSkillCounter + set WoWReforgedLearnableSkills__learnableSkillLearnItemTypeId[index]=learnItemTypeId + set WoWReforgedLearnableSkills__learnableSkillLearnAbilityId[index]=learnAbilityId + set WoWReforgedLearnableSkills__learnableSkillAbilityId[index]=abilityId + set WoWReforgedLearnableSkills__learnableSkillIconAbilityId[index]=iconAbilityId + set WoWReforgedLearnableSkills__learnableSkillSlot[index]=slot + set WoWReforgedLearnableSkills__learnableSkillForbidEquipmentBag[index]=forbidEquipmentBag + set WoWReforgedLearnableSkills__learnableSkillCounter=WoWReforgedLearnableSkills__learnableSkillCounter + 1 return index endfunction @@ -36676,7 +36652,7 @@ function AddLearnableSkill takes nothing returns integer endfunction function AddLearnableSkillToHero takes unit hero,integer index returns nothing - local integer abilityId= (WoWReforgedLearnableSkills___learnableSkillLearnAbilityId[(index)]) // INLINED!! + local integer abilityId= (WoWReforgedLearnableSkills__learnableSkillLearnAbilityId[(index)]) // INLINED!! if ( GetUnitAbilityLevel(hero, abilityId) == 0 ) then call UnitAddAbility(hero, abilityId) call BlzUnitHideAbility(hero, abilityId, true) @@ -36687,8 +36663,8 @@ endfunction function GetLearnableSkillByLearnItemTypeId takes integer itemTypeId returns integer local integer i= 0 loop - exitwhen ( i == WoWReforgedLearnableSkills___learnableSkillCounter ) - if ( (WoWReforgedLearnableSkills___learnableSkillLearnItemTypeId[(i)]) == itemTypeId ) then // INLINED!! + exitwhen ( i == WoWReforgedLearnableSkills__learnableSkillCounter ) + if ( (WoWReforgedLearnableSkills__learnableSkillLearnItemTypeId[(i)]) == itemTypeId ) then // INLINED!! return i endif set i=i + 1 @@ -36699,8 +36675,8 @@ endfunction function GetLearnableSkillByAbilityId takes integer abilityId returns integer local integer i= 0 loop - exitwhen ( i == WoWReforgedLearnableSkills___learnableSkillCounter ) - if ( (WoWReforgedLearnableSkills___learnableSkillAbilityId[(i)]) == abilityId ) then // INLINED!! + exitwhen ( i == WoWReforgedLearnableSkills__learnableSkillCounter ) + if ( (WoWReforgedLearnableSkills__learnableSkillAbilityId[(i)]) == abilityId ) then // INLINED!! return i endif set i=i + 1 @@ -36711,9 +36687,9 @@ endfunction function ResetLearnableSkillsForHero takes unit hero,integer slot returns nothing local integer i= 0 loop - exitwhen ( i == WoWReforgedLearnableSkills___learnableSkillCounter ) - if ( (WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) == slot ) then // INLINED!! - call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills___learnableSkillLearnAbilityId[(i)])) // INLINED!! + exitwhen ( i == WoWReforgedLearnableSkills__learnableSkillCounter ) + if ( (WoWReforgedLearnableSkills__learnableSkillSlot[(i)]) == slot ) then // INLINED!! + call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills__learnableSkillLearnAbilityId[(i)])) // INLINED!! endif set i=i + 1 endloop @@ -36722,8 +36698,8 @@ endfunction function ResetAllLearnableSkillsForHero takes unit hero returns nothing local integer i= 0 loop - exitwhen ( i == WoWReforgedLearnableSkills___learnableSkillCounter ) - call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills___learnableSkillLearnAbilityId[(i)])) // INLINED!! + exitwhen ( i == WoWReforgedLearnableSkills__learnableSkillCounter ) + call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills__learnableSkillLearnAbilityId[(i)])) // INLINED!! set i=i + 1 endloop endfunction @@ -36732,8 +36708,8 @@ function CountLearnableSkills takes integer slot returns integer local integer result= 0 local integer i= 0 loop - exitwhen ( i == WoWReforgedLearnableSkills___learnableSkillCounter ) - if ( slot == - 1 or (WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) == slot ) then // INLINED!! + exitwhen ( i == WoWReforgedLearnableSkills__learnableSkillCounter ) + if ( slot == - 1 or (WoWReforgedLearnableSkills__learnableSkillSlot[(i)]) == slot ) then // INLINED!! set result=result + 1 endif set i=i + 1 @@ -36745,10 +36721,10 @@ function RemoveAllLearnableSkillIconAbilities takes unit hero returns nothing local integer i= 0 //call BJDebugMsg("Remove icon abilities.") loop - exitwhen ( i == WoWReforgedLearnableSkills___learnableSkillCounter ) - if ( (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(i)]) != 0 and GetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(i)])) > 0 ) then // INLINED!! + exitwhen ( i == WoWReforgedLearnableSkills__learnableSkillCounter ) + if ( (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(i)]) != 0 and GetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(i)])) > 0 ) then // INLINED!! //call BJDebugMsg("remove icon ability " + GetObjectName(GetLearnableSkillIconAbilityId(i))) - call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(i)])) // INLINED!! + call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(i)])) // INLINED!! endif set i=i + 1 endloop @@ -36763,15 +36739,15 @@ function HideAllLearnableSkillIconAbilities takes unit hero,boolean hide returns set str="Show" endif loop - exitwhen ( i >= WoWReforgedLearnableSkills___learnableSkillCounter ) - if ( (WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) == 4 ) then // INLINED!! - if ( (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(i)]) != 0 ) then // INLINED!! - if ( GetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills___learnableSkillAbilityId[(i)])) > 0 ) then // INLINED!! + exitwhen ( i >= WoWReforgedLearnableSkills__learnableSkillCounter ) + if ( (WoWReforgedLearnableSkills__learnableSkillSlot[(i)]) == 4 ) then // INLINED!! + if ( (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(i)]) != 0 ) then // INLINED!! + if ( GetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills__learnableSkillAbilityId[(i)])) > 0 ) then // INLINED!! //if (not hide) then // readding fixes the icon position - call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(i)])) // INLINED!! - call UnitAddAbility(hero, (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(i)])) // INLINED!! - call SetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(i)]), GetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills___learnableSkillAbilityId[(i)]))) // INLINED!! + call UnitRemoveAbility(hero, (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(i)])) // INLINED!! + call UnitAddAbility(hero, (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(i)])) // INLINED!! + call SetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(i)]), GetUnitAbilityLevel(hero, (WoWReforgedLearnableSkills__learnableSkillAbilityId[(i)]))) // INLINED!! //else // call BlzUnitHideAbility(hero, GetLearnableSkillIconAbilityId(i), hide) //endif @@ -36789,15 +36765,15 @@ function HideAllLearnableSkillIconAbilities takes unit hero,boolean hide returns endloop endfunction -function WoWReforgedLearnableSkills___TriggerConditionLearn takes nothing returns boolean +function WoWReforgedLearnableSkills__TriggerConditionLearn takes nothing returns boolean local integer index= GetLearnableSkillByAbilityId(GetLearnedSkill()) - if ( index != - 1 and (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(index)]) != 0 ) then // INLINED!! + if ( index != - 1 and (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(index)]) != 0 ) then // INLINED!! //call BJDebugMsg("Add icon ability " + GetObjectName(GetLearnableSkillIconAbilityId(index))) - if ( GetUnitAbilityLevel(GetTriggerUnit(), (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(index)])) == 0 ) then // INLINED!! - call UnitAddAbility(GetTriggerUnit(), (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(index)])) // INLINED!! + if ( GetUnitAbilityLevel(GetTriggerUnit(), (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(index)])) == 0 ) then // INLINED!! + call UnitAddAbility(GetTriggerUnit(), (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(index)])) // INLINED!! endif - call SetUnitAbilityLevel(GetTriggerUnit(), (WoWReforgedLearnableSkills___learnableSkillIconAbilityId[(index)]), GetUnitAbilityLevel(GetTriggerUnit(), GetLearnedSkill())) // INLINED!! + call SetUnitAbilityLevel(GetTriggerUnit(), (WoWReforgedLearnableSkills__learnableSkillIconAbilityId[(index)]), GetUnitAbilityLevel(GetTriggerUnit(), GetLearnedSkill())) // INLINED!! //call BJDebugMsg("Level " + I2S(GetUnitAbilityLevel(GetTriggerUnit(), GetLearnedSkill()))) endif @@ -36807,7 +36783,7 @@ function WoWReforgedLearnableSkills___TriggerConditionLearn takes nothing return return true endfunction -function WoWReforgedLearnableSkills___TriggerActionLearn takes nothing returns nothing +function WoWReforgedLearnableSkills__TriggerActionLearn takes nothing returns nothing local unit hero= GetTriggerUnit() // wait for hiding/unhiding and the skill point to be spent call TriggerSleepAction(0.03) @@ -36819,27 +36795,27 @@ function WoWReforgedLearnableSkills___TriggerActionLearn takes nothing returns n set hero=null endfunction -function WoWReforgedLearnableSkills___TriggerConditionUnlearn takes nothing returns boolean - call RemoveAllLearnableSkillIconAbilities((HeroUtils___unskilledHero)) // INLINED!! +function WoWReforgedLearnableSkills__TriggerConditionUnlearn takes nothing returns boolean + call RemoveAllLearnableSkillIconAbilities((HeroUtils__unskilledHero)) // INLINED!! return false endfunction -function WoWReforgedLearnableSkills___FilterIsHero takes nothing returns boolean +function WoWReforgedLearnableSkills__FilterIsHero takes nothing returns boolean return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) endfunction -function WoWReforgedLearnableSkills___ForGroupLearn takes nothing returns nothing +function WoWReforgedLearnableSkills__ForGroupLearn takes nothing returns nothing local unit hero= GetEnumUnit() call HideAllLearnableSkillIconAbilities(hero , GetHeroSkillPoints(hero) > 0 or GetHeroLevel(hero) < MAX_HERO_LEVEL) set hero=null endfunction -function WoWReforgedLearnableSkills___TimerFunctionLearn takes nothing returns nothing +function WoWReforgedLearnableSkills__TimerFunctionLearn takes nothing returns nothing local timer t= GetExpiredTimer() local group heroes= CreateGroup() - call GroupEnumUnitsInRect(heroes, GetPlayableMapRect(), Filter(function WoWReforgedLearnableSkills___FilterIsHero)) - call ForGroup(heroes, function WoWReforgedLearnableSkills___ForGroupLearn) + call GroupEnumUnitsInRect(heroes, GetPlayableMapRect(), Filter(function WoWReforgedLearnableSkills__FilterIsHero)) + call ForGroup(heroes, function WoWReforgedLearnableSkills__ForGroupLearn) call GroupClear(heroes) call DestroyGroup(heroes) set heroes=null @@ -36848,15 +36824,15 @@ function WoWReforgedLearnableSkills___TimerFunctionLearn takes nothing returns n set t=null endfunction -function WoWReforgedLearnableSkills___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkills___learnTrigger, EVENT_PLAYER_HERO_SKILL) - call TriggerAddCondition(WoWReforgedLearnableSkills___learnTrigger, Condition(function WoWReforgedLearnableSkills___TriggerConditionLearn)) - call TriggerAddAction(WoWReforgedLearnableSkills___learnTrigger, function WoWReforgedLearnableSkills___TriggerActionLearn) +function WoWReforgedLearnableSkills__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkills__learnTrigger, EVENT_PLAYER_HERO_SKILL) + call TriggerAddCondition(WoWReforgedLearnableSkills__learnTrigger, Condition(function WoWReforgedLearnableSkills__TriggerConditionLearn)) + call TriggerAddAction(WoWReforgedLearnableSkills__learnTrigger, function WoWReforgedLearnableSkills__TriggerActionLearn) - call TriggerRegisterHeroUnskillEvent(WoWReforgedLearnableSkills___unlearnTrigger) - call TriggerAddCondition(WoWReforgedLearnableSkills___unlearnTrigger, Condition(function WoWReforgedLearnableSkills___TriggerConditionUnlearn)) + call TriggerRegisterHeroUnskillEvent(WoWReforgedLearnableSkills__unlearnTrigger) + call TriggerAddCondition(WoWReforgedLearnableSkills__unlearnTrigger, Condition(function WoWReforgedLearnableSkills__TriggerConditionUnlearn)) - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedLearnableSkills___TimerFunctionLearn) + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedLearnableSkills__TimerFunctionLearn) endfunction @@ -36866,16 +36842,16 @@ endfunction function GetUnitLeverCount takes unit whichUnit returns integer - return LoadInteger(WoWReforgedLevers__h, GetHandleId(whichUnit), WoWReforgedLevers__KEY_COUNT) + return LoadInteger(WoWReforgedLevers___h, GetHandleId(whichUnit), WoWReforgedLevers___KEY_COUNT) endfunction function GetUnitLever takes unit whichUnit,integer index returns integer - return LoadInteger(WoWReforgedLevers__h, GetHandleId(whichUnit), WoWReforgedLevers__KEY_INDEX + index) + return LoadInteger(WoWReforgedLevers___h, GetHandleId(whichUnit), WoWReforgedLevers___KEY_INDEX + index) endfunction function AddLever takes unit u,destructable d,unit sourcePortal,real sourcePortalX,real sourcePortalY,unit targetPortal,real targetPortalX,real targetPortalY,integer leverType returns integer local integer l= s__Lever__allocate() - local integer count= (LoadInteger(WoWReforgedLevers__h, GetHandleId((u)), WoWReforgedLevers__KEY_COUNT)) // INLINED!! + local integer count= (LoadInteger(WoWReforgedLevers___h, GetHandleId((u)), WoWReforgedLevers___KEY_COUNT)) // INLINED!! local integer handleId= GetHandleId(u) set s__Lever_u[l]=u set s__Lever_d[l]=d @@ -36886,23 +36862,23 @@ function AddLever takes unit u,destructable d,unit sourcePortal,real sourcePorta set s__Lever_targetPortalX[l]=targetPortalX set s__Lever_targetPortalY[l]=targetPortalY set s__Lever_leverType[l]=leverType - set WoWReforgedLevers__levers[WoWReforgedLevers__leversCount]=l - set WoWReforgedLevers__leversCount=WoWReforgedLevers__leversCount + 1 + set WoWReforgedLevers___levers[WoWReforgedLevers___leversCount]=l + set WoWReforgedLevers___leversCount=WoWReforgedLevers___leversCount + 1 - call SaveInteger(WoWReforgedLevers__h, handleId, WoWReforgedLevers__KEY_INDEX + count, l) - call SaveInteger(WoWReforgedLevers__h, handleId, WoWReforgedLevers__KEY_COUNT, count + 1) + call SaveInteger(WoWReforgedLevers___h, handleId, WoWReforgedLevers___KEY_INDEX + count, l) + call SaveInteger(WoWReforgedLevers___h, handleId, WoWReforgedLevers___KEY_COUNT, count + 1) return l endfunction -function WoWReforgedLevers__EnableLeverPortal takes integer l returns nothing +function WoWReforgedLevers___EnableLeverPortal takes integer l returns nothing call h__WaygateActivate(s__Lever_sourcePortal[l], true) call h__WaygateSetDestination(s__Lever_sourcePortal[l], s__Lever_targetPortalX[l], s__Lever_targetPortalY[l]) call h__WaygateActivate(s__Lever_targetPortal[l], true) call h__WaygateSetDestination(s__Lever_targetPortal[l], s__Lever_sourcePortalX[l], s__Lever_sourcePortalY[l]) endfunction -function WoWReforgedLevers__DisableLeverPortal takes integer l returns nothing +function WoWReforgedLevers___DisableLeverPortal takes integer l returns nothing call h__WaygateActivate(s__Lever_sourcePortal[l], false) call h__WaygateActivate(s__Lever_targetPortal[l], false) endfunction @@ -36920,7 +36896,7 @@ endfunction function AddLeverPortalWowReforged takes nothing returns nothing local integer l= AddLever(udg_TmpUnit , null , udg_TmpUnit2 , GetRectCenterX(udg_TmpRect) , GetRectCenterY(udg_TmpRect) , udg_TmpUnit3 , GetRectCenterX(udg_TmpRect2) , GetRectCenterY(udg_TmpRect2) , LEVER_TYPE_PORTAL) - call WoWReforgedLevers__EnableLeverPortal(l) + call WoWReforgedLevers___EnableLeverPortal(l) endfunction function IsLeverGate takes integer unitTypeId returns boolean @@ -36949,7 +36925,7 @@ function GetLeverType takes integer unitTypeId returns integer return LEVER_TYPE_GATE endfunction -function WoWReforgedLevers__TriggerConditionSell takes nothing returns boolean +function WoWReforgedLevers___TriggerConditionSell takes nothing returns boolean local integer l= 0 local unit shop= GetSellingUnit() local unit u= GetSoldUnit() @@ -36957,19 +36933,19 @@ function WoWReforgedLevers__TriggerConditionSell takes nothing returns boolean local integer count= 0 local integer i= 0 if ( IsLeverUnit(unitTypeId) ) then - set count=(LoadInteger(WoWReforgedLevers__h, GetHandleId((shop)), WoWReforgedLevers__KEY_COUNT)) // INLINED!! + set count=(LoadInteger(WoWReforgedLevers___h, GetHandleId((shop)), WoWReforgedLevers___KEY_COUNT)) // INLINED!! //call BJDebugMsg("Is lever unit type " + GetObjectName(unitTypeId) + " with count " + I2S(count) + " for shop " + GetUnitName(shop)) set i=0 loop exitwhen ( i >= count ) - set l=(LoadInteger(WoWReforgedLevers__h, GetHandleId((shop )), WoWReforgedLevers__KEY_INDEX + ( i))) // INLINED!! + set l=(LoadInteger(WoWReforgedLevers___h, GetHandleId((shop )), WoWReforgedLevers___KEY_INDEX + ( i))) // INLINED!! if ( l != 0 and GetLeverType(unitTypeId) == s__Lever_leverType[l] ) then if ( IsLeverPortal(unitTypeId) ) then if ( unitTypeId == ENABLE_PORTAL ) then - call WoWReforgedLevers__EnableLeverPortal(l) + call WoWReforgedLevers___EnableLeverPortal(l) call SetUnitAnimation(shop, "stand") // TODO Play this only if everything is enabled? else - call WoWReforgedLevers__DisableLeverPortal(l) + call WoWReforgedLevers___DisableLeverPortal(l) call SetUnitAnimation(shop, "stand alternate") endif else @@ -37001,20 +36977,20 @@ function WoWReforgedLevers__TriggerConditionSell takes nothing returns boolean return false endfunction -function WoWReforgedLevers__GameStart takes nothing returns nothing +function WoWReforgedLevers___GameStart takes nothing returns nothing local integer i= 0 loop - exitwhen ( i >= WoWReforgedLevers__leversCount ) - call WoWReforgedLevers__EnableLeverPortal(WoWReforgedLevers__levers[i]) + exitwhen ( i >= WoWReforgedLevers___leversCount ) + call WoWReforgedLevers___EnableLeverPortal(WoWReforgedLevers___levers[i]) set i=i + 1 endloop endfunction -function WoWReforgedLevers__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedLevers__sellTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(WoWReforgedLevers__sellTrigger, Condition(function WoWReforgedLevers__TriggerConditionSell)) +function WoWReforgedLevers___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedLevers___sellTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(WoWReforgedLevers___sellTrigger, Condition(function WoWReforgedLevers___TriggerConditionSell)) - call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedLevers__GameStart)) // INLINED!! + call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedLevers___GameStart)) // INLINED!! endfunction @@ -37138,13 +37114,13 @@ endfunction //library WoWReforgedTextTag: -function WoWReforgedTextTag__ForFunctionShowTextTag takes nothing returns nothing - if ( WoWReforgedTextTag__tmpPlayer == GetLocalPlayer() ) then - call SetTextTagVisibility((TextTagUtils___enumTextTag), WoWReforgedTextTag__tmpShow) // INLINED!! +function WoWReforgedTextTag___ForFunctionShowTextTag takes nothing returns nothing + if ( WoWReforgedTextTag___tmpPlayer == GetLocalPlayer() ) then + call SetTextTagVisibility((TextTagUtils__enumTextTag), WoWReforgedTextTag___tmpShow) // INLINED!! endif endfunction -function WoWReforgedTextTag__ShowPlayerSelectionTextTags takes player whichPlayer returns nothing +function WoWReforgedTextTag___ShowPlayerSelectionTextTags takes player whichPlayer returns nothing local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) @@ -37161,11 +37137,11 @@ function WoWReforgedTextTag__ShowPlayerSelectionTextTags takes player whichPlaye endfunction function ShowAllTextTagsForPlayer takes player whichPlayer,boolean show returns nothing - set WoWReforgedTextTag__tmpPlayer=whichPlayer - set WoWReforgedTextTag__tmpShow=show - call ForAllTextTags(function WoWReforgedTextTag__ForFunctionShowTextTag) + set WoWReforgedTextTag___tmpPlayer=whichPlayer + set WoWReforgedTextTag___tmpShow=show + call ForAllTextTags(function WoWReforgedTextTag___ForFunctionShowTextTag) if ( show ) then - call WoWReforgedTextTag__ShowPlayerSelectionTextTags(whichPlayer) + call WoWReforgedTextTag___ShowPlayerSelectionTextTags(whichPlayer) endif endfunction @@ -37174,7 +37150,7 @@ endfunction //library WoWReforgedTreeUtils: -function WoWReforgedTreeUtils___Init takes nothing returns nothing +function WoWReforgedTreeUtils__Init takes nothing returns nothing call AddTree(EASTERN_TREE_WALL_1) call AddTree(CARROT_TREE_WALL_1) call AddTree(CARROT_TREE_WALL_2) @@ -37399,7 +37375,7 @@ endfunction //library DiplomacyUI: -function DiplomacyUI___Index2D takes integer v0,integer v1,integer max2 returns integer +function DiplomacyUI__Index2D takes integer v0,integer v1,integer max2 returns integer return v0 * max2 + v1 endfunction @@ -37429,7 +37405,7 @@ function GetAllianceState takes player sourcePlayer,player otherPlayer returns i return bj_ALLIANCE_NEUTRAL endfunction -function DiplomacyUI___GetAllianceStateName takes integer allianceState returns string +function DiplomacyUI__GetAllianceStateName takes integer allianceState returns string if ( allianceState == bj_ALLIANCE_UNALLIED ) then return "Unallied" elseif ( allianceState == bj_ALLIANCE_UNALLIED_VISION ) then @@ -37448,7 +37424,7 @@ function DiplomacyUI___GetAllianceStateName takes integer allianceState returns return "Neutral Vision" endfunction -function DiplomacyUI___UpdateTooltips takes nothing returns nothing +function DiplomacyUI__UpdateTooltips takes nothing returns nothing local player rowPlayer= null local player columnPlayer= null local integer row= 0 @@ -37458,16 +37434,16 @@ function DiplomacyUI___UpdateTooltips takes nothing returns nothing loop exitwhen ( row == bj_MAX_PLAYERS ) set rowPlayer=Player(row) - if ( IsPlayerInForce(rowPlayer, DiplomacyUI___allPlayers) ) then + if ( IsPlayerInForce(rowPlayer, DiplomacyUI__allPlayers) ) then set column=0 loop exitwhen ( column == bj_MAX_PLAYERS ) set columnPlayer=Player(column) - if ( IsPlayerInForce(columnPlayer, DiplomacyUI___allPlayers) ) then + if ( IsPlayerInForce(columnPlayer, DiplomacyUI__allPlayers) ) then if ( rowPlayer != columnPlayer ) then - set index=DiplomacyUI___Index2D(row , column , bj_MAX_PLAYERS) - set allianceState=R2I(BlzFrameGetValue(DiplomacyUI___Cells[index])) - call BlzFrameSetText(DiplomacyUI___CellsTooltip[index], "From " + GetPlayerNameColored(rowPlayer) + " to " + GetPlayerNameColored(columnPlayer) + ": " + DiplomacyUI___GetAllianceStateName(allianceState)) + set index=DiplomacyUI__Index2D(row , column , bj_MAX_PLAYERS) + set allianceState=R2I(BlzFrameGetValue(DiplomacyUI__Cells[index])) + call BlzFrameSetText(DiplomacyUI__CellsTooltip[index], "From " + GetPlayerNameColored(rowPlayer) + " to " + GetPlayerNameColored(columnPlayer) + ": " + DiplomacyUI__GetAllianceStateName(allianceState)) endif endif set columnPlayer=null @@ -37480,7 +37456,7 @@ function DiplomacyUI___UpdateTooltips takes nothing returns nothing endfunction -function DiplomacyUI___UpdateUI takes nothing returns nothing +function DiplomacyUI__UpdateUI takes nothing returns nothing local player rowPlayer= null local player columnPlayer= null local integer row= 0 @@ -37490,19 +37466,19 @@ function DiplomacyUI___UpdateUI takes nothing returns nothing loop exitwhen ( row == bj_MAX_PLAYERS ) set rowPlayer=Player(row) - if ( IsPlayerInForce(rowPlayer, DiplomacyUI___allPlayers) ) then - call BlzFrameSetTexture(DiplomacyUI___RowTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! - call BlzFrameSetTexture(DiplomacyUI___ColumnTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! + if ( IsPlayerInForce(rowPlayer, DiplomacyUI__allPlayers) ) then + call BlzFrameSetTexture(DiplomacyUI__RowTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! + call BlzFrameSetTexture(DiplomacyUI__ColumnTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! set column=0 loop exitwhen ( column == bj_MAX_PLAYERS ) set columnPlayer=Player(column) - if ( IsPlayerInForce(columnPlayer, DiplomacyUI___allPlayers) ) then + if ( IsPlayerInForce(columnPlayer, DiplomacyUI__allPlayers) ) then if ( rowPlayer != columnPlayer ) then - set index=DiplomacyUI___Index2D(row , column , bj_MAX_PLAYERS) + set index=DiplomacyUI__Index2D(row , column , bj_MAX_PLAYERS) set allianceState=GetAllianceState(rowPlayer , columnPlayer) - call BlzFrameSetValue(DiplomacyUI___Cells[index], I2R(allianceState)) + call BlzFrameSetValue(DiplomacyUI__Cells[index], I2R(allianceState)) endif endif set columnPlayer=null @@ -37512,7 +37488,7 @@ function DiplomacyUI___UpdateUI takes nothing returns nothing set rowPlayer=null set row=row + 1 endloop - call DiplomacyUI___UpdateTooltips() + call DiplomacyUI__UpdateTooltips() endfunction function SetDiplomacyUIVisible takes boolean visible returns nothing @@ -37521,30 +37497,30 @@ function SetDiplomacyUIVisible takes boolean visible returns nothing local integer row= 0 local integer column= 0 local integer index= 0 - call BlzFrameSetVisible(DiplomacyUI___Background, visible) - call BlzFrameSetVisible(DiplomacyUI___Title, visible) - call BlzFrameSetVisible(DiplomacyUI___TableTitle, visible) - call BlzFrameSetVisible(DiplomacyUI___CancelButton, visible) - call BlzFrameSetVisible(DiplomacyUI___ApplyButton, visible) + call BlzFrameSetVisible(DiplomacyUI__Background, visible) + call BlzFrameSetVisible(DiplomacyUI__Title, visible) + call BlzFrameSetVisible(DiplomacyUI__TableTitle, visible) + call BlzFrameSetVisible(DiplomacyUI__CancelButton, visible) + call BlzFrameSetVisible(DiplomacyUI__ApplyButton, visible) set row=0 loop exitwhen ( row == bj_MAX_PLAYERS ) set rowPlayer=Player(row) - if ( IsPlayerInForce(rowPlayer, DiplomacyUI___allPlayers) ) then - call BlzFrameSetVisible(DiplomacyUI___ColumnTitles[row], visible) - call BlzFrameSetVisible(DiplomacyUI___RowTitles[row], visible) + if ( IsPlayerInForce(rowPlayer, DiplomacyUI__allPlayers) ) then + call BlzFrameSetVisible(DiplomacyUI__ColumnTitles[row], visible) + call BlzFrameSetVisible(DiplomacyUI__RowTitles[row], visible) set column=0 loop exitwhen ( column == bj_MAX_PLAYERS ) set columnPlayer=Player(column) - if ( IsPlayerInForce(columnPlayer, DiplomacyUI___allPlayers) ) then + if ( IsPlayerInForce(columnPlayer, DiplomacyUI__allPlayers) ) then if ( rowPlayer != columnPlayer ) then - set index=DiplomacyUI___Index2D(row , column , bj_MAX_PLAYERS) - call BlzFrameSetVisible(DiplomacyUI___Cells[index], visible) + set index=DiplomacyUI__Index2D(row , column , bj_MAX_PLAYERS) + call BlzFrameSetVisible(DiplomacyUI__Cells[index], visible) if ( not visible ) then - call BlzFrameSetVisible(DiplomacyUI___CellsTooltip[index], visible) + call BlzFrameSetVisible(DiplomacyUI__CellsTooltip[index], visible) endif endif endif @@ -37558,7 +37534,7 @@ function SetDiplomacyUIVisible takes boolean visible returns nothing endfunction function ShowDiplomacyUI takes nothing returns nothing - call DiplomacyUI___UpdateUI() + call DiplomacyUI__UpdateUI() call SetDiplomacyUIVisible(true) endfunction @@ -37566,7 +37542,7 @@ function HideDiplomacyUI takes nothing returns nothing call SetDiplomacyUIVisible(false) endfunction -function DiplomacyUI___TriggerActionSyncData takes nothing returns nothing +function DiplomacyUI__TriggerActionSyncData takes nothing returns nothing local player whichPlayer= GetTriggerPlayer() local integer playerId= GetPlayerId(whichPlayer) local string data= BlzGetTriggerSyncData() @@ -37582,7 +37558,7 @@ function DiplomacyUI___TriggerActionSyncData takes nothing returns nothing set otherPlayer=null endfunction -function DiplomacyUI___TriggerActionChat takes nothing returns nothing +function DiplomacyUI__TriggerActionChat takes nothing returns nothing if ( ((GetTriggerPlayer()) == GetHost()) ) then // INLINED!! if ( GetTriggerPlayer() == GetLocalPlayer() ) then call ShowDiplomacyUI() @@ -37592,7 +37568,7 @@ function DiplomacyUI___TriggerActionChat takes nothing returns nothing endif endfunction -function DiplomacyUI___ApplyFunction takes nothing returns nothing +function DiplomacyUI__ApplyFunction takes nothing returns nothing local player rowPlayer= null local player columnPlayer= null local integer row= 0 @@ -37601,16 +37577,16 @@ function DiplomacyUI___ApplyFunction takes nothing returns nothing loop exitwhen ( row == bj_MAX_PLAYERS ) set rowPlayer=Player(row) - if ( IsPlayerInForce(rowPlayer, DiplomacyUI___allPlayers) ) then + if ( IsPlayerInForce(rowPlayer, DiplomacyUI__allPlayers) ) then set column=0 loop exitwhen ( column == bj_MAX_PLAYERS ) set columnPlayer=Player(column) - if ( IsPlayerInForce(columnPlayer, DiplomacyUI___allPlayers) ) then + if ( IsPlayerInForce(columnPlayer, DiplomacyUI__allPlayers) ) then if ( rowPlayer != columnPlayer ) then - set index=DiplomacyUI___Index2D(row , column , bj_MAX_PLAYERS) + set index=DiplomacyUI__Index2D(row , column , bj_MAX_PLAYERS) if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(DiplomacyUI_PREFIX, I2S(row) + "_" + I2S(column) + "_" + I2S(R2I(BlzFrameGetValue(DiplomacyUI___Cells[index])))) + call BlzSendSyncData(DiplomacyUI_PREFIX, I2S(row) + "_" + I2S(column) + "_" + I2S(R2I(BlzFrameGetValue(DiplomacyUI__Cells[index])))) endif endif endif @@ -37624,7 +37600,7 @@ function DiplomacyUI___ApplyFunction takes nothing returns nothing call SetDiplomacyUIVisible(false) // INLINED!! endfunction -function DiplomacyUI___CreateUI takes nothing returns nothing +function DiplomacyUI__CreateUI takes nothing returns nothing local integer row= 0 local integer column= 0 local player rowPlayer= null @@ -37634,81 +37610,81 @@ function DiplomacyUI___CreateUI takes nothing returns nothing local real headerY= 0.0 local real y= 0.0 local integer index= 0 - local real cellWidth= DiplomacyUI_CELL_WIDTH * DiplomacyUI___scale - local real cellHeight= DiplomacyUI_CELL_HEIGHT * DiplomacyUI___scale + local real cellWidth= DiplomacyUI_CELL_WIDTH * DiplomacyUI__scale + local real cellHeight= DiplomacyUI_CELL_HEIGHT * DiplomacyUI__scale - set DiplomacyUI___Background=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(DiplomacyUI___Background, FRAMEPOINT_TOPLEFT, DiplomacyUI_X, DiplomacyUI_Y) - call BlzFrameSetAbsPoint(DiplomacyUI___Background, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_X + DiplomacyUI_WIDTH, DiplomacyUI_Y - DiplomacyUI_HEIGHT) + set DiplomacyUI__Background=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(DiplomacyUI__Background, FRAMEPOINT_TOPLEFT, DiplomacyUI_X, DiplomacyUI_Y) + call BlzFrameSetAbsPoint(DiplomacyUI__Background, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_X + DiplomacyUI_WIDTH, DiplomacyUI_Y - DiplomacyUI_HEIGHT) - set DiplomacyUI___Title=BlzCreateFrameByType("TEXT", "DiplomacyUITitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(DiplomacyUI___Title, FRAMEPOINT_TOPLEFT, DiplomacyUI_X, DiplomacyUI_TITLE_Y) - call BlzFrameSetAbsPoint(DiplomacyUI___Title, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_X + DiplomacyUI_WIDTH, DiplomacyUI_TITLE_Y - DiplomacyUI_TITLE_HEIGHT) - call BlzFrameSetText(DiplomacyUI___Title, DiplomacyUI_TITLE) - call BlzFrameSetTextAlignment(DiplomacyUI___Title, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + set DiplomacyUI__Title=BlzCreateFrameByType("TEXT", "DiplomacyUITitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(DiplomacyUI__Title, FRAMEPOINT_TOPLEFT, DiplomacyUI_X, DiplomacyUI_TITLE_Y) + call BlzFrameSetAbsPoint(DiplomacyUI__Title, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_X + DiplomacyUI_WIDTH, DiplomacyUI_TITLE_Y - DiplomacyUI_TITLE_HEIGHT) + call BlzFrameSetText(DiplomacyUI__Title, DiplomacyUI_TITLE) + call BlzFrameSetTextAlignment(DiplomacyUI__Title, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) set y=DiplomacyUI_Y - DiplomacyUI_TITLE_HEIGHT - DiplomacyUI_TITLE_VERTICAL_SPACE - cellHeight - set headerX=DiplomacyUI___indentionX + cellWidth + set headerX=DiplomacyUI__indentionX + cellWidth set headerY=DiplomacyUI_Y - DiplomacyUI_TITLE_HEIGHT - DiplomacyUI_TITLE_VERTICAL_SPACE - set DiplomacyUI___TableTitle=BlzCreateFrameByType("TEXT", "DiplomacyUITableTitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(DiplomacyUI___TableTitle, FRAMEPOINT_TOPLEFT, DiplomacyUI___indentionX, headerY) - call BlzFrameSetAbsPoint(DiplomacyUI___TableTitle, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI___indentionX + cellWidth, headerY - cellHeight) - call BlzFrameSetText(DiplomacyUI___TableTitle, DiplomacyUI_TABLE_TITLE) - call BlzFrameSetTextAlignment(DiplomacyUI___TableTitle, TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_LEFT) - call BlzFrameSetScale(DiplomacyUI___TableTitle, DiplomacyUI___scale) + set DiplomacyUI__TableTitle=BlzCreateFrameByType("TEXT", "DiplomacyUITableTitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(DiplomacyUI__TableTitle, FRAMEPOINT_TOPLEFT, DiplomacyUI__indentionX, headerY) + call BlzFrameSetAbsPoint(DiplomacyUI__TableTitle, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI__indentionX + cellWidth, headerY - cellHeight) + call BlzFrameSetText(DiplomacyUI__TableTitle, DiplomacyUI_TABLE_TITLE) + call BlzFrameSetTextAlignment(DiplomacyUI__TableTitle, TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_LEFT) + call BlzFrameSetScale(DiplomacyUI__TableTitle, DiplomacyUI__scale) - set DiplomacyUI___changeTrigger=CreateTrigger() - set DiplomacyUI___cancelTrigger=CreateTrigger() - set DiplomacyUI___applyTrigger=CreateTrigger() + set DiplomacyUI__changeTrigger=CreateTrigger() + set DiplomacyUI__cancelTrigger=CreateTrigger() + set DiplomacyUI__applyTrigger=CreateTrigger() - call TriggerAddAction(DiplomacyUI___changeTrigger, function DiplomacyUI___UpdateTooltips) + call TriggerAddAction(DiplomacyUI__changeTrigger, function DiplomacyUI__UpdateTooltips) set row=0 loop exitwhen ( row == bj_MAX_PLAYERS ) set rowPlayer=Player(row) - if ( IsPlayerInForce(rowPlayer, DiplomacyUI___allPlayers) ) then - set x=DiplomacyUI___indentionX + if ( IsPlayerInForce(rowPlayer, DiplomacyUI__allPlayers) ) then + set x=DiplomacyUI__indentionX - set DiplomacyUI___RowTitles[row]=BlzCreateFrameByType("BACKDROP", DiplomacyUI_PREFIX + "RowTitle" + I2S(row), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(DiplomacyUI___RowTitles[row], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(DiplomacyUI___RowTitles[row], FRAMEPOINT_BOTTOMRIGHT, x + cellHeight, y - cellHeight) + set DiplomacyUI__RowTitles[row]=BlzCreateFrameByType("BACKDROP", DiplomacyUI_PREFIX + "RowTitle" + I2S(row), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(DiplomacyUI__RowTitles[row], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(DiplomacyUI__RowTitles[row], FRAMEPOINT_BOTTOMRIGHT, x + cellHeight, y - cellHeight) //call BlzFrameSetText(RowTitles[row], GetPlayerNameColoredSimple(rowPlayer)) - call BlzFrameSetTexture(DiplomacyUI___RowTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! - call BlzFrameSetTextAlignment(DiplomacyUI___RowTitles[row], TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_LEFT) - call BlzFrameSetScale(DiplomacyUI___RowTitles[row], DiplomacyUI___scale) + call BlzFrameSetTexture(DiplomacyUI__RowTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! + call BlzFrameSetTextAlignment(DiplomacyUI__RowTitles[row], TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_LEFT) + call BlzFrameSetScale(DiplomacyUI__RowTitles[row], DiplomacyUI__scale) set x=x + cellHeight - set DiplomacyUI___ColumnTitles[row]=BlzCreateFrameByType("BACKDROP", DiplomacyUI_PREFIX + "ColumnTitle" + I2S(row), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(DiplomacyUI___ColumnTitles[row], FRAMEPOINT_TOPLEFT, headerX, headerY) - call BlzFrameSetAbsPoint(DiplomacyUI___ColumnTitles[row], FRAMEPOINT_BOTTOMRIGHT, headerX + cellHeight, headerY - cellHeight) + set DiplomacyUI__ColumnTitles[row]=BlzCreateFrameByType("BACKDROP", DiplomacyUI_PREFIX + "ColumnTitle" + I2S(row), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(DiplomacyUI__ColumnTitles[row], FRAMEPOINT_TOPLEFT, headerX, headerY) + call BlzFrameSetAbsPoint(DiplomacyUI__ColumnTitles[row], FRAMEPOINT_BOTTOMRIGHT, headerX + cellHeight, headerY - cellHeight) //call BlzFrameSetText(ColumnTitles[row], GetPlayerNameColoredSimple(rowPlayer)) - call BlzFrameSetTexture(DiplomacyUI___ColumnTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! - call BlzFrameSetTextAlignment(DiplomacyUI___ColumnTitles[row], TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - call BlzFrameSetScale(DiplomacyUI___ColumnTitles[row], DiplomacyUI___scale) + call BlzFrameSetTexture(DiplomacyUI__ColumnTitles[row], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(rowPlayer))) , 2)), 0, true) // INLINED!! + call BlzFrameSetTextAlignment(DiplomacyUI__ColumnTitles[row], TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + call BlzFrameSetScale(DiplomacyUI__ColumnTitles[row], DiplomacyUI__scale) set column=0 loop exitwhen ( column == bj_MAX_PLAYERS ) set columnPlayer=Player(column) - if ( IsPlayerInForce(columnPlayer, DiplomacyUI___allPlayers) ) then - set index=DiplomacyUI___Index2D(row , column , bj_MAX_PLAYERS) + if ( IsPlayerInForce(columnPlayer, DiplomacyUI__allPlayers) ) then + set index=DiplomacyUI__Index2D(row , column , bj_MAX_PLAYERS) if ( rowPlayer != columnPlayer ) then - set DiplomacyUI___Cells[index]=BlzCreateFrame("AlliancePopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(DiplomacyUI___Cells[index], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(DiplomacyUI___Cells[index], FRAMEPOINT_BOTTOMRIGHT, x + cellWidth, y - cellHeight) - call BlzFrameSetScale(DiplomacyUI___Cells[index], DiplomacyUI___scale) + set DiplomacyUI__Cells[index]=BlzCreateFrame("AlliancePopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(DiplomacyUI__Cells[index], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(DiplomacyUI__Cells[index], FRAMEPOINT_BOTTOMRIGHT, x + cellWidth, y - cellHeight) + call BlzFrameSetScale(DiplomacyUI__Cells[index], DiplomacyUI__scale) - call BlzTriggerRegisterFrameEvent(DiplomacyUI___changeTrigger, DiplomacyUI___Cells[index], FRAMEEVENT_POPUPMENU_ITEM_CHANGED) + call BlzTriggerRegisterFrameEvent(DiplomacyUI__changeTrigger, DiplomacyUI__Cells[index], FRAMEEVENT_POPUPMENU_ITEM_CHANGED) - set DiplomacyUI___CellsTooltip[index]=BlzCreateFrameByType("TEXT", DiplomacyUI_PREFIX + "CellsTooltip" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetTooltip(DiplomacyUI___Cells[index], DiplomacyUI___CellsTooltip[index]) - call BlzFrameSetAbsPoint(DiplomacyUI___CellsTooltip[index], FRAMEPOINT_TOPLEFT, DiplomacyUI_TOOLTIP_X, DiplomacyUI_TOOLTIP_Y) - call BlzFrameSetAbsPoint(DiplomacyUI___CellsTooltip[index], FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_TOOLTIP_X + DiplomacyUI_TOOLTIP_WIDTH, DiplomacyUI_TOOLTIP_Y - DiplomacyUI_TOOLTIP_HEIGHT) - call BlzFrameSetFont(DiplomacyUI___CellsTooltip[index], DiplomacyUI_TOOLTIP_FONT, DiplomacyUI_TOOLTIP_FONT_HEIGHT, 0) + set DiplomacyUI__CellsTooltip[index]=BlzCreateFrameByType("TEXT", DiplomacyUI_PREFIX + "CellsTooltip" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetTooltip(DiplomacyUI__Cells[index], DiplomacyUI__CellsTooltip[index]) + call BlzFrameSetAbsPoint(DiplomacyUI__CellsTooltip[index], FRAMEPOINT_TOPLEFT, DiplomacyUI_TOOLTIP_X, DiplomacyUI_TOOLTIP_Y) + call BlzFrameSetAbsPoint(DiplomacyUI__CellsTooltip[index], FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_TOOLTIP_X + DiplomacyUI_TOOLTIP_WIDTH, DiplomacyUI_TOOLTIP_Y - DiplomacyUI_TOOLTIP_HEIGHT) + call BlzFrameSetFont(DiplomacyUI__CellsTooltip[index], DiplomacyUI_TOOLTIP_FONT, DiplomacyUI_TOOLTIP_FONT_HEIGHT, 0) endif set x=x + cellWidth @@ -37724,29 +37700,29 @@ function DiplomacyUI___CreateUI takes nothing returns nothing set row=row + 1 endloop - set DiplomacyUI___CancelButton=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(DiplomacyUI___CancelButton, FRAMEPOINT_TOPLEFT, DiplomacyUI_CANCEL_BUTTON_X, DiplomacyUI_BUTTON_Y) - call BlzFrameSetAbsPoint(DiplomacyUI___CancelButton, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_CANCEL_BUTTON_X + DiplomacyUI_BUTTON_WIDTH, DiplomacyUI_BUTTON_Y - DiplomacyUI_BUTTON_HEIGHT) - call BlzFrameSetText(DiplomacyUI___CancelButton, DiplomacyUI_CANCEL) + set DiplomacyUI__CancelButton=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(DiplomacyUI__CancelButton, FRAMEPOINT_TOPLEFT, DiplomacyUI_CANCEL_BUTTON_X, DiplomacyUI_BUTTON_Y) + call BlzFrameSetAbsPoint(DiplomacyUI__CancelButton, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_CANCEL_BUTTON_X + DiplomacyUI_BUTTON_WIDTH, DiplomacyUI_BUTTON_Y - DiplomacyUI_BUTTON_HEIGHT) + call BlzFrameSetText(DiplomacyUI__CancelButton, DiplomacyUI_CANCEL) - set DiplomacyUI___cancelTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(DiplomacyUI___cancelTrigger, DiplomacyUI___CancelButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(DiplomacyUI___cancelTrigger, function HideDiplomacyUI) + set DiplomacyUI__cancelTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(DiplomacyUI__cancelTrigger, DiplomacyUI__CancelButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(DiplomacyUI__cancelTrigger, function HideDiplomacyUI) - set DiplomacyUI___ApplyButton=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(DiplomacyUI___ApplyButton, FRAMEPOINT_TOPLEFT, DiplomacyUI_APPLY_BUTTON_X, DiplomacyUI_BUTTON_Y) - call BlzFrameSetAbsPoint(DiplomacyUI___ApplyButton, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_APPLY_BUTTON_X + DiplomacyUI_BUTTON_WIDTH, DiplomacyUI_BUTTON_Y - DiplomacyUI_BUTTON_HEIGHT) - call BlzFrameSetText(DiplomacyUI___ApplyButton, DiplomacyUI_APPLY) + set DiplomacyUI__ApplyButton=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(DiplomacyUI__ApplyButton, FRAMEPOINT_TOPLEFT, DiplomacyUI_APPLY_BUTTON_X, DiplomacyUI_BUTTON_Y) + call BlzFrameSetAbsPoint(DiplomacyUI__ApplyButton, FRAMEPOINT_BOTTOMRIGHT, DiplomacyUI_APPLY_BUTTON_X + DiplomacyUI_BUTTON_WIDTH, DiplomacyUI_BUTTON_Y - DiplomacyUI_BUTTON_HEIGHT) + call BlzFrameSetText(DiplomacyUI__ApplyButton, DiplomacyUI_APPLY) - set DiplomacyUI___applyTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(DiplomacyUI___applyTrigger, DiplomacyUI___ApplyButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(DiplomacyUI___applyTrigger, function DiplomacyUI___ApplyFunction) + set DiplomacyUI__applyTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(DiplomacyUI__applyTrigger, DiplomacyUI__ApplyButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(DiplomacyUI__applyTrigger, function DiplomacyUI__ApplyFunction) - call DiplomacyUI___UpdateUI() + call DiplomacyUI__UpdateUI() call SetDiplomacyUIVisible(false) // INLINED!! endfunction -function DiplomacyUI___DestroyUI takes nothing returns nothing +function DiplomacyUI__DestroyUI takes nothing returns nothing local integer row= 0 local integer column= 0 local player rowPlayer= null @@ -37755,28 +37731,28 @@ function DiplomacyUI___DestroyUI takes nothing returns nothing call SetDiplomacyUIVisible(false) // INLINED!! - call BlzDestroyFrame(DiplomacyUI___Background) - call BlzDestroyFrame(DiplomacyUI___Title) - call BlzDestroyFrame(DiplomacyUI___TableTitle) + call BlzDestroyFrame(DiplomacyUI__Background) + call BlzDestroyFrame(DiplomacyUI__Title) + call BlzDestroyFrame(DiplomacyUI__TableTitle) set row=0 loop exitwhen ( row == bj_MAX_PLAYERS ) set rowPlayer=Player(row) - if ( IsPlayerInForce(rowPlayer, DiplomacyUI___allPlayers) ) then - call BlzDestroyFrame(DiplomacyUI___RowTitles[row]) - call BlzDestroyFrame(DiplomacyUI___ColumnTitles[row]) + if ( IsPlayerInForce(rowPlayer, DiplomacyUI__allPlayers) ) then + call BlzDestroyFrame(DiplomacyUI__RowTitles[row]) + call BlzDestroyFrame(DiplomacyUI__ColumnTitles[row]) set column=0 loop exitwhen ( column == bj_MAX_PLAYERS ) set columnPlayer=Player(column) - if ( IsPlayerInForce(columnPlayer, DiplomacyUI___allPlayers) ) then - set index=DiplomacyUI___Index2D(row , column , bj_MAX_PLAYERS) + if ( IsPlayerInForce(columnPlayer, DiplomacyUI__allPlayers) ) then + set index=DiplomacyUI__Index2D(row , column , bj_MAX_PLAYERS) if ( rowPlayer != columnPlayer ) then - call BlzDestroyFrame(DiplomacyUI___Cells[row]) - call BlzDestroyFrame(DiplomacyUI___CellsTooltip[row]) + call BlzDestroyFrame(DiplomacyUI__Cells[row]) + call BlzDestroyFrame(DiplomacyUI__CellsTooltip[row]) endif endif set columnPlayer=null @@ -37787,13 +37763,13 @@ function DiplomacyUI___DestroyUI takes nothing returns nothing set row=row + 1 endloop - call BlzDestroyFrame(DiplomacyUI___CancelButton) - call DestroyTrigger(DiplomacyUI___cancelTrigger) - call BlzDestroyFrame(DiplomacyUI___ApplyButton) - call DestroyTrigger(DiplomacyUI___applyTrigger) + call BlzDestroyFrame(DiplomacyUI__CancelButton) + call DestroyTrigger(DiplomacyUI__cancelTrigger) + call BlzDestroyFrame(DiplomacyUI__ApplyButton) + call DestroyTrigger(DiplomacyUI__applyTrigger) endfunction -function DiplomacyUI___TimerFunctionStart takes nothing returns nothing +function DiplomacyUI__TimerFunctionStart takes nothing returns nothing local timer t= GetExpiredTimer() local integer i= 0 local player slotPlayer= null @@ -37801,19 +37777,19 @@ function DiplomacyUI___TimerFunctionStart takes nothing returns nothing exitwhen ( i == bj_MAX_PLAYERS ) set slotPlayer=Player(i) if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER ) then - call BlzTriggerRegisterPlayerSyncEvent(DiplomacyUI___syncTrigger, slotPlayer, DiplomacyUI_PREFIX, false) - call TriggerRegisterPlayerChatEvent(DiplomacyUI___chatTrigger, slotPlayer, DiplomacyUI_CHAT_COMMAND, true) - call TriggerRegisterPlayerChatEvent(DiplomacyUI___chatTrigger, slotPlayer, DiplomacyUI_CHAT_COMMAND_SHORT, true) + call BlzTriggerRegisterPlayerSyncEvent(DiplomacyUI__syncTrigger, slotPlayer, DiplomacyUI_PREFIX, false) + call TriggerRegisterPlayerChatEvent(DiplomacyUI__chatTrigger, slotPlayer, DiplomacyUI_CHAT_COMMAND, true) + call TriggerRegisterPlayerChatEvent(DiplomacyUI__chatTrigger, slotPlayer, DiplomacyUI_CHAT_COMMAND_SHORT, true) endif set slotPlayer=null set i=i + 1 endloop - call TriggerAddAction(DiplomacyUI___syncTrigger, function DiplomacyUI___TriggerActionSyncData) - call TriggerAddAction(DiplomacyUI___chatTrigger, function DiplomacyUI___TriggerActionChat) + call TriggerAddAction(DiplomacyUI__syncTrigger, function DiplomacyUI__TriggerActionSyncData) + call TriggerAddAction(DiplomacyUI__chatTrigger, function DiplomacyUI__TriggerActionChat) call BlzLoadTOCFile(DiplomacyUI_TOC_FILE) - call DiplomacyUI___CreateUI() + call DiplomacyUI__CreateUI() call PauseTimer(t) call DestroyTimer(t) @@ -37826,26 +37802,26 @@ function SetDiplomacyUIPlayers takes force whichForce returns nothing local real height= I2R(cellsCount) * DiplomacyUI_CELL_HEIGHT local real widthScale= DiplomacyUI_TABLE_WIDTH / width local real heightScale= DiplomacyUI_TABLE_HEIGHT / height - set DiplomacyUI___scale=RMinBJ(widthScale, heightScale) + set DiplomacyUI__scale=RMinBJ(widthScale, heightScale) - if ( DiplomacyUI___allPlayers != null ) then + if ( DiplomacyUI__allPlayers != null ) then call SetDiplomacyUIVisible(false) // INLINED!! - call DiplomacyUI___DestroyUI() - call DestroyForce(DiplomacyUI___allPlayers) + call DiplomacyUI__DestroyUI() + call DestroyForce(DiplomacyUI__allPlayers) endif - set DiplomacyUI___allPlayers=whichForce + set DiplomacyUI__allPlayers=whichForce //call BJDebugMsg("with count " + I2S(cellsCount) + ": " + R2S(scale)) - set DiplomacyUI___indentionX=DiplomacyUI_X + ( DiplomacyUI_WIDTH - cellsCount * DiplomacyUI___scale * DiplomacyUI_CELL_WIDTH ) / 2.0 + set DiplomacyUI__indentionX=DiplomacyUI_X + ( DiplomacyUI_WIDTH - cellsCount * DiplomacyUI__scale * DiplomacyUI_CELL_WIDTH ) / 2.0 - call DiplomacyUI___CreateUI() + call DiplomacyUI__CreateUI() endfunction -function DiplomacyUI___Init takes nothing returns nothing +function DiplomacyUI__Init takes nothing returns nothing call SetDiplomacyUIPlayers(DiplomacyUIConfig_GetValidPlayers()) - call TimerStart(CreateTimer(), 0.0, false, function DiplomacyUI___TimerFunctionStart) + call TimerStart(CreateTimer(), 0.0, false, function DiplomacyUI__TimerFunctionStart) - call TriggerAddAction(FrameLoader___actionTrigger, (function DiplomacyUI___CreateUI)) // INLINED!! + call TriggerAddAction(FrameLoader___actionTrigger, (function DiplomacyUI__CreateUI)) // INLINED!! endfunction @@ -37856,13 +37832,13 @@ endfunction function StopDrainResources takes unit caster returns boolean local integer handleId= 0 - if ( IsUnitInGroup(caster, DrainResources___casters) ) then - call GroupRemoveUnit(DrainResources___casters, caster) + if ( IsUnitInGroup(caster, DrainResources__casters) ) then + call GroupRemoveUnit(DrainResources__casters, caster) set handleId=GetHandleId(caster) - call DestroyLightning(LoadLightningHandle(DrainResources___h, handleId, 1)) - call FlushChildHashtable(DrainResources___h, handleId) - if ( BlzGroupGetSize(DrainResources___casters) == 0 ) then - call PauseTimer(DrainResources___t) + call DestroyLightning(LoadLightningHandle(DrainResources__h, handleId, 1)) + call FlushChildHashtable(DrainResources__h, handleId) + if ( BlzGroupGetSize(DrainResources__casters) == 0 ) then + call PauseTimer(DrainResources__t) endif return true endif @@ -37870,17 +37846,17 @@ function StopDrainResources takes unit caster returns boolean return false endfunction -function DrainResources___IsDrainedResource takes integer index returns boolean +function DrainResources__IsDrainedResource takes integer index returns boolean local integer r= (s__Resource_resources[(index)]) // INLINED!! return r != Resources_GOLD and r != Resources_LUMBER and r != Resources_FOOD and r != Resources_FOOD_MAX endfunction -function DrainResources___Heal takes unit caster,integer amount returns nothing +function DrainResources__Heal takes unit caster,integer amount returns nothing call SetUnitLifeBJ(caster, RMinBJ(GetUnitState(caster, UNIT_STATE_LIFE) + I2R(amount), GetUnitState(caster, UNIT_STATE_MAX_LIFE))) call SetUnitManaBJ(caster, RMinBJ(GetUnitState(caster, UNIT_STATE_MANA) + I2R(amount), GetUnitState(caster, UNIT_STATE_MAX_MANA))) endfunction -function DrainResources___TimerFunctionDrainResources takes nothing returns nothing +function DrainResources__TimerFunctionDrainResources takes nothing returns nothing local unit caster= null local integer casterHandleId= 0 local unit target= null @@ -37895,17 +37871,17 @@ function DrainResources___TimerFunctionDrainResources takes nothing returns noth local integer j= 0 local integer i= 0 loop - exitwhen ( i == BlzGroupGetSize(DrainResources___casters) ) - set caster=BlzGroupUnitAt(DrainResources___casters, i) + exitwhen ( i == BlzGroupGetSize(DrainResources__casters) ) + set caster=BlzGroupUnitAt(DrainResources__casters, i) set owner=GetOwningPlayer(caster) set casterHandleId=GetHandleId(caster) - set target=LoadUnitHandle(DrainResources___h, casterHandleId, 0) + set target=LoadUnitHandle(DrainResources__h, casterHandleId, 0) if ( target == null ) then - set targetTree=LoadDestructableHandle(DrainResources___h, casterHandleId, 0) + set targetTree=LoadDestructableHandle(DrainResources__h, casterHandleId, 0) endif - set abilityId=LoadInteger(DrainResources___h, casterHandleId, 3) + set abilityId=LoadInteger(DrainResources__h, casterHandleId, 3) set atLeastOneResource=false if ( abilityId == DrainResources_ABILITY_ID ) then set spellDrainedAmount=1 + 3 * GetUnitAbilityLevel(caster, abilityId) @@ -37918,7 +37894,7 @@ function DrainResources___TimerFunctionDrainResources takes nothing returns noth if ( drainedAmount > 0 ) then call AddResourceAmount(target, drainedAmount * - 1) call AdjustPlayerStateBJ(drainedAmount, owner, PLAYER_STATE_RESOURCE_GOLD) - call DrainResources___Heal(caster , drainedAmount) + call DrainResources__Heal(caster , drainedAmount) set atLeastOneResource=true endif @@ -37926,13 +37902,13 @@ function DrainResources___TimerFunctionDrainResources takes nothing returns noth set j=0 loop exitwhen ( j == maxResources ) - if ( DrainResources___IsDrainedResource(j) ) then + if ( DrainResources__IsDrainedResource(j) ) then set r=(s__Resource_resources[(j)]) // INLINED!! set drainedAmount=IMinBJ(spellDrainedAmount, (LoadInteger(Resources___h, GetHandleId((target )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX)))) // INLINED!! if ( drainedAmount > 0 ) then call SetUnitResource(target , r , (LoadInteger(Resources___h, GetHandleId((target )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) - drainedAmount) // INLINED!! call SetPlayerResource(owner , r , GetPlayerResource(owner , r) + drainedAmount) - call DrainResources___Heal(caster , drainedAmount) + call DrainResources__Heal(caster , drainedAmount) set atLeastOneResource=true endif endif @@ -37943,7 +37919,7 @@ function DrainResources___TimerFunctionDrainResources takes nothing returns noth if ( drainedAmount > 0 ) then call SetDestructableLife(targetTree, GetDestructableLife(targetTree) - I2R(drainedAmount)) call AdjustPlayerStateBJ(drainedAmount, owner, PLAYER_STATE_RESOURCE_LUMBER) - call DrainResources___Heal(caster , drainedAmount) + call DrainResources__Heal(caster , drainedAmount) set atLeastOneResource=true endif endif @@ -37960,7 +37936,7 @@ function DrainResources___TimerFunctionDrainResources takes nothing returns noth endloop endfunction -function DrainResources___TargetHasCustomResources takes unit target returns boolean +function DrainResources__TargetHasCustomResources takes unit target returns boolean local integer r= 0 local integer maxResources= (s__Resource_resourcesCount) // INLINED!! local integer j= 0 @@ -37977,14 +37953,14 @@ endfunction function DrainResources takes integer abilityId,unit caster,unit target returns nothing local integer handleId= 0 - if ( GetResourceAmount(target) > 0 or DrainResources___TargetHasCustomResources(target) ) then - call GroupAddUnit(DrainResources___casters, caster) + if ( GetResourceAmount(target) > 0 or DrainResources__TargetHasCustomResources(target) ) then + call GroupAddUnit(DrainResources__casters, caster) set handleId=GetHandleId(caster) - call SaveUnitHandle(DrainResources___h, handleId, 0, target) - call SaveLightningHandle(DrainResources___h, handleId, 1, AddLightning("DRAB", true, GetUnitX(caster), GetUnitY(caster), GetUnitX(target), GetUnitY(target))) - call SaveInteger(DrainResources___h, handleId, 3, abilityId) - if ( BlzGroupGetSize(DrainResources___casters) == 1 ) then - call TimerStart(DrainResources___t, DrainResources_TIMER_INTERVAL, true, function DrainResources___TimerFunctionDrainResources) + call SaveUnitHandle(DrainResources__h, handleId, 0, target) + call SaveLightningHandle(DrainResources__h, handleId, 1, AddLightning("DRAB", true, GetUnitX(caster), GetUnitY(caster), GetUnitX(target), GetUnitY(target))) + call SaveInteger(DrainResources__h, handleId, 3, abilityId) + if ( BlzGroupGetSize(DrainResources__casters) == 1 ) then + call TimerStart(DrainResources__t, DrainResources_TIMER_INTERVAL, true, function DrainResources__TimerFunctionDrainResources) endif else call IssueImmediateOrder(caster, "stop") @@ -37995,13 +37971,13 @@ endfunction function DrainResourcesTree takes integer abilityId,unit caster,destructable target returns nothing local integer handleId= 0 if ( (IsTree(GetDestructableTypeId((target)))) ) then // INLINED!! - call GroupAddUnit(DrainResources___casters, caster) + call GroupAddUnit(DrainResources__casters, caster) set handleId=GetHandleId(caster) - call SaveDestructableHandle(DrainResources___h, handleId, 0, target) - call SaveLightningHandle(DrainResources___h, handleId, 1, AddLightning("DRAB", true, GetUnitX(caster), GetUnitY(caster), GetDestructableX(target), GetDestructableY(target))) - call SaveInteger(DrainResources___h, handleId, 3, abilityId) - if ( BlzGroupGetSize(DrainResources___casters) == 1 ) then - call TimerStart(DrainResources___t, DrainResources_TIMER_INTERVAL, true, function DrainResources___TimerFunctionDrainResources) + call SaveDestructableHandle(DrainResources__h, handleId, 0, target) + call SaveLightningHandle(DrainResources__h, handleId, 1, AddLightning("DRAB", true, GetUnitX(caster), GetUnitY(caster), GetDestructableX(target), GetDestructableY(target))) + call SaveInteger(DrainResources__h, handleId, 3, abilityId) + if ( BlzGroupGetSize(DrainResources__casters) == 1 ) then + call TimerStart(DrainResources__t, DrainResources_TIMER_INTERVAL, true, function DrainResources__TimerFunctionDrainResources) endif else call IssueImmediateOrder(caster, "stop") @@ -38009,7 +37985,7 @@ function DrainResourcesTree takes integer abilityId,unit caster,destructable tar endif endfunction -function DrainResources___TriggerConditionCast takes nothing returns boolean +function DrainResources__TriggerConditionCast takes nothing returns boolean if ( GetSpellAbilityId() == DrainResources_ABILITY_ID or GetSpellAbilityId() == DrainResources_ABILITY_ID_ITEM ) then if ( GetSpellTargetUnit() != null ) then call DrainResources(GetSpellAbilityId() , GetTriggerUnit() , GetSpellTargetUnit()) @@ -38022,22 +37998,22 @@ function DrainResources___TriggerConditionCast takes nothing returns boolean return false endfunction -function DrainResources___TriggerConditionStop takes nothing returns boolean - if ( IsUnitInGroup(GetTriggerUnit(), DrainResources___casters) ) then +function DrainResources__TriggerConditionStop takes nothing returns boolean + if ( IsUnitInGroup(GetTriggerUnit(), DrainResources__casters) ) then call StopDrainResources(GetTriggerUnit()) endif return false endfunction -function DrainResources___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(DrainResources___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(DrainResources___castTrigger, Condition(function DrainResources___TriggerConditionCast)) +function DrainResources__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(DrainResources__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(DrainResources__castTrigger, Condition(function DrainResources__TriggerConditionCast)) - call TriggerRegisterAnyUnitEventBJ(DrainResources___stopTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) - call TriggerRegisterAnyUnitEventBJ(DrainResources___stopTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) - call TriggerRegisterAnyUnitEventBJ(DrainResources___stopTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) - call TriggerRegisterAnyUnitEventBJ(DrainResources___stopTrigger, EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER) - call TriggerAddCondition(DrainResources___stopTrigger, Condition(function DrainResources___TriggerConditionStop)) + call TriggerRegisterAnyUnitEventBJ(DrainResources__stopTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) + call TriggerRegisterAnyUnitEventBJ(DrainResources__stopTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) + call TriggerRegisterAnyUnitEventBJ(DrainResources__stopTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) + call TriggerRegisterAnyUnitEventBJ(DrainResources__stopTrigger, EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER) + call TriggerAddCondition(DrainResources__stopTrigger, Condition(function DrainResources__TriggerConditionStop)) endfunction @@ -39429,50 +39405,50 @@ endfunction function GetTriggerShop takes nothing returns unit - return PagedButtons___triggerShop + return PagedButtons__triggerShop endfunction function GetTriggerPreviousPage takes nothing returns integer - return PagedButtons___triggerPreviousPage + return PagedButtons__triggerPreviousPage endfunction function GetTriggerAvailableObject takes nothing returns integer - return PagedButtons___triggerAvailableObject + return PagedButtons__triggerAvailableObject endfunction function TriggerRegisterChangePagedButtons takes trigger whichTrigger returns nothing - set PagedButtons___callbackTriggersChangePageButtons[PagedButtons___callbackTriggersChangePageButtonsCounter]=whichTrigger - set PagedButtons___callbackTriggersChangePageButtonsCounter=PagedButtons___callbackTriggersChangePageButtonsCounter + 1 + set PagedButtons__callbackTriggersChangePageButtons[PagedButtons__callbackTriggersChangePageButtonsCounter]=whichTrigger + set PagedButtons__callbackTriggersChangePageButtonsCounter=PagedButtons__callbackTriggersChangePageButtonsCounter + 1 endfunction function TriggerRegisterObjectAvailable takes trigger whichTrigger returns nothing - set PagedButtons___callbackTriggersObjectAvailable[PagedButtons___callbackTriggersObjectAvailableCounter]=whichTrigger - set PagedButtons___callbackTriggersObjectAvailableCounter=PagedButtons___callbackTriggersObjectAvailableCounter + 1 + set PagedButtons__callbackTriggersObjectAvailable[PagedButtons__callbackTriggersObjectAvailableCounter]=whichTrigger + set PagedButtons__callbackTriggersObjectAvailableCounter=PagedButtons__callbackTriggersObjectAvailableCounter + 1 endfunction -function PagedButtons___ExecuteChangedPageButtonsCallbacks takes unit shop,integer previousPage returns nothing +function PagedButtons__ExecuteChangedPageButtonsCallbacks takes unit shop,integer previousPage returns nothing local integer i= 0 - set PagedButtons___triggerShop=shop - set PagedButtons___triggerPreviousPage=previousPage + set PagedButtons__triggerShop=shop + set PagedButtons__triggerPreviousPage=previousPage set i=0 loop - exitwhen ( i == PagedButtons___callbackTriggersChangePageButtonsCounter ) - if ( IsTriggerEnabled(PagedButtons___callbackTriggersChangePageButtons[i]) ) then - call ConditionalTriggerExecute(PagedButtons___callbackTriggersChangePageButtons[i]) + exitwhen ( i == PagedButtons__callbackTriggersChangePageButtonsCounter ) + if ( IsTriggerEnabled(PagedButtons__callbackTriggersChangePageButtons[i]) ) then + call ConditionalTriggerExecute(PagedButtons__callbackTriggersChangePageButtons[i]) endif set i=i + 1 endloop endfunction -function PagedButtons___ExecuteObjectAvailableCallbacks takes unit shop,integer objectId returns nothing +function PagedButtons__ExecuteObjectAvailableCallbacks takes unit shop,integer objectId returns nothing local integer i= 0 - set PagedButtons___triggerShop=shop - set PagedButtons___triggerAvailableObject=objectId + set PagedButtons__triggerShop=shop + set PagedButtons__triggerAvailableObject=objectId set i=0 loop - exitwhen ( i == PagedButtons___callbackTriggersObjectAvailableCounter ) - if ( IsTriggerEnabled(PagedButtons___callbackTriggersObjectAvailable[i]) ) then - call ConditionalTriggerExecute(PagedButtons___callbackTriggersObjectAvailable[i]) + exitwhen ( i == PagedButtons__callbackTriggersObjectAvailableCounter ) + if ( IsTriggerEnabled(PagedButtons__callbackTriggersObjectAvailable[i]) ) then + call ConditionalTriggerExecute(PagedButtons__callbackTriggersObjectAvailable[i]) endif set i=i + 1 endloop @@ -39585,7 +39561,7 @@ endfunction endif endif - call PagedButtons___ExecuteObjectAvailableCallbacks(sg__PagedButtons_SlotType_get_shop(this) , sg__PagedButtons_SlotType_get_id(this)) + call PagedButtons__ExecuteObjectAvailableCallbacks(sg__PagedButtons_SlotType_get_shop(this) , sg__PagedButtons_SlotType_get_id(this)) endif endif set i=i + 1 @@ -39613,15 +39589,15 @@ endfunction function GetPagedButtonsShop takes unit shop returns integer - return LoadInteger(PagedButtons___h, GetHandleId(shop), 0) + return LoadInteger(PagedButtons__h, GetHandleId(shop), 0) endfunction function SetPagedButtonsShop takes unit shop,integer s returns nothing - call SaveInteger(PagedButtons___h, GetHandleId(shop), 0, s) + call SaveInteger(PagedButtons__h, GetHandleId(shop), 0, s) endfunction function GetPagedButtonsCount takes unit shop returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! if ( s != 0 ) then return sg__PagedButtons_Shop_get_buttonsCount(s) endif @@ -39629,7 +39605,7 @@ function GetPagedButtonsCount takes unit shop returns integer endfunction function GetPagedButtonsNonSpacerButtonsCount takes unit shop returns integer - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer result= 0 local integer t= 0 local integer i= 0 @@ -39645,13 +39621,13 @@ function GetPagedButtonsNonSpacerButtonsCount takes unit shop returns integer endfunction function GetPagedButton takes unit shop,integer index returns integer - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! return sg___PagedButtons_Shop_buttons_get(sg__PagedButtons_Shop_get_buttons(x)+index) endfunction function GetPagedButtonIndex takes unit shop,integer id returns integer - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer t= 0 local integer s= 0 local integer i= 0 @@ -39670,7 +39646,7 @@ function GetPagedButtonIndex takes unit shop,integer id returns integer endfunction function GetPagedButtonIndexEx takes unit shop,integer id,integer index returns integer - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer t= 0 local integer s= 0 local integer i= 0 @@ -39693,7 +39669,7 @@ function GetPagedButtonIndexEx takes unit shop,integer id,integer index returns endfunction function GetPagedButtonsCountEx takes unit shop,integer id returns integer - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer t= 0 local integer s= 0 local integer i= 0 @@ -39744,7 +39720,7 @@ function IsPagedButtonSpacer takes unit shop,integer index returns boolean endfunction function GetPagedButtonType takes unit shop,integer id returns integer - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer result= 0 local integer t= 0 local integer s= 0 @@ -39776,7 +39752,7 @@ function IsPagedButtonsIdUnit takes unit shop,integer id returns boolean endfunction function GetPagedButtonsSlotsPerPage takes unit shop returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! if ( s != 0 ) then return sg__PagedButtons_Shop_get_slotsPerPage(s) endif @@ -39784,7 +39760,7 @@ function GetPagedButtonsSlotsPerPage takes unit shop returns integer endfunction function GetPagedButtonsPage takes unit shop returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! if ( s != 0 ) then return sg__PagedButtons_Shop_get_currentPage(s) endif @@ -39792,7 +39768,7 @@ function GetPagedButtonsPage takes unit shop returns integer endfunction function GetPagedButtonsMaxPages takes unit shop returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! if ( s != 0 ) then return sg__PagedButtons_Shop_get_maxPages(s) endif @@ -39800,15 +39776,15 @@ function GetPagedButtonsMaxPages takes unit shop returns integer endfunction function GetPagedButtonsShopPage takes unit shop,integer page returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! if ( s != 0 and page >= 0 and page < sg__PagedButtons_Shop_get_maxPages(s) ) then return sg___PagedButtons_Shop_pages_get(sg__PagedButtons_Shop_get_pages(s)+page) endif return 0 endfunction -function PagedButtons___PrintPages takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__PrintPages takes unit shop returns nothing + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer p= 0 local integer i= 0 if ( s != 0 ) then @@ -39844,8 +39820,8 @@ function SetPagedButtonsCurrentPageName takes unit shop,string name returns noth call SetPagedButtonsPageName(shop , GetPagedButtonsPage(shop) , name) endfunction -function PagedButtons___ChangeShopUnitName takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__ChangeShopUnitName takes unit shop returns nothing + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer currentPage= GetPagedButtonsPage(shop) local string pageName= GetPagedButtonsPageName(shop , sg__PagedButtons_Shop_get_currentPage(s)) local string unitName= sg__PagedButtons_Shop_get_name(s) @@ -39864,8 +39840,8 @@ function PagedButtons___ChangeShopUnitName takes unit shop returns nothing endif endfunction -function PagedButtons___ResetShopUnitName takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__ResetShopUnitName takes unit shop returns nothing + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local string unitName= sg__PagedButtons_Shop_get_name(s) if ( unitName == null ) then set unitName="" @@ -39873,8 +39849,8 @@ function PagedButtons___ResetShopUnitName takes unit shop returns nothing call BlzSetUnitName(shop, unitName) endfunction -function PagedButtons___HidePagedButtonsCurrentPage takes unit shop returns nothing - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__HidePagedButtonsCurrentPage takes unit shop returns nothing + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer maxPages= sg__PagedButtons_Shop_get_maxPages(x) local integer totalCounter= sg__PagedButtons_Shop_get_buttonsCount(x) local integer countUnits= 0 @@ -39905,8 +39881,8 @@ function PagedButtons___HidePagedButtonsCurrentPage takes unit shop returns noth call SetItemTypeSlots(shop, 0) endfunction -function PagedButtons___ShowPagedButtonsCurrentPage takes unit shop returns nothing - local integer x= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__ShowPagedButtonsCurrentPage takes unit shop returns nothing + local integer x= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer maxPages= sg__PagedButtons_Shop_get_maxPages(x) local integer currentPage= sg__PagedButtons_Shop_get_currentPage(x) local integer totalCounter= sg__PagedButtons_Shop_get_buttonsCount(x) @@ -39981,7 +39957,7 @@ function PagedButtons___ShowPagedButtonsCurrentPage takes unit shop returns noth set i=i + 1 endloop - call PagedButtons___ChangeShopUnitName(shop) + call PagedButtons__ChangeShopUnitName(shop) // show the page buttons afterwards to make sure that they have a higher priority than the unit buttons @@ -39997,15 +39973,15 @@ endif endfunction function SetPagedButtonsPage takes unit shop,integer page returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer currentPage= sg__PagedButtons_Shop_get_currentPage(s) - call PagedButtons___HidePagedButtonsCurrentPage(shop) + call PagedButtons__HidePagedButtonsCurrentPage(shop) call sg__PagedButtons_Shop_set_currentPage(s,page) - call PagedButtons___ShowPagedButtonsCurrentPage(shop) + call PagedButtons__ShowPagedButtonsCurrentPage(shop) - call PagedButtons___ChangeShopUnitName(shop) + call PagedButtons__ChangeShopUnitName(shop) - call PagedButtons___ExecuteChangedPageButtonsCallbacks(shop , currentPage) + call PagedButtons__ExecuteChangedPageButtonsCallbacks(shop , currentPage) endfunction function SetPagedButtonEnabled takes unit shop,integer index,boolean enabled returns nothing @@ -40014,8 +39990,8 @@ function SetPagedButtonEnabled takes unit shop,integer index,boolean enabled ret call SetPagedButtonsPage(shop , GetPagedButtonsPage(shop)) endfunction -function PagedButtons___RefreshMaxPagesEx takes unit shop,integer maxPages returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__RefreshMaxPagesEx takes unit shop,integer maxPages returns nothing + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer oldMaxPages= sg__PagedButtons_Shop_get_maxPages(s) local integer i= 0 call sg__PagedButtons_Shop_set_maxPages(s,maxPages) @@ -40046,8 +40022,8 @@ function PagedButtons___RefreshMaxPagesEx takes unit shop,integer maxPages retur endif endfunction -function PagedButtons___RefreshMaxPages takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__RefreshMaxPages takes unit shop returns nothing + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer count= sg__PagedButtons_Shop_get_buttonsCount(s) local integer slots= sg__PagedButtons_Shop_get_slotsPerPage(s) local integer maxPages= count / slots @@ -40055,11 +40031,11 @@ function PagedButtons___RefreshMaxPages takes unit shop returns nothing set maxPages=maxPages + 1 endif set maxPages=IMaxBJ(maxPages, 1) - call PagedButtons___RefreshMaxPagesEx(shop , maxPages) + call PagedButtons__RefreshMaxPagesEx(shop , maxPages) endfunction function RemovePagedButtonsIndex takes unit shop,integer index returns boolean - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer t= 0 if ( s != 0 and index >= 0 and index <= sg__PagedButtons_Shop_get_buttonsCount(s) ) then set t=sg___PagedButtons_Shop_buttons_get(sg__PagedButtons_Shop_get_buttons(s)+index) @@ -40077,7 +40053,7 @@ function RemovePagedButtonsIndex takes unit shop,integer index returns boolean call sc__PagedButtons_Type_deallocate(t) // update buttons - call PagedButtons___RefreshMaxPages(shop) + call PagedButtons__RefreshMaxPages(shop) call SetPagedButtonsPage(shop , IMaxBJ(0, IMinBJ(GetPagedButtonsPage(shop), sg__PagedButtons_Shop_get_maxPages(s) - 1))) return true @@ -40096,13 +40072,13 @@ function RemovePagedButtonsId takes unit shop,integer id returns boolean endfunction function SetPagedButtonsSlotsPerPage takes unit shop,integer slots returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! call sg__PagedButtons_Shop_set_slotsPerPage(s,slots) - call PagedButtons___RefreshMaxPages(shop) + call PagedButtons__RefreshMaxPages(shop) call SetPagedButtonsPage(shop , GetPagedButtonsPage(shop)) endfunction -function PagedButtons___AddPageButtonsIdType takes unit shop,integer id,integer whichType returns integer +function PagedButtons__AddPageButtonsIdType takes unit shop,integer id,integer whichType returns integer local integer startStock= 1 local integer currentStock= 1 local integer maxStock= 1 @@ -40129,7 +40105,7 @@ function PagedButtons___AddPageButtonsIdType takes unit shop,integer id,integer endfunction function AddPagedButtonsId takes unit shop,integer id,integer whichType returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer t= 0 local integer index= 0 @@ -40140,11 +40116,11 @@ function AddPagedButtonsId takes unit shop,integer id,integer whichType returns if ( whichType == PagedButtons_BUTTON_TYPE_SPACER ) then set t=s__PagedButtons_SpacerType_create() else - set t=PagedButtons___AddPageButtonsIdType(shop , id , whichType) + set t=PagedButtons__AddPageButtonsIdType(shop , id , whichType) endif call sg___PagedButtons_Shop_buttons_set(sg__PagedButtons_Shop_get_buttons(s)+index,t) call sg__PagedButtons_Shop_set_buttonsCount(s,index + 1) - call PagedButtons___RefreshMaxPages(shop) + call PagedButtons__RefreshMaxPages(shop) call SetPagedButtonsPage(shop , GetPagedButtonsPage(shop)) //call BJDebugMsg("Added ID " + GetObjectName(id) + " to shop " + GetUnitName(shop) + " resulting in " + I2S(s.buttons.getSize()) + " buttons and " + I2S(s.maxPages) + " max pages.") @@ -40178,7 +40154,7 @@ call AddPagedButtonsId((shop) , 0 , PagedButtons_BUTTON_TYPE_SPACER) // INLINED! endfunction function GetPagedButtonsPageByIndex takes unit shop,integer index returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! if ( s != 0 ) then return index / sg__PagedButtons_Shop_get_slotsPerPage(s) endif @@ -40186,7 +40162,7 @@ function GetPagedButtonsPageByIndex takes unit shop,integer index returns intege endfunction function AddPagedButtonsSpacersRemaining takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer mod= 0 if ( s != 0 ) then set mod=ModuloInteger(sg__PagedButtons_Shop_get_buttonsCount(s), sg__PagedButtons_Shop_get_slotsPerPage(s)) @@ -40197,7 +40173,7 @@ function AddPagedButtonsSpacersRemaining takes unit shop returns nothing endfunction function NextPagedButtonsPage takes unit shop,string name returns integer - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer nextPage= 0 if ( s != 0 ) then // find the next page @@ -40209,12 +40185,12 @@ function NextPagedButtonsPage takes unit shop,string name returns integer //call BJDebugMsg("Adding remaining spacers for page " + I2S(nextPage)) call AddPagedButtonsSpacersRemaining(shop) endif - call PagedButtons___RefreshMaxPagesEx(shop , nextPage + 1) + call PagedButtons__RefreshMaxPagesEx(shop , nextPage + 1) //call BJDebugMsg("Setting name for next page " + I2S(nextPage) + ": " + name) call SetPagedButtonsPageName(shop , nextPage , name) - call PagedButtons___ChangeShopUnitName(shop) + call PagedButtons__ChangeShopUnitName(shop) //call BJDebugMsg("Set name for next page " + I2S(nextPage) + " to name " + name) @@ -40225,15 +40201,15 @@ function NextPagedButtonsPage takes unit shop,string name returns integer endfunction function HasPagedButtons takes unit shop returns boolean - return IsUnitInGroup(shop, PagedButtons___shops) + return IsUnitInGroup(shop, PagedButtons__shops) endfunction function EnablePagedButtons takes unit shop returns boolean - if ( not (IsUnitInGroup((shop), PagedButtons___shops)) ) then // INLINED!! + if ( not (IsUnitInGroup((shop), PagedButtons__shops)) ) then // INLINED!! call UnitAddAbility(shop, PagedButtons_ABILITY_ID_SELL_UNITS) call UnitAddAbility(shop, PagedButtons_ABILITY_ID_SELL_ITEMS) - call GroupAddUnit(PagedButtons___shops, shop) - call SaveInteger(PagedButtons___h, GetHandleId((shop )), 0, ( s__PagedButtons_Shop_create(GetUnitName(shop)))) // INLINED!! + call GroupAddUnit(PagedButtons__shops, shop) + call SaveInteger(PagedButtons__h, GetHandleId((shop )), 0, ( s__PagedButtons_Shop_create(GetUnitName(shop)))) // INLINED!! call SetPagedButtonsSlotsPerPage(shop , PagedButtons_SLOTS_PER_PAGE) return true @@ -40242,22 +40218,22 @@ function EnablePagedButtons takes unit shop returns boolean return false endfunction -function PagedButtons___DestroyPagedButtonsShopTypes takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! +function PagedButtons__DestroyPagedButtonsShopTypes takes unit shop returns nothing + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! call s__PagedButtons_Shop_deallocate(s) endfunction function DisablePagedButtons takes unit shop returns boolean - if ( (IsUnitInGroup((shop), PagedButtons___shops)) ) then // INLINED!! + if ( (IsUnitInGroup((shop), PagedButtons__shops)) ) then // INLINED!! - call PagedButtons___ResetShopUnitName(shop) + call PagedButtons__ResetShopUnitName(shop) call RemoveUnitFromStock(shop, PagedButtons_NEXT_PAGE_ID) call RemoveUnitFromStock(shop, PagedButtons_PREVIOUS_PAGE_ID) - call GroupRemoveUnit(PagedButtons___shops, shop) - call PagedButtons___HidePagedButtonsCurrentPage(shop) - call PagedButtons___DestroyPagedButtonsShopTypes(shop) - call FlushChildHashtable(PagedButtons___h, GetHandleId(shop)) + call GroupRemoveUnit(PagedButtons__shops, shop) + call PagedButtons__HidePagedButtonsCurrentPage(shop) + call PagedButtons__DestroyPagedButtonsShopTypes(shop) + call FlushChildHashtable(PagedButtons__h, GetHandleId(shop)) return true endif @@ -40266,7 +40242,7 @@ function DisablePagedButtons takes unit shop returns boolean endfunction function ChangePagedButtonsToNextPage takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer currentPage= sg__PagedButtons_Shop_get_currentPage(s) local integer maxPages= sg__PagedButtons_Shop_get_maxPages(s) if ( currentPage == maxPages - 1 ) then @@ -40277,7 +40253,7 @@ function ChangePagedButtonsToNextPage takes unit shop returns nothing endfunction function ChangePagedButtonsToPreviousPage takes unit shop returns nothing - local integer s= (LoadInteger(PagedButtons___h, GetHandleId((shop)), 0)) // INLINED!! + local integer s= (LoadInteger(PagedButtons__h, GetHandleId((shop)), 0)) // INLINED!! local integer currentPage= sg__PagedButtons_Shop_get_currentPage(s) local integer maxPages= sg__PagedButtons_Shop_get_maxPages(s) if ( currentPage == 0 ) then @@ -40287,18 +40263,18 @@ function ChangePagedButtonsToPreviousPage takes unit shop returns nothing endif endfunction -function PagedButtons___TriggerConditionDeath takes nothing returns boolean +function PagedButtons__TriggerConditionDeath takes nothing returns boolean call DisablePagedButtons(GetTriggerUnit()) return false endfunction -function PagedButtons___TriggerConditionSell takes nothing returns boolean - return (IsUnitInGroup((GetSellingUnit()), PagedButtons___shops)) // INLINED!! +function PagedButtons__TriggerConditionSell takes nothing returns boolean + return (IsUnitInGroup((GetSellingUnit()), PagedButtons__shops)) // INLINED!! endfunction -function PagedButtons___DisplayMsg takes unit shop,unit buyingUnit returns nothing +function PagedButtons__DisplayMsg takes unit shop,unit buyingUnit returns nothing local player owner= GetOwningPlayer(buyingUnit) local integer currentPage= GetPagedButtonsPage(shop) local string msg= "Page " + I2S(currentPage + 1) @@ -40324,14 +40300,14 @@ function PagedButtons___DisplayMsg takes unit shop,unit buyingUnit returns nothi set owner=null endfunction -function PagedButtons___UpdateStocksById takes unit shop,integer id returns nothing +function PagedButtons__UpdateStocksById takes unit shop,integer id returns nothing local integer s= GetPagedButtonType(shop , id) if ( s != 0 ) then call sg__PagedButtons_SlotType_set_currentStock(s,IMaxBJ(sg__PagedButtons_SlotType_get_currentStock(s) - 1, 0)) endif endfunction -function PagedButtons___TriggerActionSellUnit takes nothing returns nothing +function PagedButtons__TriggerActionSellUnit takes nothing returns nothing local unit shop= GetSellingUnit() local integer unitTypeId= GetUnitTypeId(GetSoldUnit()) if ( unitTypeId == PagedButtons_NEXT_PAGE_ID or unitTypeId == PagedButtons_PREVIOUS_PAGE_ID ) then @@ -40346,40 +40322,40 @@ function PagedButtons___TriggerActionSellUnit takes nothing returns nothing else - call PagedButtons___UpdateStocksById(shop , unitTypeId) + call PagedButtons__UpdateStocksById(shop , unitTypeId) endif set shop=null endfunction -function PagedButtons___TriggerActionSellItem takes nothing returns nothing +function PagedButtons__TriggerActionSellItem takes nothing returns nothing - call PagedButtons___UpdateStocksById(GetSellingUnit() , GetItemTypeId(GetSoldItem())) + call PagedButtons__UpdateStocksById(GetSellingUnit() , GetItemTypeId(GetSoldItem())) endfunction -function PagedButtons___TriggerConditionIsMarketplace takes nothing returns boolean +function PagedButtons__TriggerConditionIsMarketplace takes nothing returns boolean return GetUnitTypeId(GetSellingUnit()) == 'nmrk' endfunction -function PagedButtons___Init takes nothing returns nothing +function PagedButtons__Init takes nothing returns nothing - set PagedButtons___deathTrigger=CreateTrigger() - call TriggerRegisterAnyUnitEventBJ(PagedButtons___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(PagedButtons___deathTrigger, Condition(function PagedButtons___TriggerConditionDeath)) + set PagedButtons__deathTrigger=CreateTrigger() + call TriggerRegisterAnyUnitEventBJ(PagedButtons__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(PagedButtons__deathTrigger, Condition(function PagedButtons__TriggerConditionDeath)) - call TriggerRegisterAnyUnitEventBJ(PagedButtons___sellUnitTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(PagedButtons___sellUnitTrigger, Condition(function PagedButtons___TriggerConditionSell)) - call TriggerAddAction(PagedButtons___sellUnitTrigger, function PagedButtons___TriggerActionSellUnit) - call TriggerRegisterAnyUnitEventBJ(PagedButtons___sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(PagedButtons___sellItemTrigger, Condition(function PagedButtons___TriggerConditionSell)) - call TriggerAddAction(PagedButtons___sellItemTrigger, function PagedButtons___TriggerActionSellItem) + call TriggerRegisterAnyUnitEventBJ(PagedButtons__sellUnitTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(PagedButtons__sellUnitTrigger, Condition(function PagedButtons__TriggerConditionSell)) + call TriggerAddAction(PagedButtons__sellUnitTrigger, function PagedButtons__TriggerActionSellUnit) + call TriggerRegisterAnyUnitEventBJ(PagedButtons__sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(PagedButtons__sellItemTrigger, Condition(function PagedButtons__TriggerConditionSell)) + call TriggerAddAction(PagedButtons__sellItemTrigger, function PagedButtons__TriggerActionSellItem) - call TimerStart(PagedButtons___autoUpdateStockTimer, 1.0, true, function s__PagedButtons_SlotType_timerFunctionUpdateTime) + call TimerStart(PagedButtons__autoUpdateStockTimer, 1.0, true, function s__PagedButtons_SlotType_timerFunctionUpdateTime) - call TriggerAddCondition(bj_stockItemPurchased, Condition(function PagedButtons___TriggerConditionIsMarketplace)) + call TriggerAddCondition(bj_stockItemPurchased, Condition(function PagedButtons__TriggerConditionIsMarketplace)) endfunction @@ -40398,7 +40374,7 @@ endfunction function onDestHit takes integer kb,destructable hit returns nothing if GetDestructableTypeId(hit) == 'LTex' then call s__Knockback_deallocate(kb) - call DestroyEffect(AddSpecialEffect(Push___EXPLOSION_EFFECT, GetDestructableX(hit), GetDestructableY(hit))) + call DestroyEffect(AddSpecialEffect(Push__EXPLOSION_EFFECT, GetDestructableX(hit), GetDestructableY(hit))) call KillDestructable(hit) call UnitDamagePoint(s__Knockback_caster[kb], 0.15, 175., GetDestructableX(hit), GetDestructableY(hit), 150.00, false, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_FIRE, null) call RemoveDestructable(hit) @@ -40417,11 +40393,11 @@ endfunction local real angle= ( Atan2(( GetUnitY(s__Knockback_target[kb]) - GetUnitY(hit) ), ( GetUnitX(s__Knockback_target[kb]) - GetUnitX(hit) )) - 180 ) * bj_RADTODEG call UnitDamageTarget(s__Knockback_caster[kb], hit, 7.5, false, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null) if not s__Knockback_isUnitKnockedBack(hit) then - call s__Knockback_create(s__Knockback_caster[kb] , hit , s__Knockback_distance[kb] * 0.5 , s__Knockback_duration[kb] * 0.5 , angle , Push___FireBallKnockbackType) + call s__Knockback_create(s__Knockback_caster[kb] , hit , s__Knockback_distance[kb] * 0.5 , s__Knockback_duration[kb] * 0.5 , angle , Push__FireBallKnockbackType) endif endfunction - function Push___FilterTargets takes nothing returns boolean + function Push__FilterTargets takes nothing returns boolean return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) endfunction @@ -40435,14 +40411,14 @@ endfunction local real angle= 0.0 local integer i= 0 local integer targetCounter= 0 - call GroupEnumUnitsInRange(targets, x, y, 900.0, Filter(function Push___FilterTargets)) + call GroupEnumUnitsInRange(targets, x, y, 900.0, Filter(function Push__FilterTargets)) loop exitwhen ( i == BlzGroupGetSize(targets) ) set target=BlzGroupUnitAt(targets, i) if ( IsUnitEnemy(target, casterOwner) ) then set targetLoc=GetUnitLoc(target) set angle=AngleBetweenPoints(casterLoc, targetLoc) - call s__Knockback_addSpecialEffect(s__Knockback_create(caster , target , 500. , 1.5 , angle , Push___FireBallKnockbackType),Push___EFFECT , "origin") + call s__Knockback_addSpecialEffect(s__Knockback_create(caster , target , 500. , 1.5 , angle , Push__FireBallKnockbackType),Push__EFFECT , "origin") call RemoveLocation(targetLoc) set targetLoc=null set targetCounter=targetCounter + 1 @@ -40463,11 +40439,11 @@ endfunction endfunction //init - function Push___onInit takes nothing returns nothing - set Push___FireBallKnockbackType=s__KnockbackType__allocate() - set s__KnockbackType_onDestructableHitAction[Push___FireBallKnockbackType]=(1) - set s__KnockbackType_onUnitHitAction[Push___FireBallKnockbackType]=(1) - set s__KnockbackType_filterFunc[Push___FireBallKnockbackType]=(1) + function Push__onInit takes nothing returns nothing + set Push__FireBallKnockbackType=s__KnockbackType__allocate() + set s__KnockbackType_onDestructableHitAction[Push__FireBallKnockbackType]=(1) + set s__KnockbackType_onUnitHitAction[Push__FireBallKnockbackType]=(1) + set s__KnockbackType_filterFunc[Push__FireBallKnockbackType]=(1) endfunction @@ -40504,57 +40480,57 @@ function s__Queue_deallocate takes integer this returns nothing endfunction function IsQueueEnabledForPlayer takes player whichPlayer returns boolean - return Queue___isEnabledForPlayer[GetPlayerId(whichPlayer)] + return Queue__isEnabledForPlayer[GetPlayerId(whichPlayer)] endfunction function SetQueueEnabledForPlayer takes player whichPlayer,boolean enabled returns nothing - set Queue___isEnabledForPlayer[GetPlayerId(whichPlayer)]=enabled + set Queue__isEnabledForPlayer[GetPlayerId(whichPlayer)]=enabled endfunction -function Queue___SetSourceCounter takes unit source,integer id,integer count returns nothing - call SaveInteger(Queue___h, GetHandleId(source), id, count) +function Queue__SetSourceCounter takes unit source,integer id,integer count returns nothing + call SaveInteger(Queue__h, GetHandleId(source), id, count) endfunction -function Queue___GetSourceCounter takes unit source,integer id returns integer - return LoadInteger(Queue___h, GetHandleId(source), id) +function Queue__GetSourceCounter takes unit source,integer id returns integer + return LoadInteger(Queue__h, GetHandleId(source), id) endfunction -function Queue___ClearSourceCounter takes unit source returns nothing - call FlushChildHashtable(Queue___h, GetHandleId(source)) +function Queue__ClearSourceCounter takes unit source returns nothing + call FlushChildHashtable(Queue__h, GetHandleId(source)) endfunction function GetTriggerQueueUnit takes nothing returns unit - return Queue___triggerUnit + return Queue__triggerUnit endfunction function GetTriggerQueueId takes nothing returns integer - return Queue___triggerId + return Queue__triggerId endfunction function TriggerRegisterQueueEvent takes trigger whichTrigger returns nothing - set Queue___callbackTriggers[Queue___callbackTriggersCount]=whichTrigger - set Queue___callbackTriggersCount=Queue___callbackTriggersCount + 1 + set Queue__callbackTriggers[Queue__callbackTriggersCount]=whichTrigger + set Queue__callbackTriggersCount=Queue__callbackTriggersCount + 1 endfunction -function Queue___ExecuteTriggerCallbacks takes unit whichUnit,integer id returns nothing +function Queue__ExecuteTriggerCallbacks takes unit whichUnit,integer id returns nothing local integer i= 0 loop - exitwhen ( i == Queue___callbackTriggersCount ) - if ( IsTriggerEnabled(Queue___callbackTriggers[i]) ) then - set Queue___triggerUnit=whichUnit - set Queue___triggerId=id - call ConditionalTriggerExecute(Queue___callbackTriggers[i]) + exitwhen ( i == Queue__callbackTriggersCount ) + if ( IsTriggerEnabled(Queue__callbackTriggers[i]) ) then + set Queue__triggerUnit=whichUnit + set Queue__triggerId=id + call ConditionalTriggerExecute(Queue__callbackTriggers[i]) endif set i=i + 1 endloop endfunction function GetPlayerQueue takes player whichPlayer returns integer - return Queue___playerQueue[GetPlayerId(whichPlayer)] + return Queue__playerQueue[GetPlayerId(whichPlayer)] endfunction function GetPlayerQueueByIndex takes player whichPlayer,integer index returns integer - local integer current= (Queue___playerQueue[GetPlayerId((whichPlayer))]) // INLINED!! + local integer current= (Queue__playerQueue[GetPlayerId((whichPlayer))]) // INLINED!! local integer i= 0 loop exitwhen ( current == 0 or index == i ) @@ -40578,7 +40554,7 @@ function ClearQueue takes integer queue returns nothing loop exitwhen ( j == max ) set source=BlzGroupUnitAt(s__Queue_sources[current], j) - call SaveInteger(Queue___h, GetHandleId((source )), ( s__Queue_id[current] ), ( (LoadInteger(Queue___h, GetHandleId((source )), ( s__Queue_id[current]))) - 1)) // INLINED!! + call SaveInteger(Queue__h, GetHandleId((source )), ( s__Queue_id[current] ), ( (LoadInteger(Queue__h, GetHandleId((source )), ( s__Queue_id[current]))) - 1)) // INLINED!! set source=null set j=j + 1 endloop @@ -40588,7 +40564,7 @@ function ClearQueue takes integer queue returns nothing endfunction function AddQueue takes unit source,integer id returns nothing - local integer current= (Queue___playerQueue[GetPlayerId((GetOwningPlayer(source)))]) // INLINED!! + local integer current= (Queue__playerQueue[GetPlayerId((GetOwningPlayer(source)))]) // INLINED!! local integer previous= 0 local boolean found= false loop @@ -40608,8 +40584,8 @@ function AddQueue takes unit source,integer id returns nothing set s__Queue_id[current]=id //call BJDebugMsg("Creating new queue " + I2S(current) + " with previous " + I2S(previous)) - if ( Queue___playerQueue[GetPlayerId(GetOwningPlayer(source))] == 0 ) then - set Queue___playerQueue[GetPlayerId(GetOwningPlayer(source))]=current + if ( Queue__playerQueue[GetPlayerId(GetOwningPlayer(source))] == 0 ) then + set Queue__playerQueue[GetPlayerId(GetOwningPlayer(source))]=current elseif ( previous != 0 ) then set s__Queue_previous[current]=previous set s__Queue_next[previous]=current @@ -40622,16 +40598,16 @@ function AddQueue takes unit source,integer id returns nothing call GroupAddUnit(s__Queue_sources[current], source) endif - call SaveInteger(Queue___h, GetHandleId((source )), ( id ), ( (LoadInteger(Queue___h, GetHandleId((source )), ( id))) + 1)) // INLINED!! + call SaveInteger(Queue__h, GetHandleId((source )), ( id ), ( (LoadInteger(Queue__h, GetHandleId((source )), ( id))) + 1)) // INLINED!! set s__Queue_counter[current]=s__Queue_counter[current] + 1 - call Queue___ExecuteTriggerCallbacks(source , id) + call Queue__ExecuteTriggerCallbacks(source , id) endfunction function RemoveQueue takes unit source,integer id returns nothing local player owner= GetOwningPlayer(source) local integer playerId= GetPlayerId(owner) - local integer current= (Queue___playerQueue[GetPlayerId((owner))]) // INLINED!! + local integer current= (Queue__playerQueue[GetPlayerId((owner))]) // INLINED!! local integer previous= current local boolean found= false loop @@ -40647,126 +40623,126 @@ function RemoveQueue takes unit source,integer id returns nothing endloop if ( current != 0 ) then - call SaveInteger(Queue___h, GetHandleId((source )), ( id ), ( (LoadInteger(Queue___h, GetHandleId((source )), ( id))) - 1)) // INLINED!! + call SaveInteger(Queue__h, GetHandleId((source )), ( id ), ( (LoadInteger(Queue__h, GetHandleId((source )), ( id))) - 1)) // INLINED!! set s__Queue_counter[current]=s__Queue_counter[current] - 1 - if ( (LoadInteger(Queue___h, GetHandleId((source )), ( id))) == 0 ) then // INLINED!! + if ( (LoadInteger(Queue__h, GetHandleId((source )), ( id))) == 0 ) then // INLINED!! call GroupRemoveUnit(s__Queue_sources[current], source) endif if ( BlzGroupGetSize(s__Queue_sources[current]) == 0 ) then - if ( (Queue___playerQueue[GetPlayerId((owner))]) == current ) then // INLINED!! - set Queue___playerQueue[playerId]=s__Queue_next[current] + if ( (Queue__playerQueue[GetPlayerId((owner))]) == current ) then // INLINED!! + set Queue__playerQueue[playerId]=s__Queue_next[current] endif //call BJDebugMsg("Destroying " + I2S(current)) call s__Queue_deallocate(current) endif endif - call Queue___ExecuteTriggerCallbacks(source , id) + call Queue__ExecuteTriggerCallbacks(source , id) endfunction -function Queue___TriggerConditionCancelTrain takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! +function Queue__TriggerConditionCancelTrain takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! call RemoveQueue(GetTriggerUnit() , GetTrainedUnitType()) endif return false endfunction -function Queue___TriggerConditionFinishTrain takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! +function Queue__TriggerConditionFinishTrain takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! call RemoveQueue(GetTriggerUnit() , GetTrainedUnitType()) endif return false endfunction -function Queue___TriggerConditionCancelResearch takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! +function Queue__TriggerConditionCancelResearch takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! call RemoveQueue(GetTriggerUnit() , GetResearched()) endif return false endfunction -function Queue___TriggerConditionFinishResearch takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! +function Queue__TriggerConditionFinishResearch takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! call RemoveQueue(GetTriggerUnit() , GetResearched()) endif return false endfunction -function Queue___TriggerConditionCancelUpgrade takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! - call RemoveQueue(GetTriggerUnit() , LoadInteger(Queue___h, GetHandleId(GetTriggerUnit()), 0)) // Use the ID from start upgrade. +function Queue__TriggerConditionCancelUpgrade takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! + call RemoveQueue(GetTriggerUnit() , LoadInteger(Queue__h, GetHandleId(GetTriggerUnit()), 0)) // Use the ID from start upgrade. endif return false endfunction -function Queue___TriggerConditionFinishUpgrade takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! +function Queue__TriggerConditionFinishUpgrade takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! call RemoveQueue(GetTriggerUnit() , GetUnitTypeId(GetTriggerUnit())) // Already has the new ID from start upgrade at this point. endif return false endfunction -function Queue___TriggerConditionStartConstruct takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetConstructingStructure())))]) ) then // INLINED!! +function Queue__TriggerConditionStartConstruct takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetConstructingStructure())))]) ) then // INLINED!! call AddQueue(GetConstructingStructure() , GetUnitTypeId(GetConstructingStructure())) - call GroupAddUnit(Queue___constructions, GetConstructingStructure()) + call GroupAddUnit(Queue__constructions, GetConstructingStructure()) endif return false endfunction -function Queue___TriggerConditionCancelConstruct takes nothing returns boolean +function Queue__TriggerConditionCancelConstruct takes nothing returns boolean //call BJDebugMsg("Cancel construction of " + GetUnitName(GetTriggerUnit())) return false endfunction -function Queue___TriggerConditionFinishConstruct takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetConstructedStructure())))]) ) then // INLINED!! +function Queue__TriggerConditionFinishConstruct takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetConstructedStructure())))]) ) then // INLINED!! call RemoveQueue(GetConstructedStructure() , GetUnitTypeId(GetConstructedStructure())) - call GroupRemoveUnit(Queue___constructions, GetConstructedStructure()) + call GroupRemoveUnit(Queue__constructions, GetConstructedStructure()) endif return false endfunction -function Queue___TriggerConditionOrderReviveStart takes nothing returns boolean +function Queue__TriggerConditionOrderReviveStart takes nothing returns boolean //call BJDebugMsg("Altar " + GetUnitName(GetTriggerReviveAltar()) + " starts the revival of hero " + GetUnitName(GetTriggerReviveHero())) - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer((HeroReviveEvents___triggerReviveAltar))))]) ) then // INLINED!! - call AddQueue((HeroReviveEvents___triggerReviveAltar) , GetUnitTypeId((HeroReviveEvents___triggerReviveHero))) // INLINED!! + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer((HeroReviveEvents__triggerReviveAltar))))]) ) then // INLINED!! + call AddQueue((HeroReviveEvents__triggerReviveAltar) , GetUnitTypeId((HeroReviveEvents__triggerReviveHero))) // INLINED!! endif return false endfunction -function Queue___TriggerConditionOrderReviveCancel takes nothing returns boolean +function Queue__TriggerConditionOrderReviveCancel takes nothing returns boolean //call BJDebugMsg("Altar " + GetUnitName(GetTriggerReviveAltar()) + " cancels the revival of hero " + GetUnitName(GetTriggerReviveHero())) - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer((HeroReviveEvents___triggerReviveAltar))))]) ) then // INLINED!! - call RemoveQueue((HeroReviveEvents___triggerReviveAltar) , GetUnitTypeId((HeroReviveEvents___triggerReviveHero))) // INLINED!! + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer((HeroReviveEvents__triggerReviveAltar))))]) ) then // INLINED!! + call RemoveQueue((HeroReviveEvents__triggerReviveAltar) , GetUnitTypeId((HeroReviveEvents__triggerReviveHero))) // INLINED!! endif return false endfunction -function Queue___TriggerConditionFinishRevive takes nothing returns boolean +function Queue__TriggerConditionFinishRevive takes nothing returns boolean //call BJDebugMsg("Altar " + GetUnitName(GetTriggerReviveAltar()) + " finishes revival of hero " + GetUnitName(GetTriggerReviveHero())) - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer((HeroReviveEvents___triggerReviveAltar))))]) ) then // INLINED!! - call RemoveQueue((HeroReviveEvents___triggerReviveAltar) , GetUnitTypeId((HeroReviveEvents___triggerReviveHero))) // INLINED!! + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer((HeroReviveEvents__triggerReviveAltar))))]) ) then // INLINED!! + call RemoveQueue((HeroReviveEvents__triggerReviveAltar) , GetUnitTypeId((HeroReviveEvents__triggerReviveHero))) // INLINED!! endif return false endfunction -function Queue___IsValidBuilding takes unit whichUnit returns boolean +function Queue__IsValidBuilding takes unit whichUnit returns boolean if ( not IsUnitType(whichUnit, UNIT_TYPE_STRUCTURE) ) then return false elseif ( GetUnitAbilityLevel(whichUnit, 'Aneu') > 0 ) then @@ -40779,13 +40755,13 @@ function Queue___IsValidBuilding takes unit whichUnit returns boolean return true endfunction -function Queue___TriggerConditionOrder takes nothing returns boolean +function Queue__TriggerConditionOrder takes nothing returns boolean local unit building= GetTriggerUnit() local integer trainId= GetIssuedOrderId() //call BJDebugMsg("Order " + I2S(GetIssuedOrderId()) + ": " + GetObjectName(GetIssuedOrderId())) // Use only structures which do not sell units or items to avoid getting summoned and sold units and sold items. - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(building)))]) and GetObjectName(trainId) != Queue___EMPTY_STRING and GetObjectName(trainId) != null and Queue___IsValidBuilding(building) ) then // INLINED!! - call SaveInteger(Queue___h, GetHandleId(building), 0, trainId) + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(building)))]) and GetObjectName(trainId) != Queue__EMPTY_STRING and GetObjectName(trainId) != null and Queue__IsValidBuilding(building) ) then // INLINED!! + call SaveInteger(Queue__h, GetHandleId(building), 0, trainId) call AddQueue(building , trainId) endif @@ -40794,79 +40770,79 @@ function Queue___TriggerConditionOrder takes nothing returns boolean return false endfunction -function Queue___ClearSourceCounterExtended takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, Queue___constructions) ) then +function Queue__ClearSourceCounterExtended takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, Queue__constructions) ) then call RemoveQueue(whichUnit , GetUnitTypeId(whichUnit)) - call GroupRemoveUnit(Queue___constructions, whichUnit) + call GroupRemoveUnit(Queue__constructions, whichUnit) endif - call FlushChildHashtable(Queue___h, GetHandleId((whichUnit))) // INLINED!! + call FlushChildHashtable(Queue__h, GetHandleId((whichUnit))) // INLINED!! endfunction -function Queue___TriggerConditionDeath takes nothing returns boolean - if ( (Queue___isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! - call Queue___ClearSourceCounterExtended(GetTriggerUnit()) +function Queue__TriggerConditionDeath takes nothing returns boolean + if ( (Queue__isEnabledForPlayer[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) ) then // INLINED!! + call Queue__ClearSourceCounterExtended(GetTriggerUnit()) endif return false endfunction -function Queue___Init takes nothing returns nothing +function Queue__Init takes nothing returns nothing local player slotPlayer= null local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) set slotPlayer=Player(i) if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER ) then - set Queue___isEnabledForPlayer[i]=true + set Queue__isEnabledForPlayer[i]=true endif set slotPlayer=null set i=i + 1 endloop - call TriggerRegisterAnyUnitEventBJ(Queue___cancelTrainTrigger, EVENT_PLAYER_UNIT_TRAIN_CANCEL) - call TriggerAddCondition(Queue___cancelTrainTrigger, Condition(function Queue___TriggerConditionCancelTrain)) + call TriggerRegisterAnyUnitEventBJ(Queue__cancelTrainTrigger, EVENT_PLAYER_UNIT_TRAIN_CANCEL) + call TriggerAddCondition(Queue__cancelTrainTrigger, Condition(function Queue__TriggerConditionCancelTrain)) - call TriggerRegisterAnyUnitEventBJ(Queue___finishTrainTrigger, EVENT_PLAYER_UNIT_TRAIN_FINISH) - call TriggerAddCondition(Queue___finishTrainTrigger, Condition(function Queue___TriggerConditionFinishTrain)) + call TriggerRegisterAnyUnitEventBJ(Queue__finishTrainTrigger, EVENT_PLAYER_UNIT_TRAIN_FINISH) + call TriggerAddCondition(Queue__finishTrainTrigger, Condition(function Queue__TriggerConditionFinishTrain)) - call TriggerRegisterAnyUnitEventBJ(Queue___cancelResearchTrigger, EVENT_PLAYER_UNIT_RESEARCH_CANCEL) - call TriggerAddCondition(Queue___cancelResearchTrigger, Condition(function Queue___TriggerConditionCancelResearch)) + call TriggerRegisterAnyUnitEventBJ(Queue__cancelResearchTrigger, EVENT_PLAYER_UNIT_RESEARCH_CANCEL) + call TriggerAddCondition(Queue__cancelResearchTrigger, Condition(function Queue__TriggerConditionCancelResearch)) - call TriggerRegisterAnyUnitEventBJ(Queue___finishResearchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) - call TriggerAddCondition(Queue___finishResearchTrigger, Condition(function Queue___TriggerConditionFinishResearch)) + call TriggerRegisterAnyUnitEventBJ(Queue__finishResearchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) + call TriggerAddCondition(Queue__finishResearchTrigger, Condition(function Queue__TriggerConditionFinishResearch)) - call TriggerRegisterAnyUnitEventBJ(Queue___cancelUpgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_CANCEL) - call TriggerAddCondition(Queue___cancelUpgradeTrigger, Condition(function Queue___TriggerConditionCancelUpgrade)) + call TriggerRegisterAnyUnitEventBJ(Queue__cancelUpgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_CANCEL) + call TriggerAddCondition(Queue__cancelUpgradeTrigger, Condition(function Queue__TriggerConditionCancelUpgrade)) - call TriggerRegisterAnyUnitEventBJ(Queue___finishUpgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) - call TriggerAddCondition(Queue___finishUpgradeTrigger, Condition(function Queue___TriggerConditionFinishUpgrade)) + call TriggerRegisterAnyUnitEventBJ(Queue__finishUpgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) + call TriggerAddCondition(Queue__finishUpgradeTrigger, Condition(function Queue__TriggerConditionFinishUpgrade)) - call TriggerRegisterAnyUnitEventBJ(Queue___startConstructTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_START) - call TriggerAddCondition(Queue___startConstructTrigger, Condition(function Queue___TriggerConditionStartConstruct)) + call TriggerRegisterAnyUnitEventBJ(Queue__startConstructTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_START) + call TriggerAddCondition(Queue__startConstructTrigger, Condition(function Queue__TriggerConditionStartConstruct)) - call TriggerRegisterAnyUnitEventBJ(Queue___finishConstructTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(Queue___finishConstructTrigger, Condition(function Queue___TriggerConditionFinishConstruct)) + call TriggerRegisterAnyUnitEventBJ(Queue__finishConstructTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(Queue__finishConstructTrigger, Condition(function Queue__TriggerConditionFinishConstruct)) - call TriggerRegisterHeroReviveOrderStartEvent(Queue___orderReviveStartTrigger) - call TriggerAddCondition(Queue___orderReviveStartTrigger, Condition(function Queue___TriggerConditionOrderReviveStart)) + call TriggerRegisterHeroReviveOrderStartEvent(Queue__orderReviveStartTrigger) + call TriggerAddCondition(Queue__orderReviveStartTrigger, Condition(function Queue__TriggerConditionOrderReviveStart)) - call TriggerRegisterHeroReviveOrderCancelEvent(Queue___orderReviveCancelTrigger) - call TriggerAddCondition(Queue___orderReviveCancelTrigger, Condition(function Queue___TriggerConditionOrderReviveCancel)) + call TriggerRegisterHeroReviveOrderCancelEvent(Queue__orderReviveCancelTrigger) + call TriggerAddCondition(Queue__orderReviveCancelTrigger, Condition(function Queue__TriggerConditionOrderReviveCancel)) - call TriggerRegisterHeroReviveFinishEvent(Queue___finishReviveTrigger) - call TriggerAddCondition(Queue___finishReviveTrigger, Condition(function Queue___TriggerConditionFinishRevive)) + call TriggerRegisterHeroReviveFinishEvent(Queue__finishReviveTrigger) + call TriggerAddCondition(Queue__finishReviveTrigger, Condition(function Queue__TriggerConditionFinishRevive)) - call TriggerRegisterAnyUnitEventBJ(Queue___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) - call TriggerAddCondition(Queue___orderTrigger, Condition(function Queue___TriggerConditionOrder)) + call TriggerRegisterAnyUnitEventBJ(Queue__orderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) + call TriggerAddCondition(Queue__orderTrigger, Condition(function Queue__TriggerConditionOrder)) - call TriggerRegisterAnyUnitEventBJ(Queue___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(Queue___deathTrigger, Condition(function Queue___TriggerConditionDeath)) + call TriggerRegisterAnyUnitEventBJ(Queue__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(Queue__deathTrigger, Condition(function Queue__TriggerConditionDeath)) endfunction -//processed hook: hook RemoveUnit Queue___ClearSourceCounterExtended +//processed hook: hook RemoveUnit Queue__ClearSourceCounterExtended //library Queue ends @@ -42201,36 +42177,36 @@ endfunction function GetTauntsCount takes nothing returns integer - return Taunts___TauntsCount + return Taunts__TauntsCount endfunction function GetTauntChatCommand takes integer taunt returns string - return Taunts___TauntChatCommands[taunt] + return Taunts__TauntChatCommands[taunt] endfunction function GetTauntText takes integer taunt returns string - return Taunts___TauntTexts[taunt] + return Taunts__TauntTexts[taunt] endfunction function GetTauntSound takes integer taunt returns sound - return Taunts___TauntSounds[taunt] + return Taunts__TauntSounds[taunt] endfunction function SetPlayerTauntsEnabled takes player whichPlayer,boolean enabled returns nothing - set Taunts___TauntsEnabled[GetPlayerId(whichPlayer)]=enabled + set Taunts__TauntsEnabled[GetPlayerId(whichPlayer)]=enabled endfunction function IsPlayerTauntsEnabled takes player whichPlayer returns boolean - return Taunts___TauntsEnabled[GetPlayerId(whichPlayer)] + return Taunts__TauntsEnabled[GetPlayerId(whichPlayer)] endfunction function GetTauntsChatCommands takes nothing returns string local string text= "-taunts, -tauntson/off" local integer i= 0 - local integer max= (Taunts___TauntsCount) // INLINED!! + local integer max= (Taunts__TauntsCount) // INLINED!! loop exitwhen ( i == max ) - set text=text + ", " + (Taunts___TauntChatCommands[(i)]) // INLINED!! + set text=text + ", " + (Taunts__TauntChatCommands[(i)]) // INLINED!! set i=i + 1 endloop return text @@ -42242,9 +42218,9 @@ function PlayPlayerTaunt takes player whichPlayer,integer taunt returns nothing loop exitwhen ( i == bj_MAX_PLAYERS ) set slotPlayer=Player(i) - if ( (Taunts___TauntsEnabled[GetPlayerId((slotPlayer))]) ) then // INLINED!! + if ( (Taunts__TauntsEnabled[GetPlayerId((slotPlayer))]) ) then // INLINED!! if ( slotPlayer == GetLocalPlayer() ) then - call StartSound((Taunts___TauntSounds[(taunt)])) // INLINED!! + call StartSound((Taunts__TauntSounds[(taunt)])) // INLINED!! endif endif set slotPlayer=null @@ -42252,29 +42228,29 @@ function PlayPlayerTaunt takes player whichPlayer,integer taunt returns nothing endloop // send to all at once even to the ones which have disabled taunts // otherwise the player will see his/her chat messages listed n times - call h__BlzDisplayChatMessage(whichPlayer, 0, (Taunts___TauntTexts[(taunt)])) // INLINED!! + call h__BlzDisplayChatMessage(whichPlayer, 0, (Taunts__TauntTexts[(taunt)])) // INLINED!! endfunction -function Taunts___TriggerConditionChatCommand takes nothing returns boolean - local integer taunt= LoadInteger(Taunts___h, GetHandleId(GetTriggeringTrigger()), 0) +function Taunts__TriggerConditionChatCommand takes nothing returns boolean + local integer taunt= LoadInteger(Taunts__h, GetHandleId(GetTriggeringTrigger()), 0) call PlayPlayerTaunt(GetTriggerPlayer() , taunt) return false endfunction function AddTaunt takes string chatCommand,string text,sound whichSound returns integer - local integer index= Taunts___TauntsCount - set Taunts___TauntChatCommands[index]=chatCommand - set Taunts___TauntTexts[index]=text - set Taunts___TauntSounds[index]=whichSound - set Taunts___TauntsChatTrigger[index]=CreateTrigger() - call TriggerRegisterAnyPlayerChatEvent(Taunts___TauntsChatTrigger[index] , chatCommand , true) - call TriggerAddCondition(Taunts___TauntsChatTrigger[index], Condition(function Taunts___TriggerConditionChatCommand)) - call SaveInteger(Taunts___h, GetHandleId(Taunts___TauntsChatTrigger[index]), 0, index) - set Taunts___TauntsCount=Taunts___TauntsCount + 1 + local integer index= Taunts__TauntsCount + set Taunts__TauntChatCommands[index]=chatCommand + set Taunts__TauntTexts[index]=text + set Taunts__TauntSounds[index]=whichSound + set Taunts__TauntsChatTrigger[index]=CreateTrigger() + call TriggerRegisterAnyPlayerChatEvent(Taunts__TauntsChatTrigger[index] , chatCommand , true) + call TriggerAddCondition(Taunts__TauntsChatTrigger[index], Condition(function Taunts__TriggerConditionChatCommand)) + call SaveInteger(Taunts__h, GetHandleId(Taunts__TauntsChatTrigger[index]), 0, index) + set Taunts__TauntsCount=Taunts__TauntsCount + 1 return index endfunction -function Taunts___AddQuestItemSpecific takes string description returns nothing +function Taunts__AddQuestItemSpecific takes string description returns nothing call CreateQuestItem(bj_lastCreatedQuest , (description)) // INLINED!! @@ -42285,7 +42261,7 @@ endfunction function CreateTauntsQuest takes nothing returns quest local quest q= h__CreateQuestBJ(bj_QUESTTYPE_REQ_DISCOVERED, "Taunts", "Taunts can be used to send sounds with chat commands to other players.", "ReplaceableTextures\\CommandButtons\\BTNPandaTaunt.blp") local integer i= 0 - local integer max= (Taunts___TauntsCount) // INLINED!! + local integer max= (Taunts__TauntsCount) // INLINED!! set WoWReforgedInfoQuests__questHandle[WoWReforgedInfoQuests__questsMax - 1]=bj_lastCreatedQuest // INLINED!! @@ -42293,27 +42269,27 @@ function CreateTauntsQuest takes nothing returns quest call CreateQuestItem(bj_lastCreatedQuest , (("\"-tauntson/off\": Enables/disables taunts."))) // INLINED!! loop exitwhen ( i == max ) - call CreateQuestItem(bj_lastCreatedQuest , (("\"" + (Taunts___TauntChatCommands[(i)]) + "\": " + (Taunts___TauntTexts[(i)])))) // INLINED!! + call CreateQuestItem(bj_lastCreatedQuest , (("\"" + (Taunts__TauntChatCommands[(i)]) + "\": " + (Taunts__TauntTexts[(i)])))) // INLINED!! set i=i + 1 endloop return q endfunction -function Taunts___TriggerConditionTauntsOn takes nothing returns boolean - set Taunts___TauntsEnabled[GetPlayerId((GetTriggerPlayer() ))]=( true) // INLINED!! +function Taunts__TriggerConditionTauntsOn takes nothing returns boolean + set Taunts__TauntsEnabled[GetPlayerId((GetTriggerPlayer() ))]=( true) // INLINED!! call h__DisplayTimedTextToPlayer(GetTriggerPlayer(), 0.0, 0.0, 6.0, "Enabled taunts.") return false endfunction -function Taunts___TriggerConditionTauntsOff takes nothing returns boolean - set Taunts___TauntsEnabled[GetPlayerId((GetTriggerPlayer() ))]=( false) // INLINED!! +function Taunts__TriggerConditionTauntsOff takes nothing returns boolean + set Taunts__TauntsEnabled[GetPlayerId((GetTriggerPlayer() ))]=( false) // INLINED!! call h__DisplayTimedTextToPlayer(GetTriggerPlayer(), 0.0, 0.0, 6.0, "Disabled taunts.") return false endfunction -function Taunts___TriggerConditionTaunts takes nothing returns boolean +function Taunts__TriggerConditionTaunts takes nothing returns boolean local string msg= "Taunts (disabled): " - if ( (Taunts___TauntsEnabled[GetPlayerId((GetTriggerPlayer()))]) ) then // INLINED!! + if ( (Taunts__TauntsEnabled[GetPlayerId((GetTriggerPlayer()))]) ) then // INLINED!! set msg="Taunts (enabled): " endif set msg=msg + GetTauntsChatCommands() @@ -42321,19 +42297,19 @@ function Taunts___TriggerConditionTaunts takes nothing returns boolean return false endfunction -function Taunts___Init takes nothing returns nothing +function Taunts__Init takes nothing returns nothing local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) - set Taunts___TauntsEnabled[i]=true + set Taunts__TauntsEnabled[i]=true set i=i + 1 endloop - call TriggerRegisterAnyPlayerChatEvent(Taunts___TauntsEnableChatTrigger , "-tauntson" , true) - call TriggerAddCondition(Taunts___TauntsEnableChatTrigger, Condition(function Taunts___TriggerConditionTauntsOn)) - call TriggerRegisterAnyPlayerChatEvent(Taunts___TauntsDisableChatTrigger , "-tauntsoff" , true) - call TriggerAddCondition(Taunts___TauntsDisableChatTrigger, Condition(function Taunts___TriggerConditionTauntsOff)) - call TriggerRegisterAnyPlayerChatEvent(Taunts___TauntsListChatTrigger , "-taunts" , true) - call TriggerAddCondition(Taunts___TauntsListChatTrigger, Condition(function Taunts___TriggerConditionTaunts)) + call TriggerRegisterAnyPlayerChatEvent(Taunts__TauntsEnableChatTrigger , "-tauntson" , true) + call TriggerAddCondition(Taunts__TauntsEnableChatTrigger, Condition(function Taunts__TriggerConditionTauntsOn)) + call TriggerRegisterAnyPlayerChatEvent(Taunts__TauntsDisableChatTrigger , "-tauntsoff" , true) + call TriggerAddCondition(Taunts__TauntsDisableChatTrigger, Condition(function Taunts__TriggerConditionTauntsOff)) + call TriggerRegisterAnyPlayerChatEvent(Taunts__TauntsListChatTrigger , "-taunts" , true) + call TriggerAddCondition(Taunts__TauntsListChatTrigger, Condition(function Taunts__TriggerConditionTaunts)) endfunction @@ -42559,7 +42535,7 @@ endfunction //Implemented from module UnitEventEx__UnitEventExCore: - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___afterIndex takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__afterIndex takes nothing returns nothing local integer i= UnitEventEx__Stack local integer id local unit u @@ -42605,15 +42581,15 @@ endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___timerCheck takes unit u returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__timerCheck takes unit u returns nothing set UnitEventEx__Stack=UnitEventEx__Stack + 1 set UnitEventEx__IndexedUnit[UnitEventEx__Stack]=u - call TimerStart(UnitEventEx__AfterIndexTimer, 0., false, function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___afterIndex) + call TimerStart(UnitEventEx__AfterIndexTimer, 0., false, function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__afterIndex) endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___unload takes unit u returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__unload takes unit u returns nothing local integer id= (GetUnitUserData((u))) // INLINED!! local integer cargo_id= (GetUnitUserData((UnitEventEx__CargoUnit[id]))) // INLINED!! @@ -42626,7 +42602,7 @@ endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onOrder takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onOrder takes nothing returns nothing local unit u= GetTriggerUnit() local integer id= (GetUnitUserData((u))) // INLINED!! @@ -42644,7 +42620,7 @@ endfunction // This does not detect unloaded corpses. if UnitEventEx__CargoUnit[id] != null and not IsUnitLoaded(u) or UnitAlive(u) then - call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___unload(u) + call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__unload(u) endif set u=null @@ -42727,7 +42703,7 @@ endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onDeath takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onDeath takes nothing returns nothing local unit u= GetTriggerUnit() local integer id= (GetUnitUserData((u))) // INLINED!! @@ -42748,14 +42724,14 @@ endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onLoad takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onLoad takes nothing returns nothing local unit u= GetTriggerUnit() local integer id= (GetUnitUserData((u))) // INLINED!! local integer cargo_id // if unit somehow loaded into a transport while being inside another, unload it if UnitEventEx__CargoUnit[id] != null then - call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___unload(u) + call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__unload(u) endif @@ -42787,7 +42763,7 @@ endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onEnter takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onEnter takes nothing returns nothing local unit u= GetFilterUnit() local integer id= (GetUnitUserData((u))) // INLINED!! local integer cargo_id= (GetUnitUserData((UnitEventEx__CargoUnit[id]))) // INLINED!! @@ -42797,7 +42773,7 @@ endfunction // The unit was dead, but has re-entered the map. Used to detect when a Meat Wagon unloads a corpse. if id > 0 then if not IsUnitLoaded(u) and UnitEventEx__CargoUnit[id] != null then - call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___unload(u) + call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__unload(u) endif endif @@ -42806,7 +42782,7 @@ endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onIndex takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onIndex takes nothing returns nothing local unit u= (s__UnitDex_Unit[s__UnitDex_LastIndex]) // INLINED!! local integer id= (GetUnitUserData((u))) // INLINED!! @@ -42831,14 +42807,14 @@ endfunction endif // This is called here so as to set the variable IsNew[] to false after 0. seconds. - call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___timerCheck(u) + call s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__timerCheck(u) set u=null endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onDeindex takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onDeindex takes nothing returns nothing local unit u= (s__UnitDex_Unit[s__UnitDex_LastIndex]) // INLINED!! local integer id= (GetUnitUserData((u))) // INLINED!! @@ -42850,7 +42826,7 @@ endfunction endfunction - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onInit takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onInit takes nothing returns nothing local integer i @@ -42871,8 +42847,8 @@ endfunction set EVENT_ON_REINCARNATION_FINISH=CreateNativeEvent() set EVENT_ON_UNIT_CREATED=CreateNativeEvent() - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER , function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_DEATH , function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onDeath) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER , function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_DEATH , function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onDeath) @@ -42885,16 +42861,16 @@ endfunction - call TriggerRegisterEnterRegion(CreateTrigger(), s__WorldBounds_worldRegion, Condition(function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onEnter)) + call TriggerRegisterEnterRegion(CreateTrigger(), s__WorldBounds_worldRegion, Condition(function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onEnter)) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_LOADED , function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onLoad) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_LOADED , function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onLoad) - call RegisterUnitIndexEvent(Condition(function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onDeindex) , EVENT_UNIT_DEINDEX) + call RegisterUnitIndexEvent(Condition(function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onDeindex) , EVENT_UNIT_DEINDEX) - call RegisterUnitIndexEvent(Condition(function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onIndex) , EVENT_UNIT_INDEX) + call RegisterUnitIndexEvent(Condition(function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onIndex) , EVENT_UNIT_INDEX) @@ -42906,14 +42882,14 @@ endfunction // see resurrectionTimer below. - call TimerStart(CreateTimer(), 0., false, function sc__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer) + call TimerStart(CreateTimer(), 0., false, function sc__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer) endfunction // for some reason dummy recyclers creating dummies to store fires off a resurrection event, so // this boolean rezCheck is set to false after a 0. second timer to prevent this from happening. // rezCheck must be false for a resurrection event to happen. - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer takes nothing returns nothing + function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer takes nothing returns nothing set UnitEventEx__rezCheck=false call DestroyTimer(GetExpiredTimer()) endfunction @@ -43096,125 +43072,125 @@ endfunction function GetRespawningUnit takes nothing returns unit - return UnitGroupRespawnSystem___callbackUnit + return UnitGroupRespawnSystem__callbackUnit endfunction function GetRespawningUnitIndex takes nothing returns integer - return UnitGroupRespawnSystem___callbackIndex + return UnitGroupRespawnSystem__callbackIndex endfunction function TriggerRegisterUnitRespawnEvent takes trigger whichTrigger returns nothing - local integer index= UnitGroupRespawnSystem___callbackRespawnTriggersCounter - set UnitGroupRespawnSystem___callbackRespawnTriggers[index]=whichTrigger - set UnitGroupRespawnSystem___callbackRespawnTriggersCounter=UnitGroupRespawnSystem___callbackRespawnTriggersCounter + 1 + local integer index= UnitGroupRespawnSystem__callbackRespawnTriggersCounter + set UnitGroupRespawnSystem__callbackRespawnTriggers[index]=whichTrigger + set UnitGroupRespawnSystem__callbackRespawnTriggersCounter=UnitGroupRespawnSystem__callbackRespawnTriggersCounter + 1 endfunction -function UnitGroupRespawnSystem___EvaluateAndExecuteCallbackRespawnTriggers takes integer index returns nothing +function UnitGroupRespawnSystem__EvaluateAndExecuteCallbackRespawnTriggers takes integer index returns nothing local integer i= 0 loop - exitwhen ( i >= UnitGroupRespawnSystem___callbackRespawnTriggersCounter ) - if ( IsTriggerEnabled(UnitGroupRespawnSystem___callbackRespawnTriggers[i]) ) then - set UnitGroupRespawnSystem___callbackUnit=UnitGroupRespawnSystem___respawnUnitUnit[index] - set UnitGroupRespawnSystem___callbackIndex=index - call ConditionalTriggerExecute(UnitGroupRespawnSystem___callbackRespawnTriggers[i]) + exitwhen ( i >= UnitGroupRespawnSystem__callbackRespawnTriggersCounter ) + if ( IsTriggerEnabled(UnitGroupRespawnSystem__callbackRespawnTriggers[i]) ) then + set UnitGroupRespawnSystem__callbackUnit=UnitGroupRespawnSystem__respawnUnitUnit[index] + set UnitGroupRespawnSystem__callbackIndex=index + call ConditionalTriggerExecute(UnitGroupRespawnSystem__callbackRespawnTriggers[i]) endif set i=i + 1 endloop endfunction function TriggerRegisterUnitRespawnStartsEvent takes trigger whichTrigger returns nothing - local integer index= UnitGroupRespawnSystem___callbackRespawnStartsTriggersCounter - set UnitGroupRespawnSystem___callbackRespawnStartsTriggers[index]=whichTrigger - set UnitGroupRespawnSystem___callbackRespawnStartsTriggersCounter=UnitGroupRespawnSystem___callbackRespawnStartsTriggersCounter + 1 + local integer index= UnitGroupRespawnSystem__callbackRespawnStartsTriggersCounter + set UnitGroupRespawnSystem__callbackRespawnStartsTriggers[index]=whichTrigger + set UnitGroupRespawnSystem__callbackRespawnStartsTriggersCounter=UnitGroupRespawnSystem__callbackRespawnStartsTriggersCounter + 1 endfunction -function UnitGroupRespawnSystem___EvaluateAndExecuteCallbackRespawnStartsTriggers takes integer index returns nothing +function UnitGroupRespawnSystem__EvaluateAndExecuteCallbackRespawnStartsTriggers takes integer index returns nothing local integer i= 0 loop - exitwhen ( i >= UnitGroupRespawnSystem___callbackRespawnStartsTriggersCounter ) - if ( IsTriggerEnabled(UnitGroupRespawnSystem___callbackRespawnStartsTriggers[i]) ) then - set UnitGroupRespawnSystem___callbackUnit=UnitGroupRespawnSystem___respawnUnitUnit[index] - set UnitGroupRespawnSystem___callbackIndex=index - call ConditionalTriggerExecute(UnitGroupRespawnSystem___callbackRespawnStartsTriggers[i]) + exitwhen ( i >= UnitGroupRespawnSystem__callbackRespawnStartsTriggersCounter ) + if ( IsTriggerEnabled(UnitGroupRespawnSystem__callbackRespawnStartsTriggers[i]) ) then + set UnitGroupRespawnSystem__callbackUnit=UnitGroupRespawnSystem__respawnUnitUnit[index] + set UnitGroupRespawnSystem__callbackIndex=index + call ConditionalTriggerExecute(UnitGroupRespawnSystem__callbackRespawnStartsTriggers[i]) endif set i=i + 1 endloop endfunction -function UnitGroupRespawnSystem___ClearRespawnUnitIndex takes integer handleID returns nothing - if ( HaveSavedInteger(UnitGroupRespawnSystem___respawnUnitHashTable, handleID, 0) ) then - call FlushChildHashtable(UnitGroupRespawnSystem___respawnUnitHashTable, handleID) +function UnitGroupRespawnSystem__ClearRespawnUnitIndex takes integer handleID returns nothing + if ( HaveSavedInteger(UnitGroupRespawnSystem__respawnUnitHashTable, handleID, 0) ) then + call FlushChildHashtable(UnitGroupRespawnSystem__respawnUnitHashTable, handleID) endif endfunction -function UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID takes integer handleID returns integer - if ( HaveSavedInteger(UnitGroupRespawnSystem___respawnUnitHashTable, handleID, 0) ) then - return LoadInteger(UnitGroupRespawnSystem___respawnUnitHashTable, handleID, 0) +function UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID takes integer handleID returns integer + if ( HaveSavedInteger(UnitGroupRespawnSystem__respawnUnitHashTable, handleID, 0) ) then + return LoadInteger(UnitGroupRespawnSystem__respawnUnitHashTable, handleID, 0) endif return - 1 endfunction function GetUnitRespawnUnitIndex takes unit whichUnit returns integer - return UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId(whichUnit)) + return UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId(whichUnit)) endfunction function GetRespawnUnitCounter takes nothing returns integer - return UnitGroupRespawnSystem___respawnUnitCounter + return UnitGroupRespawnSystem__respawnUnitCounter endfunction function IsRespawnUnitValid takes integer index returns boolean - return index > 0 and UnitGroupRespawnSystem___respawnUnitIsValid[index] + return index > 0 and UnitGroupRespawnSystem__respawnUnitIsValid[index] endfunction function IsRespawnUnitGroupValid takes integer index returns boolean - return index > 0 and UnitGroupRespawnSystem___respawnUnitGroupIsValid[index] + return index > 0 and UnitGroupRespawnSystem__respawnUnitGroupIsValid[index] endfunction function RespawnUnit takes integer index returns boolean local boolean add= false - local integer groupIndex= UnitGroupRespawnSystem___respawnUnitGroupIndex[index] + local integer groupIndex= UnitGroupRespawnSystem__respawnUnitGroupIndex[index] if ( not IsRespawnUnitValid(index) ) then return false endif - if ( UnitGroupRespawnSystem___respawnUnitType[index] == UNIT_RESPAWN_TYPE_UNIT ) then - if ( UnitGroupRespawnSystem___respawnUnitUnit[index] != null and IsUnitType(UnitGroupRespawnSystem___respawnUnitUnit[index], UNIT_TYPE_HERO) ) then - call ReviveHero(UnitGroupRespawnSystem___respawnUnitUnit[index], UnitGroupRespawnSystem___respawnUnitX[index], UnitGroupRespawnSystem___respawnUnitY[index], UnitGroupRespawnSystemConfig_HERO_RESPAWN_DO_EYECANDY) + if ( UnitGroupRespawnSystem__respawnUnitType[index] == UNIT_RESPAWN_TYPE_UNIT ) then + if ( UnitGroupRespawnSystem__respawnUnitUnit[index] != null and IsUnitType(UnitGroupRespawnSystem__respawnUnitUnit[index], UNIT_TYPE_HERO) ) then + call ReviveHero(UnitGroupRespawnSystem__respawnUnitUnit[index], UnitGroupRespawnSystem__respawnUnitX[index], UnitGroupRespawnSystem__respawnUnitY[index], UnitGroupRespawnSystemConfig_HERO_RESPAWN_DO_EYECANDY) else - set UnitGroupRespawnSystem___respawnUnitUnit[index]=CreateUnit(UnitGroupRespawnSystem___respawnUnitOwner[index], UnitGroupRespawnSystem___respawnUnitUnitTypeId[index], UnitGroupRespawnSystem___respawnUnitX[index], UnitGroupRespawnSystem___respawnUnitY[index], UnitGroupRespawnSystem___respawnUnitFacing[index]) + set UnitGroupRespawnSystem__respawnUnitUnit[index]=CreateUnit(UnitGroupRespawnSystem__respawnUnitOwner[index], UnitGroupRespawnSystem__respawnUnitUnitTypeId[index], UnitGroupRespawnSystem__respawnUnitX[index], UnitGroupRespawnSystem__respawnUnitY[index], UnitGroupRespawnSystem__respawnUnitFacing[index]) set add=true endif - elseif ( UnitGroupRespawnSystem___respawnUnitType[index] == UNIT_RESPAWN_TYPE_UNITPOOL ) then - set UnitGroupRespawnSystem___respawnUnitUnit[index]=PlaceRandomUnit(UnitGroupRespawnSystem___respawnUnitPool[index], UnitGroupRespawnSystem___respawnUnitOwner[index], UnitGroupRespawnSystem___respawnUnitX[index], UnitGroupRespawnSystem___respawnUnitY[index], UnitGroupRespawnSystem___respawnUnitFacing[index]) + elseif ( UnitGroupRespawnSystem__respawnUnitType[index] == UNIT_RESPAWN_TYPE_UNITPOOL ) then + set UnitGroupRespawnSystem__respawnUnitUnit[index]=PlaceRandomUnit(UnitGroupRespawnSystem__respawnUnitPool[index], UnitGroupRespawnSystem__respawnUnitOwner[index], UnitGroupRespawnSystem__respawnUnitX[index], UnitGroupRespawnSystem__respawnUnitY[index], UnitGroupRespawnSystem__respawnUnitFacing[index]) set add=true - elseif ( UnitGroupRespawnSystem___respawnUnitType[index] == UNIT_RESPAWN_TYPE_RANDOM_CREEP_LEVEL ) then - set UnitGroupRespawnSystem___respawnUnitUnit[index]=CreateUnit(UnitGroupRespawnSystem___respawnUnitOwner[index], ChooseRandomCreep(UnitGroupRespawnSystem___respawnUnitRandomCreepLevel[index]), UnitGroupRespawnSystem___respawnUnitX[index], UnitGroupRespawnSystem___respawnUnitY[index], UnitGroupRespawnSystem___respawnUnitFacing[index]) + elseif ( UnitGroupRespawnSystem__respawnUnitType[index] == UNIT_RESPAWN_TYPE_RANDOM_CREEP_LEVEL ) then + set UnitGroupRespawnSystem__respawnUnitUnit[index]=CreateUnit(UnitGroupRespawnSystem__respawnUnitOwner[index], ChooseRandomCreep(UnitGroupRespawnSystem__respawnUnitRandomCreepLevel[index]), UnitGroupRespawnSystem__respawnUnitX[index], UnitGroupRespawnSystem__respawnUnitY[index], UnitGroupRespawnSystem__respawnUnitFacing[index]) set add=true endif - set UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index]=false - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=GetHandleId(UnitGroupRespawnSystem___respawnUnitUnit[index]) - call SaveInteger(UnitGroupRespawnSystem___respawnUnitHashTable, UnitGroupRespawnSystem___respawnUnitHandleId[index], 0, index) + set UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index]=false + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=GetHandleId(UnitGroupRespawnSystem__respawnUnitUnit[index]) + call SaveInteger(UnitGroupRespawnSystem__respawnUnitHashTable, UnitGroupRespawnSystem__respawnUnitHandleId[index], 0, index) - if ( IsUnitType(UnitGroupRespawnSystem___respawnUnitUnit[index], UNIT_TYPE_HERO) ) then - call BlzSetUnitRealField(UnitGroupRespawnSystem___respawnUnitUnit[index], UNIT_RF_DEATH_TIME, 99999999.0) + if ( IsUnitType(UnitGroupRespawnSystem__respawnUnitUnit[index], UNIT_TYPE_HERO) ) then + call BlzSetUnitRealField(UnitGroupRespawnSystem__respawnUnitUnit[index], UNIT_RF_DEATH_TIME, 99999999.0) endif if ( add and IsRespawnUnitGroupValid(groupIndex) ) then //call BJDebugMsg("Adding back unit " + GetUnitName(respawnUnitUnit[index]) + " with index " + I2S(index) + " to group " + I2S(groupIndex)) - call GroupAddUnit(UnitGroupRespawnSystem___respawnUnitGroup[groupIndex], UnitGroupRespawnSystem___respawnUnitUnit[index]) + call GroupAddUnit(UnitGroupRespawnSystem__respawnUnitGroup[groupIndex], UnitGroupRespawnSystem__respawnUnitUnit[index]) endif - call UnitGroupRespawnSystem___EvaluateAndExecuteCallbackRespawnTriggers(index) + call UnitGroupRespawnSystem__EvaluateAndExecuteCallbackRespawnTriggers(index) return true endfunction function RespawnAllUnits takes nothing returns nothing local integer i= 0 loop - exitwhen ( i >= (UnitGroupRespawnSystem___respawnUnitCounter) ) // INLINED!! - if ( IsRespawnUnitValid(i) and UnitGroupRespawnSystem___respawnUnitUnit[i] == null ) then + exitwhen ( i >= (UnitGroupRespawnSystem__respawnUnitCounter) ) // INLINED!! + if ( IsRespawnUnitValid(i) and UnitGroupRespawnSystem__respawnUnitUnit[i] == null ) then call RespawnUnit(i) endif set i=i + 1 @@ -43222,121 +43198,121 @@ function RespawnAllUnits takes nothing returns nothing endfunction function PreventUnitRespawn takes unit whichUnit returns nothing - local integer index= (UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit)))) // INLINED!! + local integer index= (UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit)))) // INLINED!! if ( IsRespawnUnitValid(index) ) then - if ( IsUnitType(UnitGroupRespawnSystem___respawnUnitUnit[index], UNIT_TYPE_HERO) ) then + if ( IsUnitType(UnitGroupRespawnSystem__respawnUnitUnit[index], UNIT_TYPE_HERO) ) then call KillUnit(whichUnit) else - call UnitGroupRespawnSystem___ClearRespawnUnitIndex(UnitGroupRespawnSystem___respawnUnitHandleId[index]) - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=0 + call UnitGroupRespawnSystem__ClearRespawnUnitIndex(UnitGroupRespawnSystem__respawnUnitHandleId[index]) + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=0 call h__RemoveUnit(whichUnit) endif endif endfunction -function UnitGroupRespawnSystem___TimerFunctionRespawnUnit takes nothing returns nothing - local integer index= LoadInteger(UnitGroupRespawnSystem___respawnUnitHashTable, GetHandleId(GetExpiredTimer()), 0) +function UnitGroupRespawnSystem__TimerFunctionRespawnUnit takes nothing returns nothing + local integer index= LoadInteger(UnitGroupRespawnSystem__respawnUnitHashTable, GetHandleId(GetExpiredTimer()), 0) call RespawnUnit(index) endfunction function StartUnitRespawn takes integer index returns nothing - call UnitGroupRespawnSystem___EvaluateAndExecuteCallbackRespawnStartsTriggers(index) + call UnitGroupRespawnSystem__EvaluateAndExecuteCallbackRespawnStartsTriggers(index) - if ( not UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index] ) then - call h__BJDebugMsg("Duplicated start respawn timer for index " + I2S(index) + " for unit " + GetUnitName(UnitGroupRespawnSystem___respawnUnitUnit[index])) + if ( not UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index] ) then + call h__BJDebugMsg("Duplicated start respawn timer for index " + I2S(index) + " for unit " + GetUnitName(UnitGroupRespawnSystem__respawnUnitUnit[index])) endif - if ( UnitGroupRespawnSystem___respawnUnitHandleId[index] != 0 ) then - call UnitGroupRespawnSystem___ClearRespawnUnitIndex(UnitGroupRespawnSystem___respawnUnitHandleId[index]) + if ( UnitGroupRespawnSystem__respawnUnitHandleId[index] != 0 ) then + call UnitGroupRespawnSystem__ClearRespawnUnitIndex(UnitGroupRespawnSystem__respawnUnitHandleId[index]) endif - set UnitGroupRespawnSystem___respawnUnitUnit[index]=null - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=0 + set UnitGroupRespawnSystem__respawnUnitUnit[index]=null + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=0 - call TimerStart(UnitGroupRespawnSystem___respawnUnitTimer[index], UnitGroupRespawnSystem___respawnUnitTimeout[index], false, function UnitGroupRespawnSystem___TimerFunctionRespawnUnit) - set UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index]=false + call TimerStart(UnitGroupRespawnSystem__respawnUnitTimer[index], UnitGroupRespawnSystem__respawnUnitTimeout[index], false, function UnitGroupRespawnSystem__TimerFunctionRespawnUnit) + set UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index]=false endfunction function StartAllUnitRespawnsNotRunning takes nothing returns nothing local integer i= 0 loop - exitwhen ( i >= (UnitGroupRespawnSystem___respawnUnitCounter) ) // INLINED!! - if ( IsRespawnUnitValid(i) and UnitGroupRespawnSystem___respawnUnitUnit[i] == null and UnitGroupRespawnSystem___respawnUnitReadyForRespawn[i] ) then + exitwhen ( i >= (UnitGroupRespawnSystem__respawnUnitCounter) ) // INLINED!! + if ( IsRespawnUnitValid(i) and UnitGroupRespawnSystem__respawnUnitUnit[i] == null and UnitGroupRespawnSystem__respawnUnitReadyForRespawn[i] ) then call StartUnitRespawn(i) endif set i=i + 1 endloop endfunction -function UnitGroupRespawnSystem___AddRespawnUnitDefault takes integer index,real x,real y returns nothing - set UnitGroupRespawnSystem___respawnUnitIsValid[index]=true - set UnitGroupRespawnSystem___respawnUnitX[index]=x - set UnitGroupRespawnSystem___respawnUnitY[index]=y - set UnitGroupRespawnSystem___respawnUnitFacing[index]=GetRandomDirectionDeg() - set UnitGroupRespawnSystem___respawnUnitUseDyingLoc[index]=false - set UnitGroupRespawnSystem___respawnUnitOwner[index]=Player(PLAYER_NEUTRAL_AGGRESSIVE) - set UnitGroupRespawnSystem___respawnUnitTimer[index]=CreateTimer() - set UnitGroupRespawnSystem___respawnUnitTimeout[index]=UnitGroupRespawnSystemConfig_DEFAULT_TIMEOUT - call SaveInteger(UnitGroupRespawnSystem___respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem___respawnUnitTimer[index]), 0, index) - set UnitGroupRespawnSystem___respawnUnitEnabled[index]=true - set UnitGroupRespawnSystem___respawnUnitGroupIndex[index]=- 1 - set UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index]=true +function UnitGroupRespawnSystem__AddRespawnUnitDefault takes integer index,real x,real y returns nothing + set UnitGroupRespawnSystem__respawnUnitIsValid[index]=true + set UnitGroupRespawnSystem__respawnUnitX[index]=x + set UnitGroupRespawnSystem__respawnUnitY[index]=y + set UnitGroupRespawnSystem__respawnUnitFacing[index]=GetRandomDirectionDeg() + set UnitGroupRespawnSystem__respawnUnitUseDyingLoc[index]=false + set UnitGroupRespawnSystem__respawnUnitOwner[index]=Player(PLAYER_NEUTRAL_AGGRESSIVE) + set UnitGroupRespawnSystem__respawnUnitTimer[index]=CreateTimer() + set UnitGroupRespawnSystem__respawnUnitTimeout[index]=UnitGroupRespawnSystemConfig_DEFAULT_TIMEOUT + call SaveInteger(UnitGroupRespawnSystem__respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem__respawnUnitTimer[index]), 0, index) + set UnitGroupRespawnSystem__respawnUnitEnabled[index]=true + set UnitGroupRespawnSystem__respawnUnitGroupIndex[index]=- 1 + set UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index]=true loop - set UnitGroupRespawnSystem___respawnUnitFreeIndex=UnitGroupRespawnSystem___respawnUnitFreeIndex + 1 - exitwhen ( not IsRespawnUnitValid(UnitGroupRespawnSystem___respawnUnitFreeIndex) ) + set UnitGroupRespawnSystem__respawnUnitFreeIndex=UnitGroupRespawnSystem__respawnUnitFreeIndex + 1 + exitwhen ( not IsRespawnUnitValid(UnitGroupRespawnSystem__respawnUnitFreeIndex) ) endloop - if ( UnitGroupRespawnSystem___respawnUnitFreeIndex >= JASS_MAX_ARRAY_SIZE ) then - call h__BJDebugMsg("Warning: Reached Warcraft maximum array size for respawn units: " + I2S(UnitGroupRespawnSystem___respawnUnitFreeIndex)) + if ( UnitGroupRespawnSystem__respawnUnitFreeIndex >= JASS_MAX_ARRAY_SIZE ) then + call h__BJDebugMsg("Warning: Reached Warcraft maximum array size for respawn units: " + I2S(UnitGroupRespawnSystem__respawnUnitFreeIndex)) endif - if ( index >= UnitGroupRespawnSystem___respawnUnitCounter ) then - set UnitGroupRespawnSystem___respawnUnitCounter=index + 1 + if ( index >= UnitGroupRespawnSystem__respawnUnitCounter ) then + set UnitGroupRespawnSystem__respawnUnitCounter=index + 1 endif endfunction function AddRespawnUnit takes unit whichUnit returns integer - local integer index= UnitGroupRespawnSystem___respawnUnitFreeIndex - set UnitGroupRespawnSystem___respawnUnitType[index]=UNIT_RESPAWN_TYPE_UNIT - set UnitGroupRespawnSystem___respawnUnitUnit[index]=whichUnit - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=GetHandleId(whichUnit) - set UnitGroupRespawnSystem___respawnUnitUnitTypeId[index]=GetUnitTypeId(whichUnit) - set UnitGroupRespawnSystem___respawnUnitPool[index]=null - call UnitGroupRespawnSystem___AddRespawnUnitDefault(index , GetUnitX(whichUnit) , GetUnitY(whichUnit)) - set UnitGroupRespawnSystem___respawnUnitFacing[index]=GetUnitFacing(whichUnit) - set UnitGroupRespawnSystem___respawnUnitOwner[index]=GetOwningPlayer(whichUnit) - set UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index]=false + local integer index= UnitGroupRespawnSystem__respawnUnitFreeIndex + set UnitGroupRespawnSystem__respawnUnitType[index]=UNIT_RESPAWN_TYPE_UNIT + set UnitGroupRespawnSystem__respawnUnitUnit[index]=whichUnit + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=GetHandleId(whichUnit) + set UnitGroupRespawnSystem__respawnUnitUnitTypeId[index]=GetUnitTypeId(whichUnit) + set UnitGroupRespawnSystem__respawnUnitPool[index]=null + call UnitGroupRespawnSystem__AddRespawnUnitDefault(index , GetUnitX(whichUnit) , GetUnitY(whichUnit)) + set UnitGroupRespawnSystem__respawnUnitFacing[index]=GetUnitFacing(whichUnit) + set UnitGroupRespawnSystem__respawnUnitOwner[index]=GetOwningPlayer(whichUnit) + set UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index]=false if ( IsUnitType(whichUnit, UNIT_TYPE_HERO) ) then call BlzSetUnitRealField(whichUnit, UNIT_RF_DEATH_TIME, 99999999.0) endif - call SaveInteger(UnitGroupRespawnSystem___respawnUnitHashTable, UnitGroupRespawnSystem___respawnUnitHandleId[index], 0, index) + call SaveInteger(UnitGroupRespawnSystem__respawnUnitHashTable, UnitGroupRespawnSystem__respawnUnitHandleId[index], 0, index) return index endfunction function SetRespawnUnitGroupIndex takes integer index,integer groupIndex returns nothing if ( IsRespawnUnitGroupValid(groupIndex) ) then - if ( IsRespawnUnitGroupValid(UnitGroupRespawnSystem___respawnUnitGroupIndex[index]) and UnitGroupRespawnSystem___respawnUnitUnit[index] != null ) then - call GroupRemoveUnit(UnitGroupRespawnSystem___respawnUnitGroup[UnitGroupRespawnSystem___respawnUnitGroupIndex[index]], UnitGroupRespawnSystem___respawnUnitUnit[index]) + if ( IsRespawnUnitGroupValid(UnitGroupRespawnSystem__respawnUnitGroupIndex[index]) and UnitGroupRespawnSystem__respawnUnitUnit[index] != null ) then + call GroupRemoveUnit(UnitGroupRespawnSystem__respawnUnitGroup[UnitGroupRespawnSystem__respawnUnitGroupIndex[index]], UnitGroupRespawnSystem__respawnUnitUnit[index]) endif - set UnitGroupRespawnSystem___respawnUnitGroupIndex[index]=groupIndex - if ( UnitGroupRespawnSystem___respawnUnitUnit[index] != null ) then - call GroupAddUnit(UnitGroupRespawnSystem___respawnUnitGroup[groupIndex], UnitGroupRespawnSystem___respawnUnitUnit[index]) + set UnitGroupRespawnSystem__respawnUnitGroupIndex[index]=groupIndex + if ( UnitGroupRespawnSystem__respawnUnitUnit[index] != null ) then + call GroupAddUnit(UnitGroupRespawnSystem__respawnUnitGroup[groupIndex], UnitGroupRespawnSystem__respawnUnitUnit[index]) endif endif endfunction function AddRespawnUnitPoolEx takes unitpool whichUnitPool,real x,real y,integer groupIndex returns integer - local integer index= UnitGroupRespawnSystem___respawnUnitFreeIndex - set UnitGroupRespawnSystem___respawnUnitType[index]=UNIT_RESPAWN_TYPE_UNITPOOL - set UnitGroupRespawnSystem___respawnUnitUnit[index]=null - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=0 - set UnitGroupRespawnSystem___respawnUnitUnitTypeId[index]=0 - set UnitGroupRespawnSystem___respawnUnitPool[index]=whichUnitPool - call UnitGroupRespawnSystem___AddRespawnUnitDefault(index , x , y) + local integer index= UnitGroupRespawnSystem__respawnUnitFreeIndex + set UnitGroupRespawnSystem__respawnUnitType[index]=UNIT_RESPAWN_TYPE_UNITPOOL + set UnitGroupRespawnSystem__respawnUnitUnit[index]=null + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=0 + set UnitGroupRespawnSystem__respawnUnitUnitTypeId[index]=0 + set UnitGroupRespawnSystem__respawnUnitPool[index]=whichUnitPool + call UnitGroupRespawnSystem__AddRespawnUnitDefault(index , x , y) // Set group index before respawning. call SetRespawnUnitGroupIndex(index , groupIndex) @@ -43350,14 +43326,14 @@ function AddRespawnUnitPool takes unitpool whichUnitPool,real x,real y returns i endfunction function AddRespawnUnitRandomCreepEx takes integer level,real x,real y,integer groupIndex returns integer - local integer index= UnitGroupRespawnSystem___respawnUnitFreeIndex - set UnitGroupRespawnSystem___respawnUnitType[index]=UNIT_RESPAWN_TYPE_RANDOM_CREEP_LEVEL - set UnitGroupRespawnSystem___respawnUnitUnit[index]=null - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=0 - set UnitGroupRespawnSystem___respawnUnitUnitTypeId[index]=0 - set UnitGroupRespawnSystem___respawnUnitPool[index]=null - set UnitGroupRespawnSystem___respawnUnitRandomCreepLevel[index]=level - call UnitGroupRespawnSystem___AddRespawnUnitDefault(index , x , y) + local integer index= UnitGroupRespawnSystem__respawnUnitFreeIndex + set UnitGroupRespawnSystem__respawnUnitType[index]=UNIT_RESPAWN_TYPE_RANDOM_CREEP_LEVEL + set UnitGroupRespawnSystem__respawnUnitUnit[index]=null + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=0 + set UnitGroupRespawnSystem__respawnUnitUnitTypeId[index]=0 + set UnitGroupRespawnSystem__respawnUnitPool[index]=null + set UnitGroupRespawnSystem__respawnUnitRandomCreepLevel[index]=level + call UnitGroupRespawnSystem__AddRespawnUnitDefault(index , x , y) // Set group index before respawning. call SetRespawnUnitGroupIndex(index , groupIndex) @@ -43374,29 +43350,29 @@ endfunction function RemoveRespawnUnit takes integer index returns boolean //call BJDebugMsg("Remove respawn unit " + I2S(index)) if ( IsRespawnUnitValid(index) ) then - set UnitGroupRespawnSystem___respawnUnitIsValid[index]=false + set UnitGroupRespawnSystem__respawnUnitIsValid[index]=false - if ( UnitGroupRespawnSystem___respawnUnitUnit[index] != null ) then - call UnitGroupRespawnSystem___ClearRespawnUnitIndex(GetHandleId(UnitGroupRespawnSystem___respawnUnitUnit[index])) + if ( UnitGroupRespawnSystem__respawnUnitUnit[index] != null ) then + call UnitGroupRespawnSystem__ClearRespawnUnitIndex(GetHandleId(UnitGroupRespawnSystem__respawnUnitUnit[index])) endif - set UnitGroupRespawnSystem___respawnUnitTimeout[index]=0 - set UnitGroupRespawnSystem___respawnUnitType[index]=0 - set UnitGroupRespawnSystem___respawnUnitUnit[index]=null - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=0 - set UnitGroupRespawnSystem___respawnUnitUnitTypeId[index]=0 - set UnitGroupRespawnSystem___respawnUnitPool[index]=null - set UnitGroupRespawnSystem___respawnUnitRandomCreepLevel[index]=0 - set UnitGroupRespawnSystem___respawnUnitUseDyingLoc[index]=false + set UnitGroupRespawnSystem__respawnUnitTimeout[index]=0 + set UnitGroupRespawnSystem__respawnUnitType[index]=0 + set UnitGroupRespawnSystem__respawnUnitUnit[index]=null + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=0 + set UnitGroupRespawnSystem__respawnUnitUnitTypeId[index]=0 + set UnitGroupRespawnSystem__respawnUnitPool[index]=null + set UnitGroupRespawnSystem__respawnUnitRandomCreepLevel[index]=0 + set UnitGroupRespawnSystem__respawnUnitUseDyingLoc[index]=false - call PauseTimer(UnitGroupRespawnSystem___respawnUnitTimer[index]) - call FlushChildHashtable(UnitGroupRespawnSystem___respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem___respawnUnitTimer[index])) - call DestroyTimer(UnitGroupRespawnSystem___respawnUnitTimer[index]) + call PauseTimer(UnitGroupRespawnSystem__respawnUnitTimer[index]) + call FlushChildHashtable(UnitGroupRespawnSystem__respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem__respawnUnitTimer[index])) + call DestroyTimer(UnitGroupRespawnSystem__respawnUnitTimer[index]) - set UnitGroupRespawnSystem___respawnUnitFreeIndex=index + set UnitGroupRespawnSystem__respawnUnitFreeIndex=index - if ( index == UnitGroupRespawnSystem___respawnUnitCounter - 1 ) then - set UnitGroupRespawnSystem___respawnUnitCounter=UnitGroupRespawnSystem___respawnUnitCounter - 1 + if ( index == UnitGroupRespawnSystem__respawnUnitCounter - 1 ) then + set UnitGroupRespawnSystem__respawnUnitCounter=UnitGroupRespawnSystem__respawnUnitCounter - 1 endif return true @@ -43406,153 +43382,153 @@ function RemoveRespawnUnit takes integer index returns boolean endfunction function SetRespawnUnitEnabled takes integer index,boolean enabled returns nothing - set UnitGroupRespawnSystem___respawnUnitEnabled[index]=enabled + set UnitGroupRespawnSystem__respawnUnitEnabled[index]=enabled endfunction function IsRespawnUnitEnabled takes integer index returns boolean - return UnitGroupRespawnSystem___respawnUnitEnabled[index] + return UnitGroupRespawnSystem__respawnUnitEnabled[index] endfunction function GetRespawnUnitTimer takes integer index returns timer - return UnitGroupRespawnSystem___respawnUnitTimer[index] + return UnitGroupRespawnSystem__respawnUnitTimer[index] endfunction function GetRespawnUnitType takes integer index returns integer - return UnitGroupRespawnSystem___respawnUnitType[index] + return UnitGroupRespawnSystem__respawnUnitType[index] endfunction function SetRespawnUnitTimeout takes integer index,real timeout returns nothing - set UnitGroupRespawnSystem___respawnUnitTimeout[index]=timeout + set UnitGroupRespawnSystem__respawnUnitTimeout[index]=timeout endfunction function GetRespawnUnitTimeout takes integer index returns real - return UnitGroupRespawnSystem___respawnUnitTimeout[index] + return UnitGroupRespawnSystem__respawnUnitTimeout[index] endfunction function SetRespawnUnitOwner takes integer index,player owner returns nothing - set UnitGroupRespawnSystem___respawnUnitOwner[index]=owner + set UnitGroupRespawnSystem__respawnUnitOwner[index]=owner endfunction function GetRespawnUnitOwner takes integer index returns player - return UnitGroupRespawnSystem___respawnUnitOwner[index] + return UnitGroupRespawnSystem__respawnUnitOwner[index] endfunction function SetRespawnUnitFacing takes integer index,real facing returns nothing - set UnitGroupRespawnSystem___respawnUnitFacing[index]=facing + set UnitGroupRespawnSystem__respawnUnitFacing[index]=facing endfunction function GetRespawnUnitFacing takes integer index returns real - return UnitGroupRespawnSystem___respawnUnitFacing[index] + return UnitGroupRespawnSystem__respawnUnitFacing[index] endfunction function SetRespawnUnitX takes integer index,real x returns nothing - set UnitGroupRespawnSystem___respawnUnitX[index]=x + set UnitGroupRespawnSystem__respawnUnitX[index]=x endfunction function GetRespawnUnitX takes integer index returns real - return UnitGroupRespawnSystem___respawnUnitX[index] + return UnitGroupRespawnSystem__respawnUnitX[index] endfunction function SetRespawnUnitY takes integer index,real y returns nothing - set UnitGroupRespawnSystem___respawnUnitX[index]=y + set UnitGroupRespawnSystem__respawnUnitX[index]=y endfunction function GetRespawnUnitY takes integer index returns real - return UnitGroupRespawnSystem___respawnUnitY[index] + return UnitGroupRespawnSystem__respawnUnitY[index] endfunction function SetRespawnUnitUseDyingLoc takes integer index,boolean use returns nothing - set UnitGroupRespawnSystem___respawnUnitUseDyingLoc[index]=use + set UnitGroupRespawnSystem__respawnUnitUseDyingLoc[index]=use endfunction function GetRespawnUnitUseDyingLoc takes integer index returns boolean - return UnitGroupRespawnSystem___respawnUnitUseDyingLoc[index] + return UnitGroupRespawnSystem__respawnUnitUseDyingLoc[index] endfunction function SetRespawnUnit takes integer index,unit whichUnit returns nothing - local integer groupIndex= UnitGroupRespawnSystem___respawnUnitGroupIndex[index] + local integer groupIndex= UnitGroupRespawnSystem__respawnUnitGroupIndex[index] local boolean validRespawnUnitGroup= IsRespawnUnitGroupValid(groupIndex) local integer handleId= GetHandleId(whichUnit) - if ( UnitGroupRespawnSystem___respawnUnitUnit[index] != null ) then + if ( UnitGroupRespawnSystem__respawnUnitUnit[index] != null ) then if ( validRespawnUnitGroup ) then - call GroupRemoveUnit(UnitGroupRespawnSystem___respawnUnitGroup[groupIndex], UnitGroupRespawnSystem___respawnUnitUnit[index]) + call GroupRemoveUnit(UnitGroupRespawnSystem__respawnUnitGroup[groupIndex], UnitGroupRespawnSystem__respawnUnitUnit[index]) endif - call UnitGroupRespawnSystem___ClearRespawnUnitIndex(GetHandleId(UnitGroupRespawnSystem___respawnUnitUnit[index])) + call UnitGroupRespawnSystem__ClearRespawnUnitIndex(GetHandleId(UnitGroupRespawnSystem__respawnUnitUnit[index])) endif - set UnitGroupRespawnSystem___respawnUnitUnit[index]=whichUnit - set UnitGroupRespawnSystem___respawnUnitHandleId[index]=handleId - set UnitGroupRespawnSystem___respawnUnitType[index]=GetUnitTypeId(whichUnit) - call SaveInteger(UnitGroupRespawnSystem___respawnUnitHashTable, handleId, 0, index) - set UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index]=false + set UnitGroupRespawnSystem__respawnUnitUnit[index]=whichUnit + set UnitGroupRespawnSystem__respawnUnitHandleId[index]=handleId + set UnitGroupRespawnSystem__respawnUnitType[index]=GetUnitTypeId(whichUnit) + call SaveInteger(UnitGroupRespawnSystem__respawnUnitHashTable, handleId, 0, index) + set UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index]=false if ( validRespawnUnitGroup ) then - call GroupAddUnit(UnitGroupRespawnSystem___respawnUnitGroup[groupIndex], whichUnit) + call GroupAddUnit(UnitGroupRespawnSystem__respawnUnitGroup[groupIndex], whichUnit) endif endfunction function GetRespawnUnit takes integer index returns unit - return UnitGroupRespawnSystem___respawnUnitUnit[index] + return UnitGroupRespawnSystem__respawnUnitUnit[index] endfunction function SetRespawnUnitPool takes integer index,unitpool whichUnitPool returns nothing - set UnitGroupRespawnSystem___respawnUnitPool[index]=whichUnitPool + set UnitGroupRespawnSystem__respawnUnitPool[index]=whichUnitPool endfunction function GetRespawnUnitPool takes integer index returns unitpool - return UnitGroupRespawnSystem___respawnUnitPool[index] + return UnitGroupRespawnSystem__respawnUnitPool[index] endfunction function SetRespawnUnitLevel takes integer index,integer level returns nothing - set UnitGroupRespawnSystem___respawnUnitRandomCreepLevel[index]=level + set UnitGroupRespawnSystem__respawnUnitRandomCreepLevel[index]=level endfunction function GetRespawnUnitLevel takes integer index returns integer - return UnitGroupRespawnSystem___respawnUnitRandomCreepLevel[index] + return UnitGroupRespawnSystem__respawnUnitRandomCreepLevel[index] endfunction function GetRespawnUnitGroupCounter takes nothing returns integer - return UnitGroupRespawnSystem___respawnUnitGroupCounter + return UnitGroupRespawnSystem__respawnUnitGroupCounter endfunction function GetRespawnUnitGroupIndex takes integer index returns integer - return UnitGroupRespawnSystem___respawnUnitGroupIndex[index] + return UnitGroupRespawnSystem__respawnUnitGroupIndex[index] endfunction function AddRespawnUnitGroup takes nothing returns integer - local integer index= UnitGroupRespawnSystem___respawnUnitGroupFreeIndex - set UnitGroupRespawnSystem___respawnUnitGroupIsValid[index]=true - set UnitGroupRespawnSystem___respawnUnitGroup[index]=CreateGroup() - set UnitGroupRespawnSystem___respawnUnitGroupTimer[index]=CreateTimer() - set UnitGroupRespawnSystem___respawnUnitGroupTimeout[index]=UnitGroupRespawnSystemConfig_DEFAULT_TIMEOUT - call SaveInteger(UnitGroupRespawnSystem___respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem___respawnUnitGroupTimer[index]), 0, index) - set UnitGroupRespawnSystem___respawnUnitGroupEnabled[index]=true - set UnitGroupRespawnSystem___respawnUnitGroupItemDropEnabled[index]=UnitGroupRespawnSystemConfig_AUTO_ADDED_DROP_RANDOM_ITEMS + local integer index= UnitGroupRespawnSystem__respawnUnitGroupFreeIndex + set UnitGroupRespawnSystem__respawnUnitGroupIsValid[index]=true + set UnitGroupRespawnSystem__respawnUnitGroup[index]=CreateGroup() + set UnitGroupRespawnSystem__respawnUnitGroupTimer[index]=CreateTimer() + set UnitGroupRespawnSystem__respawnUnitGroupTimeout[index]=UnitGroupRespawnSystemConfig_DEFAULT_TIMEOUT + call SaveInteger(UnitGroupRespawnSystem__respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem__respawnUnitGroupTimer[index]), 0, index) + set UnitGroupRespawnSystem__respawnUnitGroupEnabled[index]=true + set UnitGroupRespawnSystem__respawnUnitGroupItemDropEnabled[index]=UnitGroupRespawnSystemConfig_AUTO_ADDED_DROP_RANDOM_ITEMS loop - set UnitGroupRespawnSystem___respawnUnitGroupFreeIndex=UnitGroupRespawnSystem___respawnUnitGroupFreeIndex + 1 - exitwhen ( not IsRespawnUnitGroupValid(UnitGroupRespawnSystem___respawnUnitGroupFreeIndex) ) + set UnitGroupRespawnSystem__respawnUnitGroupFreeIndex=UnitGroupRespawnSystem__respawnUnitGroupFreeIndex + 1 + exitwhen ( not IsRespawnUnitGroupValid(UnitGroupRespawnSystem__respawnUnitGroupFreeIndex) ) endloop - if ( UnitGroupRespawnSystem___respawnUnitGroupFreeIndex >= JASS_MAX_ARRAY_SIZE ) then - call h__BJDebugMsg("Warning: Reached Warcraft maximum array size for respawn units: " + I2S(UnitGroupRespawnSystem___respawnUnitGroupFreeIndex)) + if ( UnitGroupRespawnSystem__respawnUnitGroupFreeIndex >= JASS_MAX_ARRAY_SIZE ) then + call h__BJDebugMsg("Warning: Reached Warcraft maximum array size for respawn units: " + I2S(UnitGroupRespawnSystem__respawnUnitGroupFreeIndex)) endif - if ( index >= UnitGroupRespawnSystem___respawnUnitGroupCounter ) then - set UnitGroupRespawnSystem___respawnUnitGroupCounter=index + 1 + if ( index >= UnitGroupRespawnSystem__respawnUnitGroupCounter ) then + set UnitGroupRespawnSystem__respawnUnitGroupCounter=index + 1 endif return index endfunction -function UnitGroupRespawnSystem___FilterFunctionBelongsToSameOwnerAndHasRespawn takes nothing returns boolean - local unit l__UnitGroupRespawnSystem___filterUnit= GetFilterUnit() +function UnitGroupRespawnSystem__FilterFunctionBelongsToSameOwnerAndHasRespawn takes nothing returns boolean + local unit l__UnitGroupRespawnSystem__filterUnit= GetFilterUnit() local integer respawnUnitIndex= - 1 - if ( IsPlayerInForce(GetOwningPlayer(l__UnitGroupRespawnSystem___filterUnit), UnitGroupRespawnSystem___filterForce) ) then - set respawnUnitIndex=(UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((l__UnitGroupRespawnSystem___filterUnit)))) // INLINED!! - set l__UnitGroupRespawnSystem___filterUnit=null - return IsRespawnUnitValid(respawnUnitIndex) and IsRespawnUnitGroupValid((UnitGroupRespawnSystem___respawnUnitGroupIndex[(respawnUnitIndex)])) // INLINED!! + if ( IsPlayerInForce(GetOwningPlayer(l__UnitGroupRespawnSystem__filterUnit), UnitGroupRespawnSystem__filterForce) ) then + set respawnUnitIndex=(UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((l__UnitGroupRespawnSystem__filterUnit)))) // INLINED!! + set l__UnitGroupRespawnSystem__filterUnit=null + return IsRespawnUnitValid(respawnUnitIndex) and IsRespawnUnitGroupValid((UnitGroupRespawnSystem__respawnUnitGroupIndex[(respawnUnitIndex)])) // INLINED!! endif - set l__UnitGroupRespawnSystem___filterUnit=null + set l__UnitGroupRespawnSystem__filterUnit=null return false endfunction @@ -43561,14 +43537,14 @@ function AddRespawnUnitGroupFromUnitEx takes unit whichUnit,force whichForce,rea local unit first= null local integer groupIndex= - 1 local integer index= - 1 - set UnitGroupRespawnSystem___filterForce=whichForce - call GroupEnumUnitsInRange(allNearbyUnitsFromTheSameOwner, GetUnitX(whichUnit), GetUnitY(whichUnit), maxDistance, Filter(function UnitGroupRespawnSystem___FilterFunctionBelongsToSameOwnerAndHasRespawn)) + set UnitGroupRespawnSystem__filterForce=whichForce + call GroupEnumUnitsInRange(allNearbyUnitsFromTheSameOwner, GetUnitX(whichUnit), GetUnitY(whichUnit), maxDistance, Filter(function UnitGroupRespawnSystem__FilterFunctionBelongsToSameOwnerAndHasRespawn)) set first=FirstOfGroup(allNearbyUnitsFromTheSameOwner) call GroupClear(allNearbyUnitsFromTheSameOwner) call DestroyGroup(allNearbyUnitsFromTheSameOwner) set allNearbyUnitsFromTheSameOwner=null if ( first != null ) then - set groupIndex=(UnitGroupRespawnSystem___respawnUnitGroupIndex[((UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((first)))))]) // INLINED!! + set groupIndex=(UnitGroupRespawnSystem__respawnUnitGroupIndex[((UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((first)))))]) // INLINED!! set first=null else // add a new group for the unit since we found no neighbours with the same owner @@ -43583,15 +43559,15 @@ function AddRespawnUnitGroupFromUnit takes unit whichUnit returns integer return AddRespawnUnitGroupFromUnitEx(whichUnit , UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_PLAYERS , UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_MAX_DISTANCE) endfunction -function UnitGroupRespawnSystem___PolarProjectionX takes real x,real dist,real angle returns real +function UnitGroupRespawnSystem__PolarProjectionX takes real x,real dist,real angle returns real return x + dist * Cos(angle * bj_DEGTORAD) endfunction -function UnitGroupRespawnSystem___PolarProjectionY takes real y,real dist,real angle returns real +function UnitGroupRespawnSystem__PolarProjectionY takes real y,real dist,real angle returns real return y + dist * Sin(angle * bj_DEGTORAD) endfunction -function UnitGroupRespawnSystem___GetRandomLocInRange takes real x,real y,real range returns location +function UnitGroupRespawnSystem__GetRandomLocInRange takes real x,real y,real range returns location local real dist= GetRandomReal(0.0, range) local real angle= GetRandomDirectionDeg() return Location((((x )*1.0) + (( dist )*1.0) * Cos((( angle)*1.0) * bj_DEGTORAD)), (((y )*1.0) + (( dist )*1.0) * Sin((( angle)*1.0) * bj_DEGTORAD))) // INLINED!! @@ -43603,7 +43579,7 @@ function AddRespawnUnitGroupFromUnitPool takes unitpool whichUnitPool,integer co local integer i= 0 loop exitwhen ( i >= countMembers ) - set whichLocation=UnitGroupRespawnSystem___GetRandomLocInRange(x , y , range) + set whichLocation=UnitGroupRespawnSystem__GetRandomLocInRange(x , y , range) call AddRespawnUnitPoolEx(whichUnitPool , GetLocationX(whichLocation) , GetLocationY(whichLocation) , groupIndex) call RemoveLocation(whichLocation) set whichLocation=null @@ -43618,7 +43594,7 @@ function AddRespawnUnitGroupFromRandomCreepLevel takes integer minCreepLevel,int local integer i= 0 loop exitwhen ( i >= countMembers ) - set whichLocation=UnitGroupRespawnSystem___GetRandomLocInRange(x , y , range) + set whichLocation=UnitGroupRespawnSystem__GetRandomLocInRange(x , y , range) call AddRespawnUnitRandomCreepEx(GetRandomInt(minCreepLevel, maxCreepLevel) , GetLocationY(whichLocation) , GetLocationY(whichLocation) , groupIndex) call RemoveLocation(whichLocation) set whichLocation=null @@ -43629,23 +43605,23 @@ endfunction function RemoveRespawnUnitGroup takes integer index returns boolean if ( IsRespawnUnitValid(index) ) then - set UnitGroupRespawnSystem___respawnUnitGroupIsValid[index]=false - set UnitGroupRespawnSystem___respawnUnitGroupEnabled[index]=false + set UnitGroupRespawnSystem__respawnUnitGroupIsValid[index]=false + set UnitGroupRespawnSystem__respawnUnitGroupEnabled[index]=false - if ( UnitGroupRespawnSystem___respawnUnitGroup[index] != null ) then - call GroupClear(UnitGroupRespawnSystem___respawnUnitGroup[index]) - call DestroyGroup(UnitGroupRespawnSystem___respawnUnitGroup[index]) - set UnitGroupRespawnSystem___respawnUnitGroup[index]=null + if ( UnitGroupRespawnSystem__respawnUnitGroup[index] != null ) then + call GroupClear(UnitGroupRespawnSystem__respawnUnitGroup[index]) + call DestroyGroup(UnitGroupRespawnSystem__respawnUnitGroup[index]) + set UnitGroupRespawnSystem__respawnUnitGroup[index]=null endif - call PauseTimer(UnitGroupRespawnSystem___respawnUnitGroupTimer[index]) - call FlushChildHashtable(UnitGroupRespawnSystem___respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem___respawnUnitGroupTimer[index])) - call DestroyTimer(UnitGroupRespawnSystem___respawnUnitGroupTimer[index]) + call PauseTimer(UnitGroupRespawnSystem__respawnUnitGroupTimer[index]) + call FlushChildHashtable(UnitGroupRespawnSystem__respawnUnitHashTable, GetHandleId(UnitGroupRespawnSystem__respawnUnitGroupTimer[index])) + call DestroyTimer(UnitGroupRespawnSystem__respawnUnitGroupTimer[index]) - set UnitGroupRespawnSystem___respawnUnitFreeIndex=index + set UnitGroupRespawnSystem__respawnUnitFreeIndex=index - if ( index == UnitGroupRespawnSystem___respawnUnitCounter - 1 ) then - set UnitGroupRespawnSystem___respawnUnitCounter=UnitGroupRespawnSystem___respawnUnitCounter - 1 + if ( index == UnitGroupRespawnSystem__respawnUnitCounter - 1 ) then + set UnitGroupRespawnSystem__respawnUnitCounter=UnitGroupRespawnSystem__respawnUnitCounter - 1 endif return true @@ -43655,31 +43631,31 @@ function RemoveRespawnUnitGroup takes integer index returns boolean endfunction function SetRespawnUnitGroupTimeout takes integer index,real timeout returns nothing - set UnitGroupRespawnSystem___respawnUnitGroupTimeout[index]=timeout + set UnitGroupRespawnSystem__respawnUnitGroupTimeout[index]=timeout endfunction function GetRespawnUnitGroupTimeout takes integer index returns real - return UnitGroupRespawnSystem___respawnUnitGroupTimeout[index] + return UnitGroupRespawnSystem__respawnUnitGroupTimeout[index] endfunction function SetRespawnUnitGroupEnabled takes integer index,boolean enabled returns nothing - set UnitGroupRespawnSystem___respawnUnitGroupEnabled[index]=enabled + set UnitGroupRespawnSystem__respawnUnitGroupEnabled[index]=enabled endfunction function IsRespawnUnitGroupEnabled takes integer index returns boolean - return UnitGroupRespawnSystem___respawnUnitGroupEnabled[index] + return UnitGroupRespawnSystem__respawnUnitGroupEnabled[index] endfunction function SetRespawnUnitGroupItemDropEnabled takes integer index,boolean enabled returns nothing - set UnitGroupRespawnSystem___respawnUnitGroupItemDropEnabled[index]=enabled + set UnitGroupRespawnSystem__respawnUnitGroupItemDropEnabled[index]=enabled endfunction function GetRespawnUnitGroupItemDropEnabled takes integer index returns boolean - return UnitGroupRespawnSystem___respawnUnitGroupItemDropEnabled[index] + return UnitGroupRespawnSystem__respawnUnitGroupItemDropEnabled[index] endfunction function GetRespawnUnitGroupUnits takes integer index returns group - return UnitGroupRespawnSystem___respawnUnitGroup[index] + return UnitGroupRespawnSystem__respawnUnitGroup[index] endfunction function RespawnUnitGroup takes integer index returns boolean @@ -43692,8 +43668,8 @@ function RespawnUnitGroup takes integer index returns boolean // TODO Store the list of indices in the group? set i=0 loop - exitwhen ( i == (UnitGroupRespawnSystem___respawnUnitCounter) ) // INLINED!! - if ( IsRespawnUnitValid(i) and (UnitGroupRespawnSystem___respawnUnitGroupIndex[(i)]) == index ) then // INLINED!! + exitwhen ( i == (UnitGroupRespawnSystem__respawnUnitCounter) ) // INLINED!! + if ( IsRespawnUnitValid(i) and (UnitGroupRespawnSystem__respawnUnitGroupIndex[(i)]) == index ) then // INLINED!! //call BJDebugMsg("Respawn unit with index " + I2S(i) + " from group " + I2S(index)) call RespawnUnit(i) endif @@ -43703,8 +43679,8 @@ function RespawnUnitGroup takes integer index returns boolean return true endfunction -function UnitGroupRespawnSystem___TimerFunctionRespawnUnitGroup takes nothing returns nothing - local integer index= LoadInteger(UnitGroupRespawnSystem___respawnUnitHashTable, GetHandleId(GetExpiredTimer()), 0) +function UnitGroupRespawnSystem__TimerFunctionRespawnUnitGroup takes nothing returns nothing + local integer index= LoadInteger(UnitGroupRespawnSystem__respawnUnitHashTable, GetHandleId(GetExpiredTimer()), 0) call RespawnUnitGroup(index) endfunction @@ -43713,10 +43689,10 @@ function StartUnitGroupRespawn takes integer index returns nothing local integer memberIndex= - 1 local integer i= 0 loop - exitwhen ( i == BlzGroupGetSize(UnitGroupRespawnSystem___respawnUnitGroup[index]) ) - set member=BlzGroupUnitAt(UnitGroupRespawnSystem___respawnUnitGroup[index], i) - set memberIndex=(UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((member)))) // INLINED!! - set UnitGroupRespawnSystem___respawnUnitReadyForRespawn[memberIndex]=false // makes sure that StartAllUnitRespawnsNotRunning does not start a duplicated respawn. + exitwhen ( i == BlzGroupGetSize(UnitGroupRespawnSystem__respawnUnitGroup[index]) ) + set member=BlzGroupUnitAt(UnitGroupRespawnSystem__respawnUnitGroup[index], i) + set memberIndex=(UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((member)))) // INLINED!! + set UnitGroupRespawnSystem__respawnUnitReadyForRespawn[memberIndex]=false // makes sure that StartAllUnitRespawnsNotRunning does not start a duplicated respawn. //call BJDebugMsg("Making group member " + I2S(memberIndex) + " not ready for respawn anymore!") set member=null set i=i + 1 @@ -43724,10 +43700,10 @@ function StartUnitGroupRespawn takes integer index returns nothing // start call backs loop - exitwhen ( i == BlzGroupGetSize(UnitGroupRespawnSystem___respawnUnitGroup[index]) ) - set member=BlzGroupUnitAt(UnitGroupRespawnSystem___respawnUnitGroup[index], i) - set memberIndex=(UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((member)))) // INLINED!! - call UnitGroupRespawnSystem___EvaluateAndExecuteCallbackRespawnStartsTriggers(memberIndex) + exitwhen ( i == BlzGroupGetSize(UnitGroupRespawnSystem__respawnUnitGroup[index]) ) + set member=BlzGroupUnitAt(UnitGroupRespawnSystem__respawnUnitGroup[index], i) + set memberIndex=(UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((member)))) // INLINED!! + call UnitGroupRespawnSystem__EvaluateAndExecuteCallbackRespawnStartsTriggers(memberIndex) set member=null set i=i + 1 endloop @@ -43735,17 +43711,17 @@ function StartUnitGroupRespawn takes integer index returns nothing // Cleanup since we do not know how long the unit will decay etc. set i=0 loop - exitwhen ( i >= BlzGroupGetSize(UnitGroupRespawnSystem___respawnUnitGroup[index]) ) - set member=BlzGroupUnitAt(UnitGroupRespawnSystem___respawnUnitGroup[index], i) - set memberIndex=(UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((member)))) // INLINED!! + exitwhen ( i >= BlzGroupGetSize(UnitGroupRespawnSystem__respawnUnitGroup[index]) ) + set member=BlzGroupUnitAt(UnitGroupRespawnSystem__respawnUnitGroup[index], i) + set memberIndex=(UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((member)))) // INLINED!! if ( not IsUnitType(member, UNIT_TYPE_HERO) ) then - if ( UnitGroupRespawnSystem___respawnUnitHandleId[memberIndex] != 0 ) then - call UnitGroupRespawnSystem___ClearRespawnUnitIndex(UnitGroupRespawnSystem___respawnUnitHandleId[memberIndex]) + if ( UnitGroupRespawnSystem__respawnUnitHandleId[memberIndex] != 0 ) then + call UnitGroupRespawnSystem__ClearRespawnUnitIndex(UnitGroupRespawnSystem__respawnUnitHandleId[memberIndex]) endif - set UnitGroupRespawnSystem___respawnUnitUnit[memberIndex]=null - set UnitGroupRespawnSystem___respawnUnitHandleId[memberIndex]=0 - call GroupRemoveUnit(UnitGroupRespawnSystem___respawnUnitGroup[index], member) // only remove non-heroes + set UnitGroupRespawnSystem__respawnUnitUnit[memberIndex]=null + set UnitGroupRespawnSystem__respawnUnitHandleId[memberIndex]=0 + call GroupRemoveUnit(UnitGroupRespawnSystem__respawnUnitGroup[index], member) // only remove non-heroes else set i=i + 1 endif @@ -43755,45 +43731,45 @@ function StartUnitGroupRespawn takes integer index returns nothing //call BJDebugMsg("Starting respawn timer for group " + I2S(index)) - call TimerStart(UnitGroupRespawnSystem___respawnUnitGroupTimer[index], UnitGroupRespawnSystem___respawnUnitGroupTimeout[index], false, function UnitGroupRespawnSystem___TimerFunctionRespawnUnitGroup) + call TimerStart(UnitGroupRespawnSystem__respawnUnitGroupTimer[index], UnitGroupRespawnSystem__respawnUnitGroupTimeout[index], false, function UnitGroupRespawnSystem__TimerFunctionRespawnUnitGroup) endfunction -function UnitGroupRespawnSystem___TriggerConditionRespawnUnit takes nothing returns boolean - local integer index= (UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((GetTriggerUnit())))) // INLINED!! - return IsRespawnUnitValid(index) and (UnitGroupRespawnSystem___respawnUnitEnabled[(index)]) // INLINED!! +function UnitGroupRespawnSystem__TriggerConditionRespawnUnit takes nothing returns boolean + local integer index= (UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((GetTriggerUnit())))) // INLINED!! + return IsRespawnUnitValid(index) and (UnitGroupRespawnSystem__respawnUnitEnabled[(index)]) // INLINED!! endfunction -function UnitGroupRespawnSystem___IsUnitGroupReadyForRespawnEnum takes nothing returns nothing - local integer index= (UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((GetEnumUnit())))) // INLINED!! +function UnitGroupRespawnSystem__IsUnitGroupReadyForRespawnEnum takes nothing returns nothing + local integer index= (UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((GetEnumUnit())))) // INLINED!! //call BJDebugMsg("Checking member: " + I2S(index)) - if ( not UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index] ) then + if ( not UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index] ) then set bj_isUnitGroupDeadResult=false endif endfunction -function UnitGroupRespawnSystem___IsUnitGroupReadyForRespawn takes group g returns boolean +function UnitGroupRespawnSystem__IsUnitGroupReadyForRespawn takes group g returns boolean set bj_isUnitGroupDeadResult=true - call ForGroup(g, function UnitGroupRespawnSystem___IsUnitGroupReadyForRespawnEnum) + call ForGroup(g, function UnitGroupRespawnSystem__IsUnitGroupReadyForRespawnEnum) //call BJDebugMsg("Result") return bj_isUnitGroupDeadResult endfunction -function UnitGroupRespawnSystem___TriggerActionRespawnUnit takes nothing returns nothing +function UnitGroupRespawnSystem__TriggerActionRespawnUnit takes nothing returns nothing local unit triggerUnit= GetTriggerUnit() - local integer index= (UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((triggerUnit)))) // INLINED!! - local integer groupIndex= (UnitGroupRespawnSystem___respawnUnitGroupIndex[(index)]) // INLINED!! + local integer index= (UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((triggerUnit)))) // INLINED!! + local integer groupIndex= (UnitGroupRespawnSystem__respawnUnitGroupIndex[(index)]) // INLINED!! - if ( (UnitGroupRespawnSystem___respawnUnitUseDyingLoc[(index)]) ) then // INLINED!! - set UnitGroupRespawnSystem___respawnUnitFacing[(index )]=(( GetUnitFacing(triggerUnit))*1.0) // INLINED!! - set UnitGroupRespawnSystem___respawnUnitX[(index )]=(( GetUnitX(triggerUnit))*1.0) // INLINED!! - set UnitGroupRespawnSystem___respawnUnitX[(index )]=(( GetUnitY(triggerUnit))*1.0) // INLINED!! + if ( (UnitGroupRespawnSystem__respawnUnitUseDyingLoc[(index)]) ) then // INLINED!! + set UnitGroupRespawnSystem__respawnUnitFacing[(index )]=(( GetUnitFacing(triggerUnit))*1.0) // INLINED!! + set UnitGroupRespawnSystem__respawnUnitX[(index )]=(( GetUnitX(triggerUnit))*1.0) // INLINED!! + set UnitGroupRespawnSystem__respawnUnitX[(index )]=(( GetUnitY(triggerUnit))*1.0) // INLINED!! endif - set UnitGroupRespawnSystem___respawnUnitReadyForRespawn[index]=true + set UnitGroupRespawnSystem__respawnUnitReadyForRespawn[index]=true - if ( IsRespawnUnitGroupValid(groupIndex) and (UnitGroupRespawnSystem___respawnUnitGroupEnabled[(groupIndex)]) ) then // INLINED!! - if ( UnitGroupRespawnSystem___IsUnitGroupReadyForRespawn((UnitGroupRespawnSystem___respawnUnitGroup[(groupIndex)])) ) then // INLINED!! - call UnitGroupRespawnSystemConfig_DropItemForGroup(groupIndex , triggerUnit , (UnitGroupRespawnSystem___respawnUnitGroup[(groupIndex)]) , (UnitGroupRespawnSystem___respawnUnitGroupItemDropEnabled[(groupIndex)])) // INLINED!! + if ( IsRespawnUnitGroupValid(groupIndex) and (UnitGroupRespawnSystem__respawnUnitGroupEnabled[(groupIndex)]) ) then // INLINED!! + if ( UnitGroupRespawnSystem__IsUnitGroupReadyForRespawn((UnitGroupRespawnSystem__respawnUnitGroup[(groupIndex)])) ) then // INLINED!! + call UnitGroupRespawnSystemConfig_DropItemForGroup(groupIndex , triggerUnit , (UnitGroupRespawnSystem__respawnUnitGroup[(groupIndex)]) , (UnitGroupRespawnSystem__respawnUnitGroupItemDropEnabled[(groupIndex)])) // INLINED!! //call BJDebugMsg("Start group unit respawn for index " + I2S(groupIndex) + " with " + I2S(BlzGroupGetSize(GetRespawnUnitGroupUnits(groupIndex))) + " members") call StartUnitGroupRespawn(groupIndex) endif @@ -43805,7 +43781,7 @@ function UnitGroupRespawnSystem___TriggerActionRespawnUnit takes nothing returns endfunction function AddRespawnUnitGroupFromUnitStart takes unit whichUnit,force whichForce,real maxDistance,boolean autoAddedGroups returns nothing - if ( not IsRespawnUnitValid((UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit))))) ) then // INLINED!! + if ( not IsRespawnUnitValid((UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit))))) ) then // INLINED!! if ( autoAddedGroups ) then call AddRespawnUnitGroupFromUnitEx(whichUnit , whichForce , maxDistance) else @@ -43814,17 +43790,17 @@ function AddRespawnUnitGroupFromUnitStart takes unit whichUnit,force whichForce, endif endfunction -function UnitGroupRespawnSystem___AddRespawnUnitGroupFromEnumUnit takes nothing returns nothing +function UnitGroupRespawnSystem__AddRespawnUnitGroupFromEnumUnit takes nothing returns nothing call AddRespawnUnitGroupFromUnitStart(GetEnumUnit() , UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_PLAYERS , UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUP_MAX_DISTANCE , UnitGroupRespawnSystemConfig_AUTO_ADDED_GROUPS) endfunction -function UnitGroupRespawnSystem___AddAllPreplacedCreeps takes nothing returns nothing +function UnitGroupRespawnSystem__AddAllPreplacedCreeps takes nothing returns nothing local timer expiredTimer= GetExpiredTimer() local group allCreeps= CreateGroup() - call GroupEnumUnitsInRect((allCreeps), GetPlayableMapRect(), Filter(function UnitGroupRespawnSystemConfig___FilterFunctionNoLegendaryArtifact)) // INLINED!! - call ForGroup(allCreeps, function UnitGroupRespawnSystem___AddRespawnUnitGroupFromEnumUnit) + call GroupEnumUnitsInRect((allCreeps), GetPlayableMapRect(), Filter(function UnitGroupRespawnSystemConfig__FilterFunctionNoLegendaryArtifact)) // INLINED!! + call ForGroup(allCreeps, function UnitGroupRespawnSystem__AddRespawnUnitGroupFromEnumUnit) call GroupClear(allCreeps) call DestroyGroup(allCreeps) set allCreeps=null @@ -43835,25 +43811,25 @@ function UnitGroupRespawnSystem___AddAllPreplacedCreeps takes nothing returns no endfunction -function UnitGroupRespawnSystem___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(UnitGroupRespawnSystem___unitDeathOrCharmOrRescueTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerRegisterAnyUnitEventBJ(UnitGroupRespawnSystem___unitDeathOrCharmOrRescueTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) - call TriggerAddCondition(UnitGroupRespawnSystem___unitDeathOrCharmOrRescueTrigger, Condition(function UnitGroupRespawnSystem___TriggerConditionRespawnUnit)) - call TriggerAddAction(UnitGroupRespawnSystem___unitDeathOrCharmOrRescueTrigger, function UnitGroupRespawnSystem___TriggerActionRespawnUnit) +function UnitGroupRespawnSystem__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(UnitGroupRespawnSystem__unitDeathOrCharmOrRescueTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerRegisterAnyUnitEventBJ(UnitGroupRespawnSystem__unitDeathOrCharmOrRescueTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) + call TriggerAddCondition(UnitGroupRespawnSystem__unitDeathOrCharmOrRescueTrigger, Condition(function UnitGroupRespawnSystem__TriggerConditionRespawnUnit)) + call TriggerAddAction(UnitGroupRespawnSystem__unitDeathOrCharmOrRescueTrigger, function UnitGroupRespawnSystem__TriggerActionRespawnUnit) // waiting makes sure that all units are already placed on the map - call TimerStart(CreateTimer(), 0.0, false, function UnitGroupRespawnSystem___AddAllPreplacedCreeps) + call TimerStart(CreateTimer(), 0.0, false, function UnitGroupRespawnSystem__AddAllPreplacedCreeps) endfunction -function UnitGroupRespawnSystem___RemoveUnitCleanup takes unit whichUnit returns nothing +function UnitGroupRespawnSystem__RemoveUnitCleanup takes unit whichUnit returns nothing local integer handleID= GetHandleId(whichUnit) - call UnitGroupRespawnSystem___ClearRespawnUnitIndex(handleID) + call UnitGroupRespawnSystem__ClearRespawnUnitIndex(handleID) endfunction -//processed hook: hook RemoveUnit UnitGroupRespawnSystem___RemoveUnitCleanup +//processed hook: hook RemoveUnit UnitGroupRespawnSystem__RemoveUnitCleanup @@ -45266,11 +45242,11 @@ function VoteRemovePlayer takes integer vote,player whichPlayer returns nothing endfunction function VoteStartForAllPlayingUsers takes integer vote returns boolean - return VoteStart(vote , (ForceUtils___allPlayingUsers)) // INLINED!! + return VoteStart(vote , (ForceUtils__allPlayingUsers)) // INLINED!! endfunction function VoteStartForAllPlayingUsersWithInitialVote takes integer vote,player whichPlayer returns boolean - local boolean result= (VoteStart((vote) , (ForceUtils___allPlayingUsers))) // INLINED!! + local boolean result= (VoteStart((vote) , (ForceUtils__allPlayingUsers))) // INLINED!! if ( result ) then call VoteAddVote(vote , 0 , whichPlayer) else @@ -45350,21 +45326,21 @@ endfunction function GetVersionQuest takes integer index returns quest - return WoWReforgedChangeLog__versionQuests[index] + return WoWReforgedChangeLog___versionQuests[index] endfunction function GetMaxVersions takes nothing returns integer - return WoWReforgedChangeLog__versionQuestsCounter + return WoWReforgedChangeLog___versionQuestsCounter endfunction function AddVersion takes string v returns nothing local string description= "All changes of " + v + "." call h__CreateQuestBJ(bj_QUESTTYPE_REQ_DISCOVERED, v, description, "ReplaceableTextures\\CommandButtons\\BTNEngineeringUpgrade.blp") - set WoWReforgedChangeLog__versionQuests[WoWReforgedChangeLog__versionQuestsCounter]=GetLastCreatedQuestBJ() + set WoWReforgedChangeLog___versionQuests[WoWReforgedChangeLog___versionQuestsCounter]=GetLastCreatedQuestBJ() set WoWReforgedInfoQuests__questHandle[WoWReforgedInfoQuests__questsMax - 1]=bj_lastCreatedQuest // INLINED!! call QuestSetTitleHook(GetLastCreatedQuestBJ() , v) call QuestSetDescriptionHook(GetLastCreatedQuestBJ() , description) - set WoWReforgedChangeLog__versionQuestsCounter=WoWReforgedChangeLog__versionQuestsCounter + 1 + set WoWReforgedChangeLog___versionQuestsCounter=WoWReforgedChangeLog___versionQuestsCounter + 1 endfunction function AddChange takes string change returns nothing @@ -45425,9077 +45401,595 @@ function AddAllChanges takes nothing returns nothing call CreateQuestItem(bj_lastCreatedQuest , (("Add Kul Tiras quest 1."))) // INLINED!! - call AddVersion("3.35") - call CreateQuestItem(bj_lastCreatedQuest , (("Add more ranks for several professions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix enchanting for Jewelcrafter items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix several Mercenary Camps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Dalaran quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cinematic Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise Dalaran terrain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give AI start location Dalaran a shipyard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace item Book of Reanimation with Scroll of Animate Dead."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix attack and defense type of unit Carrion Beetle (Level 3)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ID of Quillboar Hunter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of item Purchase Doctor Glyph."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix IDs for race Old Horde."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Necromancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Fel Grommash Hellscream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Lich King."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Kil'jaeden."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Admiral Proudmoore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix skin Grommash Hellscream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Arcane Scroll can be dropped by creeps now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Firehand Gauntlets."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add library WoWReforgedObjectMappings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("MaxHpResearch works with hooks now which fixes creep Evolution effects on changing your hero level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for hero Blackhand."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Fire Magic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit ability Meteor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone and start location Village."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve system PeriodicWatcher."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Crates."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add village quest 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add initial Housing system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Wizard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Peasant."))) // INLINED!! - - call AddVersion("3.34") - call CreateQuestItem(bj_lastCreatedQuest , (("Do not use non-existing Orc research UPG_ORC_ARTILLERY."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix calculating total area for worlds without continents."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and icon for NPC Fleet Admiral Tethys."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix registering Freelancer units for save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Murloc tier buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise creep Frost Giant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise creep Molten Giant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Elemental Plane areas and Mercenary Camps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Crystal Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Shadowlands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Smolderon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Elemental Lords into Elemental Plane and make them available from start."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more ranks to profession Necrmancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Nathrezim."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Venthyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Sunken Ruins cliff type and bridges in Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Sunken Ruins cliff type and bridges in Argus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add border around Argus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model of property Icecrown Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add property Seat of the Primus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Computer start location Maldraxxus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Primus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Shadowlands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for hero Dwarf Mage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Banner Shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Banner Shop for all races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add lots of Banner items and buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Restore old loading screen from Frozen Throne."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not show queue UI tooltip after cinematics end."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add command button Rotate."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve terrain of Clan Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Computer start location Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Khadgar to Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add shops to Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move portal to Dalaran to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename profession Pirate into Captain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add diplomacy UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix increasing maximum HP by researches for corpses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove inventory and hero spells from NPC Malfurion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix portal from Mount Hyjal to Underground."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add higher ranks to several professions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase maximum hero level of NPCs on Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Resurrection Stone revival areas."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register missing Dalaran units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Resurrection Stone to Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-loadmines\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix auto loading AI mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix recreating AI town halls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing Ingot model textures."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Banner Doodads to the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat command \"-playercolor\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat command \"-playername\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Ny'alotha."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Cultist."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Faceless Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Eagle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support profession book items for save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix removing killed or cancelled constructions from the queue UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for unit Fire Mage of race Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom Sorceress research to race Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing hotkeys for trained units to race Dalaran."))) // INLINED!! - - call AddVersion("3.33") - call CreateQuestItem(bj_lastCreatedQuest , (("Move AI start location Kul Tiras to fix the instant crash."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move AI start location Azuremyst Isles to fix the instant crash."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Dragonkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bridge to Outland's portal area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Jailer to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Inquisitor to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Chest to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register critter Fox for save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix parent zones of continent zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum HP bonus for research Improved Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum HP bonus for research Improved Hand of God."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum percentage HP bonus from researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix many building and unit portraits by specifiny the new field \"upor\" from Warcraft 2.0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-resetmount\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-resetmasonry\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-resethandofgod\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("All critters have 1 food cost now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix some synchronization issues with paged buttons UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Clefthoof Rider to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Rylak Rider to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hero level of NPC Barade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hero level of NPC Carsten."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Mercenary Camp (Sea) to water base."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move neutral buildings at water base."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critter Hedgehog."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove inventory ability and hero spells from NPC Fleet Admiral."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more creeps sold by Mercenary Camp Sea."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Zeppelin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Goblin heroes the standard mount Zeppelin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Permanently store Witch Hut abilities for mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for Troll Citzen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register unit Cow for save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase map dimensions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Djinn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Lightning Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Frost Giant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Molten Giant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Kraken."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix coloring of creep Earth Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Enraged Earth Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add queue UI system to show queued trainings, researches and upgrades."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-uiqueueon/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-uiqueueclear\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improved Paged Buttons UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make effect of spell Divine Shield temporarily."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase cooldown of hero spell Charge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Uldum."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Tol'vir."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Ramkahen Guard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ramkahen Huntress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Dark Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Thief."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Air Revenant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Fire Hawk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show zones for bosses on the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession rank Grand Master."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession rank Doctor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show profession rank in title of charges on the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Thrall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Grommash Hellscream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Uther."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Jaina."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Medivh."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Medivh."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Lord Garithos."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Spellbreaker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Knight."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow heroes to pick up multiple race scepters for the same race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow heroes to pick up multiple profession books for the same profession."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase selection scale of hero Infernal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix coloring of Neutral Citizen (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix portal from Underground to Mount Hyjal and back."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero spell Spell Shield is not learnable by Equipment Bags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing summon effect to hero spell Summon Doom Guard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix NPC Chen Stormstout in Pandaria."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise terrain tiles."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase area for start location Kul Tiras to prevent AI crashing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase area for start location Sunstrider Isle to prevent AI crashing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase area for start location Azymerest Isle to prevent AI crashing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow to pick up tome items if tomes are disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not auto replenish stocks in Crafting Stashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Divine Shield."))) // INLINED!! - - call AddVersion("3.32") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Old Horde AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Alliance of Lordaeron AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow bonus heroes for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Profession scribe cannot be used with \"-unlock\" anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Water Tower to save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Advanced Water Tower to save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of profession Scribe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix zone sizes on the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of hero and NPC Malfurion due to a bug in Warcraft Reforged 2.0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Always map loaded units, items and buildings to player's first race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys in Clan Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enchanter formulas affect all tomes and manuals now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Freelancer Laboratory can trains Neutral Child now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise game information."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Freelancer Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make sure perishable loaded items have at least 1 charge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix researching for Freelancer AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Freelancer AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom models for race Dragonkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Dragonkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Any unit order stops Drain Resources now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable option SHOW_PREVIEW_MODELS for Paged Buttons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add initial system MaxHpResearch to fix maximum HP overflows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum HP overflow for research Ogre Strength."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum HP overflow for research Improved Clan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum HP overflow for research Improved Clan Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum HP overflow for research Improved Masonry (Freelancer Hideout)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix showing gathered resources only for the selecting player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critter Fox with hunting trophy."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Bear."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Giant Bear."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-uion/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise system ResourcesGui to reduce sync selection calls and fix selection issues."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise system PagedButtonsUI to fix selection issues."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix crash in AI players UI heroes popup menu."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Lich King model which was broken due to issues in Warcraft Reforged 2.0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model of unit Rakkar Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Grunt."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix soundset and classification of Shade Form for hero Acolyte."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero spell Elune's Grace is not learnable by Equipment Bags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add passive icon for hero spell Move Speed Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add passive icon for hero spell Mana Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add passive icon for hero spell Mana Regeneration Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add passive icon for hero spell Sight Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down critter Talbuk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critters Talbuks to Argus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critters Parrots."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve AI players UI."))) // INLINED!! - - call AddVersion("3.31") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix indices for units on website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add items for Dungeon buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename property Draktharon Keep into Azjol-Nerub."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Xe'ra."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add depencency equivalents for Goblin Mobile Turrets."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("GetObjectRace considers dependency equivalents now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support AI for race Old Horde."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support AI for race Alliance of Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve website data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add calendar event Carnival."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow player colors for alliance chat commands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow player colors for votekick chat command."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support ships for property Sunstrider Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support ships for property Darkspear Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add info quest Players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add library FrameHierarchy."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable library CustomConsoleUI due to issues in Warcraft Reforged 2.0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable library GetMainSelectedUnit due to crashes in Warcraft Reforged 2.0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable library UnitSoundSets due to issues in Warcraft Reforged 2.0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable library UnitSoundSetsFakeBars due to issues in Warcraft Reforged 2.0."))) // INLINED!! - - call AddVersion("3.30") - call CreateQuestItem(bj_lastCreatedQuest , (("Add world zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add continent zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add info quest Gaia."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom hero type to detect item values."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use Reincarnation icon for ability Halls of Valor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unit Goblin Vehicle Shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix syntax errors in Dungeon AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix research icon and position of hero spell Phoenix Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix skilled hero spell Phoenix Fire for boss Al'ar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Set hero level to 75 for all NPCs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing initial mount to hero Tyrande."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing initial mount to hero Maiev."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing initial mount to hero Keeper of the Grove (Ghost)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable all lever portals in the beginning of the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove one Spike item from Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename NPC Captain James Hook into Fleet Admiral Tethys."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more dependency equivalents."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use primary dependency equivalents in unit and building save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("No more usage of CopyGroup on generating save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically restore player unit selections after cinematics."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Scribe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix required hero level for profession 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Hunter trophies for more critters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys in levers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the number of summoned units for hero spell Summon Skeletons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Resurrection Stone to zone Underground."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Resurrection Stone to zone Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Resurrection Stone to zone Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down Resurrection Stones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for item Tome of Agility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for item Tome of Strength."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use UnitGroupRespawnSystem 1.2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add all critters as single unit respawns."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for unit Talbuk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for unit Parrot."))) // INLINED!! - - call AddVersion("3.29") - call CreateQuestItem(bj_lastCreatedQuest , (("Remove hero spells from NPCs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove inventory from NPCs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Life Regeneration Aura to NPC Chem Stormstout (Pandaria)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Store registered NPCs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingnpcs\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Lord Nicholas Buzan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Commander of the Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Keeper of the Grave."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Halahk the Lifebringer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Admiral Proudmoore's Spirit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Captain James Hook."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Carsten."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register NPC Barade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give hero in Elder Sage in Archimonde's Realm an Orb of Corruption."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Satyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Dalaran Housings train unit Dalaran Child now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move creep Whale further away from Sunstrider Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten chat message for chat command \"-aiinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only load workers into the mines for the current starting player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-ailoadmines X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Gnome AI housing ID."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Gnome AI trains Child unit now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Gnome AI trains Pet unit now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Gryphon Aviary into Aviary for race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Murloc Child to race Murloc."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix cheat \"-arena\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix research Studded Leather Armor for race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Phoenix Fire hero spell for hero Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Phoenix Fire hero spell for boss Al'ar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix worker order for auto loading AI mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate seasons for website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Strawberry."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Cherry."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Plum."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add resource Milk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add resource Wool."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Milk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Wool."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not register Ironclad Submarine for race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix registration of Male Citizen for race Demon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-fill\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-evolution\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Evolution does not remove positive buffs from summoned units anymore which killed them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-zf/-zonefull\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of building Cathedral of Light."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpcheats\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nocheats/cheats\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add info quest Cheats."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Caverns of Stonetalon Peak."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise start location icons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero duration of hero spell Corrosive Breath."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add tileset name to names of Mercenary Camps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease Evolution bonus to avoid instant deaths for new units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dead hunted animals immediately respawning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add library to support dependency equivalents."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Place more critters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove custom icon BTNCage which overwrites a standard icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system GameStatus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use system GameStatus to disable custom race UI during replays."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Hippogryph Riders to the Night Elf attack waves."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register unit type equivalents for Hippogryph and Hippogryph Riders."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Dragownhawks to High Elf attack waves."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Dragownhawk Archers to High Elf attack waves."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add War Eagle Riders to High Elf attack waves."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register AI conversions into Dragownhawk Archers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register AI conversions into War Eagle Riders."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register AI equivalents for submerged Naga units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register AI equivalents for Siege Tanks and Siege Tanks with Barrage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Auto skilling heroes checks for dependency equivalents now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Mass Death Coil."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make hero spell Summon Skeletons learnable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply summoned units bonus for hero spell Summon Skeletons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply timed life for hero spell Summon Skeletons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase Occlusion Height of Line of Sight Blockers to block vision for all ground units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Burrowed Sand Worm creeps the movement type Foot to fix Unborrowing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Underground."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Underground."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Kobold property into zone Underground."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add lever system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Cage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-raceui\" changes icons of actions bar UI now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease range of creep Infernal Juggernaut of Avatar of Sargeras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Fire 2 to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Nature to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace hero spell Time Portal with Mass Slow for hero Khadgar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove hero spell Time Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for unit Goblin Worker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change mount of hero Furbolg Ursa Warrior to Green Dragon Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sell more race unit types from properties."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ID of Kobold research Burrow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix instant death bug due to Evolution by applying the health bonus via code."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpreset\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-resetevolution\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-resetnavy\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-resetpower\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI does research Orc Spikes only up to level 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce GUI global variable array sizes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix global variable udg_ProfessionCook."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix global variable udg_ProfessionBard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix auto crafted item for profession Sorcerer rank Master."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add snow to Ironforge."))) // INLINED!! - - call AddVersion("3.28") - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Bandit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom icon and buff for Enslavement."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Slaves can Repair now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Switch abilities for hero spell Phoenix Fire slot 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add icon ability for hero spell Phoenix Fire slot 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add manual learn skill events for preplaced heroes on the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove constants for non-Warcraft themed Mercenary Camps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable XP gain for builders."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Vote \"-nobuilder\" works with save codes disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add property Deadmines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change owner of Egg Sack to Neutral Hostile."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix unmounting effect for race Stormwind."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Count unmounted knights for race Stormwind as Knights."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-save\" is disabled when save codes are disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-savec\" is disabled when save codes are disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix indices on showing/hiding AI players UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Enslavement."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show difficulty for chat command \"-aiinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show Shredders for chat command \"-aiinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show Zeppelins for chat command \"-aiinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register more hero types for AI scripts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more hero types in AI player settings UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix location of AI shipyard at Kezan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Stonemaul Arena."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-arena\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak for chat command \"-suicide\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak for chat command \"-teamcolor\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak for cheat \"-kill\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-zone\" works for any selected unit now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function CountItemsOfTypeIdAll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate number of units, buildings and items in the map for website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove invalid deleted abilities from Ride Down effect."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Mass Spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of spell Mass Ensnare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix missile of hero Assassin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Cheat \"-share\" shares control with player Neutral Passive now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Talk and Skip unit types from removed Talk system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix owner of Doom Guards on Argus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Bandit and Gnoll Slaves attack now for AI if available."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register unit type Orc Warlock as creep."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register unit type Gul'dan's Guard as creep."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix syntax errors in Gnoll AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor Thieves Guilds system reducing lags on killing units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale up model of neutral mine Well."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Random Mines closeer to Gold Mines to save space."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Random Mine to Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Random Mines to Hidden Bonus Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Explosive Barrels are not sold by Thieves Guilds anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Tiny Beehive item to Water Supply building for profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Tiny Apple Seed item to Water Supply building for profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rain refills all mines with resource Water."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add logo icon."))) // INLINED!! - - call AddVersion("3.27") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix syntax error in file \"CustomConsoleUI.fdf\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-aitraceon/off\" works per sending player now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve AI tracing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AutoSkillHero when not being able to learn a skill which has some level skip requirement."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove confusing output of AutoSkillHero when not being able to learn a skill."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for Locomotive and Railway info quest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("List \"-ping\" chat command in info quest \"Quests\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten tooltips of Demigod and Void Lord heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce AOE of Furbolg building Corrupted Ancient Protector."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove some creeps from Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move creeps on Kul Tiras further away from the start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove invalid building IDs from non-Warcraft races from gameplay constants."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix registered Kobold pet."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Kul Tiras Water Dragon with Albatross Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate calendar events for website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reselect hero Goblin Shredder after casting Kaboom!."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak from hero spell Burning Sky."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase scale of hero Ogre Magi."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix disallowing Selfdestruct in player selection area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix food and gold costs of Pet Dog."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix food and gold costs of Pet Rat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix food and gold costs of Pet Rabbit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register custom UI for race Vrykul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unused ability object data fields."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change the order of mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise game information."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change race of many Goblin, Draenei, Furbolg and Eredar units to Other."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Gem of True Seeing can be dropped by creeps and saved now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Scroll of Animate Dead can be dropped by creeps and saved now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Red Drake Egg can be dropped by creeps and saved now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor arena code into vJass."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("All arena items can be saved now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Init recipes before save codes for items to register the crafted items properly."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom models for High Elf ships."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom models for Blood Elf ships."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI units only cast Divine Shield if they actually have the ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum hero and skill level constants."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change tooltip of Drop All Items button in actions bar UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Display number of dropped items for actions bar UI button."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not hide actions bar on unchecking the checkbox."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase cooldown of hero spell Parry."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon positions of Sell and Buy 100 Argunite."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise displayed text for chat command \"-time\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ID of Kobold worker unit for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ID of Gnoll Citizen Male unit for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down Dimensional Ship buildings of race Eredar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI shipyard location at start location Sunwell Grove."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register Corrupted Entangled Gold Mine for race Satyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor auto loading mines for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register more mine types to kill them on repick and replacing AI units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change race for many heroes from Creep to Other to hide unit level in UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate mine race buildings on the race pages of the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Gnoll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Silithid Wasp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Quiraj Prophet."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS functions GetPlayerRaceX which fixes many other bugs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aishredders\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Every AI starts with 3 Shredders now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix soundset of Stormwind unit Ranger."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase attack range of Stormwind unit Cannon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Purchasing properties automatically sets all corresponding race researches to the maximum level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename hero spell Demon Master into Nether Dragon Master for boss Veraku."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey and icon position of ability Spell Book of the Old Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Spell Book of the Old Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change research Hero Level 100 into Hero Level 65."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hero spells of boss Tortolla."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Bandits."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Dark Wizard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Bandit Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Assassin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change race of hero Thief to Bandit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Crow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add short chat command \"-z\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise short map description."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Falric to start location Icecrown Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Random Mine at start location Icecrown Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace model of boss Queen Azshara to reduce file size."))) // INLINED!! - - call AddVersion("3.26") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI script for race Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips for race Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use unused skill points of hero General Vezax."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI shipyard to start location Teldrassil."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI shipyard to start location Thunder Bluff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove remaining non-Warcraft themed stuff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable map changer system again."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix applying race UI after loading savegames."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix restoring multiboards and action bar after loading savegames."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aizeppelins\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aitraceon/aitraceoff\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show owned mines and gold for chat command \"-aiinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor AI scripts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat command \"-aitargeton/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat command \"-aitarget\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduced quest log entries."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero journey levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hero level of NPC Xe'ra to 60."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Sand Worm Burrow ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of creep Sand Troll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Red Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero Harpy Queen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Game Settings option Both for AI special players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-aiharveston/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI gold harvest bonus only for certain races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Readd Harvest Custom Resources ability to replaced workers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove broken AI Harvest Lumber Bonus research to fix lumber harvesting for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the size of the Evolution Dummy area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix bonus hero Genn Greymane."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero proper name in text message on picking campaign heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove code from the removed hero spell Dinosaur Nest which led to spawning Dinosauriers."))) // INLINED!! - - call AddVersion("3.25") - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Bard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-v/-version\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Black Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Blue Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Bronze Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Nether Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Damage Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ranger for race Night Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give hero Ranger proper names."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Generate Gold and Lumber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system HandleCounters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add multiboards for handle counters and timers in debug mode."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon and model of NPC Monte Gazlowe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom icon for unit Steam Fortress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Bard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-letter\" shows the savecode in UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get several hero spells anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix targets of spell Mass Inner Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable ships for property New Stormwind."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not activate all resurrection stones when activating one."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Goblin Racing Organisation to Kezan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add multiple racing tracks to the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Car mounts have ranged machine gun attacks now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system OnStartGame."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add summoned units bonus for hero spell Summon Spider Egg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Racer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down unit Goblin Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove shadow from unit Goblin Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down neutral mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingrace\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add info quest \"Railway\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Always do cheat \"-website\" at 12."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix cut off quest descriptions for website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix selecting next altar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Tome of Skill Points."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent using tome items when tomes are disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system StopWatch for performance analysis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable frame focus when clicking on any actions bar button."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not auto revive for player Bosses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add random corpse creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for neutral building Bronze Dragon Roost."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix owner of Attributes building in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix playable map dimensions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Admiral Proudmoore to Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Tuskarr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips and hotkeys for building Research Tent and the researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move portal and scale down portal area on Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Improved Mount increases maximum mana points instead of sight range now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase limits for zones to fix the zones in Argus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix showing/hiding resources multiboard for clicking players only."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix desyncs caused by actions bar UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix desyncs caused by skill UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit TIE Fighter to race Galactic Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of unit AT-AP."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Wolf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten names of customizable heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Dragonkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Quillboar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Kobold."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more races to Random Warcraft III race for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of spell Feral Spirit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove hero Master of Time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove profession Chronomancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove neutral Turnstile buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove time related items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove rewind time systems."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove talk systems."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove code from object fields data system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix increasing attribute points on transforming back into customizable hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix giving a customizable hero attribute points only once."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Keep hero standard ability for transforming heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register hero spells for transformed hero forms."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for building Record Player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unit classification Undead from hero Acolyte."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero glow to hero Naga Siren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Ogre mounts into Black Dragon Mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Fel Crossbowman mount into Black Dragon Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Tuskarr Chieftain mount into Snowy Owl Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Unbroken mount into Nether Drake Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register correct Fel Orc Child for race Fel Orc."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Troll race Pet Direhorn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for unit Troll Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for building Troll Beastiary."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove all non-Warcraft theme stuff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix many boss hero tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention required hero level in boss hero tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Place hero General Vezax at Old God's prison."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Centaur Child to the AI script and register it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mass spell system to reduce code per mass spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove chat command \"-vipdesc\" and item VIP Name."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove item VIP Car."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve error message on not being able to pick a hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Furion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Furion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Malfurion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-portals/-noportals\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down Paladin units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Centaur special building in AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix shipyards and navy units in AI scripts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sacrificial Pit race buildings are recognized as buildings now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention chat command \"-unlock\" in tooltips now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention required hero level in Void Lord hero tooltips now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix listed taunt chat commands in quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove mention of Hall of Fame from the quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Computer AI trains frigates at sea locations now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Log chat messages in custom chat log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix crash on saving the game by not using CreateRegion in globals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix title color of calendar multiboard on loading savegames."))) // INLINED!! - - call AddVersion("3.24") - call CreateQuestItem(bj_lastCreatedQuest , (("Recommend SD graphics in map description."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show map version in stats title."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise hero Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingaltars\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingres\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for building Alchemist Lab."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Deactivate Resurrection Stone to Resurrection Stones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Include activated Resurrection Stones in action \"Altars\" action."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix item Weather Balloon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix item Tome of Armor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix item Manual of Mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Thieves Guilds."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix displayed calendar month."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change summer harvest bonus to fall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix calendar harvest bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make unit Skinning Rack invulnerable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix effect of Skinning Racks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve tooltip of item Skinning Racks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom icon for profession Hunter and item Hunting Bow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Resurrection Stones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Shandris Feathermoon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix adding Meat mines for dying critters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Silverpine Forest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace hero spell Envenomed Weapons with Poison Arrows for hero Drayd."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of day time for calendar multiboard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom icon for hero spell Poison Arrows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve tooltip for hero spell Poison Arrows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically change Barrage missile art to the hero's missile art."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Naga Siren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("High Elf units have hit points regeneration only during the day now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add level changer to level Ashenvale."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Water Tower to Engineer Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Advanced Water Tower to Engineer Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Wall to Engineer Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Phoenix Egg spell passive icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention bonus hero requirements in tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make more heroes bonus heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Corrosive Breath."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Chimaera."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Hippogryph."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin Tool Box ability Dig Up."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin Tool Box ability Dig Down."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("List mounts on heroes page on website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nohardcore/-hardcore\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Sea Elementals for slot 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Deeplord Revenant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix missiline launch coordinates for creep and unit Legion Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix coloring of unit Kobold Tunneler."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Tunnel system creates copies only in tunnels with the same owner now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Tunnel system does not check if unit is still loaded on removing copies."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Vote system uses ForceUtils now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("ForceUtils provides GetAllPlayingUsers now which is used for better performance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve terrain in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model for unit AT-AT."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unused object data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase sight range of Resurrection Stones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add tome effect when activating Resurrection Stones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase selection scale of heroes Kodo Beast."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add property Tomb of Sargeras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add property Theramore Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add property Boralus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add property Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location and zone Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename resource \"Electricity\" into \"Power\"."))) // INLINED!! - - call AddVersion("3.23") - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Kobold Tunnel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Kobold Child."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI auto crafting for profession Astromancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not show item owner in backpack UI if it is Neutral Passive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten width of tooltips in backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix matching hero for race in AI settings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Freelancer AI settings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingf\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add taunts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically replace standard hero ability with Submerge on water for Naga heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention the actual effect of hero standard abilities in tooltips when changing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("List hero standard abilities on the website per hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of hero standard ability Cyclone in shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give hero standard ability Rejuvenation 15 levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Revenant of the Tides with Naga Sorceror for race Naga."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Naga Sorceror missing abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Naga research Naga Sorceror Adept Training."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix registered Naga researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Naga units are affected by research Backpack now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Submerge to unit Naga Whaler."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("All Naga Submerge abilities require research now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Naga building Sunken Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add portrait model for Naga building Statue of Azshara."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom icon for unit Naga Whaler."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model for building Naga Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-skymoon\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Direhorn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use updated PagedButtons system with model previews."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix a crash on loading savegames due to UnitSoundSetsFakeBars not hiding frames."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS function GetStandardHeroAbility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Goblin Car."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model for Chests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Engineer building Chest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS function IsWaterUnit for all unit types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Configure neutral water zone per map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Molotov Cocktails."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Grenades."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment AK-47."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Sniper."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item level, gold cost and lumber cost for equipment to website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin quest 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin quests use a simplified way to ping the next target."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Horn to car mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add votes \"-foodX\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-helpfood\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Direhorn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom log UI which helps reading messages in multiplayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin General Grievous."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin C-3PO."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin R2-D2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Buildings Murloc Blademaking Hut and Murloc Lumberkeep have different hotkeys and icon positions now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Tome of Damage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Tome of Armor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Manual of Mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment M249."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Stormwind Armor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero Eredar Warlock is classified as Undead now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero Succubus is classified as Undead now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero and boss Archimonde is classified as Undead now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero and boss Kil'jaeden is classified as Undead now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("The hero has to return the Charm spell item in Demon quest 2 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the name of Lady Hederine in demon quest descriptions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Dimensional Gate to Outland and connect it to the one in Azeroth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("No more talk to me effect on Lich King from the start of the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor Forsaken quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Stop Firework Team by player Gaia to attack creeps in the beginning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Checkbox in backpack UI enables bag numbers now instead of disabling them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use functionality from PagedButtonsConfig in backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Nocturnal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Diurnal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of ability Diurnal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down mines Power Plant and Nuclear Power Plant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("One lever in Sunwell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add tiny building items for race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register missing tiny tower items for race Human."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-limits\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nolimits\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register Dragownhawk Aviary for race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use different icon for hero spell Druid Forms."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace tile Square Tiles Outland with Snow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use Snow tiles in Northrend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add trees to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-summer\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-spring\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-fall\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-winter\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-seasons\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-noseasons\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Less Sunken Ruins terrain in Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-time\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add season and weather systems enabled for certain zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove default Snow weather effects from Northrend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of Advanced Farming."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Animals of profession Farmer have resource Meat now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Critters have all tilesets now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix custom sound sets for Cow units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Demon Gate at Black Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Pumpkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Seed Pumpkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix fly height of hero Gryphon Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Waygate ability area smaller to fix Outland portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS function PlayerCanBuyHeroEx checking for unlock all."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function GetPlayerNameColoredSimple."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS constants for hero journey hero levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve message for first equipment bag in hero journey."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Burrow to Nerubian and Kobold heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Lich King drops item Frostmourne."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add taunt system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-taunts\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-tauntson\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-tauntsoff\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace tile Bricks Outland with Sand."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Tanaris."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critter Camel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change missile of Sand Elemental for race Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Enraged Sand Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Berserk Sand Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Sand Worm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Sand Troll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-timecycle\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-notimecycle\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-morning\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-noon\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-day\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-evening\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-midnight\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-night\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-weather\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-noweather\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase duration of item Cage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-terrain\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Inspect Ground to item Goblin Tool Box."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix player selection text tag visibility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom icon for unit Zandalari Throne of War."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix sound SargerasLaugh in cinematic Old Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register Night Elf Child for race Night Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register Harpy Windwitch for race Centaur."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Orb of Kil'jaeden can be used now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Tome items are not used automatically anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down unit Naboo Star Fighter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down unit AAT."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing texture CorruptedNightElfBase."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Improved Corrupted Ancient Protectors to race Satyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Egg Sack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move multiboard toggle button into actions bar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Eredar AI starting units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix worker type for Satyr AI when loading workers into mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix IDs in Satyr AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Pet Sludge unit for Satyr race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Satyr Child unit for Satyr race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Weather Balloon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix \"Drop all items.\" action in action bar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve registered zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Doodads and destructibles change animations because of day and night cycle now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve terrain of player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Fireflies doodad."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nowater\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-water\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-waterred\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nofog\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nowater\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-fog\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing hero standard ability Berserk to hero Ancient Hydra."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing hero standard ability Berserk to hero Sauron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give hero Wisp the hero standard ability Repair."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Living Statue."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Selfdestruct to Command Buttons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Pet Worm with Pet Dog for race Furbolg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Furbolg AI trains Pet Dog now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for hero spell Explosive Barrel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for Goblin ability and research Explosive Barrel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow Selfdestruct in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Happy Easter from Event House since it is supported by calendar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix choosing a start location when not a member in Elven Clan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model of Druid Tree Form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Night Elf Car."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more paths from Northrend's coast into the land."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn icon of hero spell Phoenix Egg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Phoenix Egg for slot 4."))) // INLINED!! - - call AddVersion("3.22") - call CreateQuestItem(bj_lastCreatedQuest , (("Do not remove talk to me effect after completing Tuskarr quest 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin quest 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Forestation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add \"Matching Start Location\" race entry to AI players UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Mount Hyjal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register missing Tiny Building limits for towers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not craft placeholder items anymore for professions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add throne Doodad to Gruul's location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more missing zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move buildings on Hidden Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down many shipyard buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down building Trading Post."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of item Restoration Stone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix spell Mass Rejuvenation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Power Generator."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of special buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Thieves Guilds do not sell units of any other race anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor Thieves Guilds code."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable Dark Conversion from race Demon for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Sleeping Bag item abilities cooldowns."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Night Elf 2 quest area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix target of Portal to Emerald Dream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change effect of legendary item Ysera's Heart to spell damage reduction."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not remove properties on repick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add action Drop All Items to action bar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit classification Town Hall to properties."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Elven Gate to Teldrassil."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add checkbox to backpack UI to hide bag numbers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function CreateFullScreenCloseButton."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS constants for UI layout."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify code for URL UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify code for Save UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify code for Backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify code for AI Players UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove cheats \"-bagui\" and \"-nobagui\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace unfinished summoned units UI with WoWReforgedSummonedUnits."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function GetNextUnitToSelect."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add action Summoned Units to action bar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Outland gate description triggers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix description of resource maximum food."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix crash after loading save games caused by GetMainSelectedUnitForPlayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix crash after loading save games caused by WoWReforgedRacesUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add level Orgrimmar Tunnels based on the Orc Bonus Campaign."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Old Gods death animation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Shaman."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Purge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Lightning Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename World Portal into Level Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unused stats triggers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Auction House."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Unit Gavel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Item Gavel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function TriggerRegisterAnyPlayerSyncEvent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor code for stats to improve the performance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of spell Frost Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon positions of slot 5 spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix updating skill UI when any hero is leveling."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable skill UI in multiplayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify code of PagedButtonsUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide frames of PagedButtonsUI before saving a game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix stats multiboard color after loading a save game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix summoned units bonus for spell Raise Dead slot 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow stacking item Pickpocketing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Crossbow Turret has custom buff now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of legendary item Sea Witch Tail."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add action Altars to action bar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Picking up all items is not allowed if hero is dead."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Picking up all items is not allowed if hero is in transport."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use SD version of Violet Citadel in Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow chat commands \"-aiattackson/off\" for The Burning Legion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix effects for Pandaren quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Pet Fel Beast."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Polar Bear mount is amphibious now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Bear mount is amphibious now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make target area around shipyard bigger for Tuskarr quest 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Bank Director uses all skill points now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change ownership of Goblin Flamethrower for Pandaren quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten tooltip of item Advanced Goblin Night Scope."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Crystal Ball is no longer perishable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Scepter of Disarmament has 0 charges now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Scepter of the Mur'gul has 0 charges now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Unlimited Goblin Land Mines has 0 charges now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-mountnameX\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Jaina and Paladin on Theramore affect any hero now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Set movement type of Witch Hut to None."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add feedback messages to Witch Huts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Roar to Witch Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Cyclone to Witch Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Blood Lust to Witch Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Slam to Witch Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Ancient of War."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Play Gate open sound when using item Lock Pick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("General Grievous does not get a standard mount ability in 4 Light Sabers form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix lever for top Demonic Gate in Illidan's Camp in Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate all info quests for the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable item drop triggers for Jaina quests only during quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mind Control."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI support for profession Tamer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI support for profession Necromancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI support for profession Golem Sculptor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI support for profession Warlock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Meteor Stone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Navigation Scroll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Astromancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Phoenix Egg anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Reflection anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Envenomed Weapons anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learnable hero spell Rain of Chaos slot 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use regular summoned unit bonus for spell Council of Six."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("PagedButtons UI does not show tooltips anymore on newly selected shops."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Abilities Ping Destination and Select Location do not have the same ID anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Include Portal buildings for all races when changing the names to the destination."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix owner of Fountain of Power in Emerald Dream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of spell Scream."))) // INLINED!! - - call AddVersion("3.21") - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Explosive Barrel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Djinn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix reacting to changing player color popup menu in AI UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix effect of item Demon Slayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for Explosive Barrel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for spell Inscription."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Demoralize."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Parry."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero spell Water Ray for slot 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent Charm for all Neutral Hostile units in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Fire and Frost Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Random Mine to Azuremyst Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Lever Gate and Bridge to Azuremyst Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Velen to Azuremyst Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Open gate at Azuremyst Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Eredar tier 1-3 buildings train Male Citizens now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ancient Sasquatch."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ancient Wendigo."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-creeps\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix position of Fountain of Power in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase scaling of hero Brood Mother."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Start at page 0 in player selection taverns."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero standard ability Loot Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix aiming with mouse for Fire and Frost Ray by using AngleBetweenCoordinatesDeg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of building Acclamator."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support all items from Goblin Merchant in savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support all trophy items in savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change owners of Dalaran Mutants creeps to Neutral Hostile."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Free People of Middle Earth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove duplicated unit Raccoon from save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Raccoons to the map which can be hunted."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-t/-trophies\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Bear Traps lead to hunting trophies."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hunting Dogs can cast Track now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Crab Shell trophies dropping from Crabs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model of hero Golden Val'kyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Harpy Windwitch."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Centaur Archer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Green Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Red Drake."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Furbolg Tracker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Black Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Satyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Satyr Trickster."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Enraged Wildkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Berserk Wildkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix slot and hotkey for hero spell Breath of Fire for hero Anasterian Sunstrider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for building Ice Troll Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove food cost from bonus hero Gul'dan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Captain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace hero spell Sentry Ward with Mana Ward for hero Witch Doctor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove old hero spells from World of Warcraft Reborn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Mannoroth's Reincarnation hero spell to slot 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix requirements of cook recipes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register missing buildings for save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Brilliance Aura to Witch Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Black Arrow to Witch Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace broken SD soundset FemaleSatyr with Satyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-heroskills\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Ultravision."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for hero spell Mechanical Repair."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hero spells for hero Archimedes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Spade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix picking up items into the hero's backpack when the inventory is full."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Redirect some orders issued to the backpack to the hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not add command buttons to backpacks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add special building for race Satyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Satyr research Nature's Blessing affects tier 1-3 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Wolf Spirit Hood."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Infernal Destroyer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use new op limit when adding all heroes to the tavern to avoid issues."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update system PagedButtons to version 1.5"))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add random buttons to the taverns of the player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Random Tavern from player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unused Tavern buildings from object data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("JASS function PlayerCanBuyHero checks for bonus heroes now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Furbolg Ursa Warrior."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Sorceress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Captain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for hero U. S. General."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom hero spell Divine Shield for hero U. S. General."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Sting."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Oathbreakers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Horn of Gondor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Gruul the Dragonkiller."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add back bonus hero Sylvanas for race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add back bonus hero Thalorien Dawnseeker for race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add back bonus hero Jango Fett for race CIS."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Ranger."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Ancient of Lore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give hero spell Send to the Future 15 levels instead of 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Function IsRaceUnit uses ship, Tauren and Dragonhawk types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Christmas Creatures."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Al'ar to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral passive building Phoenix Roost to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom Phoenix Egg abilities for Ancient Phoenix and creep Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Phoenix Egg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing tooltip to creep Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Lesser Thunder Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Thunder Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Greater Thunder Phoenix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Monk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Bonus mounts require hero level 55."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus mount Dwarf Car Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus mount Orc Car Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus mount Undead Car Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus mount Demon Car Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Speed Boost."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow registering maximum levels for hero standard abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of hero spell Minigun Rage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icons of Old Horde towers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix models of Old Horde towers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add special building for race Gnome."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Boba Fett."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Rebel Alliance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Millennium Falcon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Gronn model."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix cleaning up effects for Sith light sabers on unit decay and removal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Jedi unit models with team colored models and attach light sabers as effects."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically add limits for registered race unit types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register all Worgen researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add music Cantina Band to Record Player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI autopicking professions and races at higher hero levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show technology percentage in player info."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Select Turrets."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Qui-Gon Jinn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Star Wars skins."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add attribute Thief."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention light saber chat commands in quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Extra Light Saber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Metal Boots."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Knight Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Terran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Sauron's Forces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Alliance of Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-cinrace X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Demon Shipyard has no Blight growth anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix texture path of unit Elekk Knight."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icons for many models based on screenshots."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Vrykul race can train Human ships now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix number of maximum races by starting with 0 and not 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Devour Cargo ability stays now with hero even after transformations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icons for Blood Elf researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Child unit to many races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Goblin Tunnels Waygates to simplify the whole concept."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable Dwarf railroad system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Fel Orc Shipyard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Nerubian Shipyard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Thief."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Thief items from Goblin Merchant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change effect of item and spell Pickpocketing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Razomane Chieftain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Vampire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent double fade after skipping a cinematic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease shadow size of Harvest Carts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix bounty for Gnome research Inventions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix profession bonuses for extra crafted items and units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Blood Wizard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Defender Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Guardian Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Moss Covered Granite Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Flesh Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Gnoll Poacher."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Gnoll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Gnoll Brute."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Gnoll Warden"))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Gnoll Overseer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register creep Gnoll Assassin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Shipyard to Freelancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-savecodemissing\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Place more chests on the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Professions allow crafting more than 1 item or unit per rank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add purchasable properties."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down some neutral buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing Goblin Laboratory to start location Argus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing Goblin Merchant to start location Thunder Bluff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Chronomancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove some neutral buildings from Goblin Bank Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Taxi system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move neutral buildings from Goblin Bank Island to Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-g/-get\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recipe Craft Potion of Healing does not require any tier anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recipe Craft Potion of Mana does not require any tier anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Potion of Greater Healing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Potion of Greater Mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Potion of Invisibility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Potion of Greater Invisibility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Icecrown Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Silvermoon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Sunstrider Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Thunder Buff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Outland Black Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Outland Illidan's Camp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Sludge Monstrosity."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icons for Demon race researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Salamander Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest \"Defeat Archimonde\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Tuskarr AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingproperties\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve crafting system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model of item Potion of Invulnerability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Ogre Warrior."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Ogre Magi."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Ogre Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Gronn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Thane."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Flamebinder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Wolf Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Nerubian Queen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Giant Skeleton."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Skin Sludge Monstrosity."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Salamander Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Potion of Lesser Invulnerability to the VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Glowing Mushrooms."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Kobold Candle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of item Tiny Gathering Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aieasy X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-ainormal X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aihard X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aiinsane X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Elder Ko'nani."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add resource Fel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpsave\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-b/-bans\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Kezan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Monte Gazlowe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Clan Meeting Point into Clan Shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise Clan Shop system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Clan Pandaren Banner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Clan Dwarf Banner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Clan Gnome Banner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make primary attribute of hero Ogre Magi intelligence."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make primary attribute of hero Monk intelligence."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Landowner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Summon Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Summon Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Red Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Mushroom."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral unit Drillbot."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Magical Coin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Prospector."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Tuskarr quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-whaleson\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-whalesoff\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Massive Ruined Gate in Northrend dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move all portals from Portal Room to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give all portals the Way Gate model and soundset."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Zones have player colors now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically give all portals the name of their destination zone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Thief."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register summoned units for website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for Accept."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add command buttons to preplaced units in the beginning of the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dependency of Pandaren Blacksmith."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename NPC Queen of the new Citadel into Lady Hederine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-professions\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-boots\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more tiny items for buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset all heroes to the neutral zone when a player leaves the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Share vision or even control with users when a player leaves the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for item Sleeping Bag."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register more zones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove duplicated item type Gold Bars."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase maximum stacks for item Gold Bars to 100."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Emerald Dream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add actions bar UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not add command buttons to rootet ancients which cannot move by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change costs of item Gold Coins to 125 lumber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Black Dragon Roost with Blue Dragon Roost on Elven Clan Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Place Infernal Juggernaugts in Tomb of Sargeras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Elk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Abolish Magic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Dryad."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learnable hero spell Barrage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix directory path in savecodes UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ambient sound votes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add sky votes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reselect hero after casting spell Burning Sky."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Water Portal destination to the sea at Northrend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable AUTO_UPDATE_STOCKS for performance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve performance of JASS function IsInSinglePlayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Centaur."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change mount of hero Centaur Khan from Wyvern to Eagle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add tooltip to toggle multiboard checkbox."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify code for toggle multiboard checkbox."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing texture for building Sawmill."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learnable hero spell Summon Green Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Ysera."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Xavius."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add music A Call to Arms to Record Player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Dryad Faun."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function IsUnitNeutralBuilding."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register all mercenary camps as neutral buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Explorer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Master Explorer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Druid of the Claw."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Druid of the Talon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Dryad."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Darth Vader."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Darth Maul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add back hero Gunner."))) // INLINED!! - - call AddVersion("3.20") - call CreateQuestItem(bj_lastCreatedQuest , (("Generate Sacrificial Pit buildings on the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix generating unit bounty on the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix scepter item for race Galactic Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cinematic Old Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Eredar quest 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Eredar quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Eredar quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Ancient Hydra."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Revenant of the Tides to race Naga."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of Naga tiers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for Naga unit Coral Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dependencies of Naga researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Naga Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace item Orb of Fire with Orb of Wind for race Naga."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and icon of hero Naga Royal Guard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase damage of ulti spell Monsoon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase mana cost of ulti spell Monsoon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom Ray system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Fire and Frost Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Loot Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Harvest Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Skin Villager Female"))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Randomize Skin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Chain Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Shimmerglaze Roast can be dropped by creeps now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add respawnable item Shimmerglaze Roast."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Azuremyst Isles."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disabling AI changes flag which prevents AI loops."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase damage of spell Mass Death Coil."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Resurrection Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Wind Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Water Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease delay between rocks for spell Summon Wall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Arch Sorceress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Loot Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of ability Fire Attack Icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Black Arrow Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Frost Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix mass spells by not using BlzGroupAddGroupFast anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix spell Mass Illusion by including units of the caster."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change the effect of Target Divine Shield to the new Divine Shield effect."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove learnable hero spell Spell Immunity since it is too powerful."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move intro cinematic after autoloading character."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not store non-permanent text tags forever."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cinematic Invasion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more Dimensional Gates to quest Invasion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak in quest Invasion when summoning an Infernal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Portals can have units and destructibles as destinations now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add color names to AI player settings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Brood Mother."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cinematic Lich King."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cinematic Outro."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Heroes can be restricted to account names now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mounts can be restricted to account names now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add VIP hero Barade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add VIP mount Snowy Owl."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Naga building Murloc Hut with Royal Vault."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix female Draenei texture."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Dark Val'kyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Rokhan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Cairne."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Rexxar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move hero Beastmaster to race Ogre."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase creep levels for hero spell Polymorph."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Polymorph as learnable hero spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Inscription."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor system TreeUtils."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing tree types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix summon unit effect for critters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Next/Previous Page in AI UI to Next/Previous Player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Envenomed Weapons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Creep."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Hex Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register AI script per race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Succubus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Poison Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Charm Ray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Powerful Staff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Uruk-Hai."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Lightning Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Doom Guard of Sargeras into Doom Lord of Sargeras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Doom Lord."))) // INLINED!! - - call AddVersion("3.19") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Eredar quest 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix legendary item of Argus boss."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Scepter of Alliance of Lordaeron summons the correct workers now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Tiny Town Hall of race Alliance of Lordaeron summons the correct building now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve generated data from cheat \"-website\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move dragons next to Orgrimmar to the north."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Unit Ogre-Mage of race Old Horde has mana now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ability Unholy Armor of race Old Horde gives an armor bonus now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Troll Berserkers of race Old Horde have increased hit points, sight range and attack range now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Old Horde Peons can build a Foundry now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Grunt soundset from Warcraft II."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unused function DestroyBackpackUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom UI for paged buttons to show more at once."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum hit points of boss Elune."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix function IsRaceBuilding for special buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically skill leveling AI heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register more hero spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register more race data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Fel Orc."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Icecrown Overlord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Frost Bolt Rain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Wand of Telekinesis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Tidesage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Faceless One."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Unbroken."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Naga buildings are not affected anymore by Improved Masonry from Blood Elf race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Naga buildings are affected by Glyph of Fortification now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show item owner in tooltip of custom backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change order of teleport spell Pandaria for Freelancers from frostnova to spies."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Armory requires ground pathable now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename building War Mill into Blacksmith for race Sauron's Forces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and icon of building Blacksmith for race Sauron's Forces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix check for AI tier 3 for race Sauron's Forces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add tier 2 and 3 buildings to race Free People of Middle Earth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Backpack to race Free People of Middle Earth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leaks on creating AI units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Spell Book is not dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fish Schools have much more Meat now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critter Raven."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critter Parrot."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero General Vezax."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell Mass Transmute requires level 6."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add intro cinematic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Felling Axe causes more damage per hit to a tree and allows carrying more lumber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Alchemist Lab does not include race None anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix item Tiny Town Hall for race Human."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Random Save Code."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Fel Warlock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Fel Warlord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Fel Crossbowman."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Kargath Bladefist."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Fel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Fel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Inner Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Inner Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace spell Healing Wave for hero Priest with spell Inner Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Black Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Orc AI trains Child and Pet units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ancient Hydra."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add script which checks all AI scripts for syntax errors for future releases."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI scripts for races Freelancer, Gnome, Medieval, Stormwind, Eredar, Centaur and Tauren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-w\"/\"-website\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix race Lordaeron for race selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment items cannot be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Play click sound for up and down buttons in AI players UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Raider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Fel Raider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix system UnitEventEx by replacing BlzGroupAddGroupFast with GroupAddGroup."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve performance in loaded mines system for custom resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Fel Peon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Fel skins for customizable heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hiding slot 5 spell icons before reaching hero level 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Warlock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce cooldowns for profession craftings with higher hero levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icons for German WWII buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show info about chat command \"-pingeredar\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Improved Masonry for Freelancers is available for Warlords should affect more buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move research Improved Masonry from building Freelancer Laboratory to Research Tent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Glyph of Fortification affects more buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show special building 2 for races on the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise description of Draenei quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Boots of Teleportation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Boots of Teleportation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Magic Sentry abilities from Dwarf towers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of Dwarf towers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix abilities of creep Inquisitor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix creating a Tauren Great Hall for Tauren AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of item Tiny Great Hall of Trolls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Tiny Great Hall item sold by Tauren shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more researches to Troll AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add AI script for race Ancient Greece."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Tauren icon which caused a crash when clicking on building Spirit Lodge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI mining for race Corrupted Ancients."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leaks for AI automatic periodic triggers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom command buttons to have more space for other icons in the unit control UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom command button for auto skilling a hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve the performance of JASS function AutoSkillHero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Corrupted Ancients."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ancient of Lore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-ainone\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aineutral\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aicreep\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aicomputer\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Root."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename race Corrupted Ancients into Satyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS function IsUnitTypeNavyHero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero level 30 requirement for many races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make less races require hero level 30."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creeps Phoenixes to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Satyr Trickster."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Phoenix."))) // INLINED!! - - call AddVersion("3.18") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Jaina quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat commands for enabling/disabling leaderboards in all 4 Jaina quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve website data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix mount of hero Samurai."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix several boss tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix attribute points for customizable heroes on hero transformation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Auto skill heroes when reaching maximum hero level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Ogre death animations on training after researching Ogre Strength."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of research Resistant Skin for race Ogre."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Ogre ability Fire Attack is only enabled after researching it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Ogre ability Hurl Boulder weaker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Useless item Clockwork Penguin is not randomly dropped anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Ogre research Pulverize."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide idle worker button for custom race UIs when there are no idle workers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model for Ogre unit Clefthoof."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ogre citizens and children have ability Ogre."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce hit points bonus from Ogre Strength."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Attribute Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Strength Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Agility Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Intelligence Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add zone Argus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically disable crafting on unit deaths."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Cook."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Vigilant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Imonar the Soulhunter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add equipment Throwing Axe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add attribute Stamina."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add attribute Luck."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add attribute Mystic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add attribute Charisma."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New system for registering start locations which shows paged start locations in tavern."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Tiny Fruit Stand to shop Goblin Laboratory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Garlic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Meat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Fisherman."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell D&D Duel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell Mechanical Critter summons only 1 critter now but increases the stats and decreases the cooldown with every level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Shark."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Flying Dummy Sheep is targeted as air now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing weapon sound to bonus hero Malorne."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model of building Fish School to make it selectable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change movement type of Fish Trap to Float."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Fish Trap no building anymore to make it it die at some point in time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Fortified Ogre Mound requires Altar of War now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the effect of ability Enable/Disable Gold Exchange."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add toggle button for multiboards to the top right of the screen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add idle summoned units button to the bottem left of the screen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix crash on clicking on the building Ogre Arena by fixing the Gronn icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add animation tag \"upgrade\" to unit Gronn with War Club."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase movement speed of unit Clefthoof."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase transport size of unit Gronn to 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Mercenary Camp (Sea) to Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change races of Magical Frog and Magical Albatross to Other to not summon them with spell Mechanical Critter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Eredar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Wrathguard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Mo'arg Overlord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add critter Talbuk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Talbuk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Dragonkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more races for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add respawning item Flowers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Eredar quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix index of backpack UI item tooltip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Preview item model in backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix spell Tail Swipe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom knock back type for spell Meteor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Inquisitor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Jailer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Lumberjack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add resource Argunite."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add random mine Argunite Mine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Inferno to unit Legion Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Inferno to race Demon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Jailer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Gronn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace model of building Sunwell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Conqueror."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support AI for race Stormwind."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Murloc."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support AI for race Murloc."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add requirements to Naga researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Tuskarr race uses correct AI script now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename building Vrykul Longhouse into Longhouse."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell Jump Attack causes damage now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix resetting start locations for AI on using chat command \"-aireset\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Lion Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Eredar Annihilator."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not cut off strings for the website anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Dragonspawn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Frost Bolt for slot 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Frost Bolt for slot 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI attacks with dragons from Dragon Roost building with the final waves now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support AI for race Medieval."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support AI for race Union."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify recreating AI town halls by using registered town hall unit types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify reviving AI heroes by using registered altar unit types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not create boss icons by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero spell Magic Defense requires level 6 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Murloc River Bank and Swarming buff effects."))) // INLINED!! - - call AddVersion("3.17") - call CreateQuestItem(bj_lastCreatedQuest , (("Add more Random Water Mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest marker for shop in Pandaren Quest 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix GetHighestHeroLevel when hero levels 1 and 2 were equal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Profession Golem Sculptor crafts Golems with more charges."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Old Horde."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Alliance of Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Gryphon Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Earth Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Air Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of unit Air Elemental of race Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Neptulon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Therazane."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Thunderaan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Jaina quest 3 Elemental Lords."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Earth Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Air Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Fire Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate skins table with cheat \"-website\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Gnome unit Drill Engine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Inventions increases defense and movement speed of Gnome units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Yu'lon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Jaina quest 4 Wild Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable custom auras for paused casters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename boss Ancient Turtle into Tortolla."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Ohn'ahra."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Divine Golem uses new Divine Shield ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Cyclone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not apply any music after player selection anymore due to Warcraft III bugs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Eredar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Heart of Azeroth cannot be used anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise becoming a Demigod avoiding memory leaks and recreating equipment bags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Gnome."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit sound set to Gnomish Submarine unit types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aiignoreall\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aiignore\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aiuse\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add railway to Azeroth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-train\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-notrain\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit classification Mechanical to unit Flying Machine Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of spell Summon Fire Elemental."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more gates and water entries to start locations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove creeps from portal area in Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename quest The Old Gods into Old Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make creep Gronn stronger."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-builder\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nobuilder\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model with team color support for tent buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Union."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ulysses S. Grant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor race system to simplify adding races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Evoker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Tail Swipe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Jump Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ChangeLog to quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow changing player color in AI GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero tavern pages names."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add talk system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add talk to NPC Carsten."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for item Staff of Silence."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for item Staff of Negation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for item Mindstaff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for item Scepter of Humans."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for item Scepter of Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for item Scepter of Stormwind."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Undead Child."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Mace Windu."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Reflection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix allowing unit targets for ability Disassemble."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve tooltip for ability Disassemble."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Missing \"or missing ingredients\" in message \"Out of stock\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention food costs in unit recipe tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Lemon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orange."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Sleeping Bag."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow loading savecodes with the current amount of XP for your primary hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update attribute points in UI on changing attribute skilling."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Child for Freelancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix return buildings for custom resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest info Key Movement."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more keys in key movement."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support moving right, left and down in key movement."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix buff of ability Disarmament."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for buff Disarmament."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix buff of ability Scream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for buff Scream."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Brutosaur mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hiding/showing all floating text tags on enabling/disabling the third person camera."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Third person camera works with transporters now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Quiver."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of spell Preservation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give profession book items a custom model."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Customizable Hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix keeping custom attributes when replacing heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix workers for custom resources when loaded by savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement War Criminal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest marker to Chen for Pandaren Quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow discovering Jaina's quest by completing Pandaren, Lich King, Forsaken and Naga quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow discovering quests by any hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase cooldown of hero spell Sentinel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow marking item abilities which do not exist for profession Combiner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Smoke Signal Grenades."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Arrows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Cheat \"-items\" creates all known items now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix checking for race none in race selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Hunter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function GetProfessionByTavernItemTypeId which simplifies adding new professions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add respawning critters to the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Achievement Master."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of hero spell Master of Moria."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero spell Master of Moria uses timed life."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove limitation note from tooltip of building Research Tent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for ability Fire Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ability Hardened Skin of unit Kor'gall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give unit Clefthoof mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Fire Attack hero spell icons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add war club attachment to Gronn with War Club."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change proper names of hero Flamebinder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change proper names of hero Wolf Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon to unit Ogre Drummer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon to unit Ogre Stone Thrower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon positions of Ogre researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Ogre Child to race Ogre."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Orb of Lightning with Orb of Fire for race Ogre."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Reinforced Walls for rall races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Wall buildings are affected by more researches now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove food cost from heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Kodo Beast."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix showing icon for slot 5 hero spells when spending all skill points."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Oil Tycoon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use working alternative to I2S in AI scripts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix order of hero spell Shrink."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-quests\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Strength Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Intelligence Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix detecting slot 4 on skilling hero spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix detecting a single selected unit for resources and skill points UIs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change order ID of ability Skill to avoid the same order ID as Druid Forms."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support registering icon abilities for hero spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update texts on Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use new custom models for Pandaren buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Great Pandaren Temple can be upgraded to Temple of Light and Temple of Darkness now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Malorne."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Forest Word."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-playername\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-playercolor\" works for AI players now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing chat commands to quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Saddle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys of hero spell Tornado."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix removing buffs on unlearning Aura hero spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace order ID \"roar\" with \"spies\" for ability Return Resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove gold and lumber cost from bonus hero Durotan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change color of damage floating text."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing profession 3 and race 3 to player selection floating text."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mechanical Critter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Rejuvenation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Spy."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-resinfo\" shows now which resources can be returned to the selected unit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make item Rocks perishable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys of hero spell Healing Spray."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Moon Well effect of hero spell Replenish."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Life Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mana Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Samurai."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing research Spiked Shell to Pandaren building Storm Spire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of Pandaren ability Chain Lightning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dependency of Pandaren ability Chain Lightning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of buff for ability Disarmament."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Swap models of units Pandaren Citizen and Pandaren Woodcutter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Cannon Tower to race Pandaren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Guard Tower to race Pandaren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Pandaren building Lantern into Scout Tower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Pandaren building Arcane Lantern into Magic Tower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing research Hardned Skin to race Pandaren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ability Equal Attributes skills the primary and secondary attribute with remaining attribute points now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Random mines will be placed after setting the theme of the game and consider the theme now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically skill to maximum levels when using ability Randomize with maximum hero level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pandaren research Bamboo Sticks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow more unit targets as targets for gathering and returning custom resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Elven Cloak."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom functions for hero unskilling events to HeroUtils and fix corresponding triggers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix race of Dummy Pig units to prevent summoning them as Mechanical Critter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove stock delays for item Tome of Retraining."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn ability for hero spell Cyclone in slot 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Enable/Disable Gold Exchange to building Trading Post."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Spanish Conquistador to race Medieval."))) // INLINED!! - - call AddVersion("3.16") - call CreateQuestItem(bj_lastCreatedQuest , (("Change chat command \"-pingoldgods\" into \"-pingjaina\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Jaina quest 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix pinging the heroes tavern during the hero journey."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Evolution Stone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give quest reward item Jaina's Crystal Ball a cooldown."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not stop the music for any other races which have no specific set of music."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpsound\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-music X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-resetmusic\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more races for music."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Old Horde."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Alliance of Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Oil Patch."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-enablevips\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-disablevips\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix disallowing races for non-VIPs due to Corrupted Ancients."))) // INLINED!! - - call AddVersion("3.15") - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hero spell Cleaving Attack bonus per level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix healing and mana regeneration aura of NPC Lord Nicholas Buzan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix attribute skill points on repicking the hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat commands \"-str\", \"-agi\" and \"-int\" allow skilling the attributes to the maximum."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-reseta\" to reset skilled attributes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-equala\" to skill attributes equally."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Format descriptions of hero standard abilities on the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename research Dragon Roost into Dragon Lore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS function ColoredSaveCode for character |."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix several unlearn spells events."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-areset\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatic loading is enabled per player now and not for all players at once."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom auras do not target invulnerable units anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Restore hero skills on replacing equipment bags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Link custom aura bonuses to the buff instead of the time to avoid constant changing of bonuses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Unit Elite Siege Tank is affected by researches now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow giving invulnerable units to other players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak on giving units to other players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve tooltip of ability VIP Spell Book."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Mass Entangling Roots."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Customizable heroes get only 5 attribute points instead of 7 per level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix resetting bonuses for item Ancient Bow on dropping it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the owner of boss Murloc Sorcerer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Magic Defense."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent tomes items from being used if disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more items for savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add longer cooldown to hero spell Mirror Image."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mirror images take only 100 % of damage now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Wand of Corpse."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Necromancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn hotkey of hero spell Spell Steal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix resources icon positions in building Trading Post."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add resource Fruits."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Banana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral mine Fruit Stand."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Hall of Fame."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Jaina Quest 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Town Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Corrupted Ancients."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Satyr Hellcaller."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix setting the number of charges for crafted profession items on stacking."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Auto assign profession 3 to AI now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise profession system to simplify adding new professions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Golem Sculptor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral unit Harvest Cart to return gold and lumber from anywhere."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Berry Bushes as mines for resource Fruits."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of Furbolg building Green Dragon Roost."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change sound set of Furbolg building Resurrection Stone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the percentage of hero spell Howl of Terror."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove buffs from target units before applying evolution to avoid massive armor bonuses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Boss Kil'jaeden drops legendary item Orb of Kil'jaeden now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Boss Gul'dan drops legendary item Skull of Gul'dan now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give boss Cenarius the legendary item Horn of Cenarius."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Preplace boss Cenarius on the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give boss Deathwing the legendary item Wings of Deathwing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Preplace boss Deathwing on the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make hero spell Town Portal a slot 3 hero spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace hero spell Town Portal for hero Medivh with hero spell Corruption."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Master and Student to the shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero standard ability Master and Student."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide Dark Portal after dying for hero spell Dark Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix buffs for hero spell Dark Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix unit sound set for summoned Dark Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom unit sound set for hero Medivh."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update custom unit sound set system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve the stats of special building Corrupted Ancient Protector."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Root to special building Corrupted Ancient Protector."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change the effect of spell Divine Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Backpack for race Blood Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit type Sorceress for race Blood Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Backpack requires shop building for all races now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not use generated object data fields anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Roman Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Goblin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Gnome."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Limit number of equipment bags over different hero levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename unit Equipment Backpack into Equipment Bag."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove item Orb of Nature effect on dropping it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Furbolg AI constructs special building now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Furbolg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace the ability of item Eye of Dalaran with Mana Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of building Event House."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Centaur."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add level changer to level Felwood."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Gnoll Alpha."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Gnoll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add level changes for singleplayer mode with initial different levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-levels/-nolevels\" to enable/disable level changes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise vote system and simplify adding new votes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Geomancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Kobold."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Quillboar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom unit sound set for bonus hero and boss Mal'Ganis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom unit sound set for bonus hero and boss Gul'dan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove hero level 6 requirement of hero spell Mass Firebolt."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not refund water units from different races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix slot 2 of hero spell Finish Construction."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Fire Attack anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Jetpack anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Teleporation anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Defend anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Split anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Druid Forms anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Hardened Skin anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Barrage anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Magic Defense anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Black Arrow anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Spiked Carapace anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Permanent Invisibility anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Damage Bonus anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Armor Bonus anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Life Regeneration anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Mana Regeneration anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Move Speed Bonus anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Equipment bags won't get hero spell Attack Speed Bonus anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Maiev stays invulnerable for Naga quest 2 since reviving neutral hostile heroes does not work."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Unpause Maiev and her guards when fighting them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ping for Draenei quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building World Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Harpy Queen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide icon of hero spell Sight Aura for slot 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide icon of hero spell Magic Resistance Aura for slot 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix restoring learned hero spell levels when randomizing hero spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply bonus and limited time to summoned units from hero spell Nerubian Army."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix prestored savecodes for The Elven Clan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow targetting invulnerable units with spell Telekinesis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ability ID for reskillable hero spell Finger of Death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove quest reward item Cloak of Flames from save code objects."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove quest reward item Ring of Protection +5 from save code objects."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove quest reward item Ring of Gloves of Haste from save code objects."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not show boss icons for hidden bosses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use quest marker on Sapphiron for Naga quest 3 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add helper JASS function DropQuestItemFromDyingUnit for dropping quest items on hero deaths."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Check for quest reward items with cheat \"-savecodeduplicates\" now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show quest messages for controlling Illidan in Naga quest 4 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Check if crystal is still alive when allowing Illidan control in Naga quest 4 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat commands \"-h1\", \"-h2\" and \"-h3\" do not work anymore if you are controlling Illidan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Save Master from creep list."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix initializing global variable udg_IllidanStormrage which fixes releasing the control of Illidan in Naga quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Save and load clan save codes from auto load file."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Berserk Wildkin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building High Elf Shipyard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Teleportation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply bonus and timed life to summoned Goblins of hero spell Master of Moria."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor triggers for game and maps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Ogre Slave model thanks to General Frank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Adjust text of resources of custom mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Ogre."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rescale model of hero Ogre Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rescale model of hero Centaur Khan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing AI chat commands to the game information in quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove carried items of Pack Horses on death when they explode."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Buy 100 Black Powder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove game information Enable HD Graphics."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingbosses\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Infernal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Burning Sky."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Spell Shield for slot 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function MoveTmpLocationToUnit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Magnataur Destroyer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically update all Crafting Stashes when food changes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Books shop into Profession Books Shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Profession Books Shop and Scepters Shop using pages."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Holy Nova."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Holy Warrior."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Unholy Warrior."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Summon Corpse."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more than one hero for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace The Burning Legion AI script with Demon AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset coloring of building Blood Elf Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix shared AI option in GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of building Blood Elf Guard Tower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of building High Elven Guard Tower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable movement of burrowed Nerubian units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide all resource multiboards in the beginning of the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix reskillable spell Mana Aura for slot 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of High Elf research Antimagic Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change lever animation on closing gates."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Magic Sentry to building Freelancer Tower and Advanced Freelancer Tower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove shop abilities from Freelancer buildings Freelancer Mercenary Camp and Freelancer Laboratory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Freelancer Laboratory produces 30 food."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Sea Giant Behemoth to trained units of building Freelancer Mercenary Camp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Dragon Lore to building Freelancer Laboratory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Eredar Warlock to building Freelancer Laboratory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Stop building Alchemist Lab conversion errors."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow building Alchemist Lab to convert into tier buildings, tier items or scepter items of races which are not unlocked by the player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix showing Library building after voting \"-tomes\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Tuskarr race to random AI races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Ogre race AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase cooldown of hero spell Sleep with every level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change the effect of Divine Shield spells to armor bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Siege Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Elevator constructed by Engineer units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add talk system for talks with NPCs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Craft profession items for all AI heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support crafting items for all 3 professions for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI heroes cannot discover or complete quests anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Effect of legendary items is kept after hero transformations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leaks for item of Tinker boss."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak for item Heart of Old God."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow boss deaths by heroes who are not owned by Bosses player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix opening gate with lever at Thunder Bluff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of boss Sea Witch."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI scripts training navy and building expansions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Goblin Shipyard from Elven Clan island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Book of Fast Travel to Goblin Laboratory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove target effect for Pack Horse abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Combiner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Galadriel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Arwen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Camel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add portal to Clan Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix target show player of item Goblin Tool Box."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise the texts and icons of item Goblin Tool Box."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Goblin Tool Box to shop Goblin Laboratory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Sauron's Forces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Heroes Tavern."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Races Tavern."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Professions Tavern."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Siege Engine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model and icon for NPC Anduin Wrynn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Anduin Lothar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Durotan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Stormwind."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically set race icons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Holy Light for slot 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Holy Nova for slot 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Orgrim Doomhammer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ogre Magi."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero spell Demolish targets also mechanical units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Initial manual navy support for Computer players with a navy start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Human Oil Tanker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Orc Oil Tanker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show gathered custom resource for workers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for unit Neutral Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix buff of hero spell Holy Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Varian Wrynn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Gronn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add area with Gronn creeps to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Wild Elekk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Roman Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce interval for Pack Horses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add skin Priest."))) // INLINED!! - - call AddVersion("3.14") - call CreateQuestItem(bj_lastCreatedQuest , (("Add Skins shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable heroes from start."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of melee Void Lords."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom model for Tome of Retraining items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral Graveyard to player selection to generate corpses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Transmute."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Illusion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon path for unit Neutral Citizen (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Tuskarr description."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Obelisk on selling an item."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Destroyer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Tank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Overpopulation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Demon Hunter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Master Locksmith."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Master Thief."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievement Survivor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-sellall\" does not sell lumber anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-sellwood\" to sell all lumber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow resource names for resource chat commands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve description of race Worgen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention required weapon type in hero spell Orb of Annihilation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Giant Skeleton."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix resource exchange calculation to avoid gaining endless resources via selling/buying."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Farmhands can harvest resource Water now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Permanent Invisibility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change names and icons of High Elf researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Artifical Day to special building Sunwell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Sunstone to race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research and ability Diurnal to race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix upgrades and abilities for units of race High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Book of Fast Travel for Freelancers only."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable ability Magical Creep Summoner for item Book of Mercenaries."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset coloring of unit High Elf Citizen (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not display Enchanter and Inscriptor info on picking up/dropping items or learning spells anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-day\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-night\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("High Elf ability Sun Key does not target allies anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Reincarnation Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom auras allow maximum number of targets and prioritizes heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom UI for race Draenei."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell Meteor knockbacks target units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Ogre."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Tauren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of Research upgrades."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Revenant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing hero hotkeys."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix coloring of boss Elune."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce cooldown of Blink for Old Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Sea Giant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing hotkey to hero spell Pulverize."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the number of crafted ward items for profession Witch Doctor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero spell Spell Steal turning off."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable endless Spell animation for hero spell Mace Strike."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable endless Death animation for ability Selfdestruct."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce cooldown for hero spell Telekinesis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Telekinesis buff should only affect the target now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of learnable hero spell Pulverize."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change order ID of hero spell Charge to avoid summoning Freelancer creeps on casting it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Fire Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Gnome."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update logo."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show current page number in unit name of backpack and no message."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add camera settings to backpack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-camrpgon/off\" to quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpcamera\" to quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function ShowAllTextTagsForPlayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide all text tags when enabling RPG camera."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow automatically loading your character in the beginning of the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the number of crafted items for profession Sorcerer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey for ability Invisibility for heroes for IJKL movement keys."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add information quest Camera."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename titles in quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Achievements reward you with the same amount of gold as XP now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model of purchasable Engineer unit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix slot of spell Mass Cripple Slot 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of spell Open Portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide dummy for spell Revive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix updating auras when removing the final aura caster."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Black Powder give the resource Black Powder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Rocks give the resource Rocks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral Rocks Mine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Random Mine to Pandaria."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Random Mine to Malfurion's start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of building Medieval Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of building Medieval Market."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of building Water Mill."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of building Church."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of building Plantation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide Replenish effect for building Medieval Well."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Nature to race Tauren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat commands \"-oldgodson/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename old god quests into Jaina quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Jaina quest 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix owner of Old God wards."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix making Legendary Artifact vulnerable on killing all three old gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow saving and loading multiple savecodes for units, buildings and researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Switch Next Page and Previous Page in shops."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS function CopyGroup."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Include worker units in save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Pandaren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom UI for race Pandaren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Miss Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add dependencies for NewBonus system option EXTENDED to support bonuses for misses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable vJass libraries AIDS, AbilityPreload and Libram."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add navy support to AI scripts for races Night Elf, Undead and Pandaren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix selection circle scale of hero Iron Fist."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix selection circle scale of hero Shado Pan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not mention Mountain Giant in tooltips of hero spell Hardened Skin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Tauren AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve unit sound sets system for custom unit sound sets."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove neutral building Zoo."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fixed bonus hero Samuro."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Garona."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change mode and icon of boss and bonus hero Gul'dan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace creeps in Gul'dan's dungeon with the new powerful creep type Gul'dan's Guard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Blight area to player selection"))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention chat command \"-r\" on hero death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent hero spell Teleportation in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent teleport spells from inside the player selection into the rest of the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Check food for unit recipes when showing the number of stocks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow rescuing Gaia units when your food limit has been reached."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add info for chat commands \"-asave\" and \"-aload\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat commands \"-asave\" and \"-aload\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove character \" from save code alphabet which might invalidate all old save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Cloud Serpent mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Potion of Omniscience cannot be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add life and mana regeneration aura to NPC Lord Nicholas Buzan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Telekinesis buff does not slow down targets."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cooldown to hero spell Fountain of Power Ward."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Spell Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Summoned hero illusions keep your hero's proper name now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove effect abilities of auras as well."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change missile of Cloud Serpent Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support navy units for race conversion and savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move loaded navy units automatically to Theramore to keep them in water."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Ring of Protection +8."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak for hero spell Revive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow hero spell Revive to target neutral units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and icon of Night Elf Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Night Elf Citizen (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom attribute Attributes Points."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Attributes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Skill."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise hero standard abilities system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Summon Mount and Invisibility abilities from hero Alchemist in morphed form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of hero standard ability Magic Sentry."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero standard ability Ensnare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero standard ability Repair."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero standard ability Blink."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero standard ability Bloodlust."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero standard ability Dark Summoning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position for ability Disarmament for Child units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon and hotkey of hero spell Spell Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use more custom models for items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Damage Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Armor Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Life Regeneration."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Mana Regeneration."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Move Speed Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Attack Speed Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix level of Disease Cloud ward ability for hero spell Summon Meat Wagon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Disease Cloud ability for hero spell Summon Meat Wagon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase cargo hold capacity for hero spell Summon Meat Wagon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Exhume Corpses of hero spell Summon Meat Wagon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add note to tooltips of recipes on how to craft the recipe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Attribute Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show resources icon and value for selected custom mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make workers return the custom resources from a mine as soon as they have reached their maximum to avoid gathering 0 resources with one hit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move page buttons to the left side."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn hotkey of hero spell Spiked Carapace."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn hotkey of hero spell Spy."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Neutral Citizens (male) attack 1 to harvest custom mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support buying workers for custom resources like Shredders."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn tooltip of hero spell Vengeance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase number of crafted Runes for profession Runeforger."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for hero spell Drunken Haze."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for hero spell Drunken Brawler."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down building Night Elf Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Store types of save codes for better detection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not duplicate Empty Chest anymore on using Lock Picks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hotkey to ability VIP Spell Book."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix removing custom auras when unskilling hero spells by using Randomize ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for hero spell Send to the Future."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for hero spell Frost Arrows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for hero spell Transmute."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip for hero spell Pickpocketing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for hero spell Dark Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for hero spell Mana Flare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip for hero spell Feral Spirit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero spell Winged Clock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero spell Summon Telescope."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-bonus\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Sight Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Magic Resistance Aura."))) // INLINED!! - - call AddVersion("3.13") - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Tuskarr Chieftain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Tuskarr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change stock maximum from 1 to 3 for Zeppelins."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Lock AI guard positions for bosses to prevent them attacking your base."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add achievements."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-achievements\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix owner of Legion Ship creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make hero spell Ensnare learnable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn tooltip of hero spell Ensnare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase duration for hero spell Ensnare with every level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Readd Scepter of Galactic Republic to the shop on Goblin Bank Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Scepter of Worgen to the shop on Goblin Bank Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Book of Taming to shop on Goblin Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Book of Inscription to shop on Goblin Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase bonus stats by 1 for all items from profession Jewelcrafter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove duplicated item Orb of Venom from VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip and description of item Orb of Magic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix adding bosses and Gaia units to respawn groups."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Priestess of the Moon on Owl."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Druid Forms."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Archdruid."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Rejuvenation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Cyclone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Rejuvenation with Mass Rejuvenation for Druid of the Claw."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Cyclone with Mass Cyclone for Druid of the Talon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Meteor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Flame Strike with Meteor for hero Flamebinder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move neutral buildings in the player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update selection scale for Dummy buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recolor Undead Dummy Pigs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Life Aura for slot 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mana Aura for slot 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix research icon position for hero spell Phoenix Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically hide icons of slot 5 hero spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Restore unit selection on hero transformations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix restoring hero skills on hero transformations for non-reskillable heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Cache unit type data per player to fix resetting unit researches after researching Evolution."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change missile model for item Orb of Moon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve the performance for Evolution by only adding the difference when possible."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("No more message for Evolution for creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase Evolution for creeps for each hero level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Goblin Tool Box."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and icon of NPC Magni Bronzebeard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Ensnare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom race UI for race Tuskarr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Crossbow Turrets."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Murloc."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Orc AI navy support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make hero Murloc Sorcerer a regular hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change movement type of hero Murloc Sorcerer to Amphibious."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change movement type of boss Murloc Sorcerer to Amphibious."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Naga and Night Elf Shipyard buildings do not sell any Night Elf Transport ship anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hotkeys to building Event House."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce training objects in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change unit sound set of hero Human Battleship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce size of selection circle of hero Human Battleship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove unit shadow from dummy caster of spell Launch Missiles."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Captain James Cook to water start location to heal water based heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Admiral Proudmoore to Theramore to heal water based heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Connect water start location with magic island/naga water base for the portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add gate to water start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Book of Mercenaries summons amphibious creeps on deep water now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce memory leaks for the effect of item Book of Mercenaries."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of item Book of Mercenaries."))) // INLINED!! - - call AddVersion("3.12") - call CreateQuestItem(bj_lastCreatedQuest , (("Function HeroCountItemsOfItemType counts item charges now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Dig Holy Grail."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove chat command \"-grail\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove chat command \"-dig\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give feedback to player on disassembling items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove recipe Craft Ring of Protection +5 since the item is a quest reward."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hiding Library when Tomes are disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Random Water mines with actual mines in the beginning of the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise requirements for new recipes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Crafting Stashes have their start delay for items every 20 seconds to prevent crafting items without the necessary requirements."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add crafted and disassembled items and units to Crafting Stashes instead of buying units to avoid confusion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give feedback if there are no items to disassemble."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update stocks for Crafting Stashes after linking/unlinking."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum stacks of item Goblin Land Mines to 100."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add game information Alchemist Labs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add game information Witch Huts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add game information Hero Abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove ground texture from many buildings for all races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix several empty page names for Crafting Stashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the number of charges for requirements when disassembling items when items in inventory are stacked."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix effect of Holy Grail."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Race Demon summons buildings without requiring a constructing worker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Altar of Hell into Altar of Twisting Nether."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change standard ability of hero Banshee Invisibility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of research Improved Clan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of research Improved Clan Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow AI to build ships on certain start locations by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for Save/Load System in quest log and Save GUI button in backpack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix loading and displaying item save codes by stopping when no more item information is stored."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show if savecode for items is generated in tooltip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-generated\" to list all generated savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise aura system to fix custom auras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Freelancers a Tiny Hideout item in the beginning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Freelancer items to the hero on repicks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin Merchant to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Critical Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Evasion Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model of Elemental Servant thanks to General Frank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model of Goblin tiers thanks to General Frank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of race Demon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Gem items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of hero Acolyte."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Stop hero before casting Harvest in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Wall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Explosive Barrel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Sapper."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Summon Guard of the Old Gods."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Disassemble to be used on units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Mana Herb can be sold to merchants now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Lynx."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Energy Field area from player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of quest Credits."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change weapon type for hero Succubus to Normal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Vrykul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add arrow buttons for hero entry in player AI GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow all worker units to harvest Favor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support item Scepter of Mastery for save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Ring of Superiority cannot be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix item Bundle of Wheat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix item Fish."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Repair to unit Neutral Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refund purchased units and items which are not of a player's race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention in tooltip that unit Neutral Citizen (male) can only be hired by Freelancers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not transfer ownership of researches anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Moonstone can be dropped by creeps now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Moonstone is sold by Worgen shops now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ability Nocturnal adds bonuses at night."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Sunstone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Blood to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Light to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Web to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Royality to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Wind to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Moonstone to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Sunstone to VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Running Wild ability for hero Deathclaw."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically add ability Devour Cargo to heroes who learn Devour."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase damage per second for Devour Cargo for hero spell Devour Cargo."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Shrink."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disallow many hero spells for Equipment Bags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Close button further down in Savecodes GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Worgen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recommend SD graphics on the loading screen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Ancestors for race Vrykul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Magic for race Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Moon for race Worgen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Banner of Gilneas for race Worgen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Cages for race Worgen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable debugging output for spell Rewind Time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise unit Battle Mage of race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Dices."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Genn Greymane."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race unit type for Flying Machine units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race building type for secondary special building buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Orb of Annihilation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom unit sound set for unit Swordsman."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom unit sound set for unit Swordsman (High Elf)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom unit sound set for unit Captain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom unit sound set for unit Captain (High Elf)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom unit sound set for unit Cenarius (Bonus Hero)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom unit sound set for unit Cenarius (Boss)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom unit sound set for unit Funny Bunny."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Arakkoa."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Shadow Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Sun Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add pickable hero Cenarius (Boss)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Kil'jaeden."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise spells of hero Sand Worm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Pulverize."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Wisp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update unit group respawn system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Absorb."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make hero Fel Beast a non-bonus hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-soundsets\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nosoundsets\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Obsidian Statue."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mass Firebolt."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Replenish."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more Fountains of Power to the player selection and move them."))) // INLINED!! - - call AddVersion("3.11") - call CreateQuestItem(bj_lastCreatedQuest , (("Improve website data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add arrow buttons for race in AI players GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Previous Page button to AI players GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase default food maximum for AI to 600."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace spell Attribute Bonus for boss Ragnaros with Permanet Immolation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Nerubian AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix creating the AI hero of the correct race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase gold exchange rate for resource Favor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Orb of Blood effect to tooltip of item Orb of Orbs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Ride Down for slot 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not pick bonus heroes for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Enchanted Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Frostguard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Searing Blade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Flare Gun can be dropped by creeps now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Bosses Archimonde and Avatar of Sargeras carry the item Orb of Orbs now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow HD and SD by default again."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add votes \"-legion\" and \"-nolegion\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move gate and bridge at Sunstrider Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hydromancer is no bonus hero anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add many missing bonus hero requirements."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Inscriptor Glyph items improve certain hero spells now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Inscriptor chat commands work."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Medieval Catapult icon does not overwrite Draenei Demolisher icon anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spend all unused skill points for boss heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register Worgen tier 1-3 and altar in gameplay constants."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically remove Random Mines around AI start locations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Cheat \"-share\" shares full control with all AI players now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Vrykul building Val'kyr Temple."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Vrykul unit Dark Val'kyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Vrykul unit Golden Val'kyr."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Vrykul race AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more races for random race entries in AI players GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("More AIs will build special buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI tier counting."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Troll research requirements."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll ability Sacrifice to building Temple of Sacrifice."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove ability Pillage from unit Troll Gatherer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Troll Berserkers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix soundset of Troll Voodoo Cannoneers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Troll tooltips, icon positions and hotkeys."))) // INLINED!! - - call AddVersion("3.10") - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing credits."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add link to quest for reward items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell Mass Web does not target dead units anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Nerubian."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Translate building Azjol Nerubian Obelisk back into English."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of Pandaren quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add levers for gates only where no bridges exist."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support Orb of Blood in savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of item Demon Slayer Axe."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of research Improved Creep Hunter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-sellall\" does not trigger chat command \"-sell\" anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update system CustomConsoleUI so HP and mana values are shown with custom race UIs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hero ability mana costs with every level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix animation of summoned Minigun Tower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce charges of item Honeycomb."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Shadow Orb Fragment can be dropped by creeps and carried around by heroes now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipes Craft Shadow Orb +X."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of Formula items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more items for save codes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mine Monument."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove requirement of Evolution Stone icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Moving Boxes for buildings Slaughterhouse and Sacrifical Pit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix pick mode for chat commands \"-h2\", \"-h3\", \"-p1\" and \"-p2\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change owner of mines to harvesting player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show resources of mines in tooltip of icon ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Acolyte."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix starting correct race repick timers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession 3 and race 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add checks for profession and race selection modes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update backpack UI on dropping all and picking up items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of building Gnome Factory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dependencies of Gnome units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Random Mine to West Northrend start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add background, gold and item icon frames to the backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Disassemble ability to building Crafting Stash."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Horn of the Clouds can be dropped now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Shield of Honor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix allowing crafting items with only one of the requirements."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add info about Orb of Web to item Orb of Orbs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide dummy of item Orb of Royality."))) // INLINED!! - - call AddVersion("3.9") - call CreateQuestItem(bj_lastCreatedQuest , (("Improve website data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix name Muradin in the third Human quest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Formula items crafted from Enchanter won't be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make workers stop harvesting a mine if the mine is empty for them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do workers not let harvest a mine but show an error message if the mine is empty for them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Let mines of custom resources explode on death by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Ring of the Archmagi cannot be dropped by creeps anymore since it is a quest reward item."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not let expired votes vote for the first choice by default which prevents votes being successful although not the majority of players has voted for it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Convert Item to building Alchemist Lab."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change message for chat command \"-savec\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add short chat command \"-s\" for chat command \"-savec\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add short chat command \"-l\" for chat command \"-l\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more researches to Blacksmith for race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change tooltip of race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not generate savecode text files for empty items, units, buildings and researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove debugging text output when choosing the AI heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add all credits to the quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of building Spell Book."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give ability Selfdestruct the animation Death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Food Farm building with Wheat Field."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update all wall pieces around when one piece is destroyed."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Count more housing types in AI scripts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve ship support for AI scripts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Drop the item for Pandaren Quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Star Wars and Lord of the Rings housing limits."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix costs and building and repair times of all tier building for race Naga."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Decay."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Wand of Decay."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dependency of Tauren Watch Tower building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add limit to Tauren Watch Tower buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add theme and bonus hero requirements to hero Jar Jar Binks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make item Dragon Heart for Human quest 1 invulnerable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move gold mines produced by Random Mines to the old position."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mana Shield for slot 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Finish Construction."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Repair Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Rainbow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Rainbow Bridge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Tychus Findlay."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys of hero spell Grenade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Naaru."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Undead Dummy Pig to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use tool wc3objectdataextractor for registered hero abilities instead of registering them manually."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix requirements maximum for recipe Craft Orb of Orbs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell Drain Resources should work with trees now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell Drain Resources heals and regenerates life and mana of the caster now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-rename\" works on units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model scaling, selection scaling and soundset of building Power Crystal Mine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add tiny items for Freelancer buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename building Freelancer Goblin Laboratory into Freelancer Laboratory,"))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove cooldown for item savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Each savecode can be loaded only once per game to prevent mass loading."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Anvil."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase cooldown of spells Torpedoes, Place Water Mine and Drop Water Bomb."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change mount of hero Gnomish Submarine to Flying Machine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing submerged version of hero Gnomish Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Nerubian."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Web."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Spider Egg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Mass Web."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Summon Spider Egg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Nerubian Queen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Flying Dummy Sheep to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Amphibious Dummy Sheep to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Undead units have regeneration type Only while on Blight now instead Only during night."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add tunnel system for race Nerubian."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Mozart music with Storm, Earth, Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give special building Lich King a pathing texture."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix pathing check for item Water."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Create Ubersplat for item Water."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Inscriptor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Random Mines during the start of the map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Place Goblin Land Mine."))) // INLINED!! - - call AddVersion("3.8") - call CreateQuestItem(bj_lastCreatedQuest , (("Add more website data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Torpedoes research from race Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix resources description."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Radio Tower to race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Guard Tower to race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Airbase buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Farmhand trained Farms from profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Wheat Field for profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Tiny Wheat Field for profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Bundle of Wheat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of item Fish."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Cow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Farm trains units Cow and Pig now for profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Worgen AI male citizen ID."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Vrykul AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add initial Ancient Greece AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change race of hero Archmage from Human to Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename aviation building for all Star Wars races into Spaceport."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model, icon and tooltip for Spaceport buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and tooltip for Vehicle Factory buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add researches Blasters and Iron Plating to race Galactic Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon for resource food in the multiboard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change ownership of Dummy Pigs back to Neutral Hostile when Charm is being used on them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add special building Scarlet Monastery for race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-fields\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Switch Hero Journey second race with bonus races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Wand of Drain Resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Galactic Empire AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down Vespene Geysers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make all trees selectable ingame."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix function GetExchangedResource of custom resources system and hence fix selling resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix text of chat command \"-resinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpresources\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix sending trained workers harvesting the mines targeted by rally points."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Liber Ignium."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of start location New Stormwind."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sell Orb of Light in building Trade House of race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Mass Holy Light of Lordaeron race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Scarlet Crusade to race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix researches Spearmen and Crossbowmen of race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dependencies and citizens of race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon and model of Footman unit for race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Rifleman to race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Battle Mage to race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Holy Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Spy."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Power Crystal Mine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Place many more Random Mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve and fix crafted buildings for profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS functions SetMineExplodesOnDeath and GetMineExplodesOnDeath to Resources system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix description of resource Food."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Lordaeron tower buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Berghof allows casting V-2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Train Station building to race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale up the model of unit Red Baron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix requirement of ability Ensnare of race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Prison Builder to race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix attack area of unit Wespe of race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change ability of SS Officer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Zeppelin unit the ability Crew."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of research Autobahn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix displayed info of resource savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix building Gnome Brassman."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix shown info of resources savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model height of Repair Aura buff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix JASS functions AddPlayerResource and RemovePlayerResource of Resources system for standard resources like gold and lumber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Trading Posts allow selling and buying new custom resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of \"Deposit 10 000 Lumber\" in Goblin Bank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Adapt costs of Bundle of Lumber and Exchange item in Goblin Merchant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add researches for race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Alliance Siege Tower to race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Fish Market."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Master of Moria for hero Balrog."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Lordaeron Banner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-stats/-nostats\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Moving Boxes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove chat command \"-wrapup\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register tiny castle race items as tier 1 items for converting buildings into items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral buildings to the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix soundset of Tauren Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Tamer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero Spirit Walker has range attack now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix mapping race unit types into items to fix wrapping buildings up."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only wrap up completely constructed buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add resulting wrapped up items to the caster's inventory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Group wrapped up items by type."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Treasure Map won't be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Compass won't be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Navigation Wheel won't be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Tiny Pirate Ship won't be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learn hotkey to hero spell Ethereal Form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more tiny items for wrapping up buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Stop constructing tiny buildings when the limit has already been reached."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give neutral building Hero Abilities a different icon and model."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Nerubian."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing scepters to scepters shops."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Vrykul altar building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show the number of item charges in the tooltip of the backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Peon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate item savecodes for all heroes, the backpack and all equipment bags to allow saving more items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Exclude researches Improved Clan and Improved Clan Hall from research savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Safe for Engineers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Door for Engineers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum hit points and defense of Couatl Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of race Free People of Middle Earth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise multiple profession tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Witch Hut for all races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Alchemist Lab to Dalaran and Undead Citizens (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace hero abilities for boss Kil'jaeden to make him stronger: Doom, Scream and Finger of Death instead of Banish, Immolation and Demon Storm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Human Fire Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Pandaren quest 3 reward item with Scepter of the Mur'gul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pandaren quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make enemy creeps vulnerable for Pandaren quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Alchemist Lab can convert items now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Child units have the ability Enable Wandering now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Lordaeron AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Terran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not enable custom race UI by default anymore since some are broken."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Void Lord Commander heroes with Void Lord Melee heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Void Lord heroes into Void Lord Range heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Hero Abilities for all races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add icon ability Life Regeneration to male citizens."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add passive Health and Mana Stone icons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkeys of learnable hero standard abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add small new creep area to Outland next to the Orc camp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename research Unholy Armor from Demon race into Fel Armor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of research Fel Armor for race Demon."))) // INLINED!! - - call AddVersion("3.7") - call CreateQuestItem(bj_lastCreatedQuest , (("Custom icon for research Astrology."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Ancient Greece research Bronze Swords."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Ancient Greece research Bronze Armor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Ancient Greece research Ranged Weapons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only allow Priests to harvest favor from temples."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove some custom resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Silver Bars."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat command \"-resinfo\" for mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change race of hero Emperor Palpatine to Galactic Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the number of rows of the resources multiboard GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of resource Iron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Random Water Mine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Water Oil Platform."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove mana from submerged Gnomish Submarine unit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Flotsams do not drop items on being killed anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Flotsams have selection circles on water now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten resource info for mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Save resources in a savecode when using chat command \"-save\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-loadres\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-savecodes\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vote \"-nosavecodes\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero Succubus has melee attack now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero Succubus has HP regeneration during day as well now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero Doom Guard has HP regeneration during day as well now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-maxresources\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon extension of Naga Housing from .tga to .blp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change clan savecode file prefix to \"WoWR\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Passive mode prevents taking and causing damage expect from your own units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("StartAllUnitRespawnsNotRunning does not start duplicated respawns for creep buildings anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Flotsams do only drop custom resources now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Flotsams do never give you 0 resources when giving you any."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Added Flotsam tooltip for the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase stock maximum of Shredder unit to 3 from 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce stock replenish interval of Shredder unit to 180 from 210."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix keys of UnitTypeUtils which should fix the Evolution effect."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Fire Pit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Spell DrainResources works with custom resources now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the costs for all special buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add German citizens, housings and Berghof special building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Leibstandarte unit to race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve AI script of race Germans WWII."))) // INLINED!! - - call AddVersion("3.6") - call CreateQuestItem(bj_lastCreatedQuest , (("Reorder races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve generated data for the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Gnomish Engineer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Mechanostrider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Flying Machine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Troll tier 1-3 buildings custom icons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Troll Barracks building a custom icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Troll Barracks building a custom model."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing Troll researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing Troll abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of building Trading Post."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system ObjectDataFields which allows storing additional object data fields required for the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Aqir."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Mechanical Repair."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of start location Khaz Modan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Blood Elf Castle requires Altar of Magic now instead of Altar of Kings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Blood Elf Altar of Magic into Altar of Mana because of a name conflict with the Dalaran altar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename High Elven Guard Tower into Blood Elf Guard Tower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icons and buildings made by SinisterX for the Blood Elf race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use a custom model for Blood Elf Ballista."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research and ability Siphon Mana to Blood Elf race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Blood Elf workers mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Blood Elf Phoenix mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve the description of the Blood Elf race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Dragonhawk Rider from Blood Elf race are affected by the correct Cloud research now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use a custom model for Blood Elf Archer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Blood Elf Decimator."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more buildings available for all races for savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Blood Elf unit Archer into Blood Elf Archer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon positons and hotkeys for Blood Elf units and researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of Blood Elf researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Blood Elf researches affect siege units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for unit Blood Elf Citizen (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Child to different races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show message to player how to disable custom race UIs which are enabled by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix laser missile model for AAT."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix laser missile model for Death Star."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix light saber texture path for Twilek Jedi model."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aireset\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix index of hero Gandalf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mounts Cage for all races is not invulnerable anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of item Tiny High Elf Town Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of ability Torpedoes for Naboo Star Fighters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("All Submarine units are affected by Evolution and Improved Navy now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("udg_MaxRaces starts with 1 to consider udg_RaceNone and fix generating races for the website."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace ability Evasion for White Tiger Mount with Critical Strike."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Inventions to Gnome race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Backpack to Gnome race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Gear for to Gnome race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Initial Gnome AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give bonus hero Murloc Sorcerer hero glow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero revival tooltip for bonus hero Murloc Sorcerer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give bonus hero Murloc Sorcerer Couatl mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove requirements for hero Master of Time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change soundset for hero Balrog to DoomGuard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give hero Balrog the spell Command Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce cooldown for Flying Form spell of hero Balrog."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give bonus hero Rexxar the correct Storm Bolt spell for slot 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of bonus hero Rexxar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give bonus hero Illidan the Berserk spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give bonus hero Illidan a mount spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give spell Metamorphosis for bonus hero Illidan 15 levels."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix soundset for bonus hero Banshee."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add digits to foot switches in the Gul'dan dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix abilities of building Demon Shipyard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Throw Light Saber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Light Saber Combat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change item Tiny Temple of Tides into Tiny Temple of Water."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Sand Worm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise quest log with game information."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Try to fix AI GUI configuring Warlords when no Freelancer option has been chosen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Orb of Corruption gets a custom model."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow chat command \"-suicide\" in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve tooltip of spell Egg Multiplier."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Egg Multiplier."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Egg Endurance Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for hero Legolas."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add a small creep area to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Alchemist Lab to all races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Water."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Dragon Roost requires any Tier 3 hall now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Gnome unit Mortar Team."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Gnome unit Hover Copter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Gnome unit Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Gnome building Workshop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Nazgûl."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Warlock (Gnome)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Ring of Protection +5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Inferno Stone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Craft Ice Shards."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of ability Link Crafting Stash."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Ice."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell The Last Supper."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of building Antimagic Ward."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Stupidity."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Peasant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Farmer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add NPC Carsten."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Mass Bloodlust."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ogre Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Centaur Khan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Dalaran building Arcane Sanctum."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Dalaran building Arcane Blacksmith."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Buildings Temple of Light and Temple of Darkness are tier 4 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename building Neutral Mercenary Camp into Freelancer Mercenary Camp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename building Neutral Goblin Laboratory into Freelancer Goblin Laboratory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename building Neutral Shop into Freelancer Shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise building Mercenary Camp of Middle Earth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix closing the East Undercity gate with the corresponding lever."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give boss Antonidas the hero spells Mass Slow, Mass Polymorph and Mirror Image."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix order ID of spell Mass Polymorph."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Mass Finger of Death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Galactic Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename TIE Fighter Mount into TIE Interceptor Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Jar Jar Binks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Pickpocketing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Ancient Greece."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce selection scale of building Lever."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Drain Resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make coloring of Air Wall buildings darker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Archimedes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of unit Dwarf Miner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Translate legendary item rect names into English."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent Harvest spell in player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon and tooltip of research Berserker Upgrade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of the ability Berserk for Troll Slayers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Troll Slayers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of Siege Tower units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon and model of unit Roman Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Reincarnation for Bayonet Charge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ultimate spell Spell Immunity requires level 6 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model of Roman Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model icon for building Marketplace for race Roman Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Pegasus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Leonidas I."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add warning to Goblin War Zeppelin's tooltip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-read\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Multiply."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Keep hero attributes and hero attributes per level on transforming your hero with items like Angel Wings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Undead Horse."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn tooltip of spell Rain of Chaos (Destroyer)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change tooltip of race Worgen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix and improve tooltip of research Improved Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of research Improved Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of item and spell Pickpocketing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention the limit of 4 in Housing tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system WoWReforgedObjectDataFields based on the output of the tool wc3objectdataextractor to get object data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system Resources and initial custom resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move PvP wins to the bottom of player info."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Random Mine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Unsummon Building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Flotsam."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Random Resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Spike."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add recipe Spiked Collar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Spiked Trap."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Archery Target."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Beehive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Bee."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Net."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Honeycomb."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Fish School."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Fish."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Night Elf Fishing Boat."))) // INLINED!! - - call AddVersion("3.5") - call CreateQuestItem(bj_lastCreatedQuest , (("Add Demon research Space Travel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys of Void Lord Commander heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix changing spell pages for Void Lord Commander heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add special hero standard ability for Void Lord Commander heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn hotkey of hero spell Replenish Mana and Life."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Demon Dark Conversion much faster."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable Sleeps flag for mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep Legion Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Feedback Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-damageon/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for item Firework."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey for item Lock Pick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Initial Worgen AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename race Trolls into Troll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of Troll unit Bat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Troll unit Bat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Troll unit Batrider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Troll Gatherer constructs Troll Spirit Lodge now instead of the Orc one."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix model and missile model of Troll unit Manhunter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of Troll unit Manhunter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix training tooltip of Troll unit Forest Troll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Limit Troll Housings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Limit Tauren Housings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Bat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shadow Hunter and Rokhan use mount Bat now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll unit Darkspear Troll Rider."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll building Ice Troll Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll unit Zandalari Throne of War."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll unit Troll Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll research Troll Tribes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Troll unit Forest Troll Warlord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down model of building Altar of Blood."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll research and ability Berserk."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Troll research and ability Troll Regeneration."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Berserk ability of Orc Headhunters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("More items use custom models. now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Blood sold by Trolls shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Light."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Initial Troll AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shadow Hunter is a Troll hero now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the number of player entries in the Computer Players GUI to allow seeing the whole combo box."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Stasis Trap."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Witch Doctor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spells Mass Mana Burn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove leak for Mass spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Place dummies for Mass spells at the casters position."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise maximum damage values of many hero spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give creep Centaur Khan anti air attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Goblin Sorceress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Arcane Sanctum for race Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Summon Doom Guard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace spell Unholy Frenzy with Summon Doom Guard for hero Warlock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of hero spell Horn of Gondor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Eagle mount from Lord of the Rings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Human Battleship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show unit movement type for cheat \"-unitinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hero spell Cripple Player enables bounty for enemy players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix moving floating revived heroes into the sea."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove gold costs from hero standard abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Races Troll, Tauren and Pandaren are no bonus races anymore."))) // INLINED!! - - call AddVersion("3.4") - call CreateQuestItem(bj_lastCreatedQuest , (("Add Modern Warfare AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI builds housings and lumber mills before other stuff to get more resources in the beginning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpai\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpally\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aiexpansions\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for Modern Warfare workers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add column Expansions to AI Player Settings GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Preselect \"Random Warlord\" as standard race in the AI Player Settings GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add IdleWorkersSystem and hide idle workers button of custom UIs if there are no idle workers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Master of Time with custom spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Turnstile."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Hourglass."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Wand of Future."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Winged Clock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Wand of Time Clone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aiinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aitargeton/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aitarget\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Sauron's Forces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Samwise Gamgee."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Peregrin Took."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Meriadoc Brandybuck."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Check if game mode, hero, race and profession have been picked before accepting the player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use system New Bonus by chopinski for custom spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the mana costs for the hero ability Control Magic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add a cooldown per slot for learnable hero spells which is not checked in the hero selection to prevent mass castings of spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove hero standard ability Resistant Skin which made no sense for heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename tavern \"Bonus Heroes Reskill\" into \"Bonus Heroes Void Lords\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add heroes Void Lord Commander X."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Dwarf AI builds towers now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplified Dwarf AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin AI builds Rocket Towers now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove effects from ability Force Jump."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix target players for AI chat commands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix attached Light Saber models for Sith units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix sound effects of summoning Star Wars mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix initial spell pages for the towers in the player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Sauron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Record Player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Roman Empire AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Ballista to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ships to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Real Estate Agent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Roman Shipyard to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Chariot to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model for Roman Workshop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Marketplace to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Siege Tower to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Roman Military Engineer to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Roman Tents can train Roman Legionaries."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix dependencies of Guard Towers of Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Palisade Gate to Roman Empire race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon for Roman Race in stats multiboard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Telekinesis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Full Regeneration."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable spell Demolish."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable spell Disease Cloud."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable spell Monsoon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable spell Summon Mercenary Camp."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable spell Vengeance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Cripple Player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Camera."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix chat commands \"-clanwgold\" and \"-clanwlumber\" and use SimError for error messages."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Queen of the new Citadel has life and mana regeneration aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix XP rate shown in player info."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase boss hero respawn time to 10 minutes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Lock boss hero AI guard positions to prevent bosses from attacking player bases."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Try to fix speed bonus of research Improved Navy."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase auto save interval from 5 minutes to 15 minutes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease the cooldown of ability Spell further per level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable spell Town Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable spell Find Artifacts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Blood Elf building Altar of Magic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Blood Elf building Elven Farm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pandaren AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve the performance of CopyGroup."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Select Turrets ability does not interrupt the vehicle's actions anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Select Turrets ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve turret system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix stats of bonus hero Maiev."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing minimap ping for Demon Quest 1 when meeting the Commander."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pandaren quest 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingoldgods\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add all quest ping chat commands to the help text and quest log."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve spell Slide."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use alternate form for hero Shado Pan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move portal to Pandaria to the Outland portal room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down neutral Waygates."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Jesus Christ."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Flamethrower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Flamethrower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix spell Escape Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease minimum movement speed for units to 0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increases maximum movement speed for units to 1024."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Goblin Vehicle Shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Taxi with Taxi missions inspired by GTA."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing scepters to Bonus Scepters shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix effect of vote \"-notomes\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Gnomish Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Goblin Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Ironclad Submarine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Submarine Pilot."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start location Water Base."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace building Goblin Hut with Goblin Sheep Processor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Droid Control Ship revives dead heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add CIS AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease duration of spell Slide."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Burning Oil."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Flamethrower Turret."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Flame Shredder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add level effects to many spell tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell slot to tooltips of learnable spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell tooltips to learnable spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Dark Ritual."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Summon Meat Wagon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Summon Bladestorm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Summon Cripple."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the maximum creep level for hero spell Control Magic up to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the maximum creep level for hero spell Devour up to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the maximum creep level for hero spell Charm up to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the maximum creep level for hero spell Transmute up to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the maximum creep level for hero spell Doom up to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add level to learn tooltip of hero spell Dark Summoning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix casting duration per level for hero spell Dark Summoning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add a maximum creep level to the hero ability The Ring of Power."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Death And Decay."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Locust Swarm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Carrion Beetles."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Kaboom!."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Crushing Wave."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Heal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Advanced Goblin Night Scope."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pandaren quest 2 with reward item Advanced Goblin Night Scope."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Frost Bolt."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Naga Royal Guard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Couatl."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss War Queen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add legendary item Ancient Bow."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix stopping Scroll of Town Portal and other teleport spells to units leading to endless casting."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Cargo Hold of mounts after level 15."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not sell AI citizens in Thieves Guilds."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix memory leak on adding units to Thieves Guilds."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve the performance of retrieving race information about object IDs by using two hashtables."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the duration of Impale."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Galactic Republic AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase area of effect for Flame Strike."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix making boss heroes available at hero level 50."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase slowdown by ability Frost Arrows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revive 1 more unit per level for Resurrection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of spell Anti-magic Shell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Scream of Terror to hero Banshee."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase percentage by Thorns Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase percentage by Evasion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce percentage by Vampiric Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change chances of Drunken Brawler."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys for spell Howl of Terror."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys for spell Incinerate."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Incinerate."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys for spell Soul Burn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spells to tooltip of Gul'dan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys for spell Council of Six."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys for spell Time Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn tooltip for spell Time Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys for spell Raven Form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learn tooltip for spell Raven Form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix help text for chat command \"-raceui\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Tyrannosaurus Rex."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent Dark Summoning from player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Saruman."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Sauron's Forces AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Horn of Gondor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add craftable item Iron Bars."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add CIS research Blasters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add CIS research Iron Plating."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Jedi Starfighter mount into Jedi Interceptor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Jedi Starfighter to Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Jedi Interceptor to Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Jedi Interceptor to Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Jedi Adept Training to Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move neutral buildings in start location Outland Black Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give neutral building Waygate pathing texture to avoid AI crashes in Outland Black Citadel."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use SimError on changing the hero selection mode."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use GetHighestHeroLevel to determine the hero selection mode."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give hero Boromir the spell Defend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable hero spell Defend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Male Citizens of Galactic Repbulic missing abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS functions GetHeroXP1, GetHeroXP2 and GetHeroXP3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Limit special building Coruscant to 1 and remove Take Off ability and fix scaling."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add altar building to Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add altar building to CIS."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add female citizens to races Kul Tiras, Sauron's Forces, CIS, Galactic Republic and Tauren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add housings to races CIS and Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function IsCitizen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace text \"not your race\" with green and red text color for save code infos."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reimplement caching for unit type data like levels, defense etc."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Weaken Siege Golem summoned by Dwarf Mage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the cooldown of spell Mithrandir to 0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Elven Cloak."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Jetpack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon to spell Jetpack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Create stats multiboard after voting for all settings to make sure to remove special players if necessary."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove The Alliance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fixed the Evolution bug which did not apply changes immediately."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename The Alliance island to Magic Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creeps to Magic Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Summon Dinosaur Nest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow deactivating multiple abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Mass Devour."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hotkey to item Lock Pick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Sith units of race CIS red light sabers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Shield to race CIS."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Battle Formation to race CIS."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Backpack to race CIS."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Enable Wandering to male citizens of race CIS."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Techno Union Ship attacks units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scaled down building Techno Union Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down MTT unit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Paul Bäumer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Zeppelin WWI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Germans WWII."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move professions and races prestored icons triggers to their folders."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero German Kaiser."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Unlimited Tree."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Vrykul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Dragon Roost for all races has a team color now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add start game area to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and icon of Altar of Magic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove highlighted hotkeys from profession abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove wrong item requirements from profession ability tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Create race start items on repicking races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Polar Bear."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Thane."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Rain of Arrows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Worgen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more possible item abilities to item Random Artifact."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Life Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Running Wild."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Worgen Death Knight."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Deathclaw."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mount and spell shops use PagedButtonsSystem now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Bonus Mounts shop building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change models of neutral buildings which sell hero spells, hero abilities and mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention Credits in quest log on loading screen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Crafting Stash."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Bear."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-bossicons\" and \"-nobossicons\" to enable/disable boss icons on the minimap."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Heroes Kael and Anasterian Sunstrider have a Dragonhawk mount by default now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-aishared\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-ainotshared\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add column \"Shared Control\" in AI settings GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pandaren quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Herald of the Deep Mother."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add passive icon for Aura of Darkness."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce cooldown of Dark Conversion with every level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove special effects from Freelancer Summon Mercenaries spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply summon unit bonus for converted Zombies by Dark Conversion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Limit time of summoned Zombies and villagers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing Attribute Bonus, Invisibility and Summon Frost Wyrm Mount abilities to hero Mal'Ganis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shroud of Protection cast by Hideouts should work now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use SimError for Hideout messages."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove message on constructing and losing a hideout."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix duplicated hotkeys in Player Interactions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of ability Give Units to Another Allied Player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Dark Conversion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Firework."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Flare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Fragmentation Shards."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Summon Telescope."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Split."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Mortar Team."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of Storm, Earth, Fire spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add default race entry \"Random Warcraft\" to AI player settings GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Include Scroll of Healing into randomly dropped items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Include Scroll of Mana into randomly dropped items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom models for several item types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model for Dwarf Citizens (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Balrog."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Pit Lord hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Doom Guard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add dummies to player selection area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make summoned units in player selection area invulnerable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpvisual\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-teamcolor X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention advanced chat commands at hero level 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise player selection validation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show messages on dropping race and profession items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Cloud Serpent mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Pandaren heroes the Cloud Serpent mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce shadow of Pandaria Tree Wall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Alchemist Lab."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Flame Whip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Flame Storm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of spell Poison Arrows."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Inquisitor a custom icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reserach Soul Theft to Demon race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Inquisitor ability Soul Theft."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Inquisitor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Massively increase cooldown of Dark Conversion for Demon race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Darl Conversion for Demon race costs mana now and Sacrifical Pits have mana and mana regeneration."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Demon Gate."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Sacrificial Pit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Dalaran research from Kul Tiras AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change order for sending AI Dalaran workers to Housings and the Gold Mine to Harvest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Demon race icon to Gan'arg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of Demon Sacrificial Pit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Demon unit Overlord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention ability True Sight in tooltip of Demon Greater Voidwalker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix coloring of Demon Jailer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Floating Eye and Eye of Sargeras a custom icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-website\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify adding new heroes for AI and random selection with JASS function AddHeroWoWReforged."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Translate hero name of Magni Bronzebeard back into English."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Translate hero name of Anduin Wrynn back into English."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for Divine armor type."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command -qr/questrewards."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon for Night Elf quest 3 from passive to normal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon for item Royal Paladin Hammer from passive to normal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon path of mount Wyvern Mount back to BLP."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ulti spell Spell Immunity."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vJass library FileUtils."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add vJass library QuestUtils."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix items from VIP room being moved to Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("JASS function StringTokenEx supports a separator longer than 1 character now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Spell Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Enchanter crafting tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Wander ability from CIS Citizen (male)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove duplicated Healing Wards item from save code objects."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sylvanas Windrunner boss causes Chaos damage now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sylvanas Windrunner boss has Holy Light instead of Scout now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sylvanas Windrunner boss has True Sight now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sylvanas Windrunner boss has no Invisibility anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sylvanas Windrunner boss has no Sumon Dragonhawk Mount anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ragnaros boss has True Sight now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify adding legendary items with new JASS function AddLegendaryItem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Discharge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Revive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Spirit Walker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename old spell Revive to Revive Heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix condition for spell Revive Heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Dwarf Mine Shafts giving 0 gold when being constructed in upgraded version."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing purchase tooltip to item Unlimited Bag of Gold."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing gold cost for item Winged Clock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more effects to item Dwarven Celestial Orb of Souls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the number of revived units by item Dwarven Celestial Orb of Souls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce gold cost of item Dwarven Celestial Orb of Souls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix level of item Dwarven Celestial Orb of Souls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race unit category for Spellbreakers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Clockwork Penguin to be dropped."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change ulti of Dwarf Mage from Mass Teleport into Transmute."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten save code file names with \"WoWR-\" prefix."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Elite Rifleman."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon to Dwarf research Mithril Armor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase damage of Dwarf unit Steam Fortress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Bayonet Charge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Dwarf unit Steam Fortress can transport units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix level requirement for spell Mass Devour."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Spirit Link."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Mass Cripple."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove leaking dummies for mass spells."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkey of spell Doom."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Mass Faerie Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Faerie Fire for heroes Furbolg Ursa Warrior, Druid of the Claw and Druid of the Talon with Mass Faerie Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Phoenix Fire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add banner to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral units to save objects."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add many items to save objects."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Thieves Guild to Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make all quest reward items invulnerable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move all floating revived heroes automatically back into water on Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the game mode shown in the floating text during the player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow item Black Powder to be sold to merchants."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow item Rocks to be sold to merchants."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix a bug which reset the Freelancer and Warlord researches when a hero gains a level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Wander with Enabled Wander for Save Master units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix a bug which disabled hero transformation when dropping a legendary item with the new hero transformation system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Set the maximum number of illusions for spell Mirror Image to 9 to avoid the hero disappearing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the percentage of dealt damage with every level of spell Mirror Image."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Deathwing's AOE damage should only damage neutral and enemy units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change damage type of Tinker boss from Hero to Chaos."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Categorize bosses as campaign heroes to show the proper hero name."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable cooldown for buying spells because it is annoying for Equipment Bags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not remove backpacks on using \"-repick\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove model of building Statue of Azshara after death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise tooltip of Thieves Guild."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Try to fix Thieves Guild selling."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ability ID for learnable spell Storm Bolt."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Summon Vicaresses of Elune."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learnable spell Replenish Mana and Life."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of building Blue Dragon Nexus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for ability Ride Down."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down building Techno Union Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove ground texture from building Techno Union Ship."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down building Guard Tower of Roman Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Dummy constructed by Engineer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace custom Dwarf UI with standard Human UI since it is broken."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Target Divine Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys of Goblin heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support restoring hero skills when transforming back from a reskillable hero into the original form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Unskill hero completely before restoring skills to make sure all skill points are back."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Set landing delay time to 1 second for all higher levels than level 1 for hero spell Crow Form to fix removing bonus when landing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not require a hero level or VIP or unlocked stuff for reskilling heroes but only the hero type except for equipment bags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral citizens and pet to be trained by Hideout buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Thieves Guilds sell enemy units who changed their owner for example by Charm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Dummy Pig to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of Fortified Hideout."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of Neutral Citizen (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Consume requirements for recipes which summon units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Check food limit on summoned units from recipes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add callback support for summoned units from recipes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Crafting Stashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Non-charged items crafted by recipes are created separately instead of charged."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hotkey to Dwarf War Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change training tooltip of Dwarf War Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix gold set to 0 when Dwarf mines are being destroyed or upgraded or research or cast."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Play sleep animation when Dwarf War Golem casts Sleep Form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hotkey to item Stone Token."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hotkey to race shops item Magical Seed."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Breed ability to breeding Dwarf Gryphons to summon Gryphon chicks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix unavailability of Diamong Mine Shafts for research Ore Mine Shaft."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Pandaren Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Backpack for Pandaren race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Improved Bows for Pandaren race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add many new IDs to the Pandaren AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability and research Drunk Panda to Pandaren race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Shaman to Pandaren race."))) // INLINED!! - - call AddVersion("3.3") - call CreateQuestItem(bj_lastCreatedQuest , (("Staff of Silence is not included into random choice for dropped items anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Open Gate."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow enabling/disable AI attacking for enemy players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ring of Superiority should not be dropped by creeps anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Feral Spirit to slot 3 and fix its hotkey."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learning Summon Bear."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix learning Pocket Factory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Killing summoned AI units won't lead to multiple \"Defeat AI\" messages anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Removed a memory leak when checking for AI defeat."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Let Dalaran AI enable Dalaran Shield whenever possible."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Configure unit types for all races, so they won't get removed on repicking the race: Trading Post, Antimagic Ward, Pack Horse, Ground Wall, Air Wall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Free People of Middle Earth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset music if no matching race music is found when using chat command \"-raceui\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Scepter of the Sea Giant transforms your hero into a Sea Giant now since changing the movement type did not work."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Items Scepter of the Sea Giant and Angel Wings work on every hero now no matter its movement type."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Configure initial game mode in the player selection to Warlord for every player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recreate backpack and equipment bags on picking up Angel Wings and Scepter of the Sea to fix hero icon positions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only list UIs for \"-raceui\" which are supported."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show usage for \"-gold\" and \"-lumber\" chat commands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system WoWReforgedHeroTransformation for item based hero transformations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add systems to allow reskilling heroes: WoWReforgedLearnableSkills, WoWReforgedHeroSkills and WoWReforgedLearnableSkillsShop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ulti of bonus hero Kel'Thuzad."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add many hero spells to be skilled from towers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Avoid spawning Tomes of Retraining by resetting the heroes ability cooldowns when reskilling."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Spell Book."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Mana Ward."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix setting level of Healing Ward aura ability on summoning it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Fountain of Power Ward."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Slide and give it to hero Shado Pan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Spell Book."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount White Tiger."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Discord UI to copy the URL."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum stocks of item Tiny Clan Hall to 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Repair Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve race Modern Warfare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icon for Research Tent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not sell summoned units in Thieves Guilds."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix skip level requirement for Summon Sapphiron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Apache."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Mana Flare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down Marketplace and Thieves Guild buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI builds Antimagic Wards, Marketplaces, Thieves Guilds and Dragon Roosts now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI researches Dragon Roost research now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI sends chat message back when you enable/disable them attacking."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change soundsets of Wall buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve info text for enchanter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Spell Book, Research Tent and Event House ground textures."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disabled unit sound sets for turrets."))) // INLINED!! - - call AddVersion("3.2") - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Free People of Middle Earth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Boromir."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Aragorn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Legolas."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Gimli."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve the performance of custom spell Ride Down by disabling periodic checks when nothing is casted."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Chinese Soldier unit to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Chest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Lock Pick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero spell Disarmament."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow skilling Silence, Disarmament and Preservation on Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-playercolor\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-rename\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-scale\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Improved Trading increases hit points and defense instead of movement speed."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove food cost from units Acclamator and Droid Control Ship and adapt their gold and lumber cost to a Town Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Darth Maul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Gandalf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Frodo Baggins."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename ability Jedi Master into Force Master."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase attack speed and movement speed reductions per level for ability Force Master."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Eagle mount for The Lord of the Rings heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow buying Star Wars, The Lord of the Rings and Medieval mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix making Star Wars mounts unavailable from start."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item Jedi Drone gets a custom icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add reskillable ability Summon Bear, Summon Quilbeast, Summon Hawk, Pocket Factory, Cluster Rockets, Engineering Upgrade, Rain of Fire, How olf Terror, Black Arrow, Healing Spray, Chemical Rage and Acid Bomb."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Silence with Disarmament for hero Bishop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-tomes\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-notomes\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add race Modern Warfare."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Anti Air Wall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use wall system by The_Silent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revised hero abilities of General Grievous."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero U. S. General."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix air attack for heroes Mountain Giant and Iron Fist."))) // INLINED!! - - call AddVersion("3.1") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix food maximum in player info."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add XP rate to player info."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change colors of Jewelcrafter items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item types of Jewelcrafter, Enchanter, Pirate, Witch Doctor and Merchant professions to savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add different Claw item types to savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Orb of Wind and Orb of Royality to savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add worker and male citizen unit types for more races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add farm and altar unit types for more races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable tier 2 and 3 XP bonuses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove all hero equivalents."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase food maximum to 600."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add male CIS citizen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Tiny Scout Tower to Market of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease damage base of building Trebuchet of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase selection scale for building Trebuchet of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Limit building Encampment of Medieval race to 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase selection scale for building Encampment of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add helmet attachment to Crossbowmen of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Unit Swiss Guard of Medieval race gets ability Shockwave."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move icon position of ability Quarter of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase scaling of building Barracks of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase gold and lumber costs for age buildings above Age III of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove units Swiss Guard and Samurai from building Barracks of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove units Archer and Crossbowman from building Encampment of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase selection scale of building University of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase scale of building Siege Workshop of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename unit Knight of Medieval race into Knight on Horseback."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Knight to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add unit Hussar to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Farm of Medieval race can be upgrade to Plantation now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Building Plantation and Farm of Medieval race give more food and have higher costs now than a House."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Fletching to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Town Watch to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Wheelbarrow to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename unit Peasant of Medieval race into Villager."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention Age of Empires II in the tooltip of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Heresy to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the range of ability Quarter of Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Cavalery Plating to Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Human and Kul Tiras researches from Medieval race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Kul Tiras Ghost spawn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change owner of Legendary Artifact building next to Archimonde to bosses to avoid attacks by AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scepter of Healing regenerates 5 % of life."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Thieves Guild sells killed units from enemy players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Marketplace has a limit of 11 slots for items now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Kul Tiras Advanced Shipyard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of unit Peregrin Falcon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move floating text for lumber from Pack Horses down, so players can see the gold text."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Pack Horses are sent to the Trading Post and town halls furthest away now instead of the closest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Pack Horses collect resources for all allies as well."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function GetUnitFurthestAway to simplify the code for Pack Horses and reduce memory leaks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add gold and lumber items to Pack Horses and Trading Posts which indicate the transported resources."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not send Pack Horses to Town Halls if they get 0 resources from Trading Posts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply upkeep rates to earned gold and lumber from Pack Horses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move floating texts for lumber bounty for Merchant profession and Trading Horses to the left."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Equipment Laboratory to Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce damage caused by Eye of Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix coloring of Night Elf Citizen (female)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reives building Night Elf Housing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make building Night Elf housing unavailable for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make building Entangled Gold Mine unavailable for users."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of special building World Tree."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Dalaran Housings start with 10 000 gold."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add pathing blockers to the walls of Sylvanas' spot."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hero Hydromancer to intelligence based hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove cheats \"-attacktypes\" and \"-defensetypes\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-unitinfo\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix replacing hero with Archangel with the correct primary attribute."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon positions for Kul Tiras town halls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Kul Tiras research Devour."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Kul Tiras ability True Sight."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ring of the Trading Guild can not be used to increase charges with Bill items anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Ring of the Trading Guild bonus on selling items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Try to reorder race initialization to fix GetItemRace."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use SimError for item pick up errors due to different race and profession."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of ability Send to Trading Post."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce life healed by Tranquility per level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum stacks of Ankh of Reincarnation to 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Host is player 1-20 in this order instead of the actual host."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add system UnitEventEx from Spellbound with all of its dependencies."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Create custom system CargoLocationSystem to get a unit's X and Y even when being transported."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move transported heroes to their transporters location to fix VIP floating texts and Equipment Bag locations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow certain spells for Equipment Bags: Starfall, Tranquility, Stampede, Volcano, Big Bad Voodoo."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase gained XP from creeps from 50 % to 60 %."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease previous value factor for required XP per hero level from 1.1 down to 1.0 and increase the constant factor from 0 to 100."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not show info about second and third hero picks every time when leveling up."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix entering Boss Fight Island at hero level 55 instead of 70."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add column \"Attack\" to AI player settings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of ability Charge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Leprechaun."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change movement speed bonus of research Improved Mount from percentage to absolute value to fix a bug."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Clone spell as reskillable spell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix resetting Trueshot Aura on reskilling."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the Damage Reduction per Target for ability Healing Wave."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the percentage per level for ability Command Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase percentage per level for ability Trueshot Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce duration of ability Tranquility to 8 seconds."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Place a Thieves Guild on Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise quest log info."))) // INLINED!! - - call AddVersion("3.0") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of ability Stampede (Fel Beast)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix leaving units from Khadgar's Time Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Pack Horse from Marketplace is affected by Evolution now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Freelancer Tower requires Ground-pathable now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Freelancer Tower has damage type Normal now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Advanced Freelancer Tower has increased costs now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update the tooltip of Research Tent and Event House."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Freelancer Protection Tower way stronger."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not increase the mount Cargo ability by one level for the first level of Improved Mount to avoid losing the ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Destroyers as saved units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function SimError to simulate ability cast errors."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Khadgar's Time Portal ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more deposit values to Goblin Bank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply Evolution to loaded units from savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply Evolution for summoned units from Hand of God."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply cooldown of Hand of God to all town halls with Spell Book Tier 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move all units and items after PvP fight back to the portal area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add High Elf Shipyard building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply Evolution to sold units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat commands \"-camlockon/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the slow factors of Cold Arrows and mention the bonus damage in the tooltip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Orb of Orbs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove all 6 Orbs on crafting Orb of Orbs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-orbs\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add non-leaking JASS functions for minimap pings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ping all legendary item rects for Forsaken quest pings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add 3 Naga Tier buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Naga Shipyard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Coral Golem to Naga."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Fish Market by Treasury Of Tides,"))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pyramid of Serpant to Naga."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Naga Whaler."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-racerepick2\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add and use JASS function DropItemAtRectFromHeroByItemType."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Summon Divine Golem with Hand of God."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add War Eagle Taming and Dragonhawk Taming researches to Dragonhawk Aviary."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow High Elf Archers to mount Dragonhawks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-presave\" with prestored savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Convert Soul into hero unit type so you can find it easily."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Easter trees to IsDestructableTree."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Soul Blink ability and increase the movement speed."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-loadp X\" to load prestored savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New bonus hero Razormane Chieftain."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow choosing Game Mode before hero selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow loading savecodes during hero selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show highest known hero level in Hall of Fame floating text."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shipyards require sea-pathable ground."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase width of the player name column."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Prevent Blinking and teleporting into hero selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase Damage Multiplier of Critical Strike."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Crafting Stash requires ground-pathable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not rename summoned units with \" Level X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Wards are affected by Evolution now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revised player selection with Taverns."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest log entry for Hall of Fame."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing food cost to many bonus heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Thalorien Dawnseeker."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Maximum hero level is 75 now and maximum level of all hero abilities is 15 now to improve the loading time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add auto Blink ability to Book of Sargeras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Store flag if Demigod has ever been picked and allow picking demigod heroes during the hero selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix updating hero level researches when loading savecode without a hero unit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix permanent disabling of Gate ability when teleporting into Gul'dan's dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix marking Forsaken Quest 2 as discovered."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register Frostmourne as legendary artifact."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("High Elf AI revives heroes now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Naga and Dwarf AI scripts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify AI scripts by moving duplicated code into common.ai file."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix wrong Dwarf AI script IDs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing AI research for Goblin Sorceress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add special building to Human AI script."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Spellbreakers available for Human AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Autofill Dwarf Mines with workers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Human AI trains Flying Machines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Night Elf AI trains Faerie Dragons."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Undead AI trains Abominations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI only researches Improved Mount every 10 levels of Evolution."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase space for the base at Malfurion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use percentage for Power Generator heal to fix the issue of low healing."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add prestored clan savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-loadpclan X\" and \"-presaveclans\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Block area at Demon Quest 2 prison for buildings and ground units to avoid AI issues."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Statue of Azshara only placable on ground-pathable ground."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make The Alliance Naga only."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Water Gold Mine further away from The Alliance start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more trees to The Alliance start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace shallow water by normal ground at The Alliance start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix ability research icon for Summon Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove research dependency for hero ability Control Magic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply summoned unit effect to Siege Golem from Summon Siege Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Always summon one Siege Golem for Summon Siege Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the tooltips of Summon Siege Golem."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom tooltips to Goblin buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move Goblin research Chemistry into Fuel Pump."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkeys of multiple Goblin units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease upgrade time for Mine Shaft buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Every force has 5 players now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Defend research for High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom unit inventory ability for High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Kul Tiras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pirate Battleships as creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Crafted items for Runeforger profession do stack now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hero ability hotkeys to QWER and A for Attribute Bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Arcane Academy of Theramore allows changing hero standard ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not highlight hotkeys in the tooltips of Summon Mount abilities anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-info X\" to show info about a player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Ner'Zhul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Blackhand."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Spell Book of Sargeras to Jeweled Scepter of Sargeras matching the lore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Roman Empire."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New boss Deathwing appearing after some time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Tent allows training a limited number of Divine Golems."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Divine Golems cause Chaos damage and have anti air attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Samuro."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Magic Sentry to the Arcane Academy of Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add back Gold Mine to dungeon with Keeper of Frostmourne."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Old Gods in dungeon next to Avatar of Sargeras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix changing abilities in Arcane Academy of Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not kill Backpack or Boss units in Maelstrom."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Goblin War Zeppelin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Turret System."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Void Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add prestored clan TheElvenClan with a custom island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spawning bosses Deathwing and Cenarius."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-clans\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change defense type of bonus hero Cenarius to Hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Eggs crafted by Dragon Breeder can be stacked now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Set fixed number of 2 summoned Spider Crab Behemoths and Sea Elementals with increased stats."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Unlock all races and professions at maximum hero level for all heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New chat command \"-maxbosslevels\" at maximum hero level for all heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New chat command \"-anim X\" to play unit animations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Register chat command events only for users to improve the performance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new profession Jewelcrafter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Equipment Bags at higher hero level which are also stored in the savecode."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Potion of Greater Restoration and Restoration Stone to the Crafting Stash."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix auto revival for AI players with multiple heroes like The Burning Legion and The Alliance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify code for auto moving backpack to the hero's location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix losing when cancelling town halls in game type Hardcore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only users can lose the game by losing their town hall in game type Hardcore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Clan Hall Spell Book ability on upgrading the building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Clan AI player does not spend its own resources when sharing with the clan members."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new profession Enchanter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new chat command \"-camrpgon/off\" to allow an RPG camera in singleplayer with arrow key controls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only summon 1 Owl for Scout which has increased sight range and movement speed per level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add researches to upgrade all Dwarf mines instead of a single one."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix storing XP of hero 1 and 3 in the savecode when the hero is not present."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix calculating the levels from XP only for the save code information."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not remove hero 3 and clan halls on repicking."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the Command Aura level for the clan hall with the research."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest log entry \"Known Issues\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-sel\" allowing to select a barrel to fix the multiplayer selection bug."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-zoneson/off\" to enable/disable zone hints from WoW Reborn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix applying Evolution only if the lowest hero leveled up even when all other heroes are in hero selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow loading prestored items, units, buildings and researches savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more prestored savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support Draenei and Furbolg researches in savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("The Eye of Sargeras and Old God bosses have amphibious movement type but can only move very slow and with a special Blink ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Priest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Engineers to build furniture."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Warlords to hire Engineers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable AI script for The Alliance to prevent crashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of researches Storm Protection, Arch Cleric Adept Training and Strength of Silvermoon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use JASS function DropItemAtRectFromHeroByItemType to simplify dropping items on hero deaths."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Academy of Theramore allows changing the mount now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add IJKL movement system to the new RPG camera."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add portal to Goblin Bank island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Pandaren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Gunner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Kodo Beast."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mount Horse."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow mounts for all 3 heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Hydromancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Pandaria area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the radius of Pick up all Items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add delay to opening portals to The Burning Legion to delay their attacks for new players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Pickpocketing item to steal an item on killing any unit with inventory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Feed Boss Heroes will increase the level of all heroes owned by player Bosses now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-revive\" to select your altar on Theramore which helps new players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-players\" to the list of chat commands in \"-help\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Readd correct Undead Housing to Undead Male Citizens."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow to build structures next to portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Force of Nature summons Protectors at level 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingm\" to ping all mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-accounts\" to list all known accounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add shallow water entry to The Alliance base."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Items Magical Cutter, Magical Creep Summoner and Magical Seed can be stacked now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update Evolution for creeps when a player leaves the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-enchanter\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add mailbox on Theramore with savecodes for letters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow VIP players to select bonus races from start."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icons to some High Elf buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more floating texts to describe Outland portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Pirate."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support for replacing Attribute Bonus at the Arcane Academy of Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Engineers can build Item Storages now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Gates constructed by Engineers have a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-asave\" and \"-aload\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset more researches like Improved Navy, Improved Power Generator, Improved Hand of God etc. on full hero repick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Wheel of Fortune."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Custom GUI in the beginning of the game to change AI player settings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Reaver creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Restore Gold Mines on Dwarf Mine Shaft deaths."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Dwarf unit tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Dwarf icon positions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Female Citizens can build Antimagic Wards now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-dice X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Tomes game settings with a Tomes library on the Goblin Bank Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the increased stats by Evolution."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Elune."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase required XP per level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral passive building Zoo to buy pets."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Druid of the Claw."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Druid of the Talon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item unstacking will stack the next slot's item if it has the same type."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Engineer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin unit Flame Shredder is mechanical now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Flamethrowers have a faster attack now which causes less damage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fixed tooltips of Flame Shredder and Goblin Flamethrowers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Goblin Shredder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Flame Tank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Assault Tank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Evolution Stone ability at max hero level."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Necromancer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item respawn system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ore items which respawn."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow crafting item Gold Bars from ores."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race CIS."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Galactic Republic."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Darth Vader."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Yoda."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Jedi"))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Themes options and themes All, Warcraft, Star Wars and Ancient."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove many unused destructible types from object data."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Toggle UI to backpacks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add UnitGroupRespawnSystem which replaces the custom creep respawn system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Automatically generate all savecodes before full hero repick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Jedi Twilek."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Count Dooku."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Palpatine."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-lightsabercolor\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-lightsabertype\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Dragonhawk Aviary."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Jango Fett."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Gran Jedi."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce items in VIP room due to item respawn system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix enabling VIP mode by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show messages on picking up and dropping all backpack items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Destroy/recreate backpack UI on saving/loading in singleplayer to avoid crashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more creeps to the Goblin boss island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add GroupSystem which supports group for more types than units and players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Zeus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add function DropBackpack and fix not clearing backpack on dropping all items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Naga Whalers can harvest lumber now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Coral Golems can cast Replenish now and do have mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Coral Golems can learn Resistant Skin instead of Spell Immunity now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Coral Golems have movement type Amphibous now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Pyramid of Serpent can be used to return lumber now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove hotkey highlighting from Murloc Hut."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingportals\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Jump System."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change model and icon of Human housing to a granary."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix town hall spell book on upgrades for all town hall buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Oil Platforms only drill oil now if the research has level 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update savecode alphabet with all ASCII symbols which should lead to shorter savecodes in some cases and allows using more letters for letter savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase maximum stacks to 1000 for many item types."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow stacking Healing Wards."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Appearing bosses can be summoned in the Event House now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Magical Item Summoner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Goblin Merchant to every possible base."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Exchange 100 Lumber for 100 Gold."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase stocks of Bundle of Lumber and reduce stock interval."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Imp worker unit type from Demon race into Gan'arg Engineer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reaver units can be trained by Demon race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add War Stomp to Fel Reaver."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Ragnaros in dungeon Molten Core."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Core Hound creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the delay until the portal to the Buring Legion opens."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Crafting Stashes are not limited to 1 anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Crafting Stashes are not invulnerable anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more craftable items: Gold Bars, Boards, Healing Potions, Mana Potions, Stone Tokens."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more respawning items: Branches, Stones, Healing Herbs, Mana Herbs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add respawning orbs into VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase item respawn time to 180 seconds."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove researches from Neutral Goblin Laboratory which are available in the Research Tent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change the icon of the Hideout spellbook ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add many more building types for Freelancers and all races to savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix spelling mistake in Portal tooltip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove requirement of Power Generator Regeneration icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Connect wtih Destination to Portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow connection portals with smart order."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Arcane Portals and ability Select Location to Portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change High Elf Citizen icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Frostmourne to The Ashbringer and give it a +5 extra damage bonus."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-craft\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Barracks have a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Tank Factory and Goblin Town Hall switch models."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Town Hall has a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin race has 3 different tier buildings now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Tower has a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down the Wall building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix updating the backpack on picking up items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Burning Oil for Ogre Goblin Squads."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix some icon positions for Goblins."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Altar of Goblins into Altar of Engineering."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Rocket Towers have custom icons now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow crafting Goblin Land Mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Orb of Orbs has a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus profession Archaeologist."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Beast Whistle to Arcane Academy of Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support Demon Slayer Axe for enchanting."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Goblin Turret."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Advanced Goblin Rocket Tower is affected by Goblin researches now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix some hotkeys of Gobilins."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow expanding walls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Selfdestruct to walls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of Wall to W."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add respawning items to the VIP room."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable Divine Shield of Anduin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove highlighted keywords from several tooltips."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ability Selfdestruct has Death animation now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Marketplace system."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix showing item charges in custom backpack UI for non-perishable item types with more than 1 charge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Goblin Citizens (male) can construct Marketplaces now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Order Backpack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum life of Marketplaces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("More items can be enchanted."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Summoning The Burning Legion in Event Houses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show player teams with chat command \"-players\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow picking up non-profession and non-race items with the Pickup all Items ability anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Item Locker which allows you to claim items to protect them from enemy players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function CanItemBePickedUp to check if any item can be picked up by any player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Magical Rune Wards."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Stasis Traps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus profession Witch Doctor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow linking Crafting Stashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease many stock item charges from 100 to 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Save item owner for backpack items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Locked Item Summoner to Goblin Merchant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Heart of Aszhara adds AOE damage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename several rects into English."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-host\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix setting udg_Hero for AI players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Ironforge as separate start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Fountain of Power to the Clan Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix feedback message of \"-clanlumber X\" chat command."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Troll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce sight range bonus of research Improved Mount."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improved Mount researches adds maximum life to the mounts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Lich King carries an Orb of Frost now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not let creeps die in Maelstrom anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Adapt tooltip of Improved Creep Hunter and explain it only helps unit abilities but not hero abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Resistant Skin ability to Stonemaul Arena Master."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Changing the owner of enemies in the arena drops items as well now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Mount to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Creep Hunter to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Navy to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Power Generator to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Hand of God to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Masonry to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Clan to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce maximum level of research Improved Clan Hall to 75."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Freelancers can train Green Drakes instead of Green Dragons now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Life and Mana Regeneration of Clan Hall does not require any research anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus race Tauren."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow backpack UI in multiplayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat command \"-savegui\" works in multiplayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability to Backpack to show the savecode GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show the bag number per slot in the custom backpack UI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix removing bonuses of Storm Crow and Bear Form from Druid heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Antimagic Wards prevent enemy portal targets in area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix error message for pinging targets of portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Buildings constructed by Engineers are only affected by the Glyph of Fortification but not any race specific research."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Immortality of World Tree an instant ability with unlimited range."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make range of Power of Cenarius of World Tree unlimited."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show error messages and fix memory leaks of of Immortality and Power of Cenarius of World Tree with SimError."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Find Artifacts ability summons 2 random items now of any type."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new Orc hero Warlock."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Creep Stormreaver Warlock gets its original abilities back."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset stats of Undead heroes to default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Improved Trading to Marketplaces."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support saving item Mantle of Intelligence +3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Let no creep spawning in the arena sleep at night."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow using \"-c\" for chat command \"-clear\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingaistarts\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Unsummon Building to Engineers and Engineer Ships."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of Tiny Dwarf Town Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Orc Shipyard with Demon Shipyard for Demon race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Becoming a demigod by loading a savecode keeps your heroes position or moves the hero to Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Water Way Gate to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Wind which is sold from the Kul Tiras shop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new boss Antonidas in new area Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom models for Blood Elf and Night Elf Female Citizens."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Magic Sentry of unique item Murloc Scroll."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow crafting Rings of Protection and Claws."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow crafting Demonic Figurines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Deathwing won't damage himself anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce damage caused by Finger of Death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise bonus hero Goblin Shredder thanks to Uncle from HiveWorkshop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve abilities of Goblin Heavy Tank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve ability tooltips of Goblin Gunner."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys of Funny Bunny."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model and icon for Altar of Hell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Sylvanas Windrunner with new area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Citizens have a hotkey now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Save Masters have a hotkey now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icons and effects of Save Master abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move code of external systems into trigger folder \"Libraries\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Demon and The Burning Legion AI train Reavers now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of High Elf research Defend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Captured Maiev Spell Immunity to avoid using it as teleport target."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Undead citizens actually Undead and give them the Restore ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom icon for ability Dalaran Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use official vJass library SimError made by Vexorian instead of a custom function."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Player Interactions has a hotkey now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add paid fans to player selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change weather effect on Sunstrider Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Fountain of Life for players Gaia and The Alliance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reorder Fountain of Life buildings on Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Bonus hero Void Lord can be picked at maximum hero level and can change his hero abilities on Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve abilities of bonus hero Antonidas."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix cooldown of Roar of Stonemaul Arena Master Belt."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat commands \"-i\" and \"-info\" have the same effect now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat commands \"-e\" and \"-enchanter\" have the same effect now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Chat commands \"-r\" and \"-revive\" have the same effect now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Pets have a hotkey now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only show item charges in item savecodes if items are stackable."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero variables for The Burning Legion."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hydromancer has standard ability Invisibility now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix creating quest marker on Queen of the new Citadel after charming the last Draenei."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease the damage from Gul'dan's damaging power generator."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix leaving Gul'dan's dungeon to blink and teleport again."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove elevators from Gul'dan's dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Sargeras' laugh a 3D sound, so it won't annoy all players all the time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add a timer window for the Draenei waves in Demon quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the number of spawned Draenei in Demon quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the level of spawned Draenei in Demon quest 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Demon Reavers cause Siege damage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Added note about Siege damage and harvesting lumber to tooltips of Demon Reavers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enchanting formulas can be stacked up to 2 items which both will improve the enchanted items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention exact bonus values and defense type hero in tooltip of item Draenei Slayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the damage bonus against heroes from Draenei Slayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltip of Orb of Sun and mention the exact values."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the caused damage against summoned units from Orb of Sun."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the destroyed mana against units and heroes from Orb of Sun."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix maximum research and ability levels for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Research Improved Mount to the maximum for AI when Evolution and Improved Power Generator reached their maximum."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add portal from Black Citadel to New Citadel and back to Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-vips\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show a player's clan and VIP status in \"-players\" chat command's output."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move code from \"src/Systems.j\" into different triggers and vJass libraries."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use hidden icon ReplaceableTextures\\CommandButtons\\BTNeredarRed.blp for many Eredar units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use hidden icon ReplaceableTextures\\CommandButtons\\BTNPickUpItem.blp for Pick up all Items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use hidden icon ReplaceableTextures\\CommandButtons\\BTNStaffOfPurification.blp as Scepter of Dalaran."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add option STACKING_NEXT_ITEM_FROM_START to the custom ItemUnstackSystem which changes item unstacking behavior and release version 1.7 on Hive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of item Dungeon Key."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rescuable units from player Gaia respawn now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Units Warden, Naisha, Shandris and Night Elf Runners are affected by Evolution now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Uther."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Jaina."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero glow to Hand of Destruction."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Antonidas."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use a custom treasure model with hero glow and hence a visible team color for items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show clan name and VIP status in player list."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show player list and player info longer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recolored crafted profession items to identify them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Draenei Banner cannot be sold to merchants anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable anti air traps and preventing to teleport and blink in Gul'dan's dungeon and rename the floating text to the Unknown Dungeon after killing all three Old Gods for the first time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide Goblin Air Field model on death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase the lumber cost of Glyph of Omniscience."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Divine Golem have ranged attacked by default now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Demon building Legion Transporter."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove manual hotkey highlighting from Demon buildings and researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change \"hire\" and \"summon\" in Demon tooltips to \"train\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down Goblin War Zeppelins from 2.0 to 1.2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Demon can build Sacrificial Pit now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Demon unit Jailer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Demon unit Inquistor."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix a bug in Demon Quest 4 which made it possible to complete the quest before killing the final wave."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce PvP countdown to 20 seconds."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fixed a bug where starting the PvP fight led to heroes leaving their teams immediately."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add floating texts for Team 1 and Team 2 to the PvP arena."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more professions for AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-legendary\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon of Medivh's Spell Book."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Update all 3 heroes for player bosses all the time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Demon Shipyard does not sell but train ships now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Change to next free Bag to backpacks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Change to first Bag to backpacks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Change to last Bag to backpacks."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New chat command \"-it\"/\"-items\" shows all backpack items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New chat command \"-pi\"/\"-pickup\" picks up all items around your hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New chat command \"-o\"/\"-order\" orders your backpack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-aicraft\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-respawnall\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Shorten clan member info in Save GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Keeper of Ashbringer (previously Keeper of Frostmourne) causes Chaos damage now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Magical Creep and Item Summoner use SimError now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Magical Creep and Item Summoner are stopped during the casting event instead of the channel event which should prevent the hero from already using mana."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Power Generators do only affect structures but not mechanical units anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix setting level of Auto Repair Icon ability for Power Generators even when loading savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Demon research Fel Transporting."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Cages \"drop\" Wind Riders."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New building Lever to open/close gates and bridges which won't be used by AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add gate to World Tree base."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add gate to Sunstrider Isle."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add gate to Illidan's base in Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Magical Frog and Magical Albatross have hotkeys now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of Starfall in Power Generator."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Arthas."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Arthas wielding Frostmourne."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Muradin."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Kel'Thuzad in Necromancer form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Arthas (evil)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Anub'arak."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Maiev."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Tyrande."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Ghost."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Illidan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Cairne Bloodhoof."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Thrall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Grommash Hellscream with custom ulti Chaos."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add towers to player selection which allow players to reskill the Void Lord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-hero1\", \"-hero2\" and \"-hero3\" to pick and repick all three heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-profession1\" and \"-profession2\" to pick and repick both professions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-race1\" and \"-race2\" to pick and repick both races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-cooldowns\" to show the repicking cooldowns."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix spawning eggs for hero Funny Bunny without skilling Egg Multiplier."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Night Elf Runners can cast Reveal now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Scale down Demon special building Dimensional Gate."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Improved Devour to Demon race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-idleworker\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add respawning item Dragon Egg."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow summoning dragons in Crafting Stash."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Enable Wander to all citizens and pets and disable their Wander ability by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Bonus Book Shop to Goblin Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Crafting Stash, Event House and Research Tent are buildings for all races now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix gold value shown in custom backpack UI for charged items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Crafting Stash uses a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-gaiaon/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Entangled Gold Mine uses a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest log entry Portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest log entry Crafting Stashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest log entry Void Lords."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Demon research Anti-magic Shell."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use custom model and icon for Goblin Bank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Improve Warlord AI configurations."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Murloc Hut and Goblin Hut use a custom icon now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Draenei quest 1 reward is a Ring of Protection +5 now instead of a Ring of Protection +2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Draenei quest 2 reward is a Claws of Attack +15 now instead of a Claws of Attack +12."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove food costs of several spell dummies."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Repair."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero standard ability Dark Summoning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Enable Wandering to summoned Scouts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable automatic camera distance updates and chat commands \"-far\", \"-close\" and \"-camdistance X\" due to camera distance settings in Warcraft Reforged."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more creeps in an area at the Burning Legion realm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change icon position and hotkey of building and research Book of Summoning Pedestal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest log entry \"Enable HD Graphics\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support replacing Demon race on repick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix and revise hero ability Harvest of Goblin Shredder."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom Vote System."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-ffa\" to change the player alliances for all Warlord players to Free For All."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-lobby\" to change the player alliances for all players to the lobby teams."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify stats multiboard due to freezing bug with the new font in Reforged."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("The Burning Legion and The Alliance have random professions now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin Merchant for Star Wars to Boss Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add purchasable item Jedi Drone."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Item and ability Mana Ward with custom model and icon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the chance for creeps of dropping items and increase the chance to drop low level items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero ability Drain for Gul'dan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom icons for High Elven buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Shado Pan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Iron Fist."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Many bonus Goblin heroes are regular Goblin heroes now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Sorceress."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Funny Bunny gets Easter Egg directly spawned into its inventory."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-auto\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not auto kill air heroes in Gul'dan's dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Marketplace for all races to Trading Post."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building neutral Marketplace to all races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest log entry for Trading Posts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero ability Dark Summoning available for Void Lords."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add neutral building Thieves Guild."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Goblin Prince."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Mal'Ganis."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero ability Aura of Darkness."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Aura of Darkness to Antimagic Wards."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Mal'Ganis boss Inferno, Carrion Beetles and Death Coil abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add ability Lordearon Villagers for Mal'Ganis instead of Soul Preservation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add boss Elune."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI does not attack players by default but only with the help of chat commands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat commands \"-unlock\" and \"-lock\" to unlock everything."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpping\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-helpclan\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Equipment Bags to change hero abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Shroud of Protection area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove manual highlightings of several hotkeys."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Neutral Goblin Laboratory can train Female Citizens and Pets now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add bonus hero Bishop."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Orb of Royality."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Legendary item Sea Witch Tail only blocks negative spells now and adds 20 damage instead of 10."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-gold\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-lumber\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hidden item Holy Grail and chat commands \"-grail\" and \"-dig\" to find it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Dragon Roost which can be constructed by Female Citizens."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add human hero Dark Knight."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Hydromancer a regular Human hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Scroll of the Ghosts of the Sea."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Unlimited Bag of Gold."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Dark Knight the new hero spell Ride Down."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Revise info quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of heroes Berserk buff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add CustomUI system from Hive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add custom UIs for races Blood Elf, Naga and Demon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Banshee."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Open Portals."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-raceui X\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Revive."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Escape Portal."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-items\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-baginfoon/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add creep spot with blue dragons to Northrend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add spell Charge."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Abomination."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-baguion/off\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add profession Merchant."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero Military Tribune."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Cache item type information for better performance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero C-3PO."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero R2-D2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add hero General Grievous."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Customize Engineering Upgrade, so it does not need extra abilities with levels which would slow down the loading time and require extra logic in AI scripts (fixes AI skilling for hero Engineer)."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not limited Haunted or Entangled Gold Mines anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix food maximum number in stats multiboard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of research Flame Grenade."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of unit Goblin Flamethrower."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of unit Ogre Goblin Squad."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change hotkey of research Repair."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon position of High Elf research Defend."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce build time of Haunted, Entangled and Enchanted Gold Mines to balance initial mining time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix tooltips of Beastmaster hero abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Apply summoning bonuses to preplaced tentacles."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix icon of item Tiny Goblin Town Hall."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show numbers of foot levers in Gul'dan's dungeon as messages to the owner of the entering unit."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow giving units to other players exceeding their food maximum."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce base damage of heroes Gul'dan and Ner'Zhul."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Random Artifact."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable cheats for player red with name Barade#2569."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do mention links in quest log entries \"Reforged Version\" and \"Credits\" instead of listing everything."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Repair to some citizen units since AI uses them to construct structures."))) // INLINED!! - - call AddVersion("2.0") - call CreateQuestItem(bj_lastCreatedQuest , (("Fix number of Adventurers in the map description."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-savegui\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more unit, building, item and research types for savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix defense type for Turtle Shell item."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase death time of creep/boss heroes to avoid their permanent removal from the game."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disease Cloud of Corrupted Ancient Protector does not require a research anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recreate Furbolg Tribal Center on AI destruction."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not remove Sargeras for non-Boss players on death."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Set mana cost for all levels of Mirror Image to 80 which was 125 from level 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix effect of item Amulet of Martial Arts and remove Unique from its tooltip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new boss Spider Crab Behemoth."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rename Sea Giant boss to King Deepbeard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reveal certain neutral buildings to Freelancers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show hero journey messages with colors, sound and in correct order when leveling up."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase Archimonde's hero level to 150 and the level of his Dreadlords to level 60."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable hero level up for Mirror Image of bosses because of Evolution."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move town halls of The Alliance next to the goldmines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add line break to the defeat message."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Translate victory message into English."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-wrapup\" which converts all buildings into tiny items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("More general approach nor not picking up items which do not belong to your races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add portal to and from Alliance island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change color of portal to Archimonde to the The Burning Legion player color."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add portal to and from Boss Fight Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-passive\" for a passive mode against enemy players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Engineer Ships can build Haunted Water Gold Mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Engineer Ships can place Goblin Water Mines."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase stock number and decrease stock delay for Engineer Ships."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Haunted Water Gold Mines can train ships and Sky Barges."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Improved Air Transport to the Power Generator."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Mercenary Camp from the Future to the Boss Fight Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hitpoints and mana bonus from 50 % to 60 % for Evolution."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hero ability levels to 100."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show the percentage in the tooltip of Brilliance Aura."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase hero level of Archimonde to 500 which is the maximum hero level skill points can be spent."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove irritating boss marker at mages creep spot in Lordaeron."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new boss Mathog."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow deactivating Divine Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce cooldown and duration of Divine Shield."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new boss Gul'dan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Simplify triggers to drop legendary artifacts on hero deaths."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add JASS function AssignAllUnitsToCurrentGroup to assign all units at once to a creep respawn group."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add global unit group variable udg_CurrentRespawnGroup to add all respawning creeps to it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace useless Embassy of Theramore with an Arcane Academy of Theramore selling mana-related items."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove useless Tavern of Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new island next to Maelstrom with new boss Sea Witch."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Play Naga or Blood Elf Theme if you choose the corresponding races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the number of air units and increase the number of ground units for Demon/TBL AIs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add new boss Avatar of Sargeras with legendary item which can convert units to different races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix worker counter in stats when using Charm."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more unit and building types for savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New race Goblins."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add save code for researches and chat command \"-loadr XXX\" to load it."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow voting for Only Freelancers for AI in the beginning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Generate dragon units and good items savecodes with cheats."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Tier 1-3 equivalent texts with \"Tier 1\", \"Tier 2\" and \"Tier 3\" instead of listing all town halls."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New island Kezan with boss Rumblefitz."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow disabling AI The Burning Legion and The Alliance via votes in the beginning."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-racerepick\" to repick your first race as Warlord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Hall of Fame floating text to hero selection."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building type Research Tent for all races with important researches to save icon space in tier 3 buildings."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hotkeys for bonus hero Medivh."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-savec\" to generate savecodes into files without printing information for a long time."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove weather effect from hidden island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add learn hotkey to ability Summon Sea Elemental of bonus hero Admiral Proudmoore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove message \"Upgraded Evolution.\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce Demon Housing model scale to make build area visible."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Let Naga AI build special building."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add more Hidden Bases."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-saveautoon/off\" and auto save the hero every 10 minutes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Adapt Warlord and Freelancer descriptions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add portals to different boss islands on the sea."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Always summon Sunken Ruin mercenaries for Freelancers when the regions are unknown."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix respawning The Alliance AI at the correct start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-help/-h\" to list all chat commands."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Becoming a demigod requires a Nether Dragon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingdragons\" to ping all Dragon Roosts."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Power Generator causes damage in area of boss Gul'dan."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add secret combination to enter Gul'dan's dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add treasure with trap to Gul'dan's dungeon."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix hero revival for Furbolg AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Support more heroes for Freelancer AI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add leaderboards quest log entry from the original Reborn map."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Invisibility and Berserk have 100 levels now and are set to the hero's level up to level 100."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Both Pit Lords in Outland carry an Orb of Fire now to attack air units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Initial Towers of the Arcane Academy of Theramore allow changing hero abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add fixed Computer player Gaia who provides some units on the map which can be rescued."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Improved Navy for all races."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Human, Night Elf and Undead ships are affected by Evolution now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Added shipyards to The Alliance for initial navy AI support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix soundset of Nether Dragon boss."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use the hero proper name of bosses in the message for all players when defeating them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add build blockers to the Outland portals area."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("The Alliance and Blood Elf AI build special building Magic Vault."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset hero level researchs on full repick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Try to fix alliance change reaction by AI players by swapping player parameters."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Water Waygates."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Engineer Ships to build Portals on water."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow to load save objects which do not belong to your race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease the save code IDs by splitting them up into units, buildings, items and researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase maximum level of research Evolution from 100 to 1000."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not increase the area of effect for War Stomp with each level to avoid lags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable AI special players by default to avoid crashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Move creep dragons further away from the Orgrimmar start location."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-pingkeys\" to ping all keys which are not in black mask for a player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace Spell Immunity of bonus hero Archimonde with Invisibility."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add research Improved Creep Hunter which increases the maximum creep level of certain unit abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fill savecodes with fixed number with remaining zeroes to always have a fixed length since we do not store the number."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix cooldown for savecode researches."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("The chat commands \"-save\" and \"-savegui\" open a custom GUI in singleplayer only which allows managing savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not load research levels from savecodes if your current ones are higher."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not load savecodes if they are empty."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Store Improved Navy level in the hero savecode."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix an issue of loading not existing hero level 2 from the savecode."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("The savecode stores if your hero has become a Demigod or not."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add two more creep unit types (one healing) to the Neutral Mercenary Camp of Freelancers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Translate abilities of Tinker back into English."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow saving fragment items required to become a Demigod."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reorder columns in the stats multiboard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Kil'Jaeden boss Banish ability."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AutoSkillHero and simplify Boss Island boss creation."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("One single cheat \"-levelX\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New cheat \"-cheats\" to list all cheats."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Ping Water Goldmines with \"-pinggoldmines\" chat command."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Sargeras boss much stronger by giving him some powerful unit abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow to pick Sargeras boss as second hero."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Feed made by the Research Tent which increases the hero level of all bosses."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add third hero at hero level 100 with chat command \"-thirdrepick\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheats \"-orderon/off\" to debug orders by all players to find crashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Attribute Bonus has 1000 levels now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sorcerer and Runeforger craft items with 4 charges instead of 3 now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow enabling AI for yourself at hero level 200."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Clans."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset abilities of mercenary and creep Dark Wizard to default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Maiev a Shadow Orb to attack air units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Demon Quests 3 and 4."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Lower the priorities for Research Tent and Power Generator to avoid AI crashes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Bounties."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Store item names, descriptions, tooltips and extended tooltips in backpacks to avoid losing dungeon key information."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Goblin Bank."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable Warcraft's Item Stacking."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give boss Ancient Dragon Turtle and Spider Crab Behemoth an orb item to attack air units."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("AI cannot buy Random Events or Alliance with the Burning Legion anymore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New bonus hero Antonidas."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add random bonus hero support."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow to load savecodes which have been generated during the same game to avoid duplicating stuff."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Enable visibility for bonus heroes from start for VIP players."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New bonus hero Fel Beast."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Shivarra creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add quest entry Lore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow filling auto savecode file with the custom save GUI."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix the icon positions for the abilities of bonus hero Wizard."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow defeating AI and show defeat in stats."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New boss Akama in Outland."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Paladin bosses to be included as counters for Forsaken quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow Paladins to complete Forsaken quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make sure players are enemies on killing for Forsaken quest 3."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Allow saving all 3 tier buildings for Freelancers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-foldername\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Mention that Legendary items and quest rewards are not saved."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("No hero equivalents anymore in gameplay constants which treats all hero types the same way."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cheat \"-foldername\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use a folder for all generated savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Consider hero XP from heroes in repick when increasing creep Evolution."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Only load gold and lumber from savecode if it is higher than your current gold and lumber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix changing creep Evolution level when loading heroes with levels not having modulo 10 = 0."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable AI special players by default."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove AI special players from stats if disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove Neutral Hostile and Neutral Passive from stats."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Sell expensive Glyph items in Arcane Academy of Theramore."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Show bonus heroes for VIPs on repick."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Neutral Laboratories for Freelancers can be used to return gold and lumber."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New bonus hero: Dwarf Mage."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refactor trigger names and move them into folders."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add building Event House."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Freelancer Towers."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("All tier town halls use a spell book for the player interactions."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix quest markers over Illidan for Draenei quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix quest markers over Queen for Demon quests."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Medivh's Spell Book a shared cooldown to prevent mass casting."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix Magma Giant tooltip and costs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New hero: Khadgar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("More preplaced creeps with random dropped item types instead of fixed ones."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Scroll of Town Portal to the list of dropped item types by creeps."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Make Maiev's guards vulnerable during the quest, so the player can kill them."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix removing quest marker from Kael after Naga Quest 1."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Refresh backpack before getting and after releasing control of Illidan to fix its hero icon position."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Power Generators do not sell Crystal Balls anymore since they are a reward for a Naga quest."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Limit Goblin Artist colors to 10 in total per player."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Random events spawn 20 units at maximum to prevent massive lags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New bonus hero: Carsten."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease the rate for Transmute."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Massively decrease the damage multiplier for Drunken Brawler."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add item Feed AI to increase the hero level of AI heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Neutral Shop sells Magical Cuter and Magical Seed."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Discord to loading screen."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not share vision during hero selection and repick to prevent black mask areas from allies."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix unwanted level up effect on Mirror Image caused by Evolution."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fixed area for Thunder Clap to avoid lags."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase cooldown for Boss Fight Island."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Divide the boss level in Boss Fight Island by 2."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Impale a fixed stun duration."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Decrease the life drain percentage of Death and Decay.and Dalaran Shield and give them a fixed cooldown."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reduce the percentage of Cleaving Attack."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New hero: Ranger."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New race: High Elf."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove level values from Cold Arrows tooltip."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Replace ulti of Sylvanas Windrunner with Banshee Form."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Increase number of levels for hero ability Battle Roar."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing learn hotkey to hero ability Cripple."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Black Arrow abilities support units with levels greater than 5."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Reset full repick flag on normal repick to prevent game mode dialog showing up."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Dragonhawk mounts for High Elf and Blood Elf heroes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Human can train Spellbreakers and Dragonhawk Riders again."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add Phoenixes and Phoenix Egg building to Blood Elf race."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("New hero: Funny Bunny."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add chat command \"-discord\"."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add cooldown for hero savecodes."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Give Bosses on Boss Fight Island orbs."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove splash damage from Guards of Sargeras to prevent them from killing Sargeras."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Disable many quest items and rewards to be sold by the Theramore Marketplace."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Immediately check for enough votekick votes after starting which fixes votekicks in singleplayer."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Use summoned level 4 unit types from World of Warcraft Reborn again."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Many summon hero abilities have stronger but less summoned units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow alliance chat commands with player The Alliance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Hide The Burning Legion and The Alliance from score screen if disabled."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Recreate stats multiboard on alliance changes to hide Warcraft's multiboard for full shared control."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Remove votekick timer window and reset votes on timer expiring."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not allow votekicks against The Alliance."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Rain of Chaos and Call of Drakes summons always 4 units now."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add missing learn hotkeys of Crushing Wave and Watery Minion hero abilities."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Change Multiplayer detection to work with only 1 player left."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Do not reset gold and lumber on repicking and picking Warlord."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Made AntiDenseMan#1202 a VIP."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Add all alliance chat commands to the separate quest log entry Alliances."))) // INLINED!! - call CreateQuestItem(bj_lastCreatedQuest , (("Fix AI alliance responses."))) // INLINED!! -endfunction -//library WoWReforgedChangeLog ends -//library WoWReforgedDayNightCycleEffects: -function WoWReforgedDayNightCycleEffects__AddDestructableEx takes integer id,boolean hide,real hideDelay returns nothing - set WoWReforgedDayNightCycleEffects__destructableIds[WoWReforgedDayNightCycleEffects__destructableIdsCounter]=id - set WoWReforgedDayNightCycleEffects__destructableHide[WoWReforgedDayNightCycleEffects__destructableIdsCounter]=hide - set WoWReforgedDayNightCycleEffects__destructableHideDelay[WoWReforgedDayNightCycleEffects__destructableIdsCounter]=hideDelay - set WoWReforgedDayNightCycleEffects__destructableIdsCounter=WoWReforgedDayNightCycleEffects__destructableIdsCounter + 1 -endfunction -function WoWReforgedDayNightCycleEffects__AddDestructable takes integer id returns nothing - call WoWReforgedDayNightCycleEffects__AddDestructableEx(id , false , 0.0) -endfunction -function WoWReforgedDayNightCycleEffects__GetDestructableIndex takes integer id returns integer - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedDayNightCycleEffects__destructableIdsCounter ) - if ( WoWReforgedDayNightCycleEffects__destructableIds[i] == id ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function WoWReforgedDayNightCycleEffects__FilterIsDayNightDestructable takes nothing returns boolean - return WoWReforgedDayNightCycleEffects__GetDestructableIndex(GetDestructableTypeId(GetFilterDestructable())) != - 1 -endfunction -function WoWReforgedDayNightCycleEffects__EnumDestructableDayEffect takes nothing returns nothing - local integer index= WoWReforgedDayNightCycleEffects__GetDestructableIndex(GetDestructableTypeId(GetEnumDestructable())) - if ( WoWReforgedDayNightCycleEffects__destructableHide[index] ) then - call ShowDestructable(GetEnumDestructable(), true) - endif - call SetDestructableAnimation(GetEnumDestructable(), "Stand") -endfunction -function WoWReforgedDayNightCycleEffects__EnumDestructableNightEffect takes nothing returns nothing - local integer index= WoWReforgedDayNightCycleEffects__GetDestructableIndex(GetDestructableTypeId(GetEnumDestructable())) - call SetDestructableAnimation(GetEnumDestructable(), "Death") - if ( WoWReforgedDayNightCycleEffects__destructableHide[index] ) then - call TriggerSleepAction(WoWReforgedDayNightCycleEffects__destructableHideDelay[index]) - call ShowDestructable(GetEnumDestructable(), false) - endif -endfunction -function WoWReforgedDayNightCycleEffects__AddDoodadEx takes integer id,string dayAnimName,string nightAnimName returns nothing - set WoWReforgedDayNightCycleEffects__doodadIds[WoWReforgedDayNightCycleEffects__doodadIdsCounter]=id - set WoWReforgedDayNightCycleEffects__doodadDayAnimNames[WoWReforgedDayNightCycleEffects__doodadIdsCounter]=dayAnimName - set WoWReforgedDayNightCycleEffects__doodadNightAnimNames[WoWReforgedDayNightCycleEffects__doodadIdsCounter]=nightAnimName - set WoWReforgedDayNightCycleEffects__doodadIdsCounter=WoWReforgedDayNightCycleEffects__doodadIdsCounter + 1 -endfunction -function WoWReforgedDayNightCycleEffects__AddDoodad takes integer id returns nothing - call WoWReforgedDayNightCycleEffects__AddDoodadEx(id , "Death" , "Stand") -endfunction -function WoWReforgedDayNightCycleEffects__PlayDoodadAnimations takes boolean day returns nothing - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedDayNightCycleEffects__doodadIdsCounter ) - if ( day ) then - call SetDoodadAnimationRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects__doodadIds[i], WoWReforgedDayNightCycleEffects__doodadDayAnimNames[i], false) - else - call SetDoodadAnimationRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects__doodadIds[i], WoWReforgedDayNightCycleEffects__doodadNightAnimNames[i], false) - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedDayNightCycleEffects__DayEffects takes nothing returns nothing - if ( IsDay() and not WoWReforgedDayNightCycleEffects__effectsIsDaytime ) then - set WoWReforgedDayNightCycleEffects__effectsIsDaytime=true - call WoWReforgedDayNightCycleEffects__PlayDoodadAnimations(true) - call EnumDestructablesInRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects__filter, function WoWReforgedDayNightCycleEffects__EnumDestructableDayEffect) - endif -endfunction -function WoWReforgedDayNightCycleEffects__NightEffects takes nothing returns nothing - local real ToD= GetTimeOfDay() - if ( IsNight() and WoWReforgedDayNightCycleEffects__effectsIsDaytime ) then - set WoWReforgedDayNightCycleEffects__effectsIsDaytime=false - - call WoWReforgedDayNightCycleEffects__PlayDoodadAnimations(false) - call EnumDestructablesInRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects__filter, function WoWReforgedDayNightCycleEffects__EnumDestructableNightEffect) - endif -endfunction -function WoWReforgedDayNightCycleEffects__Init takes nothing returns nothing - set WoWReforgedDayNightCycleEffects__filter=Filter(function WoWReforgedDayNightCycleEffects__FilterIsDayNightDestructable) - //call TriggerAddAction(bj_dncSoundsDay, function DayEffects) - //call TriggerAddAction(bj_dncSoundsNight, function NightEffects) - - // Set up triggers to respond to changes from day to night or vice-versa. - set WoWReforgedDayNightCycleEffects__dayEffectsTrigger=CreateTrigger() - call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects__dayEffectsTrigger, GAME_STATE_TIME_OF_DAY, GREATER_THAN_OR_EQUAL, bj_TOD_DAWN) - call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects__dayEffectsTrigger, GAME_STATE_TIME_OF_DAY, LESS_THAN, bj_TOD_DUSK) - call TriggerAddAction(WoWReforgedDayNightCycleEffects__dayEffectsTrigger, function WoWReforgedDayNightCycleEffects__DayEffects) - set WoWReforgedDayNightCycleEffects__nightEffectsTrigger=CreateTrigger() - call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects__nightEffectsTrigger, GAME_STATE_TIME_OF_DAY, LESS_THAN, bj_TOD_DAWN) - call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects__nightEffectsTrigger, GAME_STATE_TIME_OF_DAY, GREATER_THAN_OR_EQUAL, bj_TOD_DUSK) - call TriggerAddAction(WoWReforgedDayNightCycleEffects__nightEffectsTrigger, function WoWReforgedDayNightCycleEffects__NightEffects) - - //call AddDestructable() - - call WoWReforgedDayNightCycleEffects__AddDoodadEx(('YOlp') , "Death" , "Stand") // Post Lantern Cityscape // INLINED!! - call WoWReforgedDayNightCycleEffects__AddDoodadEx(('LOlp') , "Death" , "Stand") // Post Lantern Lordaeron Summer // INLINED!! - call WoWReforgedDayNightCycleEffects__AddDoodadEx(('LObz') , "Death" , "Stand") // Brazier Glowing Loraderon Summer // INLINED!! - call WoWReforgedDayNightCycleEffects__AddDoodadEx(('LOtz') , "Death" , "Stand") // Torch Glowing Lordaeron Summer // INLINED!! - call WoWReforgedDayNightCycleEffects__AddDoodadEx(('ZObz') , "Death" , "Stand") // Brazier Ruins // INLINED!! - call WoWReforgedDayNightCycleEffects__AddDoodadEx(('D013') , "Death" , "Stand") // Gypsy Wagon // INLINED!! - call WoWReforgedDayNightCycleEffects__AddDestructableEx('D00F' , true , 2.167) // Fireflies - call WoWReforgedDayNightCycleEffects__AddDoodadEx('AOgs' , "Stand" , "Stand Alternate") // Statue Guardian of Aszune - call WoWReforgedDayNightCycleEffects__AddDoodadEx('AOks' , "Stand" , "Stand Alternate") // Statue Keeper -endfunction -//library WoWReforgedDayNightCycleEffects ends -//library WoWReforgedHeroSkills: -function GetHeroLearnedSkillEx takes integer sourceHandleId,integer slot returns integer - return LoadInteger(WoWReforgedHeroSkills___h, sourceHandleId, slot) -endfunction -function GetHeroLearnedSkill takes unit hero,integer slot returns integer - return (LoadInteger(WoWReforgedHeroSkills___h, (GetHandleId(hero) ), ( slot))) // INLINED!! -endfunction -function GetHeroLearnedSkillLevelEx takes integer sourceHandleId,integer slot returns integer - return LoadInteger(WoWReforgedHeroSkills___h2, sourceHandleId, slot) -endfunction -function GetHeroLearnedSkillLevel takes unit hero,integer slot returns integer - return (LoadInteger(WoWReforgedHeroSkills___h2, (GetHandleId(hero) ), ( slot))) // INLINED!! -endfunction -function IsCustomizableAttributesHero takes integer unitTypeId returns boolean - if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE ) then - return true - endif - if ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE ) then - return true - endif - if ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE ) then - return true - endif - if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE ) then - return true - endif - if ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE ) then - return true - endif - if ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE ) then - return true - endif - return false -endfunction -function IsUnitCustomizableAttributesHero takes unit hero returns boolean - return IsCustomizableAttributesHero(GetUnitTypeId(hero)) -endfunction -function IsReskillableHero takes integer unitTypeId returns boolean - if ( unitTypeId == EQUIPMENT_BAG ) then // Equipment Bag - return true - endif - if ( unitTypeId == 'N08V' ) then // Void Lord Range Strength - return true - endif - if ( unitTypeId == 'N06O' ) then // Void Lord Range Agility - return true - endif - if ( unitTypeId == 'N08U' ) then // Void Lord Range Intelligence - return true - endif - if ( unitTypeId == 'N09X' ) then // Void Lord Strength - return true - endif - if ( unitTypeId == 'N0AM' ) then // Void Lord Agility - return true - endif - if ( unitTypeId == 'N0AL' ) then // Void Lord Intelligence - return true - endif - if ( unitTypeId == 'H0A3' ) then // Archangel Strength - return true - endif - if ( unitTypeId == 'H0BN' ) then // Archangel Agility - return true - endif - if ( unitTypeId == 'H0BO' ) then // Archangel Intelligence - return true - endif - if ( unitTypeId == 'H0FB' ) then // Sea Giant Strength - return true - endif - if ( unitTypeId == 'H0F9' ) then // Sea Giant Agility - return true - endif - if ( unitTypeId == 'H0FA' ) then // Sea Giant Intelligence - return true - endif - return IsCustomizableAttributesHero(unitTypeId) -endfunction -function ApplyHeroLearnedSkillEx takes unit hero,integer sourceHandleId,integer slot,integer level returns boolean - local integer unitTypeId= GetUnitTypeId(hero) - local integer abilityId= (LoadInteger(WoWReforgedHeroSkills___h, (sourceHandleId ), ( slot))) // INLINED!! - local integer index= - 1 - //call BJDebugMsg("Restoring ability " + GetObjectName(abilityId) + " with level " + I2S(level) + " for slot " + I2S(slot)) - if ( abilityId != 0 ) then - if ( IsReskillableHero(unitTypeId) ) then - set index=GetLearnableSkillByAbilityId(abilityId) - if ( index != - 1 ) then - //call BJDebugMsg("Found and restoring it.") - call AddLearnableSkillToHero(hero , index) - call LearnHeroSkill(hero , abilityId , level) - //call BJDebugMsg("Restore ability " + GetObjectName(abilityId) + " to level " + I2S(level) + " at slot " + I2S(slot)) - - return true - else - //call BJDebugMsg("Add ability to reskillable abilities: " + GetObjectName(abilityId)) - - return false - endif - else - //set index = GetHeroAbilityIndex(unitTypeId, abilityId) - - //if (index != -1) then - call LearnHeroSkill(hero , abilityId , level) - - return true - //else - //call BJDebugMsg("Missing hero ability " + GetObjectName(abilityId) + " from hero type " + GetObjectName(unitTypeId)) - - //return false - //endif - endif - endif - - return false -endfunction -function ApplyHeroLearnedSkill takes unit hero,integer sourceHandleId,integer slot returns boolean - local integer level= (LoadInteger(WoWReforgedHeroSkills___h2, (sourceHandleId ), ( slot))) // INLINED!! - - return ApplyHeroLearnedSkillEx(hero , sourceHandleId , slot , level) -endfunction -function EnableLearnEvents takes nothing returns nothing - call EnableTrigger(WoWReforgedHeroSkills___learnTrigger) -endfunction -function DisableLearnEvents takes nothing returns nothing - call DisableTrigger(WoWReforgedHeroSkills___learnTrigger) -endfunction -function EnableUnlearnEvents takes nothing returns nothing - call EnableTrigger(WoWReforgedHeroSkills___unlearnTrigger) -endfunction -function DisableUnlearnEvents takes nothing returns nothing - call DisableTrigger(WoWReforgedHeroSkills___unlearnTrigger) -endfunction -function ApplyAllHeroLearnedSkills takes unit hero,integer sourceHandleId returns nothing - local integer i= 0 - call DisableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! - call UnskillHero(hero) - loop - exitwhen ( i == RESKILL_MAX_SLOTS ) - call ApplyHeroLearnedSkill(hero , sourceHandleId , i) - set i=i + 1 - endloop - call EnableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! -endfunction -function ApplyAllHeroLearnedSkillsMax takes unit hero,integer sourceHandleId returns nothing - local integer i= 0 - call DisableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! - call UnskillHero(hero) - loop - exitwhen ( i == RESKILL_MAX_SLOTS ) - call ApplyHeroLearnedSkillEx(hero , sourceHandleId , i , MAX_HERO_SPELL_LEVEL) - set i=i + 1 - endloop - call EnableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! -endfunction -function ResetHeroLearnedSkills takes integer sourceHandleId returns nothing - call FlushChildHashtable(WoWReforgedHeroSkills___h, sourceHandleId) - call FlushChildHashtable(WoWReforgedHeroSkills___h2, sourceHandleId) -endfunction -function SetHeroLearnedSkillAbilityId takes integer sourceHandleId,integer slot,integer abilityId returns nothing - call SaveInteger(WoWReforgedHeroSkills___h, sourceHandleId, slot, abilityId) -endfunction -function HasNoHeroAbilityWithCooldown takes unit hero returns boolean - local integer abilityId= 0 - local integer i= 0 - loop - exitwhen ( i == RESKILL_MAX_SLOTS ) - set abilityId=(LoadInteger(WoWReforgedHeroSkills___h, (GetHandleId((hero )) ), ( ( i)))) // INLINED!! - if ( abilityId != 0 and BlzGetUnitAbilityCooldownRemaining(hero, abilityId) > 0.0 ) then - return false - endif - set i=i + 1 - endloop - return true -endfunction -function RandomizeHeroSkill takes unit hero returns boolean - local integer unitTypeId= GetUnitTypeId(hero) - local integer index= - 1 - local integer i= 0 - if ( HasNoHeroAbilityWithCooldown(hero) ) then - call DisableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! - call UnskillHero(hero) - call ResetAllLearnableSkillsForHero(hero) - call RemoveAllLearnableSkillIconAbilities(hero) - set i=0 - loop - exitwhen ( i == RESKILL_MAX_SLOTS ) - set index=GetRandomLearnableSkillIndex(unitTypeId , i) - if ( index != - 1 ) then - call AddLearnableSkillToHero(hero , index) - call SaveInteger(WoWReforgedHeroSkills___h, (GetHandleId(hero) ), ( i ), ( (WoWReforgedLearnableSkills___learnableSkillAbilityId[(index)]))) // INLINED!! - endif - set i=i + 1 - endloop - call EnableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! - - if ( GetHeroLevel(hero) >= MAX_HERO_LEVEL ) then - call ApplyAllHeroLearnedSkillsMax(hero , GetHandleId(hero)) - else - call ApplyAllHeroLearnedSkills(hero , GetHandleId(hero)) - endif - return true - endif - - return false -endfunction -function WoWReforgedHeroSkills___TriggerActionLearn takes nothing returns nothing - local unit hero= GetTriggerUnit() - local integer skill= GetLearnedSkill() - local integer slot= BlzGetAbilityIntegerField(BlzGetUnitAbility(hero, skill), ABILITY_IF_BUTTON_POSITION_NORMAL_X) - local integer y= BlzGetAbilityIntegerField(BlzGetUnitAbility(hero, skill), ABILITY_IF_BUTTON_POSITION_NORMAL_Y) - if ( y < 2 ) then - set slot=4 - endif - call SaveInteger(WoWReforgedHeroSkills___h, GetHandleId(hero), slot, skill) - call SaveInteger(WoWReforgedHeroSkills___h2, GetHandleId(hero), slot, GetUnitAbilityLevel(hero, skill)) - //call BJDebugMsg("Learning ability " + GetObjectName(skill) + " with level " + I2S(GetUnitAbilityLevel(hero, skill)) + " for slot " + I2S(slot) + " with Y " + I2S(y)) - set hero=null -endfunction -function WoWReforgedHeroSkills___TriggerActionUnlearn takes nothing returns nothing - call ResetHeroLearnedSkills(GetHandleId((HeroUtils___unskilledHero))) // INLINED!! -endfunction -function WoWReforgedHeroSkills___TimerFunctionLearn takes nothing returns nothing - local timer t= GetExpiredTimer() - // TODO Save all hero skills - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function WoWReforgedHeroSkills___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroSkills___learnTrigger, EVENT_PLAYER_HERO_SKILL) - call TriggerAddAction(WoWReforgedHeroSkills___learnTrigger, function WoWReforgedHeroSkills___TriggerActionLearn) - - call TriggerRegisterHeroUnskillEvent(WoWReforgedHeroSkills___unlearnTrigger) - call TriggerAddAction(WoWReforgedHeroSkills___unlearnTrigger, function WoWReforgedHeroSkills___TriggerActionUnlearn) - - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedHeroSkills___TimerFunctionLearn) -endfunction -//library WoWReforgedHeroSkills ends -//library WoWReforgedHousing: -function GetPlayerHousing takes player whichPlayer returns integer - return WoWReforgedHousing__housings[GetPlayerId(whichPlayer)] -endfunction -function SetPlayerHousing takes nothing returns nothing - local integer h= (WoWReforgedHousing__housings[GetPlayerId((Player(WoWReforgedHousing__housingsCounter)))]) // INLINED!! - set s__Housing_r[h]=udg_TmpRect - set s__Housing_manager[h]=udg_TmpUnit - set WoWReforgedHousing__housingsCounter=WoWReforgedHousing__housingsCounter + 1 -endfunction -function GetHousingByCoordinates takes real x,real y returns integer - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( WoWReforgedHousing__housings[i] != 0 and RectContainsCoords(s__Housing_r[WoWReforgedHousing__housings[i]], x, y) ) then - return WoWReforgedHousing__housings[i] - endif - set i=i + 1 - endloop - return 0 -endfunction -function IsCoordinatesInHousing takes real x,real y returns boolean - return GetHousingByCoordinates(x , y) != 0 -endfunction -function IsUnitInHousing takes unit whichUnit returns boolean - return GetHousingByCoordinates(GetUnitX(whichUnit) , GetUnitY(whichUnit)) != 0 -endfunction -function WoWReforgedHousing__ReplaceWithTerrain takes rect whichRect,integer t returns nothing - local real x= GetRectMinX(whichRect) - local real y= 0.0 - local real maxX= GetRectMaxX(whichRect) - local real maxY= GetRectMaxY(whichRect) - loop - exitwhen ( x >= maxX ) - set y=GetRectMinY(whichRect) - loop - exitwhen ( y >= maxY ) - call SetTerrainType(x, y, t, GetTerrainVariance(x, y), 1, 0) - set y=y + bj_CELLWIDTH - endloop - set x=x + bj_CELLWIDTH - endloop -endfunction -function SetHousingTileset takes integer h,integer t returns nothing - call WoWReforgedHousing__ReplaceWithTerrain(s__Housing_r[h] , t) -endfunction -function LeaveHousing takes unit whichUnit returns nothing - local player owner= GetOwningPlayer(whichUnit) - call SetUnitPosition(whichUnit, GetMapNeutralZoneX(owner), GetMapNeutralZoneY(owner)) - call SetUnitFacing(whichUnit, GetMapNeutralZoneFacing(owner)) - set owner=null -endfunction -function EnterHousing takes unit whichUnit,player whichPlayer returns nothing - local integer h= (WoWReforgedHousing__housings[GetPlayerId((whichPlayer))]) // INLINED!! - if ( h != 0 ) then - call SetUnitPosition(whichUnit, GetRectCenterX(s__Housing_r[h]), GetRectCenterY(s__Housing_r[h])) - call SetUnitFacing(whichUnit, 270.0) - if ( GetOwningPlayer(whichUnit) == GetLocalPlayer() ) then - call PanCameraTo(GetUnitX(whichUnit), GetUnitY(whichUnit)) - endif - endif -endfunction -function WoWReforgedHousing__TriggerConditionSellItem takes nothing returns boolean - local player owner= GetOwningPlayer(GetBuyingUnit()) - if ( GetItemTypeId(GetSoldItem()) == ITEM_HOUSE_KEY ) then - if ( PlayerHasUnlocked(owner , ITEM_HOUSE_KEY) ) then - if ( (WoWReforgedHousing__housings[GetPlayerId((owner))]) != 0 ) then // INLINED!! - call SetItemInvulnerable(GetSoldItem(), true) - set s__Housing_available[(WoWReforgedHousing__housings[GetPlayerId((owner))])]=true // INLINED!! - else - call SimError(owner , "No housing available.") - call RefundItem(GetSoldItem() , owner) - endif - else - call SimError(owner , "Housings are restricted to certain accounts: " + GetAllUnlockedAccountNames(ITEM_HOUSE_KEY)) - call RefundItem(GetSoldItem() , owner) - endif - endif - set owner=null - return false -endfunction -function WoWReforgedHousing__TriggerConditionSellUnit takes nothing returns boolean - local unit u= GetSoldUnit() - local integer unitTypeId= GetUnitTypeId(u) - local player owner= GetOwningPlayer(GetBuyingUnit()) - if ( unitTypeId == LEAVE_HOUSING ) then - if ( IsUnitInHousing(GetBuyingUnit()) ) then - call LeaveHousing(GetBuyingUnit()) - else - call SimError(owner , "Not in housing.") - endif - call h__RemoveUnit(u) - elseif ( unitTypeId == GROUND_DIRT ) then - call WoWReforgedHousing__ReplaceWithTerrain(s__Housing_r[((WoWReforgedHousing__housings[GetPlayerId((owner))]) )] , ( 0)) // INLINED!! - call h__RemoveUnit(u) - elseif ( unitTypeId == GROUND_ROUGH_DIRT ) then - call WoWReforgedHousing__ReplaceWithTerrain(s__Housing_r[((WoWReforgedHousing__housings[GetPlayerId((owner))]) )] , ( 1)) // INLINED!! - call h__RemoveUnit(u) - endif - set owner=null - set u=null - return false -endfunction -function WoWReforgedHousing__TriggerConditionUseItem takes nothing returns boolean - if ( GetItemTypeId(GetManipulatedItem()) == ITEM_HOUSE_KEY ) then - if ( (WoWReforgedHousing__housings[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) != 0 ) then // INLINED!! - if ( IsUnitInHousing(GetTriggerUnit()) ) then - call LeaveHousing(GetTriggerUnit()) - else - call EnterHousing(GetTriggerUnit() , GetOwningPlayer(GetTriggerUnit())) - endif - else - call SimError(GetOwningPlayer(GetTriggerUnit()) , "No housing available.") - endif - endif - return false -endfunction -function WoWReforgedHousing__TriggerConditionChat takes nothing returns boolean - return false -endfunction -function WoWReforgedHousing__TriggerConditionCast takes nothing returns boolean - local integer abilityId= GetSpellAbilityId() - if ( abilityId == 'AEbl' and (GetHousingByCoordinates(((GetSpellTargetX() )*1.0) , (( GetSpellTargetY())*1.0)) != 0) ) then // INLINED!! - call IssueImmediateOrder(GetTriggerUnit(), "stop") - call SimError(GetOwningPlayer(GetTriggerUnit()) , "Cannot teleport into player housing.") - endif - return false -endfunction -function WoWReforgedHousing__Init takes nothing returns nothing - local player slotPlayer= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - set WoWReforgedHousing__housings[i]=s__Housing__allocate() - set s__Housing_p[WoWReforgedHousing__housings[i]]=slotPlayer - call TriggerRegisterPlayerChatEvent(WoWReforgedHousing__chatTrigger, slotPlayer, "-housing", true) - call TriggerRegisterPlayerChatEvent(WoWReforgedHousing__chatTrigger, slotPlayer, "-housingenter", false) - call TriggerRegisterPlayerChatEvent(WoWReforgedHousing__chatTrigger, slotPlayer, "-housingleave", false) - call TriggerRegisterPlayerChatEvent(WoWReforgedHousing__chatTrigger, slotPlayer, "-housinginvite", false) - set slotPlayer=null - set i=i + 1 - endloop - call TriggerAddCondition(WoWReforgedHousing__chatTrigger, Condition(function WoWReforgedHousing__TriggerConditionChat)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing__sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedHousing__sellItemTrigger, Condition(function WoWReforgedHousing__TriggerConditionSellItem)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing__useItemTrigger, EVENT_PLAYER_UNIT_USE_ITEM) - call TriggerAddCondition(WoWReforgedHousing__useItemTrigger, Condition(function WoWReforgedHousing__TriggerConditionUseItem)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing__sellUnitTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(WoWReforgedHousing__sellUnitTrigger, Condition(function WoWReforgedHousing__TriggerConditionSellUnit)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(WoWReforgedHousing__castTrigger, Condition(function WoWReforgedHousing__TriggerConditionCast)) -endfunction -//library WoWReforgedHousing ends -//library WoWReforgedMiner: -function GetRandomOreItemTypeId takes nothing returns integer - return WoWReforgedMiner__oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner__oreItemTypeIdsCounter - 1)] -endfunction -function IsOre takes integer itemTypeId returns boolean - local integer i= 0 - loop - exitwhen ( i == WoWReforgedMiner__oreItemTypeIdsCounter ) - if ( itemTypeId == WoWReforgedMiner__oreItemTypeIds[i] ) then - return true - endif - set i=i + 1 - endloop - return false -endfunction -function AddOreItemTypeId takes integer itemTypeId returns nothing - set WoWReforgedMiner__oreItemTypeIds[WoWReforgedMiner__oreItemTypeIdsCounter]=itemTypeId - set WoWReforgedMiner__oreItemTypeIdsCounter=WoWReforgedMiner__oreItemTypeIdsCounter + 1 -endfunction -function GetRandomGemItemTypeId takes nothing returns integer - return WoWReforgedMiner__gemItemTypeIds[GetRandomInt(0, WoWReforgedMiner__gemItemTypeIdsCounter - 1)] -endfunction -function IsGem takes integer itemTypeId returns boolean - local integer i= 0 - loop - exitwhen ( i == WoWReforgedMiner__gemItemTypeIdsCounter ) - if ( itemTypeId == WoWReforgedMiner__gemItemTypeIds[i] ) then - return true - endif - set i=i + 1 - endloop - return false -endfunction -function AddGemItemTypeId takes integer itemTypeId returns nothing - set WoWReforgedMiner__gemItemTypeIds[WoWReforgedMiner__gemItemTypeIdsCounter]=itemTypeId - set WoWReforgedMiner__gemItemTypeIdsCounter=WoWReforgedMiner__gemItemTypeIdsCounter + 1 -endfunction -function GetRandomMineralResource takes nothing returns integer - return WoWReforgedMiner__mineralResources[GetRandomInt(0, WoWReforgedMiner__mineralResourcesCounter - 1)] -endfunction -function AddMineralResource takes integer resource returns nothing - set WoWReforgedMiner__mineralResources[WoWReforgedMiner__mineralResourcesCounter]=resource - set WoWReforgedMiner__mineralResourcesCounter=WoWReforgedMiner__mineralResourcesCounter + 1 -endfunction -function AddMinerMine takes unit mine returns nothing - call AddMineEx(mine , (WoWReforgedMiner__mineralResources[GetRandomInt(0, WoWReforgedMiner__mineralResourcesCounter - 1)]) , GetRandomInt(200, 1500)) // INLINED!! -endfunction -function AddWorkerMiner takes unit worker returns nothing - local integer i= 0 - call AddWorker(worker) - loop - exitwhen ( i == WoWReforgedMiner__mineralResourcesCounter ) - call AddResourceToWorker(worker , WoWReforgedMiner__mineralResources[i] , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 200 , 20 , "gold") - set i=i + 1 - endloop -endfunction -function MinerPickup takes unit hero,item whichItem returns nothing - local integer itemTypeId= GetItemTypeId(whichItem) - if ( ( IsOre(itemTypeId) or IsGem(itemTypeId) ) and UnitHasItemOfTypeBJ(hero, ITEM_PICKAXE) ) then - call SetItemCharges(whichItem, IMaxBJ(1, GetItemCharges(whichItem)) + 1) - endif -endfunction -function InitMiner takes nothing returns nothing - call AddOreItemTypeId(ITEM_ROCKS) - call AddOreItemTypeId(ITEM_ORE_GOLD) - call AddOreItemTypeId(ITEM_ORE_IRON) - call AddOreItemTypeId(ITEM_ORE_SILVER) - - call AddGemItemTypeId(ITEM_GEM_AMBER) - call AddGemItemTypeId(ITEM_GEM_AMETHYST) - call AddGemItemTypeId(ITEM_GEM_AQUAMARINE) - call AddGemItemTypeId(ITEM_GEM_DIAMOND) - call AddGemItemTypeId(ITEM_GEM_EMERALD) - call AddGemItemTypeId(ITEM_GEM_JADE) - call AddGemItemTypeId(ITEM_GEM_MALACHITE) - call AddGemItemTypeId(ITEM_GEM_OPAL) - call AddGemItemTypeId(ITEM_GEM_RUBY) - call AddGemItemTypeId(ITEM_GEM_SAPPHIRE) - call AddGemItemTypeId(ITEM_GEM_TOPAZ) - call AddGemItemTypeId(ITEM_GEM_TURQUOISE) - - // do after initializing resources - call AddMineralResource(udg_ResourceSilver) - call AddMineralResource(udg_ResourceIron) - call AddMineralResource(udg_ResourceRock) - call AddMineralResource(udg_ResourceGemstones) -endfunction -//library WoWReforgedMiner ends -//library WoWReforgedNpcs: -function GetMaxNpcs takes nothing returns integer - return WoWReforgedNpcs__npcUnitTypeIdsCount -endfunction -function GetNpc takes integer index returns integer - return WoWReforgedNpcs__npcUnitTypeIds[index] -endfunction -function AddNpc takes integer unitTypeId returns integer - local integer index= WoWReforgedNpcs__npcUnitTypeIdsCount - set WoWReforgedNpcs__npcUnitTypeIds[index]=unitTypeId - set WoWReforgedNpcs__npcUnitTypeIdsCount=index + 1 - call SaveBoolean(ObjectDataFields___h, (unitTypeId ), ( OBJECT_DATA_FIELD_UCAM ), ( true)) // INLINED!! - //call AddUnitTypeCampaign() - return index -endfunction -function AddWoWReforgedNpc takes nothing returns nothing - call AddNpc(udg_TmpUnitType) -endfunction -function GetNpcIndexByUnitTypeId takes integer unitTypeId returns integer - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedNpcs__npcUnitTypeIdsCount ) - if ( WoWReforgedNpcs__npcUnitTypeIds[i] == unitTypeId ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function IsNpc takes integer unitTypeId returns boolean - return GetNpcIndexByUnitTypeId(unitTypeId) != - 1 -endfunction -function IsUnitNpc takes unit whichUnit returns boolean - return (GetNpcIndexByUnitTypeId((GetUnitTypeId(whichUnit))) != - 1) // INLINED!! -endfunction -function WoWReforgedNpcs__FilterIsUnitType takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == WoWReforgedNpcs__filterUnitTypeId -endfunction -function GetNpcUnitByUnitTypeId takes integer unitTypeId returns unit - local group g= CreateGroup() - local unit first= null - set WoWReforgedNpcs__filterUnitTypeId=unitTypeId - call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), Filter(function WoWReforgedNpcs__FilterIsUnitType)) - set first=FirstOfGroup(g) - call GroupClear(g) - call DestroyGroup(g) - set g=null - return first -endfunction -//library WoWReforgedNpcs ends -//library WoWReforgedPagedButtonsConfig: -function WoWReforgedPagedButtonsConfig___Init takes nothing returns nothing - call SetPagedButtonsConfigHeroCostsDefault(0 , 0) -endfunction -//library WoWReforgedPagedButtonsConfig ends -//library WoWReforgedProspector: -function IsGoldItem takes integer itemTypeId returns boolean - local integer i= 0 - loop - exitwhen ( i == WoWReforgedProspector__goldItemTypeIdsCounter ) - if ( itemTypeId == WoWReforgedProspector__goldItemTypeIds[i] ) then - return true - endif - set i=i + 1 - endloop - return false -endfunction -function AddGoldItemTypeId takes integer itemTypeId returns nothing - set WoWReforgedProspector__goldItemTypeIds[WoWReforgedProspector__goldItemTypeIdsCounter]=itemTypeId - set WoWReforgedProspector__goldItemTypeIdsCounter=WoWReforgedProspector__goldItemTypeIdsCounter + 1 -endfunction -function ProspectorPickup takes unit hero,item whichItem returns nothing - local integer itemTypeId= GetItemTypeId(whichItem) - if ( IsGoldItem(itemTypeId) and UnitHasItemOfTypeBJ(hero, ITEM_GOLD_DRILL) ) then - call SetItemCharges(whichItem, IMaxBJ(1, GetItemCharges(whichItem)) + 1) - endif -endfunction -function WoWReforgedProspector__Init takes nothing returns nothing - call AddGoldItemTypeId(ITEM_ORE_GOLD) - call AddGoldItemTypeId(ITEM_GOLD_BARS) - call AddGoldItemTypeId(ITEM_GOLD_COINS) -endfunction -//library WoWReforgedProspector ends -//library AStructCoreInterfaceThirdPersonCamera: - // key settings - // static construction members - // static members - // dynamic members - // construction members - // members - // dynamic members - function s__AThirdPersonCamera_setCamAoa takes integer this,real camAoa returns nothing - set s__AThirdPersonCamera_m_camAoa[this]=camAoa - endfunction - function s__AThirdPersonCamera_camAoa takes integer this returns real - return s__AThirdPersonCamera_m_camAoa[this] - endfunction - function s__AThirdPersonCamera_setCamRot takes integer this,real camRot returns nothing - set s__AThirdPersonCamera_m_camRot[this]=camRot - endfunction - function s__AThirdPersonCamera_camRot takes integer this returns real - return s__AThirdPersonCamera_m_camRot[this] - endfunction - // construction members - function s__AThirdPersonCamera_player takes integer this returns player - return s__AThirdPersonCamera_m_player[this] - endfunction - // members - function s__AThirdPersonCamera_unit takes integer this returns unit - return s__AThirdPersonCamera_m_unit[this] - endfunction - function s__AThirdPersonCamera_isEnabled takes integer this returns boolean - return s__AThirdPersonCamera_m_isEnabled[this] - endfunction - //methods - function s__AThirdPersonCamera_disable takes integer this returns nothing - if ( TimerGetRemaining(s__AThirdPersonCamera_m_firstPan[this]) > 0.0 ) then - call PauseTimer(s__AThirdPersonCamera_m_firstPan[this]) - endif - set s__AThirdPersonCamera_m_unit[this]=null - set s__AThirdPersonCamera_m_isEnabled[this]=false - endfunction - /// Functions for distance and offset. These are linear mathematical functions y = mx+t. - function s__AThirdPersonCamera_interpolateDistance takes real angleOfAttack returns real - if ( angleOfAttack <= s__AThirdPersonCamera_distanceAoaMax * bj_DEGTORAD ) then - return s__AThirdPersonCamera_distanceDistanceMax - elseif ( angleOfAttack >= s__AThirdPersonCamera_distanceAoaMin * bj_DEGTORAD ) then - return s__AThirdPersonCamera_distanceDistanceMin - endif - return s__AThirdPersonCamera_m_distanceM * angleOfAttack + s__AThirdPersonCamera_m_distanceT - endfunction - function s__AThirdPersonCamera_interpolateOffset takes real angleOfAttack returns real - if ( angleOfAttack <= s__AThirdPersonCamera_offsetAoaMax * bj_DEGTORAD ) then - return s__AThirdPersonCamera_offsetOffsetMax - elseif ( angleOfAttack >= s__AThirdPersonCamera_offsetAoaMin * bj_DEGTORAD ) then - return s__AThirdPersonCamera_offsetOffsetMin - endif - return s__AThirdPersonCamera_m_offsetM * angleOfAttack + s__AThirdPersonCamera_m_offsetT - endfunction - function s__AThirdPersonCamera_cappedReal takes real r,real lowBound,real highBound returns real - if r < lowBound then - return lowBound - elseif r > highBound then - return highBound - endif - return r - endfunction - - function s__AThirdPersonCamera_getActualUnit takes integer this returns unit - local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((s__AThirdPersonCamera_m_unit[this]))))]) // INLINED!! - if ( transporter != null ) then - return transporter - endif - return s__AThirdPersonCamera_m_unit[this] - endfunction - function s__AThirdPersonCamera_applyCam takes integer this,real duration returns nothing - local real aoa= GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) - 2 * bj_PI - local real offset= s__AThirdPersonCamera_interpolateOffset(aoa) - local real newaoa - local real maxd - local real tarz - local real newx - local real newy - local real newm - local real maxm= - 1 - local real r= s__AThirdPersonCamera_terrainSampling - local real dx - local real dy - if ( s__AThirdPersonCamera_m_useArrowKeys ) then - if ( s__AThirdPersonCamera_inverted ) then - set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_cappedReal(s__AThirdPersonCamera_m_camRot[this] + ( (s__AArrowKeys_m_horizontal[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) + (s__AArrowKeys_m_horizontalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) ) * s__AThirdPersonCamera_rotInterval , - s__AThirdPersonCamera_maxRot , s__AThirdPersonCamera_maxRot) // INLINED!! - else - set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_cappedReal(s__AThirdPersonCamera_m_camRot[this] - ( (s__AArrowKeys_m_horizontal[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) + (s__AArrowKeys_m_horizontalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) ) * s__AThirdPersonCamera_rotInterval , - s__AThirdPersonCamera_maxRot , s__AThirdPersonCamera_maxRot) // INLINED!! - endif - set s__AArrowKeys_m_horizontalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]=(0) // INLINED!! - set s__AThirdPersonCamera_m_camAoa[this]=s__AThirdPersonCamera_cappedReal(s__AThirdPersonCamera_m_camAoa[this] - ( (s__AArrowKeys_m_vertical[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) + (s__AArrowKeys_m_verticalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) ) * s__AThirdPersonCamera_aoaInterval , s__AThirdPersonCamera_minAoa , s__AThirdPersonCamera_maxAoa) // INLINED!! - set s__AArrowKeys_m_verticalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]=(0) // INLINED!! - endif - call SetCameraField(CAMERA_FIELD_ROTATION, GetUnitFacing(s__AThirdPersonCamera_getActualUnit(this)) + s__AThirdPersonCamera_m_camRot[this], duration) - call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, s__AThirdPersonCamera_fieldOfView, duration) - call SetCameraField(CAMERA_FIELD_FARZ, s__AThirdPersonCamera_farZ, duration) - call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, s__AThirdPersonCamera_interpolateDistance(aoa), duration) - call PanCameraToTimed(GetUnitX(s__AThirdPersonCamera_getActualUnit(this)) + offset * Cos(bj_DEGTORAD * GetUnitFacing(s__AThirdPersonCamera_getActualUnit(this))), GetUnitY(s__AThirdPersonCamera_getActualUnit(this)) + offset * Sin(bj_DEGTORAD * GetUnitFacing(s__AThirdPersonCamera_getActualUnit(this))), duration) - set newx=GetCameraTargetPositionX() - set newy=GetCameraTargetPositionY() - set maxd=s__AThirdPersonCamera_cliffDistance + GetCameraField(CAMERA_FIELD_TARGET_DISTANCE) - set dx=- Cos(GetCameraField(CAMERA_FIELD_ROTATION)) * r - set dy=- Sin(GetCameraField(CAMERA_FIELD_ROTATION)) * r - call MoveLocation(s__AThirdPersonCamera_m_location, newx, newy) - set tarz=GetCameraTargetPositionZ() - call SetCameraField(CAMERA_FIELD_ZOFFSET, GetCameraField(CAMERA_FIELD_ZOFFSET) + GetLocationZ(s__AThirdPersonCamera_m_location) + s__AThirdPersonCamera_zOffset + GetUnitFlyHeight(s__AThirdPersonCamera_getActualUnit(this)) - tarz, duration) - loop - exitwhen ( r > maxd ) - set newx=newx + dx - set newy=newy + dy - call MoveLocation(s__AThirdPersonCamera_m_location, newx, newy) - set newm=( GetLocationZ(s__AThirdPersonCamera_m_location) - tarz ) / r - if ( newm > maxm ) then - set maxm=newm - endif - set r=r + s__AThirdPersonCamera_terrainSampling - endloop - set newaoa=- Atan(maxm) * bj_RADTODEG - s__AThirdPersonCamera_angleAboveTerrain - if ( s__AThirdPersonCamera_m_camAoa[this] < newaoa ) then - set newaoa=s__AThirdPersonCamera_m_camAoa[this] - endif - call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, newaoa, duration) - endfunction - function s__AThirdPersonCamera_enable takes integer this,unit whichUnit,real firstPan returns nothing - if ( (s__AThirdPersonCamera_m_isEnabled[(this)]) ) then // INLINED!! - call s__AThirdPersonCamera_disable(this) - endif - set s__AThirdPersonCamera_m_unit[this]=whichUnit - set s__AThirdPersonCamera_m_isEnabled[this]=true - call TimerStart(s__AThirdPersonCamera_m_firstPan[this], firstPan, false, null) - if ( GetLocalPlayer() == s__AThirdPersonCamera_m_player[this] ) then - call StopCamera() - if ( whichUnit != null ) then - call s__AThirdPersonCamera_applyCam(this,firstPan) - endif - endif - endfunction - function s__AThirdPersonCamera_pause takes integer this returns nothing - call PauseTimer(s__AThirdPersonCamera_m_firstPan[this]) - set s__AThirdPersonCamera_m_isEnabled[this]=false - endfunction - function s__AThirdPersonCamera_resume takes integer this returns nothing - call ResumeTimer(s__AThirdPersonCamera_m_firstPan[this]) - set s__AThirdPersonCamera_m_isEnabled[this]=true - endfunction - function s__AThirdPersonCamera_resetCamAoa takes integer this returns nothing - set s__AThirdPersonCamera_m_camAoa[this]=s__AThirdPersonCamera_defaultAoa - endfunction - function s__AThirdPersonCamera_resetCamRot takes integer this returns nothing - set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_defaultRot - endfunction - function s__AThirdPersonCamera_create takes player usedPlayer returns integer - local integer this= s__AThirdPersonCamera__allocate() - // dynamic members - set s__AThirdPersonCamera_m_camAoa[this]=s__AThirdPersonCamera_defaultAoa - set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_defaultRot - // construction members - set s__AThirdPersonCamera_m_player[this]=usedPlayer - // members - set s__AThirdPersonCamera_m_unit[this]=null - set s__AThirdPersonCamera_m_isEnabled[this]=false - set s__AThirdPersonCamera_m_firstPan[this]=CreateTimer() - return this - endfunction - function s__AThirdPersonCamera_onDestroy takes integer this returns nothing - // construction members - set s__AThirdPersonCamera_m_player[this]=null - // members - set s__AThirdPersonCamera_m_unit[this]=null - call PauseTimer(s__AThirdPersonCamera_m_firstPan[this]) - call DestroyTimer(s__AThirdPersonCamera_m_firstPan[this]) - set s__AThirdPersonCamera_m_firstPan[this]=null - endfunction -//Generated destructor of AThirdPersonCamera -function s__AThirdPersonCamera_deallocate takes integer this returns nothing - if this==null then - return - elseif (si__AThirdPersonCamera_V[this]!=-1) then - return - endif - call s__AThirdPersonCamera_onDestroy(this) - set si__AThirdPersonCamera_V[this]=si__AThirdPersonCamera_F - set si__AThirdPersonCamera_F=this -endfunction - function s__AThirdPersonCamera_timerFunctionRefresh takes nothing returns nothing - local player localPlayer= GetLocalPlayer() - local integer playerId= GetPlayerId(localPlayer) - if ( s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId] != 0 and s__AThirdPersonCamera_m_isEnabled[s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId]] ) then - if ( TimerGetRemaining(s__AThirdPersonCamera_m_firstPan[s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId]]) <= s__AThirdPersonCamera_panDuration ) then - call s__AThirdPersonCamera_applyCam(s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId],s__AThirdPersonCamera_panDuration) - else - call s__AThirdPersonCamera_applyCam(s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId],TimerGetRemaining(s__AThirdPersonCamera_m_firstPan[s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId]])) - endif - endif - endfunction - function s__AThirdPersonCamera_init takes boolean useArrowKeys returns nothing - // static construction members - set s__AThirdPersonCamera_m_useArrowKeys=useArrowKeys - // static members - set s__AThirdPersonCamera_m_location=Location(0, 0) - set s__AThirdPersonCamera_m_distanceM=( s__AThirdPersonCamera_distanceDistanceMax - s__AThirdPersonCamera_distanceDistanceMin ) / ( ( s__AThirdPersonCamera_distanceAoaMax - s__AThirdPersonCamera_distanceAoaMin ) * bj_DEGTORAD ) - set s__AThirdPersonCamera_m_distanceT=s__AThirdPersonCamera_distanceDistanceMin - s__AThirdPersonCamera_distanceAoaMin * bj_DEGTORAD * s__AThirdPersonCamera_m_distanceM - set s__AThirdPersonCamera_m_offsetM=( s__AThirdPersonCamera_offsetOffsetMax - s__AThirdPersonCamera_offsetOffsetMin ) / ( ( s__AThirdPersonCamera_offsetAoaMax - s__AThirdPersonCamera_offsetAoaMin ) * bj_DEGTORAD ) - set s__AThirdPersonCamera_m_offsetT=s__AThirdPersonCamera_offsetOffsetMin - s__AThirdPersonCamera_offsetAoaMin * bj_DEGTORAD * s__AThirdPersonCamera_m_offsetM - set s__AThirdPersonCamera_m_timer=CreateTimer() - call TimerStart(s__AThirdPersonCamera_m_timer, s__AThirdPersonCamera_timeout, true, function s__AThirdPersonCamera_timerFunctionRefresh) - endfunction - function s__AThirdPersonCamera_cleanUp takes nothing returns nothing - call PauseTimer(s__AThirdPersonCamera_m_timer) - call RemoveLocation(s__AThirdPersonCamera_m_location) - set s__AThirdPersonCamera_m_location=null - call DestroyTimer(s__AThirdPersonCamera_m_timer) - set s__AThirdPersonCamera_m_timer=null - endfunction - function s__AThirdPersonCamera_playerThirdPersonCamera takes player user returns integer - if ( s__s__AThirdPersonCamera_m_playerThirdPersonCamera[GetPlayerId(user)] == 0 ) then - set s__s__AThirdPersonCamera_m_playerThirdPersonCamera[GetPlayerId(user)]= s__AThirdPersonCamera_create(user) - endif - return s__s__AThirdPersonCamera_m_playerThirdPersonCamera[GetPlayerId(user)] - endfunction - - function s__AThirdPersonCamera_timerHandleId takes nothing returns integer - return GetHandleId(s__AThirdPersonCamera_m_timer) - endfunction -//library AStructCoreInterfaceThirdPersonCamera ends -//library CameraUtils: -function SmartCameraPanToUnit takes player whichPlayer,unit target,real duration returns nothing - local real dist - local location cameraLoc= GetCameraTargetPositionLoc() - local real x= GetUnitX(target) - local real y= GetUnitY(target) - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - set dist=DistanceBetweenCoordinates(x , y , GetLocationX(cameraLoc) , GetLocationY(cameraLoc)) - if ( dist >= bj_SMARTPAN_TRESHOLD_SNAP ) then - // If the user is too far away, snap the camera. - call PanCameraToTimed(x, y, 0) - elseif ( dist >= bj_SMARTPAN_TRESHOLD_PAN ) then - // If the user is moderately close, pan the camera. - call PanCameraToTimed(x, y, duration) - else - // User is close enough, so don't touch the camera. - endif - endif - call RemoveLocation(cameraLoc) -endfunction -//library CameraUtils ends -//library CargoLocationSystem: -function GetUnitActualX takes unit whichUnit returns real - local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((whichUnit))))]) // INLINED!! - if ( transporter != null ) then - return GetUnitX(transporter) - endif - return GetUnitX(whichUnit) -endfunction -function GetUnitActualY takes unit whichUnit returns real - local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((whichUnit))))]) // INLINED!! - if ( transporter != null ) then - return GetUnitY(transporter) - endif - return GetUnitY(whichUnit) -endfunction -//library CargoLocationSystem ends -//library Crafting: -//processed: function interface CraftingRequirementCallback takes integer recipe, unit craftingUnit returns integer -function GetCraftingStockUpdateTimerHandleId takes nothing returns integer - return GetHandleId(Crafting___itemCraftingStockUpdateTimer) -endfunction -function Crafting___Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer - return ( ( Value1 * MaxValue2 ) + Value2 ) -endfunction -function GetRecipesMax takes nothing returns integer - return Crafting___recipesCounter -endfunction -function GetRecipeItemTypeId takes integer recipe returns integer - return Crafting___recipesItemTypeIds[recipe] -endfunction -function GetRecipeUIItemTypeId takes integer recipe returns integer - return Crafting___recipesUIItemTypeIds[recipe] -endfunction -function AddRecipe takes integer itemTypeId,integer uiItemTypeId returns integer - local integer index= Crafting___recipesCounter - set Crafting___recipesItemTypeIds[index]=itemTypeId - set Crafting___recipesUIItemTypeIds[index]=uiItemTypeId - set Crafting___recipesIsUnit[index]=false - set Crafting___recipesIsSpacer[index]=false - set Crafting___recipesPageName[index]="" - set Crafting___recipesMinRequirements[index]=0 - set Crafting___recipesRequirementCounters[index]=0 - set Crafting___recipesCounter=Crafting___recipesCounter + 1 - set Crafting___lastCreatedRecipe=index - return index -endfunction -function AddRecipeRequirementItem takes integer recipe,integer itemTypeId,integer charges,boolean consume returns integer - local integer counter= Crafting___recipesRequirementCounters[recipe] - local integer index= Crafting___Index2D(recipe , counter , Crafting_MAX_REQUIREMENTS) - set Crafting___recipesRequirementItemTypeIds[index]=itemTypeId - set Crafting___recipesRequirementCharges[index]=charges - set Crafting___recipesRequirementConsume[index]=consume - set Crafting___recipesRequirementCounters[recipe]=counter + 1 - set Crafting___recipesMinRequirements[recipe]=counter + 1 - return counter -endfunction -function SetRecipeIsUnit takes integer recipe,boolean flag returns nothing - set Crafting___recipesIsUnit[recipe]=flag -endfunction -function GetRecipeIsUnit takes integer recipe returns boolean - return Crafting___recipesIsUnit[recipe] -endfunction -function SetRecipeIsSpacer takes integer recipe,boolean flag returns nothing - set Crafting___recipesIsSpacer[recipe]=flag -endfunction -function GetRecipeIsSpacer takes integer recipe returns boolean - return Crafting___recipesIsSpacer[recipe] -endfunction -function AddRecipeSpacer takes string pageName returns integer - local integer recipe= AddRecipe(0 , 0) - set Crafting___recipesIsSpacer[(recipe )]=( true) // INLINED!! - set Crafting___recipesPageName[recipe]=pageName - return recipe -endfunction -function SetRecipePageName takes integer recipe,string pageName returns nothing - set Crafting___recipesPageName[recipe]=pageName -endfunction -function GetRecipeNotAvailableForPlayer takes integer recipe,integer playerId returns boolean - local integer index= Crafting___Index2D(recipe , playerId , bj_MAX_PLAYERS) - return Crafting___recipesNotAvailableForPlayer[index] -endfunction -function SetRecipeNotAvailableForPlayer takes integer recipe,integer playerId,boolean notAvailable returns nothing - local integer index= Crafting___Index2D(recipe , playerId , bj_MAX_PLAYERS) - set Crafting___recipesNotAvailableForPlayer[index]=notAvailable -endfunction -function GetRecipeAvailableForPlayer takes integer recipe,integer playerId returns boolean - local integer index= Crafting___Index2D(recipe , playerId , bj_MAX_PLAYERS) - return not Crafting___recipesNotAvailableForPlayer[index] -endfunction -function SetRecipeAvailableForPlayer takes integer recipe,integer playerId,boolean available returns nothing - local integer index= Crafting___Index2D(recipe , playerId , bj_MAX_PLAYERS) - set Crafting___recipesNotAvailableForPlayer[index]=not available -endfunction -function GetLastCreatedRecipe takes nothing returns integer - return Crafting___lastCreatedRecipe -endfunction -function SetLastRecipePageName takes string pageName returns nothing - set Crafting___recipesPageName[Crafting___lastCreatedRecipe]=pageName -endfunction -function GetRecipeRequirementsCount takes integer recipe returns integer - return Crafting___recipesRequirementCounters[recipe] -endfunction -function GetRecipeRequirementItemTypeId takes integer recipe,integer requirement returns integer - local integer index= Crafting___Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) - return Crafting___recipesRequirementItemTypeIds[index] -endfunction -function GetRecipeRequirementCharges takes integer recipe,integer requirement returns integer - local integer index= Crafting___Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) - return Crafting___recipesRequirementCharges[index] -endfunction -function GetRecipeRequirementConsume takes integer recipe,integer requirement returns boolean - local integer index= Crafting___Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) - return Crafting___recipesRequirementConsume[index] -endfunction -function GetRecipeMinRequirements takes integer recipe returns integer - return Crafting___recipesMinRequirements[recipe] -endfunction -function SetRecipeMinRequirements takes integer recipe,integer minRequirements returns nothing - set Crafting___recipesMinRequirements[recipe]=minRequirements -endfunction -function SetRecipeRequirementCallback takes integer callback returns nothing - set Crafting___recipeRequirementCallback=callback -endfunction -function SetRecipeRequirementCallbackTrigger takes trigger callback returns nothing - set Crafting___recipeRequirementCallbackTrigger=callback -endfunction -function SetRecipeShowCallbackTrigger takes trigger callback returns nothing - set Crafting___recipeShowCallbackTrigger=callback -endfunction -function TriggerRegisterItemCraftingEvent takes trigger whichTrigger returns integer - local integer counter= Crafting___craftingCallbackTriggersCounter - set Crafting___craftingCallbackTriggers[counter]=whichTrigger - set Crafting___craftingCallbackTriggersCounter=Crafting___craftingCallbackTriggersCounter + 1 - return counter -endfunction -function TriggerRegisterUnitCraftingEvent takes trigger whichTrigger returns integer - local integer counter= Crafting___craftingCallbackUnitTriggersCounter - set Crafting___craftingCallbackUnitTriggers[counter]=whichTrigger - set Crafting___craftingCallbackUnitTriggersCounter=Crafting___craftingCallbackUnitTriggersCounter + 1 - return counter -endfunction -function TriggerRegisterItemDisassembleEvent takes trigger whichTrigger returns integer - local integer counter= Crafting___disassembleCallbackTriggersCounter - set Crafting___disassembleCallbackTriggers[counter]=whichTrigger - set Crafting___disassembleCallbackTriggersCounter=Crafting___disassembleCallbackTriggersCounter + 1 - return counter -endfunction -function GetTriggerRecipe takes nothing returns integer - return Crafting___triggerRecipe -endfunction -function GetTriggerCraftingUnit takes nothing returns unit - return Crafting___triggerCraftingUnit -endfunction -function GetTriggerCraftedItem takes nothing returns item - return Crafting___triggerCraftedItem -endfunction -function GetTriggerCraftedUnit takes nothing returns unit - return Crafting___triggerCraftedUnit -endfunction -function GetTriggerCraftedCharges takes nothing returns integer - return Crafting___triggerCraftedCharges -endfunction -function Crafting___ExecuteCraftingCallbacks takes integer recipe,unit craftingUnit,item craftedItem returns nothing - local integer i= 0 - set Crafting___triggerRecipe=recipe - set Crafting___triggerCraftingUnit=craftingUnit - set Crafting___triggerCraftedItem=craftedItem - loop - exitwhen ( i == Crafting___craftingCallbackTriggersCounter ) - if ( IsTriggerEnabled(Crafting___craftingCallbackTriggers[i]) ) then - call ConditionalTriggerExecute(Crafting___craftingCallbackTriggers[i]) - endif - set i=i + 1 - endloop -endfunction -function Crafting___ExecuteCraftingCallbacksUnit takes integer recipe,unit craftingUnit,unit craftedUnit returns nothing - local integer i= 0 - set Crafting___triggerRecipe=recipe - set Crafting___triggerCraftingUnit=craftingUnit - set Crafting___triggerCraftedUnit=craftedUnit - loop - exitwhen ( i == Crafting___craftingCallbackUnitTriggersCounter ) - if ( IsTriggerEnabled(Crafting___craftingCallbackUnitTriggers[i]) ) then - call ConditionalTriggerExecute(Crafting___craftingCallbackUnitTriggers[i]) - endif - set i=i + 1 - endloop -endfunction -function Crafting___ExecuteDisassembleCallbacks takes integer recipe,unit craftingUnit,item craftedItem,unit craftedUnit returns nothing - local integer i= 0 - set Crafting___triggerRecipe=recipe - set Crafting___triggerCraftingUnit=craftingUnit - set Crafting___triggerCraftedItem=craftedItem - set Crafting___triggerCraftedUnit=craftedUnit - loop - exitwhen ( i == Crafting___disassembleCallbackTriggersCounter ) - if ( IsTriggerEnabled(Crafting___disassembleCallbackTriggers[i]) ) then - call ConditionalTriggerExecute(Crafting___disassembleCallbackTriggers[i]) - endif - set i=i + 1 - endloop -endfunction -function GetRecipeByItemTypeId takes integer itemTypeId returns integer - local integer counter= Crafting___recipesCounter - local integer recipe= 0 - loop - exitwhen ( recipe == counter ) - if ( Crafting___recipesItemTypeIds[recipe] == itemTypeId ) then - return recipe - endif - set recipe=recipe + 1 - endloop - return - 1 -endfunction -function Crafting___SetItemCraftingUnitGroup takes unit whichUnit,group whichGroup returns nothing - call SaveGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_GROUP, whichGroup) -endfunction -function Crafting___GetItemCraftingUnitGroup takes unit whichUnit returns group - return LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_GROUP) -endfunction -function IsItemCraftingRecipeEnabled takes unit whichUnit,integer recipe returns boolean - local integer counter= LoadInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES) - local integer disabledRecipe= 0 - local integer i= 0 - loop - exitwhen ( i >= counter ) - set disabledRecipe=LoadInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES + i) - if ( disabledRecipe == recipe ) then - return false - endif - set i=i + 1 - endloop - return true -endfunction -function GetRecipeName takes integer recipe returns string - return GetObjectName(Crafting___recipesUIItemTypeIds[recipe]) -endfunction -function Crafting___CheckRecipeRequirement takes integer recipe,integer requirement,unit whichUnit,integer craftedCharges returns integer - local integer index= Crafting___Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) - local integer requiredItemTypeId= Crafting___recipesRequirementItemTypeIds[index] - local integer requiredCharges= Crafting___recipesRequirementCharges[index] - local integer matchingCharges= 0 - local item slotItem= null - local integer i= 0 - local integer j= 0 - - if ( requiredItemTypeId != 0 ) then - //call BJDebugMsg("CheckRecipeRequirement for recipe " + GetRecipeName(recipe) + " with requirement item " + GetObjectName(requiredItemTypeId)) - - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(whichUnit, i) - if ( slotItem != null and GetItemTypeId(slotItem) == requiredItemTypeId ) then - // check the callback for each charge separately - set j=0 - loop - exitwhen ( j == IMaxBJ(GetItemCharges(slotItem), 1) ) - if ( Crafting___recipeRequirementCallbackTrigger != null ) then - set Crafting___triggerRecipe=recipe - set Crafting___triggerCraftingUnit=whichUnit - set Crafting___triggerCraftedItem=null - set Crafting___triggerCraftedCharges=craftedCharges + matchingCharges / requiredCharges - exitwhen ( not TriggerEvaluate(Crafting___recipeRequirementCallbackTrigger) ) - endif - set matchingCharges=matchingCharges + 1 - set j=j + 1 - endloop - - //call BJDebugMsg("CheckRecipeRequirement " + I2S(matchingCharges) + " for recipe " + GetRecipeName(recipe) + " with slot item " + GetItemName(slotItem)) - endif - set slotItem=null - set i=i + 1 - endloop - //call BJDebugMsg("Checking recipe requirement for recipe " + GetRecipeName(recipe) + " with item type " + GetObjectName(requiredItemTypeId) + " and found charges: " + I2S(matchingCharges) + " resulting in " + I2S( matchingCharges / recipesRequirementCharges[index])) - return matchingCharges / requiredCharges - endif - return 0 -endfunction -function Crafting___ConsumeRecipeRequirement takes integer recipe,integer requirement,integer charges,unit whichUnit returns integer - local integer index= Crafting___Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) - local integer requiredItemTypeId= Crafting___recipesRequirementItemTypeIds[index] - local integer matchingCharges= 0 - local integer reducedCharges= 0 - local item slotItem= null - local integer i= 0 - local group whichGroup= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - local integer j= 0 - local unit groupUnit= null - if ( requiredItemTypeId != 0 ) then - set j=0 - loop - exitwhen ( j >= BlzGroupGetSize(whichGroup) ) - set groupUnit=BlzGroupUnitAt(whichGroup, j) - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(groupUnit, i) - if ( slotItem != null and GetItemTypeId(slotItem) == requiredItemTypeId ) then - set reducedCharges=charges * Crafting___recipesRequirementCharges[index] - set matchingCharges=matchingCharges + reducedCharges - //call BJDebugMsg("Consuming " + I2S(reducedCharges) + " of item " + GetItemName(slotItem) + " from unit " + GetUnitName(groupUnit) + ".") - set reducedCharges=GetItemCharges(slotItem) - reducedCharges - if ( reducedCharges > 0 ) then - call SetItemCharges(slotItem, reducedCharges) - else - call h__RemoveItem(slotItem) - endif - endif - set i=i + 1 - endloop - set groupUnit=null - set j=j + 1 - endloop - endif - set whichGroup=null - return reducedCharges -endfunction -function Crafting___CheckRecipeRequirements takes integer recipe,unit whichUnit returns integer - local integer requirementCheckCounter= 0 - local integer result= 0 - local boolean initResult= false - local integer matchingRequirements= 0 - local integer minRequirements= Crafting___recipesMinRequirements[recipe] - local integer counter= Crafting___recipesRequirementCounters[recipe] - local integer i= 0 - local group whichGroup= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - local player owner= GetOwningPlayer(whichUnit) - local integer j= 0 - if ( Crafting___recipeRequirementCallback != 0 ) then - set result=sc___prototype356_evaluate(Crafting___recipeRequirementCallback,recipe , whichUnit) - endif - loop - exitwhen ( i >= counter or matchingRequirements >= minRequirements ) - set j=0 - loop - exitwhen ( j >= BlzGroupGetSize(whichGroup) or matchingRequirements >= minRequirements ) - set requirementCheckCounter=Crafting___CheckRecipeRequirement(recipe , i , BlzGroupUnitAt(whichGroup, j) , result) - if ( requirementCheckCounter > 0 ) then - // TODO What if there is yet another requirement which has more charges? - set matchingRequirements=matchingRequirements + 1 - if ( not initResult ) then // initially result is 0 - set result=requirementCheckCounter - else - set result=IMinBJ(result, requirementCheckCounter) - endif - - //call BJDebugMsg("Checking recipe requirement for recipe " + GetRecipeName(recipe) + " and found charges: " + I2S(requirementCheckCounter) + " resulting in requirements matching " + I2S(matchingRequirements)) - endif - //call BJDebugMsg("Result: " + I2S(result)) - set j=j + 1 - endloop - set i=i + 1 - endloop - set whichGroup=null - - // food check - if ( (Crafting___recipesIsUnit[(recipe)]) ) then // INLINED!! - set result=IMinBJ(( GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_CAP) - GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_USED) ) / GetFoodUsed(Crafting___recipesItemTypeIds[recipe]), result) - endif - - set owner=null - - // make sure that it matches at least the number of minimum requirements is reached - if ( matchingRequirements >= minRequirements ) then - return result - endif - - return 0 -endfunction -function Crafting___ConsumeRecipeRequirements takes integer recipe,integer charges,unit whichUnit returns integer - local integer result= 0 - local integer counter= Crafting___recipesRequirementCounters[recipe] - local integer matchingRequirements= 0 - local integer minRequirements= Crafting___recipesMinRequirements[recipe] - local integer consumedRequirements= 0 - local boolean consume= false - local integer i= 0 - loop - exitwhen ( i == counter or matchingRequirements >= minRequirements ) - set consume=GetRecipeRequirementConsume(recipe , i) - if ( consume ) then - set consumedRequirements=Crafting___ConsumeRecipeRequirement(recipe , i , charges , whichUnit) - set result=result + consumedRequirements - endif - if ( consumedRequirements > 0 or not consume ) then - set matchingRequirements=matchingRequirements + 1 - endif - set i=i + 1 - endloop - return result -endfunction -function GetRecipeByUIItemTypeId takes integer uIItemTypeId returns integer - local integer counter= Crafting___recipesCounter - local integer recipe= 0 - loop - exitwhen ( recipe == counter ) - if ( Crafting___recipesUIItemTypeIds[recipe] == uIItemTypeId ) then - return recipe - endif - set recipe=recipe + 1 - endloop - return - 1 -endfunction -function Crafting___CheckAllRecipesRequirementsForPageEx takes unit whichUnit,integer page returns integer - local integer result= 0 - local integer requirementCheckCounter= 0 - local integer startSlot= page * Crafting_MAX_SLOTS - local integer maxSlot= startSlot + Crafting_MAX_SLOTS - local integer slot= startSlot - local integer recipe= 0 - local group whichGroup= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - local integer j= 0 - local unit groupUnit= null - //call BJDebugMsg("Checking " + I2S(counter) + " recipes for unit " + GetUnitName(whichUnit) + " at page " + I2S(page) + " with " + I2S(recipesPerPage) + " recipes per page.") - loop - exitwhen ( slot >= maxSlot ) - if ( not (sg__PagedButtons_Type_get_whichType(GetPagedButton((whichUnit ) , ( slot))) == PagedButtons_BUTTON_TYPE_SPACER) ) then // INLINED!! - set recipe=GetRecipeByUIItemTypeId(GetPagedButtonId(whichUnit , slot)) - if ( recipe != - 1 ) then - set requirementCheckCounter=Crafting___CheckRecipeRequirements(recipe , whichUnit) - //call BJDebugMsg("Get requirement counter " + I2S(requirementCheckCounter) + " and group size " + I2S(BlzGroupGetSize(whichGroup))) - set j=0 - loop - exitwhen ( j >= BlzGroupGetSize(whichGroup) ) - set groupUnit=BlzGroupUnitAt(whichGroup, j) - if ( IsItemCraftingRecipeEnabled(groupUnit , recipe) ) then - //call BJDebugMsg("Item crafting is enabled." ) - if ( requirementCheckCounter > 0 ) then - set result=result + 1 - - //call BJDebugMsg("Adding UI item type " + GetObjectName(recipesUIItemTypeIds[recipe]) + " to unit " + GetUnitName(groupUnit)) - call RemoveItemFromStock(groupUnit, Crafting___recipesUIItemTypeIds[recipe]) - //call BJDebugMsg("Crafted item: " + GetObjectName(recipesUIItemTypeIds[recipe]) + " with stock " + I2S(requirementCheckCounter)) - // Even although this is 2 it becomes like 1 or something by the paged buttons system? - call AddItemToStock(groupUnit, Crafting___recipesUIItemTypeIds[recipe], requirementCheckCounter, requirementCheckCounter) - else - //call BJDebugMsg("Removing UI item type " + GetObjectName(recipesUIItemTypeIds[recipe]) + " from unit " + GetUnitName(groupUnit)) - call RemoveItemFromStock(groupUnit, Crafting___recipesUIItemTypeIds[recipe]) - call AddItemToStock(groupUnit, Crafting___recipesUIItemTypeIds[recipe], 0, 1) - endif - //else - //call BJDebugMsg("Item crafting is disabled." ) - else - call SimError(GetOwningPlayer(whichUnit) , "Recipe " + (GetObjectName(Crafting___recipesUIItemTypeIds[(recipe)])) + " is disabled.") // INLINED!! - endif - set groupUnit=null - set j=j + 1 - endloop - endif - endif - set slot=slot + 1 - endloop - set whichGroup=null - return result -endfunction -function Crafting___CheckAllRecipesRequirementsForPageNewOpLimit takes nothing returns nothing - call Crafting___CheckAllRecipesRequirementsForPageEx(Crafting___tmpUnit , Crafting___tmpInteger0) -endfunction -function Crafting___CheckAllRecipesRequirementsForPage takes unit whichUnit,integer page returns nothing - set Crafting___tmpUnit=whichUnit - set Crafting___tmpInteger0=page - call ForForce(bj_FORCE_PLAYER[0], (function Crafting___CheckAllRecipesRequirementsForPageNewOpLimit)) // INLINED!! -endfunction -function Crafting___UpdateStocks takes unit whichUnit returns nothing - call Crafting___CheckAllRecipesRequirementsForPage(whichUnit , GetPagedButtonsPage(whichUnit)) -endfunction -function Crafting___ClearItemCraftingUnit takes unit whichUnit returns nothing - local group whichGroup= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - if ( whichGroup != null ) then - call GroupRemoveUnit(whichGroup, whichUnit) - if ( BlzGroupGetSize(whichGroup) == 0 ) then - call GroupClear(whichGroup) - call DestroyGroup(whichGroup) - endif - set whichGroup=null - endif - call FlushChildHashtable(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit)) -endfunction -function SetItemCraftingRecipeEnabled takes unit whichUnit,integer recipe,boolean enabled returns nothing - local integer page= GetPagedButtonsPage(whichUnit) - local integer counter= LoadInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES) - local integer disabledRecipe= 0 - local boolean found= false - local integer i= 0 - if ( enabled ) then - loop - exitwhen ( i >= counter ) - set disabledRecipe=LoadInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES + i) - if ( found == true ) then - call SaveInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES + i - 1, disabledRecipe) - endif - if ( disabledRecipe == recipe ) then - set found=true - endif - set i=i + 1 - endloop - if ( found ) then - call SaveInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES, counter - 1) - endif - else - loop - exitwhen ( i >= counter ) - set disabledRecipe=LoadInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES + i) - if ( disabledRecipe == recipe ) then - set found=true - endif - set i=i + 1 - endloop - if ( not found ) then - call SaveInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES + counter, recipe) - call SaveInteger(Crafting___itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting___HASHTABLE_KEY_DISABLED_RECIPES, counter + 1) - endif - endif - call Crafting___CheckAllRecipesRequirementsForPage(whichUnit , page) -endfunction -function CraftItem takes item soldItem,unit sellingUnit,unit buyingUnit returns item - local integer page= GetPagedButtonsPage(sellingUnit) - local integer soldItemTypeId= GetItemTypeId(soldItem) - local player owner= GetOwningPlayer(sellingUnit) - local player ownerBuying= GetOwningPlayer(buyingUnit) - local integer playerIdBuying= GetPlayerId(ownerBuying) - local integer charges= 0 - local integer chargesWithFoodLimit= 0 - local integer availableFood= 0 - local item craftedItem= null - local unit craftedUnit= null - local item array additionalCraftedItems - local integer additionalCraftedItemsCounter= 0 - local integer counter= Crafting___recipesCounter - local integer j= 0 - local integer recipe= 0 - loop - exitwhen ( recipe >= counter and craftedItem != null ) - if ( not (Crafting___recipesIsSpacer[(recipe)]) and Crafting___recipesUIItemTypeIds[recipe] == soldItemTypeId ) then // INLINED!! - if ( GetRecipeAvailableForPlayer(recipe , playerIdBuying) ) then - set charges=Crafting___CheckRecipeRequirements(recipe , sellingUnit) - if ( charges > 0 ) then - call h__RemoveItem(soldItem) - set soldItem=null - - if ( (Crafting___recipesIsUnit[(recipe)]) ) then // INLINED!! - set availableFood=GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_CAP) - GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_USED) - set chargesWithFoodLimit=availableFood / GetFoodUsed(Crafting___recipesItemTypeIds[recipe]) - set chargesWithFoodLimit=IMinBJ(chargesWithFoodLimit, charges) - if ( chargesWithFoodLimit > 0 ) then - if ( chargesWithFoodLimit < charges ) then - call SimError(owner , "Can only summon " + I2S(chargesWithFoodLimit) + " creatures due to food limit.") - endif - - set j=0 - loop - exitwhen ( j >= chargesWithFoodLimit ) - set craftedUnit=CreateUnit(owner, Crafting___recipesItemTypeIds[recipe], GetUnitX(sellingUnit), GetUnitY(sellingUnit), GetUnitFacing(sellingUnit)) - call Crafting___ExecuteCraftingCallbacksUnit(recipe , sellingUnit , craftedUnit) - set j=j + 1 - endloop - call Crafting___ConsumeRecipeRequirements(recipe , chargesWithFoodLimit , sellingUnit) - else - call SimError(owner , "Not enough food to summon any creature.") - endif - else - set craftedItem=CreateItem(Crafting___recipesItemTypeIds[recipe], GetUnitX(sellingUnit), GetUnitY(sellingUnit)) - - if ( GetItemCharges(craftedItem) > 0 ) then - call SetItemCharges(craftedItem, charges) - call Crafting___ExecuteCraftingCallbacks(recipe , sellingUnit , craftedItem) - // create non charged items separately - else - call Crafting___ExecuteCraftingCallbacks(recipe , sellingUnit , craftedItem) - - set j=1 - loop - exitwhen ( j >= charges ) - set craftedItem=CreateItem(Crafting___recipesItemTypeIds[recipe], GetUnitX(sellingUnit), GetUnitY(sellingUnit)) - call Crafting___ExecuteCraftingCallbacks(recipe , sellingUnit , craftedItem) - set additionalCraftedItems[additionalCraftedItemsCounter]=craftedItem - set additionalCraftedItemsCounter=additionalCraftedItemsCounter + 1 - set j=j + 1 - endloop - endif - - call Crafting___ConsumeRecipeRequirements(recipe , charges , sellingUnit) - - // add item after callbacks since it might lead to stacking and the crafted item may become null - // call ite also after consuming requirements since the inventory might have more slots now - call UnitAddItem(sellingUnit, craftedItem) - set j=0 - loop - exitwhen ( j >= additionalCraftedItemsCounter ) - call UnitAddItem(sellingUnit, additionalCraftedItems[j]) // TODO Drops the item next to the crafting unit. - set j=j + 1 - endloop - - endif - endif - else - call SimError(ownerBuying , "Recipe is not available for you.") - endif - endif - set recipe=recipe + 1 - endloop - call Crafting___CheckAllRecipesRequirementsForPage(sellingUnit , page) // update all stocks but after crafting something we might need some delay to update stocks. - set owner=null - set ownerBuying=null - return craftedItem -endfunction -function Crafting___ForGroupUpdateStocks takes nothing returns nothing - call Crafting___UpdateStocks(GetEnumUnit()) -endfunction -function Crafting___UpdateAllStocks takes nothing returns nothing - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) -endfunction -function Crafting___TimerFunctionUpdateItemCraftingStocks takes nothing returns nothing - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) // INLINED!! -endfunction -function Crafting___ShowRecipeForUnit takes integer recipe,unit whichUnit returns boolean - if ( Crafting___recipeShowCallbackTrigger != null and IsTriggerEnabled(Crafting___recipeShowCallbackTrigger) ) then - set Crafting___triggerRecipe=recipe - set Crafting___triggerCraftingUnit=whichUnit - return TriggerEvaluate(Crafting___recipeShowCallbackTrigger) - endif - return true -endfunction -function EnableItemCraftingUnit takes unit whichUnit returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(whichUnit)) - local integer i= 0 - local integer index= 0 - local group whichGroup= CreateGroup() - call GroupAddUnit(whichGroup, whichUnit) - call GroupAddUnit(Crafting___itemCraftingUnits, whichUnit) - call SaveGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit )), Crafting___HASHTABLE_KEY_GROUP, ( whichGroup)) // INLINED!! - //call BJDebugMsg("Enable crafting for unit " + GetUnitName(whichUnit)) - call EnablePagedButtons(whichUnit) - call SetPagedButtonsSlotsPerPage(whichUnit , Crafting_MAX_SLOTS) - set i=0 - loop - exitwhen ( i == Crafting___recipesCounter ) - //call BJDebugMsg("Recipe " + I2S(i) + ": " + GetObjectName(recipesUIItemTypeIds[i])) - if ( GetRecipeAvailableForPlayer(i , playerId) and Crafting___ShowRecipeForUnit(i , whichUnit) ) then - if ( Crafting___recipesIsSpacer[i] ) then - call SetPagedButtonsCurrentPageName(whichUnit , Crafting___recipesPageName[i]) - call AddPagedButtonsSpacersRemaining(whichUnit) - else - if ( Crafting___recipesPageName[i] != null and StringLength(Crafting___recipesPageName[i]) > 0 ) then - call SetPagedButtonsCurrentPageName(whichUnit , Crafting___recipesPageName[i]) - endif - set index=(AddPagedButtonsId((whichUnit ) , ( Crafting___recipesUIItemTypeIds[i]) , PagedButtons_BUTTON_TYPE_ITEM)) // INLINED!! - call sg__PagedButtons_SlotType_set_replenish((GetPagedButton(whichUnit , index)),false) // prevents auto replenish - endif - endif - set i=i + 1 - endloop - //call CheckAllRecipesRequirementsForPage(whichUnit, 0, PagedButtonsSystem_SLOTS_PER_PAGE) - if ( BlzGroupGetSize(Crafting___itemCraftingUnits) == 1 ) then - // This timer is required since we can only set the maximum time to 3600 seconds. - call TimerStart(Crafting___itemCraftingStockUpdateTimer, Crafting_UPDATE_INTERVAL, true, function Crafting___TimerFunctionUpdateItemCraftingStocks) - endif -endfunction -function DisableItemCraftingUnit takes unit whichUnit returns nothing - call GroupRemoveUnit(Crafting___itemCraftingUnits, whichUnit) - call DisablePagedButtons(whichUnit) - call Crafting___ClearItemCraftingUnit(whichUnit) - if ( BlzGroupGetSize(Crafting___itemCraftingUnits) == 0 ) then - call PauseTimer(Crafting___itemCraftingStockUpdateTimer) - endif -endfunction -function IsItemCraftingUnitEnabled takes unit whichUnit returns boolean - return IsUnitInGroup(whichUnit, Crafting___itemCraftingUnits) -endfunction -function LinkItemCraftingUnitInventories takes unit whichUnit0,unit whichUnit1 returns group - local group whichGroup0= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit0)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - local group whichGroup1= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit1)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - local integer i= 0 - if ( whichGroup0 == null ) then - set whichGroup0=CreateGroup() - call GroupAddUnit(whichGroup0, whichUnit0) - endif - if ( whichGroup1 == null ) then - set whichGroup1=CreateGroup() - call GroupAddUnit(whichGroup1, whichUnit1) - endif - if ( whichGroup0 != null and whichGroup1 != null ) then - call GroupAddGroup(whichGroup1, whichGroup0) - set i=0 - loop - exitwhen ( i == BlzGroupGetSize(whichGroup0) ) - call SaveGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((BlzGroupUnitAt(whichGroup0, i) )), Crafting___HASHTABLE_KEY_GROUP, ( whichGroup0)) // INLINED!! - set i=i + 1 - endloop - call GroupClear(whichGroup1) - call DestroyGroup(whichGroup1) - set whichGroup1=null - endif - - call Crafting___UpdateStocks(whichUnit0) - call Crafting___UpdateStocks(whichUnit1) - return whichGroup0 -endfunction -function LinkItemCraftingGroupInventories takes group source returns group - local unit first= FirstOfGroup(source) - local integer i= 1 - if ( first != null ) then - loop - exitwhen ( i == BlzGroupGetSize(source) ) - call LinkItemCraftingUnitInventories(BlzGroupUnitAt(source, i) , first) - set i=i + 1 - endloop - set first=null - return (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((first)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - endif - return null -endfunction -function UnlinkItemCraftingUnitInventories takes unit whichUnit0,unit whichUnit1 returns group - local group whichGroup0= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit0)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - local group whichGroup1= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit1)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - if ( whichGroup0 != null ) then - call GroupRemoveUnit(whichGroup0, whichUnit1) - endif - if ( whichGroup1 != null and IsUnitInGroup(whichUnit1, whichGroup1) ) then - call GroupRemoveUnit(whichGroup1, whichUnit1) - if ( BlzGroupGetSize(whichGroup1) == 0 ) then - call GroupClear(whichGroup1) - call DestroyGroup(whichGroup1) - set whichGroup1=null - endif - endif - set whichGroup1=CreateGroup() - call GroupAddUnit(whichGroup1, whichUnit1) - call SaveGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit1 )), Crafting___HASHTABLE_KEY_GROUP, ( whichGroup1)) // INLINED!! - - call Crafting___UpdateStocks(whichUnit0) - call Crafting___UpdateStocks(whichUnit1) - return whichGroup1 -endfunction -function ItemCraftingUnitInventoriesAreLinked takes unit whichUnit0,unit whichUnit1 returns boolean - local group whichGroup0= (LoadGroupHandle(Crafting___itemCraftingUnitsHashTable, GetHandleId((whichUnit0)), Crafting___HASHTABLE_KEY_GROUP)) // INLINED!! - return IsUnitInGroup(whichUnit1, whichGroup0) -endfunction -function Crafting___TriggerConditionIsItemCraftingUnitEnabled takes nothing returns boolean - return (IsUnitInGroup((GetTriggerUnit()), Crafting___itemCraftingUnits)) // INLINED!! -endfunction -function Crafting___TriggerActionCheckAllRecipesRequirements takes nothing returns nothing - //call BJDebugMsg("Crafter " + GetUnitName(GetTriggerUnit()) + " picks up or drops an item.") - call Crafting___UpdateStocks(GetTriggerUnit()) -endfunction -function Crafting___TriggerActionCheckAllRecipesRequirementsDelayed takes nothing returns nothing - //call BJDebugMsg("Crafter " + GetUnitName(GetTriggerUnit()) + " picks up or drops an item.") - local unit triggerUnit= GetTriggerUnit() - call TriggerSleepAction(0.0) // wait until item has been dropped - call Crafting___UpdateStocks(triggerUnit) - set triggerUnit=null -endfunction -function Crafting___TriggerActionCraftItem takes nothing returns nothing - local unit shop= GetSellingUnit() - call CraftItem(GetSoldItem() , shop , GetBuyingUnit()) - call TriggerSleepAction(0.0) // wait until we can refresh the stock - call Crafting___UpdateStocks(shop) - set shop=null -endfunction -function Crafting___TriggerConditionDisassemble takes nothing returns boolean - return GetSpellAbilityId() == Crafting_DISASSEMBLE_ABILITY_ID -endfunction -function DisassembleItem takes item soldItem,unit sellingUnit returns integer - local integer recipe= GetRecipeByItemTypeId(GetItemTypeId(soldItem)) - local integer i= 0 - local integer max= 0 - local integer count= IMaxBJ(GetItemCharges(soldItem), 1) - local integer charges= 0 - local item requirement= null - local integer minRequirements= 0 - local integer result= 0 - - if ( recipe != - 1 ) then - call Crafting___ExecuteDisassembleCallbacks(recipe , sellingUnit , soldItem , null) - call h__RemoveItem(soldItem) - set soldItem=null - set i=0 - set max=(Crafting___recipesRequirementCounters[(recipe)]) // INLINED!! - set minRequirements=(Crafting___recipesMinRequirements[(recipe)]) // INLINED!! - loop - exitwhen ( i == max or ( minRequirements > 0 and i > minRequirements ) ) - set requirement=CreateItem(GetRecipeRequirementItemTypeId(recipe , i), GetUnitX(sellingUnit), GetUnitY(sellingUnit)) - set charges=GetRecipeRequirementCharges(recipe , i) * count - if ( GetItemCharges(requirement) > 0 or charges > 1 ) then - call SetItemCharges(requirement, charges) - endif - call UnitAddItem(sellingUnit, requirement) - set result=result + charges - set i=i + 1 - endloop - endif - - return result -endfunction -function DisassembleUnit takes unit target,unit sellingUnit returns integer - local integer recipe= GetRecipeByItemTypeId(GetUnitTypeId(target)) - local integer i= 0 - local integer max= 0 - local integer count= 1 - local integer charges= 0 - local item requirement= null - local integer minRequirements= 0 - local integer result= 0 - - if ( recipe != - 1 ) then - call Crafting___ExecuteDisassembleCallbacks(recipe , sellingUnit , null , target) - call h__RemoveUnit(target) - set target=null - set i=0 - set max=(Crafting___recipesRequirementCounters[(recipe)]) // INLINED!! - set minRequirements=(Crafting___recipesMinRequirements[(recipe)]) // INLINED!! - loop - exitwhen ( i == max or ( minRequirements > 0 and i > minRequirements ) ) - set requirement=CreateItem(GetRecipeRequirementItemTypeId(recipe , i), GetUnitX(sellingUnit), GetUnitY(sellingUnit)) - set charges=GetRecipeRequirementCharges(recipe , i) * count - if ( GetItemCharges(requirement) > 0 or charges > 1 ) then - call SetItemCharges(requirement, charges) - endif - call UnitAddItem(sellingUnit, requirement) - set result=result + charges - set i=i + 1 - endloop - endif - - return result -endfunction -function Crafting___TriggerActionDisassembleItem takes nothing returns nothing - local unit sellingUnit= GetTriggerUnit() - local unit target= GetSpellTargetUnit() - local item targetItem= GetSpellTargetItem() - local item slotItem= null - local integer counter= 0 - local integer i= 0 - if ( target != null ) then - if ( (IsUnitInGroup((target), Crafting___itemCraftingUnits)) and GetOwningPlayer(sellingUnit) == GetOwningPlayer(target) ) then // INLINED!! - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(sellingUnit, i) - if ( slotItem != null ) then - set counter=counter + DisassembleItem(slotItem , sellingUnit) - endif - set slotItem=null - set i=i + 1 - endloop - if ( counter == 0 ) then - call SimError(GetOwningPlayer(sellingUnit) , "No items to disassemble.") - endif - else - set counter=DisassembleUnit(target , sellingUnit) - if ( counter == 0 ) then - call SimError(GetOwningPlayer(sellingUnit) , "Unit can not be disassembled.") - endif - endif - elseif ( targetItem != null ) then - set counter=DisassembleItem(targetItem , sellingUnit) - if ( counter == 0 ) then - call SimError(GetOwningPlayer(sellingUnit) , "Item cannot be disassembled.") - endif - endif - set sellingUnit=null - set target=null - set targetItem=null -endfunction -function Crafting___TriggerConditionChangePage takes nothing returns boolean - return (IsUnitInGroup(((PagedButtons___triggerShop)), Crafting___itemCraftingUnits)) // INLINED!! -endfunction -function Crafting___TriggerActionChangePage takes nothing returns nothing - call Crafting___UpdateStocks((PagedButtons___triggerShop)) // INLINED!! -endfunction -function Crafting___TriggerConditionTrainStart takes nothing returns boolean - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) // INLINED!! - return false -endfunction - -function Crafting___TriggerConditionTrainCancel takes nothing returns boolean - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) // INLINED!! - return false -endfunction - -function Crafting___TriggerConditionReviveStart takes nothing returns boolean - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) // INLINED!! - return false -endfunction - -function Crafting___TriggerConditionReviveCancel takes nothing returns boolean - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) // INLINED!! - return false -endfunction - -function Crafting___TriggerConditionSell takes nothing returns boolean - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) // INLINED!! - return false -endfunction - -function Crafting___TriggerConditionDeath takes nothing returns boolean - call ForGroup(Crafting___itemCraftingUnits, function Crafting___ForGroupUpdateStocks) // INLINED!! - return false -endfunction -function Crafting___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Crafting___pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) - call TriggerAddCondition(Crafting___pickupTrigger, Condition(function Crafting___TriggerConditionIsItemCraftingUnitEnabled)) - call TriggerAddAction(Crafting___pickupTrigger, function Crafting___TriggerActionCheckAllRecipesRequirements) - - call TriggerRegisterAnyUnitEventBJ(Crafting___dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddCondition(Crafting___dropTrigger, Condition(function Crafting___TriggerConditionIsItemCraftingUnitEnabled)) - call TriggerAddAction(Crafting___dropTrigger, function Crafting___TriggerActionCheckAllRecipesRequirementsDelayed) - call TriggerRegisterAnyUnitEventBJ(Crafting___itemCraftTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(Crafting___itemCraftTrigger, Condition(function Crafting___TriggerConditionIsItemCraftingUnitEnabled)) - call TriggerAddAction(Crafting___itemCraftTrigger, function Crafting___TriggerActionCraftItem) - - call TriggerRegisterAnyUnitEventBJ(Crafting___itemDisassembleTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(Crafting___itemDisassembleTrigger, Condition(function Crafting___TriggerConditionDisassemble)) - call TriggerAddAction(Crafting___itemDisassembleTrigger, function Crafting___TriggerActionDisassembleItem) - call TriggerRegisterChangePagedButtons(Crafting___itemCraftingChangePageTrigger) - call TriggerAddCondition(Crafting___itemCraftingChangePageTrigger, Condition(function Crafting___TriggerConditionChangePage)) - call TriggerAddAction(Crafting___itemCraftingChangePageTrigger, function Crafting___TriggerActionChangePage) - - // update food available - call TriggerRegisterAnyUnitEventBJ(Crafting___trainStartTrigger, EVENT_PLAYER_UNIT_TRAIN_START) - call TriggerAddCondition(Crafting___trainStartTrigger, Condition(function Crafting___TriggerConditionTrainStart)) - - call TriggerRegisterAnyUnitEventBJ(Crafting___trainCancelTrigger, EVENT_PLAYER_UNIT_TRAIN_CANCEL) - call TriggerAddCondition(Crafting___trainCancelTrigger, Condition(function Crafting___TriggerConditionTrainCancel)) - - call TriggerRegisterAnyUnitEventBJ(Crafting___reviveStartTrigger, EVENT_PLAYER_HERO_REVIVE_START) - call TriggerAddCondition(Crafting___reviveStartTrigger, Condition(function Crafting___TriggerConditionReviveStart)) - - call TriggerRegisterAnyUnitEventBJ(Crafting___reviveCancelTrigger, EVENT_PLAYER_HERO_REVIVE_CANCEL) - call TriggerAddCondition(Crafting___reviveCancelTrigger, Condition(function Crafting___TriggerConditionReviveCancel)) - - call TriggerRegisterAnyUnitEventBJ(Crafting___sellTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(Crafting___sellTrigger, Condition(function Crafting___TriggerConditionSell)) - - call TriggerRegisterAnyUnitEventBJ(Crafting___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(Crafting___deathTrigger, Condition(function Crafting___TriggerConditionDeath)) -endfunction -//library Crafting ends -//library CriticalStrike: - - // CriticalStrike implements an easy way to register and detect a custom critical event. - // allows the manipulation of a unit critical strike chance and multiplier, as well as - // manipulating the critical damage dealt. - // It works by monitoring custom critical strike chance and multiplier values given to units. - // It will only detect custom critical strikes, so all critical chance given to a - // unit must be done so using the public API provided by this system. - // *CriticalStrike requires DamageInterface. Do not use TriggerSleepAction() with Evasion. - // It also requires optional Evasion so that this library is written after the Evasion - // library, so both custom events will not fire at the same time. - // The API: - // function RegisterCriticalStrikeEvent(function YourFunction) - // -> YourFunction will run when a unit hits a critical strike. - // function GetCriticalSource takes nothing returns unit - // -> Returns the unit hitting a critical strike. - - // function GetCriticalTarget takes nothing returns unit - // -> Returns the unit being hit by a critical strike. - - // function GetCriticalDamage takes nothing returns real - // -> Returns the critical strike damage amount. - - // function GetUnitCriticalChance takes unit u returns real - // -> Returns the chance to hit a critical strike to specified unit. - - // function GetUnitCriticalMultiplier takes unit u returns real - // -> Returns the chance to hit a critical strike to specified unit. - - // function SetUnitCriticalChance takes unit u, real value returns nothing - // -> Set's the unit chance to hit a critical strike to specified value. - // -> 15.0 = 15% - - // function SetUnitCriticalMultiplier takes unit u, real value returns nothing - // -> Set's the unit multiplier of damage when hitting a critical to value - // -> 1.0 = increases the multiplier by 1. all units have a multiplier of 1.0 - // by default, so by adding 1.0, for example, the critical damage will be - // 2x the normal damage - // function SetCriticalEventDamage takes real newValue returns nothing - // -> Modify the critical damage dealt to the specified value. - - // function UnitAddCriticalStrike takes unit u, real chance, real multiplier returns nothing - // -> Adds the specified values of chance and multiplier to a unit - - - - - function s__Critical_getChance takes unit u returns real - return s__Critical_chance[GetUnitUserData(u)] - endfunction - function s__Critical_getMultiplier takes unit u returns real - return s__Critical_multiplier[GetUnitUserData(u)] - endfunction - function s__Critical_setChance takes unit u,real value returns nothing - set s__Critical_chance[GetUnitUserData(u)]=value - endfunction - function s__Critical_setMultiplier takes unit u,real value returns nothing - set s__Critical_multiplier[GetUnitUserData(u)]=value - endfunction - function s__Critical_add takes unit u,real chance,real multuplier returns nothing - set s__Critical_chance[GetUnitUserData((u ))]=(( (s__Critical_chance[GetUnitUserData((u))]) + chance)*1.0) // INLINED!! - set s__Critical_multiplier[GetUnitUserData((u ))]=(( (s__Critical_multiplier[GetUnitUserData((u))]) + multuplier)*1.0) // INLINED!! - endfunction - function s__Critical_text takes unit whichUnit,string text,real duration,integer red,integer green,integer blue,integer alpha returns nothing - local texttag tx= CreateTextTag() - - call h__SetTextTagText(tx, text, s__Critical_TEXT_SIZE) - call SetTextTagPosUnit(tx, whichUnit, 0) - call SetTextTagColor(tx, red, green, blue, alpha) - call SetTextTagLifespan(tx, duration) - call SetTextTagVelocity(tx, 0.0, 0.0355) - call h__SetTextTagPermanent(tx, false) - - set tx=null - endfunction - function s__Critical_onDamage takes nothing returns nothing - local real amount= GetEventDamage() - - if amount > 0 and GetRandomReal(0, 100) <= s__Critical_chance[s__Unit_id[s__Damage_source]] and s__Damage_isEnemy and not s__Unit_isStructure[s__Damage_target] and s__Critical_multiplier[s__Unit_id[s__Damage_source]] > 0 then - set s__Critical_source=s__Damage_source - set s__Critical_target=s__Damage_target - set s__Critical_damage=amount * ( 1 + s__Critical_multiplier[s__Unit_id[s__Damage_source]] ) - call TriggerEvaluate(s__Critical_trigger) - call BlzSetEventDamage(s__Critical_damage) - if s__Critical_damage > 0 then - call s__Critical_text(s__Unit_unit[s__Critical_target] , ( I2S(R2I(s__Critical_damage)) + "!" ) , 1.5 , 255 , 0 , 0 , 255) - endif - set s__Critical_damage=0 - set s__Critical_source=0 - set s__Critical_target=0 - endif - endfunction - function s__Critical_register takes code c returns nothing - call TriggerAddCondition(s__Critical_trigger, Filter(c)) - endfunction - function s__Critical_onInit takes nothing returns nothing - call s__Damage_register(null , DAMAGE_TYPE_NORMAL , (function s__Critical_onDamage) , true) // INLINED!! - endfunction - - - - - function RegisterCriticalStrikeEvent takes code c returns nothing - call TriggerAddCondition(s__Critical_trigger, Filter((c))) // INLINED!! - endfunction - function GetCriticalSource takes nothing returns unit - return s__Unit_unit[s__Critical_source] - endfunction - function GetCriticalTarget takes nothing returns unit - return s__Unit_unit[s__Critical_target] - endfunction - function GetCriticalDamage takes nothing returns real - return s__Critical_damage - endfunction - function GetUnitCriticalChance takes unit u returns real - return (s__Critical_chance[GetUnitUserData((u))]) // INLINED!! - endfunction - function GetUnitCriticalMultiplier takes unit u returns real - return (s__Critical_multiplier[GetUnitUserData((u))]) // INLINED!! - endfunction - function SetUnitCriticalChance takes unit u,real value returns nothing - set s__Critical_chance[GetUnitUserData((u ))]=(( value)*1.0) // INLINED!! - endfunction - function SetUnitCriticalMultiplier takes unit u,real value returns nothing - set s__Critical_multiplier[GetUnitUserData((u ))]=(( value)*1.0) // INLINED!! - endfunction - function SetCriticalEventDamage takes real newValue returns nothing - set s__Critical_damage=newValue - endfunction - function UnitAddCriticalStrike takes unit u,real chance,real multiplier returns nothing - call s__Critical_add(u , chance , multiplier) - endfunction -//library CriticalStrike ends -//library CrowdControl: - - // How to Import: - // 1 - Copy the Utilities library over to your map and follow its install instructions - // 2 - Copy the WorldBounds library over to your map and follow its install instructions - // 3 - Copy the Indexer library over to your map and follow its install instructions - // 4 - Copy the TimerUtils library over to your map and follow its install instructions - // 5 - Copy the RegisterPlayerUnitEvent library over to your map and follow its install instructions - // 6 - Copy the Tenacity library over to your map and follow its install instructions - // 7 - Copy this library into your map - // 8 - Copy the 14 buffs and 15 abilities with the CC prefix and match their raw code below. - - - - - - - - - function DisarmUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_disarm(target , duration , model , point , stack) - endfunction - function IsUnitDisarmed takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__DISARM_BUFF) > 0) // INLINED!! - endfunction - - function FearUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_fear(target , duration , model , point , stack) - endfunction - function IsUnitFeared takes unit target returns boolean - return sc__CrowdControl_feared(target) - endfunction - - function TauntUnit takes unit source,unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_taunt(source , target , duration , model , point , stack) - endfunction - function IsUnitTaunted takes unit target returns boolean - return sc__CrowdControl_taunted(target) - endfunction - - function KnockbackUnit takes unit target,real angle,real distance,real duration,string model,string point,boolean onCliff,boolean onDestructable,boolean onUnit,boolean stack returns nothing - call sc__CrowdControl_knockback(target , angle , distance , duration , model , point , onCliff , onDestructable , onUnit , stack) - endfunction - - function IsUnitKnockedBack takes unit target returns boolean - return sc__CrowdControl_knockedback(target) - endfunction - - function KnockupUnit takes unit target,real maxHeight,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_knockup(target , maxHeight , duration , model , point , stack) - endfunction - function IsUnitKnockedUp takes unit target returns boolean - return sc__CrowdControl_knockedup(target) - endfunction - - function SilenceUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_silence(target , duration , model , point , stack) - endfunction - function IsUnitSilenced takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__SILENCE_BUFF) > 0) // INLINED!! - endfunction - - function StunUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_stun(target , duration , model , point , stack) - endfunction - function IsUnitStunned takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__STUN_BUFF) > 0) // INLINED!! - endfunction - - function SlowUnit takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_slow(target , amount , duration , model , point , stack) - endfunction - function IsUnitSlowed takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__MOVEMENT_SLOW_BUFF) > 0) // INLINED!! - endfunction - - function SlowUnitAttack takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_slowAttack(target , amount , duration , model , point , stack) - endfunction - function IsUnitAttackSlowed takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__ATTACK_SLOW_BUFF) > 0) // INLINED!! - endfunction - - function BanishUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_banish(target , duration , model , point , stack) - endfunction - function IsUnitBanished takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__BANISH_BUFF) > 0) // INLINED!! - endfunction - - function EnsnareUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_ensnare(target , duration , model , point , stack) - endfunction - function IsUnitEnsnared takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__ENSNARE_BUFF) > 0) // INLINED!! - endfunction - - function PurgeUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_purge(target , duration , model , point , stack) - endfunction - function IsUnitPurged takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__PURGE_BUFF) > 0) // INLINED!! - endfunction - - function HexUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_hex(target , duration , model , point , stack) - endfunction - function IsUnitHexed takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__HEX_BUFF) > 0) // INLINED!! - endfunction - - function SleepUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_sleep(target , duration , model , point , stack) - endfunction - function IsUnitSleeping takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__SLEEP_BUFF) > 0) // INLINED!! - endfunction - - function CycloneUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_cyclone(target , duration , model , point , stack) - endfunction - function IsUnitCycloned takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__CYCLONE_BUFF) > 0) // INLINED!! - endfunction - - function EntangleUnit takes unit target,real duration,string model,string point,boolean stack returns nothing - call sc__CrowdControl_entangle(target , duration , model , point , stack) - endfunction - function IsUnitEntangled takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__ENTANGLE_BUFF) > 0) // INLINED!! - endfunction - - function UnitDispelCrowdControl takes unit target,integer id returns nothing - call sc__CrowdControl_dispel(target , id) - endfunction - function UnitDispelAllCrowdControl takes unit target returns nothing - call sc__CrowdControl_dispelAll(target) - endfunction - - function RegisterCrowdControlEvent takes integer id,code c returns nothing - call sc__CrowdControl_register(id , c) - endfunction - function RegisterAnyCrowdControlEvent takes code c returns nothing - call sc__CrowdControl_register(- 1 , c) - endfunction - function GetCrowdControlUnit takes nothing returns unit - return s__CrowdControl_unit[s__CrowdControl_key] - endfunction - function GetCrowdControlType takes nothing returns integer - return s__CrowdControl_type[s__CrowdControl_key] - endfunction - function GetCrowdControlDuration takes nothing returns real - return s__CrowdControl_duration[s__CrowdControl_key] - endfunction - function GetCrowdControlAmount takes nothing returns real - return s__CrowdControl_amount[s__CrowdControl_key] - endfunction - function GetCrowdControlModel takes nothing returns string - return s__CrowdControl_model[s__CrowdControl_key] - endfunction - function GetCrowdControlBone takes nothing returns string - return s__CrowdControl_point[s__CrowdControl_key] - endfunction - function GetCrowdControlStack takes nothing returns boolean - return s__CrowdControl_stack[s__CrowdControl_key] - endfunction - function GetCrowdControlRemaining takes unit target,integer id returns real - return (TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId((target )), ( id)))) // INLINED!! - endfunction - function GetTauntSource takes nothing returns unit - return s__CrowdControl_source[s__CrowdControl_key] - endfunction - function GetKnockbackAngle takes nothing returns real - return s__CrowdControl_angle[s__CrowdControl_key] - endfunction - function GetKnockbackDistance takes nothing returns real - return s__CrowdControl_distance[s__CrowdControl_key] - endfunction - function GetKnockupHeight takes nothing returns real - return s__CrowdControl_height[s__CrowdControl_key] - endfunction - function GetKnockbackOnCliff takes nothing returns boolean - return s__CrowdControl_cliff[s__CrowdControl_key] - endfunction - function GetKnockbackOnDestructable takes nothing returns boolean - return s__CrowdControl_destructable[s__CrowdControl_key] - endfunction - function GetKnockbackOnUnit takes nothing returns boolean - return s__CrowdControl_agent[s__CrowdControl_key] - endfunction - function SetCrowdControlUnit takes unit u returns nothing - set s__CrowdControl_unit[s__CrowdControl_key]=u - endfunction - function SetCrowdControlType takes integer id returns nothing - if id >= CROWD_CONTROL_SILENCE and id <= CROWD_CONTROL_KNOCKUP then - set s__CrowdControl_type[s__CrowdControl_key]=id - endif - endfunction - function SetCrowdControlDuration takes real duration returns nothing - set s__CrowdControl_duration[s__CrowdControl_key]=duration - endfunction - function SetCrowdControlAmount takes real amount returns nothing - set s__CrowdControl_amount[s__CrowdControl_key]=amount - endfunction - function SetCrowdControlModel takes string model returns nothing - set s__CrowdControl_model[s__CrowdControl_key]=model - endfunction - function SetCrowdControlBone takes string point returns nothing - set s__CrowdControl_point[s__CrowdControl_key]=point - endfunction - function SetCrowdControlStack takes boolean stack returns nothing - set s__CrowdControl_stack[s__CrowdControl_key]=stack - endfunction - function SetTauntSource takes unit u returns nothing - set s__CrowdControl_source[s__CrowdControl_key]=u - endfunction - function SetKnockbackAngle takes real angle returns nothing - set s__CrowdControl_angle[s__CrowdControl_key]=angle - endfunction - function SetKnockbackDistance takes real distance returns nothing - set s__CrowdControl_distance[s__CrowdControl_key]=distance - endfunction - function SetKnockupHeight takes real height returns nothing - set s__CrowdControl_height[s__CrowdControl_key]=height - endfunction - function SetKnockbackOnCliff takes boolean onCliff returns nothing - set s__CrowdControl_cliff[s__CrowdControl_key]=onCliff - endfunction - function SetKnockbackOnDestructable takes boolean onDestructable returns nothing - set s__CrowdControl_destructable[s__CrowdControl_key]=onDestructable - endfunction - function SetKnockbackOnUnit takes boolean onUnit returns nothing - set s__CrowdControl_agent[s__CrowdControl_key]=onUnit - endfunction - - - - - - - function s__CrowdControl__Knockback_remove takes integer this,integer i returns integer - call DestroyGroup(s__CrowdControl__Knockback_group[this]) - call DestroyEffect(s__CrowdControl__Knockback_effect[this]) - call BlzPauseUnitEx(s__CrowdControl__Knockback_unit[this], false) - set s__CrowdControl__Knockback_unit[this]=null - set s__CrowdControl__Knockback_group[this]=null - set s__CrowdControl__Knockback_effect[this]=null - set s__CrowdControl__Knockback_struct[s__CrowdControl__Knockback_id[this]]=0 - set s__CrowdControl__Knockback_array[i]=s__CrowdControl__Knockback_array[s__CrowdControl__Knockback_key] - set s__CrowdControl__Knockback_key=s__CrowdControl__Knockback_key - 1 - call s__CrowdControl__Knockback_deallocate(this) - if s__CrowdControl__Knockback_key == - 1 then - call PauseTimer(s__CrowdControl__Knockback_timer) - endif - return i - 1 - endfunction - function s__CrowdControl__Knockback_onDestructable takes nothing returns nothing - local integer this= s__CrowdControl__Knockback_temp - if GetDestructableLife(GetEnumDestructable()) > 0 then - set s__CrowdControl__Knockback_duration[this]=0 - return - endif - endfunction - function s__CrowdControl__Knockback_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - local real x - local real y - local unit u - loop - exitwhen i > s__CrowdControl__Knockback_key - set this=s__CrowdControl__Knockback_array[i] - if s__CrowdControl__Knockback_duration[this] > 0 and UnitAlive(s__CrowdControl__Knockback_unit[this]) then - set s__CrowdControl__Knockback_duration[this]=s__CrowdControl__Knockback_duration[this] - s__CrowdControl__Knockback_period - set x=GetUnitX(s__CrowdControl__Knockback_unit[this]) + s__CrowdControl__Knockback_offset[this] * Cos(s__CrowdControl__Knockback_angle[this]) - set y=GetUnitY(s__CrowdControl__Knockback_unit[this]) + s__CrowdControl__Knockback_offset[this] * Sin(s__CrowdControl__Knockback_angle[this]) - - if s__CrowdControl__Knockback_onUnit[this] and s__CrowdControl__Knockback_collision[this] > 0 then - call GroupEnumUnitsInRange(s__CrowdControl__Knockback_group[this], x, y, s__CrowdControl__Knockback_collision[this], null) - call GroupRemoveUnit(s__CrowdControl__Knockback_group[this], s__CrowdControl__Knockback_unit[this]) - loop - set u=FirstOfGroup(s__CrowdControl__Knockback_group[this]) - exitwhen u == null - if UnitAlive(u) then - set s__CrowdControl__Knockback_duration[this]=0 - set u=null - exitwhen true - endif - call GroupRemoveUnit(s__CrowdControl__Knockback_group[this], u) - endloop - endif - if s__CrowdControl__Knockback_onDest[this] and s__CrowdControl__Knockback_duration[this] > 0 and s__CrowdControl__Knockback_collision[this] > 0 then - set s__CrowdControl__Knockback_temp=this - call SetRect(s__CrowdControl__Knockback_rect, x - s__CrowdControl__Knockback_collision[this], y - s__CrowdControl__Knockback_collision[this], x + s__CrowdControl__Knockback_collision[this], y + s__CrowdControl__Knockback_collision[this]) - call EnumDestructablesInRect(s__CrowdControl__Knockback_rect, null, function s__CrowdControl__Knockback_onDestructable) - endif - if s__CrowdControl__Knockback_onCliff[this] and s__CrowdControl__Knockback_duration[this] > 0 then - if GetTerrainCliffLevel(GetUnitX(s__CrowdControl__Knockback_unit[this]), GetUnitY(s__CrowdControl__Knockback_unit[this])) < GetTerrainCliffLevel(x, y) and GetUnitZ(s__CrowdControl__Knockback_unit[this]) < ( GetTerrainCliffLevel(x, y) - GetTerrainCliffLevel(s__WorldBounds_maxX, s__WorldBounds_maxY) ) * bj_CLIFFHEIGHT then - set s__CrowdControl__Knockback_duration[this]=0 - endif - endif - if s__CrowdControl__Knockback_duration[this] > 0 then - call SetUnitX(s__CrowdControl__Knockback_unit[this], x) - call SetUnitY(s__CrowdControl__Knockback_unit[this], y) - endif - else - set i=s__CrowdControl__Knockback_remove(this,i) - endif - set i=i + 1 - endloop - endfunction - function s__CrowdControl__Knockback_knocked takes unit u returns boolean - return s__CrowdControl__Knockback_struct[GetUnitUserData(u)] != 0 - endfunction - - function s__CrowdControl__Knockback_apply takes unit target,real angle,real distance,real duration,string model,string point,boolean onCliff,boolean onDestructable,boolean onUnit returns nothing - local integer id= GetUnitUserData(target) - local integer this - if duration > 0 and UnitAlive(target) then - if s__CrowdControl__Knockback_struct[id] != 0 then - set this=s__CrowdControl__Knockback_struct[id] - else - set this=s__CrowdControl__Knockback__allocate() - set s__CrowdControl__Knockback_id[this]=id - set s__CrowdControl__Knockback_unit[this]=target - set s__CrowdControl__Knockback_collision[this]=2 * BlzGetUnitCollisionSize(target) - set s__CrowdControl__Knockback_group[this]=CreateGroup() - set s__CrowdControl__Knockback_key=s__CrowdControl__Knockback_key + 1 - set s__CrowdControl__Knockback_array[s__CrowdControl__Knockback_key]=this - set s__CrowdControl__Knockback_struct[id]=this - call BlzPauseUnitEx(target, true) - if model != null and point != null then - set s__CrowdControl__Knockback_effect[this]=AddSpecialEffectTarget(model, target, point) - endif - if s__CrowdControl__Knockback_key == 0 then - call TimerStart(s__CrowdControl__Knockback_timer, s__CrowdControl__Knockback_period, true, function s__CrowdControl__Knockback_onPeriod) - endif - endif - set s__CrowdControl__Knockback_angle[this]=angle - set s__CrowdControl__Knockback_distance[this]=distance - set s__CrowdControl__Knockback_duration[this]=duration - set s__CrowdControl__Knockback_onCliff[this]=onCliff - set s__CrowdControl__Knockback_onDest[this]=onDestructable - set s__CrowdControl__Knockback_onUnit[this]=onUnit - set s__CrowdControl__Knockback_offset[this]=RMaxBJ(0.00000001, distance * s__CrowdControl__Knockback_period / RMaxBJ(0.00000001, duration)) - endif - endfunction - - function s__Knockup_isUnitKnocked takes unit u returns boolean - return s__Knockup_knocked[GetUnitUserData(u)] > 0 - endfunction - function s__Knockup_onPeriod takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! - if s__Knockup_up[this] then - set s__Knockup_up[this]=false - call SetUnitFlyHeight(s__Knockup_unit[this], GetUnitDefaultFlyHeight(s__Knockup_unit[this]), s__Knockup_rate[this]) - call TimerStart(s__Knockup_timer[this], s__Knockup_airTime[this] / 2, false, function s__Knockup_onPeriod) - else - call DestroyEffect(s__Knockup_effect[this]) - call ReleaseTimer(s__Knockup_timer[this]) - call s__Knockup_deallocate(this) - set s__Knockup_knocked[s__Knockup_key[this]]=s__Knockup_knocked[s__Knockup_key[this]] - 1 - if s__Knockup_knocked[s__Knockup_key[this]] == 0 then - call BlzPauseUnitEx(s__Knockup_unit[this], false) - endif - set s__Knockup_timer[this]=null - set s__Knockup_unit[this]=null - set s__Knockup_effect[this]=null - endif - endfunction - function s__Knockup_apply takes unit whichUnit,real airTime,real maxHeight,string model,string point returns nothing - local integer this - if airTime > 0 then - set this=s__Knockup__allocate() - set s__Knockup_timer[this]=NewTimerEx(this) - set s__Knockup_unit[this]=whichUnit - set s__Knockup_rate[this]=maxHeight / airTime - set s__Knockup_airTime[this]=airTime - set s__Knockup_up[this]=true - set s__Knockup_key[this]=GetUnitUserData(s__Knockup_unit[this]) - set s__Knockup_knocked[s__Knockup_key[this]]=s__Knockup_knocked[s__Knockup_key[this]] + 1 - if model != null and point != null then - set s__Knockup_effect[this]=AddSpecialEffectTarget(model, s__Knockup_unit[this], point) - endif - if s__Knockup_knocked[s__Knockup_key[this]] == 1 then - call BlzPauseUnitEx(whichUnit, true) - endif - call UnitAddAbility(s__Knockup_unit[this], 'Amrf') - call UnitRemoveAbility(s__Knockup_unit[this], 'Amrf') - call SetUnitFlyHeight(s__Knockup_unit[this], ( GetUnitDefaultFlyHeight(s__Knockup_unit[this]) + maxHeight ), s__Knockup_rate[this]) - call TimerStart(s__Knockup_timer[this], airTime / 2, false, function s__Knockup_onPeriod) - endif - endfunction - - function s__Fear_feared takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__FEAR_BUFF) > 0 - endfunction - function s__Fear_remove takes integer this,integer i returns integer - set s__Fear_flag[s__Fear_id[this]]=true - call IssueImmediateOrder(s__Fear_unit[this], "stop") - call DestroyEffect(s__Fear_effect[this]) - set s__Fear_struct[s__Fear_id[this]]=0 - set s__Fear_unit[this]=null - set s__Fear_effect[this]=null - set s__Fear_array[i]=s__Fear_array[s__Fear_key] - set s__Fear_key=s__Fear_key - 1 - call s__Fear_deallocate(this) - if s__Fear_key == - 1 then - call PauseTimer(s__Fear_timer) - endif - return i - 1 - endfunction - function s__Fear_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - loop - exitwhen i > s__Fear_key - set this=s__Fear_array[i] - if GetUnitAbilityLevel(s__Fear_unit[this], CrowdControl__FEAR_BUFF) > 0 then - set s__Fear_change[this]=s__Fear_change[this] + 1 - if s__Fear_change[this] >= s__Fear_DIRECTION_CHANGE then - set s__Fear_change[this]=0 - set s__Fear_flag[s__Fear_id[this]]=true - set s__Fear_x[s__Fear_id[this]]=GetRandomReal(GetUnitX(s__Fear_unit[this]) - s__Fear_MAX_CHANGE, GetUnitX(s__Fear_unit[this]) + s__Fear_MAX_CHANGE) - set s__Fear_y[s__Fear_id[this]]=GetRandomReal(GetUnitY(s__Fear_unit[this]) - s__Fear_MAX_CHANGE, GetUnitY(s__Fear_unit[this]) + s__Fear_MAX_CHANGE) - call IssuePointOrder(s__Fear_unit[this], "move", s__Fear_x[s__Fear_id[this]], s__Fear_y[s__Fear_id[this]]) - endif - else - set i=s__Fear_remove(this,i) - endif - set i=i + 1 - endloop - endfunction - function s__Fear_apply takes unit whichUnit,real duration,string model,string point returns nothing - local integer id= GetUnitUserData(whichUnit) - local integer this - if duration > 0 then - call BlzSetAbilityRealLevelField(s__Fear_ability, ABILITY_RLF_DURATION_NORMAL, 0, duration) - call BlzSetAbilityRealLevelField(s__Fear_ability, ABILITY_RLF_DURATION_HERO, 0, duration) - call IncUnitAbilityLevel(s__Fear_dummy, CrowdControl__FEAR) - call DecUnitAbilityLevel(s__Fear_dummy, CrowdControl__FEAR) - if IssueTargetOrder(s__Fear_dummy, "drunkenhaze", whichUnit) then - if s__Fear_struct[id] != 0 then - set this=s__Fear_struct[id] - else - set this=s__Fear__allocate() - set s__Fear_id[this]=id - set s__Fear_unit[this]=whichUnit - set s__Fear_change[this]=0 - set s__Fear_key=s__Fear_key + 1 - set s__Fear_array[s__Fear_key]=this - set s__Fear_struct[id]=this - - if model != null and point != null then - set s__Fear_effect[this]=AddSpecialEffectTarget(model, whichUnit, point) - endif - - if s__Fear_key == 0 then - call TimerStart(s__Fear_timer, s__Fear_PERIOD, true, function s__Fear_onPeriod) - endif - endif - - set s__Fear_flag[id]=true - set s__Fear_x[id]=GetRandomReal(GetUnitX(whichUnit) - s__Fear_MAX_CHANGE, GetUnitX(whichUnit) + s__Fear_MAX_CHANGE) - set s__Fear_y[id]=GetRandomReal(GetUnitY(whichUnit) - s__Fear_MAX_CHANGE, GetUnitY(whichUnit) + s__Fear_MAX_CHANGE) - call IssuePointOrder(whichUnit, "move", s__Fear_x[id], s__Fear_y[id]) - endif - endif - endfunction - function s__Fear_onOrder takes nothing returns nothing - local unit source= GetOrderedUnit() - local integer id - if (GetUnitAbilityLevel((source), CrowdControl__FEAR_BUFF) > 0) and GetIssuedOrderId() != 851973 then // INLINED!! - set id=GetUnitUserData(source) - if not s__Fear_flag[id] then - set s__Fear_flag[id]=true - call IssuePointOrder(source, "move", s__Fear_x[id], s__Fear_y[id]) - else - set s__Fear_flag[id]=false - endif - endif - set source=null - endfunction - function s__Fear_onInit takes nothing returns nothing - set s__Fear_dummy=(sc__DummyPool_retrieve((Player(PLAYER_NEUTRAL_PASSIVE) ) , (( GetRectCenterX(GetWorldBounds()) )*1.0) , (( GetRectCenterY(GetWorldBounds()) )*1.0) , (( 0 )*1.0) , (( 0)*1.0))) // INLINED!! - call UnitAddAbility(s__Fear_dummy, CrowdControl__TRUE_SIGHT) - call UnitAddAbility(s__Fear_dummy, CrowdControl__FEAR) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER , function s__Fear_onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER , function s__Fear_onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER , function s__Fear_onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER , function s__Fear_onOrder) - set s__Fear_ability=BlzGetUnitAbility(s__Fear_dummy, CrowdControl__FEAR) - endfunction - - function s__Taunt_taunted takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__TAUNT_BUFF) > 0 - endfunction - function s__Taunt_remove takes integer this,integer i returns integer - call sc__CrowdControl_dispel((s__Taunt_unit[this] ) , ( CROWD_CONTROL_TAUNT)) // INLINED!! - call IssueImmediateOrder(s__Taunt_unit[this], "stop") - call DestroyEffect(s__Taunt_effect[this]) - if s__Taunt_selected[this] and UnitAlive(s__Taunt_unit[this]) then - call SelectUnitAddForPlayer(s__Taunt_unit[this], GetOwningPlayer(s__Taunt_unit[this])) - endif - set s__Taunt_struct[s__Taunt_id[this]]=0 - set s__Taunt_source[s__Taunt_id[this]]=null - set s__Taunt_unit[this]=null - set s__Taunt_effect[this]=null - set s__Taunt_array[i]=s__Taunt_array[s__Taunt_key] - set s__Taunt_key=s__Taunt_key - 1 - call s__Taunt_deallocate(this) - if s__Taunt_key == - 1 then - call PauseTimer(s__Taunt_timer) - endif - return i - 1 - endfunction - function s__Taunt_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - loop - exitwhen i > s__Taunt_key - set this=s__Taunt_array[i] - if GetUnitAbilityLevel(s__Taunt_unit[this], CrowdControl__TAUNT_BUFF) > 0 and UnitAlive(s__Taunt_source[s__Taunt_id[this]]) and UnitAlive(s__Taunt_unit[this]) then - if IsUnitVisible(s__Taunt_source[s__Taunt_id[this]], GetOwningPlayer(s__Taunt_unit[this])) then - call IssueTargetOrderById(s__Taunt_unit[this], 851983, s__Taunt_source[s__Taunt_id[this]]) - else - call IssuePointOrderById(s__Taunt_unit[this], 851986, GetUnitX(s__Taunt_source[s__Taunt_id[this]]), GetUnitY(s__Taunt_source[s__Taunt_id[this]])) - endif - else - set i=s__Taunt_remove(this,i) - endif - set i=i + 1 - endloop - endfunction - function s__Taunt_apply takes unit source,unit target,real duration,string model,string point returns nothing - local integer id= GetUnitUserData(target) - local integer this - if duration > 0 and UnitAlive(source) and UnitAlive(target) then - call BlzSetAbilityRealLevelField(s__Taunt_ability, ABILITY_RLF_DURATION_NORMAL, 0, duration) - call BlzSetAbilityRealLevelField(s__Taunt_ability, ABILITY_RLF_DURATION_HERO, 0, duration) - call IncUnitAbilityLevel(s__Taunt_dummy, CrowdControl__TAUNT) - call DecUnitAbilityLevel(s__Taunt_dummy, CrowdControl__TAUNT) - if IssueTargetOrder(s__Taunt_dummy, "drunkenhaze", target) then - if s__Taunt_struct[id] != 0 then - set this=s__Taunt_struct[id] - else - set this=s__Taunt__allocate() - set s__Taunt_id[this]=id - set s__Taunt_unit[this]=target - set s__Taunt_selected[this]=IsUnitSelected(target, GetOwningPlayer(target)) - set s__Taunt_key=s__Taunt_key + 1 - set s__Taunt_array[s__Taunt_key]=this - set s__Taunt_struct[id]=this - - if s__Taunt_selected[this] then - call SelectUnit(target, false) - endif - if model != null and point != null then - set s__Taunt_effect[this]=AddSpecialEffectTarget(model, target, point) - endif - - if s__Taunt_key == 0 then - call TimerStart(s__Taunt_timer, s__Taunt_PERIOD, true, function s__Taunt_onPeriod) - endif - endif - set s__Taunt_source[id]=source - - if IsUnitVisible(source, GetOwningPlayer(target)) then - call IssueTargetOrderById(target, 851983, source) - else - call IssuePointOrderById(target, 851986, GetUnitX(source), GetUnitY(source)) - endif - endif - endif - endfunction - function s__Taunt_onOrder takes nothing returns nothing - local unit target= GetOrderedUnit() - local integer order= GetIssuedOrderId() - local integer id - - if (GetUnitAbilityLevel((target), CrowdControl__TAUNT_BUFF) > 0) and order != 851973 then // INLINED!! - set id=GetUnitUserData(target) - if order != 851983 and order != 851986 then - if IsUnitVisible(s__Taunt_source[id], GetOwningPlayer(target)) then - call IssueTargetOrderById(target, 851983, s__Taunt_source[id]) - else - call IssuePointOrderById(target, 851986, GetUnitX(s__Taunt_source[id]), GetUnitY(s__Taunt_source[id])) - endif - else - if GetOrderTargetUnit() != s__Taunt_source[id] and GetOrderTargetUnit() != null then - if IsUnitVisible(s__Taunt_source[id], GetOwningPlayer(target)) then - call IssueTargetOrderById(target, 851983, s__Taunt_source[id]) - else - call IssuePointOrderById(target, 851986, GetUnitX(s__Taunt_source[id]), GetUnitY(s__Taunt_source[id])) - endif - endif - endif - endif - set target=null - endfunction - function s__Taunt_onSelect takes nothing returns nothing - local unit target= GetTriggerUnit() - - if (GetUnitAbilityLevel((target), CrowdControl__TAUNT_BUFF) > 0) then // INLINED!! - if IsUnitSelected(target, GetOwningPlayer(target)) then - call SelectUnit(target, false) - endif - endif - - set target=null - endfunction - function s__Taunt_onInit takes nothing returns nothing - set s__Taunt_dummy=(sc__DummyPool_retrieve((Player(PLAYER_NEUTRAL_PASSIVE) ) , (( GetRectCenterX(GetWorldBounds()) )*1.0) , (( GetRectCenterY(GetWorldBounds()) )*1.0) , (( 0 )*1.0) , (( 0)*1.0))) // INLINED!! - call UnitAddAbility(s__Taunt_dummy, CrowdControl__TRUE_SIGHT) - call UnitAddAbility(s__Taunt_dummy, CrowdControl__TAUNT) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER , function s__Taunt_onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER , function s__Taunt_onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER , function s__Taunt_onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER , function s__Taunt_onOrder) - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SELECTED , function s__Taunt_onSelect) - set s__Taunt_ability=BlzGetUnitAbility(s__Taunt_dummy, CrowdControl__TAUNT) - endfunction - - - function s__CrowdControl_onInit takes nothing returns nothing - set s__CrowdControl_dummy=(sc__DummyPool_retrieve((Player(PLAYER_NEUTRAL_PASSIVE) ) , (( GetRectCenterX(GetWorldBounds()) )*1.0) , (( GetRectCenterY(GetWorldBounds()) )*1.0) , (( 0 )*1.0) , (( 0)*1.0))) // INLINED!! - - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__SILENCE) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__STUN) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__ATTACK_SLOW) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__MOVEMENT_SLOW) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__BANISH) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__ENSNARE) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__PURGE) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__HEX) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__SLEEP) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__CYCLONE) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__ENTANGLE) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__DISARM) - call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__TRUE_SIGHT) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__SILENCE, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__STUN, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__ATTACK_SLOW, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__MOVEMENT_SLOW, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__BANISH, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__ENSNARE, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__PURGE, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__HEX, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__SLEEP, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__CYCLONE, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__ENTANGLE, true, true) - call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__DISARM, true, true) - set s__CrowdControl_ability[CROWD_CONTROL_SILENCE]=CrowdControl__SILENCE - set s__CrowdControl_ability[CROWD_CONTROL_STUN]=CrowdControl__STUN - set s__CrowdControl_ability[CROWD_CONTROL_SLOW]=CrowdControl__MOVEMENT_SLOW - set s__CrowdControl_ability[CROWD_CONTROL_SLOW_ATTACK]=CrowdControl__ATTACK_SLOW - set s__CrowdControl_ability[CROWD_CONTROL_BANISH]=CrowdControl__BANISH - set s__CrowdControl_ability[CROWD_CONTROL_ENSNARE]=CrowdControl__ENSNARE - set s__CrowdControl_ability[CROWD_CONTROL_PURGE]=CrowdControl__PURGE - set s__CrowdControl_ability[CROWD_CONTROL_HEX]=CrowdControl__HEX - set s__CrowdControl_ability[CROWD_CONTROL_SLEEP]=CrowdControl__SLEEP - set s__CrowdControl_ability[CROWD_CONTROL_CYCLONE]=CrowdControl__CYCLONE - set s__CrowdControl_ability[CROWD_CONTROL_ENTANGLE]=CrowdControl__ENTANGLE - set s__CrowdControl_ability[CROWD_CONTROL_DISARM]=CrowdControl__DISARM - set s__CrowdControl_ability[CROWD_CONTROL_FEAR]=CrowdControl__FEAR - set s__CrowdControl_ability[CROWD_CONTROL_TAUNT]=CrowdControl__TAUNT - set s__CrowdControl_buff[CROWD_CONTROL_SILENCE]=CrowdControl__SILENCE_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_STUN]=CrowdControl__STUN_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_SLOW]=CrowdControl__MOVEMENT_SLOW_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_SLOW_ATTACK]=CrowdControl__ATTACK_SLOW_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_BANISH]=CrowdControl__BANISH_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_ENSNARE]=CrowdControl__ENSNARE_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_PURGE]=CrowdControl__PURGE_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_HEX]=CrowdControl__HEX_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_SLEEP]=CrowdControl__SLEEP_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_CYCLONE]=CrowdControl__CYCLONE_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_ENTANGLE]=CrowdControl__ENTANGLE_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_DISARM]=CrowdControl__DISARM_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_FEAR]=CrowdControl__FEAR_BUFF - set s__CrowdControl_buff[CROWD_CONTROL_TAUNT]=CrowdControl__TAUNT_BUFF - set s__CrowdControl_order[CROWD_CONTROL_SILENCE]="drunkenhaze" - set s__CrowdControl_order[CROWD_CONTROL_STUN]="thunderbolt" - set s__CrowdControl_order[CROWD_CONTROL_SLOW]="cripple" - set s__CrowdControl_order[CROWD_CONTROL_SLOW_ATTACK]="cripple" - set s__CrowdControl_order[CROWD_CONTROL_BANISH]="banish" - set s__CrowdControl_order[CROWD_CONTROL_ENSNARE]="ensnare" - set s__CrowdControl_order[CROWD_CONTROL_PURGE]="purge" - set s__CrowdControl_order[CROWD_CONTROL_HEX]="hex" - set s__CrowdControl_order[CROWD_CONTROL_SLEEP]="sleep" - set s__CrowdControl_order[CROWD_CONTROL_CYCLONE]="cyclone" - set s__CrowdControl_order[CROWD_CONTROL_ENTANGLE]="entanglingroots" - set s__CrowdControl_order[CROWD_CONTROL_DISARM]="drunkenhaze" - endfunction - function s__CrowdControl_onExpire takes nothing returns nothing - local timer t= GetExpiredTimer() - call RemoveSavedHandle(s__CrowdControl_timer, GetHandleId(LoadUnitHandle(s__CrowdControl_timer, GetHandleId(t), 0)), LoadInteger(s__CrowdControl_timer, GetHandleId(t), 1)) - call FlushChildHashtable(s__CrowdControl_timer, GetHandleId(t)) - call DestroyTimer(t) - set t=null - endfunction - function s__CrowdControl_onEvent takes integer key returns nothing - local integer i= 0 - local integer next= - 1 - local integer prev= - 2 - set s__CrowdControl_count=s__CrowdControl_count + 1 - if s__CrowdControl_count - CROWD_CONTROL_KNOCKUP < CrowdControl__RECURSION_LIMIT then - loop - exitwhen s__CrowdControl_type[key] == next or ( i - CROWD_CONTROL_KNOCKUP > CrowdControl__RECURSION_LIMIT ) - set next=s__CrowdControl_type[key] - - if s__CrowdControl_event[next] != null then - call TriggerEvaluate(s__CrowdControl_event[next]) - endif - if s__CrowdControl_type[key] != next then - set i=i + 1 - else - if next != prev then - call TriggerEvaluate(s__CrowdControl_trigger) - if s__CrowdControl_type[key] != next then - set i=i + 1 - set prev=next - endif - endif - endif - endloop - endif - - set s__CrowdControl_count=s__CrowdControl_count - 1 - set s__CrowdControl_key=key - endfunction - function s__CrowdControl_cast takes unit source,unit target,real amount,real angle,real distance,real height,real duration,string model,string point,boolean stack,boolean onCliff,boolean onDestructable,boolean onUnit,integer id returns nothing - local ability spell - local timer t - - if not IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) and UnitAlive(target) and duration > 0 then - set s__CrowdControl_key=s__CrowdControl_key + 1 - set s__CrowdControl_unit[s__CrowdControl_key]=target - set s__CrowdControl_source[s__CrowdControl_key]=source - set s__CrowdControl_amount[s__CrowdControl_key]=amount - set s__CrowdControl_angle[s__CrowdControl_key]=angle - set s__CrowdControl_distance[s__CrowdControl_key]=distance - set s__CrowdControl_height[s__CrowdControl_key]=height - set s__CrowdControl_duration[s__CrowdControl_key]=duration - set s__CrowdControl_model[s__CrowdControl_key]=model - set s__CrowdControl_point[s__CrowdControl_key]=point - set s__CrowdControl_stack[s__CrowdControl_key]=stack - set s__CrowdControl_cliff[s__CrowdControl_key]=onCliff - set s__CrowdControl_destructable[s__CrowdControl_key]=onDestructable - set s__CrowdControl_agent[s__CrowdControl_key]=onUnit - set s__CrowdControl_type[s__CrowdControl_key]=id - call s__CrowdControl_onEvent(s__CrowdControl_key) - - set s__CrowdControl_duration[s__CrowdControl_key]=(sc__Tenacity_calculate((s__CrowdControl_unit[s__CrowdControl_key] ) , (( s__CrowdControl_duration[s__CrowdControl_key])*1.0))) // INLINED!! - if s__CrowdControl_duration[s__CrowdControl_key] > 0 and UnitAlive(s__CrowdControl_unit[s__CrowdControl_key]) then - if not HaveSavedHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]) then - set t=CreateTimer() - call SaveTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key], t) - call SaveUnitHandle(s__CrowdControl_timer, GetHandleId(t), 0, s__CrowdControl_unit[s__CrowdControl_key]) - call SaveInteger(s__CrowdControl_timer, GetHandleId(t), 1, s__CrowdControl_type[s__CrowdControl_key]) - endif - if s__CrowdControl_stack[s__CrowdControl_key] then - if s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_TAUNT then - set s__CrowdControl_duration[s__CrowdControl_key]=s__CrowdControl_duration[s__CrowdControl_key] + TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key])) - else - if s__Taunt_source[GetUnitUserData(s__CrowdControl_unit[s__CrowdControl_key])] == s__CrowdControl_source[s__CrowdControl_key] then - set s__CrowdControl_duration[s__CrowdControl_key]=s__CrowdControl_duration[s__CrowdControl_key] + TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key])) - endif - endif - endif - if s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_FEAR and s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_TAUNT and s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_KNOCKBACK and s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_KNOCKUP then - set spell=BlzGetUnitAbility(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]]) - call BlzUnitDisableAbility(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]], false, false) - call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_DURATION_NORMAL, 0, s__CrowdControl_duration[s__CrowdControl_key]) - call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_DURATION_HERO, 0, s__CrowdControl_duration[s__CrowdControl_key]) - if s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_SLOW then - call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_MOVEMENT_SPEED_REDUCTION_PERCENT_CRI1, 0, s__CrowdControl_amount[s__CrowdControl_key]) - elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_SLOW_ATTACK then - call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_ATTACK_SPEED_REDUCTION_PERCENT_CRI2, 0, s__CrowdControl_amount[s__CrowdControl_key]) - endif - call IncUnitAbilityLevel(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]]) - call DecUnitAbilityLevel(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]]) - if IssueTargetOrder(s__CrowdControl_dummy, s__CrowdControl_order[s__CrowdControl_type[s__CrowdControl_key]], s__CrowdControl_unit[s__CrowdControl_key]) then - call UnitRemoveAbility(s__CrowdControl_unit[s__CrowdControl_key], s__CrowdControl_buff[s__CrowdControl_type[s__CrowdControl_key]]) - call IssueTargetOrder(s__CrowdControl_dummy, s__CrowdControl_order[s__CrowdControl_type[s__CrowdControl_key]], s__CrowdControl_unit[s__CrowdControl_key]) - call TimerStart(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]), s__CrowdControl_duration[s__CrowdControl_key], false, function s__CrowdControl_onExpire) - if s__CrowdControl_model[s__CrowdControl_key] != null and s__CrowdControl_model[s__CrowdControl_key] != "" then - if s__CrowdControl_point[s__CrowdControl_key] != null and s__CrowdControl_point[s__CrowdControl_key] != "" then - call sc__EffectLink_BuffLink((s__CrowdControl_unit[s__CrowdControl_key] ) , ( s__CrowdControl_buff[s__CrowdControl_type[s__CrowdControl_key]] ) , ( s__CrowdControl_model[s__CrowdControl_key] ) , ( s__CrowdControl_point[s__CrowdControl_key])) // INLINED!! - else - call DestroyEffect(AddSpecialEffect(s__CrowdControl_model[s__CrowdControl_key], GetUnitX(s__CrowdControl_unit[s__CrowdControl_key]), GetUnitY(s__CrowdControl_unit[s__CrowdControl_key]))) - endif - endif - else - call RemoveSavedHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]) - call FlushChildHashtable(s__CrowdControl_timer, GetHandleId(t)) - call DestroyTimer(t) - endif - call BlzUnitDisableAbility(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]], true, true) - else - if s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_FEAR then - call s__Fear_apply(s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key]) - elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_TAUNT then - call s__Taunt_apply(s__CrowdControl_source[s__CrowdControl_key] , s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key]) - elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_KNOCKBACK then - call s__CrowdControl__Knockback_apply(s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_angle[s__CrowdControl_key] , s__CrowdControl_distance[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key] , s__CrowdControl_cliff[s__CrowdControl_key] , s__CrowdControl_destructable[s__CrowdControl_key] , s__CrowdControl_agent[s__CrowdControl_key]) - elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_KNOCKUP then - call s__Knockup_apply(s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_height[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key]) - endif - call TimerStart(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]), s__CrowdControl_duration[s__CrowdControl_key], false, function s__CrowdControl_onExpire) - endif - endif - - if s__CrowdControl_key > - 1 then - set s__CrowdControl_key=s__CrowdControl_key - 1 - endif - endif - - set t=null - set spell=null - endfunction - function s__CrowdControl_silence takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SILENCE) - endfunction - - function s__CrowdControl_silenced takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__SILENCE_BUFF) > 0 - endfunction - function s__CrowdControl_stun takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_STUN) - endfunction - - function s__CrowdControl_stunned takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__STUN_BUFF) > 0 - endfunction - function s__CrowdControl_slow takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , amount , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SLOW) - endfunction - - function s__CrowdControl_slowed takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__MOVEMENT_SLOW_BUFF) > 0 - endfunction - function s__CrowdControl_slowAttack takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , amount , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SLOW_ATTACK) - endfunction - - function s__CrowdControl_attackSlowed takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__ATTACK_SLOW_BUFF) > 0 - endfunction - function s__CrowdControl_banish takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_BANISH) - endfunction - - function s__CrowdControl_banished takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__BANISH_BUFF) > 0 - endfunction - function s__CrowdControl_ensnare takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_ENSNARE) - endfunction - - function s__CrowdControl_ensnared takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__ENSNARE_BUFF) > 0 - endfunction - function s__CrowdControl_purge takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_PURGE) - endfunction - - function s__CrowdControl_purged takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__PURGE_BUFF) > 0 - endfunction - function s__CrowdControl_hex takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_HEX) - endfunction - - function s__CrowdControl_hexed takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__HEX_BUFF) > 0 - endfunction - function s__CrowdControl_sleep takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SLEEP) - endfunction - - function s__CrowdControl_sleeping takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__SLEEP_BUFF) > 0 - endfunction - function s__CrowdControl_cyclone takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_CYCLONE) - endfunction - - function s__CrowdControl_cycloned takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__CYCLONE_BUFF) > 0 - endfunction - function s__CrowdControl_entangle takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_ENTANGLE) - endfunction - - function s__CrowdControl_entangled takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__ENTANGLE_BUFF) > 0 - endfunction - - function s__CrowdControl_knockback takes unit target,real angle,real distance,real duration,string model,string point,boolean onCliff,boolean onDestructable,boolean onUnit,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , angle , distance , 0 , duration , model , point , stack , onCliff , onDestructable , onUnit , CROWD_CONTROL_KNOCKBACK) - endfunction - - function s__CrowdControl_knockedback takes unit target returns boolean - return (s__CrowdControl__Knockback_struct[GetUnitUserData((target))] != 0) // INLINED!! - endfunction - function s__CrowdControl_knockup takes unit target,real maxHeight,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , maxHeight , duration , model , point , stack , false , false , false , CROWD_CONTROL_KNOCKUP) - endfunction - - function s__CrowdControl_knockedup takes unit target returns boolean - return (s__Knockup_knocked[GetUnitUserData((target))] > 0) // INLINED!! - endfunction - function s__CrowdControl_fear takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_FEAR) - endfunction - - function s__CrowdControl_feared takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__FEAR_BUFF) > 0) // INLINED!! - endfunction - function s__CrowdControl_disarm takes unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_DISARM) - endfunction - - function s__CrowdControl_disarmed takes unit target returns boolean - return GetUnitAbilityLevel(target, CrowdControl__DISARM_BUFF) > 0 - endfunction - function s__CrowdControl_taunt takes unit source,unit target,real duration,string model,string point,boolean stack returns nothing - call s__CrowdControl_cast(source , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_TAUNT) - endfunction - - function s__CrowdControl_taunted takes unit target returns boolean - return (GetUnitAbilityLevel((target), CrowdControl__TAUNT_BUFF) > 0) // INLINED!! - endfunction - function s__CrowdControl_dispel takes unit target,integer id returns nothing - local timer t - if s__CrowdControl_buff[id] != 0 then - call UnitRemoveAbility(target, s__CrowdControl_buff[id]) - if HaveSavedHandle(s__CrowdControl_timer, GetHandleId(target), id) then - set t=LoadTimerHandle(s__CrowdControl_timer, GetHandleId(target), id) - call RemoveSavedHandle(s__CrowdControl_timer, GetHandleId(target), id) - call FlushChildHashtable(s__CrowdControl_timer, GetHandleId(t)) - call DestroyTimer(t) - endif - endif - set t=null - endfunction - function s__CrowdControl_dispelAll takes unit target returns nothing - call s__CrowdControl_dispel(target , CROWD_CONTROL_SILENCE) - call s__CrowdControl_dispel(target , CROWD_CONTROL_STUN) - call s__CrowdControl_dispel(target , CROWD_CONTROL_SLOW) - call s__CrowdControl_dispel(target , CROWD_CONTROL_SLOW_ATTACK) - call s__CrowdControl_dispel(target , CROWD_CONTROL_BANISH) - call s__CrowdControl_dispel(target , CROWD_CONTROL_ENSNARE) - call s__CrowdControl_dispel(target , CROWD_CONTROL_PURGE) - call s__CrowdControl_dispel(target , CROWD_CONTROL_HEX) - call s__CrowdControl_dispel(target , CROWD_CONTROL_SLEEP) - call s__CrowdControl_dispel(target , CROWD_CONTROL_CYCLONE) - call s__CrowdControl_dispel(target , CROWD_CONTROL_ENTANGLE) - call s__CrowdControl_dispel(target , CROWD_CONTROL_DISARM) - call s__CrowdControl_dispel(target , CROWD_CONTROL_FEAR) - call s__CrowdControl_dispel(target , CROWD_CONTROL_TAUNT) - endfunction - function s__CrowdControl_remaining takes unit target,integer id returns real - return TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(target), id)) - endfunction - function s__CrowdControl_register takes integer id,code c returns nothing - if id >= CROWD_CONTROL_SILENCE and id <= CROWD_CONTROL_KNOCKUP then - if s__CrowdControl_event[id] == null then - set s__CrowdControl_event[id]=CreateTrigger() - endif - call TriggerAddCondition(s__CrowdControl_event[id], Filter(c)) - else - call TriggerAddCondition(s__CrowdControl_trigger, Filter(c)) - endif - endfunction -//library CrowdControl ends -//library KeyMovementSystem: -function KeyMovementSystem__PolarProjectionX takes real x,real angle,real distance returns real - return x + distance * Cos(angle * bj_DEGTORAD) -endfunction -function KeyMovementSystem__PolarProjectionY takes real y,real angle,real distance returns real - return y + distance * Sin(angle * bj_DEGTORAD) -endfunction -function MovementSystemSetPlayerUnit takes player whichPlayer,unit whichUnit returns nothing - set KeyMovementSystem__Unit[GetPlayerId(whichPlayer)]=whichUnit -endfunction -function MovementSystemResetPlayerUnit takes player whichPlayer returns nothing - set KeyMovementSystem__Unit[GetPlayerId(whichPlayer)]=null -endfunction -function MovementSystemGetPlayerUnit takes player whichPlayer returns unit - return KeyMovementSystem__Unit[GetPlayerId(whichPlayer)] -endfunction -function KeyMovementSystem__GetActualUnit takes player whichPlayer returns unit - local unit cargo= (KeyMovementSystem__Unit[GetPlayerId((whichPlayer))]) // INLINED!! - local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((cargo))))]) // INLINED!! - if ( transporter != null ) then - return transporter - endif - return cargo -endfunction -function KeyMovementSystem__TriggerConditionCanMove takes nothing returns boolean - return (KeyMovementSystem__Unit[GetPlayerId((GetTriggerPlayer()))]) != null and KeyMovementSystem__GetActualUnit(GetTriggerPlayer()) != null and GetOwningPlayer(KeyMovementSystem__GetActualUnit(GetTriggerPlayer())) == GetOwningPlayer((KeyMovementSystem__Unit[GetPlayerId((GetTriggerPlayer()))])) // INLINED!! -endfunction -function KeyMovementSystem__TriggerActionMoveForward takes nothing returns nothing - set KeyMovementSystem__MoveForward[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionMovementForwardStop takes nothing returns boolean - return KeyMovementSystem__MoveForward[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionMoveForwardStop takes nothing returns nothing - set KeyMovementSystem__MoveForward[GetPlayerId(GetTriggerPlayer())]=false - call ResetUnitAnimation(KeyMovementSystem__GetActualUnit(GetTriggerPlayer())) -endfunction -function KeyMovementSystem__TriggerActionMoveBackward takes nothing returns nothing - set KeyMovementSystem__MoveBackward[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionMovementBackwardStop takes nothing returns boolean - return KeyMovementSystem__MoveBackward[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionMoveBackwardStop takes nothing returns nothing - set KeyMovementSystem__MoveBackward[GetPlayerId(GetTriggerPlayer())]=false - call ResetUnitAnimation(KeyMovementSystem__GetActualUnit(GetTriggerPlayer())) -endfunction -function KeyMovementSystem__TriggerActionMoveUp takes nothing returns nothing - set KeyMovementSystem__MoveUp[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionMovementUpStop takes nothing returns boolean - return KeyMovementSystem__MoveUp[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionMoveUpStop takes nothing returns nothing - set KeyMovementSystem__MoveUp[GetPlayerId(GetTriggerPlayer())]=false -endfunction -function KeyMovementSystem__TriggerActionMoveDown takes nothing returns nothing - set KeyMovementSystem__MoveDown[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionMovementDownStop takes nothing returns boolean - return KeyMovementSystem__MoveDown[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionMoveDownStop takes nothing returns nothing - set KeyMovementSystem__MoveDown[GetPlayerId(GetTriggerPlayer())]=false -endfunction -function KeyMovementSystem__TriggerActionRotateRight takes nothing returns nothing - set KeyMovementSystem__RotateRight[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionRotateRightStop takes nothing returns boolean - return KeyMovementSystem__RotateRight[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionRotateRightStop takes nothing returns nothing - set KeyMovementSystem__RotateRight[GetPlayerId(GetTriggerPlayer())]=false -endfunction -function KeyMovementSystem__TriggerActionRotateLeft takes nothing returns nothing - set KeyMovementSystem__RotateLeft[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionRotateLeftStop takes nothing returns boolean - return KeyMovementSystem__RotateLeft[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionRotateLeftStop takes nothing returns nothing - set KeyMovementSystem__RotateLeft[GetPlayerId(GetTriggerPlayer())]=false -endfunction -function KeyMovementSystem__TriggerActionMoveRight takes nothing returns nothing - set KeyMovementSystem__MoveRight[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionMoveRightStop takes nothing returns boolean - return KeyMovementSystem__MoveRight[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionMoveRightStop takes nothing returns nothing - set KeyMovementSystem__MoveRight[GetPlayerId(GetTriggerPlayer())]=false -endfunction -function KeyMovementSystem__TriggerActionMoveLeft takes nothing returns nothing - set KeyMovementSystem__MoveLeft[GetPlayerId(GetTriggerPlayer())]=true -endfunction -function KeyMovementSystem__TriggerConditionMoveLeftStop takes nothing returns boolean - return KeyMovementSystem__MoveLeft[GetPlayerId(GetTriggerPlayer())] -endfunction -function KeyMovementSystem__TriggerActionMoveLeftStop takes nothing returns nothing - set KeyMovementSystem__MoveLeft[GetPlayerId(GetTriggerPlayer())]=false -endfunction -function KeyMovementSystem__TimerFunctionUpdate takes nothing returns nothing - local player slotPlayer= null - local unit whichUnit= null - local real facing= 0.0 - local real x= 0.0 - local real y= 0.0 - local real speed= 5.0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - set whichUnit=KeyMovementSystem__GetActualUnit(slotPlayer) - if ( whichUnit != null and IsUnitAliveBJ(whichUnit) ) then - //call BJDebugMsg("Unit " + GetUnitName(whichUnit)) - if ( KeyMovementSystem__RotateRight[i] ) then - set facing=ModuloReal(GetUnitFacing(whichUnit) - KeyMovementSystem_MOVEMENT_SYSTEM_ROTATION_PER_INTERVAL, 360.0) - elseif ( KeyMovementSystem__RotateLeft[i] ) then - set facing=ModuloReal(GetUnitFacing(whichUnit) + KeyMovementSystem_MOVEMENT_SYSTEM_ROTATION_PER_INTERVAL, 360.0) - elseif ( KeyMovementSystem__MoveForward[i] ) then - //call BJDebugMsg("Move forward") - set facing=GetUnitFacing(whichUnit) - elseif ( KeyMovementSystem__MoveBackward[i] ) then - set facing=ModuloReal(GetUnitFacing(whichUnit) - 180.0, 360.0) - elseif ( KeyMovementSystem__MoveRight[i] ) then - set facing=ModuloReal(GetUnitFacing(whichUnit) - 90.0, 360.0) - elseif ( KeyMovementSystem__MoveLeft[i] ) then - set facing=ModuloReal(GetUnitFacing(whichUnit) + 90.0, 360.0) - endif - - set x=GetUnitX(whichUnit) - set y=GetUnitY(whichUnit) - set speed=GetUnitMoveSpeed(whichUnit) * KeyMovementSystem_TIMER_INTERVAL - //call BJDebugMsg("Move speed: " + R2S(speed)) - if ( KeyMovementSystem__MoveForward[i] or KeyMovementSystem__MoveBackward[i] or KeyMovementSystem__MoveRight[i] or KeyMovementSystem__MoveLeft[i] ) then - //call BJDebugMsg("Move forward 2") - if ( GetUnitCurrentOrder(whichUnit) == OrderId("idle") ) then - //call BJDebugMsg("Move") - set x=KeyMovementSystem__PolarProjectionX(x , facing , speed) - set y=KeyMovementSystem__PolarProjectionY(y , facing , speed) - call SetUnitPosition(whichUnit, x, y) - call SetUnitFacing(whichUnit, facing) - //call SetUnitAnimation(whichUnit, "stand") - call QueueUnitAnimation(whichUnit, "walk") - endif - elseif ( KeyMovementSystem__RotateRight[i] or KeyMovementSystem__RotateLeft[i] ) then - call SetUnitFacing(whichUnit, facing) - endif - if ( IsUnitType(whichUnit, UNIT_TYPE_FLYING) ) then - if ( KeyMovementSystem__MoveUp[i] ) then - call SetUnitFlyHeight(whichUnit, RMinBJ(GetUnitFlyHeight(whichUnit) + speed, KeyMovementSystem_MAX_HEIGHT), 0.0) - elseif ( KeyMovementSystem__MoveDown[i] ) then - call SetUnitFlyHeight(whichUnit, RMaxBJ(GetUnitFlyHeight(whichUnit) - speed, KeyMovementSystem_MIN_HEIGHT), 0.0) - endif - endif - endif - set whichUnit=null - set slotPlayer=null - set i=i + 1 - endloop -endfunction -function MovementSystemEnable takes nothing returns nothing - call TimerStart(KeyMovementSystem__UpdateTimer, KeyMovementSystem_TIMER_INTERVAL, true, function KeyMovementSystem__TimerFunctionUpdate) -endfunction -function MovementSystemDisable takes nothing returns nothing - call PauseTimer(KeyMovementSystem__UpdateTimer) -endfunction -function KeyMovementSystem__Init takes nothing returns nothing - local player slotPlayer= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__ForwardTrigger, slotPlayer, OSKEY_I, 0, true) - //call BlzTriggerRegisterPlayerKeyEvent(ForwardTrigger, slotPlayer, OSKEY_NUMPAD8, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__ForwardStopTrigger, slotPlayer, OSKEY_I, 0, false) - //call BlzTriggerRegisterPlayerKeyEvent(ForwardStopTrigger, slotPlayer, OSKEY_NUMPAD8, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpTrigger, slotPlayer, OSKEY_SPACE, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpTrigger, slotPlayer, OSKEY_OEM_PLUS, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpStopTrigger, slotPlayer, OSKEY_SPACE, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpStopTrigger, slotPlayer, OSKEY_OEM_PLUS, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownTrigger, slotPlayer, OSKEY_X, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownTrigger, slotPlayer, OSKEY_OEM_MINUS, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownStopTrigger, slotPlayer, OSKEY_X, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownStopTrigger, slotPlayer, OSKEY_OEM_MINUS, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__BackwardTrigger, slotPlayer, OSKEY_K, 0, true) - //call BlzTriggerRegisterPlayerKeyEvent(BackwardTrigger, slotPlayer, OSKEY_NUMPAD2, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__BackwardStopTrigger, slotPlayer, OSKEY_K, 0, false) - //call BlzTriggerRegisterPlayerKeyEvent(BackwardStopTrigger, slotPlayer, OSKEY_NUMPAD2, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightRotateTrigger, slotPlayer, OSKEY_L, 0, true) - //call BlzTriggerRegisterPlayerKeyEvent(RightRotateTrigger, slotPlayer, OSKEY_NUMPAD6, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightRotateStopTrigger, slotPlayer, OSKEY_L, 0, false) - //call BlzTriggerRegisterPlayerKeyEvent(RightRotateStopTrigger, slotPlayer, OSKEY_NUMPAD6, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftRotateTrigger, slotPlayer, OSKEY_J, 0, true) - //call BlzTriggerRegisterPlayerKeyEvent(LeftRotateTrigger, slotPlayer, OSKEY_NUMPAD4, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftRotateStopTrigger, slotPlayer, OSKEY_J, 0, false) - //call BlzTriggerRegisterPlayerKeyEvent(LeftRotateStopTrigger, slotPlayer, OSKEY_NUMPAD4, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightTrigger, slotPlayer, OSKEY_O, 0, true) - //call BlzTriggerRegisterPlayerKeyEvent(RightTrigger, slotPlayer, OSKEY_NUMPAD9, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightStopTrigger, slotPlayer, OSKEY_O, 0, false) - //call BlzTriggerRegisterPlayerKeyEvent(RightStopTrigger, slotPlayer, OSKEY_NUMPAD9, 0, false) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftTrigger, slotPlayer, OSKEY_U, 0, true) - //call BlzTriggerRegisterPlayerKeyEvent(LeftTrigger, slotPlayer, OSKEY_NUMPAD7, 0, true) - call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftStopTrigger, slotPlayer, OSKEY_U, 0, false) - //call BlzTriggerRegisterPlayerKeyEvent(LeftStopTrigger, slotPlayer, OSKEY_NUMPAD7, 0, false) - set slotPlayer=null - set i=i + 1 - endloop - - call TriggerAddCondition(KeyMovementSystem__ForwardTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__ForwardTrigger, function KeyMovementSystem__TriggerActionMoveForward) - call TriggerAddCondition(KeyMovementSystem__ForwardStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementForwardStop)) - call TriggerAddAction(KeyMovementSystem__ForwardStopTrigger, function KeyMovementSystem__TriggerActionMoveForwardStop) - call TriggerAddCondition(KeyMovementSystem__UpTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__UpTrigger, function KeyMovementSystem__TriggerActionMoveUp) - call TriggerAddCondition(KeyMovementSystem__UpStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementUpStop)) - call TriggerAddAction(KeyMovementSystem__UpStopTrigger, function KeyMovementSystem__TriggerActionMoveUpStop) - - call TriggerAddCondition(KeyMovementSystem__DownTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__DownTrigger, function KeyMovementSystem__TriggerActionMoveDown) - call TriggerAddCondition(KeyMovementSystem__DownStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementDownStop)) - call TriggerAddAction(KeyMovementSystem__DownStopTrigger, function KeyMovementSystem__TriggerActionMoveDownStop) - call TriggerAddCondition(KeyMovementSystem__BackwardTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__BackwardTrigger, function KeyMovementSystem__TriggerActionMoveBackward) - call TriggerAddCondition(KeyMovementSystem__BackwardStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementBackwardStop)) - call TriggerAddAction(KeyMovementSystem__BackwardStopTrigger, function KeyMovementSystem__TriggerActionMoveBackwardStop) - call TriggerAddCondition(KeyMovementSystem__RightRotateTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__RightRotateTrigger, function KeyMovementSystem__TriggerActionRotateRight) - call TriggerAddCondition(KeyMovementSystem__RightRotateStopTrigger, Condition(function KeyMovementSystem__TriggerConditionRotateRightStop)) - call TriggerAddAction(KeyMovementSystem__RightRotateStopTrigger, function KeyMovementSystem__TriggerActionRotateRightStop) - call TriggerAddCondition(KeyMovementSystem__LeftRotateTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__LeftRotateTrigger, function KeyMovementSystem__TriggerActionRotateLeft) - call TriggerAddCondition(KeyMovementSystem__LeftRotateStopTrigger, Condition(function KeyMovementSystem__TriggerConditionRotateLeftStop)) - call TriggerAddAction(KeyMovementSystem__LeftRotateStopTrigger, function KeyMovementSystem__TriggerActionRotateLeftStop) - - call TriggerAddCondition(KeyMovementSystem__RightTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__RightTrigger, function KeyMovementSystem__TriggerActionMoveRight) - call TriggerAddCondition(KeyMovementSystem__RightStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMoveRightStop)) - call TriggerAddAction(KeyMovementSystem__RightStopTrigger, function KeyMovementSystem__TriggerActionMoveRightStop) - call TriggerAddCondition(KeyMovementSystem__LeftTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) - call TriggerAddAction(KeyMovementSystem__LeftTrigger, function KeyMovementSystem__TriggerActionMoveLeft) - call TriggerAddCondition(KeyMovementSystem__LeftTrigger, Condition(function KeyMovementSystem__TriggerConditionMoveLeftStop)) - call TriggerAddAction(KeyMovementSystem__LeftTrigger, function KeyMovementSystem__TriggerActionMoveLeftStop) -endfunction -//library KeyMovementSystem ends -//library LogUI: -function EnableLogUI takes nothing returns nothing - call EnableTrigger(LogUI___closeTrigger) - call EnableTrigger(LogUI___chatCommandTrigger) - call EnableTrigger(LogUI___logTrigger) -endfunction -function DisableLogUI takes nothing returns nothing - call DisableTrigger(LogUI___closeTrigger) - call DisableTrigger(LogUI___chatCommandTrigger) - call DisableTrigger(LogUI___logTrigger) -endfunction -function UpdateLogUIVisible takes nothing returns nothing - local integer max= (Log___logCounter[GetPlayerId((GetLocalPlayer()))]) // INLINED!! - local integer i= 0 - call BlzFrameSetText(LogUI___TextAreaFrame, "") - loop - exitwhen ( i == max ) - call BlzFrameAddText(LogUI___TextAreaFrame, (Log___log[Log___GetLogEntryIndex((GetLocalPlayer() ) , ( i))])) // INLINED!! - set i=i + 1 - endloop -endfunction -function SetLogUIVisible takes boolean visible returns nothing - if ( visible ) then - call UpdateLogUIVisible() - endif - call BlzFrameSetVisible(LogUI___BackgroundFrame, visible) -endfunction -function ShowLogUI takes nothing returns nothing - call SetLogUIVisible(true) -endfunction -function HideLogUI takes nothing returns nothing - call SetLogUIVisible(false) -endfunction -function SetLogUIVisibleForPlayer takes player whichPlayer,boolean visible returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call SetLogUIVisible(visible) - endif -endfunction -function ShowLogUIForPlayer takes player whichPlayer returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call SetLogUIVisible(true) - endif -endfunction -function HideLogUIForPlayer takes player whichPlayer returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call SetLogUIVisible(false) - endif -endfunction -function LogUI___CloseFunction takes nothing returns nothing - call HideLogUIForPlayer(GetTriggerPlayer()) -endfunction -function LogUI_CreateUI takes nothing returns nothing - local framehandle f= null - - set LogUI___BackgroundFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(LogUI___BackgroundFrame, FRAMEPOINT_TOPLEFT, LogUI_X, LogUI_Y) - call BlzFrameSetAbsPoint(LogUI___BackgroundFrame, FRAMEPOINT_BOTTOMRIGHT, LogUI_X + LogUI_WIDTH, LogUI_Y - LogUI_HEIGHT) - set f=BlzCreateFrame("EscMenuTitleTextTemplate", LogUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(f, FRAMEPOINT_TOPLEFT, LogUI_TITLE_X, LogUI_TITLE_Y) - call BlzFrameSetAbsPoint(f, FRAMEPOINT_BOTTOMRIGHT, LogUI_TITLE_X + LogUI_WIDTH, LogUI_TITLE_Y - LogUI_TITLE_HEIGHT) - call BlzFrameSetTextAlignment(f, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - call BlzFrameSetText(f, GetLocalizedString("MESSAGE_LOG")) - - set LogUI___TextAreaFrame=BlzCreateFrame("EscMenuTextAreaTemplate", LogUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(LogUI___TextAreaFrame, FRAMEPOINT_TOPLEFT, LogUI_TEXT_AREA_X, LogUI_TEXT_AREA_Y) - call BlzFrameSetAbsPoint(LogUI___TextAreaFrame, FRAMEPOINT_BOTTOMRIGHT, LogUI_TEXT_AREA_X + LogUI_TEXT_AREA_WIDTH, LogUI_TEXT_AREA_Y - LogUI_TEXT_AREA_HEIGHT) - call BlzFrameSetFont(LogUI___TextAreaFrame, "MasterFont", 0.011, 0) - set f=BlzCreateFrame("ScriptDialogButton", LogUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(f, FRAMEPOINT_TOPLEFT, LogUI_CLOSE_BUTTON_X, LogUI_CLOSE_BUTTON_Y) - call BlzFrameSetAbsPoint(f, FRAMEPOINT_BOTTOMRIGHT, LogUI_CLOSE_BUTTON_X + LogUI_CLOSE_BUTTON_WIDTH, LogUI_CLOSE_BUTTON_Y - LogUI_CLOSE_BUTTON_HEIGHT) - call BlzFrameSetText(f, "|cffffcc00" + GetLocalizedString("OK") + "|r") - if ( LogUI___closeTrigger != null ) then - call DestroyTrigger(LogUI___closeTrigger) - endif - set LogUI___closeTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(LogUI___closeTrigger, f, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(LogUI___closeTrigger, function LogUI___CloseFunction) - call SetLogUIVisible(false) // INLINED!! -endfunction -function LogUI___TriggerActionShowLogUI takes nothing returns nothing - call ShowLogUIForPlayer(GetTriggerPlayer()) -endfunction -function LogUI___TriggerActionLog takes nothing returns nothing - if ( (Log___triggerLogPlayer) == GetLocalPlayer() ) then // INLINED!! - if ( BlzFrameIsVisible(LogUI___BackgroundFrame) ) then - call UpdateLogUIVisible() - endif - endif -endfunction -function LogUI___TimerFunctionStart takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer i= 0 - local player slotPlayer= null - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( GetPlayerController(slotPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING ) then - if ( StringLength(LogUI_CHAT_COMMAND_SHORT) > 0 ) then - call TriggerRegisterPlayerChatEvent(LogUI___chatCommandTrigger, slotPlayer, LogUI_CHAT_COMMAND_SHORT, true) - endif - if ( StringLength(LogUI_CHAT_COMMAND) > 0 ) then - call TriggerRegisterPlayerChatEvent(LogUI___chatCommandTrigger, slotPlayer, LogUI_CHAT_COMMAND, true) - endif - endif - set slotPlayer=null - set i=i + 1 - endloop - call TriggerAddAction(LogUI___chatCommandTrigger, function LogUI___TriggerActionShowLogUI) - - call TriggerRegisterLogEvent(LogUI___logTrigger) - call TriggerAddAction(LogUI___logTrigger, function LogUI___TriggerActionLog) - call BlzLoadTOCFile(LogUI_TOC_FILE) - - call LogUI_CreateUI() - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function LogUI___Init takes nothing returns nothing - call TimerStart(CreateTimer(), 0.0, false, function LogUI___TimerFunctionStart) - // Prevents crashes on loading save games: - call TriggerAddAction(FrameLoader___actionTrigger, (function LogUI_CreateUI)) // INLINED!! -endfunction -//library LogUI ends -//library MathUtils: -function Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer - return ( ( Value1 * MaxValue2 ) + Value2 ) -endfunction -function Index3D takes integer Value1,integer Value2,integer Value3,integer MaxValue2,integer MaxValue3 returns integer - return ( ( Value1 * ( MaxValue2 * MaxValue3 ) ) + ( Value2 * MaxValue3 ) + Value3 ) -endfunction -function PolarProjectionX takes real x,real angle,real distance returns real - return x + distance * Cos(angle * bj_DEGTORAD) -endfunction -function PolarProjectionY takes real y,real angle,real distance returns real - return y + distance * Sin(angle * bj_DEGTORAD) -endfunction -function AngleBetweenCoordinatesRad takes real x1,real y1,real x2,real y2 returns real - return Atan2(y2 - y1, x2 - x1) -endfunction -function AngleBetweenCoordinatesDeg takes real x1,real y1,real x2,real y2 returns real - return bj_RADTODEG * Atan2(y2 - y1, x2 - x1) -endfunction -function AngleBetweenUnitsDeg takes unit whichUnit0,unit whichUnit1 returns real - return AngleBetweenCoordinatesDeg(GetUnitX(whichUnit0) , GetUnitY(whichUnit0) , GetUnitX(whichUnit1) , GetUnitY(whichUnit1)) -endfunction -function DistanceBetweenUnits takes unit whichUnit0,unit whichUnit1 returns real - return DistanceBetweenCoordinates(GetUnitX(whichUnit0) , GetUnitY(whichUnit0) , GetUnitX(whichUnit1) , GetUnitY(whichUnit1)) -endfunction -function DistanceBetweenUnitAndItem takes unit whichUnit,item whichItem returns real - return DistanceBetweenCoordinates(GetUnitX(whichUnit) , GetUnitY(whichUnit) , GetItemX(whichItem) , GetItemY(whichItem)) -endfunction -function DistanceBetweenUnitAndDestructable takes unit whichUnit,destructable whichDestructable returns real - return DistanceBetweenCoordinates(GetUnitX(whichUnit) , GetUnitY(whichUnit) , GetDestructableX(whichDestructable) , GetDestructableY(whichDestructable)) -endfunction -function IntToPrecentage takes integer v,integer max returns real - return ( I2R(v) * 100.0 ) / I2R(max) -endfunction -function GetRectFromCircle takes real centerX,real centerY,real radius returns rect - return Rect(centerX - radius, centerY - radius, centerX + radius, centerY + radius) -endfunction -//library MathUtils ends -//library MissileUtils: - - // This is a simple Utils library for the Relativistic Missiles system. - // Credits: - // Sevion for the Alloc module - // - www.hiveworkshop.com/threads/snippet-alloc.192348/ - - - - - - function CreateMissileGroup takes nothing returns integer - return sc__MissileGroup_create() - endfunction - - function DestroyMissileGroup takes integer missiles returns nothing - if missiles != 0 then - call sc__MissileGroup_clear(missiles) - call sc__MissileGroup_destroy(missiles) - endif - endfunction - - function MissileGroupGetSize takes integer missiles returns integer - if missiles != 0 then - return s__MissileGroup_size[missiles] - else - return 0 - endif - endfunction - - function GroupMissileAt takes integer missiles,integer position returns integer - if missiles != 0 then - return sc__MissileGroup_missileAt(missiles,position) - else - return 0 - endif - endfunction - - function ClearMissileGroup takes integer missiles returns nothing - if missiles != 0 then - call sc__MissileGroup_clear(missiles) - endif - endfunction - - function IsMissileInGroup takes integer missile,integer missiles returns boolean - if missiles != 0 and missile != 0 then - if s__MissileGroup_size[missiles] > 0 then - return sc__MissileGroup_contains(missiles,missile) - else - return false - endif - else - return false - endif - endfunction - - function GroupRemoveMissile takes integer missiles,integer missile returns nothing - if missiles != 0 and missile != 0 then - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_remove(missiles,missile) - endif - endif - endfunction - - function GroupAddMissile takes integer missiles,integer missile returns nothing - if missiles != 0 and missile != 0 then - if not sc__MissileGroup_contains(missiles,missile) then - call sc__MissileGroup_insert(missiles,missile) - endif - endif - endfunction - - function GroupPickRandomMissile takes integer missiles returns integer - if missiles != 0 then - if s__MissileGroup_size[missiles] > 0 then - return sc__MissileGroup_missileAt(missiles,GetRandomInt(0, s__MissileGroup_size[missiles] - 1)) - else - return 0 - endif - else - return 0 - endif - endfunction - - function FirstOfMissileGroup takes integer missiles returns integer - if missiles != 0 then - if s__MissileGroup_size[missiles] > 0 then - return s__MissileUtils__MGroup_missile[s__MissileUtils__MGroup_next[s__MissileGroup_group[missiles]]] - else - return 0 - endif - else - return 0 - endif - endfunction - - function GroupAddMissileGroup takes integer source,integer destiny returns nothing - if source != 0 and destiny != 0 then - if s__MissileGroup_size[source] > 0 and source != destiny then - call sc__MissileGroup_addGroup(destiny,source) - endif - endif - endfunction - - function GroupRemoveMissileGroup takes integer source,integer destiny returns nothing - if source != 0 and destiny != 0 then - if source == destiny then - call sc__MissileGroup_clear(source) - elseif s__MissileGroup_size[source] > 0 then - call sc__MissileGroup_removeGroup(destiny,source) - endif - endif - endfunction - - function GroupEnumMissilesOfType takes integer missiles,integer whichType returns nothing - local integer i - local integer missile - - if missiles != 0 then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count - set missile=s__Missiles_collection[i] - - if s__Missiles_type[missile] == whichType then - call sc__MissileGroup_insert(missiles,missile) - endif - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesOfTypeCounted takes integer missiles,integer whichType,integer amount returns nothing - local integer i - local integer j= amount - local integer missile - - if missiles != 0 then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count or j == 0 - set missile=s__Missiles_collection[i] - - if s__Missiles_type[missile] == whichType then - call sc__MissileGroup_insert(missiles,missile) - endif - set j=j - 1 - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesOfPlayer takes integer missiles,player p returns nothing - local integer i - local integer missile - - if missiles != 0 then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count - set missile=s__Missiles_collection[i] - - if s__Missiles_owner[missile] == p then - call sc__MissileGroup_insert(missiles,missile) - endif - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesOfPlayerCounted takes integer missiles,player p,integer amount returns nothing - local integer i - local integer j= amount - local integer missile - - if missiles != 0 then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count or j == 0 - set missile=s__Missiles_collection[i] - - if s__Missiles_owner[missile] == p then - call sc__MissileGroup_insert(missiles,missile) - endif - set j=j - 1 - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesInRect takes integer missiles,rect r returns nothing - local integer i - local integer missile - - if missiles != 0 and r != null then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count - set missile=s__Missiles_collection[i] - - if GetRectMinX(r) <= s__Missiles_x[missile] and s__Missiles_x[missile] <= GetRectMaxX(r) and GetRectMinY(r) <= s__Missiles_y[missile] and s__Missiles_y[missile] <= GetRectMaxY(r) then - call sc__MissileGroup_insert(missiles,missile) - endif - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesInRectCounted takes integer missiles,rect r,integer amount returns nothing - local integer i - local integer j= amount - local integer missile - - if missiles != 0 and r != null then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count or j == 0 - set missile=s__Missiles_collection[i] - - if GetRectMinX(r) <= s__Missiles_x[missile] and s__Missiles_x[missile] <= GetRectMaxX(r) and GetRectMinY(r) <= s__Missiles_y[missile] and s__Missiles_y[missile] <= GetRectMaxY(r) then - call sc__MissileGroup_insert(missiles,missile) - endif - set j=j - 1 - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesInRangeOfLoc takes integer missiles,location loc,real radius returns nothing - local real dx - local real dy - local integer i - local integer missile - - if missiles != 0 and radius > 0 and loc != null then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count - set missile=s__Missiles_collection[i] - set dx=s__Missiles_x[missile] - GetLocationX(loc) - set dy=s__Missiles_y[missile] - GetLocationY(loc) - - if SquareRoot(dx * dx + dy * dy) <= radius then - call sc__MissileGroup_insert(missiles,missile) - endif - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesInRangeOfLocCounted takes integer missiles,location loc,real radius,integer amount returns nothing - local real dx - local real dy - local integer i - local integer j= amount - local integer missile - - if missiles != 0 and radius > 0 and loc != null then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count or j == 0 - set missile=s__Missiles_collection[i] - set dx=s__Missiles_x[missile] - GetLocationX(loc) - set dy=s__Missiles_y[missile] - GetLocationY(loc) - - if SquareRoot(dx * dx + dy * dy) <= radius then - call sc__MissileGroup_insert(missiles,missile) - endif - set j=j - 1 - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesInRange takes integer missiles,real x,real y,real radius returns nothing - local real dx - local real dy - local integer i - local integer missile - - if missiles != 0 and radius > 0 then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count - set missile=s__Missiles_collection[i] - set dx=s__Missiles_x[missile] - x - set dy=s__Missiles_y[missile] - y - - if SquareRoot(dx * dx + dy * dy) <= radius then - call sc__MissileGroup_insert(missiles,missile) - endif - set i=i + 1 - endloop - endif - endif - endfunction - - function GroupEnumMissilesInRangeCounted takes integer missiles,real x,real y,real radius,integer amount returns nothing - local real dx - local real dy - local integer i - local integer j= amount - local integer missile - - if missiles != 0 and radius > 0 then - if s__Missiles_count > - 1 then - set i=0 - - if s__MissileGroup_size[missiles] > 0 then - call sc__MissileGroup_clear(missiles) - endif - - loop - exitwhen i > s__Missiles_count or j == 0 - set missile=s__Missiles_collection[i] - set dx=s__Missiles_x[missile] - x - set dy=s__Missiles_y[missile] - y - - if SquareRoot(dx * dx + dy * dy) <= radius then - call sc__MissileGroup_insert(missiles,missile) - endif - set j=j - 1 - set i=i + 1 - endloop - endif - endif - endfunction - - - -//Implemented from module MissileUtils__LinkedList: - function s__MissileUtils__MGroup_init takes integer this returns integer - set s__MissileUtils__MGroup_next[this]=this - set s__MissileUtils__MGroup_prev[this]=this - return this - endfunction - function s__MissileUtils__MGroup_pushBack takes integer this,integer node returns integer - set s__MissileUtils__MGroup_prev[node]=s__MissileUtils__MGroup_prev[this] - set s__MissileUtils__MGroup_next[node]=this - set s__MissileUtils__MGroup_next[s__MissileUtils__MGroup_prev[this]]=node - set s__MissileUtils__MGroup_prev[this]=node - return node - endfunction - function s__MissileUtils__MGroup_pushFront takes integer this,integer node returns integer - set s__MissileUtils__MGroup_prev[node]=this - set s__MissileUtils__MGroup_next[node]=s__MissileUtils__MGroup_next[this] - set s__MissileUtils__MGroup_prev[s__MissileUtils__MGroup_next[this]]=node - set s__MissileUtils__MGroup_next[this]=node - return node - endfunction - function s__MissileUtils__MGroup_pop takes integer this returns nothing - set s__MissileUtils__MGroup_next[s__MissileUtils__MGroup_prev[this]]=s__MissileUtils__MGroup_next[this] - set s__MissileUtils__MGroup_prev[s__MissileUtils__MGroup_next[this]]=s__MissileUtils__MGroup_prev[this] - endfunction -//Implemented from module Alloc: - - function s__MissileUtils__MGroup_allocate takes nothing returns integer - local integer this - - if ( s__MissileUtils__MGroup_Alloc___recycle[(0)] == 0 ) then - set s__MissileUtils__MGroup_Alloc___instanceCount=s__MissileUtils__MGroup_Alloc___instanceCount + 1 - set this=s__MissileUtils__MGroup_Alloc___instanceCount - else - set this=s__MissileUtils__MGroup_Alloc___recycle[(0)] - set s__MissileUtils__MGroup_Alloc___recycle[(0)]=s__MissileUtils__MGroup_Alloc___recycle[s__MissileUtils__MGroup_Alloc___recycle[(0)]] - endif - - return this - endfunction - - function s__MissileUtils__MGroup_deallocate takes integer this returns nothing - set s__MissileUtils__MGroup_Alloc___recycle[this]=s__MissileUtils__MGroup_Alloc___recycle[(0)] - set s__MissileUtils__MGroup_Alloc___recycle[(0)]=this - endfunction - - - function s__MissileUtils__MGroup_remove takes integer this returns nothing - call s__MissileUtils__MGroup_pop(this) - call s__MissileUtils__MGroup_deallocate(this) - endfunction - function s__MissileUtils__MGroup_insert takes integer this,integer m returns integer - local integer node= s__MissileUtils__MGroup_pushBack(this,s__MissileUtils__MGroup_allocate()) - set s__MissileUtils__MGroup_missile[node]=m - return node - endfunction - - function s__MissileUtils__MGroup_create takes nothing returns integer - return s__MissileUtils__MGroup_init((s__MissileUtils__MGroup_allocate())) - endfunction - - function s__MissileGroup_destroy takes integer this returns nothing - call s__MissileUtils__MGroup_deallocate(s__MissileGroup_group[this]) - call s__MissileGroup_deallocate(this) - endfunction - - function s__MissileGroup_missileAt takes integer this,integer i returns integer - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] - local integer j= 0 - - if s__MissileGroup_size[this] > 0 and i <= s__MissileGroup_size[this] - 1 then - loop - exitwhen j == i - set node=s__MissileUtils__MGroup_next[node] - set j=j + 1 - endloop - - return s__MissileUtils__MGroup_missile[node] - else - return 0 - endif - endfunction - - function s__MissileGroup_remove takes integer this,integer missile returns nothing - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] - - loop - exitwhen node == s__MissileGroup_group[this] - if s__MissileUtils__MGroup_missile[node] == missile then - set s__MissileGroup_size[this]=s__MissileGroup_size[this] - 1 - call s__MissileUtils__MGroup_remove(node) - exitwhen true - endif - set node=s__MissileUtils__MGroup_next[node] - endloop - endfunction - - function s__MissileGroup_insert takes integer this,integer missile returns nothing - set s__MissileGroup_size[this]=s__MissileGroup_size[this] + 1 - call s__MissileUtils__MGroup_insert(s__MissileGroup_group[this],missile) - endfunction - - function s__MissileGroup_clear takes integer this returns nothing - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] - - loop - exitwhen node == s__MissileGroup_group[this] - call s__MissileUtils__MGroup_remove(node) - set node=s__MissileUtils__MGroup_next[node] - endloop - - set s__MissileGroup_size[this]=0 - endfunction - - function s__MissileGroup_contains takes integer this,integer missile returns boolean - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] - local boolean found= false - - loop - exitwhen node == s__MissileGroup_group[this] - if s__MissileUtils__MGroup_missile[node] == missile then - set found=true - exitwhen true - endif - set node=s__MissileUtils__MGroup_next[node] - endloop - - return found - endfunction - - function s__MissileGroup_addGroup takes integer this,integer source returns nothing - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[source]] - - loop - exitwhen node == s__MissileGroup_group[source] - if not s__MissileGroup_contains(this,s__MissileUtils__MGroup_missile[node]) then - call s__MissileGroup_insert(this,s__MissileUtils__MGroup_missile[node]) - endif - set node=s__MissileUtils__MGroup_next[node] - endloop - endfunction - - function s__MissileGroup_removeGroup takes integer this,integer source returns nothing - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[source]] - - loop - exitwhen node == s__MissileGroup_group[source] - if s__MissileGroup_contains(this,s__MissileUtils__MGroup_missile[node]) then - call s__MissileGroup_remove(this,s__MissileUtils__MGroup_missile[node]) - endif - set node=s__MissileUtils__MGroup_next[node] - endloop - endfunction - - function s__MissileGroup_create takes nothing returns integer - local integer this= s__MissileGroup__allocate() - - set s__MissileGroup_group[this]=(s__MissileUtils__MGroup_init((s__MissileUtils__MGroup_allocate()))) // INLINED!! - set s__MissileGroup_size[this]=0 - - return this - endfunction -//library MissileUtils ends -//library PagedButtonsUI: @@ -54522,433 +46016,58 @@ endfunction -function SetPagedButtonsUIEnabledForPlayer takes player whichPlayer,boolean enabled returns nothing - set PagedButtonsUI___enabledForPlayer[GetPlayerId(whichPlayer)]=enabled -endfunction -function IsPagedButtonsUIEnabledForPlayer takes player whichPlayer returns boolean - return PagedButtonsUI___enabledForPlayer[GetPlayerId(whichPlayer)] -endfunction -function PagedButtonsUI___GetButtonSlotIcon takes unit shop,integer index returns string - return BlzGetAbilityIcon(GetPagedButtonId(shop , index)) -endfunction -function PagedButtonsUI___GetMaxPageIndex takes integer playerId returns integer - return GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI___UIShop[playerId]) / PagedButtonsUI_MAX_SLOTS -endfunction -function PagedButtonsUI___SetSlotChargesVisible takes integer i,boolean visible returns nothing - call BlzFrameSetVisible(PagedButtonsUI___SlotChargesBackgroundFrame[i], visible) - call BlzFrameSetVisible(PagedButtonsUI___SlotChargesFrame[i], visible) -endfunction -function PagedButtonsUI___SetTooltipVisible takes boolean visible returns nothing - call BlzFrameSetVisible(PagedButtonsUI___TooltipIcon, visible) - call BlzFrameSetVisible(PagedButtonsUI___PageNameText, visible) - call BlzFrameSetVisible(PagedButtonsUI___SummonFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___TooltipText, visible) - call BlzFrameSetVisible(PagedButtonsUI___ItemGoldFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___ItemGoldIconFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___ItemLumberFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___ItemLumberIconFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___ItemFoodFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___ItemFoodIconFrame, visible) -endfunction -function PagedButtonsUI___SetVisible takes boolean visible returns nothing - call BlzFrameSetVisible(PagedButtonsUI___BackgroundFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___TitleFrame, visible) - call BlzFrameSetVisible(PagedButtonsUI___Checkbox, visible) - - call PagedButtonsUI___SetTooltipVisible(visible) -endfunction -function PagedButtonsUI___SetSlotVisible takes integer i,boolean visible returns nothing - call BlzFrameSetVisible(PagedButtonsUI___SlotFrame[i], visible) - call BlzFrameSetVisible(PagedButtonsUI___SlotBackdropFrame[i], visible) - call BlzFrameSetVisible(PagedButtonsUI___SlotPageBackgroundFrame[i], visible) - call BlzFrameSetVisible(PagedButtonsUI___SlotPageFrame[i], visible) - if ( visible ) then - set visible=PagedButtonsUI___checked // async - endif - call PagedButtonsUI___SetSlotChargesVisible(i , visible) -endfunction -function PagedButtonsUI___SetAllSlotChargesVisibleForPlayer takes player whichPlayer,boolean visible returns nothing - local integer i= 0 - loop - exitwhen ( i >= PagedButtonsUI_MAX_SLOTS ) - if ( whichPlayer == GetLocalPlayer() ) then - if ( BlzFrameIsVisible(PagedButtonsUI___SlotFrame[i]) ) then - call PagedButtonsUI___SetSlotChargesVisible(i , visible) - endif - endif - set i=i + 1 - endloop -endfunction -function PagedButtonsUI___UpdateItemsForUI takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer objectId= 0 - local integer i= 0 - local unit shop= PagedButtonsUI___UIShop[playerId] - local integer slot= 0 - local integer nonSpacerSlots= 0 - local integer startSlot= PagedButtonsUI___PagesIndex[playerId] * PagedButtonsUI_MAX_SLOTS - local integer maxSlots= GetPagedButtonsCount(shop) - local integer page= GetPagedButtonsPage(shop) - local string pageName= GetPagedButtonsPageName(shop , page) - local integer maxPageIndex= (GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI___UIShop[(playerId)]) / PagedButtonsUI_MAX_SLOTS) // INLINED!! - local integer handleId= 0 - if ( pageName == null or StringLength(pageName) == 0 ) then - set pageName=GetUnitName(shop) - endif - if ( maxPageIndex > 0 ) then - set pageName=pageName + " (" + I2S(PagedButtonsUI___PagesIndex[playerId] + 1) + "/" + I2S(maxPageIndex + 1) + ")" - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(PagedButtonsUI___NextPagesButton, true) - call BlzFrameSetVisible(PagedButtonsUI___PreviousPagesButton, true) - endif - else - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(PagedButtonsUI___NextPagesButton, false) - call BlzFrameSetVisible(PagedButtonsUI___PreviousPagesButton, false) - endif - endif - //call BJDebugMsg("max page index " + I2S(maxPageIndex)) - // set UIShop[playerId] = shop - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetText(PagedButtonsUI___TitleFrame, pageName) - endif - loop - exitwhen ( slot >= maxSlots or i >= PagedButtonsUI_MAX_SLOTS ) - if ( not (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_SPACER) ) then // INLINED!! - set nonSpacerSlots=nonSpacerSlots + 1 - if ( nonSpacerSlots > startSlot ) then - set objectId=GetPagedButtonId(shop , slot) - if ( PagedButtonsUI___UIVisible[playerId] ) then // and GetItemCharges(index) > 0 - if ( whichPlayer == GetLocalPlayer() ) then - //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) - call BlzFrameSetTexture(PagedButtonsUI___SlotBackdropFrame[i], BlzGetAbilityIcon(objectId), 0, true) - call BlzFrameSetText(PagedButtonsUI___SlotChargesFrame[i], "1") // I2S(GetItemCharges(index)) - call BlzFrameSetText(PagedButtonsUI___SlotPageFrame[i], I2S(GetPagedButtonsPageByIndex(shop , slot) + 1)) - call BlzFrameSetVisible(PagedButtonsUI___SlotChargesBackgroundFrame[i], PagedButtonsUI___checked) - call BlzFrameSetVisible(PagedButtonsUI___SlotChargesFrame[i], PagedButtonsUI___checked) - call BlzFrameSetVisible(PagedButtonsUI___SlotFrame[i], true) - call BlzFrameSetVisible(PagedButtonsUI___SlotBackdropFrame[i], true) - endif - endif - - set handleId=GetHandleId(PagedButtonsUI___SlotClickTrigger[i]) - call SaveInteger(PagedButtonsUI___h, handleId, 0, slot) - set handleId=GetHandleId(PagedButtonsUI___SlotTooltipOnTrigger[i]) - call SaveInteger(PagedButtonsUI___h, handleId, 0, slot) - set handleId=GetHandleId(PagedButtonsUI___SlotTooltipOffTrigger[i]) - call SaveInteger(PagedButtonsUI___h, handleId, 0, slot) - - set i=i + 1 - endif - endif - - set slot=slot + 1 - endloop - - loop - exitwhen ( i >= PagedButtonsUI_MAX_SLOTS ) - if ( whichPlayer == GetLocalPlayer() ) then - call PagedButtonsUI___SetSlotVisible(i , false) - endif - set i=i + 1 - endloop -endfunction -function PagedButtonsUI___UIExists takes nothing returns boolean - return PagedButtonsUI___BackgroundFrame != null -endfunction -function PagedButtonsUI___GetPagesIndexFromPagedButtonsShopEx takes unit shop returns integer - local integer currentPage= GetPagedButtonsPage(shop) - local integer i= 0 - local integer max= GetPagedButtonsCount(shop) - local integer countNonSpacerButtons= 0 - loop - exitwhen ( i >= max ) - if ( GetPagedButtonsPageByIndex(shop , i) >= currentPage ) then - return countNonSpacerButtons / PagedButtonsUI_MAX_SLOTS - endif - - if ( not (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( i))) == PagedButtons_BUTTON_TYPE_SPACER) ) then // INLINED!! - set countNonSpacerButtons=countNonSpacerButtons + 1 - endif - set i=i + 1 - endloop - return 0 -endfunction -function PagedButtonsUI___GetPagesIndexFromPagedButtonsShop takes unit shop returns integer - if ( (IsUnitInGroup((shop), PagedButtons___shops)) ) then // INLINED!! - return PagedButtonsUI___GetPagesIndexFromPagedButtonsShopEx(shop) - endif - return 0 -endfunction -function ShowPagedButtonsUI takes player whichPlayer,unit shop returns nothing - local integer playerId= GetPlayerId(whichPlayer) - if ( not (PagedButtonsUI___BackgroundFrame != null) ) then // INLINED!! - return - endif - set PagedButtonsUI___UIVisible[playerId]=true - set PagedButtonsUI___UIShop[playerId]=shop - set PagedButtonsUI___PagesIndex[playerId]=PagedButtonsUI___GetPagesIndexFromPagedButtonsShop(shop) - call PagedButtonsUI___UpdateItemsForUI(whichPlayer) - if ( whichPlayer == GetLocalPlayer() ) then - call PagedButtonsUI___SetVisible(true) - call PagedButtonsUI___SetTooltipVisible(false) - endif -endfunction -function PagedButtonsUI___HidePagedButtonsUISlots takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == PagedButtonsUI_MAX_SLOTS ) - call PagedButtonsUI___SetSlotVisible(i , false) - set i=i + 1 - endloop -endfunction -function HidePagedButtonsUI takes nothing returns nothing - call PagedButtonsUI___SetVisible(false) - call PagedButtonsUI___HidePagedButtonsUISlots() -endfunction -function HidePagedButtonsUIForPlayer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer index= 0 - if ( not (PagedButtonsUI___BackgroundFrame != null) ) then // INLINED!! - return - endif - set PagedButtonsUI___UIVisible[playerId]=false - set PagedButtonsUI___UIShop[playerId]=null - set PagedButtonsUI___PagesIndex[playerId]=0 - if ( whichPlayer == GetLocalPlayer() ) then - call PagedButtonsUI___SetVisible(false) - endif - set i=0 - loop - exitwhen ( i == PagedButtonsUI_MAX_SLOTS ) - if ( whichPlayer == GetLocalPlayer() ) then - call PagedButtonsUI___SetSlotVisible(i , false) - endif - set i=i + 1 - endloop -endfunction -function PagedButtonsUI___ClickItemFunction takes nothing returns nothing - local integer handleId= GetHandleId(GetTriggeringTrigger()) - local integer slot= LoadInteger(PagedButtonsUI___h, handleId, 0) - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(PagedButtonsUI_PREFIX, I2S(slot)) - endif -endfunction -function PagedButtonsUI___CompareReals takes real a,real b returns boolean - return a >= b and a <= b -endfunction -function PagedButtonsUI___StringSplit takes string source,integer index,string separator returns string - local string result= null - local integer currentIndex= 0 - local integer separatorLength= StringLength(separator) - local integer length= StringLength(source) - local integer i= 0 - loop - exitwhen ( i == length or currentIndex > index ) - if ( SubString(source, i, i + separatorLength) == separator ) then - if ( currentIndex == index and result == null ) then - set result="" - endif - set currentIndex=currentIndex + 1 - set i=i + separatorLength - else - if ( currentIndex == index ) then - if ( result == null ) then - set result="" - endif - set result=result + SubString(source, i, i + 1) - endif - set i=i + 1 - endif - endloop - return result -endfunction -function PagedButtonsUI___SetTextAreaText takes framehandle f,string text returns nothing - local string t= null - local integer i= 0 - call BlzFrameSetText(f, "") - loop - set t=PagedButtonsUI___StringSplit(text , i , "|n") - exitwhen ( t == null ) - if ( StringLength(t) == 0 ) then - set t=" " // empty line - endif - call BlzFrameAddText(f, t) - set i=i + 1 - endloop -endfunction -function PagedButtonsUI___EnterItemFunction takes nothing returns nothing - local integer handleId= GetHandleId(GetTriggeringTrigger()) - local integer slot= LoadInteger(PagedButtonsUI___h, handleId, 0) - local integer playerId= GetPlayerId(GetTriggerPlayer()) - local unit shop= PagedButtonsUI___UIShop[playerId] - local integer id= GetPagedButtonId(shop , slot) - local integer page= GetPagedButtonsPageByIndex(shop , slot) - local string pageName= "" - local string tooltip= "" - local integer goldCost= 0 - local integer lumberCost= 0 - local integer foodCost= 0 - local string summonText= "" - local real modelX= 0.0 - local real modelY= 0.0 - local real modelScale= 0.0 - local string modelPath= "" - local integer c= GetPagedButtonsConfig(id) - if ( slot >= 0 and slot < GetPagedButtonsCount(shop) ) then - set pageName=GetPagedButtonsPageName(shop , page) - set summonText=BlzGetAbilityTooltip(id, 0) - if ( (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_UNIT) ) then // INLINED!! - if ( IsUnitIdType(id, UNIT_TYPE_HERO) ) then - //call BJDebugMsg("Hero code " + A2S(id)) - set goldCost=s__PagedButtonsConfig_heroGoldCost[c] - set lumberCost=s__PagedButtonsConfig_heroLumberCost[c] - else - set goldCost=GetUnitGoldCost(id) - set lumberCost=GetUnitWoodCost(id) - endif - set foodCost=GetFoodUsed(id) - elseif ( (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_ITEM) ) then // INLINED!! - set goldCost=GetItemValueGold(id) - set lumberCost=GetItemValueLumber(id) - endif - - - if ( summonText != null and StringLength(summonText) > 0 ) then - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetText(PagedButtonsUI___SummonFrame, summonText) - call BlzFrameSetVisible(PagedButtonsUI___SummonFrame, true) - endif - endif - - if ( goldCost > 0 ) then - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetText(PagedButtonsUI___ItemGoldFrame, "|cffffcc00" + I2S(goldCost) + "|r") - call BlzFrameSetVisible(PagedButtonsUI___ItemGoldIconFrame, true) - call BlzFrameSetVisible(PagedButtonsUI___ItemGoldFrame, true) - endif - else - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetVisible(PagedButtonsUI___ItemGoldIconFrame, false) - call BlzFrameSetVisible(PagedButtonsUI___ItemGoldFrame, false) - endif - endif - - if ( lumberCost > 0 ) then - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetText(PagedButtonsUI___ItemLumberFrame, "|cffffcc00" + I2S(lumberCost) + "|r") - call BlzFrameSetVisible(PagedButtonsUI___ItemLumberIconFrame, true) - call BlzFrameSetVisible(PagedButtonsUI___ItemLumberFrame, true) - endif - else - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetVisible(PagedButtonsUI___ItemLumberIconFrame, false) - call BlzFrameSetVisible(PagedButtonsUI___ItemLumberFrame, false) - endif - endif - - if ( foodCost > 0 ) then - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetText(PagedButtonsUI___ItemFoodFrame, "|cffffcc00" + I2S(foodCost) + "|r") - call BlzFrameSetVisible(PagedButtonsUI___ItemFoodIconFrame, true) - call BlzFrameSetVisible(PagedButtonsUI___ItemFoodFrame, true) - endif - else - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetVisible(PagedButtonsUI___ItemFoodIconFrame, false) - call BlzFrameSetVisible(PagedButtonsUI___ItemFoodFrame, false) - endif - endif - //call BJDebugMsg("Entering item " + I2S(index)) - - if ( pageName != null ) then - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetText(PagedButtonsUI___PageNameText, pageName) - call BlzFrameSetVisible(PagedButtonsUI___PageNameText, true) - endif - else - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetVisible(PagedButtonsUI___PageNameText, false) - endif - endif - if ( id != 0 ) then - set tooltip=tooltip + BlzGetAbilityExtendedTooltip(id, 0) - else - set tooltip=tooltip + "Empty slot " + I2S(slot + 1) + " at page " + I2S(page + 1) + "." - //call BlzFrameSetVisible(ItemGoldIconFrame[playerId], false) - endif - - if ( id != 0 ) then - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetTexture(PagedButtonsUI___TooltipIcon, (BlzGetAbilityIcon(GetPagedButtonId((shop ) , ( slot)))), 0, false) // INLINED!! - call BlzFrameSetVisible(PagedButtonsUI___TooltipIcon, true) - endif - set tooltip=tooltip + PagedButtonsUI_BUY_TEXT - else - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetVisible(PagedButtonsUI___TooltipIcon, false) - endif - set tooltip=tooltip + PagedButtonsUI_OPEN_TEXT - endif - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call PagedButtonsUI___SetTextAreaText(PagedButtonsUI___TooltipText , tooltip) - //call BlzFrameSetText(TooltipText, tooltip) - call BlzFrameSetVisible(PagedButtonsUI___TooltipText, true) - endif - @@ -54976,2574 +46095,355 @@ function PagedButtonsUI___EnterItemFunction takes nothing returns nothing - endif - - set shop=null -endfunction -function PagedButtonsUI___LeaveItemFunction takes nothing returns nothing - -endfunction -function PagedButtonsUI___PreviousPagesFunction takes nothing returns nothing - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(PagedButtonsUI_PREFIX, "PreviousPage") - endif -endfunction -function PagedButtonsUI___NextPagesFunction takes nothing returns nothing - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(PagedButtonsUI_PREFIX, "NextPage") - endif -endfunction -function PagedButtonsUI___CheckedFunction takes nothing returns nothing - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - set PagedButtonsUI___checked=true - endif - call PagedButtonsUI___SetAllSlotChargesVisibleForPlayer(GetTriggerPlayer() , true) -endfunction -function PagedButtonsUI___UncheckedFunction takes nothing returns nothing - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - set PagedButtonsUI___checked=false - endif - call PagedButtonsUI___SetAllSlotChargesVisibleForPlayer(GetTriggerPlayer() , false) -endfunction -function PagedButtonsUI___CloseFunction takes nothing returns nothing - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(PagedButtonsUI_PREFIX, "Close") - endif -endfunction -function PagedButtonsUI_CreateUI takes nothing returns nothing - local integer i= 0 - local integer handleId= 0 - local real x= 0.0 - local real y= 0.0 - - set PagedButtonsUI___BackgroundFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___BackgroundFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_X, PagedButtonsUI_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___BackgroundFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_SIZE_X, PagedButtonsUI_Y - PagedButtonsUI_SIZE_Y) - set y=PagedButtonsUI_TITLE_Y - set PagedButtonsUI___TitleFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___TitleFrame, FRAMEPOINT_TOPLEFT, 0.0, y) - call BlzFrameSetAbsPoint(PagedButtonsUI___TitleFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_SIZE_X, y - PagedButtonsUI_TITLE_HEIGHT) - call BlzFrameSetTextAlignment(PagedButtonsUI___TitleFrame, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - set x=PagedButtonsUI_BUTTON_X - set y=PagedButtonsUI_BUTTON_Y - set i=0 - loop - exitwhen ( i == PagedButtonsUI_MAX_SLOTS ) - set PagedButtonsUI___SlotFrame[i]=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___SlotFrame[i], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(PagedButtonsUI___SlotFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + PagedButtonsUI_BUTTON_SIZE, y - PagedButtonsUI_BUTTON_SIZE) - //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(0), 0, true) - //call BlzFrameSetText(SlotFrame[index], I2S(index)) - set PagedButtonsUI___SlotBackdropFrame[i]=BlzCreateFrameByType("BACKDROP", "PagedButtonsUIBackdropFrame" + I2S(i), PagedButtonsUI___SlotFrame[i], "", 1) - call BlzFrameSetAllPoints(PagedButtonsUI___SlotBackdropFrame[i], PagedButtonsUI___SlotFrame[i]) -// call BlzFrameSetTexture(SlotBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) - set PagedButtonsUI___SlotClickTrigger[i]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___SlotClickTrigger[i], PagedButtonsUI___SlotFrame[i], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(PagedButtonsUI___SlotClickTrigger[i], function PagedButtonsUI___ClickItemFunction) - set handleId=GetHandleId(PagedButtonsUI___SlotClickTrigger[i]) - call SaveInteger(PagedButtonsUI___h, handleId, 0, i) - - set PagedButtonsUI___SlotTooltipOnTrigger[i]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___SlotTooltipOnTrigger[i], PagedButtonsUI___SlotFrame[i], FRAMEEVENT_MOUSE_ENTER) - call TriggerAddAction(PagedButtonsUI___SlotTooltipOnTrigger[i], function PagedButtonsUI___EnterItemFunction) - set handleId=GetHandleId(PagedButtonsUI___SlotTooltipOnTrigger[i]) - call SaveInteger(PagedButtonsUI___h, handleId, 0, i) - - set PagedButtonsUI___SlotTooltipOffTrigger[i]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___SlotTooltipOffTrigger[i], PagedButtonsUI___SlotFrame[i], FRAMEEVENT_MOUSE_LEAVE) - call TriggerAddAction(PagedButtonsUI___SlotTooltipOffTrigger[i], function PagedButtonsUI___LeaveItemFunction) - call SaveInteger(PagedButtonsUI___h, handleId, 0, i) - // TODO Mouse down and mouse up to drag & drop to another bag or switch or do it like Warcraft's inventory with right click and left click. Add the icon of the item to the mouse cursor. If you click on the map it is dropped, if you click on the inventory it is dropped there. - - set PagedButtonsUI___SlotPageBackgroundFrame[i]=BlzCreateFrameByType("BACKDROP", "ItemBagBackrgroundFrame" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___SlotPageBackgroundFrame[i], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(PagedButtonsUI___SlotPageBackgroundFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + PagedButtonsUI_CHARGES_BACKGROUND_SIZE, y - PagedButtonsUI_CHARGES_BACKGROUND_SIZE) - call BlzFrameSetTexture(PagedButtonsUI___SlotPageBackgroundFrame[i], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) - call BlzFrameSetLevel(PagedButtonsUI___SlotPageBackgroundFrame[i], 1) - - set PagedButtonsUI___SlotPageFrame[i]=BlzCreateFrameByType("TEXT", "PagedButtonsUIBag" + I2S(i), PagedButtonsUI___SlotPageBackgroundFrame[i], "", 0) - call BlzFrameSetAllPoints(PagedButtonsUI___SlotPageFrame[i], PagedButtonsUI___SlotPageBackgroundFrame[i]) - call BlzFrameSetText(PagedButtonsUI___SlotPageFrame[i], I2S(i + 1)) - call BlzFrameSetTextAlignment(PagedButtonsUI___SlotPageFrame[i], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) - call BlzFrameSetScale(PagedButtonsUI___SlotPageFrame[i], 0.7) - call BlzFrameSetEnable(PagedButtonsUI___SlotPageFrame[i], false) - call BlzFrameSetLevel(PagedButtonsUI___SlotPageFrame[i], 2) - - set PagedButtonsUI___SlotChargesBackgroundFrame[i]=BlzCreateFrameByType("BACKDROP", "PagedButtonsUIItemChargesBackrgroundFrame" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___SlotChargesBackgroundFrame[i], FRAMEPOINT_TOPLEFT, x + PagedButtonsUI_BUTTON_SIZE - PagedButtonsUI_CHARGES_BACKGROUND_SIZE, y - PagedButtonsUI_BUTTON_SIZE + PagedButtonsUI_CHARGES_BACKGROUND_SIZE) - call BlzFrameSetAbsPoint(PagedButtonsUI___SlotChargesBackgroundFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + PagedButtonsUI_BUTTON_SIZE, y - PagedButtonsUI_BUTTON_SIZE) - call BlzFrameSetTexture(PagedButtonsUI___SlotChargesBackgroundFrame[i], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) - call BlzFrameSetLevel(PagedButtonsUI___SlotChargesBackgroundFrame[i], 1) - - set PagedButtonsUI___SlotChargesFrame[i]=BlzCreateFrameByType("TEXT", "PagedButtonsUICharges" + I2S(i), PagedButtonsUI___SlotChargesBackgroundFrame[i], "", 0) - call BlzFrameSetAllPoints(PagedButtonsUI___SlotChargesFrame[i], PagedButtonsUI___SlotChargesBackgroundFrame[i]) - call BlzFrameSetText(PagedButtonsUI___SlotChargesFrame[i], "|cffFFFFFFCharges|r") - call BlzFrameSetTextAlignment(PagedButtonsUI___SlotChargesFrame[i], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) - call BlzFrameSetScale(PagedButtonsUI___SlotChargesFrame[i], 0.7) - call BlzFrameSetEnable(PagedButtonsUI___SlotChargesFrame[i], false) - call BlzFrameSetLevel(PagedButtonsUI___SlotChargesFrame[i], 2) - set x=x + PagedButtonsUI_BUTTON_SIZE + PagedButtonsUI_BUTTON_SPACE - set i=i + 1 - // every 3 bags start another line - if ( ModuloInteger(i, PagedButtonsUI_MAX_SLOTS_PER_LINE) == 0 ) then - set x=PagedButtonsUI_BUTTON_X - set y=y - PagedButtonsUI_BUTTON_SIZE - PagedButtonsUI_BUTTON_SPACE - endif - endloop - set PagedButtonsUI___TooltipFrame=BlzCreateFrame("EscMenuBackdrop", PagedButtonsUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___TooltipFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_FRAME_X, PagedButtonsUI_TOOLTIP_FRAME_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___TooltipFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_FRAME_X + PagedButtonsUI_TOOLTIP_FRAME_WIDTH, PagedButtonsUI_TOOLTIP_FRAME_Y - PagedButtonsUI_TOOLTIP_FRAME_HEIGHT) - - set PagedButtonsUI___TooltipIcon=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipIconFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___TooltipIcon, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_ICON_X, PagedButtonsUI_TOOLTIP_ICON_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___TooltipIcon, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_ICON_X + PagedButtonsUI_TOOLTIP_ICON_SIZE, PagedButtonsUI_TOOLTIP_ICON_Y - PagedButtonsUI_TOOLTIP_ICON_SIZE) - call BlzFrameSetTexture(PagedButtonsUI___TooltipIcon, "ReplaceableTextures\\WorldEditUI\\Editor-Random-Item.blp", 0, true) - - set PagedButtonsUI___PageNameText=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipPageName", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___PageNameText, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_PAGE_NAME_X, PagedButtonsUI_TOOLTIP_PAGE_NAME_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___PageNameText, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_PAGE_NAME_X + PagedButtonsUI_TOOLTIP_PAGE_NAME_WIDTH, PagedButtonsUI_TOOLTIP_PAGE_NAME_Y - PagedButtonsUI_TOOLTIP_PAGE_NAME_HEIGHT) - - set PagedButtonsUI___SummonFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipSummon", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___SummonFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_SUMMON_X, PagedButtonsUI_SUMMON_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___SummonFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_SUMMON_X + PagedButtonsUI_TOOLTIP_WIDTH, PagedButtonsUI_SUMMON_Y - PagedButtonsUI_SUMMON_HEIGHT) - set PagedButtonsUI___ItemGoldIconFrame=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipGoldFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemGoldIconFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_X, PagedButtonsUI_COST_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemGoldIconFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_X + PagedButtonsUI_COST_ICON_SIZE, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) - call BlzFrameSetTexture(PagedButtonsUI___ItemGoldIconFrame, "UI\\Feedback\\Resources\\ResourceGold.blp", 0, true) - - set PagedButtonsUI___ItemGoldFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipGold", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemGoldFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_GOLD_X, PagedButtonsUI_COST_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemGoldFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_GOLD_X + PagedButtonsUI_COST_WIDTH, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_HEIGHT) - - set PagedButtonsUI___ItemLumberIconFrame=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipLumberFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemLumberIconFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_ICON_LUMBER_X, PagedButtonsUI_COST_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemLumberIconFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_ICON_LUMBER_X + PagedButtonsUI_COST_ICON_SIZE, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) - call BlzFrameSetTexture(PagedButtonsUI___ItemLumberIconFrame, "UI\\Feedback\\Resources\\ResourceLumber.blp", 0, true) - - set PagedButtonsUI___ItemLumberFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipLumber", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemLumberFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_LUMBER_X, PagedButtonsUI_COST_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemLumberFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_LUMBER_X + PagedButtonsUI_COST_WIDTH, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) - - set PagedButtonsUI___ItemFoodIconFrame=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipFoodFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemFoodIconFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_ICON_FOOD_X, PagedButtonsUI_COST_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemFoodIconFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_ICON_FOOD_X + PagedButtonsUI_COST_ICON_SIZE, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) - call BlzFrameSetTexture(PagedButtonsUI___ItemFoodIconFrame, "UI\\Feedback\\Resources\\ResourceSupply.blp", 0, true) - - set PagedButtonsUI___ItemFoodFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipFood", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemFoodFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_FOOD_X, PagedButtonsUI_COST_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___ItemFoodFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_FOOD_X + PagedButtonsUI_COST_WIDTH, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) - - set PagedButtonsUI___TooltipText=BlzCreateFrame("EscMenuTextAreaTemplate", PagedButtonsUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___TooltipText, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_X, PagedButtonsUI_TOOLTIP_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___TooltipText, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_X + PagedButtonsUI_TOOLTIP_WIDTH, PagedButtonsUI_TOOLTIP_Y - PagedButtonsUI_TOOLTIP_HEIGHT) - call BlzFrameSetFont(PagedButtonsUI___TooltipText, "MasterFont", PagedButtonsUI_TOOLTIP_FONT_HEIGHT, 0) - call BlzFrameSetEnable(PagedButtonsUI___TooltipText, false) - call BlzFrameSetTextAlignment(PagedButtonsUI___TooltipText, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_LEFT) - call BlzFrameSetLevel(PagedButtonsUI___TooltipText, 1) - - //call BJDebugMsg("Icon " + GetIconByItemType(itemTypeId) + " for item type " + GetObjectName(itemTypeId)) - set PagedButtonsUI___NextPagesButton=BlzCreateFrame("ScriptDialogButton", PagedButtonsUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___NextPagesButton, FRAMEPOINT_TOPLEFT, PagedButtonsUI_NEXT_PAGE_BUTTON_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___NextPagesButton, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_NEXT_PAGE_BUTTON_X + PagedButtonsUI_PAGE_BUTTON_WIDTH, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CLOSE_BUTTON_HEIGHT) - call BlzFrameSetText(PagedButtonsUI___NextPagesButton, PagedButtonsUI_NEXT_PAGE_TEXT) - set PagedButtonsUI___NextPagesTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___NextPagesTrigger, PagedButtonsUI___NextPagesButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(PagedButtonsUI___NextPagesTrigger, function PagedButtonsUI___NextPagesFunction) - - set PagedButtonsUI___PreviousPagesButton=BlzCreateFrame("ScriptDialogButton", PagedButtonsUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___PreviousPagesButton, FRAMEPOINT_TOPLEFT, PagedButtonsUI_PREVIOUS_PAGE_BUTTON_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___PreviousPagesButton, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_PREVIOUS_PAGE_BUTTON_X + PagedButtonsUI_PAGE_BUTTON_WIDTH, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CLOSE_BUTTON_HEIGHT) - call BlzFrameSetText(PagedButtonsUI___PreviousPagesButton, PagedButtonsUI_PREVIOUS_PAGE_TEXT) - set PagedButtonsUI___PreviousPagesTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___PreviousPagesTrigger, PagedButtonsUI___PreviousPagesButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(PagedButtonsUI___PreviousPagesTrigger, function PagedButtonsUI___PreviousPagesFunction) - set PagedButtonsUI___Checkbox=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___Checkbox, FRAMEPOINT_TOPLEFT, PagedButtonsUI_CHECKBOX_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___Checkbox, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_CHECKBOX_X + PagedButtonsUI_CHECKBOX_SIZE, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CHECKBOX_SIZE) - call BlzFrameSetEnable(PagedButtonsUI___Checkbox, true) - call BlzFrameSetValue(PagedButtonsUI___Checkbox, 1.0) - - set PagedButtonsUI___CheckedTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___CheckedTrigger, PagedButtonsUI___Checkbox, FRAMEEVENT_CHECKBOX_CHECKED) - call TriggerAddAction(PagedButtonsUI___CheckedTrigger, function PagedButtonsUI___CheckedFunction) - - set PagedButtonsUI___UncheckedTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___UncheckedTrigger, PagedButtonsUI___Checkbox, FRAMEEVENT_CHECKBOX_UNCHECKED) - call TriggerAddAction(PagedButtonsUI___UncheckedTrigger, function PagedButtonsUI___UncheckedFunction) - set PagedButtonsUI___CloseButton=BlzCreateFrame("ScriptDialogButton", PagedButtonsUI___BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(PagedButtonsUI___CloseButton, FRAMEPOINT_TOPLEFT, PagedButtonsUI_CLOSE_BUTTON_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) - call BlzFrameSetAbsPoint(PagedButtonsUI___CloseButton, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_CLOSE_BUTTON_X + PagedButtonsUI_CLOSE_BUTTON_WIDTH, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CLOSE_BUTTON_HEIGHT) - call BlzFrameSetText(PagedButtonsUI___CloseButton, PagedButtonsUI_CLOSE_TEXT) - set PagedButtonsUI___CloseTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(PagedButtonsUI___CloseTrigger, PagedButtonsUI___CloseButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(PagedButtonsUI___CloseTrigger, function PagedButtonsUI___CloseFunction) - call HidePagedButtonsUI() -endfunction -function PagedButtonsUI___TriggerActionSelected takes nothing returns nothing - if ( (IsUnitInGroup((GetTriggerUnit()), PagedButtons___shops)) and GetPagedButtonsCount(GetTriggerUnit()) > 0 and (PagedButtonsUI___enabledForPlayer[GetPlayerId((GetTriggerPlayer()))]) ) then // INLINED!! - call ShowPagedButtonsUI(GetTriggerPlayer() , GetTriggerUnit()) - endif -endfunction -function PagedButtonsUI___TriggerConditionChangePage takes nothing returns boolean - local unit shop= (PagedButtons___triggerShop) // INLINED!! - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( shop == PagedButtonsUI___UIShop[i] ) then - call PagedButtonsUI___UpdateItemsForUI(Player(i)) - endif - set i=i + 1 - endloop - set shop=null - return false -endfunction -function PagedButtonsUI___TriggerConditionDeath takes nothing returns boolean - local unit shop= GetTriggerUnit() - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( shop == PagedButtonsUI___UIShop[i] ) then - call HidePagedButtonsUIForPlayer(Player(i)) - endif - set i=i + 1 - endloop - set shop=null - return false -endfunction -function PagedButtonsUI___TriggerActionSyncData takes nothing returns nothing - local player whichPlayer= GetTriggerPlayer() - local integer playerId= GetPlayerId(whichPlayer) - local string data= BlzGetTriggerSyncData() - local integer slot= 0 - local unit shop= PagedButtonsUI___UIShop[playerId] - local integer id= 0 - local integer newPage= 0 - if ( data == "PreviousPage" ) then - if ( PagedButtonsUI___PagesIndex[playerId] == 0 ) then - set PagedButtonsUI___PagesIndex[playerId]=(GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI___UIShop[(playerId)]) / PagedButtonsUI_MAX_SLOTS) // INLINED!! - else - set PagedButtonsUI___PagesIndex[playerId]=PagedButtonsUI___PagesIndex[playerId] - 1 - endif - call PagedButtonsUI___UpdateItemsForUI(whichPlayer) - //call BJDebugMsg("Previous pages button with index " + I2S(PagesIndex[playerId])) - elseif ( data == "NextPage" ) then - if ( PagedButtonsUI___PagesIndex[playerId] < (GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI___UIShop[(playerId)]) / PagedButtonsUI_MAX_SLOTS) ) then // INLINED!! - set PagedButtonsUI___PagesIndex[playerId]=PagedButtonsUI___PagesIndex[playerId] + 1 - else - set PagedButtonsUI___PagesIndex[playerId]=0 - endif - call PagedButtonsUI___UpdateItemsForUI(whichPlayer) - //call BJDebugMsg("Next pages button with index " + I2S(PagesIndex[playerId])) - elseif ( data == "Close" ) then - call HidePagedButtonsUIForPlayer(whichPlayer) - else - set slot=S2I(data) - set id=GetPagedButtonId(shop , slot) - set newPage=GetPagedButtonsPageByIndex(shop , slot) - if ( newPage < GetPagedButtonsMaxPages(shop) and newPage >= 0 ) then - call SetPagedButtonsPage(shop , newPage) - if ( id != 0 and ( (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_UNIT) or (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_ITEM) ) ) then // INLINED!! - call IssueNeutralImmediateOrderById(whichPlayer, shop, id) - endif - endif - endif - set whichPlayer=null - set shop=null -endfunction -function PagedButtonsUI___TimerFunctionStart takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer i= 0 - local player slotPlayer= null - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER ) then - set PagedButtonsUI___enabledForPlayer[i]=true - call BlzTriggerRegisterPlayerSyncEvent(PagedButtonsUI___SyncTrigger, slotPlayer, PagedButtonsUI_PREFIX, false) - endif - set slotPlayer=null - set i=i + 1 - endloop - call TriggerAddAction(PagedButtonsUI___SyncTrigger, function PagedButtonsUI___TriggerActionSyncData) - - call BlzLoadTOCFile(PagedButtonsUI_TOC_FILE) - - call PagedButtonsUI_CreateUI() - - call TriggerRegisterAnyUnitEventBJ(PagedButtonsUI___selectionTrigger, EVENT_PLAYER_UNIT_SELECTED) - // Barade: Using trigger conditions with selection events led to weird behavior, so use a trigger action here. - call TriggerAddAction(PagedButtonsUI___selectionTrigger, function PagedButtonsUI___TriggerActionSelected) - - call TriggerRegisterChangePagedButtons(PagedButtonsUI___changePageButtonsTrigger) - call TriggerAddCondition(PagedButtonsUI___changePageButtonsTrigger, Condition(function PagedButtonsUI___TriggerConditionChangePage)) - - call TriggerRegisterAnyUnitEventBJ(PagedButtonsUI___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(PagedButtonsUI___deathTrigger, Condition(function PagedButtonsUI___TriggerConditionDeath)) - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function PagedButtonsUI___Init takes nothing returns nothing - call TimerStart(CreateTimer(), 0.0, false, function PagedButtonsUI___TimerFunctionStart) - call TriggerAddAction(FrameLoader___actionTrigger, (function PagedButtonsUI_CreateUI)) // INLINED!! - call TriggerAddAction(FrameSaver___saveTrigger, (function HidePagedButtonsUI)) // INLINED!! -endfunction -//library PagedButtonsUI ends -//library QueueUI: -function IsQueueUIEnabledForPlayer takes player whichPlayer returns boolean - return QueueUI___enabledForPlayer[GetPlayerId(whichPlayer)] -endfunction -function QueueUI___SetSlotVisible takes integer i,boolean visible returns nothing - call BlzFrameSetVisible(QueueUI___SlotFrame[i], visible) - call BlzFrameSetVisible(QueueUI___SlotBackdropFrame[i], visible) - call BlzFrameSetVisible(QueueUI___SlotChargesBackdropFrame[i], visible) - call BlzFrameSetVisible(QueueUI___SlotChargesFrame[i], visible) - call BlzFrameSetEnable(QueueUI___SlotTooltip[i], visible) -endfunction -function QueueUI___SetAllSlotChargesVisible takes boolean visible returns nothing - local integer i= 0 - loop - exitwhen ( i >= QueueUI_MAX_SLOTS ) - call QueueUI___SetSlotVisible(i , visible) - set i=i + 1 - endloop -endfunction -function QueueUI___UpdateUIForPlayer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer current= (Queue___playerQueue[GetPlayerId((whichPlayer))]) // INLINED!! - local integer i= 0 - if ( (QueueUI___enabledForPlayer[GetPlayerId((whichPlayer))]) and not QueueUI___checked[playerId] ) then // INLINED!! - loop - exitwhen ( i >= QueueUI_MAX_SLOTS or current == 0 ) - if ( whichPlayer == GetLocalPlayer() ) then - //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) - call BlzFrameSetTexture(QueueUI___SlotBackdropFrame[i], QueueUIConfig_GetIcon(s__Queue_id[current] , whichPlayer), 0, true) - call BlzFrameSetText(QueueUI___SlotTooltip[i], QueueUIConfig_GetName(s__Queue_id[current] , whichPlayer)) - call BlzFrameSetText(QueueUI___SlotChargesFrame[i], I2S(s__Queue_counter[current])) - call BlzFrameSetEnable(QueueUI___SlotTooltip[i], true) - call QueueUI___SetSlotVisible(i , true) - endif - - //call BJDebugMsg("Show slot " + I2S(i) + ": " + BlzGetAbilityIcon(current.id)) - //call BJDebugMsg("UI check " + I2S(current) + " with ID " + GetObjectName(current.id)) - - set current=s__Queue_next[current] - set i=i + 1 - endloop - endif - - loop - exitwhen ( i >= QueueUI_MAX_SLOTS ) - if ( whichPlayer == GetLocalPlayer() ) then - //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) - call BlzFrameSetTexture(QueueUI___SlotBackdropFrame[i], "", 0, true) - call BlzFrameSetEnable(QueueUI___SlotTooltip[i], false) - call QueueUI___SetSlotVisible(i , false) - endif - - set i=i + 1 - endloop -endfunction -function QueueUI___ForForceUpdateUI takes nothing returns nothing - call QueueUI___UpdateUIForPlayer(GetEnumPlayer()) -endfunction -function QueueUI___UpdateUI takes nothing returns nothing - call ForForce(GetPlayersAll(), function QueueUI___ForForceUpdateUI) -endfunction -function QueueUI___GetNextUnitToSelect takes group g,player whichPlayer returns unit - local integer max= BlzGroupGetSize(g) - local integer i= 0 - local unit u= null - local unit result= null - local boolean found= false - if ( max > 0 ) then - loop - exitwhen ( i == max ) - set u=BlzGroupUnitAt(g, i) - if ( IsUnitSelected(u, whichPlayer) ) then - set found=true - elseif ( found ) then - set result=u - endif - set u=null - set i=i + 1 - endloop - - // this happens if none of them is selected or the last one - if ( result == null ) then - set result=BlzGroupUnitAt(g, 0) // start at first - endif - endif - - return result -endfunction -function QueueUI___DistanceBetweenCoordinates takes real x1,real y1,real x2,real y2 returns real - local real dx= ( x2 - x1 ) - local real dy= ( y2 - y1 ) - return SquareRoot(dx * dx + dy * dy) -endfunction -function QueueUI___SmartCameraPanToUnit takes player whichPlayer,unit target,real duration returns nothing - local real dist - local location cameraLoc= GetCameraTargetPositionLoc() - local real x= GetUnitX(target) - local real y= GetUnitY(target) - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - set dist=QueueUI___DistanceBetweenCoordinates(x , y , GetLocationX(cameraLoc) , GetLocationY(cameraLoc)) - if ( dist >= bj_SMARTPAN_TRESHOLD_SNAP ) then - // If the user is too far away, snap the camera. - call PanCameraToTimed(x, y, 0) - elseif ( dist >= bj_SMARTPAN_TRESHOLD_PAN ) then - // If the user is moderately close, pan the camera. - call PanCameraToTimed(x, y, duration) - else - // User is close enough, so don't touch the camera. - endif - endif - call RemoveLocation(cameraLoc) - set cameraLoc=null -endfunction -function QueueUI___SelectNextSource takes player whichPlayer,integer slot returns nothing - local integer q= GetPlayerQueueByIndex(whichPlayer , slot) - local unit n= null - if ( q != 0 ) then - set n=QueueUI___GetNextUnitToSelect(s__Queue_sources[q] , whichPlayer) - - if ( n != null ) then - call SelectUnitForPlayerSingle(n, whichPlayer) - call QueueUI___SmartCameraPanToUnit(whichPlayer , n , 0.0) - endif - endif -endfunction -function QueueUI___TriggerActionSyncData takes nothing returns nothing - local player whichPlayer= GetTriggerPlayer() - local integer playerId= GetPlayerId(whichPlayer) - local string data= BlzGetTriggerSyncData() - local integer slot= 0 - if ( data == "Checked" ) then - set QueueUI___checked[playerId]=true - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetText(QueueUI___CheckboxTooltip, QueueUI_CHECKBOX_TOOLTIP_SHOW) - endif - call QueueUI___UpdateUIForPlayer(whichPlayer) - elseif ( data == "Unchecked" ) then - set QueueUI___checked[playerId]=false - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetText(QueueUI___CheckboxTooltip, QueueUI_CHECKBOX_TOOLTIP_HIDE) - endif - call QueueUI___UpdateUIForPlayer(whichPlayer) - else - set slot=S2I(data) - call QueueUI___SelectNextSource(whichPlayer , slot) - endif - set whichPlayer=null -endfunction -function ShowQueueUI takes nothing returns nothing - call BlzFrameSetVisible(QueueUI___Checkbox, true) - //call BlzFrameSetVisible(CheckboxTooltip, true) - call QueueUI___SetAllSlotChargesVisible(true) -endfunction -function HideQueueUI takes nothing returns nothing - call BlzFrameSetVisible(QueueUI___Checkbox, false) - call BlzFrameSetVisible(QueueUI___CheckboxTooltip, false) - call QueueUI___SetAllSlotChargesVisible(false) -endfunction -function SetQueueUIEnabledForPlayer takes player whichPlayer,boolean enabled returns nothing - set QueueUI___enabledForPlayer[GetPlayerId(whichPlayer)]=enabled - if ( enabled ) then - if ( whichPlayer == GetLocalPlayer() ) then - call ShowQueueUI() - endif - call QueueUI___UpdateUIForPlayer(whichPlayer) - else - if ( whichPlayer == GetLocalPlayer() ) then - call HideQueueUI() - endif - endif -endfunction -function QueueUI___CheckedFunction takes nothing returns nothing - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(QueueUI_PREFIX, "Checked") - endif -endfunction -function QueueUI___UncheckedFunction takes nothing returns nothing - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(QueueUI_PREFIX, "Unchecked") - endif -endfunction -function QueueUI___ClickItemFunction takes nothing returns nothing - local integer handleId= GetHandleId(GetTriggeringTrigger()) - local integer slot= LoadInteger(QueueUI___h, handleId, 0) - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzSendSyncData(QueueUI_PREFIX, I2S(slot)) - endif -endfunction -function QueueUI_CreateUI takes nothing returns nothing - local integer i= 0 - local integer handleId= 0 - local real x= 0.0 - local real y= 0.0 - set x=QueueUI_CHECK_BOX_X - set y=QueueUI_CHECK_BOX_Y - - set QueueUI___Checkbox=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(QueueUI___Checkbox, FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(QueueUI___Checkbox, FRAMEPOINT_BOTTOMRIGHT, x + QueueUI_CHECK_BOX_SIZE, y - QueueUI_CHECK_BOX_SIZE) - - set QueueUI___CheckboxTooltip=BlzCreateFrameByType("TEXT", "QueueUICheckboxTooltip", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetTooltip(QueueUI___Checkbox, QueueUI___CheckboxTooltip) - call BlzFrameSetPoint(QueueUI___CheckboxTooltip, FRAMEPOINT_BOTTOM, QueueUI___Checkbox, FRAMEPOINT_TOP, 0, 0.01) - call BlzFrameSetFont(QueueUI___CheckboxTooltip, "fonts\\dfst-m3u.ttf", QueueUI_TOOLTIP_FONT_HEIGHT, 0) - call BlzFrameSetText(QueueUI___CheckboxTooltip, QueueUI_CHECKBOX_TOOLTIP_HIDE) - - set QueueUI___CheckboxCheckedTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(QueueUI___CheckboxCheckedTrigger, QueueUI___Checkbox, FRAMEEVENT_CHECKBOX_CHECKED) - call TriggerAddAction(QueueUI___CheckboxCheckedTrigger, function QueueUI___CheckedFunction) - - set QueueUI___CheckboxUncheckedTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(QueueUI___CheckboxUncheckedTrigger, QueueUI___Checkbox, FRAMEEVENT_CHECKBOX_UNCHECKED) - call TriggerAddAction(QueueUI___CheckboxUncheckedTrigger, function QueueUI___UncheckedFunction) - - set x=QueueUI_BUTTON_X - set y=QueueUI_BUTTON_Y - set i=0 - loop - exitwhen ( i == QueueUI_MAX_SLOTS ) - set QueueUI___SlotFrame[i]=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(QueueUI___SlotFrame[i], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(QueueUI___SlotFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + QueueUI_BUTTON_SIZE, y - QueueUI_BUTTON_SIZE) - //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(0), 0, true) - //call BlzFrameSetText(SlotFrame[index], I2S(index)) - set QueueUI___SlotBackdropFrame[i]=BlzCreateFrameByType("BACKDROP", "QueueUIBackdropFrame" + I2S(i), QueueUI___SlotFrame[i], "", 1) - call BlzFrameSetAllPoints(QueueUI___SlotBackdropFrame[i], QueueUI___SlotFrame[i]) -// call BlzFrameSetTexture(SlotBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) - // TODO Set Tooltip frame for the object name - - set QueueUI___SlotChargesBackdropFrame[i]=BlzCreateFrameByType("BACKDROP", "QueueUIChargesBackdropFrame" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(QueueUI___SlotChargesBackdropFrame[i], FRAMEPOINT_TOPLEFT, x + QueueUI_BUTTON_SIZE - QueueUI_CHARGES_SIZE, y - QueueUI_BUTTON_SIZE + QueueUI_CHARGES_SIZE) - call BlzFrameSetAbsPoint(QueueUI___SlotChargesBackdropFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + QueueUI_BUTTON_SIZE, y - QueueUI_BUTTON_SIZE) - call BlzFrameSetTexture(QueueUI___SlotChargesBackdropFrame[i], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) - call BlzFrameSetLevel(QueueUI___SlotChargesBackdropFrame[i], 1) - - set QueueUI___SlotChargesFrame[i]=BlzCreateFrameByType("TEXT", "QueueUIChargesFrame" + I2S(i), QueueUI___SlotChargesBackdropFrame[i], "", 0) - call BlzFrameSetAllPoints(QueueUI___SlotChargesFrame[i], QueueUI___SlotChargesBackdropFrame[i]) - call BlzFrameSetTextAlignment(QueueUI___SlotChargesFrame[i], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) - call BlzFrameSetScale(QueueUI___SlotChargesFrame[i], 0.7) - call BlzFrameSetEnable(QueueUI___SlotChargesFrame[i], false) - call BlzFrameSetLevel(QueueUI___SlotChargesFrame[i], 2) - - set QueueUI___SlotClickTrigger[i]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(QueueUI___SlotClickTrigger[i], QueueUI___SlotFrame[i], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(QueueUI___SlotClickTrigger[i], function QueueUI___ClickItemFunction) - set handleId=GetHandleId(QueueUI___SlotClickTrigger[i]) - call SaveInteger(QueueUI___h, handleId, 0, i) - - set QueueUI___SlotTooltip[i]=BlzCreateFrameByType("TEXT", "QueueUITooltip" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetTooltip(QueueUI___SlotFrame[i], QueueUI___SlotTooltip[i]) - call BlzFrameSetPoint(QueueUI___SlotTooltip[i], FRAMEPOINT_BOTTOM, QueueUI___SlotFrame[i], FRAMEPOINT_TOP, 0, 0.01) - call BlzFrameSetFont(QueueUI___SlotTooltip[i], "fonts\\dfst-m3u.ttf", QueueUI_TOOLTIP_FONT_HEIGHT, 0) - call BlzFrameSetEnable(QueueUI___SlotTooltip[i], false) - set x=x + QueueUI_BUTTON_SIZE + QueueUI_BUTTON_SPACE - set i=i + 1 - endloop - call ForForce(GetPlayersAll(), function QueueUI___ForForceUpdateUI) // INLINED!! -endfunction -function QueueUI___TriggerActionUpdateQueue takes nothing returns nothing - //call BJDebugMsg("Queue update " + GetObjectName(GetTriggerQueueId())) - call QueueUI___UpdateUIForPlayer(GetOwningPlayer((Queue___triggerUnit))) // INLINED!! -endfunction -function QueueUI___TimerFunctionStart takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer i= 0 - local player slotPlayer= null - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER ) then - set QueueUI___enabledForPlayer[i]=true - call BlzTriggerRegisterPlayerSyncEvent(QueueUI___syncTrigger, slotPlayer, QueueUI_PREFIX, false) - endif - set slotPlayer=null - set i=i + 1 - endloop - call TriggerAddAction(QueueUI___syncTrigger, function QueueUI___TriggerActionSyncData) - - call QueueUI_CreateUI() - - call TriggerRegisterQueueEvent(QueueUI___queueTrigger) - call TriggerAddAction(QueueUI___queueTrigger, function QueueUI___TriggerActionUpdateQueue) - - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function QueueUI___Init takes nothing returns nothing - call TimerStart(CreateTimer(), 0.0, false, function QueueUI___TimerFunctionStart) - call TriggerAddAction(FrameLoader___actionTrigger, (function QueueUI_CreateUI)) // INLINED!! -endfunction -//library QueueUI ends -//library ResourcesGui: -function ResourcesGui___SetResourcesUIVisibleAll takes boolean visible returns nothing - call BlzFrameSetVisible(ResourcesGui___IconFrame, visible) - call BlzFrameSetVisible(ResourcesGui___TextFrame, visible) -endfunction -function ResourcesGui___SetResourcesUIGatheredVisibleAll takes boolean visible returns nothing - call BlzFrameSetVisible(ResourcesGui___IconFrameGathered, visible) - call BlzFrameSetVisible(ResourcesGui___TextFrameGathered, visible) - call BlzFrameSetVisible(ResourcesGui___IconFrameGathered2, visible) - call BlzFrameSetVisible(ResourcesGui___TextFrameGathered2, visible) -endfunction -function ResourcesGui___SetResourcesUIGathered2VisibleAll takes boolean visible returns nothing - call BlzFrameSetVisible(ResourcesGui___IconFrameGathered2, visible) - call BlzFrameSetVisible(ResourcesGui___TextFrameGathered2, visible) -endfunction -function ResourcesGui___SetResourcesUIVisible takes player whichPlayer,boolean visible returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call ResourcesGui___SetResourcesUIVisibleAll(visible) - endif -endfunction -function ResourcesGui___SetResourcesUIGatheredVisible takes player whichPlayer,boolean visible returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call ResourcesGui___SetResourcesUIGatheredVisibleAll(visible) - endif -endfunction -function ResourcesGui___ShowResourcesUI takes player whichPlayer returns nothing - call ResourcesGui___SetResourcesUIVisible(whichPlayer , true) -endfunction -function ResourcesGui___HideResourcesUI takes player whichPlayer returns nothing - call ResourcesGui___SetResourcesUIVisible(whichPlayer , false) -endfunction -function ResourcesGui___ShowResourcesGatheredUI takes player whichPlayer returns nothing - call ResourcesGui___SetResourcesUIGatheredVisible(whichPlayer , true) -endfunction -function ResourcesGui___HideResourcesGatheredUI takes player whichPlayer returns nothing - call ResourcesGui___SetResourcesUIGatheredVisible(whichPlayer , false) -endfunction -function ResourcesGui___CreateResourcesUI takes nothing returns nothing - set ResourcesGui___IconFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(ResourcesGui___IconFrame, FRAMEPOINT_TOPLEFT, ResourcesGui___X, ResourcesGui___Y) - call BlzFrameSetAbsPoint(ResourcesGui___IconFrame, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___X + ResourcesGui___WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) - call BlzFrameSetLevel(ResourcesGui___IconFrame, 1) - set ResourcesGui___TextFrame=BlzCreateFrameByType("TEXT", "ResourceGuiText", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(ResourcesGui___TextFrame, FRAMEPOINT_TOPLEFT, ResourcesGui___TEXT_X, ResourcesGui___Y) - call BlzFrameSetAbsPoint(ResourcesGui___TextFrame, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___TEXT_X + ResourcesGui___TEXT_WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) - call BlzFrameSetText(ResourcesGui___TextFrame, "Resource") - call BlzFrameSetTextAlignment(ResourcesGui___TextFrame, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) - call BlzFrameSetScale(ResourcesGui___TextFrame, 1.0) - call BlzFrameSetLevel(ResourcesGui___TextFrame, 1) - - set ResourcesGui___IconFrameGathered=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered, FRAMEPOINT_TOPLEFT, ResourcesGui___X_GATHERED, ResourcesGui___Y_GATHERED) - call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___X_GATHERED + ResourcesGui___WIDTH, ResourcesGui___Y_GATHERED - ResourcesGui___HEIGHT) - call BlzFrameSetLevel(ResourcesGui___IconFrameGathered, 1) - set ResourcesGui___TextFrameGathered=BlzCreateFrameByType("TEXT", "ResourceGuiTextGathered", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered, FRAMEPOINT_TOPLEFT, ResourcesGui___TEXT_X_GATHERED, ResourcesGui___Y_GATHERED) - call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___TEXT_X_GATHERED + ResourcesGui___TEXT_WIDTH, ResourcesGui___Y_GATHERED - ResourcesGui___HEIGHT) - call BlzFrameSetText(ResourcesGui___TextFrameGathered, "Resource") - call BlzFrameSetTextAlignment(ResourcesGui___TextFrameGathered, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) - call BlzFrameSetScale(ResourcesGui___TextFrameGathered, 1.0) - call BlzFrameSetLevel(ResourcesGui___TextFrameGathered, 1) - - set ResourcesGui___IconFrameGathered2=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered2, FRAMEPOINT_TOPLEFT, ResourcesGui___X_GATHERED, ResourcesGui___Y) - call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered2, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___X_GATHERED + ResourcesGui___WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) - call BlzFrameSetLevel(ResourcesGui___IconFrameGathered2, 1) - set ResourcesGui___TextFrameGathered2=BlzCreateFrameByType("TEXT", "ResourceGuiTextGathered2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered2, FRAMEPOINT_TOPLEFT, ResourcesGui___TEXT_X_GATHERED, ResourcesGui___Y) - call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered2, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___TEXT_X_GATHERED + ResourcesGui___TEXT_WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) - call BlzFrameSetText(ResourcesGui___TextFrameGathered2, "Resource") - call BlzFrameSetTextAlignment(ResourcesGui___TextFrameGathered2, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) - call BlzFrameSetScale(ResourcesGui___TextFrameGathered2, 1.0) - call BlzFrameSetLevel(ResourcesGui___TextFrameGathered2, 1) - // hide for all players - call ResourcesGui___SetResourcesUIVisibleAll(false) - call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) - call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) -endfunction -function ResourcesGui___GetPrimaryResourceEx takes unit mine,integer ignore returns integer - local integer resource= 0 - local integer result= 0 - local integer current= 0 - local integer currentMax= 0 - local integer v= 0 - local integer w= 0 - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - loop - exitwhen ( i == max ) - set resource=(s__Resource_resources[(i)]) // INLINED!! - if ( resource != ignore ) then - set v=(LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( resource) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) // INLINED!! - set w=(LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( resource) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) // INLINED!! - if ( v > current ) then - set result=resource - set current=v - elseif ( not IsStandardResource(resource) and current == 0 and w > currentMax ) then - set result=resource - set currentMax=w - endif - endif - set i=i + 1 - endloop - return result -endfunction -function ResourcesGui___GetPrimaryResource takes unit mine returns integer - return ResourcesGui___GetPrimaryResourceEx(mine , 0) -endfunction -function ResourcesGui___GetResourceGatheredText takes unit worker,integer resource returns string - local string text= "|cffffcc00" + (s__Resource_name[(resource)]) + ":|r|n " + I2S((LoadInteger(Resources___h, GetHandleId((worker )), Resources___Index2D(( resource) , Resources___KEY_RESOURCE , Resources___KEY_MAX)))) + "/" + I2S((LoadInteger(Resources___h, GetHandleId((worker )), Resources___Index2D(( resource) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX)))) // INLINED!! - if ( GetPlayerResourceBonus(GetOwningPlayer(worker) , resource) > 0 ) then - set text=text + "|n|c0000ff00+" + I2S(GetPlayerResourceBonus(GetOwningPlayer(worker) , resource)) + "|r" - elseif ( GetPlayerResourceBonus(GetOwningPlayer(worker) , resource) < 0 ) then - set text=text + "|n|c00ff0000-" + I2S(GetPlayerResourceBonus(GetOwningPlayer(worker) , resource)) + "|r" - endif - return text -endfunction -function ResourcesGui___UpdateGathered takes player whichPlayer,unit worker returns nothing - local integer resource= (ResourcesGui___GetPrimaryResourceEx((worker) , 0)) // INLINED!! - local integer resource2= ResourcesGui___GetPrimaryResourceEx(worker , resource) - //call BJDebugMsg("resource " + I2S(resource)) - if ( GetLocalPlayer() == whichPlayer ) then - if ( resource != 0 ) then - call BlzFrameSetTexture(ResourcesGui___IconFrameGathered, (s__Resource_iconAtt[(resource)]), 0, true) // INLINED!! - call BlzFrameSetText(ResourcesGui___TextFrameGathered, ResourcesGui___GetResourceGatheredText(worker , resource)) - //call BJDebugMsg("Icon mine " + GetResourceIcon(resource)) - //call BJDebugMsg("Text mine " + BlzFrameGetText(TextFrame)) - call ResourcesGui___SetResourcesUIGatheredVisibleAll(true) - else - call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) - endif - - if ( resource2 != 0 ) then - call BlzFrameSetTexture(ResourcesGui___IconFrameGathered2, (s__Resource_iconAtt[(resource2)]), 0, true) // INLINED!! - call BlzFrameSetText(ResourcesGui___TextFrameGathered2, ResourcesGui___GetResourceGatheredText(worker , resource2)) - call ResourcesGui___SetResourcesUIGathered2VisibleAll(true) - else - call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) - endif - endif -endfunction -function ResourcesGui___ForGroupPrint takes nothing returns nothing - call h__BJDebugMsg(GetUnitName(GetEnumUnit())) -endfunction -function PrintResourcesGuiSelection takes player whichPlayer returns nothing - call h__BJDebugMsg("current selected unit from system " + GetUnitName(ResourcesGui___currentMine[GetPlayerId(whichPlayer)])) - call h__BJDebugMsg("current selected unit by player " + GetUnitName(GetSingleSelectedUnit(whichPlayer))) -endfunction -function ResourcesGui___HasNonEmptyCargo takes unit mine returns boolean - return (CountUnitsInGroup(UnitEventEx__CargoGroup[((GetUnitUserData(((mine)))))])) > 0 // INLINED!! -endfunction -function ResourcesGui___HasProgressBar takes unit mine returns boolean - return IsUnitInGroup(mine, ResourcesGui___progressBarUnits) -endfunction -function UpdatePlayerResourceSelectionGui takes player whichPlayer returns nothing - local integer resource= 0 - local integer playerId= GetPlayerId(whichPlayer) - set ResourcesGui___currentMine[playerId]=GetSingleSelectedUnit(whichPlayer) - // heroes have no space for the icons - if ( IsUnitType(ResourcesGui___currentMine[playerId], UNIT_TYPE_HERO) ) then - set ResourcesGui___currentMine[playerId]=null - endif - - // with cargo there is no space for icons - if ( ResourcesGui___currentMine[playerId] != null and ((CountUnitsInGroup(UnitEventEx__CargoGroup[((GetUnitUserData((((ResourcesGui___currentMine[playerId]))))))])) > 0) ) then // INLINED!! - set ResourcesGui___currentMine[playerId]=null - endif - if ( ResourcesGui___currentMine[playerId] != null and (IsUnitInGroup((ResourcesGui___currentMine[playerId]), ResourcesGui___progressBarUnits)) ) then // INLINED!! - set ResourcesGui___currentMine[playerId]=null - endif - //call BJDebugMsg("XXXXXXXXXXXX") - if ( ResourcesGui___currentMine[playerId] != null ) then - set resource=(ResourcesGui___GetPrimaryResourceEx((ResourcesGui___currentMine[playerId]) , 0)) // INLINED!! - - //call PrintResourcesGuiSelection(whichPlayer) - //call BJDebugMsg("mine " + GetUnitName(currentMine[playerId]) + " with primary resource " + I2S(resource)) - if ( (IsUnitInGroup((ResourcesGui___currentMine[playerId]), Resources___mines)) and IsAlliedMine(ResourcesGui___currentMine[playerId] , whichPlayer) ) then // INLINED!! - // call BJDebugMsg("is mine") - if ( resource != 0 ) then - //call BJDebugMsg("Show mine " + GetUnitName(currentMine[playerId])) - if ( GetLocalPlayer() == whichPlayer ) then - call BlzFrameSetTexture(ResourcesGui___IconFrame, (s__Resource_iconAtt[(resource)]), 0, true) // INLINED!! - call BlzFrameSetText(ResourcesGui___TextFrame, "|cffffcc00" + (s__Resource_name[(resource)]) + ":|r|n " + I2S((LoadInteger(Resources___h, GetHandleId((ResourcesGui___currentMine[playerId] )), Resources___Index2D(( resource) , Resources___KEY_RESOURCE , Resources___KEY_MAX))))) // INLINED!! - //call BJDebugMsg("Icon mine " + GetResourceIcon(resource)) - //call BJDebugMsg("Text mine " + BlzFrameGetText(TextFrame)) - call ResourcesGui___SetResourcesUIVisibleAll(true) - call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) - call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) - endif - else - //call BJDebugMsg("selection counter is not 1 " + I2S(selectionCounter[playerId] )) - //call BJDebugMsg("Hide mine " + GetUnitName(selected)) - if ( GetLocalPlayer() == whichPlayer ) then - call ResourcesGui___SetResourcesUIVisibleAll(false) - call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) - call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) - endif - endif - elseif ( resource != 0 and IsAlliedMine(ResourcesGui___currentMine[playerId] , whichPlayer) ) then - //call BJDebugMsg("Update gathered resources UI for player " + GetPlayerName(whichPlayer)) - call ResourcesGui___SetResourcesUIVisibleAll(false) - call ResourcesGui___UpdateGathered(whichPlayer , ResourcesGui___currentMine[playerId]) - else - //call BJDebugMsg("Hide gathered resources UI for player " + GetPlayerName(whichPlayer)) - call ResourcesGui___SetResourcesUIVisibleAll(false) - call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) - call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) - endif - else - //call BJDebugMsg("Hide all resources UI for player " + GetPlayerName(whichPlayer)) - call ResourcesGui___SetResourcesUIVisibleAll(false) - call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) - call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) - endif -endfunction -function ResourcesGui___TriggerActionTmp takes nothing returns nothing - call UpdatePlayerResourceSelectionGui(ResourcesGui___tmpPlayer) -endfunction -function ResourcesGui___TimerFunctionUpdate takes nothing returns nothing - local integer playerId= LoadInteger(ResourcesGui___h, GetHandleId(GetExpiredTimer()), 0) - //call BJDebugMsg("Timer function with playerId " + I2S(playerId)) - // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. - set ResourcesGui___tmpPlayer=Player(playerId) - call TriggerExecute(ResourcesGui___tmpTrigger) - set ResourcesGui___updateTimerRunning[playerId]=false -endfunction -function ResourcesGui___StartUpdateTimer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - if ( not ResourcesGui___updateTimerRunning[playerId] ) then - set ResourcesGui___updateTimerRunning[playerId]=true - call TimerStart(ResourcesGui___updateTimer[playerId], 0.0, false, function ResourcesGui___TimerFunctionUpdate) - endif -endfunction -function ResourcesGui_StartUpdateTimerForUnits takes unit u0,unit u1 returns nothing - local player slotPlayer= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( GetPlayerController(slotPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and ( ( u0 != null and IsUnitSelected(u0, slotPlayer) ) or ( u1 != null and IsUnitSelected(u1, slotPlayer) ) ) ) then - call ResourcesGui___StartUpdateTimer(slotPlayer) - endif - set slotPlayer=null - set i=i + 1 - endloop -endfunction -function ResourcesGui___TriggerConditionSelected takes nothing returns boolean - // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. - call ResourcesGui___StartUpdateTimer(GetTriggerPlayer()) - return false -endfunction -function ResourcesGui___TriggerConditionDeselected takes nothing returns boolean - // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. - call ResourcesGui___StartUpdateTimer(GetTriggerPlayer()) - return false -endfunction -function ResourcesGui___TriggerActionGather takes nothing returns nothing - // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. - call ResourcesGui_StartUpdateTimerForUnits((Resources___triggerWorker) , (Resources___triggerMine)) // INLINED!! -endfunction -function ResourcesGui___TriggerActionReturn takes nothing returns nothing - // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. - call ResourcesGui_StartUpdateTimerForUnits((Resources___triggerWorker) , (Resources___triggerReturnBuilding)) // INLINED!! -endfunction -function ResourcesGui___TimerFunctionCreateUI takes nothing returns nothing - call ResourcesGui___CreateResourcesUI() - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function ResourcesGui___TriggerActionProgressBarStart takes nothing returns nothing - if ( not IsUnitInGroup(GetTriggerUnit(), ResourcesGui___progressBarUnits) ) then - call GroupAddUnit(ResourcesGui___progressBarUnits, GetTriggerUnit()) - call ResourcesGui_StartUpdateTimerForUnits(GetTriggerUnit() , null) - endif -endfunction -function ResourcesGui___TriggerActionProgressBarFinish takes nothing returns nothing - if ( IsUnitInGroup(GetTriggerUnit(), ResourcesGui___progressBarUnits) ) then - call GroupRemoveUnit(ResourcesGui___progressBarUnits, GetTriggerUnit()) - call ResourcesGui_StartUpdateTimerForUnits(GetTriggerUnit() , null) - endif -endfunction -function ResourcesGui___Init takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set ResourcesGui___currentMine[i]=null - set ResourcesGui___updateTimer[i]=CreateTimer() - call SaveInteger(ResourcesGui___h, GetHandleId(ResourcesGui___updateTimer[i]), 0, i) - set i=i + 1 - endloop - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___selectionTrigger, EVENT_PLAYER_UNIT_SELECTED) - call TriggerAddCondition(ResourcesGui___selectionTrigger, Condition(function ResourcesGui___TriggerConditionSelected)) - - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___deselectionTrigger, EVENT_PLAYER_UNIT_DESELECTED) - call TriggerAddCondition(ResourcesGui___deselectionTrigger, Condition(function ResourcesGui___TriggerConditionDeselected)) - - call TriggerRegisterGatherEvent(ResourcesGui___gatherTrigger) - // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. - call TriggerAddAction(ResourcesGui___gatherTrigger, function ResourcesGui___TriggerActionGather) - - call TriggerRegisterReturnEvent(ResourcesGui___returnTrigger) - // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. - call TriggerAddAction(ResourcesGui___returnTrigger, function ResourcesGui___TriggerActionReturn) - call TimerStart(CreateTimer(), 0.0, false, function ResourcesGui___TimerFunctionCreateUI) - - call TriggerAddAction(ResourcesGui___tmpTrigger, function ResourcesGui___TriggerActionTmp) - - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarStartTrigger, EVENT_PLAYER_UNIT_UPGRADE_START) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarStartTrigger, EVENT_PLAYER_UNIT_RESEARCH_START) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarStartTrigger, EVENT_PLAYER_UNIT_TRAIN_START) - // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. - call TriggerAddAction(ResourcesGui___progressBarStartTrigger, function ResourcesGui___TriggerActionProgressBarStart) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_UPGRADE_CANCEL) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_RESEARCH_CANCEL) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_TRAIN_CANCEL) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_TRAIN_FINISH) - call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_DEATH) - // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. - call TriggerAddAction(ResourcesGui___progressBarFinishTrigger, function ResourcesGui___TriggerActionProgressBarFinish) - - call TriggerAddAction(FrameLoader___actionTrigger, (function ResourcesGui___CreateResourcesUI)) // INLINED!! -endfunction -function ResourcesGui___RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, ResourcesGui___progressBarUnits) ) then - call GroupRemoveUnit(ResourcesGui___progressBarUnits, whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit ResourcesGui___RemoveUnitHook -//library ResourcesGui ends -//library ResourcesLoadedMines: -function GetResourcesLoadedMinesTimerHandleId takes nothing returns integer - return GetHandleId(ResourcesLoadedMines___harvestTimer) -endfunction -function ResourcesLoadedMines___Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer - return ( ( Value1 * MaxValue2 ) + Value2 ) -endfunction -function IsLoadedMine takes unit mine returns boolean - return IsUnitInGroup(mine, ResourcesLoadedMines___mines) -endfunction -function SetLoadedMineHarvestBonusPerWorker takes unit mine,integer bonus returns nothing - call SaveInteger(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(0 , ResourcesLoadedMines___KEY_HARVEST_BONUS_PER_WORKER , ResourcesLoadedMines___MAX_KEYS), bonus) -endfunction -function GetLoadedMineHarvestBonusPerWorker takes unit mine returns integer - return LoadInteger(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(0 , ResourcesLoadedMines___KEY_HARVEST_BONUS_PER_WORKER , ResourcesLoadedMines___MAX_KEYS)) -endfunction -function SetLoadedMineAllowedWorkerUnitTypeId takes unit mine,integer unitTypeId,boolean allowed returns nothing - call SaveBoolean(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(unitTypeId , ResourcesLoadedMines___KEY_ALLOWED_WORKER_UNIT_TYPE_ID , ResourcesLoadedMines___MAX_KEYS), allowed) -endfunction -function GetLoadedMineAllowedWorkerUnitTypeId takes unit mine,integer unitTypeId returns boolean - return LoadBoolean(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(unitTypeId , ResourcesLoadedMines___KEY_ALLOWED_WORKER_UNIT_TYPE_ID , ResourcesLoadedMines___MAX_KEYS)) -endfunction -function AddLoadedMineWorkerUnitTypeId takes unit mine,integer unitTypeId returns nothing - call SetLoadedMineAllowedWorkerUnitTypeId(mine , unitTypeId , true) -endfunction -function AddLoadedMine takes unit mine,integer resource,integer max,integer harvestBonusPerWorker returns nothing - call AddMineEx(mine , resource , max) - call GroupAddUnit(ResourcesLoadedMines___mines, mine) - call SetLoadedMineHarvestBonusPerWorker(mine , harvestBonusPerWorker) - call SetUnitDisableStopMiningOnError(mine , true) -endfunction -function RemoveLoadedMine takes unit mine returns nothing - call RemoveMine(mine) - call GroupRemoveUnit(ResourcesLoadedMines___mines, mine) - call FlushChildHashtable(ResourcesLoadedMines___h, GetHandleId(mine)) -endfunction -function PauseHarvestTimer takes nothing returns nothing - call PauseTimer(ResourcesLoadedMines___harvestTimer) -endfunction -function ResumeHarvestTimer takes nothing returns nothing - call ResumeTimer(ResourcesLoadedMines___harvestTimer) -endfunction -function ResourcesLoadedMines___GetFirstWorkerInLoadedMine takes unit mine returns unit - local group cargo= (s__UnitEventEx__Cargo_copyGroup((GetUnitUserData(((mine)))))) // INLINED!! - local unit first= FirstOfGroup(cargo) - call GroupClear(cargo) - call DestroyGroup(cargo) - set cargo=null - return first -endfunction -function ResourcesLoadedMines___HarvestMine takes unit mine,integer amount returns nothing - local unit firstWorker= ResourcesLoadedMines___GetFirstWorkerInLoadedMine(mine) - local integer r= 0 - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - local integer actualAmount= 0 - loop - exitwhen ( i == max ) - set r=(s__Resource_resources[(i)]) // INLINED!! - set actualAmount=(LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) // INLINED!! - if ( actualAmount > 0 ) then - set actualAmount=IMinBJ(actualAmount, amount + GetPlayerResourceBonus(GetOwningPlayer(mine) , r)) - call SetUnitResource(mine , r , (LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) - actualAmount) // INLINED!! - call CustomBountyEx(mine , GetOwningPlayer(firstWorker) , r , actualAmount) - call ExecuteGatherCallbacks(mine , firstWorker , r , actualAmount) - endif - set i=i + 1 - endloop - set firstWorker=null -endfunction -function ResourcesLoadedMines___ForGroupHarvest takes nothing returns nothing - local unit mine= GetEnumUnit() - local integer cargoSize= 0 - local integer amount= 0 - if ( not IsUnitPaused(mine) ) then - set cargoSize=(CountUnitsInGroup(UnitEventEx__CargoGroup[((GetUnitUserData(((mine)))))])) // INLINED!! - if ( cargoSize > 0 ) then - set amount=cargoSize * (LoadInteger(ResourcesLoadedMines___h, GetHandleId((mine)), ResourcesLoadedMines___Index2D(0 , ResourcesLoadedMines___KEY_HARVEST_BONUS_PER_WORKER , ResourcesLoadedMines___MAX_KEYS))) // INLINED!! - if ( amount > 0 ) then - call QueueUnitAnimation(mine, "stand work") - - call ResourcesLoadedMines___HarvestMine(mine , amount) - - if ( IsMineEmpty(mine) ) then - if ( (LoadBoolean(Resources___h, GetHandleId((mine)), Resources___Index2D(0 , Resources___KEY_EXPLODE_ON_DEATH , Resources___KEY_MAX))) ) then // INLINED!! - call KillUnit(mine) - else - call RemoveLoadedMine(mine) - endif - endif - endif - endif - else - call ResetUnitAnimation(mine) - endif - set mine=null -endfunction -function ResourcesLoadedMines___TimerFunctionHarvest takes nothing returns nothing - call ForGroup(ResourcesLoadedMines___mines, function ResourcesLoadedMines___ForGroupHarvest) -endfunction -function ResourcesLoadedMines___TriggerConditionOrder takes nothing returns boolean - local integer orderId= GetIssuedOrderId() - local unit worker= GetOrderTargetUnit() - local unit mine= GetTriggerUnit() - if ( orderId == ResourcesLoadedMines_ORDER_ID_LOAD and mine != null and (IsUnitInGroup((mine), ResourcesLoadedMines___mines)) and not (LoadBoolean(ResourcesLoadedMines___h, GetHandleId((mine )), ResourcesLoadedMines___Index2D(( GetUnitTypeId(worker)) , ResourcesLoadedMines___KEY_ALLOWED_WORKER_UNIT_TYPE_ID , ResourcesLoadedMines___MAX_KEYS))) ) then // INLINED!! - call IssueImmediateOrder(worker, "stop") - call SimError(GetOwningPlayer(worker) , "Not allowed to harvest.") - endif - set worker=null - set mine=null - return false -endfunction -function ResourcesLoadedMines___TriggerConditionDeath takes nothing returns boolean - if ( (IsUnitInGroup((GetTriggerUnit()), ResourcesLoadedMines___mines)) ) then // INLINED!! - call RemoveLoadedMine(GetTriggerUnit()) - endif - return false -endfunction -function ResourcesLoadedMines___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(ResourcesLoadedMines___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) - call TriggerAddCondition(ResourcesLoadedMines___orderTrigger, Condition(function ResourcesLoadedMines___TriggerConditionOrder)) - - call TriggerRegisterAnyUnitEventBJ(ResourcesLoadedMines___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(ResourcesLoadedMines___deathTrigger, Condition(function ResourcesLoadedMines___TriggerConditionDeath)) - - call TimerStart(ResourcesLoadedMines___harvestTimer, ResourcesLoadedMines_HARVEST_INTERVAL, true, function ResourcesLoadedMines___TimerFunctionHarvest) -endfunction -//library ResourcesLoadedMines ends -//library Tunnel: -function Tunnel___IsLoaded takes unit whichUnit returns boolean - return IsUnitInGroup(whichUnit, Tunnel___loaded) -endfunction -function Tunnel___IsCopy takes unit whichUnit returns boolean - return IsUnitInGroup(whichUnit, Tunnel___copies) -endfunction -function Tunnel___IsCopyOf takes unit whichUnit,unit source returns boolean - return LoadUnitHandle(Tunnel___h, GetHandleId(whichUnit), Tunnel___KEY_SOURCE) == source -endfunction -function Tunnel___GetCopySource takes unit whichUnit returns unit - return LoadUnitHandle(Tunnel___h, GetHandleId(whichUnit), Tunnel___KEY_SOURCE) -endfunction -function Tunnel___GetTunnel takes unit whichUnit returns unit - return LoadUnitHandle(Tunnel___h, GetHandleId(whichUnit), Tunnel___KEY_TUNNEL) -endfunction -function Tunnel___MoveToUnloadPosition takes unit whichUnit returns nothing - local integer handleId= GetHandleId(whichUnit) - if ( HaveSavedReal(Tunnel___h, handleId, Tunnel___KEY_X) ) then - call SetUnitX(whichUnit, LoadReal(Tunnel___h, handleId, Tunnel___KEY_X)) - call SetUnitY(whichUnit, LoadReal(Tunnel___h, handleId, Tunnel___KEY_Y)) - endif -endfunction -function Tunnel___SetUnloadPosition takes unit whichUnit,real x,real y returns nothing - local integer handleId= GetHandleId(whichUnit) - call SaveReal(Tunnel___h, handleId, Tunnel___KEY_X, x) - call SaveReal(Tunnel___h, handleId, Tunnel___KEY_Y, y) -endfunction -function Tunnel___CopyUnit takes unit whichUnit,real x,real y,real face returns unit - local unit copy= CreateUnit(GetOwningPlayer(whichUnit), GetUnitTypeId(whichUnit), x, y, face) - call SetUnitUseFood(copy, false) - call SetUnitInvulnerable(copy, true) - if ( IsUnitType(copy, UNIT_TYPE_HERO) ) then - call BlzSetUnitBooleanField(copy, UNIT_BF_HERO_HIDE_HERO_INTERFACE_ICON, true) - endif - call GroupAddUnit(Tunnel___copies, copy) - call SaveUnitHandle(Tunnel___h, GetHandleId(copy), Tunnel___KEY_SOURCE, whichUnit) - - return copy -endfunction -function IsTunnel takes integer unitTypeId returns boolean - if ( unitTypeId == Tunnel_UNIT_TYPE_ID ) then - return true - elseif ( unitTypeId == Tunnel_UNIT_TYPE_ID_2 ) then - return true - endif - return false -endfunction -function IsUnitTunnel takes unit whichUnit returns boolean - return IsTunnel(GetUnitTypeId(whichUnit)) -endfunction -function Tunnel___FilterIsDifferentTunnel takes nothing returns boolean - return (IsTunnel(GetUnitTypeId((GetFilterUnit())))) and (LoadUnitHandle(Tunnel___h, GetHandleId((Tunnel___tmpUnit)), Tunnel___KEY_TUNNEL)) != GetFilterUnit() // INLINED!! -endfunction -function Tunnel___CreateCopies takes unit whichUnit returns nothing - local player owner= GetOwningPlayer(whichUnit) - local group tunnels= CreateGroup() - local unit tunnel= null - local integer i= 0 - local integer max= 0 - local real x= 0.0 - local real y= 0.0 - local real face= 0.0 - set Tunnel___tmpUnit=whichUnit - call GroupEnumUnitsOfPlayer(tunnels, GetOwningPlayer(whichUnit), Filter(function Tunnel___FilterIsDifferentTunnel)) - set max=BlzGroupGetSize(tunnels) - set i=0 - loop - exitwhen ( i == max ) - set tunnel=BlzGroupUnitAt(tunnels, i) - if ( GetOwningPlayer(tunnel) == owner ) then - set x=GetUnitX(tunnel) - set y=GetUnitY(tunnel) - set face=GetUnitFacing(tunnel) - call BlzQueueTargetOrderById(tunnel, OrderId("load"), Tunnel___CopyUnit(whichUnit , x , y , face)) - //call IssueTargetOrder(tunnel, "load", CopyUnit(whichUnit, x, y, face)) - endif - set i=i + 1 - endloop - call GroupClear(tunnels) - call DestroyGroup(tunnels) - set tunnels=null - set owner=null -endfunction -function Tunnel___CreateExistingCopies takes unit tunnel returns nothing - local player owner= GetOwningPlayer(tunnel) - local real x= GetUnitX(tunnel) - local real y= GetUnitY(tunnel) - local real face= GetUnitFacing(tunnel) - local unit u= null - local integer i= 0 - local integer max= BlzGroupGetSize(Tunnel___loaded) - loop - exitwhen ( i == max ) - set u=BlzGroupUnitAt(Tunnel___loaded, i) - if ( GetOwningPlayer(u) == owner ) then - call IssueTargetOrder(tunnel, "load", Tunnel___CopyUnit(u , x , y , face)) - endif - set u=null - set i=i + 1 - endloop - set owner=null -endfunction -function Tunnel___ForGroupClearCopy takes nothing returns nothing - if ( (LoadUnitHandle(Tunnel___h, GetHandleId((GetEnumUnit() )), Tunnel___KEY_SOURCE) == ( Tunnel___tmpUnit)) ) then // INLINED!! - call GroupRemoveUnit(Tunnel___copies, GetEnumUnit()) - call FlushChildHashtable(Tunnel___h, GetHandleId(GetEnumUnit())) - call ShowUnit(GetEnumUnit(), false) - call h__RemoveUnit(GetEnumUnit()) - endif -endfunction -function Tunnel___ClearCopies takes unit source returns nothing - set Tunnel___tmpUnit=source - call ForGroup(Tunnel___copies, function Tunnel___ForGroupClearCopy) -endfunction -function Tunnel___FilterIsTunnel takes nothing returns boolean - return (IsTunnel(GetUnitTypeId((GetFilterUnit())))) // INLINED!! -endfunction -function Tunnel___GetSelectedTunnel takes player whichPlayer returns unit - local group tunnels= CreateGroup() - local unit tunnel= null - call SyncSelections() - call GroupEnumUnitsSelected(tunnels, whichPlayer, Filter(function Tunnel___FilterIsTunnel)) - set tunnel=FirstOfGroup(tunnels) - call GroupClear(tunnels) - call DestroyGroup(tunnels) - set tunnels=null - return tunnel -endfunction -function GetNextTunnel takes player whichPlayer returns unit - local group tunnels= CreateGroup() - local unit tunnel= null - local integer i= 0 - local integer max= 0 - local unit selectedTunnel= Tunnel___GetSelectedTunnel(whichPlayer) - local boolean foundSelectedTunnel= false - local boolean foundNewTunnel= false - call GroupEnumUnitsOfPlayer(tunnels, whichPlayer, Filter(function Tunnel___FilterIsTunnel)) - set max=BlzGroupGetSize(tunnels) - set i=0 - loop - exitwhen ( i == max or foundNewTunnel ) - set tunnel=BlzGroupUnitAt(tunnels, i) - if ( selectedTunnel == null or foundSelectedTunnel ) then - set selectedTunnel=tunnel - set foundNewTunnel=true - elseif ( tunnel == selectedTunnel ) then - set foundSelectedTunnel=true - endif - set i=i + 1 - endloop - - if ( not foundNewTunnel ) then - set selectedTunnel=FirstOfGroup(tunnels) - endif - - call GroupClear(tunnels) - call DestroyGroup(tunnels) - set tunnels=null - return selectedTunnel -endfunction -function Tunnel___TriggerConditionLoad takes nothing returns boolean - local unit transportUnit= GetTransportUnit() - local unit loadedUnit= GetLoadedUnit() - if ( (IsUnitInGroup((loadedUnit), Tunnel___copies)) ) then // INLINED!! - call UnitAddAbility(loadedUnit, Tunnel_REGENERATION_ABILITY_ID) - call SaveUnitHandle(Tunnel___h, GetHandleId(loadedUnit), Tunnel___KEY_TUNNEL, transportUnit) - elseif ( (IsTunnel(GetUnitTypeId((transportUnit)))) ) then // INLINED!! - call UnitAddAbility(loadedUnit, Tunnel_REGENERATION_ABILITY_ID) - call SaveUnitHandle(Tunnel___h, GetHandleId(loadedUnit), Tunnel___KEY_TUNNEL, transportUnit) - call GroupAddUnit(Tunnel___loaded, loadedUnit) - call Tunnel___CreateCopies(loadedUnit) - endif - set transportUnit=null - set loadedUnit=null - return false -endfunction -function Tunnel___TriggerFunctionUnload takes nothing returns nothing - local unit eventUnit= (UnitEventEx__eventUnit) // INLINED!! - local unit source= null - if ( (IsUnitInGroup((eventUnit), Tunnel___loaded)) ) then // INLINED!! - call UnitRemoveAbility(eventUnit, Tunnel_REGENERATION_ABILITY_ID) - call Tunnel___MoveToUnloadPosition(eventUnit) - call Tunnel___ClearCopies(eventUnit) - call GroupRemoveUnit(Tunnel___loaded, eventUnit) - call FlushChildHashtable(Tunnel___h, GetHandleId(eventUnit)) - elseif ( (IsUnitInGroup((eventUnit), Tunnel___copies)) ) then // INLINED!! - call UnitRemoveAbility(eventUnit, Tunnel_REGENERATION_ABILITY_ID) - set source=(LoadUnitHandle(Tunnel___h, GetHandleId((eventUnit)), Tunnel___KEY_SOURCE)) // INLINED!! - call Tunnel___SetUnloadPosition(source , GetUnitX(eventUnit) , GetUnitY(eventUnit)) - call IssueTargetOrder((LoadUnitHandle(Tunnel___h, GetHandleId((source)), Tunnel___KEY_TUNNEL)), "unload", source) // INLINED!! - call Tunnel___ClearCopies(eventUnit) - endif - set eventUnit=null -endfunction -function Tunnel___TriggerConditionConstructed takes nothing returns boolean - local unit building= GetConstructedStructure() - if ( (IsTunnel(GetUnitTypeId((building)))) ) then // INLINED!! - call Tunnel___CreateExistingCopies(building) - endif - set building=null - return false -endfunction -function Tunnel___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Tunnel___loadTrigger, EVENT_PLAYER_UNIT_LOADED) - call TriggerAddCondition(Tunnel___loadTrigger, Condition(function Tunnel___TriggerConditionLoad)) - -call RegisterIndexNativeEvent(bj_MAX_PLAYER_SLOTS , (EVENT_ON_CARGO_UNLOAD ) , ( function Tunnel___TriggerFunctionUnload)) // INLINED!! - - call TriggerRegisterAnyUnitEventBJ(Tunnel___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(Tunnel___constructionTrigger, Condition(function Tunnel___TriggerConditionConstructed)) -endfunction -function Tunnel___RemoveUnitHook takes unit whichUnit returns nothing - call GroupRemoveUnit(Tunnel___loaded, whichUnit) - call GroupRemoveUnit(Tunnel___copies, whichUnit) - call FlushChildHashtable(Tunnel___h, GetHandleId(whichUnit)) -endfunction -//processed hook: hook RemoveUnit Tunnel___RemoveUnitHook -//library Tunnel ends -//library WoWReforgedCrates: -function IsCrate takes integer unitTypeId returns boolean - return unitTypeId == CRATES_0 or unitTypeId == CRATES_1 -endfunction -function WoWReforgedCrates___FilterFunctionIsCrate takes nothing returns boolean - return IsCrate(GetUnitTypeId(GetFilterUnit())) -endfunction -function WoWReforgedCrates___UnitAddRespawnUnitEnum takes nothing returns nothing - call AddRespawnUnit(GetEnumUnit()) -endfunction -function WoWReforgedCrates___AddAllCrittersAsSingleUnitRespawns takes nothing returns nothing - local group crates= CreateGroup() - call GroupEnumUnitsInRect(crates, GetPlayableMapRect(), Filter(function WoWReforgedCrates___FilterFunctionIsCrate)) - call ForGroup(crates, function WoWReforgedCrates___UnitAddRespawnUnitEnum) - call GroupClear(crates) - call DestroyGroup(crates) - set crates=null -endfunction -function WoWReforgedCrates___Init takes nothing returns nothing - call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedCrates___AddAllCrittersAsSingleUnitRespawns)) // INLINED!! -endfunction -//library WoWReforgedCrates ends -//library WoWReforgedCritters: -function WoWReforgedCritters___FilterFunctionIsCritter takes nothing returns boolean - return IsCritter(GetUnitTypeId(GetFilterUnit())) -endfunction -function WoWReforgedCritters___UnitAddRespawnUnitEnum takes nothing returns nothing - call AddRespawnUnit(GetEnumUnit()) -endfunction -function WoWReforgedCritters___AddAllCrittersAsSingleUnitRespawns takes nothing returns nothing - local group critters= CreateGroup() - call GroupEnumUnitsInRect(critters, GetPlayableMapRect(), Filter(function WoWReforgedCritters___FilterFunctionIsCritter)) - call ForGroup(critters, function WoWReforgedCritters___UnitAddRespawnUnitEnum) - call GroupClear(critters) - call DestroyGroup(critters) - set critters=null -endfunction -function WoWReforgedCritters___Init takes nothing returns nothing - call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedCritters___AddAllCrittersAsSingleUnitRespawns)) // INLINED!! -endfunction -//library WoWReforgedCritters ends -//library WoWReforgedEnslave: -function WoWReforgedEnslave__FilterIsTownHall takes nothing returns boolean - return IsUnitType(GetFilterUnit(), UNIT_TYPE_TOWNHALL) -endfunction -function Enslave takes unit whichUnit,unit killer returns nothing - local group g= CreateGroup() - local unit townHall= null - local unit slave= null - call GroupEnumUnitsOfPlayer(g, GetOwningPlayer(killer), Filter(function WoWReforgedEnslave__FilterIsTownHall)) - set townHall=GetClosestUnitGroup(GetUnitX(whichUnit) , GetUnitY(whichUnit) , g) - if ( townHall != null ) then - set slave=CreateUnit(GetOwningPlayer(killer), UNIT_TYPE_ID, GetUnitX(townHall), GetUnitY(townHall), GetUnitFacing(whichUnit)) - call BlzSetUnitSkin(slave, BlzGetUnitSkin(whichUnit)) - call UnitAddType(slave, UNIT_TYPE_SUMMONED) - call h__RemoveUnit(whichUnit) - set whichUnit=null - endif - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -//library WoWReforgedEnslave ends -//library WoWReforgedRandomCorpse: -function IsRandomCorpse takes integer unitTypeId returns boolean - return unitTypeId == WoWReforgedRandomCorpse_UNIT_TYPE_ID -endfunction -function IsUnitRandomCorpse takes unit whichUnit returns boolean - return ((GetUnitTypeId(whichUnit)) == WoWReforgedRandomCorpse_UNIT_TYPE_ID) // INLINED!! -endfunction -function ReplaceRandomCorpse takes unit whichUnit returns unit - local real x= GetUnitX(whichUnit) - local real y= GetUnitY(whichUnit) - local location l= Location(x, y) - local real face= GetUnitFacing(whichUnit) - local integer index= (UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit)))) // INLINED!! - local unit u= null - call SetUnitPathing(whichUnit, false) - - set u=CreatePermanentCorpseLocBJ(bj_CORPSETYPE_FLESH, ChooseRandomCreep(GetRandomInt(1, 10)), GetOwningPlayer(whichUnit), l, face) - call UnitDropItem(u, 'rren') - - if ( IsRespawnUnitValid(index) ) then - call SetRespawnUnit(index , u) - endif - - call h__RemoveUnit(whichUnit) - set whichUnit=null - call RemoveLocation(l) - set l=null - - return u -endfunction -function WoWReforgedRandomCorpse__FilterIsRandomCorpse takes nothing returns boolean - return ((GetUnitTypeId((GetFilterUnit()))) == WoWReforgedRandomCorpse_UNIT_TYPE_ID) // INLINED!! -endfunction -function WoWReforgedRandomCorpse__ReplaceRandomCorpseEnum takes nothing returns nothing - call ReplaceRandomCorpse(GetEnumUnit()) -endfunction -function WoWReforgedRandomCorpse__ReplaceAllRandomCorpses takes nothing returns nothing - local group g= CreateGroup() - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedRandomCorpse__FilterIsRandomCorpse)) - call ForGroup(g, function WoWReforgedRandomCorpse__ReplaceRandomCorpseEnum) - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function WoWReforgedRandomCorpse__Init takes nothing returns nothing - call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedRandomCorpse__ReplaceAllRandomCorpses)) // INLINED!! -endfunction -//library WoWReforgedRandomCorpse ends -//library WoWReforgedTaunts: -function AddTauntWoWReforged takes nothing returns nothing - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! -endfunction -//library WoWReforgedTaunts ends -//library WoWReforgedVotes: - -function AddWowReforgedVote takes nothing returns nothing - local integer vote= VoteCreate(udg_TmpString) -call VoteAddChoice((vote) , false , "yes" , "-yes") // INLINED!! - set VoteSystem__VoteStartChatCommand[(vote )]=( udg_TmpString2) // INLINED!! - set VoteSystem__VoteYesTrigger[(vote )]=( udg_TmpTrigger) // INLINED!! -endfunction -//library WoWReforgedVotes ends -//library DamageInterfaceUtils: - - - // JASS API: - // Evasion System: - // function UnitAddEvasionChanceTimed takes unit u, real amount, real duration returns nothing - // -> Add to a unit Evasion chance the specified amount for a given period - - // function UnitAddMissChanceTimed takes unit u, real amount, real duration returns nothing - // -> Add to a unit Miss chance the specified amount for a given period - // Critical Strike System: - // function UnitAddCriticalStrikeTimed takes unit u, real chance, real multiplier, real duration returns nothing - // -> Adds the specified values of chance and multiplier to a unit for a given period - - // function UnitAddCriticalChanceTimed takes unit u, real chance, real duration returns nothing - // -> Adds the specified values of critical chance to a unit for a given period - - // function UnitAddCriticalMultiplierTimed takes unit u, real multiplier, real duration returns nothing - // -> Adds the specified values of critical multiplier to a unit for a given period - // Spell Power System: - // function UnitAddSpellPowerFlatTimed takes unit u, real amount, real duration returns nothing - // -> Add to the Flat amount of Spell Power of a unit for a given period - // function UnitAddSpellPowerPercentTimed takes unit u, real amount, real duration returns nothing - // -> Add to the Percent amount of Spell Power of a unit for a given period - // function AbilitySpellDamage takes unit u, integer abilityId, abilityreallevelfield field returns string - // -> Given an ability field, will return a string that represents the damage that would be dealt - // taking into consideration the spell power bonusses of a unit. - // function AbilitySpellDamageEx takes real amount, unit u returns string - // -> Similar to GetSpellDamage will return the damage that would be dealt but as a string - // Life Steal System: - // function UnitAddLifeStealTimed takes unit u, real amount, real duration returns nothing - // -> Add to the Life Steal amount of a unit the given amount for a given period - // Spell Vamp System: - // function UnitAddSpellVampTimed takes unit u, real amount, real duration returns nothing - // -> Add to the Spell Vamp amount of a unit the given amount for a given period - - - - - - function s__DamageInterfaceUtils__EvasionUtils_remove takes integer this,integer i returns integer - if s__DamageInterfaceUtils__EvasionUtils_type[this] then - set s__Evasion_evasion[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this] ))]=(( (s__Evasion_evasion[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this]))]) - s__DamageInterfaceUtils__EvasionUtils_amount[this])*1.0) // INLINED!! - else - set s__Evasion_miss[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this] ))]=(( (s__Evasion_miss[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this]))]) - s__DamageInterfaceUtils__EvasionUtils_amount[this])*1.0) // INLINED!! - endif - set s__DamageInterfaceUtils__EvasionUtils_data[i]=s__DamageInterfaceUtils__EvasionUtils_data[s__DamageInterfaceUtils__EvasionUtils_didx] - set s__DamageInterfaceUtils__EvasionUtils_didx=s__DamageInterfaceUtils__EvasionUtils_didx - 1 - set s__DamageInterfaceUtils__EvasionUtils_unit[this]=null - set s__DamageInterfaceUtils__EvasionUtils_ticks[this]=0 - if s__DamageInterfaceUtils__EvasionUtils_didx == - 1 then - call PauseTimer(s__DamageInterfaceUtils__EvasionUtils_timer) - endif - call sc__Evasion_deallocate(this) - return i - 1 - endfunction - function s__DamageInterfaceUtils__EvasionUtils_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - - loop - exitwhen i > s__DamageInterfaceUtils__EvasionUtils_didx - set this=s__DamageInterfaceUtils__EvasionUtils_data[i] - if s__DamageInterfaceUtils__EvasionUtils_ticks[this] <= 0 then - set i=s__DamageInterfaceUtils__EvasionUtils_remove(this,i) - endif - set s__DamageInterfaceUtils__EvasionUtils_ticks[this]=s__DamageInterfaceUtils__EvasionUtils_ticks[this] - 1 - set i=i + 1 - endloop - endfunction - function s__DamageInterfaceUtils__EvasionUtils_addTimed takes unit u,real amount,real duration,boolean evasion returns nothing - local integer this= s__DamageInterfaceUtils__EvasionUtils__allocate() - set s__DamageInterfaceUtils__EvasionUtils_unit[this]=u - set s__DamageInterfaceUtils__EvasionUtils_amount[this]=amount - set s__DamageInterfaceUtils__EvasionUtils_ticks[this]=duration / 0.03125000 - set s__DamageInterfaceUtils__EvasionUtils_type[this]=evasion - set s__DamageInterfaceUtils__EvasionUtils_didx=s__DamageInterfaceUtils__EvasionUtils_didx + 1 - set s__DamageInterfaceUtils__EvasionUtils_data[s__DamageInterfaceUtils__EvasionUtils_didx]=this - if s__DamageInterfaceUtils__EvasionUtils_type[this] then - set s__Evasion_evasion[GetUnitUserData((u ))]=(( (s__Evasion_evasion[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! - else - set s__Evasion_miss[GetUnitUserData((u ))]=(( (s__Evasion_miss[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! - endif - - if s__DamageInterfaceUtils__EvasionUtils_didx == 0 then - call TimerStart(s__DamageInterfaceUtils__EvasionUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__EvasionUtils_onPeriod) - endif - endfunction - - - - //region Critical Strike - function s__DamageInterfaceUtils__CriticalUtils_remove takes integer this,integer i returns integer - if s__DamageInterfaceUtils__CriticalUtils_type[this] == 0 then - call s__Critical_add(s__DamageInterfaceUtils__CriticalUtils_unit[this] , - s__DamageInterfaceUtils__CriticalUtils_crit[this] , - s__DamageInterfaceUtils__CriticalUtils_multi[this]) - elseif s__DamageInterfaceUtils__CriticalUtils_type[this] == 1 then - set s__Critical_chance[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this] ))]=(( (s__Critical_chance[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this]))]) - s__DamageInterfaceUtils__CriticalUtils_crit[this])*1.0) // INLINED!! - else - set s__Critical_multiplier[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this] ))]=(( (s__Critical_multiplier[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this]))]) - s__DamageInterfaceUtils__CriticalUtils_multi[this])*1.0) // INLINED!! - endif - set s__DamageInterfaceUtils__CriticalUtils_data[i]=s__DamageInterfaceUtils__CriticalUtils_data[s__DamageInterfaceUtils__CriticalUtils_didx] - set s__DamageInterfaceUtils__CriticalUtils_didx=s__DamageInterfaceUtils__CriticalUtils_didx - 1 - set s__DamageInterfaceUtils__CriticalUtils_unit[this]=null - set s__DamageInterfaceUtils__CriticalUtils_ticks[this]=0 - if s__DamageInterfaceUtils__CriticalUtils_didx == - 1 then - call PauseTimer(s__DamageInterfaceUtils__CriticalUtils_timer) - endif - call sc__Critical_deallocate(this) - return i - 1 - endfunction - function s__DamageInterfaceUtils__CriticalUtils_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - - loop - exitwhen i > s__DamageInterfaceUtils__CriticalUtils_didx - set this=s__DamageInterfaceUtils__CriticalUtils_data[i] - if s__DamageInterfaceUtils__CriticalUtils_ticks[this] <= 0 then - set i=s__DamageInterfaceUtils__CriticalUtils_remove(this,i) - endif - set s__DamageInterfaceUtils__CriticalUtils_ticks[this]=s__DamageInterfaceUtils__CriticalUtils_ticks[this] - 1 - set i=i + 1 - endloop - endfunction - function s__DamageInterfaceUtils__CriticalUtils_addTimed takes unit u,real chance,real multiplier,real duration,integer types returns nothing - local integer this= s__DamageInterfaceUtils__CriticalUtils__allocate() - set s__DamageInterfaceUtils__CriticalUtils_unit[this]=u - set s__DamageInterfaceUtils__CriticalUtils_crit[this]=chance - set s__DamageInterfaceUtils__CriticalUtils_multi[this]=multiplier - set s__DamageInterfaceUtils__CriticalUtils_ticks[this]=duration / 0.03125000 - set s__DamageInterfaceUtils__CriticalUtils_type[this]=types - set s__DamageInterfaceUtils__CriticalUtils_didx=s__DamageInterfaceUtils__CriticalUtils_didx + 1 - set s__DamageInterfaceUtils__CriticalUtils_data[s__DamageInterfaceUtils__CriticalUtils_didx]=this - if types == 0 then - call s__Critical_add(u , s__DamageInterfaceUtils__CriticalUtils_crit[this] , s__DamageInterfaceUtils__CriticalUtils_multi[this]) - elseif types == 1 then - set s__Critical_chance[GetUnitUserData((u ))]=(( (s__Critical_chance[GetUnitUserData((u))]) + s__DamageInterfaceUtils__CriticalUtils_crit[this])*1.0) // INLINED!! - else - set s__Critical_multiplier[GetUnitUserData((u ))]=(( (s__Critical_multiplier[GetUnitUserData((u))]) + s__DamageInterfaceUtils__CriticalUtils_multi[this])*1.0) // INLINED!! - endif - - if s__DamageInterfaceUtils__CriticalUtils_didx == 0 then - call TimerStart(s__DamageInterfaceUtils__CriticalUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__CriticalUtils_onPeriod) - endif - endfunction - //endregion - - - - //region Spell Power - function s__DamageInterfaceUtils__SpellPowerUtils_remove takes integer this,integer i returns integer - if s__DamageInterfaceUtils__SpellPowerUtils_isFlat[this] then - set s__SpellPower_flat[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this] ))]=(( (s__SpellPower_flat[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this]))]) - s__DamageInterfaceUtils__SpellPowerUtils_amount[this])*1.0) // INLINED!! - else - set s__SpellPower_percent[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this] ))]=(( (s__SpellPower_percent[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this]))]) - s__DamageInterfaceUtils__SpellPowerUtils_amount[this])*1.0) // INLINED!! - endif - set s__DamageInterfaceUtils__SpellPowerUtils_data[i]=s__DamageInterfaceUtils__SpellPowerUtils_data[s__DamageInterfaceUtils__SpellPowerUtils_didx] - set s__DamageInterfaceUtils__SpellPowerUtils_didx=s__DamageInterfaceUtils__SpellPowerUtils_didx - 1 - set s__DamageInterfaceUtils__SpellPowerUtils_unit[this]=null - set s__DamageInterfaceUtils__SpellPowerUtils_ticks[this]=0 - if s__DamageInterfaceUtils__SpellPowerUtils_didx == - 1 then - call PauseTimer(s__DamageInterfaceUtils__SpellPowerUtils_timer) - endif - call sc__SpellPower_deallocate(this) - return i - 1 - endfunction - function s__DamageInterfaceUtils__SpellPowerUtils_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - - loop - exitwhen i > s__DamageInterfaceUtils__SpellPowerUtils_didx - set this=s__DamageInterfaceUtils__SpellPowerUtils_data[i] - if s__DamageInterfaceUtils__SpellPowerUtils_ticks[this] <= 0 then - set i=s__DamageInterfaceUtils__SpellPowerUtils_remove(this,i) - endif - set s__DamageInterfaceUtils__SpellPowerUtils_ticks[this]=s__DamageInterfaceUtils__SpellPowerUtils_ticks[this] - 1 - set i=i + 1 - endloop - endfunction - function s__DamageInterfaceUtils__SpellPowerUtils_addTimed takes unit u,real amount,real duration,boolean isFlat returns nothing - local integer this= s__DamageInterfaceUtils__SpellPowerUtils__allocate() - set s__DamageInterfaceUtils__SpellPowerUtils_unit[this]=u - set s__DamageInterfaceUtils__SpellPowerUtils_amount[this]=amount - set s__DamageInterfaceUtils__SpellPowerUtils_ticks[this]=duration / 0.03125000 - set s__DamageInterfaceUtils__SpellPowerUtils_isFlat[this]=isFlat - set s__DamageInterfaceUtils__SpellPowerUtils_didx=s__DamageInterfaceUtils__SpellPowerUtils_didx + 1 - set s__DamageInterfaceUtils__SpellPowerUtils_data[s__DamageInterfaceUtils__SpellPowerUtils_didx]=this - if isFlat then - set s__SpellPower_flat[GetUnitUserData((u ))]=(( (s__SpellPower_flat[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! - else - set s__SpellPower_percent[GetUnitUserData((u ))]=(( (s__SpellPower_percent[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! - endif - - if s__DamageInterfaceUtils__SpellPowerUtils_didx == 0 then - call TimerStart(s__DamageInterfaceUtils__SpellPowerUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__SpellPowerUtils_onPeriod) - endif - endfunction - //endregion - - - - //region Life Steal - function s__DamageInterfaceUtils__LifeStealUtils_remove takes integer this,integer i returns integer - set s__LifeSteal_amount[GetUnitUserData((s__DamageInterfaceUtils__LifeStealUtils_unit[this] ))]=(( (s__LifeSteal_amount[GetUnitUserData((s__DamageInterfaceUtils__LifeStealUtils_unit[this]))]) - s__DamageInterfaceUtils__LifeStealUtils_lifeSteal[this])*1.0) // INLINED!! - set s__DamageInterfaceUtils__LifeStealUtils_data[i]=s__DamageInterfaceUtils__LifeStealUtils_data[s__DamageInterfaceUtils__LifeStealUtils_didx] - set s__DamageInterfaceUtils__LifeStealUtils_didx=s__DamageInterfaceUtils__LifeStealUtils_didx - 1 - set s__DamageInterfaceUtils__LifeStealUtils_unit[this]=null - set s__DamageInterfaceUtils__LifeStealUtils_ticks[this]=0 - if s__DamageInterfaceUtils__LifeStealUtils_didx == - 1 then - call PauseTimer(s__DamageInterfaceUtils__LifeStealUtils_timer) - endif - call sc__LifeSteal_deallocate(this) - return i - 1 - endfunction - function s__DamageInterfaceUtils__LifeStealUtils_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - - loop - exitwhen i > s__DamageInterfaceUtils__LifeStealUtils_didx - set this=s__DamageInterfaceUtils__LifeStealUtils_data[i] - if s__DamageInterfaceUtils__LifeStealUtils_ticks[this] <= 0 then - set i=s__DamageInterfaceUtils__LifeStealUtils_remove(this,i) - endif - set s__DamageInterfaceUtils__LifeStealUtils_ticks[this]=s__DamageInterfaceUtils__LifeStealUtils_ticks[this] - 1 - set i=i + 1 - endloop - endfunction - function s__DamageInterfaceUtils__LifeStealUtils_addTimed takes unit u,real amount,real duration returns nothing - local integer this= s__DamageInterfaceUtils__LifeStealUtils__allocate() - set s__DamageInterfaceUtils__LifeStealUtils_unit[this]=u - set s__DamageInterfaceUtils__LifeStealUtils_lifeSteal[this]=amount - set s__DamageInterfaceUtils__LifeStealUtils_ticks[this]=duration / 0.03125000 - set s__DamageInterfaceUtils__LifeStealUtils_didx=s__DamageInterfaceUtils__LifeStealUtils_didx + 1 - set s__DamageInterfaceUtils__LifeStealUtils_data[s__DamageInterfaceUtils__LifeStealUtils_didx]=this - set s__LifeSteal_amount[GetUnitUserData((u ))]=(( (s__LifeSteal_amount[GetUnitUserData((u))]) + s__DamageInterfaceUtils__LifeStealUtils_lifeSteal[this])*1.0) // INLINED!! - - if s__DamageInterfaceUtils__LifeStealUtils_didx == 0 then - call TimerStart(s__DamageInterfaceUtils__LifeStealUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__LifeStealUtils_onPeriod) - endif - endfunction - //endregion - - - - //region Spell Vamp - function s__DamageInterfaceUtils__SpellVampUtils_remove takes integer this,integer i returns integer - set s__SpellVamp_amount[GetUnitUserData((s__DamageInterfaceUtils__SpellVampUtils_unit[this] ))]=(( (s__SpellVamp_amount[GetUnitUserData((s__DamageInterfaceUtils__SpellVampUtils_unit[this]))]) - s__DamageInterfaceUtils__SpellVampUtils_spellVamp[this])*1.0) // INLINED!! - set s__DamageInterfaceUtils__SpellVampUtils_data[i]=s__DamageInterfaceUtils__SpellVampUtils_data[s__DamageInterfaceUtils__SpellVampUtils_didx] - set s__DamageInterfaceUtils__SpellVampUtils_didx=s__DamageInterfaceUtils__SpellVampUtils_didx - 1 - set s__DamageInterfaceUtils__SpellVampUtils_unit[this]=null - set s__DamageInterfaceUtils__SpellVampUtils_ticks[this]=0 - if s__DamageInterfaceUtils__SpellVampUtils_didx == - 1 then - call PauseTimer(s__DamageInterfaceUtils__SpellVampUtils_timer) - endif - call sc__SpellVamp_deallocate(this) - return i - 1 - endfunction - function s__DamageInterfaceUtils__SpellVampUtils_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - - loop - exitwhen i > s__DamageInterfaceUtils__SpellVampUtils_didx - set this=s__DamageInterfaceUtils__SpellVampUtils_data[i] - if s__DamageInterfaceUtils__SpellVampUtils_ticks[this] <= 0 then - set i=s__DamageInterfaceUtils__SpellVampUtils_remove(this,i) - endif - set s__DamageInterfaceUtils__SpellVampUtils_ticks[this]=s__DamageInterfaceUtils__SpellVampUtils_ticks[this] - 1 - set i=i + 1 - endloop - endfunction - function s__DamageInterfaceUtils__SpellVampUtils_addTimed takes unit u,real amount,real duration returns nothing - local integer this= s__DamageInterfaceUtils__SpellVampUtils__allocate() - set s__DamageInterfaceUtils__SpellVampUtils_unit[this]=u - set s__DamageInterfaceUtils__SpellVampUtils_spellVamp[this]=amount - set s__DamageInterfaceUtils__SpellVampUtils_ticks[this]=duration / 0.03125000 - set s__DamageInterfaceUtils__SpellVampUtils_didx=s__DamageInterfaceUtils__SpellVampUtils_didx + 1 - set s__DamageInterfaceUtils__SpellVampUtils_data[s__DamageInterfaceUtils__SpellVampUtils_didx]=this - set s__SpellVamp_amount[GetUnitUserData((u ))]=(( (s__SpellVamp_amount[GetUnitUserData((u))]) + s__DamageInterfaceUtils__SpellVampUtils_spellVamp[this])*1.0) // INLINED!! - - if s__DamageInterfaceUtils__SpellVampUtils_didx == 0 then - call TimerStart(s__DamageInterfaceUtils__SpellVampUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__SpellVampUtils_onPeriod) - endif - endfunction - - - - function UnitAddEvasionChanceTimed takes unit u,real amount,real duration returns nothing - call s__DamageInterfaceUtils__EvasionUtils_addTimed(u , amount , duration , true) - endfunction - function UnitAddMissChanceTimed takes unit u,real amount,real duration returns nothing - call s__DamageInterfaceUtils__EvasionUtils_addTimed(u , amount , duration , false) - endfunction - function UnitAddCriticalStrikeTimed takes unit u,real chance,real multiplier,real duration returns nothing - call s__DamageInterfaceUtils__CriticalUtils_addTimed(u , chance , multiplier , duration , 0) - endfunction - function UnitAddCriticalChanceTimed takes unit u,real chance,real duration returns nothing - call s__DamageInterfaceUtils__CriticalUtils_addTimed(u , chance , 0 , duration , 1) - endfunction - function UnitAddCriticalMultiplierTimed takes unit u,real multiplier,real duration returns nothing - call s__DamageInterfaceUtils__CriticalUtils_addTimed(u , 0 , multiplier , duration , 2) - endfunction - function UnitAddSpellPowerFlatTimed takes unit u,real amount,real duration returns nothing - call s__DamageInterfaceUtils__SpellPowerUtils_addTimed(u , amount , duration , true) - endfunction - function UnitAddSpellPowerPercentTimed takes unit u,real amount,real duration returns nothing - call s__DamageInterfaceUtils__SpellPowerUtils_addTimed(u , amount , duration , false) - endfunction - function AbilitySpellDamage takes unit u,integer abilityId,abilityreallevelfield field returns string - return I2S(R2I(( BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, abilityId), field, GetUnitAbilityLevel(u, abilityId) - 1) + (s__SpellPower_flat[GetUnitUserData((u))]) ) * ( 1 + (s__SpellPower_percent[GetUnitUserData((u))]) ))) // INLINED!! - endfunction - function AbilitySpellDamageEx takes real amount,unit u returns string - return I2S(R2I(( amount + (s__SpellPower_flat[GetUnitUserData((u))]) ) * ( 1 + (s__SpellPower_percent[GetUnitUserData((u))]) ))) // INLINED!! - endfunction - function UnitAddLifeStealTimed takes unit u,real amount,real duration returns nothing - call s__DamageInterfaceUtils__LifeStealUtils_addTimed(u , amount , duration) - endfunction - function UnitAddSpellVampTimed takes unit u,real amount,real duration returns nothing - call s__DamageInterfaceUtils__SpellVampUtils_addTimed(u , amount , duration) - endfunction -//library DamageInterfaceUtils ends -//library Demoralize: -function Demoralize___FiterIsTarget takes nothing returns boolean - return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitAlly(GetFilterUnit(), Demoralize___tmpPlayer) -endfunction -function Demoralize takes unit caster returns nothing - local group targets= CreateGroup() - local integer i= 0 - local integer max= 0 - local real distance= 600.0 + GetUnitAbilityLevel(caster, Demoralize_ABILITY_ID) * 200.0 - local unit target= null - local real casterX= GetUnitX(caster) - local real casterY= GetUnitY(caster) - local real x= 0.0 - local real y= 0.0 - local real facing= 0.0 - set Demoralize___tmpPlayer=GetOwningPlayer(caster) - call GroupEnumUnitsInRange(targets, GetUnitX(caster), GetUnitY(caster), 512.0, Filter(function Demoralize___FiterIsTarget)) - set max=BlzGroupGetSize(targets) - if ( max > 0 ) then - set i=0 - loop - exitwhen ( i == max ) - set target=BlzGroupUnitAt(targets, i) - set x=GetUnitX(target) - set y=GetUnitY(target) - set facing=AngleBetweenCoordinates(casterX , casterY , x , y) - call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(caster))] , "Flee!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) - call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(target))] , "Flee!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) - - set x=PolarProjectionX(casterX , facing , distance) - set y=PolarProjectionY(casterY , facing , distance) - call IssuePointOrder(target, "move", x, y) - - set target=null - set i=i + 1 - endloop - else - call SimError(Demoralize___tmpPlayer , "No targets.") - call IssueImmediateOrder(caster, "stop") - endif - set Demoralize___tmpPlayer=null - call GroupClear(targets) - call DestroyGroup(targets) - set targets=null -endfunction -function Demoralize___TriggerConditionCast takes nothing returns boolean - if ( GetSpellAbilityId() == Demoralize_ABILITY_ID ) then - call Demoralize(GetTriggerUnit()) - endif - return false -endfunction -function Demoralize___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Demoralize___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(Demoralize___castTrigger, Condition(function Demoralize___TriggerConditionCast)) -endfunction -//library Demoralize ends -//library HolyNova: -function HolyNova___FilterIsEnemyInRange takes nothing returns boolean - return IsUnitAliveBJ(GetFilterUnit()) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) and not IsUnitAlly(GetFilterUnit(), GetOwningPlayer(HolyNova___tmpCaster)) and GetOwningPlayer(GetFilterUnit()) != GetOwningPlayer(HolyNova___tmpCaster) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') == 0 ) or ( not IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) and ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(HolyNova___tmpCaster)) or GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(HolyNova___tmpCaster) ) and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) < GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_LIFE) ) -endfunction -function HolyNova takes unit caster,integer abilityId returns nothing - local player owner= GetOwningPlayer(caster) - local real damage= I2R(GetUnitAbilityLevel(caster, abilityId)) * 50 + 150 - local group targets= CreateGroup() - local unit target= null - local effect array effects - local integer effectsCounter= 0 - local effect casterEffect - local integer max= 0 - local integer i= 0 - call GroupEnumUnitsInRange(targets, GetUnitX(caster), GetUnitY(caster), 900.0, Filter(function HolyNova___FilterIsEnemyInRange)) - set max=BlzGroupGetSize(targets) - if ( max > 0 ) then - set casterEffect=AddSpecialEffectTarget("war3mapImported\\Holy Nova.mdx", caster, "origin") - loop - exitwhen ( i >= max ) - set target=BlzGroupUnitAt(targets, i) - if ( IsUnitAlly(target, owner) or GetOwningPlayer(target) == owner ) then - call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_LIFE) + damage, GetUnitState(target, UNIT_STATE_MAX_LIFE))) - else - call UnitDamageTarget(caster, target, damage, false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) - endif - set effects[i]=AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", target, "origin") - set target=null - set i=i + 1 - endloop - call PolledWait(3.0) - set i=0 - set max=effectsCounter - loop - exitwhen ( i >= max ) - call DestroyEffect(effects[i]) - set effects[i]=null - set i=i + 1 - endloop - call DestroyEffect(casterEffect) - set casterEffect=null - else - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "No valid targets.") - endif - set owner=null -endfunction -function HolyNova___TriggerConditionCast takes nothing returns boolean - local integer abilityId= GetSpellAbilityId() - return abilityId == HolyNova_ABILITY_ID or abilityId == HolyNova_ABILITY_ID_2 or abilityId == HolyNova_ABILITY_ID_3 -endfunction -function HolyNova___TriggerActionCast takes nothing returns nothing - call HolyNova(GetTriggerUnit() , GetSpellAbilityId()) -endfunction -function HolyNova___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(HolyNova___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(HolyNova___castTrigger, Condition(function HolyNova___TriggerConditionCast)) - call TriggerAddAction(HolyNova___castTrigger, function HolyNova___TriggerActionCast) -endfunction -//library HolyNova ends -//library MassDevour: -function MassDevour___MassDevourClearTarget takes unit target returns nothing - local integer handleId= GetHandleId(target) - call FlushChildHashtable(MassDevour___h, handleId) -endfunction -function MassDevour___MassDevourClearCaster takes unit caster returns nothing - local integer handleId= GetHandleId(caster) - local group d= LoadGroupHandle(MassDevour___h, handleId, MassDevour___KEY_DUMMIES) - if ( d != null ) then - call GroupClear(d) - call DestroyGroup(d) - endif - call FlushChildHashtable(MassDevour___h, handleId) -endfunction -function MassDevour___MassDevourFilter takes nothing returns boolean - local unit filterUnit= GetFilterUnit() - local integer level= GetUnitLevel(filterUnit) - local integer maxLevel= GetUnitAbilityLevel(MassDevour___c, MassDevour___ABILITY_ID) * 5 - local boolean result= level <= maxLevel and not IsUnitAlly(filterUnit, MassDevour___owner) and not IsUnitDeadBJ(filterUnit) and not IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and not IsUnitType(filterUnit, UNIT_TYPE_MAGIC_IMMUNE) - set filterUnit=null - return result -endfunction -function MassDevour___ForGroupDevour takes nothing returns nothing - local unit target= GetEnumUnit() - local real x= GetUnitX(target) - local real y= GetUnitY(target) - local real facing= GetUnitFacing(target) - local real dummyX= PolarProjectionX(GetUnitX(target) , 60.0 , facing) - local real dummyY= PolarProjectionY(GetUnitY(target) , 60.0 , facing) - local real dummyFacing= AngleBetweenCoordinatesDeg(x , y , dummyX , dummyY) - local unit dummy= CreateUnit(MassDevour___owner, MassDevour___DUMMY_ID, dummyX, dummyY, dummyFacing) - local integer abilityLevel= GetUnitAbilityLevel(MassDevour___c, MassDevour___ABILITY_ID) - //call BJDebugMsg("Caster " + GetUnitName(c) + " with ability level " + I2S(abilityLevel) + " for dummy " + GetUnitName(dummy) + " to target " + GetUnitName(target)) - call UnitAddAbility(dummy, MassDevour___DUMMY_DEVOUR_ABILITY_ID) - call UnitAddAbility(dummy, MassDevour___DUMMY_DEVOUR_CARGO_ABILITY_ID) - //call BJDebugMsg("Dummy 1 " + GetUnitName(dummy)) - call UnitMakeAbilityPermanent(dummy, true, MassDevour___DUMMY_DEVOUR_ABILITY_ID) - call UnitMakeAbilityPermanent(dummy, true, MassDevour___DUMMY_DEVOUR_CARGO_ABILITY_ID) - //call BJDebugMsg("Dummy 2 " + GetUnitName(dummy)) - call SetUnitAbilityLevel(dummy, MassDevour___DUMMY_DEVOUR_ABILITY_ID, abilityLevel) - call SetUnitAbilityLevel(dummy, MassDevour___DUMMY_DEVOUR_CARGO_ABILITY_ID, abilityLevel) - //call BJDebugMsg("Dummy 3 " + GetUnitName(dummy)) - call SetUnitInvulnerable(dummy, true) - //call SelectUnit(dummy, true) - //call BJDebugMsg("After invulnerable") - call ShowUnit(dummy, false) - //call BJDebugMsg("Dummy 4 " + GetUnitName(dummy)) - call GroupAddUnit(MassDevour___dummies, dummy) - call SaveUnitHandle(MassDevour___h, GetHandleId(dummy), MassDevour___KEY_CASTER, MassDevour___c) - //call BJDebugMsg("Dummy 5 " + GetUnitName(dummy)) - //call BJDebugMsg("Before issuing") - call IssueTargetOrder(dummy, MassDevour___DUMMY_DEVOUR_ORDER, target) - //call BJDebugMsg("Dummy 6 " + GetUnitName(dummy)) - //call BJDebugMsg("After issuing") - set dummy=null - set target=null -endfunction -function MassDevour___ForGroupMassDevourCasterDies takes nothing returns nothing - local unit dummy= GetEnumUnit() - call SetUnitX(dummy, GetUnitX(MassDevour___tmpCaster)) - call SetUnitY(dummy, GetUnitY(MassDevour___tmpCaster)) - call SetUnitInvulnerable(dummy, false) - call KillUnit(dummy) - call h__RemoveUnit(dummy) - set dummy=null -endfunction -function MassDevour___CastMassDevour takes unit caster,real x,real y returns nothing - local group d= LoadGroupHandle(MassDevour___h, GetHandleId(caster), MassDevour___KEY_DUMMIES) - local group l__MassDevour___targets= CreateGroup() - set MassDevour___owner=GetOwningPlayer(caster) - set MassDevour___c=caster - call GroupEnumUnitsInRange(l__MassDevour___targets, x, y, MassDevour___RANGE, Filter(function MassDevour___MassDevourFilter)) - - if ( BlzGroupGetSize(l__MassDevour___targets) > 0 ) then - if ( d == null ) then - set MassDevour___dummies=CreateGroup() - else - set MassDevour___dummies=d - endif - call ForGroup(l__MassDevour___targets, function MassDevour___ForGroupDevour) - call SaveGroupHandle(MassDevour___h, GetHandleId(caster), MassDevour___KEY_DUMMIES, MassDevour___dummies) - call GroupAddUnit(MassDevour___casters, caster) - else - call IssueImmediateOrder(caster, "stop") - call SimError(MassDevour___owner , "No targets.") - endif - call GroupClear(l__MassDevour___targets) - call DestroyGroup(l__MassDevour___targets) - set l__MassDevour___targets=null -endfunction -function MassDevour___TriggerConditionCast takes nothing returns boolean - return GetSpellAbilityId() == MassDevour___ABILITY_ID -endfunction -function MassDevour___TriggerActionCast takes nothing returns nothing - call MassDevour___CastMassDevour(GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY()) -endfunction -function MassDevour___TriggerConditionDeathCaster takes nothing returns boolean - return IsUnitInGroup(GetTriggerUnit(), MassDevour___casters) -endfunction -function MassDevour___TriggerActionDeathCaster takes nothing returns nothing - local group d= LoadGroupHandle(MassDevour___h, GetHandleId(GetTriggerUnit()), MassDevour___KEY_DUMMIES) - set MassDevour___tmpCaster=GetTriggerUnit() - call ForGroup(d, function MassDevour___ForGroupMassDevourCasterDies) - call GroupClear(d) - call DestroyGroup(d) - call GroupRemoveUnit(MassDevour___casters, GetTriggerUnit()) - call MassDevour___MassDevourClearCaster(GetTriggerUnit()) - set d=null -endfunction -function MassDevour___TriggerConditionDeathTarget takes nothing returns boolean - return IsUnitInGroup(GetTriggerUnit(), MassDevour___targets) -endfunction -function MassDevour___TriggerActionDeathTarget takes nothing returns nothing - local unit target= GetTriggerUnit() - local unit caster= LoadUnitHandle(MassDevour___h, GetHandleId(target), MassDevour___KEY_CASTER) - local unit dummy= LoadUnitHandle(MassDevour___h, GetHandleId(target), MassDevour___KEY_DUMMY) - local group d= LoadGroupHandle(MassDevour___h, GetHandleId(caster), MassDevour___KEY_DUMMIES) - call GroupRemoveUnit(d, dummy) - call SetUnitInvulnerable(dummy, false) - call KillUnit(dummy) - call h__RemoveUnit(dummy) - set dummy=null - call GroupRemoveUnit(MassDevour___targets, target) - call MassDevour___MassDevourClearTarget(target) - if ( BlzGroupGetSize(d) == 0 ) then - call GroupRemoveUnit(MassDevour___casters, target) - call MassDevour___MassDevourClearCaster(target) - endif - set target=null - set d=null -endfunction -function MassDevour___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(MassDevour___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(MassDevour___castTrigger, Condition(function MassDevour___TriggerConditionCast)) - call TriggerAddAction(MassDevour___castTrigger, function MassDevour___TriggerActionCast) - - call TriggerRegisterAnyUnitEventBJ(MassDevour___deathTriggerCaster, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(MassDevour___deathTriggerCaster, Condition(function MassDevour___TriggerConditionDeathCaster)) - call TriggerAddAction(MassDevour___deathTriggerCaster, function MassDevour___TriggerActionDeathCaster) - - call TriggerRegisterAnyUnitEventBJ(MassDevour___deathTriggerTarget, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(MassDevour___deathTriggerTarget, Condition(function MassDevour___TriggerConditionDeathTarget)) - call TriggerAddAction(MassDevour___deathTriggerTarget, function MassDevour___TriggerActionDeathTarget) -endfunction -function MassDevour___RemoveUnitMassDevour takes unit whichUnit returns nothing - call GroupRemoveUnit(MassDevour___targets, whichUnit) - call GroupRemoveUnit(MassDevour___casters, whichUnit) - call MassDevour___MassDevourClearTarget(whichUnit) - call MassDevour___MassDevourClearCaster(whichUnit) -endfunction -//processed hook: hook RemoveUnit MassDevour___RemoveUnitMassDevour -//library MassDevour ends -//library NewBonus: - - // Since ObjectMerger is broken and we still have no means to edit - // bonus values (green values) i decided to create a light weight - // Bonus library that works in the same way that the original Bonus Mod - // by Earth Fury did. NewBonus requires patch 1.30+. - // Credits to Earth Fury for the original Bonus idea - // How to Import? - // Importing bonus mod is really simple. Just copy the 9 abilities with the - // prefix "NewBonus" from the Object Editor into your map and match their new raw - // code to the bonus types in the global block below. Then create a trigger called - // NewBonus, convert it to custom text and paste this code there. You done! - - - - - - - - - - function GetUnitBonus takes unit source,integer bonus returns real - return sc__NewBonus_get(source , bonus) - endfunction - function SetUnitBonus takes unit source,integer bonus,real amount returns real - return sc__NewBonus_Set(source , bonus , amount , false) - endfunction - - function RemoveUnitBonus takes unit source,integer bonus returns nothing - if bonus == BONUS_CRITICAL_DAMAGE then - call sc__NewBonus_Set(source , bonus , 1 , false) - else - call sc__NewBonus_Set(source , bonus , 0 , false) - endif - - if bonus == BONUS_LIFE_STEAL then - call UnitRemoveAbility(source, NewBonus__LIFE_STEAL_ABILITY) - endif - endfunction - - function AddUnitBonus takes unit source,integer bonus,real amount returns real - return sc__NewBonus_add(source , bonus , amount) - endfunction - - function RegisterBonusEvent takes code c returns nothing - call sc__NewBonus_register(c , 0) - endfunction - - function RegisterBonusTypeEvent takes integer bonus,code c returns nothing - call sc__NewBonus_register(c , bonus) - endfunction - - function GetBonusUnit takes nothing returns unit - return s__NewBonus_unit[s__NewBonus_key] - endfunction - - function GetBonusType takes nothing returns integer - return s__NewBonus_type[s__NewBonus_key] - endfunction - - function SetBonusType takes integer bonus returns nothing - if bonus >= BONUS_DAMAGE and bonus <= s__NewBonus_last then - set s__NewBonus_type[s__NewBonus_key]=bonus - endif - endfunction - - function GetBonusAmount takes nothing returns real - return s__NewBonus_amount[s__NewBonus_key] - endfunction - - function SetBonusAmount takes real amount returns nothing - set s__NewBonus_amount[s__NewBonus_key]=amount - endfunction - - - - - function s__NewBonus_checkOverflow takes real current,real value returns real - if value > 0 and current > 2147483647 - value then - return 2147483647 - current - elseif value < 0 and current < - 2147483648 - value then - return - 2147483648 - current - else - return value - endif - endfunction - function s__NewBonus_onEvent takes integer key returns nothing - local integer i= 0 - local integer next= - 1 - local integer prev= - 2 - set s__NewBonus_count=s__NewBonus_count + 1 - - if s__NewBonus_amount[key] != 0 and ( s__NewBonus_count - s__NewBonus_last < NewBonus__RECURSION_LIMIT ) then - loop - exitwhen s__NewBonus_type[key] == next or ( i - s__NewBonus_last > NewBonus__RECURSION_LIMIT ) - set next=s__NewBonus_type[key] - if s__NewBonus_event[next] != null then - call TriggerEvaluate(s__NewBonus_event[next]) - endif - if s__NewBonus_type[key] != next then - set i=i + 1 - else - if next != prev then - call TriggerEvaluate(s__NewBonus_trigger) - if s__NewBonus_type[key] != next then - set i=i + 1 - set prev=next - endif - endif - endif - endloop - endif - - set s__NewBonus_count=s__NewBonus_count - 1 - set s__NewBonus_key=key - endfunction - - function s__NewBonus_setAbilityI takes unit source,integer id,abilityintegerlevelfield field,real value,boolean adding returns real - if GetUnitAbilityLevel(source, id) == 0 then - call UnitAddAbility(source, id) - call UnitMakeAbilityPermanent(source, true, id) - endif - - if adding then - if BlzSetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0, BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0) + R2I(value)) then - call IncUnitAbilityLevel(source, id) - call DecUnitAbilityLevel(source, id) - endif - else - if BlzSetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0, R2I(value)) then - call IncUnitAbilityLevel(source, id) - call DecUnitAbilityLevel(source, id) - endif - endif - - set s__NewBonus_linkType=s__NewBonus_type[s__NewBonus_key] - - if s__NewBonus_key > - 1 then - set s__NewBonus_key=s__NewBonus_key - 1 - endif - - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0)) - endfunction - function s__NewBonus_setAbilityR takes unit source,integer id,abilityreallevelfield field,real value returns real - if GetUnitAbilityLevel(source, id) == 0 then - call UnitAddAbility(source, id) - call UnitMakeAbilityPermanent(source, true, id) - endif - - if BlzSetAbilityRealLevelField(BlzGetUnitAbility(source, id), field, 0, value) then - call IncUnitAbilityLevel(source, id) - call DecUnitAbilityLevel(source, id) - endif - - set s__NewBonus_linkType=s__NewBonus_type[s__NewBonus_key] - - if s__NewBonus_key > - 1 then - set s__NewBonus_key=s__NewBonus_key - 1 - endif - - return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, id), field, 0) - endfunction - function s__NewBonus_get takes unit source,integer bonus returns real - if bonus == BONUS_DAMAGE then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__DAMAGE_ABILITY), NewBonus__DAMAGE_FIELD, 0)) - elseif bonus == BONUS_ARMOR then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__ARMOR_ABILITY), NewBonus__ARMOR_FIELD, 0)) - elseif bonus == BONUS_HEALTH then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__HEALTH_ABILITY), NewBonus__HEALTH_FIELD, 0)) - elseif bonus == BONUS_MANA then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__MANA_ABILITY), NewBonus__MANA_FIELD, 0)) - elseif bonus == BONUS_AGILITY then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__STATS_ABILITY), NewBonus__AGILITY_FIELD, 0)) - elseif bonus == BONUS_STRENGTH then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__STATS_ABILITY), NewBonus__STRENGTH_FIELD, 0)) - elseif bonus == BONUS_INTELLIGENCE then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__STATS_ABILITY), NewBonus__INTELLIGENCE_FIELD, 0)) - elseif bonus == BONUS_MOVEMENT_SPEED then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__MOVEMENTSPEED_ABILITY), NewBonus__MOVEMENTSPEED_FIELD, 0)) - elseif bonus == BONUS_SIGHT_RANGE then - return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__SIGHT_RANGE_ABILITY), NewBonus__SIGHT_RANGE_FIELD, 0)) - elseif bonus == BONUS_HEALTH_REGEN then - return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__HEALTHREGEN_ABILITY), NewBonus__HEALTHREGEN_FIELD, 0) - elseif bonus == BONUS_MANA_REGEN then - return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__MANAREGEN_ABILITY), NewBonus__MANAREGEN_FIELD, 0) - elseif bonus == BONUS_ATTACK_SPEED then - return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__ATTACKSPEED_ABILITY), NewBonus__ATTACKSPEED_FIELD, 0) - elseif bonus == BONUS_MAGIC_RESISTANCE then - return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__MAGIC_RESISTANCE_ABILITY), NewBonus__MAGIC_RESISTANCE_FIELD, 0) - elseif bonus >= BONUS_EVASION_CHANCE and bonus <= s__NewBonus_last then - if bonus == BONUS_EVASION_CHANCE then - return (s__Evasion_evasion[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_MISS_CHANCE then - return (s__Evasion_miss[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_CRITICAL_CHANCE then - return (s__Critical_chance[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_CRITICAL_DAMAGE then - return (s__Critical_multiplier[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_SPELL_POWER_FLAT then - return (s__SpellPower_flat[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_SPELL_POWER_PERCENT then - return (s__SpellPower_percent[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_LIFE_STEAL then - return (s__LifeSteal_amount[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_SPELL_VAMP then - return (s__SpellVamp_amount[GetUnitUserData(((source)))]) // INLINED!! - elseif bonus == BONUS_COOLDOWN_REDUCTION then - return (1 - s__CDR_get((source) , 0)) // INLINED!! - elseif bonus == BONUS_COOLDOWN_REDUCTION_FLAT then - return (s__CDR_get((source) , 1)) // INLINED!! - elseif bonus == BONUS_COOLDOWN_OFFSET then - return (s__CDR_get((source) , 2)) // INLINED!! - elseif bonus == BONUS_TENACITY then - return (sc__Tenacity_get((source) , 0)) // INLINED!! - elseif bonus == BONUS_TENACITY_FLAT then - return (sc__Tenacity_get((source) , 1)) // INLINED!! - elseif bonus == BONUS_TENACITY_OFFSET then - return (sc__Tenacity_get((source) , 2)) // INLINED!! - endif @@ -57555,140 +46455,17 @@ endfunction - else - call h__DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type") - endif - - return - 1. - endfunction - function s__NewBonus_Set takes unit source,integer bonus,real value,boolean adding returns real - local real p - - if not adding then - set s__NewBonus_key=s__NewBonus_key + 1 - set s__NewBonus_unit[s__NewBonus_key]=source - set s__NewBonus_type[s__NewBonus_key]=bonus - set s__NewBonus_amount[s__NewBonus_key]=value - - call s__NewBonus_onEvent(s__NewBonus_key) - - if s__NewBonus_amount[s__NewBonus_key] != value then - set value=s__NewBonus_amount[s__NewBonus_key] - endif - - if s__NewBonus_type[s__NewBonus_key] != bonus then - return s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_amount[s__NewBonus_key] , not adding) - endif - else - set s__NewBonus_unit[s__NewBonus_key]=source - set s__NewBonus_type[s__NewBonus_key]=bonus - set s__NewBonus_amount[s__NewBonus_key]=value - endif - if bonus == BONUS_DAMAGE then - return s__NewBonus_setAbilityI(source , NewBonus__DAMAGE_ABILITY , NewBonus__DAMAGE_FIELD , value , adding) - elseif bonus == BONUS_ARMOR then - return s__NewBonus_setAbilityI(source , NewBonus__ARMOR_ABILITY , NewBonus__ARMOR_FIELD , value , adding) - elseif bonus == BONUS_HEALTH then - set p=GetUnitLifePercent(source) - if value == 0 and not adding then - call BlzSetUnitMaxHP(source, R2I(BlzGetUnitMaxHP(source) - s__NewBonus_get(source , bonus))) - else - call BlzSetUnitMaxHP(source, R2I(BlzGetUnitMaxHP(source) + value)) - endif - call s__NewBonus_setAbilityI(source , NewBonus__HEALTH_ABILITY , NewBonus__HEALTH_FIELD , value , adding) - call SetUnitLifePercentBJ(source, p) - return value - elseif bonus == BONUS_MANA then - set p=GetUnitManaPercent(source) - if value == 0 and not adding then - call BlzSetUnitMaxMana(source, R2I(BlzGetUnitMaxMana(source) - s__NewBonus_get(source , bonus))) - else - call BlzSetUnitMaxMana(source, R2I(BlzGetUnitMaxMana(source) + value)) - endif - call s__NewBonus_setAbilityI(source , NewBonus__MANA_ABILITY , NewBonus__MANA_FIELD , value , adding) - call SetUnitManaPercentBJ(source, p) - return value - elseif bonus == BONUS_AGILITY then - return s__NewBonus_setAbilityI(source , NewBonus__STATS_ABILITY , NewBonus__AGILITY_FIELD , value , adding) - elseif bonus == BONUS_STRENGTH then - return s__NewBonus_setAbilityI(source , NewBonus__STATS_ABILITY , NewBonus__STRENGTH_FIELD , value , adding) - elseif bonus == BONUS_INTELLIGENCE then - return s__NewBonus_setAbilityI(source , NewBonus__STATS_ABILITY , NewBonus__INTELLIGENCE_FIELD , value , adding) - elseif bonus == BONUS_MOVEMENT_SPEED then - return s__NewBonus_setAbilityI(source , NewBonus__MOVEMENTSPEED_ABILITY , NewBonus__MOVEMENTSPEED_FIELD , value , adding) - elseif bonus == BONUS_SIGHT_RANGE then - if value == 0 and not adding then - call BlzSetUnitRealField(source, UNIT_RF_SIGHT_RADIUS, ( BlzGetUnitRealField(source, UNIT_RF_SIGHT_RADIUS) - s__NewBonus_get(source , bonus) )) - else - call BlzSetUnitRealField(source, UNIT_RF_SIGHT_RADIUS, ( BlzGetUnitRealField(source, UNIT_RF_SIGHT_RADIUS) + value )) - endif - call s__NewBonus_setAbilityI(source , NewBonus__SIGHT_RANGE_ABILITY , NewBonus__SIGHT_RANGE_FIELD , value , adding) - return value - elseif bonus == BONUS_HEALTH_REGEN then - return s__NewBonus_setAbilityR(source , NewBonus__HEALTHREGEN_ABILITY , NewBonus__HEALTHREGEN_FIELD , value) - elseif bonus == BONUS_MANA_REGEN then - return s__NewBonus_setAbilityR(source , NewBonus__MANAREGEN_ABILITY , NewBonus__MANAREGEN_FIELD , value) - elseif bonus == BONUS_ATTACK_SPEED then - return s__NewBonus_setAbilityR(source , NewBonus__ATTACKSPEED_ABILITY , NewBonus__ATTACKSPEED_FIELD , value) - elseif bonus == BONUS_MAGIC_RESISTANCE then - return s__NewBonus_setAbilityR(source , NewBonus__MAGIC_RESISTANCE_ABILITY , NewBonus__MAGIC_RESISTANCE_FIELD , value) - elseif bonus >= BONUS_EVASION_CHANCE and bonus <= s__NewBonus_last then - if bonus == BONUS_EVASION_CHANCE then - set s__Evasion_evasion[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_MISS_CHANCE then - set s__Evasion_miss[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_CRITICAL_CHANCE then - set s__Critical_chance[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_CRITICAL_DAMAGE then - set s__Critical_multiplier[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_SPELL_POWER_FLAT then - set s__SpellPower_flat[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_SPELL_POWER_PERCENT then - set s__SpellPower_percent[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_LIFE_STEAL then - set s__LifeSteal_amount[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_SPELL_VAMP then - set s__SpellVamp_amount[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! - elseif bonus == BONUS_COOLDOWN_REDUCTION then - if adding then - call s__CDR_add((source ) , (( value)*1.0)) // INLINED!! - else - call s__CDR_Set((source ) , (( value)*1.0) , 0) // INLINED!! - endif - elseif bonus == BONUS_COOLDOWN_REDUCTION_FLAT then - call s__CDR_Set((source ) , (( value)*1.0) , 1) // INLINED!! - elseif bonus == BONUS_COOLDOWN_OFFSET then - call s__CDR_Set((source ) , (( value)*1.0) , 2) // INLINED!! - elseif bonus == BONUS_TENACITY then - if adding then - call sc__Tenacity_add((source ) , (( value)*1.0) , 0) // INLINED!! - else - call sc__Tenacity_Set((source ) , (( value)*1.0) , 0) // INLINED!! - endif - elseif bonus == BONUS_TENACITY_FLAT then - call sc__Tenacity_Set((source ) , (( value)*1.0) , 1) // INLINED!! - elseif bonus == BONUS_TENACITY_OFFSET then - call sc__Tenacity_Set((source ) , (( value)*1.0) , 2) // INLINED!! - endif - - set s__NewBonus_linkType=bonus - - if s__NewBonus_key > - 1 then - set s__NewBonus_key=s__NewBonus_key - 1 - endif - - return value @@ -57700,24846 +46477,33652 @@ endfunction - else - call h__DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type: " + I2S(bonus) + " with last " + I2S(s__NewBonus_last)) - endif - return - 1. - endfunction - function s__NewBonus_add takes unit source,integer bonus,real value returns real - if value != 0 then - set s__NewBonus_key=s__NewBonus_key + 1 - set s__NewBonus_unit[s__NewBonus_key]=source - set s__NewBonus_type[s__NewBonus_key]=bonus - set s__NewBonus_amount[s__NewBonus_key]=value - - if bonus <= BONUS_SIGHT_RANGE then - set s__NewBonus_amount[s__NewBonus_key]=s__NewBonus_checkOverflow(s__NewBonus_get(source , bonus) , R2I(value)) - endif - - call s__NewBonus_onEvent(s__NewBonus_key) - set value=s__NewBonus_amount[s__NewBonus_key] - - if s__NewBonus_type[s__NewBonus_key] <= BONUS_SIGHT_RANGE then - call s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_checkOverflow(s__NewBonus_get(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key]) , R2I(s__NewBonus_amount[s__NewBonus_key])) , true) - else - if s__NewBonus_type[s__NewBonus_key] == BONUS_COOLDOWN_REDUCTION or s__NewBonus_type[s__NewBonus_key] == BONUS_TENACITY then - call s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_amount[s__NewBonus_key] , true) - else - call s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_get(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key]) + s__NewBonus_amount[s__NewBonus_key] , true) - endif - endif - - return value - endif - - return 0. - endfunction - - function s__NewBonus_register takes code c,integer bonus returns nothing - if bonus >= BONUS_DAMAGE and bonus <= s__NewBonus_last then - if s__NewBonus_event[bonus] == null then - set s__NewBonus_event[bonus]=CreateTrigger() - endif - call TriggerAddCondition(s__NewBonus_event[bonus], Filter(c)) - else - call TriggerAddCondition(s__NewBonus_trigger, Filter(c)) - endif - endfunction - - function s__NewBonus_onInit takes nothing returns nothing - set s__NewBonus_last=BONUS_TENACITY_OFFSET - endfunction -//library NewBonus ends -//library Parry: -function Parry___TimerFunctionExpires takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer handleId= GetHandleId(t) - local unit caster= LoadUnitHandle(Parry___h, handleId, 0) - - call GroupRemoveUnit(Parry___casters, caster) - call UnitRemoveAbility(caster, Parry_BUFF_ABILITY_ID) - - call FlushChildHashtable(Parry___h, handleId) - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function Parry takes unit caster returns nothing - local integer handleId= GetHandleId(caster) - local timer t= LoadTimerHandle(Parry___h, handleId, 0) - local real duration= 1.0 + I2R(GetUnitAbilityLevel(caster, Parry_ABILITY_ID)) * 0.5 - call GroupAddUnit(Parry___casters, caster) - call UnitAddAbility(caster, Parry_BUFF_ABILITY_ID) - if ( t == null ) then - set t=CreateTimer() - endif - call TimerStart(t, duration, false, function Parry___TimerFunctionExpires) - call SaveTimerHandle(Parry___h, handleId, 0, t) - set handleId=GetHandleId(t) - call SaveUnitHandle(Parry___h, handleId, 0, caster) - set t=null -endfunction -function Parry___TriggerConditionCast takes nothing returns boolean - if ( GetSpellAbilityId() == Parry_ABILITY_ID ) then - call Parry(GetTriggerUnit()) - endif - return false -endfunction -function Parry___TriggerConditionAttack takes nothing returns boolean - local real x= GetUnitX(GetTriggerUnit()) - local real y= GetUnitY(GetTriggerUnit()) - if ( IsUnitInGroup(GetTriggerUnit(), Parry___casters) ) then - call BlzUnitInterruptAttack(GetAttacker()) - call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] , "Parry!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) - call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(GetAttacker()))] , "Parry!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) - endif - return false -endfunction -function Parry___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Parry___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(Parry___castTrigger, Condition(function Parry___TriggerConditionCast)) - call TriggerRegisterAnyUnitEventBJ(Parry___attackTrigger, EVENT_PLAYER_UNIT_ATTACKED) - call TriggerAddCondition(Parry___attackTrigger, Condition(function Parry___TriggerConditionAttack)) -endfunction -function Parry___StopEffect takes unit whichUnit returns nothing - local integer handleId= GetHandleId(whichUnit) - local timer t= LoadTimerHandle(Parry___h, handleId, 0) - call FlushChildHashtable(Parry___h, GetHandleId(t)) - call PauseTimer(t) - call DestroyTimer(t) - call FlushChildHashtable(Parry___h, handleId) - call GroupRemoveUnit(Parry___casters, whichUnit) -endfunction -function Parry___RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, Parry___casters) ) then - call Parry___StopEffect(whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit Parry___RemoveUnitHook -//library Parry ends -//library PhoenixEgg: -function PhoenixEgg___TimerFunctionExpires takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer handleId= GetHandleId(t) - local unit egg= LoadUnitHandle(PhoenixEgg___h, handleId, 0) - local unit hero= LoadUnitHandle(PhoenixEgg___h, handleId, 1) - - call ReviveHero(hero, GetUnitX(egg), GetUnitY(egg), true) - - call KillUnit(egg) - - call GroupRemoveUnit(PhoenixEgg___eggs, egg) - - call FlushChildHashtable(PhoenixEgg___h, handleId) - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function PhoenixEgg___StopEffect takes unit egg returns nothing - local integer handleId= GetHandleId(egg) - local timer t= LoadTimerHandle(PhoenixEgg___h, handleId, 0) - call FlushChildHashtable(PhoenixEgg___h, GetHandleId(t)) - call PauseTimer(t) - call DestroyTimer(t) - call FlushChildHashtable(PhoenixEgg___h, handleId) - call GroupRemoveUnit(PhoenixEgg___eggs, egg) -endfunction -function GetPhoenixEggAbilityId takes unit hero returns integer - local integer level1= GetUnitAbilityLevel(hero, PhoenixEgg_ABILITY_ID) - local integer level2= GetUnitAbilityLevel(hero, PhoenixEgg_ABILITY_ID_2) - if ( level1 > level2 ) then - return level1 - endif - - return level2 -endfunction -function PhoenixEgg takes unit hero,unit egg returns nothing - local integer handleId= GetHandleId(egg) - local timer t= LoadTimerHandle(PhoenixEgg___h, handleId, 0) - local real duration= 20.0 - I2R(GetPhoenixEggAbilityId(hero)) * 1.0 - call GroupAddUnit(PhoenixEgg___eggs, egg) - if ( t == null ) then - set t=CreateTimer() - endif - call TimerStart(t, duration, false, function PhoenixEgg___TimerFunctionExpires) - call SaveTimerHandle(PhoenixEgg___h, handleId, 0, t) - set handleId=GetHandleId(t) - call SaveUnitHandle(PhoenixEgg___h, handleId, 0, egg) - call SaveUnitHandle(PhoenixEgg___h, handleId, 1, hero) - set t=null -endfunction -function PhoenixEgg___TriggerConditionSummon takes nothing returns boolean - //call BJDebugMsg(GetUnitName(GetSummoningUnit()) + " summons " + GetUnitName(GetSummonedUnit())) - if ( GetUnitTypeId(GetSummonedUnit()) == PhoenixEgg_UNIT_TYPE_ID and IsUnitType(GetSummoningUnit(), UNIT_TYPE_HERO) ) then - //call BJDebugMsg(GetUnitName(GetSummoningUnit()) + " summons " + GetUnitName(GetSummonedUnit())) - call PhoenixEgg(GetSummoningUnit() , GetSummonedUnit()) - endif - return false -endfunction -function PhoenixEgg___TriggerConditionDeath takes nothing returns boolean - if ( IsUnitInGroup(GetTriggerUnit(), PhoenixEgg___eggs) ) then - call PhoenixEgg___StopEffect(GetTriggerUnit()) - endif - return false -endfunction -function PhoenixEgg___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(PhoenixEgg___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(PhoenixEgg___summonTrigger, Condition(function PhoenixEgg___TriggerConditionSummon)) - call TriggerRegisterAnyUnitEventBJ(PhoenixEgg___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(PhoenixEgg___deathTrigger, Condition(function PhoenixEgg___TriggerConditionDeath)) -endfunction -function PhoenixEgg___RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, PhoenixEgg___eggs) ) then - call PhoenixEgg___StopEffect(whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit PhoenixEgg___RemoveUnitHook -//library PhoenixEgg ends -//library Railway: -function GetRailwayRectFromCurrentPosition takes unit whichUnit returns integer - local integer i= 0 - loop - exitwhen ( i == udg_RailwayRectsCounter ) - if ( RectContainsUnit(udg_RailwayRects[i], whichUnit) ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function UnitIsInRailwayStation takes unit whichUnit returns boolean - local integer index= LoadInteger(Railway___h, GetHandleId(udg_RailwayLocomotive), Railway___KEY_STATION) - return index != - 1 -endfunction -function MoveUnitToRailwayStation takes unit whichUnit returns nothing - local integer index= LoadInteger(Railway___h, GetHandleId(udg_RailwayLocomotive), Railway___KEY_STATION) - if ( index != - 1 ) then - call SetUnitX(whichUnit, GetRectCenterX(udg_RailwayStationUnloadRects[index])) - call SetUnitY(whichUnit, GetRectCenterY(udg_RailwayStationUnloadRects[index])) - call BlzSetUnitFacingEx(whichUnit, udg_RailwayStationFaces[index]) - endif -endfunction -function InitRailwayFromCurrentPositions takes nothing returns nothing - local integer index= - 1 - local unit slotUnit= null - local integer i= 0 - local integer max= BlzGroupGetSize(udg_Railway) - loop - exitwhen ( i == max ) - set slotUnit=BlzGroupUnitAt(udg_Railway, i) - set index=GetRailwayRectFromCurrentPosition(slotUnit) - if ( index != - 1 ) then - call SaveInteger(Railway___h, GetHandleId(slotUnit), Railway___KEY_POSITION, index) - call SaveInteger(Railway___h, GetHandleId(slotUnit), Railway___KEY_STATION, 0) // initial station - endif - set slotUnit=null - set i=i + 1 - endloop -endfunction -function GetRailwayRect takes unit whichUnit returns integer - return LoadInteger(Railway___h, GetHandleId(whichUnit), Railway___KEY_POSITION) -endfunction -function GetRailwayRectDirection takes integer index returns integer - return udg_RailwayRectsDirections[index] -endfunction -function MoveRailwayFromCurrentPosition takes unit whichUnit returns integer - local integer index= (LoadInteger(Railway___h, GetHandleId((whichUnit)), Railway___KEY_POSITION)) // INLINED!! - local real distance= 30.0 - local integer direction= 0 - local real x= 0.0 - local real y= 0.0 - local real face= 0.0 - if ( index != - 1 ) then - if ( udg_RailwayForward ) then - set face=udg_RailwayRectsFaces[index] - else - set face=udg_RailwayRectsFacesReverse[index] - endif - - // align on the rect - set direction=(udg_RailwayRectsDirections[(index)]) // INLINED!! - - if ( direction == DIRECTION_NORTH or direction == DIRECTION_SOUTH ) then - set x=GetRectMaxX(udg_RailwayRects[index]) - GetRectWidthBJ(udg_RailwayRects[index]) / 2.0 - set y=GetUnitY(whichUnit) - elseif ( direction == DIRECTION_WEST or direction == DIRECTION_EAST ) then - set x=GetUnitX(whichUnit) - set y=GetRectMaxY(udg_RailwayRects[index]) - GetRectHeightBJ(udg_RailwayRects[index]) / 2.0 - - else - set x=GetUnitX(whichUnit) - set y=GetUnitY(whichUnit) - endif - - set x=PolarProjectionX(x , face , distance) - set y=PolarProjectionY(y , face , distance) - - call SetUnitX(whichUnit, x) - call SetUnitY(whichUnit, y) - //call SetUnitFacing(whichUnit, udg_RailwayRectsFaces[index]) - call BlzSetUnitFacingEx(whichUnit, udg_RailwayRectsFaces[index]) - - if ( whichUnit == udg_RailwayLocomotive ) then - set udg_RailwayDistance=udg_RailwayDistance + distance - endif - endif - - return index -endfunction -function MoveRailwayCargo takes nothing returns nothing - local unit whichUnit= null - local real x= GetUnitX(udg_RailwayLocomotive) - local real y= GetUnitY(udg_RailwayLocomotive) - local integer max= BlzGroupGetSize(udg_RailwayCargo) - local integer i= 0 - loop - exitwhen ( i == max ) - set whichUnit=BlzGroupUnitAt(udg_RailwayCargo, i) - call SetUnitX(whichUnit, x) - call SetUnitY(whichUnit, y) - set whichUnit=null - set i=i + 1 - endloop -endfunction -function AddRailwayRect takes nothing returns nothing - local region r= CreateRegion() - set udg_RailwayRects[udg_RailwayRectsCounter]=udg_TmpRect - set udg_RailwayRectsFaces[udg_RailwayRectsCounter]=udg_TmpReal - set udg_RailwayRectsFacesReverse[udg_RailwayRectsCounter]=ModuloReal(udg_TmpReal + 180.0, 360.0) - - if ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 90.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 90.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_NORTH - elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 270.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 270.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_SOUTH - elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 0.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 0.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_EAST - elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 180.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 180.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_WEST - elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 45.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 45.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_NORTH_EAST - elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 135.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 135.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_NORTH_WEST - elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 225.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 225.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_SOUTH_WEST - elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 315.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 315.0 ) then - set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_SOUTH_EAST - endif - - call RegionAddRect(r, udg_TmpRect) - call SaveInteger(Railway___h, GetHandleId(r), Railway___KEY_POSITION, udg_RailwayRectsCounter) - call TriggerRegisterEnterRegion(Railway___enterTrigger, r, null) - - set udg_RailwayRectsCounter=udg_RailwayRectsCounter + 1 -endfunction -function AddRailwayStation takes nothing returns nothing - local region r= CreateRegion() - set udg_RailwayStationRects[udg_RailwayStationsCounter]=udg_TmpRect - set udg_RailwayStationFaces[udg_RailwayStationsCounter]=udg_TmpReal - set udg_RailwayStationUnloadRects[udg_RailwayStationsCounter]=udg_TmpRect2 - - call RegionAddRect(r, udg_TmpRect) - call SaveInteger(Railway___h, GetHandleId(r), Railway___KEY_POSITION, udg_RailwayStationsCounter) - call TriggerRegisterEnterRegion(Railway___enterStationTrigger, r, null) - call TriggerRegisterLeaveRegion(Railway___leaveStationTrigger, r, null) - - set udg_RailwayStationsCounter=udg_RailwayStationsCounter + 1 -endfunction -function Railway___TriggerConditionEnter takes nothing returns boolean - local integer index= LoadInteger(Railway___h, GetHandleId(GetTriggeringRegion()), Railway___KEY_POSITION) - if ( IsUnitInGroup(GetTriggerUnit(), udg_Railway) ) then - call SaveInteger(Railway___h, GetHandleId(GetTriggerUnit()), 0, index) - endif - return false -endfunction -function Railway___TriggerConditionEnterStation takes nothing returns boolean - local integer index= LoadInteger(Railway___h, GetHandleId(GetTriggeringRegion()), Railway___KEY_POSITION) - if ( IsUnitInGroup(GetTriggerUnit(), udg_Railway) ) then - call SaveInteger(Railway___h, GetHandleId(GetTriggerUnit()), Railway___KEY_STATION, index) - endif - return false -endfunction -function Railway___TriggerConditionLeaveStation takes nothing returns boolean - if ( IsUnitInGroup(GetTriggerUnit(), udg_Railway) ) then - call SaveInteger(Railway___h, GetHandleId(GetTriggerUnit()), Railway___KEY_STATION, - 1) - endif - return false -endfunction -function Railway___Init takes nothing returns nothing - call TriggerAddCondition(Railway___enterTrigger, Condition(function Railway___TriggerConditionEnter)) - call TriggerAddCondition(Railway___enterStationTrigger, Condition(function Railway___TriggerConditionEnterStation)) - call TriggerAddCondition(Railway___leaveStationTrigger, Condition(function Railway___TriggerConditionLeaveStation)) -endfunction -function Railway___RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, udg_RailwayCargo) ) then - call GroupRemoveUnit(udg_RailwayCargo, whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit Railway___RemoveUnitHook -//library Railway ends -//library RayConfig: -function RayConfig___HasDummy takes unit target,integer abilityId returns boolean - return HaveSavedHandle(RayConfig___h, GetHandleId(target), abilityId) -endfunction -function RayConfig___AttachDummy takes player owner,integer unitTypeId,unit target,integer abilityId returns unit - local real face= GetUnitFacing(target) - local real x= PolarProjectionX(GetUnitX(target) , 30.0 , face) - local real y= PolarProjectionY(GetUnitY(target) , 30.0 , face) - local real faceToTarget= AngleBetweenCoordinatesDeg(GetUnitX(target) , GetUnitY(target) , x , y) - local unit dummy= CreateUnit(owner, unitTypeId, x, y, faceToTarget) - call SaveUnitHandle(RayConfig___h, GetHandleId(target), abilityId, dummy) - call ShowUnit(dummy, false) - return dummy -endfunction -function RayConfig___CleanDummy takes unit target,integer abilityId returns nothing - local integer handleId= GetHandleId(target) - local unit dummy= LoadUnitHandle(RayConfig___h, handleId, abilityId) - if ( dummy != null ) then - call RemoveSavedHandle(RayConfig___h, handleId, abilityId) - call h__RemoveUnit(dummy) - set dummy=null - endif -endfunction -function RayConfig___TimerFunctionCleanDummy takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer handleId= GetHandleId(t) - local unit target= LoadUnitHandle(RayConfig___h, handleId, 0) - local integer abilityId= LoadInteger(RayConfig___h, handleId, 1) - call RayConfig___CleanDummy(target , abilityId) - call PauseTimer(t) - call DestroyTimer(t) - call FlushChildHashtable(RayConfig___h, handleId) -endfunction -function RayConfig___CleanDummyDelayed takes unit target,integer abilityId,real delay returns nothing - local timer t= CreateTimer() - local integer handleId= GetHandleId(t) - call SaveUnitHandle(RayConfig___h, handleId, 0, target) - call SaveInteger(RayConfig___h, handleId, 1, abilityId) - call TimerStart(t, delay, false, function RayConfig___TimerFunctionCleanDummy) -endfunction -function RayConfig___RemoveUnitHook takes unit whichUnit returns nothing - call FlushChildHashtable(RayConfig___h, GetHandleId(whichUnit)) -endfunction -//processed hook: hook RemoveUnit RayConfig___RemoveUnitHook -function RayConfig_IsValidAbility takes integer abilityId returns boolean - if ( abilityId == RayConfig_FROST_RAY ) then - return true - elseif ( abilityId == RayConfig_FIRE_RAY ) then - return true - elseif ( abilityId == RayConfig_HOLY_RAY ) then - return true - elseif ( abilityId == RayConfig_HARVEST_RAY ) then - return true - elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then - return true - elseif ( abilityId == RayConfig_WATER_RAY ) then - return true - elseif ( abilityId == RayConfig_WATER_RAY_SLOT_1 ) then - return true - elseif ( abilityId == RayConfig_DRAIN_RAY ) then - return true - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return true - elseif ( abilityId == RayConfig_CHAIN_RAY ) then - return true - elseif ( abilityId == RayConfig_MANA_RAY ) then - return true - elseif ( abilityId == RayConfig_RAISE_RAY ) then - return true - elseif ( abilityId == RayConfig_POISON_RAY ) then - return true - elseif ( abilityId == RayConfig_CHARM_RAY ) then - return true - elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY ) then - return true - elseif ( abilityId == RayConfig_HEX_RAY ) then - return true - elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then - return true - elseif ( abilityId == RayConfig_WIND_RAY ) then - return true - endif - return false -endfunction -function RayConfig_CanTargetUnits takes integer abilityId returns boolean - return true -endfunction -function RayConfig_CanTargetDestructables takes integer abilityId returns boolean - return true -endfunction -function RayConfig_CanTargetItems takes integer abilityId returns boolean - return abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD -endfunction -function RayConfig___IsNoAlly takes unit target,unit caster returns boolean - return GetOwningPlayer(caster) != GetOwningPlayer(target) and ( not IsUnitAlly(target, GetOwningPlayer(caster)) or GetOwningPlayer(target) == Player(PLAYER_NEUTRAL_PASSIVE) ) -endfunction -function RayConfig___IsNotAValidWoWReforgedTarget takes unit target returns boolean - local integer unitTypeId= GetUnitTypeId(target) - return unitTypeId == BACKPACK or unitTypeId == EQUIPMENT_BAG -endfunction -function RayConfig_IsUnitAllowed takes unit caster,unit target,integer abilityId returns boolean - if ( caster == target ) then - return false - elseif ( RayConfig___IsNotAValidWoWReforgedTarget(target) ) then - return false - // Locust is used by dummy units. - elseif ( GetUnitAbilityLevel(target, 'Aloc') > 0 ) then - return false - elseif ( abilityId == RayConfig_RAISE_RAY and IsUnitAliveBJ(target) ) then - return false - elseif ( abilityId == RayConfig_HARVEST_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_HOLY_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_LOOT_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_LOOT_RAY_STANDARD and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_WATER_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_WATER_RAY_SLOT_1 and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_POISON_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_CHARM_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_MANA_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_HEX_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY and IsUnitDeadBJ(target) ) then - return false - elseif ( abilityId == RayConfig_CHAIN_RAY and ( IsUnitDeadBJ(target) or DistanceBetweenCoordinates(GetUnitX(caster) , GetUnitY(caster) , GetUnitX(target) , GetUnitY(target)) <= 100.0 ) ) then - return false - elseif ( abilityId == RayConfig_RESURRECTION_RAY and ( IsUnitType(target, UNIT_TYPE_STRUCTURE) or IsUnitAliveBJ(target) or IsUnitEnemy(target, GetOwningPlayer(caster)) ) ) then - return false - elseif ( abilityId == RayConfig_WIND_RAY and ( not IsUnitType(target, UNIT_TYPE_GROUND) or IsUnitType(target, UNIT_TYPE_STRUCTURE) or IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) ) ) then - return false - elseif ( ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FIRE_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY or abilityId == RayConfig_WIND_RAY ) and IsUnitDeadBJ(target) ) then - return false - endif - - return true -endfunction -function RayConfig_IsDestructableAllowed takes unit caster,destructable target,integer abilityId returns boolean - if ( abilityId == RayConfig_RESURRECTION_RAY ) then - return IsDestructableDeadBJ(target) - endif - return IsDestructableAliveBJ(target) -endfunction -function RayConfig_IsItemAllowed takes unit caster,item target,integer abilityId returns boolean - return GetItemLifeBJ(target) > 0.0 and DistanceBetweenCoordinates(GetUnitX(caster) , GetUnitY(caster) , GetItemX(target) , GetItemY(target)) > 100.0 -endfunction -function RayConfig___IsFrostRay takes integer index returns boolean - return ModuloInteger(index, 2) == 1 -endfunction -function RayConfig_GetLightningOffsetWidthX takes unit caster,integer abilityId,integer index returns real - if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - if ( (ModuloInteger((index), 2) == 1) ) then // INLINED!! - return index * 10.0 - else - return index * - 10.0 - endif - endif - return 0.0 -endfunction -function RayConfig_GetLightningOffsetWidthY takes unit caster,integer abilityId,integer index returns real - if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - if ( (ModuloInteger((index), 2) == 1) ) then // INLINED!! - return index * 10.0 - else - return index * - 10.0 - endif - endif - return 0.0 -endfunction -function RayConfig_GetLightningOffsetLengthX takes unit caster,integer abilityId,integer index returns real - return 40.0 -endfunction -function RayConfig_GetLightningOffsetLengthY takes unit caster,integer abilityId,integer index returns real - return 40.0 -endfunction -function RayConfig_GetLightningOffsetZ takes unit caster,integer abilityId,integer index returns real - return 40.0 -endfunction -function RayConfig___GetDamage takes unit caster,integer abilityId,real duration returns real - local real result= ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 9.0 + 7.0 ) * RayConfig_REFRESH_INTERVAL - - if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return result * 4.0 - endif - - return result -endfunction -function RayConfig___GetSpeed takes unit caster,integer abilityId,real duration returns real - return ( GetUnitAbilityLevel(caster, abilityId) * 10.0 + 220.0 ) * RayConfig_REFRESH_INTERVAL -endfunction -function RayConfig___GetHealingLife takes unit caster,integer abilityId,real duration returns real - return ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 9.0 + 7.0 ) * RayConfig_REFRESH_INTERVAL -endfunction -function RayConfig___GetMana takes unit caster,integer abilityId,real duration returns real - return ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 10.0 + 10.0 ) * RayConfig_REFRESH_INTERVAL -endfunction -function RayConfig___GetManaCost takes unit caster,integer abilityId,real duration returns real - return ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 7.0 + 5.0 ) * RayConfig_REFRESH_INTERVAL -endfunction -function RayConfig___WaitDuration takes real duration,real expected returns boolean - if ( duration >= expected ) then - return true - endif - return false -endfunction -function RayConfig___EveryDuration takes real duration,real interval returns boolean - local real mod= ModuloReal(duration, interval) - return ( mod >= 0.0 and mod < RayConfig_REFRESH_INTERVAL ) -endfunction -function RayConfig___GetGold takes unit caster,integer abilityId,real duration returns integer - if ( RayConfig___EveryDuration(duration , RayConfig_HARVEST_INTERVAL) ) then - return GetUnitAbilityLevel(caster, abilityId) - endif - return 0 -endfunction -function RayConfig___GetLumber takes unit caster,integer abilityId,real duration returns integer - if ( RayConfig___EveryDuration(duration , RayConfig_HARVEST_INTERVAL) ) then - return GetUnitAbilityLevel(caster, abilityId) - endif - return 0 -endfunction -function RayConfig___MoveUnit takes unit caster,unit target,real distance returns nothing - local real sourceX= GetUnitX(caster) - local real sourceY= GetUnitY(caster) - local real targetX= GetUnitX(target) - local real targetY= GetUnitY(target) - local real dist= DistanceBetweenCoordinates(sourceX , sourceY , targetX , targetY) - local real d= dist + distance - local real facing= GetUnitFacing(caster) - local real x= PolarProjectionX(sourceX , d , facing) - local real y= PolarProjectionY(sourceY , d , facing) - call SetUnitPosition(target, x, y) -endfunction -function RayConfig___KnockBack takes unit caster,unit target,real distance returns nothing - call RayConfig___MoveUnit(caster , target , distance) -endfunction -function RayConfig___PullUnit takes unit caster,unit target,real distance returns nothing - call RayConfig___MoveUnit(caster , target , - distance) -endfunction -function RayConfig___PullItem takes unit caster,item target,real distance returns nothing - local real casterX= GetUnitX(caster) - local real casterY= GetUnitY(caster) - local real itemX= GetItemX(target) - local real itemY= GetItemY(target) - local real dist= DistanceBetweenCoordinates(casterX , casterY , itemX , itemY) - local real d= dist - distance - local real facing= GetUnitFacing(caster) - local real x= PolarProjectionX(casterX , d , facing) - local real y= PolarProjectionY(casterY , d , facing) - call SetItemPosition(target, x, y) - - if ( DistanceBetweenCoordinates(casterX , casterY , x , y) <= 100.0 ) then - call UnitAddItem(caster, target) - endif -endfunction -function RayConfig___Drain takes unit caster,unit target,real amount,real manaAmount returns nothing - // damaging triggers the creep - call UnitDamageTarget(caster, target, amount, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) - call SetUnitState(target, UNIT_STATE_MANA, RMaxBJ(GetUnitState(target, UNIT_STATE_MANA) - manaAmount, 0.0)) - - call SetUnitState(caster, UNIT_STATE_LIFE, RMinBJ(GetUnitState(caster, UNIT_STATE_LIFE) + amount, GetUnitState(caster, UNIT_STATE_MAX_LIFE))) - call SetUnitState(caster, UNIT_STATE_MANA, RMinBJ(GetUnitState(caster, UNIT_STATE_MANA) + manaAmount, GetUnitState(caster, UNIT_STATE_MAX_MANA))) -endfunction -function RayConfig___Restore takes unit caster,unit target,real amount,real manaAmount returns nothing - call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_LIFE) + amount, GetUnitState(target, UNIT_STATE_MAX_LIFE))) - call SetUnitState(target, UNIT_STATE_MANA, RMinBJ(GetUnitState(target, UNIT_STATE_MANA) + manaAmount, GetUnitState(target, UNIT_STATE_MAX_MANA))) -endfunction -function RayConfig___DrainMana takes unit caster,unit target,real amount returns nothing - call SetUnitState(target, UNIT_STATE_MANA, RMaxBJ(GetUnitState(target, UNIT_STATE_MANA) - amount, 0.0)) - - call SetUnitState(caster, UNIT_STATE_MANA, RMinBJ(GetUnitState(caster, UNIT_STATE_MANA) + amount, GetUnitState(caster, UNIT_STATE_MAX_MANA))) -endfunction -function RayConfig___RestoreMana takes unit caster,unit target,real amount returns nothing - call SetUnitState(target, UNIT_STATE_MANA, RMinBJ(GetUnitState(target, UNIT_STATE_MANA) + amount, GetUnitState(target, UNIT_STATE_MAX_MANA))) -endfunction -function RayConfig___SummonSkeleton takes unit caster,unit target returns nothing - local unit s= CreateUnit(GetOwningPlayer(caster), 'nske', GetUnitX(target), GetUnitY(target), GetUnitFacing(target)) - call UnitApplyTimedLife(s, 'BTLF', 60) - call SetUnitAnimation(s, "Birth") - call h__RemoveUnit(target) - set s=null -endfunction -function RayConfig___ResurrectNonHeroUnit takes unit target returns nothing - local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(target) , RayConfig_RESURRECT_DUMMY , target , RayConfig_RESURRECTION_RAY) - call IssueImmediateOrder(dummy, "resurrection") - call RayConfig___CleanDummyDelayed(target , RayConfig_RESURRECTION_RAY , 2.0) - //call BJDebugMsg("Remove dummy!") - set dummy=null -endfunction -function RayConfig___FrostDamage takes unit caster,unit target returns nothing - local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_FROST_DUMMY , target , RayConfig_FROST_RAY) - call SetUnitAbilityLevel(dummy, RayConfig_FROST_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_FROST_RAY)) - call IssueTargetOrder(dummy, "attack", target) - call RayConfig___CleanDummyDelayed(target , RayConfig_FROST_DUMMY , 2.0) - set dummy=null -endfunction -function RayConfig___FireDamage takes unit caster,unit target returns nothing - local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_FIRE_DUMMY , target , RayConfig_FIRE_RAY) - call SetUnitAbilityLevel(dummy, RayConfig_FIRE_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_FIRE_RAY)) - call IssueTargetOrder(dummy, "attack", target) - call RayConfig___CleanDummyDelayed(target , RayConfig_FIRE_DUMMY , 2.0) - //call BJDebugMsg("Remove dummy!") - set dummy=null -endfunction -function RayConfig___PoisonDamage takes unit caster,unit target returns nothing - local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_POISON_DUMMY , target , RayConfig_POISON_RAY) - call SetUnitAbilityLevel(dummy, RayConfig_POISON_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_POISON_RAY)) - //call BJDebugMsg("Create poison dummy " + GetUnitName(dummy)) - call IssueTargetOrder(dummy, "attack", target) - call RayConfig___CleanDummyDelayed(target , RayConfig_POISON_DUMMY , 2.0) - //call BJDebugMsg("Remove dummy!") - set dummy=null -endfunction -function RayConfig___Cyclone takes unit caster,unit target returns nothing - local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_WIND_DUMMY , target , RayConfig_WIND_RAY) - call SetUnitAbilityLevel(dummy, RayConfig_WIND_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_WIND_RAY)) - call IssueTargetOrder(dummy, "cyclone", target) - call RayConfig___CleanDummyDelayed(target , RayConfig_WIND_DUMMY , 2.0) - //call BJDebugMsg("Remove dummy cyclone!") - set dummy=null -endfunction -function RayConfig___GetMaxCharmLevel takes unit caster,integer abilityId returns integer - return 5 + GetUnitAbilityLevel(caster, abilityId) -endfunction -function RayConfig___Charm takes unit caster,unit target returns nothing - local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_CHARM_DUMMY , target , RayConfig_CHARM_RAY) - call SetUnitAbilityLevel(dummy, RayConfig_CHARM_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_CHARM_RAY)) - call IssueTargetOrder(dummy, "charm", target) - call RayConfig___CleanDummyDelayed(target , RayConfig_CHARM_DUMMY , 2.0) - //call BJDebugMsg("Remove dummy cyclone!") - set dummy=null -endfunction -function RayConfig___Hex takes unit caster,unit target returns nothing - local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_HEX_DUMMY , target , RayConfig_HEX_RAY) - call SetUnitAbilityLevel(dummy, RayConfig_HEX_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_HEX_RAY)) - call IssueTargetOrder(dummy, "hex", target) - call RayConfig___CleanDummyDelayed(target , RayConfig_HEX_DUMMY , 2.0) - //call BJDebugMsg("Remove dummy cyclone!") - set dummy=null -endfunction -function RayConfig___ResurrectUnit takes unit target returns nothing - if ( IsUnitType(target, UNIT_TYPE_HERO) ) then - //call BJDebugMsg("Revive hero " + GetUnitName(target)) - call ReviveHero(target, GetUnitX(target), GetUnitY(target), true) - else - //call BJDebugMsg("Mod " + R2S(ModuloReal(duration, 1.0))) - if ( not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_RESURRECTION_RAY))) ) then // INLINED!! - //call BJDebugMsg("Resurrect unit " + GetUnitName(target)) - call RayConfig___ResurrectNonHeroUnit(target) - endif - endif -endfunction -function RayConfig_OnHitUnit takes unit caster,unit target,integer abilityId,real duration returns nothing - if ( abilityId == RayConfig_HOLY_RAY ) then - if ( IsUnitAlly(target, GetOwningPlayer(caster)) ) then - if ( not IsUnitType(target, UNIT_TYPE_UNDEAD) ) then - call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_MAX_LIFE), GetUnitState(target, UNIT_STATE_LIFE) + RayConfig___GetHealingLife(caster , abilityId , duration))) - endif - else - if ( IsUnitType(target, UNIT_TYPE_UNDEAD) ) then - call UnitDamageTarget(caster, target, RayConfig___GetDamage(caster , abilityId , duration), false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) - endif - endif - elseif ( abilityId == RayConfig_HARVEST_RAY ) then - if ( GetResourceAmount(target) > 0 ) then - call AdjustPlayerStateBJ(RayConfig___GetGold(caster , abilityId , duration), GetOwningPlayer(caster), PLAYER_STATE_RESOURCE_GOLD) - call SetResourceAmount(target, IMaxBJ(0, GetResourceAmount(target) - RayConfig___GetGold(caster , abilityId , duration))) - endif - elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then - if ( RayConfig___IsNoAlly(target , caster) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then - call RayConfig___MoveUnit((caster ) , ( target ) , (( RayConfig___GetSpeed(caster , abilityId , duration))*1.0)) // INLINED!! - endif - elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then - // nothing - elseif ( abilityId == RayConfig_CHAIN_RAY ) then - if ( RayConfig___IsNoAlly(target , caster) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then - call RayConfig___MoveUnit((caster ) , ( target ) , - (( RayConfig___GetSpeed(caster , abilityId , duration))*1.0)) // INLINED!! - endif - elseif ( abilityId == RayConfig_MANA_RAY ) then - if ( RayConfig___IsNoAlly(target , caster) ) then - call RayConfig___DrainMana(caster , target , RayConfig___GetMana(caster , abilityId , duration)) - else - call RayConfig___RestoreMana(caster , target , RayConfig___GetMana(caster , abilityId , duration)) - endif - elseif ( abilityId == RayConfig_DRAIN_RAY ) then - if ( RayConfig___IsNoAlly(target , caster) ) then - call RayConfig___Drain(caster , target , RayConfig___GetHealingLife(caster , abilityId , duration) , RayConfig___GetMana(caster , abilityId , duration)) - else - call RayConfig___Restore(caster , target , RayConfig___GetHealingLife(caster , abilityId , duration) , RayConfig___GetMana(caster , abilityId , duration)) - endif - elseif ( abilityId == RayConfig_RAISE_RAY ) then - if ( RayConfig___WaitDuration(duration , 1.0) ) then - if ( IsUnitDeadBJ(target) and not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then - call RayConfig___SummonSkeleton(caster , target) - endif - endif - elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then - if ( RayConfig___WaitDuration(duration , 1.0) ) then - if ( not RayConfig___IsNoAlly(target , caster) or GetOwningPlayer(target) == Player(PLAYER_NEUTRAL_PASSIVE) ) then - call RayConfig___ResurrectUnit(target) - endif - endif - elseif ( abilityId == RayConfig_WIND_RAY ) then - if ( RayConfig___WaitDuration(duration , 2.0) ) then - if ( not UnitHasBuffBJ(target, RayConfig_BUFF_ID_WIND) and RayConfig___IsNoAlly(target , caster) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_WIND_RAY))) ) then // INLINED!! - call RayConfig___Cyclone(caster , target) - endif - endif - elseif ( abilityId == RayConfig_CHARM_RAY ) then - if ( RayConfig___WaitDuration(duration , 6.0) ) then - if ( GetUnitLevel(target) <= (5 + GetUnitAbilityLevel((caster ), ( abilityId))) and not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and RayConfig___IsNoAlly(target , caster) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_CHARM_RAY))) ) then // INLINED!! - call RayConfig___Charm(caster , target) - endif - endif - elseif ( abilityId == RayConfig_HEX_RAY ) then - if ( RayConfig___WaitDuration(duration , 1.0) ) then - if ( not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and RayConfig___IsNoAlly(target , caster) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_HEX_RAY))) ) then // INLINED!! - call RayConfig___Hex(caster , target) - endif - endif - elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY ) then - if ( RayConfig___WaitDuration(duration , 1.0) ) then - if ( IsUnitType(target, UNIT_TYPE_SUMMONED) and RayConfig___IsNoAlly(target , caster) ) then - call UnitDamageTarget(caster, target, RayConfig___GetDamage(caster , abilityId , duration) * 2.0, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) - else - if ( RayConfig___IsNoAlly(target , caster) ) then - call UnitRemoveBuffs(target, true, false) - else - call UnitRemoveBuffs(target, false, true) - endif - endif - endif - elseif ( RayConfig___IsNoAlly(target , caster) ) then - if ( ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_FROST_RAY))) and not UnitHasBuffBJ(target, RayConfig_BUFF_ID_FROST) ) then // INLINED!! - call RayConfig___FrostDamage(caster , target) - endif - if ( ( abilityId == RayConfig_FIRE_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_FIRE_RAY))) and not UnitHasBuffBJ(target, RayConfig_BUFF_ID_FIRE) ) then // INLINED!! - call RayConfig___FireDamage(caster , target) - endif - if ( abilityId == RayConfig_POISON_RAY and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_POISON_RAY))) and not UnitHasBuffBJ(target, RayConfig_BUFF_ID_POISON) ) then // INLINED!! - call RayConfig___PoisonDamage(caster , target) - endif - call UnitDamageTarget(caster, target, RayConfig___GetDamage(caster , abilityId , duration), false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) - endif -endfunction -function RayConfig_OnHitDestructable takes unit caster,destructable target,integer abilityId,real duration returns nothing - if ( abilityId == RayConfig_HARVEST_RAY ) then - if ( IsTree(GetDestructableTypeId(target)) ) then - call AdjustPlayerStateBJ(RayConfig___GetLumber(caster , abilityId , duration), GetOwningPlayer(caster), PLAYER_STATE_RESOURCE_LUMBER) - call SetDestructableLife(target, RMaxBJ(0.0, GetDestructableLife(target) - RayConfig___GetLumber(caster , abilityId , duration))) - endif - elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then - if ( RayConfig___WaitDuration(duration , 2.0) ) then - if ( IsDestructableDeadBJ(target) ) then - call DestructableRestoreLife(target, GetDestructableMaxLife(target), true) - endif - endif - else - call SetDestructableLife(target, RMaxBJ(0.0, GetDestructableLife(target) - RayConfig___GetDamage(caster , abilityId , duration))) - endif -endfunction -function RayConfig_OnHitItem takes unit caster,item target,integer abilityId,real duration returns nothing - call RayConfig___PullItem(caster , target , RayConfig___GetSpeed(caster , abilityId , duration)) -endfunction -function RayConfig_OnCastLoop takes unit caster,integer abilityId,real duration returns boolean - call SetUnitManaBJ(caster, RMaxBJ(0.0, GetUnitState(caster, UNIT_STATE_MANA) - RayConfig___GetManaCost(caster , abilityId , duration))) - - return GetUnitState(caster, UNIT_STATE_MANA) > 0.0 -endfunction -function RayConfig_GetDuration takes unit caster,integer abilityId returns real - if ( abilityId == RayConfig_FROST_RAY ) then - return RayConfig_HOLD_KEY_DURATION - elseif ( abilityId == RayConfig_FIRE_RAY ) then - return RayConfig_HOLD_KEY_DURATION - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return RayConfig_HOLD_KEY_DURATION - endif - return 0.0 -endfunction -function RayConfig_GetMaxDistance takes unit caster,integer abilityId returns real - return BlzGetUnitRealField(caster, UNIT_RF_SIGHT_RADIUS) -endfunction -function RayConfig_GetRange takes unit caster,integer abilityId returns real - return 100.0 -endfunction -function RayConfig_GetCooldown takes unit caster,integer abilityId returns real - return 0.0 -endfunction -function RayConfig_GetMaxLightnings takes unit caster,integer abilityId returns integer - if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return 1 + GetUnitAbilityLevel(caster, abilityId) - endif - return 1 -endfunction -function RayConfig_GetLightningCode takes unit caster,integer abilityId,integer index returns string - if ( abilityId == RayConfig_FROST_RAY ) then - return "BLBM" - elseif ( abilityId == RayConfig_FIRE_RAY ) then - return "FIPA" - elseif ( abilityId == RayConfig_HOLY_RAY ) then - return "YEBM" - elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then - return "YEBM" - elseif ( abilityId == RayConfig_HARVEST_RAY ) then - return "MYSB" - elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then - return "WHBM" - elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then - return "BLBM" - elseif ( abilityId == RayConfig_DRAIN_RAY ) then - return "DRAB" - elseif ( abilityId == RayConfig_CHAIN_RAY ) then - return "WHCH" - elseif ( abilityId == RayConfig_MANA_RAY ) then - return "DRAM" - elseif ( abilityId == RayConfig_RAISE_RAY ) then - return "WHSB" - elseif ( abilityId == RayConfig_POISON_RAY ) then - return "GRSB" - elseif ( abilityId == RayConfig_WIND_RAY ) then - return "SPNL" - elseif ( abilityId == RayConfig_HEX_RAY ) then - return "GRBM" - elseif ( abilityId == RayConfig_CHARM_RAY ) then - return "BLBM" - elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY ) then - return "MYNL" - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - if ( (ModuloInteger((index), 2) == 1) ) then // INLINED!! - return "BLBM" - else - return "FIPA" - endif - endif - return "CLPB" -endfunction -function RayConfig_GetLoopSound takes unit caster,integer abilityId returns sound - if ( abilityId == RayConfig_FIRE_RAY ) then - return gg_snd_Incinerate1 - //return gg_snd_BlueFireBurstLoop - elseif ( abilityId == RayConfig_FROST_RAY ) then - return gg_snd_BreathOfFrost1 - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return gg_snd_BreathOfFrost1 - elseif ( abilityId == RayConfig_DRAIN_RAY ) then - return gg_snd_LifeDrain - elseif ( abilityId == RayConfig_POISON_RAY ) then - return gg_snd_LifeDrain - elseif ( abilityId == RayConfig_HOLY_RAY ) then - return gg_snd_HealTarget - elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then - return gg_snd_HealTarget - elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then - return gg_snd_WaterWaterFallLoop1 - elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then - return gg_snd_ShimmeringPortalLoop - elseif ( abilityId == RayConfig_HARVEST_RAY ) then - return gg_snd_MineDomeLoop1 - elseif ( abilityId == RayConfig_WIND_RAY ) then - return gg_snd_CycloneLoop1 - elseif ( abilityId == RayConfig_HEX_RAY ) then - return gg_snd_CharmTarget1 - endif - return null -endfunction -function RayConfig_GetHitSound takes unit caster,integer abilityId returns sound - if ( abilityId == RayConfig_FIRE_RAY ) then - return gg_snd_ImmolationTarget1 - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return gg_snd_ImmolationTarget1 - elseif ( abilityId == RayConfig_FROST_RAY ) then - return gg_snd_FreezingBreathTarget1 - elseif ( abilityId == RayConfig_DRAIN_RAY ) then - return gg_snd_LifeDrain - elseif ( abilityId == RayConfig_POISON_RAY ) then - return gg_snd_LifeDrain - elseif ( abilityId == RayConfig_HOLY_RAY ) then - return gg_snd_HealTarget - elseif ( abilityId == RayConfig_RAISE_RAY ) then - return gg_snd_RaiseSkeleton - elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then - return gg_snd_Tranquility - elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then - return gg_snd_WaterWaterFallLoop1 - elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then - return gg_snd_ShimmeringPortalLoop - elseif ( abilityId == RayConfig_HARVEST_RAY ) then - return gg_snd_MagicWallLoop1 - endif - return null -endfunction -function RayConfig_GetCasterEffect takes unit caster,integer abilityId,real duration returns string - if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return "Abilities\\Spells\\Items\\AIob\\AIobTarget.mdl" - endif - return null -endfunction -function RayConfig_GetCasterEffectAttachmentPoint takes unit caster,integer abilityId,real duration returns string - if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return "origin" - endif - return null -endfunction -function RayConfig_GetTargetEffect takes unit caster,integer abilityId,real duration returns string - if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return "Abilities\\Spells\\Items\\AIob\\AIobSpecialArt.mdl" - endif - return null -endfunction -function RayConfig_GetTargetEffectAttachmentPoint takes unit caster,integer abilityId,real duration returns string - if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return "origin" - endif - return null -endfunction -function RayConfig_DisableAttack takes unit caster,integer abilityId returns boolean - if ( abilityId == RayConfig_FROST_RAY ) then - return true - elseif ( abilityId == RayConfig_FIRE_RAY ) then - return true - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return true - elseif ( abilityId == RayConfig_CHARM_RAY ) then - return true - endif - return false -endfunction -function RayConfig_GetDisableMovement takes unit caster,integer abilityId returns boolean - if ( abilityId == RayConfig_FROST_RAY ) then - return true - elseif ( abilityId == RayConfig_FIRE_RAY ) then - return true - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return true - endif - return false -endfunction -function RayConfig_GetHoldKey takes unit caster,integer abilityId returns boolean - if ( abilityId == RayConfig_FROST_RAY ) then - return true - elseif ( abilityId == RayConfig_FIRE_RAY ) then - return true - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return true - endif - return false -endfunction -function RayConfig_GetMouseAiming takes unit caster,integer abilityId returns boolean - if ( abilityId == RayConfig_FROST_RAY ) then - return true - elseif ( abilityId == RayConfig_FIRE_RAY ) then - return true - elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then - return true - endif - return false -endfunction -//library RayConfig ends -//library SummonWall: -function SummonWall takes unit caster,real targetX,real targetY returns nothing - local player owner= GetOwningPlayer(caster) - local integer max= GetUnitAbilityLevel(caster, SummonWall_ABILITY_ID) + 4 - local real duration= I2R(GetUnitAbilityLevel(caster, SummonWall_ABILITY_ID)) * 5.0 + 45.0 - local real damage= I2R(GetUnitAbilityLevel(caster, SummonWall_ABILITY_ID)) * 5.0 + 10.0 - local real face= AngleBetweenCoordinatesDeg(GetUnitX(caster) , GetUnitY(caster) , targetX , targetY) - local real distance= 0.0 - local real x= targetX - local real y= targetY - local unit wall= null - local integer counter= 0 - loop - exitwhen ( IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) or counter >= max ) - set counter=counter + 1 - call UnitDamagePoint(caster, 0.0, 128.0, x, y, damage, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) - set wall=CreateUnit(owner, SummonWall_UNIT_TYPE_ID, x, y, face) - call UnitApplyTimedLife(wall, 'BTLF', duration) - set distance=distance + 90.0 - set x=PolarProjectionX(targetX , face , distance) - set y=PolarProjectionY(targetY , face , distance) - call TriggerSleepAction(0.1) - endloop - if ( counter == 0 ) then - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "No space.") - endif - set owner=null -endfunction -function SummonWall___TriggerConditionCast takes nothing returns boolean - return GetSpellAbilityId() == SummonWall_ABILITY_ID -endfunction -function SummonWall___TriggerActionCast takes nothing returns nothing - call SummonWall(GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY()) -endfunction -function SummonWall___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(SummonWall___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(SummonWall___castTrigger, Condition(function SummonWall___TriggerConditionCast)) - call TriggerAddAction(SummonWall___castTrigger, function SummonWall___TriggerActionCast) -endfunction -//library SummonWall ends -//library TailSwipe: -function TailSwipe___onUnitHit takes integer kb,unit hit returns nothing - if ( not IsUnitAlly(hit, GetOwningPlayer(s__Knockback_caster[kb])) ) then - call UnitDamageTarget(s__Knockback_caster[kb], hit, GetUnitAbilityLevel(s__Knockback_caster[kb], TailSwipe_ABILITY_ID) * 100.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) - endif -endfunction -function TailSwipe___onDestructableHit takes integer kb,destructable hit returns nothing - if ( (IsTree(GetDestructableTypeId((hit)))) ) then // INLINED!! - call KillDestructable(hit) - endif -endfunction -function TailSwipe___filterFunction takes integer kb,unit enum returns boolean - return not IsUnitAlly(enum, GetOwningPlayer(s__Knockback_caster[kb])) -endfunction -function TailSwipe___FiterIsTarget takes nothing returns boolean - return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitAlly(GetFilterUnit(), TailSwipe___tmpPlayer) -endfunction -function TailSwipe takes unit caster returns nothing - local group targets= CreateGroup() - local integer i= 0 - local integer max= 0 - local real distance= 20.0 + GetUnitAbilityLevel(caster, TailSwipe_ABILITY_ID) * 20.0 - local unit target= null - set TailSwipe___tmpPlayer=GetOwningPlayer(caster) - call GroupEnumUnitsInRange(targets, GetUnitX(caster), GetUnitY(caster), 512.0, Filter(function TailSwipe___FiterIsTarget)) - set max=BlzGroupGetSize(targets) - if ( max > 0 ) then - set i=0 - loop - exitwhen ( i == max ) - set target=BlzGroupUnitAt(targets, i) - call s__Knockback_create(caster , target , distance , 2.0 , AngleBetweenUnitsDeg(caster , target) , TailSwipe_kbType) - set target=null - set i=i + 1 - endloop - else - call SimError(TailSwipe___tmpPlayer , "No targets.") - call IssueImmediateOrder(caster, "stop") - endif - set TailSwipe___tmpPlayer=null - call GroupClear(targets) - call DestroyGroup(targets) - set targets=null -endfunction -function TailSwipe___TriggerConditionCast takes nothing returns boolean - if ( GetSpellAbilityId() == TailSwipe_ABILITY_ID ) then - call TailSwipe(GetTriggerUnit()) - endif - return false -endfunction -function TailSwipe___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(TailSwipe___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(TailSwipe___castTrigger, Condition(function TailSwipe___TriggerConditionCast)) - - set TailSwipe_kbType=s__KnockbackType__allocate() - set s__KnockbackType_onUnitHitAction[TailSwipe_kbType]=(2) - set s__KnockbackType_onDestructableHitAction[TailSwipe_kbType]=(2) - set s__KnockbackType_filterFunc[TailSwipe_kbType]=(2) -endfunction -//library TailSwipe ends -//library Telekinesis: -function Telekinesis___GetMaxDistance takes unit caster returns real - if ( GetUnitAbilityLevel(caster, Telekinesis___ABILITY_ID) > 0 ) then - return Telekinesis___MAX_DISTANCE + GetUnitAbilityLevel(caster, Telekinesis___ABILITY_ID) * 100.0 - endif - - return 1200.0 -endfunction -function Telekinesis___TelekinesisHasTarget takes unit caster returns boolean - return HaveSavedHandle(Telekinesis___h, GetHandleId(caster), Telekinesis___KEY_TARGET) -endfunction -function Telekinesis___TelekinesisSaveUnitTarget takes unit caster,unit target returns nothing - local integer handleId= GetHandleId(caster) - call SaveUnitHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET, target) - call SaveInteger(Telekinesis___h, handleId, Telekinesis___KEY_TARGET_TYPE, Telekinesis___TARGET_TYPE_UNIT) - call UnitAddAbility(target, Telekinesis___BUFF_ABILITY_ID) - //call BJDebugMsg("Target is " + GetUnitName(target)) -endfunction -function Telekinesis___TelekinesisSaveItemTarget takes unit caster,item target returns nothing - local integer handleId= GetHandleId(caster) - call SaveItemHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET, target) - call SaveInteger(Telekinesis___h, handleId, Telekinesis___KEY_TARGET_TYPE, Telekinesis___TARGET_TYPE_ITEM) -endfunction -function Telekinesis___TelekinesisSaveDestructableTarget takes unit caster,destructable target returns nothing - local integer handleId= GetHandleId(caster) - call SaveDestructableHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET, target) - call SaveInteger(Telekinesis___h, handleId, Telekinesis___KEY_TARGET_TYPE, Telekinesis___TARGET_TYPE_DESTRUCTABLE) -endfunction -function Telekinesis___TelekinesisClearTarget takes unit caster returns nothing - local integer handleId= GetHandleId(caster) - call FlushChildHashtable(Telekinesis___h, handleId) -endfunction -function Telekinesis___IsTelekinesisTargetValid takes unit caster returns boolean - local integer handleId= GetHandleId(caster) - local integer targetType= LoadInteger(Telekinesis___h, handleId, Telekinesis___KEY_TARGET_TYPE) - local real maxDistance= Telekinesis___GetMaxDistance(caster) - local unit targetUnit= null - local item targetItem= null - local destructable targetDestructable= null - if ( targetType == Telekinesis___TARGET_TYPE_UNIT ) then - set targetUnit=LoadUnitHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET) - return DistanceBetweenUnits(caster , targetUnit) <= maxDistance - elseif ( targetType == Telekinesis___TARGET_TYPE_ITEM ) then - set targetItem=LoadItemHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET) - return DistanceBetweenUnitAndItem(caster , targetItem) <= maxDistance - elseif ( targetType == Telekinesis___TARGET_TYPE_DESTRUCTABLE ) then - set targetDestructable=LoadDestructableHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET) - return DistanceBetweenUnitAndDestructable(caster , targetDestructable) <= maxDistance - endif - - return false -endfunction -function Telekinesis___MoveDestructable takes destructable d,real x,real y,real face,real scale,integer variation returns destructable - local integer typeId= GetDestructableTypeId(d) - local real life= GetDestructableLife(d) - local destructable t= null - call RemoveDestructable(d) - set t=CreateDestructable(typeId, x, y, face, scale, variation) - call SetDestructableLife(t, life) - return t -endfunction -function Telekinesis___TelekinesisMoveTargetTo takes unit caster,real x,real y returns nothing - local integer handleId= GetHandleId(caster) - local integer targetType= LoadInteger(Telekinesis___h, handleId, Telekinesis___KEY_TARGET_TYPE) - local unit targetUnit= null - local item targetItem= null - local destructable targetDestructable= null - local integer targetDestructableTypeId= 0 - local real targetDestructableLife= 0.0 - if ( targetType == Telekinesis___TARGET_TYPE_UNIT ) then - set targetUnit=LoadUnitHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET) - call SetUnitX(targetUnit, x) - call SetUnitY(targetUnit, y) - call UnitRemoveAbility(targetUnit, Telekinesis___BUFF_ABILITY_ID) - //call BJDebugMsg("Move target: " + GetUnitName(targetUnit)) - set targetUnit=null - elseif ( targetType == Telekinesis___TARGET_TYPE_ITEM ) then - set targetItem=LoadItemHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET) - call SetItemPosition(targetItem, x, y) - set targetItem=null - elseif ( targetType == Telekinesis___TARGET_TYPE_DESTRUCTABLE ) then - set targetDestructable=LoadDestructableHandle(Telekinesis___h, handleId, Telekinesis___KEY_TARGET) - call Telekinesis___MoveDestructable(targetDestructable , x , y , GetRandomDirectionDeg() , 1.0 , 0) - set targetDestructable=null - endif -endfunction -function Telekinesis___TimerFunctionResetAbilityCooldown takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer handleId= GetHandleId(t) - local unit caster= LoadUnitHandle(Telekinesis___h, handleId, 0) - if ( not IsUnitInGroup(caster, Telekinesis___casters) ) then - //call BJDebugMsg("Reset cooldown for " + GetUnitName(caster)) - call BlzEndUnitAbilityCooldown(caster, Telekinesis___ABILITY_ID) - call BlzEndUnitAbilityCooldown(caster, Telekinesis___ITEM_ABILITY_ID) - endif - call FlushChildHashtable(Telekinesis___h, handleId) - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function Telekinesis___ResetAbilityCooldown takes unit caster returns nothing - local timer t= CreateTimer() - call GroupRemoveUnit(Telekinesis___casters, caster) - call SaveUnitHandle(Telekinesis___h, GetHandleId(t), 0, caster) - call TimerStart(t, 1.0, false, function Telekinesis___TimerFunctionResetAbilityCooldown) -endfunction -function Telekinesis___CastTelekinesisOnUnit takes unit caster,unit target returns nothing - if ( not IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) ) then - if ( GetUnitAbilityLevel(target, 'Avul') == 0 ) then - call Telekinesis___TelekinesisSaveUnitTarget(caster , target) - call Telekinesis___ResetAbilityCooldown(caster) - else - call IssueImmediateOrder(caster, "stop") - call SimError(GetOwningPlayer(caster) , "Target is spell invulnerable.") - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(GetOwningPlayer(caster) , "Target is spell immune.") - endif -endfunction -function Telekinesis___CastTelekinesisOnItem takes unit caster,item target returns nothing - call Telekinesis___TelekinesisSaveItemTarget(caster , target) - call Telekinesis___ResetAbilityCooldown(caster) -endfunction -function Telekinesis___CastTelekinesisOnDestructable takes unit caster,destructable target returns nothing - call Telekinesis___TelekinesisSaveDestructableTarget(caster , target) - call Telekinesis___ResetAbilityCooldown(caster) -endfunction -function Telekinesis___CastTelekinesisOnPoint takes unit caster,real x,real y returns nothing - if ( (HaveSavedHandle(Telekinesis___h, GetHandleId((caster)), Telekinesis___KEY_TARGET)) ) then // INLINED!! - if ( Telekinesis___IsTelekinesisTargetValid(caster) ) then - call GroupRemoveUnit(Telekinesis___casters, caster) - call Telekinesis___TelekinesisMoveTargetTo(caster , x , y) - call Telekinesis___TelekinesisClearTarget(caster) - else - call Telekinesis___TelekinesisClearTarget(caster) - call IssueImmediateOrder(caster, "stop") - call SimError(GetOwningPlayer(caster) , "Invalid target.") - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(GetOwningPlayer(caster) , "No target.") - endif -endfunction -function Telekinesis___CastTelekinesis takes nothing returns nothing - if ( GetSpellTargetUnit() != null ) then - call Telekinesis___CastTelekinesisOnUnit(GetTriggerUnit() , GetSpellTargetUnit()) - elseif ( GetSpellTargetItem() != null ) then - call Telekinesis___CastTelekinesisOnItem(GetTriggerUnit() , GetSpellTargetItem()) - elseif ( GetSpellTargetDestructable() != null ) then - call Telekinesis___CastTelekinesisOnDestructable(GetTriggerUnit() , GetSpellTargetDestructable()) - else - call Telekinesis___CastTelekinesisOnPoint(GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY()) - endif -endfunction -function Telekinesis___TriggerConditionCast takes nothing returns boolean - local integer abilityId= GetSpellAbilityId() - - return abilityId == Telekinesis___ABILITY_ID or abilityId == Telekinesis___ITEM_ABILITY_ID -endfunction -function Telekinesis___TriggerActionCast takes nothing returns nothing - call Telekinesis___CastTelekinesis() -endfunction -function Telekinesis___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Telekinesis___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(Telekinesis___castTrigger, Condition(function Telekinesis___TriggerConditionCast)) - call TriggerAddAction(Telekinesis___castTrigger, function Telekinesis___TriggerActionCast) -endfunction -function Telekinesis___RemoveUnitTelekinesis takes unit whichUnit returns nothing - call GroupRemoveUnit(Telekinesis___casters, whichUnit) - call Telekinesis___TelekinesisClearTarget(whichUnit) -endfunction -//processed hook: hook RemoveUnit Telekinesis___RemoveUnitTelekinesis -//library Telekinesis ends -//library WoWReforgedFelOrcPiggery: -function WoWReforgedFelOrcPiggery__TriggerConditionConstructFinish takes nothing returns boolean - if ( GetUnitTypeId(GetConstructedStructure()) == WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_PIG_FARM ) then - call AddLoadedMine(GetConstructedStructure() , udg_ResourceMeat , 200 , 20) - call SetLoadedMineAllowedWorkerUnitTypeId(GetConstructedStructure() , WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_FEL_BOAR , true) - call SetMineExplodesOnDeath(GetConstructedStructure() , false) - endif - return false -endfunction -function WoWReforgedFelOrcPiggery__KillUnitEnum takes nothing returns nothing - call IssueTargetOrder((Resources___triggerMine), "unload", GetEnumUnit()) // INLINED!! - call KillUnit(GetEnumUnit()) -endfunction -function WoWReforgedFelOrcPiggery__KillCargo takes unit mine returns nothing - local group cargo= (s__UnitEventEx__Cargo_copyGroup((GetUnitUserData(((mine)))))) // INLINED!! - //call BJDebugMsg("Cargo " + I2S(BlzGroupGetSize(cargo))) - call ForGroup(cargo, function WoWReforgedFelOrcPiggery__KillUnitEnum) - call GroupClear(cargo) - call DestroyGroup(cargo) - set cargo=null -endfunction -function WoWReforgedFelOrcPiggery__TriggerConditionGather takes nothing returns boolean - //call BJDebugMsg("Gather: " + GetUnitName(GetTriggerWorker()) + " in mine " + GetUnitName(GetTriggerMine())) - if ( GetUnitTypeId((Resources___triggerWorker)) == WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_FEL_BOAR ) then // INLINED!! - call WoWReforgedFelOrcPiggery__KillCargo((Resources___triggerMine)) // INLINED!! - call SetUnitResource((Resources___triggerMine) , udg_ResourceMeat , 200) // INLINED!! - endif - return false -endfunction -function WoWReforgedFelOrcPiggery__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedFelOrcPiggery__constructedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedFelOrcPiggery__constructedTrigger, Condition(function WoWReforgedFelOrcPiggery__TriggerConditionConstructFinish)) - - call TriggerRegisterGatherEvent(WoWReforgedFelOrcPiggery__gatherTrigger) - call TriggerAddCondition(WoWReforgedFelOrcPiggery__gatherTrigger, Condition(function WoWReforgedFelOrcPiggery__TriggerConditionGather)) -endfunction -//library WoWReforgedFelOrcPiggery ends -//library WoWReforgedProfessions: -function GetRankName takes integer rank returns string - if ( rank == PROFESSION_RANK_DOCTOR ) then - return "Doctor" - elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return "Grand Master" - elseif ( rank == PROFESSION_RANK_MASTER ) then - return "Master" - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return "Adept" - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return "Advanced" - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return "Novice" - endif - - return "Unknown" -endfunction -function GetProfessionsMax takes nothing returns integer - return WoWReforgedProfessions___professionsCounter -endfunction -function GetProfession takes integer index returns integer - return WoWReforgedProfessions___professions[index] -endfunction -function GetProfessionName takes integer index returns string - local integer p= (WoWReforgedProfessions___professions[(index)]) // INLINED!! - return GetObjectName(s__Profession_itemTypeId[p]) -endfunction -function AddProfession takes nothing returns nothing - local integer p= s__Profession__allocate() - local integer index= (WoWReforgedProfessions___professionsCounter) // INLINED!! - local integer i= 0 - - set WoWReforgedProfessions___professions[index]=p - set s__Profession_itemTypeId[p]=udg_TmpItemTypeId - set s__Profession_bookItemTypeId[p]=udg_TmpItemTypeId2 - - loop - exitwhen ( i == PROFESSION_RANK_MAX ) - set s___Profession_ranks[s__Profession_ranks[p]+i]=s__Rank__allocate() - set i=i + 1 - endloop - - set udg_ProfessionName[index]=GetObjectName(udg_TmpItemTypeId) - set udg_ProfessionItemType[index]=udg_TmpItemTypeId2 - set udg_ProfessionItemTypeTavern[index]=udg_TmpItemTypeId - - set udg_LastAddedProfession=index - - set WoWReforgedProfessions___tmpRankCounter=PROFESSION_RANK_NOVICE - - set WoWReforgedProfessions___professionsCounter=WoWReforgedProfessions___professionsCounter + 1 - set udg_Max_Berufe=WoWReforgedProfessions___professionsCounter - - // for adding the items - set udg_TmpInteger=1 - set udg_TmpBoolean=true -endfunction -function GetProfessionByTavernItemTypeId takes integer tavernItemTypeId returns integer - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i == max ) - if ( tavernItemTypeId == udg_ProfessionItemTypeTavern[i] ) then - return i - endif - set i=i + 1 - endloop - return - 1 // udg_ProfessionNone -endfunction -function AddProfessionRank takes nothing returns nothing - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) -endfunction -function AddProfessionCrafted takes integer itemTypeId,integer unitTypeId,integer charges,boolean onCast,integer abilityId returns nothing - local integer index= IMaxBJ(0, (WoWReforgedProfessions___professionsCounter) - 1) // INLINED!! - local integer p= (WoWReforgedProfessions___professions[(index)]) // INLINED!! - local integer rank= IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter) - local integer r= s___Profession_ranks[s__Profession_ranks[p]+rank] - local integer index2= s__Rank_craftedItemsCount[r] - - if ( rank == PROFESSION_RANK_NOVICE and index2 == 0 ) then - if ( itemTypeId != 0 ) then - set WoWReforgedIcons__professionIcons[(index )]=( BlzGetAbilityIcon(itemTypeId)) // INLINED!! - elseif ( unitTypeId != 0 ) then - set WoWReforgedIcons__professionIcons[(index )]=( BlzGetAbilityIcon(unitTypeId)) // INLINED!! - endif - endif - - //call BJDebugMsg(GetProfessionName(index) + " - " + GetRankName(rank) + " count " + I2S(r.craftedItemsCount) + " index2 " + I2S(index2)) - - set s___Rank_craftedItems[s__Rank_craftedItems[r]+index2]=itemTypeId - set s___Rank_craftedUnits[s__Rank_craftedUnits[r]+index2]=unitTypeId - set s___Rank_craftedCount[s__Rank_craftedCount[r]+index2]=charges - set s___Rank_craftedOnCast[s__Rank_craftedOnCast[r]+index2]=onCast - - set s__Rank_craftedItemAbilityId[r]=abilityId - set s__Rank_craftedItemsCount[r]=s__Rank_craftedItemsCount[r] + 1 - - set udg_TmpInteger=1 // charges - set udg_TmpBoolean=true // onCast -endfunction -function AddProfessionCraftedItem takes nothing returns nothing - call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) -endfunction -function AddProfessionCraftedUnit takes nothing returns nothing - call AddProfessionCrafted(0 , udg_TmpUnitType , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) -endfunction -function GetProfessionItemTypeId takes integer index returns integer - local integer p= (WoWReforgedProfessions___professions[(index)]) // INLINED!! - return s__Profession_itemTypeId[p] -endfunction -function GetProfessionBookItemTypeId takes integer index returns integer - local integer p= (WoWReforgedProfessions___professions[(index)]) // INLINED!! - return s__Profession_bookItemTypeId[p] -endfunction -function GetProfessionCraftedItem takes integer i,integer rank,integer j returns integer - local integer p= (WoWReforgedProfessions___professions[(i)]) // INLINED!! - return s___Rank_craftedItems[s__Rank_craftedItems[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] -endfunction -function GetProfessionCraftedUnit takes integer i,integer rank,integer j returns integer - local integer p= (WoWReforgedProfessions___professions[(i)]) // INLINED!! - return s___Rank_craftedUnits[s__Rank_craftedUnits[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] -endfunction -function GetProfessionCraftedCount takes integer i,integer rank,integer j returns integer - local integer p= (WoWReforgedProfessions___professions[(i)]) // INLINED!! - return s___Rank_craftedCount[s__Rank_craftedCount[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] -endfunction -function GetProfessionCraftedOnCast takes integer i,integer rank,integer j returns boolean - local integer p= (WoWReforgedProfessions___professions[(i)]) // INLINED!! - return s___Rank_craftedOnCast[s__Rank_craftedOnCast[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] -endfunction -function GetProfessionCraftedItemsCount takes integer i,integer rank returns integer - local integer p= (WoWReforgedProfessions___professions[(i)]) // INLINED!! - return s__Rank_craftedItemsCount[s___Profession_ranks[s__Profession_ranks[p]+rank]] -endfunction -function GetPlayerProfession1 takes player whichPlayer returns integer - return udg_PlayerProfession[GetConvertedPlayerId(whichPlayer)] -endfunction -function GetPlayerProfession2 takes player whichPlayer returns integer - return udg_PlayerProfession2[GetConvertedPlayerId(whichPlayer)] -endfunction -function GetPlayerProfession3 takes player whichPlayer returns integer - return udg_PlayerProfession3[GetConvertedPlayerId(whichPlayer)] -endfunction -function PlayerHasProfession takes player whichPlayer,integer profession returns boolean - return (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) == profession or (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) == profession or (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) == profession // INLINED!! -endfunction -// Used for Computer AI. -function GetRandomProfession takes nothing returns integer - local integer random= GetRandomInt(0, 11) - if ( random == 0 ) then - return udg_ProfessionHerbalist - elseif ( random == 1 ) then - return udg_ProfessionAlchemist - elseif ( random == 2 ) then - return udg_ProfessionWeaponSmith - elseif ( random == 3 ) then - return udg_ProfessionArmourer - elseif ( random == 4 ) then - return udg_ProfessionEngineer - elseif ( random == 5 ) then - return udg_ProfessionDragonBreeder - elseif ( random == 6 ) then - return udg_ProfessionLoreMaster - elseif ( random == 7 ) then - return udg_ProfessionRuneforger - elseif ( random == 8 ) then - return udg_ProfessionSorcerer - elseif ( random == 9 ) then - return udg_ProfessionJewelcrafter - elseif ( random == 10 ) then - return udg_ProfessionArchaeologist - //elseif (random == 11) then - //return udg_ProfessionWitchDoctor - endif - - return udg_ProfessionWitchDoctor -endfunction -// TODO Determine by registered stuff not manually except for archeology and rune master -function GetNextCraftedProfessionItemEx takes integer profession,integer rank returns integer - if ( profession == udg_ProfessionHerbalist ) then - if ( rank == PROFESSION_RANK_DOCTOR ) then - return ITEM_HERB_GARDEN - elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return ITEM_SCROLL_OF_HEALING - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_TALISMAN_OF_EVERLASTING - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_POTION_OF_INVULNERABILITY - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_HEALTH_STONE - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_POTION_OF_GREATER_HEALING - endif - elseif ( profession == udg_ProfessionAlchemist ) then - if ( rank == PROFESSION_RANK_DOCTOR ) then - return ITEM_CAULDRON - elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return ITEM_SCROLL_OF_MANA - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_TALISMAN_OF_SPELL_PROTECTION - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_WAND_OF_MANA_STEALING - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_MANA_STONE - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_POTION_OF_GREATER_MANA - endif - elseif ( profession == udg_ProfessionWeaponSmith ) then - if ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return ITEM_MYTHICAL_POISON_BLADE - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_BLESSED_DRAGON_LANCE - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_DEMON_SLAYER_AXE - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_MITHRIL_LONG_SWORD - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_BOW_OF_FIRE - endif - elseif ( profession == udg_ProfessionArmourer ) then - if ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return ITEM_MYTHICAL_GOLDEN_ARMOR - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_BLESSED_CHAMPION_ARMOR - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_HEAVY_PLATED_SHIELD - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_PLATED_HELMET - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_LIGHT_LEATHER_ARMOR - endif - elseif ( profession == udg_ProfessionEngineer ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_TINY_DEATH_TOWER -// elseif (rank == PROFESSION_RANK_ADEPT) then - //return 'I00M' // 2 gobline sappers - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_TINY_COLD_TOWER - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_TINY_FLAME_TOWER - endif - elseif ( profession == udg_ProfessionLoreMaster ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_ANKH_OF_REINCARNATION - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_SCROLL_OF_RESURRECTION - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_SCROLL_OF_RESTORATION - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_SCROLL_OF_PROTECTION - endif - elseif ( profession == udg_ProfessionSorcerer ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_WAND_OF_SORCERER_ILLUSION - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_WAND_OF_REANIMATION - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_WAND_OF_THE_WIND - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_WAND_OF_NEUTRALIZATION - endif - elseif ( profession == udg_ProfessionRuneforger ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_RUNE_OF_GREATER_RESURRECTION - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_RUNE_OF_LESSER_RESURRECTION_RUNEFORGER - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_RUNE_OF_REBIRTH_RUNEFORGER - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_RUNE_OF_RESTORATION_RUNEFORGER - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_RUNE_OF_DISPEL_MAGIC_RUNEFORGER - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_RUNE_OF_SPEED_RUNEFORGER - endif - elseif ( profession == udg_ProfessionDragonBreeder ) then - if ( rank == PROFESSION_RANK_DOCTOR ) then - return ITEM_DRAGON_BREEDER_ROOST - //elseif (rank == PROFESSION_RANK_GRAND_MASTER) then - //return ITEM_SCROLL_OF_HEALING - // grand master crafts dragon egg which then can be used to summon a dragon - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_GREEN_DRAGON_EGG - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_GREEN_DRAKE_EGG - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_THARIFAS_EGG - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_GREEN_DRAGON_WHELP_EGG - endif - elseif ( profession == udg_ProfessionJewelcrafter ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_GOLDEN_CROWN - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_BRACELET - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_JEWEL_AMULET - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_GREEN_GEMSTONE - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_ENCHANTED_GEMSTONE - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_RING_OF_SUPERIORITY - endif - elseif ( profession == udg_ProfessionArchaeologist ) then - if ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return ChooseRandomItemExBJ(8, ITEM_TYPE_ANY) - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ChooseRandomItemExBJ(7, ITEM_TYPE_ANY) - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ChooseRandomItemExBJ(5, ITEM_TYPE_ANY) - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ChooseRandomItemExBJ(3, ITEM_TYPE_ANY) - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ChooseRandomItemExBJ(1, ITEM_TYPE_ANY) - endif - elseif ( profession == udg_ProfessionWitchDoctor ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_HEALING_WARDS - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_MANA_WARDS - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_STASIS_TRAPS - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_SENTRY_WARDS - endif - elseif ( profession == udg_ProfessionTamer ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_MONSTER_LURE - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_ADVANCED_BAIT - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_BAIT - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_SMALL_BAIT - endif - elseif ( profession == udg_ProfessionNecromancer ) then - if ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return ITEM_SCROLL_OF_ANIMATE_DEAD - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_BOOK_OF_THE_DEAD - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_SACRIFICAL_SCULL - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_WAND_OF_CORPSES - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_ROD_OF_NECROMANCY - endif - elseif ( profession == udg_ProfessionGolemSculptor ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_TINY_FLESH_GOLEM - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_TINY_SIEGE_GOLEM - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_TINY_WAR_GOLEM - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_TINY_MUD_GOLEM - endif - elseif ( profession == udg_ProfessionWarlock ) then - if ( rank == PROFESSION_RANK_DOCTOR ) then - return ITEM_TINY_FEL_FOUNTAIN - elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then - return ITEM_DEMONIC_FIGURE // ITEM_SPIKED_COLLAR - elseif ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_TINY_DEMON_GATE - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_DEMON_BLOOD - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_INFERNO_STONE - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_WAND_OF_DRAIN - endif - elseif ( profession == udg_ProfessionAstromancer ) then - if ( rank == PROFESSION_RANK_MASTER ) then - return ITEM_TINY_ARCANE_OBSERVATORY_ASTROMANCER - elseif ( rank == PROFESSION_RANK_ADEPT ) then - return ITEM_METEOR_STONE - elseif ( rank == PROFESSION_RANK_ADVANCED ) then - return ITEM_FLARE_GUN - elseif ( rank == PROFESSION_RANK_NOVICE ) then - return ITEM_NAVIGATION_SCROLL - endif - endif - return 0 -endfunction -function GetProfessionItemCharges takes integer itemTypeId returns integer - return 0 -endfunction -function GetProfessionCraftRankByMana takes unit hero returns integer - local real mana= GetUnitState(hero, UNIT_STATE_MANA) - if ( mana >= DOCTOR_MANA_COST ) then - return PROFESSION_RANK_DOCTOR - elseif ( mana >= GRAND_MASTER_MANA_COST ) then - return PROFESSION_RANK_GRAND_MASTER - elseif ( mana >= MASTER_MANA_COST ) then - return PROFESSION_RANK_MASTER - elseif ( mana >= ADEPT_MANA_COST ) then - return PROFESSION_RANK_ADEPT - elseif ( mana >= ADVANCED_MANA_COST ) then - return PROFESSION_RANK_ADVANCED - elseif ( mana >= NOVICE_MANA_COST ) then - return PROFESSION_RANK_NOVICE - endif - return PROFESSION_RANK_NOVICE -endfunction -function GetNextCraftedProfession1Item takes unit hero returns integer - local integer profession= (udg_PlayerProfession[GetConvertedPlayerId((GetOwningPlayer(hero)))]) // INLINED!! - local integer rank= GetProfessionCraftRankByMana(hero) - return GetNextCraftedProfessionItemEx(profession , rank) -endfunction -function GetNextCraftedProfession2Item takes unit hero returns integer - local integer profession= (udg_PlayerProfession2[GetConvertedPlayerId((GetOwningPlayer(hero)))]) // INLINED!! - local integer rank= GetProfessionCraftRankByMana(hero) - return GetNextCraftedProfessionItemEx(profession , rank) -endfunction -function GetNextCraftedProfession3Item takes unit hero returns integer - local integer profession= (udg_PlayerProfession3[GetConvertedPlayerId((GetOwningPlayer(hero)))]) // INLINED!! - local integer rank= GetProfessionCraftRankByMana(hero) - return GetNextCraftedProfessionItemEx(profession , rank) -endfunction -function CraftProfessionItemAIEx takes unit hero,integer itemTypeId returns item - local item result= null - local item slotItem= null - local integer charges= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY or result != null ) - set slotItem=UnitItemInSlot(hero, i) - if ( slotItem == null ) then - call UnitAddItemToSlotById(hero, itemTypeId, i) - set result=UnitItemInSlot(hero, i) - set charges=GetProfessionItemCharges(itemTypeId) - if ( charges > 0 ) then - call SetItemCharges(result, charges) - endif - elseif ( GetItemTypeId(slotItem) == itemTypeId and GetItemCharges(slotItem) > 0 and GetItemCharges(slotItem) < GetMaxStacksByItemTypeId(itemTypeId) ) then - set charges=GetProfessionItemCharges(itemTypeId) - if ( charges == 0 ) then - set charges=1 - endif - call SetItemCharges(slotItem, GetItemCharges(slotItem) + charges) - endif - set slotItem=null - set i=i + 1 - endloop - return result -endfunction -function CraftProfessionItemAI1 takes unit hero returns item - local integer itemTypeId= GetNextCraftedProfession1Item(hero) - if ( itemTypeId != 0 ) then - return CraftProfessionItemAIEx(hero , itemTypeId) - endif - - return null -endfunction -function CraftProfessionItemAI2 takes unit hero returns item - local integer itemTypeId= GetNextCraftedProfession2Item(hero) - if ( itemTypeId != 0 ) then - return CraftProfessionItemAIEx(hero , itemTypeId) - endif - - return null -endfunction -function CraftProfessionItemAI3 takes unit hero returns item - local integer itemTypeId= GetNextCraftedProfession3Item(hero) - if ( itemTypeId != 0 ) then - return CraftProfessionItemAIEx(hero , itemTypeId) - endif - - return null -endfunction -function CraftProfessionItemsAI takes unit hero returns nothing - local item whichItem= null - if ( IsUnitAliveBJ(hero) ) then - set whichItem=CraftProfessionItemAI1(hero) - if ( whichItem != null ) then - call UnitAddItem(hero, whichItem) - endif - set whichItem=CraftProfessionItemAI2(hero) - if ( whichItem != null ) then - call UnitAddItem(hero, whichItem) - endif - set whichItem=CraftProfessionItemAI3(hero) - if ( whichItem != null ) then - call UnitAddItem(hero, whichItem) - endif - endif -endfunction -function GetBookItemProfession takes integer itemTypeId returns integer - local integer i= 0 - loop - exitwhen ( i >= udg_Max_Berufe ) - if ( udg_ProfessionItemType[i] == itemTypeId ) then - return i - endif - set i=i + 1 - endloop - return udg_ProfessionNone -endfunction -function GetObjectProfession takes integer objectId returns integer - local integer j= 0 - local integer i= 0 - local integer k= 0 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - loop - exitwhen ( i >= max ) - if ( udg_ProfessionItemType[i] == objectId ) then - return i - endif - set j=0 - loop - exitwhen ( j == PROFESSION_RANK_MAX ) - set k=0 - loop - exitwhen ( k == PROFESSION_MAX_CRAFTED ) - if ( GetProfessionCraftedUnit(i , j , k) == objectId or GetProfessionCraftedItem(i , j , k) == objectId ) then - return i - endif - set k=k + 1 - endloop - set j=j + 1 - endloop - set i=i + 1 - endloop - return udg_ProfessionNone -endfunction -function ProfessionBonusCharges takes unit hero returns integer - return GetHeroLevel(hero) / 15 -endfunction -function WoWReforgedProfessions___CraftUnits takes unit hero,integer unitTypeId,integer charges returns nothing - local player owner= GetOwningPlayer(hero) - local real x= GetUnitX(hero) - local real y= GetUnitY(hero) - local real face= GetUnitFacing(hero) - local integer count= charges + (GetHeroLevel((hero)) / 15) // INLINED!! - loop - set count=count - 1 - exitwhen count < 0 - call CreateUnit(owner, unitTypeId, x, y, face) - endloop - set owner=null -endfunction -function WoWReforgedProfessions___CraftItems takes unit hero,integer itemTypeId,integer charges returns nothing - local item whichItem= CreateItem(itemTypeId, GetUnitX(hero), GetUnitY(hero)) - // set charges before adding the item to the hero to avoid stacking before setting charges - if ( GetItemCharges(whichItem) > 0 or charges > 1 ) then - call SetItemCharges(whichItem, charges + (GetHeroLevel((hero)) / 15)) // INLINED!! - endif - call UnitAddItem(hero, whichItem) - set whichItem=null -endfunction -function WoWReforgedProfessions___GetProfessionIndexByAbilityId takes integer abilityId returns integer - local integer j= 0 - local integer i= 0 - local integer profession= 0 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - loop - exitwhen ( i >= max ) - set profession=(WoWReforgedProfessions___professions[(i)]) // INLINED!! - set j=0 - loop - exitwhen ( j == PROFESSION_RANK_MAX ) - if ( s__Rank_craftedItemAbilityId[s___Profession_ranks[s__Profession_ranks[profession]+j]] == abilityId ) then - return i - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - return - 1 -endfunction -function WoWReforgedProfessions___GetProfessionRankByAbilityId takes integer abilityId returns integer - local integer j= 0 - local integer i= 0 - local integer profession= 0 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - loop - exitwhen ( i >= max ) - set profession=(WoWReforgedProfessions___professions[(i)]) // INLINED!! - set j=0 - loop - exitwhen ( j == PROFESSION_RANK_MAX ) - if ( s__Rank_craftedItemAbilityId[s___Profession_ranks[s__Profession_ranks[profession]+j]] == abilityId ) then - return j - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - return - 1 -endfunction -function ProfessionCraftUnits takes unit hero,integer abilityId,integer unitTypeId,integer count returns nothing - local real cooldown= RMaxBJ(5.0, BlzGetAbilityRealLevelField(BlzGetUnitAbility(hero, abilityId), ABILITY_RLF_COOLDOWN, 0) - I2R(GetHeroLevel(hero))) - local force allies= GetAlliesWithSharedControl(GetOwningPlayer(hero)) - call WoWReforgedProfessions___CraftUnits(hero , unitTypeId , count) - call ShowFadingTextTagForForce((allies ) , ( "+" + I2S((GetHeroLevel((hero)) / 15)) + "|nCooldown: " + I2S(R2I(cooldown)) + "s" ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 255 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! - // sleep is required since the shared spell book cooldown apparently triggers after some sleep - call TriggerSleepAction(0.1) - if ( GetUnitTypeId(hero) != 0 ) then - call BlzStartUnitAbilityCooldown(hero, 'Aspb', cooldown) - endif - call DestroyForce(allies) - set allies=null -endfunction -function ProfessionCraftItems takes unit hero,integer abilityId,integer itemTypeId,integer count returns nothing - local real cooldown= RMaxBJ(5.0, BlzGetAbilityRealLevelField(BlzGetUnitAbility(hero, abilityId), ABILITY_RLF_COOLDOWN, 0) - I2R(GetHeroLevel(hero))) - local force allies= GetAlliesWithSharedControl(GetOwningPlayer(hero)) - call WoWReforgedProfessions___CraftItems(hero , itemTypeId , count) - call ShowFadingTextTagForForce((allies ) , ( "+" + I2S((GetHeroLevel((hero)) / 15)) + "|nCooldown: " + I2S(R2I(cooldown)) + "s" ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 255 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! - // sleep is required since the shared spell book cooldown apparently triggers after some sleep - call TriggerSleepAction(0.1) - if ( GetUnitTypeId(hero) != 0 ) then - call BlzStartUnitAbilityCooldown(hero, 'Aspb', cooldown) - endif - call DestroyForce(allies) - set allies=null -endfunction -function WoWReforgedProfessions___CastCraft takes unit hero,integer abilityId,integer index returns nothing - local integer p= (WoWReforgedProfessions___professions[(index)]) // INLINED!! - local integer i= 0 - local integer index2= 0 - local integer rank= WoWReforgedProfessions___GetProfessionRankByAbilityId(abilityId) - local integer max= GetProfessionCraftedItemsCount(index , rank) - //call BJDebugMsg("Craft " + I2S(max) + " IDs.") - loop - exitwhen ( i >= max ) - if ( s___Rank_craftedOnCast[s__Rank_craftedOnCast[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] ) then - if ( s___Rank_craftedUnits[s__Rank_craftedUnits[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] != 0 ) then - call ProfessionCraftUnits(hero , abilityId , s___Rank_craftedUnits[s__Rank_craftedUnits[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] , s___Rank_craftedCount[s__Rank_craftedCount[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i]) - elseif ( s___Rank_craftedItems[s__Rank_craftedItems[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] != 0 ) then - call ProfessionCraftItems(hero , abilityId , s___Rank_craftedItems[s__Rank_craftedItems[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] , s___Rank_craftedCount[s__Rank_craftedCount[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i]) - endif - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedProfessions___TriggerActionCast takes nothing returns nothing - local integer abilityId= GetSpellAbilityId() - local integer index= WoWReforgedProfessions___GetProfessionIndexByAbilityId(abilityId) - if ( index != - 1 ) then - call WoWReforgedProfessions___CastCraft(GetTriggerUnit() , abilityId , index) - endif -endfunction -function WoWReforgedProfessions___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedProfessions___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddAction(WoWReforgedProfessions___castTrigger, function WoWReforgedProfessions___TriggerActionCast) -endfunction -//library WoWReforgedProfessions ends -//library WoWReforgedRailRoad: -function WoWReforgedRailRoad__FilterFunctionIsRailroad takes nothing returns boolean - return IsUnitAliveBJ(GetFilterUnit()) and ( GetUnitTypeId(GetFilterUnit()) == 'o01N' or GetUnitTypeId(GetFilterUnit()) == 'o01K' or GetUnitTypeId(GetFilterUnit()) == 'o01H' ) -endfunction -function GetRailroad takes unit train,real angle returns unit - local group whichGroup= CreateGroup() - local unit result= null - local unit first= null - call GroupEnumUnitsInRange(whichGroup, PolarProjectionX(GetUnitX(train) , angle , 40.0), PolarProjectionY(GetUnitY(train) , angle , 40.0), 200.0, Filter(function WoWReforgedRailRoad__FilterFunctionIsRailroad)) - loop - exitwhen ( result != null ) - set first=FirstOfGroup(whichGroup) - exitwhen ( first == null ) - if ( GetOwningPlayer(first) == GetOwningPlayer(train) or IsUnitAlly(first, GetOwningPlayer(train)) ) then - set result=first - endif - call GroupRemoveUnit(whichGroup, first) - endloop - call GroupClear(whichGroup) - call DestroyGroup(whichGroup) - set whichGroup=null - return result -endfunction -function GetNextRailroad takes unit source returns unit - return GetRailroad(source , 90.0) -endfunction -function GetPreviousRailroad takes unit source returns unit - return GetRailroad(source , 270.0) -endfunction -//library WoWReforgedRailRoad ends -//library WoWReforgedTradingPosts: -function GetUnitFurthestAway takes unit source,group possibleTargets returns unit - local player owner= GetOwningPlayer(source) - local unit result= null - local real distance0= 0.0 - local real distance1= 0.0 - local unit groupUnit= null - local integer i= 0 - loop - exitwhen ( i >= BlzGroupGetSize(possibleTargets) ) - set groupUnit=BlzGroupUnitAt(possibleTargets, i) - if ( IsUnitAlly(groupUnit, owner) ) then - set distance1=DistanceBetweenUnits(source , groupUnit) - if ( result == null or distance1 > distance0 ) then - set distance0=distance1 - set result=groupUnit - endif - endif - set groupUnit=null - set i=i + 1 - endloop - set owner=null - return result -endfunction -function AddTradingPostResource takes integer resource,integer buyUnitTypeId,integer sellUnitTypeId returns nothing - local integer r= s__WoWReforgedTradingPosts__TradingPostResource__allocate() - set s__WoWReforgedTradingPosts__TradingPostResource_resource[r]=resource - set s__WoWReforgedTradingPosts__TradingPostResource_buyUnitTypeId[r]=buyUnitTypeId - set s__WoWReforgedTradingPosts__TradingPostResource_sellUnitTypeId[r]=sellUnitTypeId - set WoWReforgedTradingPosts__tradingPostResource[WoWReforgedTradingPosts__tradingPostResourceCount]=r - set WoWReforgedTradingPosts__tradingPostResourceCount=WoWReforgedTradingPosts__tradingPostResourceCount + 1 -endfunction -function AddTradingPostResourceWoWReforged takes nothing returns nothing - call AddTradingPostResource(udg_TmpInteger , udg_TmpUnitType , udg_TmpUnitType2) -endfunction -function AddResourcesShop takes unit shop returns nothing - local integer i= 0 - local integer r= 0 - call EnablePagedButtons(shop) - call SetPagedButtonsSlotsPerPage(shop , 4) // 12 - Cancel Button, 2 Page Buttons, Rally Point, Pack Horse and research - loop - exitwhen ( i == WoWReforgedTradingPosts__tradingPostResourceCount ) - set r=WoWReforgedTradingPosts__tradingPostResource[i] -call AddPagedButtonsId((shop ) , ( s__WoWReforgedTradingPosts__TradingPostResource_buyUnitTypeId[r]) , PagedButtons_BUTTON_TYPE_UNIT) // Buy 100 // INLINED!! -call AddPagedButtonsId((shop ) , ( s__WoWReforgedTradingPosts__TradingPostResource_sellUnitTypeId[r]) , PagedButtons_BUTTON_TYPE_UNIT) // Sell 100 // INLINED!! - set i=i + 1 - endloop -endfunction -function TradingPostSellsUnit takes unit tradingPost,unit soldUnit returns nothing - local integer unitTypeId= GetUnitTypeId(soldUnit) - local player owner= GetOwningPlayer(soldUnit) - local integer r= 0 - local integer i= 0 - loop - exitwhen ( i == WoWReforgedTradingPosts__tradingPostResourceCount ) - set r=WoWReforgedTradingPosts__tradingPostResource[i] - if ( unitTypeId == s__WoWReforgedTradingPosts__TradingPostResource_buyUnitTypeId[r] ) then // Buy 100 - call AddPlayerResource(owner , s__WoWReforgedTradingPosts__TradingPostResource_resource[r] , 100) - call h__RemoveUnit(soldUnit) - exitwhen ( true ) - elseif ( unitTypeId == s__WoWReforgedTradingPosts__TradingPostResource_sellUnitTypeId[r] ) then // Sell 100 - if ( ExchangePlayerResource(owner , s__WoWReforgedTradingPosts__TradingPostResource_resource[r] , Resources_GOLD , 100) == 0 ) then - call SimError(owner , "No " + (s__Resource_name[(s__WoWReforgedTradingPosts__TradingPostResource_resource[r])]) + ".") // INLINED!! - endif - call h__RemoveUnit(soldUnit) - exitwhen ( true ) - endif - set i=i + 1 - endloop - set owner=null -endfunction -function WoWReforgedTradingPosts__TriggerConditionGather takes nothing returns boolean - local integer playerId= GetPlayerId(GetOwningPlayer((Resources___triggerWorker))) // INLINED!! - if ( udg_TradingPostGoldExchange[playerId] ) then - call CustomBountyFadingText((Resources___triggerWorker) , Resources_GOLD , (Resources___triggerResourceAmount)) // INLINED!! - call ExchangePlayerResource(GetOwningPlayer((Resources___triggerWorker)) , (Resources___triggerResource) , Resources_GOLD , (Resources___triggerResourceAmount)) // INLINED!! - endif - return false -endfunction -function WoWReforgedTradingPosts__Init takes nothing returns nothing - call TriggerRegisterGatherEvent(WoWReforgedTradingPosts__gatherTrigger) - call TriggerAddCondition(WoWReforgedTradingPosts__gatherTrigger, Condition(function WoWReforgedTradingPosts__TriggerConditionGather)) -endfunction -//library WoWReforgedTradingPosts ends -//library NewBonusUtils: - - // Required Library: RegisterPlayerUnitEvent -> www.hiveworkshop.com/threads/snippet-registerplayerunitevent.203338/ - // API: - // function AddUnitBonusTimed takes unit u, integer bonus_type, real amount, real duration returns nothing - // -> Add the specified amount for the specified bonus type for unit for a duration - // -> Example: call AddUnitBonusTimed(GetTriggerUnit(), BONUS_ARMOR, 13, 10.5) - // function LinkBonusToBuff takes unit u, integer bonus_type, real amount, integer buffId returns nothing - // -> Links the bonus amount specified to a buff or ability. As long as the unit has the buff or - // -> the ability represented by the parameter buffId the bonus is not removed. - // -> Example: call LinkBonusToBuff(GetTriggerUnit(), BONUS_ARMOR, 10, 'B000') - // function LinkBonusToItem takes unit u, integer bonus_type, real amount, item i returns nothing - // -> Links the bonus amount specified to an item. As long as the unit has that item the bonus is not removed. - // -> Note that it will work for items with the same id, because it takes as parameter the item object. - // -> Example: call LinkBonusToItem(GetManipulatingUnit(), BONUS_ARMOR, 10, GetManipulatedItem()) - // function UnitCopyBonuses takes unit source, unit target returns nothing - // -> Copy the source unit bonuses using the Add functionality to the target unit - // -> Example: call UnitCopyBonuses(GetTriggerUnit(), GetSummonedUnit()) - // function UnitMirrorBonuses takes unit source, unit target returns nothing - // -> Copy the source unit bonuses using the Set functionality to the target unit - // -> Example: call UnitMirrorBonuses(GetTriggerUnit(), GetSummonedUnit()) - - - - - - function AddUnitBonusTimed takes unit source,integer bonus,real amount,real duration returns nothing - call sc__NewBonusUtils_linkTimed(source , bonus , amount , duration , true) - endfunction - function LinkBonusToBuff takes unit source,integer bonus,real amount,integer id returns nothing - call sc__NewBonusUtils_linkBuff(source , bonus , amount , id , false) - endfunction - function LinkBonusToItem takes unit source,integer bonus,real amount,item i returns nothing - call sc__NewBonusUtils_linkItem(source , bonus , amount , i) - endfunction - function UnitCopyBonuses takes unit source,unit target returns nothing - call sc__NewBonusUtils_copy(source , target) - endfunction - function UnitMirrorBonuses takes unit source,unit target returns nothing - call sc__NewBonusUtils_mirror(source , target) - endfunction - - - - function s__NewBonusUtils_remove takes integer this,integer i,boolean isItem returns integer - if s__NewBonusUtils_bonus_t[this] == BONUS_COOLDOWN_REDUCTION then - call s__CDR_remove((s__NewBonusUtils_source[this] ) , (( s__NewBonusUtils_value[this])*1.0)) // INLINED!! - elseif s__NewBonusUtils_bonus_t[this] == BONUS_TENACITY then - call sc__Tenacity_remove((s__NewBonusUtils_source[this] ) , (( s__NewBonusUtils_value[this])*1.0)) // INLINED!! - else -call sc__NewBonus_add((s__NewBonusUtils_source[this] ) , ( s__NewBonusUtils_bonus_t[this] ) , (( - s__NewBonusUtils_value[this])*1.0)) // INLINED!! - endif - if isItem then - set s__NewBonusUtils_items[i]=s__NewBonusUtils_items[s__NewBonusUtils_k] - set s__NewBonusUtils_k=s__NewBonusUtils_k - 1 - else - set s__NewBonusUtils_array[i]=s__NewBonusUtils_array[s__NewBonusUtils_index] - set s__NewBonusUtils_index=s__NewBonusUtils_index - 1 - if s__NewBonusUtils_index == - 1 then - call PauseTimer(s__NewBonusUtils_timer) - endif - endif - set s__NewBonusUtils_source[this]=null - set s__NewBonusUtils_item[this]=null - - call sc__NewBonus_deallocate(this) - return i - 1 - endfunction - function s__NewBonusUtils_onDrop takes nothing returns nothing - local item itm= GetManipulatedItem() - local integer i= 0 - local integer this - - loop - exitwhen i > s__NewBonusUtils_k - set this=s__NewBonusUtils_items[i] - - if s__NewBonusUtils_item[this] == itm then - set i=s__NewBonusUtils_remove(this,i , true) - endif - set i=i + 1 - endloop - endfunction - - function s__NewBonusUtils_onPeriod takes nothing returns nothing - local integer i= 0 - local integer this - loop - exitwhen i > s__NewBonusUtils_index - set this=s__NewBonusUtils_array[i] - if s__NewBonusUtils_link[this] then - if s__NewBonusUtils_duration[this] <= 0 then - set i=s__NewBonusUtils_remove(this,i , false) - endif - set s__NewBonusUtils_duration[this]=s__NewBonusUtils_duration[this] - s__NewBonusUtils_period - else - if GetUnitAbilityLevel(s__NewBonusUtils_source[this], s__NewBonusUtils_buff[this]) == 0 then - set i=s__NewBonusUtils_remove(this,i , false) - endif - endif - set i=i + 1 - endloop - endfunction - function s__NewBonusUtils_linkTimed takes unit source,integer bonus,real amount,real duration,boolean link returns nothing - local integer this= s__NewBonusUtils__allocate() - set s__NewBonusUtils_source[this]=source - set s__NewBonusUtils_duration[this]=duration - set s__NewBonusUtils_link[this]=link - set s__NewBonusUtils_value[this]=(sc__NewBonus_add((source ) , ( bonus ) , (( amount)*1.0))) // INLINED!! - set s__NewBonusUtils_bonus_t[this]=s__NewBonus_linkType - set s__NewBonusUtils_index=s__NewBonusUtils_index + 1 - set s__NewBonusUtils_array[s__NewBonusUtils_index]=this - - if s__NewBonusUtils_index == 0 then - call TimerStart(s__NewBonusUtils_timer, s__NewBonusUtils_period, true, function s__NewBonusUtils_onPeriod) - endif - endfunction - function s__NewBonusUtils_linkBuff takes unit source,integer bonus,real amount,integer id,boolean link returns nothing - local integer this= s__NewBonusUtils__allocate() - set s__NewBonusUtils_source[this]=source - set s__NewBonusUtils_buff[this]=id - set s__NewBonusUtils_link[this]=link - set s__NewBonusUtils_value[this]=(sc__NewBonus_add((source ) , ( bonus ) , (( amount)*1.0))) // INLINED!! - set s__NewBonusUtils_bonus_t[this]=s__NewBonus_linkType - set s__NewBonusUtils_index=s__NewBonusUtils_index + 1 - set s__NewBonusUtils_array[s__NewBonusUtils_index]=this - - if s__NewBonusUtils_index == 0 then - call TimerStart(s__NewBonusUtils_timer, s__NewBonusUtils_period, true, function s__NewBonusUtils_onPeriod) - endif - endfunction - function s__NewBonusUtils_linkItem takes unit source,integer bonus,real amount,item i returns nothing - local integer this= s__NewBonusUtils__allocate() - set s__NewBonusUtils_source[this]=source - set s__NewBonusUtils_item[this]=i - set s__NewBonusUtils_value[this]=(sc__NewBonus_add((source ) , ( bonus ) , (( amount)*1.0))) // INLINED!! - set s__NewBonusUtils_bonus_t[this]=s__NewBonus_linkType - set s__NewBonusUtils_k=s__NewBonusUtils_k + 1 - set s__NewBonusUtils_items[s__NewBonusUtils_k]=this - endfunction - function s__NewBonusUtils_copy takes unit source,unit target returns nothing - local integer i= 1 - loop - exitwhen i > s__NewBonus_last - if (sc__NewBonus_get((source ) , ( i))) != 0 then // INLINED!! -call sc__NewBonus_add((target ) , ( i ) , (( (sc__NewBonus_get((source ) , ( i))))*1.0)) // INLINED!! - endif - set i=i + 1 - endloop - endfunction - function s__NewBonusUtils_mirror takes unit source,unit target returns nothing - local integer i= 1 - - loop - exitwhen i > s__NewBonus_last -call sc__NewBonus_Set((target ) , ( i ) , (( (sc__NewBonus_get((source ) , ( i))))*1.0) , false) // INLINED!! - set i=i + 1 - endloop - endfunction - function s__NewBonusUtils_onInit takes nothing returns nothing - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_DROP_ITEM , function s__NewBonusUtils_onDrop) - endfunction -//library NewBonusUtils ends -//library Ray: -function Ray___FilterIsClosestUnit takes nothing returns boolean - local unit u= GetFilterUnit() - local real distance= 0.0 - if ( RayConfig_IsUnitAllowed(s__Ray___T_caster[Ray___filterTarget] , u , s__Ray___T_abilityId[Ray___filterTarget]) ) then - set distance=DistanceBetweenCoordinates(GetUnitX(u) , GetUnitY(u) , GetUnitX(s__Ray___T_caster[Ray___filterTarget]) , GetUnitY(s__Ray___T_caster[Ray___filterTarget])) - if ( Ray___filterClosestUnit == null or distance < Ray___filterClosestDistance ) then - //call BJDebugMsg("Matched destructable " + GetDestructableName(d)) - set Ray___filterClosestDistance=distance - set Ray___filterClosestUnit=u - endif - endif - set u=null - return false -endfunction -function Ray___FilterIsClosestDestructable takes nothing returns boolean - local destructable d= GetFilterDestructable() - local real distance= 0.0 - if ( RayConfig_IsDestructableAllowed(s__Ray___T_caster[Ray___filterTarget] , d , s__Ray___T_abilityId[Ray___filterTarget]) ) then - set distance=DistanceBetweenCoordinates(GetDestructableX(d) , GetDestructableY(d) , GetUnitX(s__Ray___T_caster[Ray___filterTarget]) , GetUnitY(s__Ray___T_caster[Ray___filterTarget])) - if ( Ray___filterClosestDestructable == null or distance < Ray___filterClosestDistance ) then - //call BJDebugMsg("Matched destructable " + GetDestructableName(d)) - set Ray___filterClosestDistance=distance - set Ray___filterClosestDestructable=d - endif - endif - set d=null - return false -endfunction -function Ray___FilterIsClosestItem takes nothing returns boolean - local item i= GetFilterItem() - local real distance= 0.0 - if ( RayConfig_IsItemAllowed(s__Ray___T_caster[Ray___filterTarget] , i , s__Ray___T_abilityId[Ray___filterTarget]) ) then - set distance=DistanceBetweenCoordinates(GetItemX(i) , GetItemY(i) , GetUnitX(s__Ray___T_caster[Ray___filterTarget]) , GetUnitY(s__Ray___T_caster[Ray___filterTarget])) - if ( Ray___filterClosestItem == null or distance < Ray___filterClosestDistance ) then - set Ray___filterClosestDistance=distance - set Ray___filterClosestItem=i - endif - endif - set i=null - return false -endfunction -function GetRayRefreshTimerHandleId takes nothing returns integer - return GetHandleId(Ray___refreshTimer) -endfunction -function Ray___GetTargetUnit takes integer target,real casterX,real casterY,real face,real x,real y returns unit - local group g= CreateGroup() - local unit result= null - set Ray___filterTarget=target - set Ray___filterClosestDistance=0.0 - set Ray___filterClosestUnit=null - call GroupEnumUnitsInRange(g, x, y, s__Ray___T_range[target], Ray___filterIsClosestUnit) - call GroupClear(g) - call DestroyGroup(g) - set g=null - return Ray___filterClosestUnit -endfunction -function Ray___GetTargetDestructable takes integer target,real casterX,real casterY,real face,real x,real y returns destructable - local rect r= GetRectFromCircle(x , y , s__Ray___T_range[target]) - set Ray___filterTarget=target - set Ray___filterClosestDistance=0.0 - set Ray___filterClosestDestructable=null - call EnumDestructablesInRect(r, Ray___filterIsClosestDestructable, null) - call RemoveRect(r) - set r=null - return Ray___filterClosestDestructable -endfunction -function Ray___GetTargetItem takes integer target,real casterX,real casterY,real face,real x,real y returns item - local rect r= GetRectFromCircle(x , y , s__Ray___T_range[target]) - set Ray___filterTarget=target - set Ray___filterClosestDistance=0.0 - set Ray___filterClosestItem=null - call EnumItemsInRect(r, Ray___filterIsClosestItem, null) - call RemoveRect(r) - set r=null - return Ray___filterClosestItem -endfunction -function Ray___UpdateTarget takes integer target returns nothing - local real face= GetUnitFacing(s__Ray___T_caster[target]) - local real x= GetUnitX(s__Ray___T_caster[target]) - local real y= GetUnitY(s__Ray___T_caster[target]) - local real z= BlzGetUnitZ(s__Ray___T_caster[target]) + GetUnitFlyHeight(s__Ray___T_caster[target]) - local real targetX= x - local real targetY= y - local real targetWidth= 0.0 - local real centerX= PolarProjectionX(targetX , face , Ray_STEP_DISTANCE_HALF) - local real centerY= PolarProjectionY(targetY , face , Ray_STEP_DISTANCE_HALF) - local real tmpTargetX= x - local real tmpTargetY= y - local location tmpTarget= Location(tmpTargetX, tmpTargetY) - local real distanceUnit= 0.0 - local real distanceDestructable= 0.0 - local real distanceItem= 0.0 - local real maxDistance= s__Ray___T_maxDistance[target] - local real distance= 0.0 - local integer i= 0 - local real lightningX= 0.0 - local real lightningY= 0.0 - local real lightningZ= 0.0 - local unit oldTargetUnit= s__Ray___T_u[target] - local destructable oldTargetDestructable= s__Ray___T_d[target] - local item oldTargetItem= s__Ray___T_i[target] - local boolean oldTarget= false - set s__Ray___T_u[target]=null - set s__Ray___T_d[target]=null - set s__Ray___T_i[target]=null - //call BJDebugMsg("Face " + R2S(face)) - loop - if ( RayConfig_CanTargetUnits(s__Ray___T_abilityId[target]) ) then - set s__Ray___T_u[target]=Ray___GetTargetUnit(target , x , y , face , centerX , centerY) - endif - if ( RayConfig_CanTargetDestructables(s__Ray___T_abilityId[target]) ) then - set s__Ray___T_d[target]=Ray___GetTargetDestructable(target , x , y , face , centerX , centerY) - endif - - if ( RayConfig_CanTargetItems(s__Ray___T_abilityId[target]) ) then - set s__Ray___T_i[target]=Ray___GetTargetItem(target , x , y , face , centerX , centerY) - endif - if ( s__Ray___T_u[target] != null and s__Ray___T_d[target] != null ) then - set distanceUnit=DistanceBetweenCoordinates(x , y , GetUnitX(s__Ray___T_u[target]) , GetUnitY(s__Ray___T_u[target])) - set distanceDestructable=DistanceBetweenCoordinates(x , y , GetDestructableX(s__Ray___T_d[target]) , GetDestructableY(s__Ray___T_d[target])) - if ( distanceDestructable < distanceUnit ) then - set s__Ray___T_u[target]=null - else - set s__Ray___T_d[target]=null - endif - endif - - if ( s__Ray___T_u[target] != null and s__Ray___T_i[target] != null ) then - set distanceUnit=DistanceBetweenCoordinates(x , y , GetUnitX(s__Ray___T_u[target]) , GetUnitY(s__Ray___T_u[target])) - set distanceItem=DistanceBetweenCoordinates(x , y , GetItemX(s__Ray___T_i[target]) , GetItemY(s__Ray___T_i[target])) - if ( distanceItem < distanceUnit ) then - set s__Ray___T_u[target]=null - else - set s__Ray___T_i[target]=null - endif - endif - - if ( s__Ray___T_d[target] != null and s__Ray___T_i[target] != null ) then - set distanceDestructable=DistanceBetweenCoordinates(x , y , GetDestructableX(s__Ray___T_d[target]) , GetDestructableY(s__Ray___T_d[target])) - set distanceItem=DistanceBetweenCoordinates(x , y , GetItemX(s__Ray___T_i[target]) , GetItemY(s__Ray___T_i[target])) - if ( distanceItem < distanceDestructable ) then - set s__Ray___T_d[target]=null - else - set s__Ray___T_i[target]=null - endif - endif - - exitwhen ( s__Ray___T_u[target] != null or s__Ray___T_d[target] != null or s__Ray___T_i[target] != null ) - - //call BJDebugMsg("Updating target loop (" + R2S(targetX) + "|" + R2S(targetX) + ")") - - set tmpTargetX=PolarProjectionX(targetX , face , Ray_STEP_DISTANCE) - set tmpTargetY=PolarProjectionY(targetY , face , Ray_STEP_DISTANCE) - call MoveLocation(tmpTarget, tmpTargetX, tmpTargetY) - exitwhen ( IsTerrainPathable(tmpTargetX, tmpTargetY, PATHING_TYPE_FLYABILITY) ) - exitwhen ( IsTerrainPathable(tmpTargetX, tmpTargetY, PATHING_TYPE_WALKABILITY) and IsTerrainPathable(tmpTargetX, tmpTargetY, PATHING_TYPE_FLOATABILITY) ) - exitwhen ( tmpTargetX >= GetRectMaxX(GetPlayableMapRect()) ) - exitwhen ( tmpTargetX <= GetRectMinX(GetPlayableMapRect()) ) - exitwhen ( tmpTargetY >= GetRectMaxY(GetPlayableMapRect()) ) - exitwhen ( tmpTargetY <= GetRectMinY(GetPlayableMapRect()) ) - exitwhen ( GetLocationZ(tmpTarget) > z + Ray_Z_THRESHOLD ) - exitwhen ( DistanceBetweenCoordinates(x , y , tmpTargetX , tmpTargetY) > maxDistance ) - set targetX=tmpTargetX - set targetY=tmpTargetY - set centerX=PolarProjectionX(targetX , face , Ray_STEP_DISTANCE_HALF) - set centerY=PolarProjectionY(targetY , face , Ray_STEP_DISTANCE_HALF) - endloop - - if ( s__Ray___T_u[target] != null ) then - set s__Ray___T_x[target]=GetUnitX(s__Ray___T_u[target]) - set s__Ray___T_y[target]=GetUnitY(s__Ray___T_u[target]) - set s__Ray___T_z[target]=BlzGetUnitZ(s__Ray___T_u[target]) + GetUnitFlyHeight(s__Ray___T_u[target]) - set targetWidth=BlzGetUnitCollisionSize(s__Ray___T_u[target]) - - if ( oldTargetUnit == s__Ray___T_u[target] ) then - set oldTarget=true - endif - elseif ( s__Ray___T_d[target] != null ) then - set s__Ray___T_x[target]=GetDestructableX(s__Ray___T_d[target]) - set s__Ray___T_y[target]=GetDestructableY(s__Ray___T_d[target]) - set s__Ray___T_z[target]=z - - if ( oldTargetDestructable == s__Ray___T_d[target] ) then - set oldTarget=true - endif - elseif ( s__Ray___T_i[target] != null ) then - set s__Ray___T_x[target]=GetItemX(s__Ray___T_i[target]) - set s__Ray___T_y[target]=GetItemY(s__Ray___T_i[target]) - set s__Ray___T_z[target]=z - - if ( oldTargetItem == s__Ray___T_i[target] ) then - set oldTarget=true - endif - else - set s__Ray___T_x[target]=targetX - set s__Ray___T_y[target]=targetY - set s__Ray___T_z[target]=z - endif - - if ( oldTarget ) then - set s__Ray___T_duration[target]=s__Ray___T_duration[target] + RayConfig_REFRESH_INTERVAL - else - set s__Ray___T_duration[target]=0.0 - endif - set distance=DistanceBetweenCoordinates(x , y , s__Ray___T_x[target] , s__Ray___T_y[target]) - targetWidth - set s__Ray___T_x[target]=PolarProjectionX(x , face , distance) - set s__Ray___T_y[target]=PolarProjectionY(y , face , distance) - - set i=0 - loop - exitwhen ( i == s__Ray___T_maxLightnings[target] ) - set lightningX=PolarProjectionX(x , ModuloReal(face + 90.0, 360.0) , RayConfig_GetLightningOffsetWidthX(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) - set lightningY=PolarProjectionY(y , ModuloReal(face + 90.0, 360.0) , RayConfig_GetLightningOffsetWidthY(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) - set lightningX=PolarProjectionX(lightningX , face , RayConfig_GetLightningOffsetLengthX(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) - set lightningY=PolarProjectionY(lightningY , face , RayConfig_GetLightningOffsetLengthY(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) - set lightningZ=z + RayConfig_GetLightningOffsetZ(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i) - - call MoveLightningEx(s___Ray___T_l[s__Ray___T_l[target]+i], false, lightningX, lightningY, lightningZ, s__Ray___T_x[target], s__Ray___T_y[target], s__Ray___T_z[target]) - set i=i + 1 - endloop - - call RemoveLocation(tmpTarget) - set tmpTarget=null -endfunction -function Ray___EndRay takes unit caster returns nothing - local integer handleId= GetHandleId(caster) - local integer i= 0 - local integer target= LoadInteger(Ray___h, handleId, 0) - local real cooldown= RayConfig_GetCooldown(s__Ray___T_caster[target] , s__Ray___T_abilityId[target]) - - if ( s__Ray___T_loopSound[target] != null and GetSoundIsPlaying(s__Ray___T_loopSound[target]) ) then - call StopSound(s__Ray___T_loopSound[target], false, false) - endif - - if ( s__Ray___T_hitSound[target] != null and GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then - call StopSound(s__Ray___T_hitSound[target], false, false) - endif - - if ( s__Ray___T_casterEffect[target] != null ) then - call DestroyEffect(s__Ray___T_casterEffect[target]) - set s__Ray___T_casterEffect[target]=null - endif - - if ( s__Ray___T_targetEffect[target] != null ) then - call DestroyEffect(s__Ray___T_targetEffect[target]) - set s__Ray___T_targetEffect[target]=null - endif - - call GroupRemoveUnit(Ray___casters, s__Ray___T_caster[target]) - - if ( BlzGroupGetSize(Ray___casters) == 0 ) then - call PauseTimer(Ray___refreshTimer) - endif - - set i=0 - loop - exitwhen ( i == s__Ray___T_maxLightnings[target] ) - call DestroyLightning(s___Ray___T_l[s__Ray___T_l[target]+i]) - set i=i + 1 - endloop - - call BlzStartUnitAbilityCooldown(s__Ray___T_caster[target], s__Ray___T_abilityId[target], cooldown) - - call s__Ray___T_deallocate(target) - call FlushChildHashtable(Ray___h, handleId) -endfunction -function Ray___GetUnitController takes unit caster returns player - local player slotPlayer= null - local player owner= GetOwningPlayer(caster) - local player result= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( ( owner == slotPlayer or GetPlayerAlliance(slotPlayer, owner, ALLIANCE_SHARED_ADVANCED_CONTROL) ) and IsUnitSelected(caster, slotPlayer) ) then - if ( result == null or owner == slotPlayer ) then - set result=slotPlayer - endif - endif - set slotPlayer=null - set i=i + 1 - endloop - set owner=null - return result -endfunction -function Ray___MouseAiming takes unit caster returns nothing - local player controller= Ray___GetUnitController(caster) - call SetUnitFacing(caster, AngleBetweenCoordinatesDeg(GetUnitX(caster) , GetUnitY(caster) , (s__UserMouse_mouseX[s__UserMouse__staticgetindex((controller))]) , (s__UserMouse_mouseY[s__UserMouse__staticgetindex((controller))]))) // INLINED!! - set controller=null -endfunction -function Ray___TriggerActionRefresh takes nothing returns nothing - local integer i= 0 - local integer max= BlzGroupGetSize(Ray___casters) - local integer target= 0 - loop - exitwhen ( i == max ) - set target=LoadInteger(Ray___h, GetHandleId(BlzGroupUnitAt(Ray___casters, i)), 0) - - if ( s__Ray___T_mouseAiming[target] ) then - call Ray___MouseAiming(s__Ray___T_caster[target]) - endif - - //call BJDebugMsg("Update target " + I2S(target)) - call Ray___UpdateTarget(target) - if ( s__Ray___T_loopSound[target] != null and not GetSoundIsPlaying(s__Ray___T_loopSound[target]) ) then - //call BJDebugMsg("Play sound.") - call PlaySoundOnUnitBJ(s__Ray___T_loopSound[target], 100.0, s__Ray___T_caster[target]) - endif - if ( s__Ray___T_u[target] != null ) then - call RayConfig_OnHitUnit(s__Ray___T_caster[target] , s__Ray___T_u[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) - - if ( s__Ray___T_hitSound[target] != null and not GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then - call PlaySoundOnUnitBJ(s__Ray___T_hitSound[target], 100.0, s__Ray___T_u[target]) - endif - - if ( RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) != null and s__Ray___T_targetEffect[target] == null ) then - set s__Ray___T_targetEffect[target]=AddSpecialEffectTarget(RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]), s__Ray___T_u[target], RayConfig_GetTargetEffectAttachmentPoint(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target])) - endif - - call BlzSetSpecialEffectX(s__Ray___T_targetEffect[target], GetUnitX(s__Ray___T_u[target])) - call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], GetUnitY(s__Ray___T_u[target])) - call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], BlzGetUnitZ(s__Ray___T_u[target]) + GetUnitFlyHeight(s__Ray___T_u[target])) - elseif ( s__Ray___T_d[target] != null ) then - call RayConfig_OnHitDestructable(s__Ray___T_caster[target] , s__Ray___T_d[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) - - if ( s__Ray___T_hitSound[target] != null ) then - if ( not GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then - call StartSound(s__Ray___T_hitSound[target]) - call SetSoundVolume(s__Ray___T_hitSound[target], 127) - endif - call SetSoundPosition(s__Ray___T_hitSound[target], s__Ray___T_x[target], s__Ray___T_y[target], s__Ray___T_z[target]) - endif - - if ( RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) != null and s__Ray___T_targetEffect[target] == null ) then - set s__Ray___T_targetEffect[target]=AddSpecialEffect(RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]), GetDestructableX(s__Ray___T_d[target]), GetDestructableY(s__Ray___T_d[target])) - endif - - call BlzSetSpecialEffectX(s__Ray___T_targetEffect[target], GetDestructableX(s__Ray___T_d[target])) - call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], GetDestructableY(s__Ray___T_d[target])) - //call BlzSetSpecialEffectY(target.targetEffect, BlzGetUnitZ(target.u) + GetUnitFlyHeight(target.u)) - elseif ( s__Ray___T_i[target] != null ) then - call RayConfig_OnHitItem(s__Ray___T_caster[target] , s__Ray___T_i[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) - - if ( s__Ray___T_hitSound[target] != null ) then - if ( not GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then - call StartSound(s__Ray___T_hitSound[target]) - call SetSoundVolume(s__Ray___T_hitSound[target], 127) - endif - call SetSoundPosition(s__Ray___T_hitSound[target], s__Ray___T_x[target], s__Ray___T_y[target], s__Ray___T_z[target]) - endif - - if ( RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) != null and s__Ray___T_targetEffect[target] == null ) then - set s__Ray___T_targetEffect[target]=AddSpecialEffect(RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]), GetItemX(s__Ray___T_i[target]), GetItemY(s__Ray___T_i[target])) - endif - - call BlzSetSpecialEffectX(s__Ray___T_targetEffect[target], GetItemX(s__Ray___T_i[target])) - call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], GetItemY(s__Ray___T_i[target])) - //call BlzSetSpecialEffectY(target.targetEffect, BlzGetUnitZ(target.u) + GetUnitFlyHeight(target.u)) - endif - - if ( not RayConfig_OnCastLoop(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) ) then - call Ray___EndRay(s__Ray___T_caster[target]) - endif - set i=i + 1 - endloop -endfunction -function Ray___TimerFunctionRefresh takes nothing returns nothing - // allows using trigger sleep actions - call TriggerExecute(Ray___refreshTrigger) -endfunction -function Ray___TimerFunctionExpire takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer handleId= GetHandleId(t) - local integer target= LoadInteger(Ray___h, handleId, 0) - - call Ray___EndRay(s__Ray___T_caster[target]) - - call FlushChildHashtable(Ray___h, handleId) - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function Ray_GetCastingRayAbilityId takes unit caster returns integer - local integer handleId= GetHandleId(caster) - local integer target= LoadInteger(Ray___h, handleId, 0) - - if ( target == 0 ) then - return 0 - endif - - return s__Ray___T_abilityId[target] -endfunction -function Ray_IsCastingRay takes unit caster,integer abilityId returns boolean - return Ray_GetCastingRayAbilityId(caster) == abilityId -endfunction -function Ray_IsCastingAnyRay takes unit caster returns boolean - local integer handleId= GetHandleId(caster) - local integer target= LoadInteger(Ray___h, handleId, 0) - - return target != 0 -endfunction -function Ray___Ray takes unit caster,integer abilityId returns nothing - local real x= GetUnitX(caster) - local real y= GetUnitY(caster) - local real face= GetUnitFacing(caster) - local integer handleId= GetHandleId(caster) - local integer target= LoadInteger(Ray___h, handleId, 0) - local real duration= RayConfig_GetDuration(caster , abilityId) - local integer i= 0 - if ( target == 0 ) then - set target=s__Ray___T__allocate() - set s__Ray___T_t[target]=CreateTimer() - set s__Ray___T_caster[target]=caster - call SaveInteger(Ray___h, handleId, 0, target) - set handleId=GetHandleId(s__Ray___T_t[target]) - call SaveInteger(Ray___h, handleId, 0, target) - endif - - set s__Ray___T_duration[target]=0.0 - set s__Ray___T_disableAttack[target]=RayConfig_DisableAttack(caster , abilityId) - set s__Ray___T_disableMovement[target]=RayConfig_GetDisableMovement(caster , abilityId) - set s__Ray___T_mouseAiming[target]=RayConfig_GetMouseAiming(caster , abilityId) - - set s__Ray___T_maxLightnings[target]=RayConfig_GetMaxLightnings(caster , abilityId) - set i=0 - loop - exitwhen ( i == s__Ray___T_maxLightnings[target] ) - set s___Ray___T_l[s__Ray___T_l[target]+i]=AddLightning(RayConfig_GetLightningCode(caster , abilityId , i), true, x, y, x, y) - set i=i + 1 - endloop - - if ( RayConfig_GetCasterEffect(caster , abilityId , s__Ray___T_duration[target]) != null ) then - set s__Ray___T_casterEffect[target]=AddSpecialEffectTarget(RayConfig_GetCasterEffect(caster , abilityId , s__Ray___T_duration[target]), caster, RayConfig_GetCasterEffectAttachmentPoint(caster , abilityId , s__Ray___T_duration[target])) - endif - - call Ray___UpdateTarget(target) - set s__Ray___T_abilityId[target]=abilityId - set s__Ray___T_loopSound[target]=RayConfig_GetLoopSound(caster , abilityId) - set s__Ray___T_hitSound[target]=RayConfig_GetHitSound(caster , abilityId) - set s__Ray___T_maxDistance[target]=RayConfig_GetMaxDistance(caster , abilityId) - set s__Ray___T_range[target]=RayConfig_GetRange(caster , abilityId) - - if ( not IsUnitInGroup(caster, Ray___casters) ) then - call GroupAddUnit(Ray___casters, caster) - - if ( BlzGroupGetSize(Ray___casters) == 1 ) then - call TimerStart(Ray___refreshTimer, RayConfig_REFRESH_INTERVAL, true, function Ray___TimerFunctionRefresh) - endif - endif - - if ( duration > 0.0 ) then - call TimerStart(s__Ray___T_t[target], duration, false, function Ray___TimerFunctionExpire) - endif -endfunction -function Ray___TriggerConditionCast takes nothing returns boolean - local unit caster= GetTriggerUnit() - local integer abilityId= GetSpellAbilityId() - local integer target= 0 - if ( RayConfig_IsValidAbility(abilityId) ) then - if ( Ray_IsCastingRay(caster , abilityId) and RayConfig_GetHoldKey(caster , abilityId) ) then - set target=LoadInteger(Ray___h, GetHandleId(caster), 0) - //call BJDebugMsg("Renew " + GetObjectName(target.abilityId) + " with duration " + R2S(RayConfig_GetDuration(caster, target.abilityId))) - call TimerStart(s__Ray___T_t[target], RayConfig_GetDuration(caster , s__Ray___T_abilityId[target]), false, function Ray___TimerFunctionExpire) - call DisableTrigger(Ray___orderTrigger) - call IssueImmediateOrder(caster, "stop") - call EnableTrigger(Ray___orderTrigger) - return false - endif - - if ( Ray_IsCastingRay(caster , abilityId) ) then - call Ray___EndRay(caster) - else - if ( Ray_IsCastingAnyRay(caster) ) then - call Ray___EndRay(caster) - endif - call Ray___Ray(caster , abilityId) - endif - endif - set caster=null - return false -endfunction -function Ray___TriggerConditionDeath takes nothing returns boolean - local unit caster= GetTriggerUnit() - if ( Ray_IsCastingAnyRay(caster) ) then - call Ray___EndRay(caster) - endif - set caster=null - return false -endfunction -function Ray___TriggerConditionOrder takes nothing returns boolean - local integer orderId= GetIssuedOrderId() - local unit caster= GetTriggerUnit() - //call BJDebugMsg("Order " + I2S(orderId)) - if ( Ray_IsCastingAnyRay(caster) ) then - //call BJDebugMsg("Check 1") - if ( orderId == Ray_ORDER_ID_STOP ) then - //call BJDebugMsg("Stop") - call Ray___EndRay(caster) - endif - endif - set caster=null - return true -endfunction -function Ray___TimerFunctionChangeFacing takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer handleId= GetHandleId(t) - local unit caster= LoadUnitHandle(Ray___h, handleId, 0) - local integer abilityId= LoadInteger(Ray___h, handleId, 1) - local real x= LoadReal(Ray___h, handleId, 2) - local real y= LoadReal(Ray___h, handleId, 3) - if ( GetUnitTypeId(caster) != 0 and Ray_GetCastingRayAbilityId(caster) == abilityId ) then - call DisableTrigger(Ray___orderTrigger) - call IssueImmediateOrder(caster, "stop") - call EnableTrigger(Ray___orderTrigger) - call SetUnitFacing(caster, AngleBetweenCoordinatesDeg(GetUnitX(caster) , GetUnitY(caster) , x , y)) - endif - call FlushChildHashtable(Ray___h, handleId) - call PauseTimer(t) - call DestroyTimer(t) - set t=null - set caster=null -endfunction -function Ray___TimedChangeFacing takes unit caster,integer abilityId,real x,real y returns nothing - local timer t= CreateTimer() - local integer handleId= GetHandleId(t) - call SaveUnitHandle(Ray___h, handleId, 0, caster) - call SaveInteger(Ray___h, handleId, 1, abilityId) - call SaveReal(Ray___h, handleId, 2, x) - call SaveReal(Ray___h, handleId, 3, y) - //call BJDebugMsg("Start time changed facing") - call TimerStart(t, 0.0, false, function Ray___TimerFunctionChangeFacing) -endfunction -function Ray___TriggerActionOrder takes nothing returns nothing - local trigger whichTrigger= GetTriggeringTrigger() - local integer orderId= GetIssuedOrderId() - local unit caster= GetTriggerUnit() - //call BJDebugMsg("Order " + I2S(orderId)) - if ( Ray_IsCastingAnyRay(caster) ) then - //call BJDebugMsg("Check 2") - if ( ( orderId == Ray_ORDER_ID_MOVE or orderId == Ray_ORDER_ID_SMART ) and RayConfig_GetDisableMovement(caster , Ray_GetCastingRayAbilityId(caster)) ) then - call Ray___TimedChangeFacing(caster , Ray_GetCastingRayAbilityId(caster) , GetOrderPointX() , GetOrderPointY()) - //call BJDebugMsg("Change facing") - endif - endif - set caster=null - set whichTrigger=null -endfunction -function Ray___TriggerConditionAttack takes nothing returns boolean - local integer handleId= GetHandleId(GetAttacker()) - local integer t= LoadInteger(Ray___h, handleId, 0) - if ( t != 0 and s__Ray___T_disableAttack[t] ) then - call BlzUnitInterruptAttack(GetAttacker()) - endif - return false -endfunction -function Ray___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(Ray___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(Ray___castTrigger, Condition(function Ray___TriggerConditionCast)) - call TriggerRegisterAnyUnitEventBJ(Ray___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(Ray___deathTrigger, Condition(function Ray___TriggerConditionDeath)) - call TriggerRegisterAnyUnitEventBJ(Ray___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) - call TriggerRegisterAnyUnitEventBJ(Ray___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) - call TriggerAddCondition(Ray___orderTrigger, Condition(function Ray___TriggerConditionOrder)) - call TriggerAddAction(Ray___orderTrigger, function Ray___TriggerActionOrder) - call TriggerRegisterAnyUnitEventBJ(Ray___attackTrigger, EVENT_PLAYER_UNIT_ATTACKED) - call TriggerAddCondition(Ray___attackTrigger, Condition(function Ray___TriggerConditionAttack)) - call TriggerAddAction(Ray___refreshTrigger, function Ray___TriggerActionRefresh) - - set Ray___filterIsClosestUnit=Filter(function Ray___FilterIsClosestUnit) - set Ray___filterIsClosestDestructable=Filter(function Ray___FilterIsClosestDestructable) - set Ray___filterIsClosestItem=Filter(function Ray___FilterIsClosestItem) -endfunction -function Ray___RemoveUnitHook takes unit whichUnit returns nothing - if ( Ray_IsCastingAnyRay(whichUnit) ) then - call Ray___EndRay(whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit Ray___RemoveUnitHook -//library Ray ends -//library WoWReforgedProfessionBooksShop: -function AddProfessionBooksShop takes unit shop returns nothing - local integer i= 0 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - call EnablePagedButtons(shop) - loop - exitwhen ( i == max ) -call AddPagedButtonsId((shop ) , ( udg_ProfessionItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop -endfunction -function WoWReforgedProfessionBooksShop__FilterIsProfessionBooksShop takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == PROFESSION_BOOKS_SHOP -endfunction -function WoWReforgedProfessionBooksShop__ForGroupAddProfessionBooksShop takes nothing returns nothing - call AddProfessionBooksShop(GetEnumUnit()) -endfunction -function AddAllProfessionBooksShops takes nothing returns nothing - local group shops= CreateGroup() - call GroupEnumUnitsInRect(shops, GetPlayableMapRect(), Filter(function WoWReforgedProfessionBooksShop__FilterIsProfessionBooksShop)) - call ForGroup(shops, function WoWReforgedProfessionBooksShop__ForGroupAddProfessionBooksShop) - call GroupClear(shops) - call DestroyGroup(shops) - set shops=null -endfunction -function WoWReforgedProfessionBooksShop__TimerFunctionAddAllProfessionBooksShop takes nothing returns nothing - call AddAllProfessionBooksShops() - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function WoWReforgedProfessionBooksShop__Init takes nothing returns nothing - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedProfessionBooksShop__TimerFunctionAddAllProfessionBooksShop) -endfunction -//library WoWReforgedProfessionBooksShop ends -//library AuraSystem: -function GetAuraSystemTimerHandleId takes nothing returns integer - return GetHandleId(AuraSystem___h) -endfunction -//processed: function interface AuraFilterFunction takes unit caster, unit target, integer abilityId returns boolean -function AuraSystem___OrderGroupByPriority takes group l__AuraSystem___t returns group - local group r= CreateGroup() - local integer j= 0 - local unit memberJ - local unit memberI - local unit tmp - local integer i= 0 - local integer max= BlzGroupGetSize(l__AuraSystem___t) - local unit array g - local integer gCounter= 0 - - loop - exitwhen ( i >= max ) - set memberI=BlzGroupUnitAt(l__AuraSystem___t, i) - set g[gCounter]=memberI - set gCounter=gCounter + 1 - set memberI=null - set i=i + 1 - endloop - - //call BJDebugMsg("Count targets " + I2S(gCounter)) - - call GroupClear(l__AuraSystem___t) - call DestroyGroup(l__AuraSystem___t) - set l__AuraSystem___t=null - - loop - exitwhen ( i >= gCounter ) - set memberI=g[i] - set j=0 - loop - exitwhen ( j >= gCounter ) - set memberJ=g[j] - if ( memberJ != memberI and BlzGetUnitRealField(memberJ, UNIT_RF_PRIORITY) > BlzGetUnitRealField(memberI, UNIT_RF_PRIORITY) ) then - set tmp=g[i] - set g[i]=g[j] - set g[j]=tmp - set memberI=g[i] - set memberJ=g[j] - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - - loop - exitwhen ( i >= gCounter ) - call GroupAddUnit(r, g[i]) - set i=i + 1 - endloop - - return r -endfunction - - - function s__Aura_addCaster takes integer this,unit caster returns nothing - call GroupAddUnit(s__Aura_casters[this], caster) - endfunction - - function s__Aura_setCasterMaxTargets takes integer this,unit caster,integer maxTargets returns nothing - call SaveInteger(AuraSystem___h, s__Aura_abilityId[this], GetHandleId(caster), maxTargets) - endfunction - - function s__Aura_getCasterMaxTargets takes integer this,unit caster returns integer - return LoadInteger(AuraSystem___h, s__Aura_abilityId[this], GetHandleId(caster)) - endfunction - - function s__Aura_filter takes nothing returns boolean - local boolean result= sc___prototype387_evaluate(s__Aura_tmpFilter,s__Aura_tmpCaster , GetFilterUnit() , s__Aura_tmpAbilityId) - //call BJDebugMsg("Filter: " + GetUnitName(GetFilterUnit())) - if ( result ) then - //call BJDebugMsg("Result true") - else - //call BJDebugMsg("Result false") - endif - return result - endfunction - - function s__Aura_create takes integer abilityId,integer buffAbilityId,integer effectAbilityId,integer filterFunction,real radius,boolean has_bonus_type,integer bonus_type,real bonus_amount,integer bonus_type2,real bonus_amount2 returns integer - local integer this= s__Aura__allocate() - set s__Aura_abilityId[this]=abilityId - set s__Aura_buffAbilityId[this]=buffAbilityId - set s__Aura_effectAbilityId[this]=effectAbilityId - set s__Aura_filterFunction[this]=filterFunction - set s__Aura_radius[this]=radius - set s__Aura_has_bonus_type[this]=has_bonus_type - set s__Aura_bonus_type[this]=bonus_type - set s__Aura_bonus_amount[this]=bonus_amount - set s__Aura_bonus_type2[this]=bonus_type2 - set s__Aura_bonus_amount2[this]=bonus_amount2 - - set s__s__Aura_allAuras[s__Aura_allAurasCounter]= this - set s__Aura_allAurasCounter=s__Aura_allAurasCounter + 1 - - return this - endfunction - - function s__Aura_update takes integer this,unit caster,group newTargets returns nothing - local integer level= GetUnitAbilityLevel(caster, s__Aura_abilityId[this]) - local group l__AuraSystem___t= CreateGroup() - local integer i= 0 - local integer max= 0 - local integer maxTargets= (LoadInteger(AuraSystem___h, s__Aura_abilityId[(this)], GetHandleId((caster)))) // INLINED!! - local unit target= null - set s__Aura_tmpFilter=s__Aura_filterFunction[this] - set s__Aura_tmpCaster=caster - set s__Aura_tmpAbilityId=s__Aura_abilityId[this] - call GroupEnumUnitsInRange(l__AuraSystem___t, GetUnitX(caster), GetUnitY(caster), s__Aura_radius[this], Filter(function s__Aura_filter)) - // if the number of targets is limited make sure that heroes etc. are targetted first - if ( maxTargets > 0 ) then - //call BJDebugMsg("Max targets " + I2S(maxTargets)) - set l__AuraSystem___t=AuraSystem___OrderGroupByPriority(l__AuraSystem___t) - endif - set max=BlzGroupGetSize(l__AuraSystem___t) - loop - exitwhen ( i == max or ( maxTargets > 0 and i >= maxTargets ) ) - set target=BlzGroupUnitAt(l__AuraSystem___t, i) - if ( not IsUnitInGroup(target, s__Aura_targets[this]) ) then - call UnitAddAbility(target, s__Aura_buffAbilityId[this]) - if ( s__Aura_effectAbilityId[this] != 0 ) then - call UnitAddAbility(target, s__Aura_effectAbilityId[this]) - call BlzUnitHideAbility(target, s__Aura_effectAbilityId[this], true) - endif - endif - - if ( s__Aura_effectAbilityId[this] != 0 ) then - call SetUnitAbilityLevel(target, s__Aura_effectAbilityId[this], level) - endif - //call BJDebugMsg("Target " + GetUnitName(target) + " with ability " + GetObjectName(effectAbilityId) + " level " + I2S(level) + " resulting in level " + I2S(GetUnitAbilityLevel(target, effectAbilityId))) - - if ( s__Aura_has_bonus_type[this] ) then - //call BJDebugMsg("Bonus! " + R2S(bonus_amount)) - if ( s__Aura_bonus_type[this] != 0 ) then - call sc__NewBonusUtils_linkTimed((target ) , ( s__Aura_bonus_type[this] ) , (( level * s__Aura_bonus_amount[this] )*1.0) , (( AuraSystem_BUFF_DURATION)*1.0) , true) // INLINED!! - endif - if ( s__Aura_bonus_type2[this] != 0 ) then - call sc__NewBonusUtils_linkTimed((target ) , ( s__Aura_bonus_type2[this] ) , (( level * s__Aura_bonus_amount2[this] )*1.0) , (( AuraSystem_BUFF_DURATION)*1.0) , true) // INLINED!! - endif - - //call LinkBonusToBuff(target, bonus_type, level * bonus_amount, buffAbilityId) - //call LinkBonusToBuff(target, bonus_type, level * bonus_amount, buffAbilityId) - endif - - call GroupAddUnit(newTargets, target) - set target=null - set i=i + 1 - endloop - - call GroupClear(l__AuraSystem___t) - call DestroyGroup(l__AuraSystem___t) - set l__AuraSystem___t=null - endfunction - - function s__Aura_updateAllCasters takes integer this returns nothing - // find new targets - local group newTargets= CreateGroup() - local integer i= 0 - local integer max= BlzGroupGetSize(s__Aura_casters[this]) - local unit caster= null - local unit target= null - loop - exitwhen ( i == max ) - set caster=BlzGroupUnitAt(s__Aura_casters[this], i) - if ( IsUnitAliveBJ(caster) and not IsUnitPaused(caster) ) then - call s__Aura_update(this,caster , newTargets) - endif - set caster=null - set i=i + 1 - endloop - - // remove old targets which are not part of new targets - call GroupRemoveGroup(newTargets, s__Aura_targets[this]) - set i=0 - set max=BlzGroupGetSize(s__Aura_targets[this]) - loop - exitwhen ( i == max ) - set target=BlzGroupUnitAt(s__Aura_targets[this], i) - //call BJDebugMsg("Remove aura " + GetObjectName(abilityId) + " target: " + GetUnitName(target)) - call UnitRemoveAbility(target, s__Aura_buffAbilityId[this]) - if ( s__Aura_effectAbilityId[this] != 0 ) then - call UnitRemoveAbility(target, s__Aura_effectAbilityId[this]) - endif - set target=null - set i=i + 1 - endloop - - // swap - call GroupClear(s__Aura_targets[this]) - call DestroyGroup(s__Aura_targets[this]) - set s__Aura_targets[this]=newTargets - endfunction - - function s__Aura_onDestroy takes integer this returns nothing - call GroupClear(s__Aura_casters[this]) - call DestroyGroup(s__Aura_casters[this]) - set s__Aura_casters[this]=null - - call GroupClear(s__Aura_targets[this]) - call DestroyGroup(s__Aura_targets[this]) - set s__Aura_targets[this]=null - endfunction -//Generated destructor of Aura -function s__Aura_deallocate takes integer this returns nothing - if this==null then - return - elseif (si__Aura_V[this]!=-1) then - return - endif - call s__Aura_onDestroy(this) - set si__Aura_V[this]=si__Aura_F - set si__Aura_F=this -endfunction - - function s__Aura_removeCasterFromAll takes unit caster returns nothing - local integer i= 0 - //call BJDebugMsg("Remove caster " + GetUnitName(caster)) - loop - exitwhen ( i == s__Aura_allAurasCounter ) - call GroupRemoveUnit(s__Aura_casters[s__s__Aura_allAuras[i]], caster) - set i=i + 1 - endloop - endfunction - - function s__Aura_getTotalCasters takes nothing returns integer - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i == s__Aura_allAurasCounter ) - set result=result + BlzGroupGetSize(s__Aura_casters[s__s__Aura_allAuras[i]]) - set i=i + 1 - endloop - return result - endfunction - - function s__Aura_updateAuraCasters takes nothing returns nothing - call s__Aura_updateAllCasters(AuraSystem___tmpAura) - endfunction - - function s__Aura_updateAllAuras takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == s__Aura_allAurasCounter ) - set AuraSystem___tmpAura=s__s__Aura_allAuras[i] - call ForForce(bj_FORCE_PLAYER[0], (function s__Aura_updateAuraCasters)) // INLINED!! - set i=i + 1 - endloop - endfunction -function AuraSystem___SaveAura takes integer abilityId,integer a returns nothing - call SaveInteger(AuraSystem___h, abilityId, 0, a) -endfunction -function AuraSystem___LoadAura takes integer abilityId returns integer - return LoadInteger(AuraSystem___h, abilityId, 0) -endfunction -function AuraSystem___TimerFunctionUpdateAuras takes nothing returns nothing - call s__Aura_updateAllAuras() -endfunction -function AddAura takes integer abilityId,integer buffAbilityId,integer effectAbilityId,integer filterFunction,real radius,boolean has_bonus_type,integer bonus_type,real bonus_amount,integer bonus_type2,real bonus_amount2 returns nothing - call SaveInteger(AuraSystem___h, (abilityId ), 0, ( s__Aura_create(abilityId , buffAbilityId , effectAbilityId , filterFunction , radius , has_bonus_type , bonus_type , bonus_amount , bonus_type2 , bonus_amount2))) // INLINED!! -endfunction -function AddAuraCaster takes unit caster,integer abilityId returns nothing - local integer aura= (LoadInteger(AuraSystem___h, (abilityId), 0)) // INLINED!! - if ( aura != 0 ) then - if ( s__Aura_getTotalCasters() == 0 ) then - call TimerStart(AuraSystem___t, AuraSystem_TIMER_UPDATE_INTERVAL, true, function AuraSystem___TimerFunctionUpdateAuras) - endif - call GroupAddUnit(s__Aura_casters[(aura)], (caster)) // INLINED!! - endif -endfunction -function RemoveAuraCaster takes unit caster returns nothing - call s__Aura_removeCasterFromAll(caster) - call s__Aura_updateAllAuras() // make sure we update one more time to remove effects - - if ( s__Aura_getTotalCasters() == 0 ) then - call PauseTimer(AuraSystem___t) - endif -endfunction -//processed hook: hook RemoveUnit RemoveAuraCaster -function SetAuraMaxTargets takes unit caster,integer abilityId,integer max returns nothing - local integer aura= (LoadInteger(AuraSystem___h, (abilityId), 0)) // INLINED!! - if ( aura != 0 ) then - call SaveInteger(AuraSystem___h, s__Aura_abilityId[(aura)], GetHandleId((caster )), ( max)) // INLINED!! - endif -endfunction -function AuraSystem___TriggerActionLearnSkill takes nothing returns nothing - call AddAuraCaster(GetTriggerUnit() , GetLearnedSkill()) -endfunction -function AuraSystem___TriggerActionUnlearn takes nothing returns nothing - //call BJDebugMsg("Remove hero caster for auras " + GetUnitName(GetTriggerUnskilledHero())) - call RemoveAuraCaster((HeroUtils___unskilledHero)) // INLINED!! -endfunction -function AuraSystem___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(AuraSystem___learnTrigger, EVENT_PLAYER_HERO_SKILL) - call TriggerAddAction(AuraSystem___learnTrigger, function AuraSystem___TriggerActionLearnSkill) - - call TriggerRegisterHeroUnskillEvent(AuraSystem___unlearnTrigger) - call TriggerAddAction(AuraSystem___unlearnTrigger, function AuraSystem___TriggerActionUnlearn) -endfunction -//library AuraSystem ends -//library HighElfDiurnal: -function EnableDiurnalEffect takes unit whichUnit returns nothing - if ( not IsUnitType(whichUnit, UNIT_TYPE_HERO) ) then - call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0D3', 1) - endif - call UnitAddAbility(whichUnit, 'A1IQ') - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH ) , (( 80.0 )*1.0) , ( 'B02L') , false) // INLINED!! - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH_REGEN ) , (( 0.4 )*1.0) , ( 'B02L') , false) // INLINED!! - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_ATTACK_SPEED ) , (( 0.1 )*1.0) , ( 'B02L') , false) // INLINED!! - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_MOVEMENT_SPEED ) , (( 80 )*1.0) , ( 'B02L') , false) // INLINED!! -endfunction -//library HighElfDiurnal ends -//library WoWReforgedOldHorde: -function RecreatOilPatchFromPlatform takes unit platform returns nothing - local unit mine= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'u031', GetUnitX(platform), GetUnitY(platform), bj_UNIT_FACING) - call SetResourceAmount(mine, (LoadInteger(Resources___h, GetHandleId((platform )), Resources___Index2D(( udg_ResourceOil) , Resources___KEY_RESOURCE , Resources___KEY_MAX)))) // INLINED!! -endfunction -// death event before resources are lost -function WoWReforgedOldHorde___TriggerConditionDeathResource takes nothing returns boolean - if ( GetUnitTypeId((Resources___triggerDyingResourceUnit)) == 'o07X' and (LoadInteger(Resources___h, GetHandleId(((Resources___triggerDyingResourceUnit) )), Resources___Index2D(( udg_ResourceOil) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! - call RecreatOilPatchFromPlatform((Resources___triggerDyingResourceUnit)) // INLINED!! - endif - return false -endfunction -function InitResourcesOldHorde takes nothing returns nothing - //call SetCosts('obot', udg_ResourceOil, 700) - //call SetCosts('odes', udg_ResourceOil, 700) - //call SetCosts('ojgn', udg_ResourceOil, 1000) - - call SetObjectTypeResourcesCosts(('o089' ) , ( udg_ResourceOil ) , ( 200)) // Stronghold // INLINED!! - call SetObjectTypeResourcesCosts(('o08A' ) , ( udg_ResourceOil ) , ( 500)) // Fortress // INLINED!! - call SetObjectTypeResourcesCosts(('o088' ) , ( udg_ResourceOil ) , ( 200)) // Oil Refinery // INLINED!! - - call SetResearchCostsForLevel('R0FB' , 0 , udg_ResourceOil , 1000) // Upgrade Cannons - call SetResearchCostsForLevel('R0FB' , 1 , udg_ResourceOil , 3000) // Upgrade Cannons - - // callbacks - call TriggerRegisterDeathResourceEvent(WoWReforgedOldHorde___deathResourceTrigger) - call TriggerAddCondition(WoWReforgedOldHorde___deathResourceTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionDeathResource)) -endfunction -function ForceUIBuildings takes unit worker returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - // we could also check if it is the only selected unit for the player who has shared control - if ( GetOwningPlayer(worker) == Player(i) or ( GetPlayerAlliance(GetOwningPlayer(worker), Player(i), ALLIANCE_SHARED_CONTROL) and IsUnitSelected(worker, Player(i)) ) ) then - call ForceUIKeyBJ(Player(i), "B") - endif - set i=i + 1 - endloop -endfunction -function AddOilTankerOldHorde takes unit worker returns nothing - call AddWorker(worker) - call SetUnitHarvestDuration(worker , udg_ResourceOil , 2.0) - call AddResourceToWorker(worker , udg_ResourceOil , 'A1PL' , "harvest" , 'A1PN' , "roar" , 'A1PO' , "robogoblin" , 100 , 100 , "gold") -endfunction -function AddShipyardOldHorde takes unit whichUnit returns nothing - call AddReturnBuildingEx(whichUnit , udg_ResourceOil) -endfunction -function AddOilPlatformEx takes unit worker,unit mine,integer oil returns nothing - call UnitRemoveAbility(mine, 'Aegm') - call AddMineEx(mine , udg_ResourceOil , oil) - call SetMineTakeWorkerInside(mine , true) - call SetMineMaxWorkers(mine , 1) - - // TODO the worker seems to be the mine itself. - //call ConstructedMine(worker, mine) -endfunction -function AddOilPlatform takes unit worker,unit mine returns nothing - call AddOilPlatformEx(worker , mine , 20000) -endfunction -function StartConstructingOilPlatform takes unit worker,unit mine returns nothing - call UnitRemoveAbility(mine, 'Aegm') -endfunction -function AddOilRefinery takes unit whichUnit returns nothing - set playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))] + 1 - call SetPlayerResourceBonus(GetOwningPlayer(whichUnit) , udg_ResourceOil , 25) - call AddReturnBuildingEx(whichUnit , udg_ResourceOil) -endfunction -function RemoveOilRefinery takes unit whichUnit returns nothing - set playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))] - 1 - if ( playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))] <= 0 ) then - call SetPlayerResourceBonus(GetOwningPlayer(whichUnit) , udg_ResourceOil , 0) - endif -endfunction -function AddTrollLumberMill takes unit whichUnit returns nothing - set playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))] + 1 - call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0FD', 1) -endfunction -function RemoveTrollLumberMill takes unit whichUnit returns nothing - set playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))] - 1 - if ( playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))] <= 0 ) then - call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0FD', 0) - endif -endfunction -function IsDeathCoilDummy takes unit dummy returns boolean - return IsUnitInGroup(dummy, WoWReforgedOldHorde___deathCoilDummies) -endfunction -function GetDeathCoilCaster takes unit dummy returns unit - return LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId(dummy), 0) -endfunction -function SaveDeathCoilCaster takes unit dummy,unit caster returns nothing - call SaveUnitHandle(WoWReforgedOldHorde___h, GetHandleId(dummy), 0, caster) - call GroupAddUnit(WoWReforgedOldHorde___deathCoilDummies, dummy) -endfunction -function RemoveDeathCoilDummy takes unit dummy returns nothing - call FlushChildHashtable(WoWReforgedOldHorde___h, GetHandleId(dummy)) - call GroupRemoveUnit(WoWReforgedOldHorde___deathCoilDummies, dummy) -endfunction -// restart existing timers -function WoWReforgedOldHorde___GetNewUnholyArmorTimer takes unit target returns timer - local timer t= LoadTimerHandle(WoWReforgedOldHorde___h, GetHandleId(target), 0) - - if ( t != null ) then - call PauseTimer(t) - return t - endif - - return CreateTimer() -endfunction -function WoWReforgedOldHorde___TimerFunctionUnholyArmorEnd takes nothing returns nothing - local timer t= GetExpiredTimer() - local integer handleId= GetHandleId(t) - local unit target= LoadUnitHandle(WoWReforgedOldHorde___h, handleId, 0) - call UnitRemoveAbility(target, 'A1TS') - set target=null - call RemoveSavedHandle(WoWReforgedOldHorde___h, GetHandleId(target), 1) - call FlushChildHashtable(WoWReforgedOldHorde___h, handleId) - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function UnholyArmor takes unit target returns nothing - local timer t= WoWReforgedOldHorde___GetNewUnholyArmorTimer(target) - call UnitAddAbility(target, 'A1TS') - call SaveUnitHandle(WoWReforgedOldHorde___h, GetHandleId(t), 0, target) - call SaveTimerHandle(WoWReforgedOldHorde___h, GetHandleId(target), 1, t) - call TimerStart(t, 10.0, false, function WoWReforgedOldHorde___TimerFunctionUnholyArmorEnd) - - call sc__NewBonusUtils_linkBuff((target ) , ( BONUS_ARMOR ) , (( 30.0 )*1.0) , ( 'B03K') , false) // INLINED!! - call sc__NewBonusUtils_linkTimed((target ) , ( BONUS_ARMOR ) , (( 30.0 )*1.0) , (( 12.0)*1.0) , true) // INLINED!! -endfunction -function WoWReforgedOldHorde___AddSummonedUnitToDeathKnight takes unit caster,unit summoned returns nothing - local integer handleId= GetHandleId(caster) - local group g= LoadGroupHandle(WoWReforgedOldHorde___h, handleId, 2) - local unit first= null - if ( g == null ) then - set g=CreateGroup() - endif - if ( BlzGroupGetSize(g) >= 5 ) then - set first=FirstOfGroup(g) - call KillUnit(first) - call GroupRemoveUnit(g, first) - set first=null - endif - call GroupAddUnit(g, summoned) - call SaveGroupHandle(WoWReforgedOldHorde___h, handleId, 2, g) - call SaveUnitHandle(WoWReforgedOldHorde___h, GetHandleId(summoned), 0, caster) -endfunction -function WoWReforgedOldHorde___GetSummonedUnitDeathKnight takes unit summoned returns unit - return LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId(summoned), 0) -endfunction -function WoWReforgedOldHorde___RemoveSummonedUnitFromDeathKnight takes unit caster,unit summoned returns nothing - local integer handleId= GetHandleId(caster) - local group g= LoadGroupHandle(WoWReforgedOldHorde___h, handleId, 2) - if ( g != null ) then - call GroupRemoveUnit(g, summoned) - endif - call FlushChildHashtable(WoWReforgedOldHorde___h, GetHandleId(summoned)) -endfunction -function WoWReforgedOldHorde___RemoveDeathKnight takes unit caster returns nothing - local integer handleId= GetHandleId(caster) - local group g= LoadGroupHandle(WoWReforgedOldHorde___h, handleId, 2) - if ( g != null ) then - call GroupClear(g) - call DestroyGroup(g) - endif - call FlushChildHashtable(WoWReforgedOldHorde___h, handleId) -endfunction -function WoWReforgedOldHorde___Heal takes unit target,real life returns nothing - call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_MAX_LIFE), GetUnitState(target, UNIT_STATE_LIFE) + life)) -endfunction -function WoWReforgedOldHorde___TriggerConditionDamage takes nothing returns boolean - if ( (IsUnitInGroup((GetEventDamageSource()), WoWReforgedOldHorde___deathCoilDummies)) ) then // INLINED!! - call WoWReforgedOldHorde___Heal((LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId((GetEventDamageSource())), 0)) , GetEventDamage()) // INLINED!! - endif - - if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A1TS') > 0 ) then - call WoWReforgedOldHorde___Heal(GetTriggerUnit() , GetEventDamage()) - endif - - return false -endfunction -function WoWReforgedOldHorde___TriggerConditionSummon takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == 'o07L' and GetUnitTypeId(GetSummonedUnit()) == 'uske' ) then - call WoWReforgedOldHorde___AddSummonedUnitToDeathKnight(GetTriggerUnit() , GetSummonedUnit()) - endif - - return false -endfunction -function WoWReforgedOldHorde___TriggerConditionDeath takes nothing returns boolean - local unit deathKnight= (LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId((GetTriggerUnit())), 0)) // INLINED!! - if ( deathKnight != null ) then - call WoWReforgedOldHorde___RemoveSummonedUnitFromDeathKnight(deathKnight , GetTriggerUnit()) - elseif ( GetUnitTypeId(GetTriggerUnit()) == 'o07L' ) then - call WoWReforgedOldHorde___RemoveDeathKnight(GetTriggerUnit()) - endif - - return false -endfunction -function WoWReforgedOldHorde___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedOldHorde___damageTrigger, EVENT_PLAYER_UNIT_DAMAGED) - call TriggerAddCondition(WoWReforgedOldHorde___damageTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionDamage)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedOldHorde___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedOldHorde___summonTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionSummon)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedOldHorde___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedOldHorde___deathTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionDeath)) -endfunction -function WoWReforgedOldHorde___RemoveDeathKnightHook takes unit whichUnit returns nothing - if ( GetUnitTypeId(whichUnit) == 'o07L' ) then - call WoWReforgedOldHorde___RemoveDeathKnight(whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit WoWReforgedOldHorde___RemoveDeathKnightHook -//library WoWReforgedOldHorde ends -//library WorgenNocturnal: -function EnableNocturnalEffect takes unit whichUnit returns nothing - if ( not IsUnitType(whichUnit, UNIT_TYPE_HERO) ) then - call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0C1', 1) - endif - call UnitAddAbility(whichUnit, 'A1ER') - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH ) , (( 80.0 )*1.0) , ( 'B02L') , false) // INLINED!! - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH_REGEN ) , (( 0.4 )*1.0) , ( 'B02L') , false) // INLINED!! - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_ATTACK_SPEED ) , (( 0.1 )*1.0) , ( 'B02L') , false) // INLINED!! - call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_MOVEMENT_SPEED ) , (( 80 )*1.0) , ( 'B02L') , false) // INLINED!! -endfunction -//library WorgenNocturnal ends -//library WowReforgedCook: -function GetRandomFoodItemTypeId takes nothing returns integer - return WowReforgedCook__foodItemTypeIds[GetRandomInt(0, WowReforgedCook__foodItemTypeIdsCounter - 1)] -endfunction -function IsFood takes integer itemTypeId returns boolean - local integer i= 0 - loop - exitwhen ( i == WowReforgedCook__foodItemTypeIdsCounter ) - if ( itemTypeId == WowReforgedCook__foodItemTypeIds[i] ) then - return true - endif - set i=i + 1 - endloop - return false -endfunction -function AddFoodItemTypeId takes integer itemTypeId returns nothing - set WowReforgedCook__foodItemTypeIds[WowReforgedCook__foodItemTypeIdsCounter]=itemTypeId - set WowReforgedCook__foodItemTypeIdsCounter=WowReforgedCook__foodItemTypeIdsCounter + 1 -endfunction -function AddCookFirePit takes unit whichUnit returns nothing - local integer i= 0 - local integer max= udg_RecipeCooking - call EnableItemCraftingUnit(whichUnit) - loop - exitwhen ( i >= max ) - call SetItemCraftingRecipeEnabled(whichUnit , i , false) - set i=i + 1 - endloop - //call SetItemCraftingRecipeEnabled(whichUnit, udg_RecipeHolyGrail, false) - - //call SetPagedButtonsPage(whichUnit, GetRecipePage(udg_RecipeCooking)) -endfunction -function WarriorsMenu takes unit hero returns nothing - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_STRENGTH ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_DAMAGE ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_HEALTH ) , (( 100.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_HEALTH_REGEN ) , (( 0.3 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! -endfunction -function RangersMenu takes unit hero returns nothing - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_AGILITY ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_ARMOR ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MOVEMENT_SPEED ) , (( 100.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_ATTACK_SPEED ) , (( 0.3 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! -endfunction -function MagiciansMenu takes unit hero returns nothing - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_INTELLIGENCE ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MAGIC_RESISTANCE ) , (( 30.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MANA ) , (( 100.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! - call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MANA_REGEN ) , (( 0.3 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! -endfunction -function IsItemTypeIdCookingRecipe takes integer itemTypeId returns boolean - local integer i= 0 - local integer max= udg_RecipeCooking - loop - exitwhen ( i == max ) - if ( itemTypeId == (Crafting___recipesItemTypeIds[(i)]) ) then // INLINED!! - return true - endif - set i=i + 1 - endloop - return false -endfunction -function WowReforgedCook__ShowRecipesFloatingText takes unit hero,item whichItem,integer recipes returns nothing - local force whichForce= CreateForce() - call ForceAddPlayer(whichForce, GetOwningPlayer(hero)) - call ShowFadingTextTagForForce((whichForce ) , ( "+" + I2S(recipes) + " " + GetItemName(whichItem) ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 0 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! - call ForceClear(whichForce) - call DestroyForce(whichForce) - set whichForce=null -endfunction -function CraftItemCook takes unit crafter,item whichItem returns nothing - local integer recipes= CountItemsOfItemTypeId(crafter , ITEM_TYPE_ID_RECIPE) - //call BJDebugMsg("Recipes " + I2S(recipes)) - if ( recipes > 0 ) then - if ( IsItemTypeIdCookingRecipe(GetItemTypeId(whichItem)) ) then - //call BJDebugMsg("Is cooking recipe") - call SetItemCharges(whichItem, GetItemCharges(whichItem) + recipes) - call RemoveAllItemsOfTypeId(crafter , ITEM_TYPE_ID_RECIPE) - call WowReforgedCook__ShowRecipesFloatingText(crafter , whichItem , recipes) - else - //call BJDebugMsg("Is no cooking recipe") - endif - endif -endfunction -function CookCutKitchenKnife takes unit hero,item whichItem returns nothing - if ( IsFood(GetItemTypeId(whichItem)) ) then - call SetItemCharges(whichItem, GetItemCharges(whichItem) + 1) - else - call IssueImmediateOrder(hero, "stop") - call SimError(GetOwningPlayer(hero) , "Target item must be food.") - endif -endfunction -function WowReforgedCook__Init takes nothing returns nothing - call AddFoodItemTypeId(ITEM_TYPE_ID_GARLIC) - call AddFoodItemTypeId(ITEM_TYPE_ID_BANANA) - call AddFoodItemTypeId(ITEM_TYPE_ID_ORANGE) - call AddFoodItemTypeId(ITEM_TYPE_ID_LEMON) - call AddFoodItemTypeId(ITEM_TYPE_ID_MEAT) -endfunction -//library WowReforgedCook ends -//library WoWReforgedUtils: -function WoWReforgedUtils___IsTownHallFilter takes nothing returns boolean - return IsUnitType(GetFilterUnit(), UNIT_TYPE_TOWNHALL) and IsUnitAliveBJ(GetFilterUnit()) -endfunction -function GetNextUnitToSelect takes group g,player whichPlayer returns unit - local integer max= BlzGroupGetSize(g) - local integer i= 0 - local unit u= null - local unit result= null - local boolean found= false - if ( max > 0 ) then - loop - exitwhen ( i == max ) - set u=BlzGroupUnitAt(g, i) - if ( IsUnitSelected(u, whichPlayer) ) then - set found=true - elseif ( found ) then - set result=u - endif - set u=null - set i=i + 1 - endloop - - // this happens if none of them is selected or the last one - if ( result == null ) then - set result=BlzGroupUnitAt(g, 0) // start at first - endif - endif - - return result -endfunction -function SelectNextTownHall takes player whichPlayer returns unit - local group halls= CreateGroup() - local unit result= null - call GroupEnumUnitsOfPlayer(halls, whichPlayer, Filter(function WoWReforgedUtils___IsTownHallFilter)) - set result=GetNextUnitToSelect(halls , whichPlayer) - call GroupClear(halls) - call DestroyGroup(halls) - set halls=null - - if ( result != null ) then - call SelectUnitForPlayerSingle(result, whichPlayer) - call SmartCameraPanToUnit(whichPlayer , result , 0.0) - else - call SimError(whichPlayer , "No town halls.") - endif - - return result -endfunction -function SetTechMaxAllowed takes integer id,integer maximum returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - call SetPlayerTechMaxAllowed(Player(i), id, maximum) - set i=i + 1 - endloop -endfunction -function FilterPlayerFunctionUsedUser takes nothing returns boolean - return GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER and GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING -endfunction -function IsInSinglePlayer takes nothing returns boolean - // cache it to avoid too many calls since it won't change during the game - if ( not WoWReforgedUtils___initialized ) then - //return CountPlayersInForceBJ(GetPlayersMatching(Condition(function FilterPlayerFunctionUsedUser))) == 1 - // https://www.hiveworkshop.com/threads/how-to-detect-single-player.161490/ - // https://www.hiveworkshop.com/threads/how-to-detect-single-player.161490/#post-1512734 - // Even works when all players except one have left the game: - set WoWReforgedUtils___isInSinglePlayer=ReloadGameCachesFromDisk() - set WoWReforgedUtils___initialized=true - endif - - return WoWReforgedUtils___isInSinglePlayer -endfunction -function GetUnitBaseLevel takes unit whichUnit returns integer - return GetUnitLevelByType(GetUnitTypeId(whichUnit) , GetOwningPlayer(whichUnit)) -endfunction -function IsPlayerFreelancer takes player whichPlayer returns boolean - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - return not udg_PlayerIsWarlord[convertedPlayerId] -endfunction -function IsPlayerWarlord takes player whichPlayer returns boolean - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - return udg_PlayerIsWarlord[convertedPlayerId] -endfunction -function PlayerHasUnlockedRace takes player whichPlayer,integer whichRace returns boolean - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - return whichRace == udg_RaceNone or udg_PlayerUnlockedAllRaces[convertedPlayerId] or whichRace == udg_PlayerRace[convertedPlayerId] or whichRace == udg_PlayerRace2[convertedPlayerId] or udg_UnlockedAll -endfunction -function SetPlayerHero1 takes player whichPlayer,unit hero returns nothing - set udg_Hero[GetPlayerId(whichPlayer)]=hero - set udg_Held[GetConvertedPlayerId(whichPlayer)]=hero -endfunction -function GetPlayerHero1 takes player whichPlayer returns unit - return udg_Hero[GetPlayerId(whichPlayer)] -endfunction -function SetPlayerHero2 takes player whichPlayer,unit hero returns nothing - set udg_Hero2[GetPlayerId(whichPlayer)]=hero - set udg_Held2[GetConvertedPlayerId(whichPlayer)]=hero -endfunction -function GetPlayerHero2 takes player whichPlayer returns unit - return udg_Hero2[GetPlayerId(whichPlayer)] -endfunction -function SetPlayerHero3 takes player whichPlayer,unit hero returns nothing - set udg_Hero3[GetPlayerId(whichPlayer)]=hero - set udg_Held3[GetConvertedPlayerId(whichPlayer)]=hero -endfunction -function GetPlayerHero3 takes player whichPlayer returns unit - return udg_Hero3[GetPlayerId(whichPlayer)] -endfunction -function GetLivingPlayerHero takes player whichPlayer returns unit - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null and IsUnitAliveBJ((udg_Hero[GetPlayerId((whichPlayer))])) ) then // INLINED!! - return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! - endif - - if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null and IsUnitAliveBJ((udg_Hero2[GetPlayerId((whichPlayer))])) ) then // INLINED!! - return (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! - endif - - if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null and IsUnitAliveBJ((udg_Hero3[GetPlayerId((whichPlayer))])) ) then // INLINED!! - return (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! - endif - - return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! -endfunction -function IsPlayerHero1 takes unit hero returns boolean - return (udg_Hero[GetPlayerId((GetOwningPlayer(hero)))]) == hero // INLINED!! -endfunction -function IsPlayerHero takes unit hero returns boolean - local player owner= GetOwningPlayer(hero) - local boolean result= (udg_Hero[GetPlayerId((owner))]) == hero or (udg_Hero2[GetPlayerId((owner))]) == hero or (udg_Hero3[GetPlayerId((owner))]) == hero // INLINED!! - set owner=null - return result -endfunction -function GetPlayerHeroes takes player whichPlayer returns group - local group heroes= CreateGroup() - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call GroupAddUnit(heroes, (udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - endif - if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call GroupAddUnit(heroes, (udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! - endif - if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call GroupAddUnit(heroes, (udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! - endif - return heroes -endfunction -function GetPlayerHeroIndex takes player whichPlayer,unit hero returns integer - if ( (udg_Hero[GetPlayerId((whichPlayer))]) == hero ) then // INLINED!! - return 0 - elseif ( (udg_Hero2[GetPlayerId((whichPlayer))]) == hero ) then // INLINED!! - return 1 - elseif ( (udg_Hero3[GetPlayerId((whichPlayer))]) == hero ) then // INLINED!! - return 2 - endif - - return - 1 -endfunction -function GetPlayerHeroByIndex takes player whichPlayer,integer index returns unit - if ( index == 0 ) then - return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! - elseif ( index == 1 ) then - return (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! - elseif ( index == 2 ) then - return (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! - endif - - return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! -endfunction -function ReplaceHero takes unit hero,integer newUnitId,integer unitStateMethod,boolean keepAttributes,boolean keepAttributesPerLevel returns unit - local integer sourceHandleId= GetHandleId(hero) - local integer targetHandleId= 0 - local player owner= GetOwningPlayer(hero) - local boolean isHero1= (udg_Hero[GetPlayerId((owner))]) == hero // INLINED!! - local boolean isHero2= (udg_Hero2[GetPlayerId((owner))]) == hero // INLINED!! - local boolean isHero3= (udg_Hero3[GetPlayerId((owner))]) == hero // INLINED!! - local integer str= GetHeroStr(hero, false) - local integer agi= GetHeroAgi(hero, false) - local integer int= GetHeroInt(hero, false) - local real strPerLevel= BlzGetUnitRealField(hero, UNIT_RF_STRENGTH_PER_LEVEL) - local real agiPerLevel= BlzGetUnitRealField(hero, UNIT_RF_AGILITY_PER_LEVEL) - local real intPerLevel= BlzGetUnitRealField(hero, UNIT_RF_INTELLIGENCE_PER_LEVEL) - local unit result= null - - call CopyHeroLevelGainData(sourceHandleId , 0) - call CopyUnitAttributeData(udg_AttributeAttributePoints , sourceHandleId , 0) - call DisableTrigger(gg_trg_Attributes_Skill_Points_Level_Up) - set result=ReplaceUnitBJ(hero, newUnitId, unitStateMethod) - call EnableTrigger(gg_trg_Attributes_Skill_Points_Level_Up) - - set targetHandleId=GetHandleId(result) - call CopyHeroLevelGainData(0 , targetHandleId) - call CopyUnitAttributeData(udg_AttributeAttributePoints , 0 , targetHandleId) - - if ( keepAttributes ) then - call SetHeroStr(result, str, true) - call SetHeroAgi(result, agi, true) - call SetHeroInt(result, int, true) - endif - - if ( keepAttributesPerLevel ) then - call BlzSetUnitRealField(result, UNIT_RF_STRENGTH_PER_LEVEL, strPerLevel) - call BlzSetUnitRealField(result, UNIT_RF_AGILITY_PER_LEVEL, agiPerLevel) - call BlzSetUnitRealField(result, UNIT_RF_INTELLIGENCE_PER_LEVEL, intPerLevel) - endif - - if ( isHero1 ) then - call SetPlayerHero1(owner , result) - endif - - if ( isHero2 ) then - call SetPlayerHero2(owner , result) - endif - - if ( isHero3 ) then - call SetPlayerHero3(owner , result) - endif - - return result -endfunction -function GetSelectedForce takes unit hero returns force - local force whichForce= CreateForce() - local player slotPlayer= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( IsUnitSelected(hero, slotPlayer) ) then - call ForceAddPlayer(whichForce, slotPlayer) - endif - set slotPlayer=null - set i=i + 1 - endloop - return whichForce -endfunction -function GetLivingHero takes player whichPlayer returns unit - if ( IsUnitAliveBJ((udg_Hero[GetPlayerId((whichPlayer))])) ) then // INLINED!! - return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! - elseif ( IsUnitAliveBJ((udg_Hero2[GetPlayerId((whichPlayer))])) ) then // INLINED!! - return (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! - elseif ( IsUnitAliveBJ((udg_Hero3[GetPlayerId((whichPlayer))])) ) then // INLINED!! - return (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! - endif - - return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! -endfunction -function GetPlayerEquipmentBags takes player whichPlayer returns group - return udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)] -endfunction -function GetHeroLevelMaxXP takes integer heroLevel returns integer - local integer result= 0 - local integer i= 3 - loop - exitwhen ( i > heroLevel + 1 ) - set result=result + i * 1000 - set i=i + 1 - endloop - return result -endfunction -function GetHeroLevelByXP takes integer xp returns integer - local integer heroLevel= 1 - local integer i= 3 - loop - set xp=xp - i * 1000 - exitwhen ( xp < 0 ) - set heroLevel=heroLevel + 1 - set i=i + 1 - endloop - return heroLevel -endfunction -function GetHeroLevel1 takes player whichPlayer returns integer - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held[playerId] != null ) then - return GetHeroLevel(udg_Held[playerId]) - endif - return GetHeroLevelByXP(udg_CharacterStartXP[playerId]) -endfunction -function GetHeroXP1 takes player whichPlayer returns integer - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held[playerId] != null ) then - return GetHeroXP(udg_Held[playerId]) - endif - return udg_CharacterStartXP[playerId] -endfunction -function AddHeroXP1 takes player whichPlayer,integer xpToAdd,boolean showEyeCandy returns nothing - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held[playerId] != null ) then - call AddHeroXP(udg_Held[playerId], xpToAdd, showEyeCandy) - else - set udg_CharacterStartXP[playerId]=udg_CharacterStartXP[playerId] + xpToAdd - endif -endfunction -function GetHeroLevel2 takes player whichPlayer returns integer - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held2[playerId] != null ) then - return GetHeroLevel(udg_Held2[playerId]) - endif - return GetHeroLevelByXP(udg_Held2XP[playerId]) -endfunction -function GetHeroXP2 takes player whichPlayer returns integer - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held2[playerId] != null ) then - return GetHeroXP(udg_Held2[playerId]) - endif - return udg_Held2XP[playerId] -endfunction -function AddHeroXP2 takes player whichPlayer,integer xpToAdd,boolean showEyeCandy returns nothing - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held2[playerId] != null ) then - call AddHeroXP(udg_Held2[playerId], xpToAdd, showEyeCandy) - else - set udg_Held2XP[playerId]=udg_Held2XP[playerId] + xpToAdd - endif -endfunction -function GetHeroLevel3 takes player whichPlayer returns integer - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held3[playerId] != null ) then - return GetHeroLevel(udg_Held3[playerId]) - endif - return GetHeroLevelByXP(udg_Held3XP[playerId]) -endfunction -function GetHeroXP3 takes player whichPlayer returns integer - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held3[playerId] != null ) then - return GetHeroXP(udg_Held3[playerId]) - endif - return udg_Held3XP[playerId] -endfunction -function AddHeroXP3 takes player whichPlayer,integer xpToAdd,boolean showEyeCandy returns nothing - local integer playerId= GetConvertedPlayerId(whichPlayer) - if ( udg_Held3[playerId] != null ) then - call AddHeroXP(udg_Held3[playerId], xpToAdd, showEyeCandy) - else - set udg_Held3XP[playerId]=udg_Held3XP[playerId] + xpToAdd - endif -endfunction -function GetHighestHeroLevel takes player whichPlayer returns integer - local integer heroLevel1= GetHeroLevel1(whichPlayer) - local integer heroLevel2= GetHeroLevel2(whichPlayer) - local integer heroLevel3= GetHeroLevel3(whichPlayer) - if ( heroLevel1 >= heroLevel2 and heroLevel1 >= heroLevel3 ) then - return heroLevel1 - elseif ( heroLevel2 >= heroLevel1 and heroLevel2 >= heroLevel3 ) then - return heroLevel2 - endif - return heroLevel3 -endfunction -function GetHighestHeroLevelFromAllPlayingUsers takes nothing returns integer - local player whichPlayer= null - local integer heroLevel= 0 - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set whichPlayer=Player(i) - if ( GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING ) then - set heroLevel=GetHighestHeroLevel(whichPlayer) - if ( heroLevel > result ) then - set result=heroLevel - endif - endif - set whichPlayer=null - set i=i + 1 - endloop - return result -endfunction -function GetLowestHeroLevel takes player whichPlayer returns integer - local integer playerId= GetConvertedPlayerId(whichPlayer) - local integer heroLevel1= GetHeroLevel1(whichPlayer) - local integer heroLevel2= GetHeroLevel2(whichPlayer) - local integer heroLevel3= GetHeroLevel3(whichPlayer) - if ( heroLevel1 < heroLevel2 and heroLevel1 < heroLevel3 ) then - return heroLevel1 - elseif ( heroLevel2 < heroLevel1 and heroLevel2 < heroLevel3 ) then - return heroLevel2 - endif - return heroLevel3 -endfunction -function GetLowestHeroLevelFromAllPlayingUsers takes nothing returns integer - local player whichPlayer= null - local integer heroLevel= 0 - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set whichPlayer=Player(i) - if ( GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING ) then - set heroLevel=GetLowestHeroLevel(whichPlayer) - if ( heroLevel < result ) then - set result=heroLevel - endif - endif - set whichPlayer=null - set i=i + 1 - endloop - return result -endfunction -function GetLowestHeroLevel1FromAllPlayingUsers takes nothing returns integer - local player whichPlayer= null - local integer heroLevel= 0 - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set whichPlayer=Player(i) - if ( GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING ) then - set heroLevel=GetHeroLevel1(whichPlayer) - if ( result == 0 or heroLevel < result ) then - set result=heroLevel - endif - endif - set whichPlayer=null - set i=i + 1 - endloop - return result -endfunction -function SaveTriggerParameterInteger takes handle Trigger,integer ParameterKey,integer Value returns nothing - call SaveInteger(udg_DB, GetHandleId(Trigger), ParameterKey, Value) -endfunction -function LoadTriggerParameterInteger takes handle Trigger,integer ParameterKey returns integer - return LoadInteger(udg_DB, GetHandleId(Trigger), ParameterKey) -endfunction -function TriggerParameterIntegerExists takes handle Trigger,integer ParameterKey returns boolean - return HaveSavedInteger(udg_DB, GetHandleId(Trigger), ParameterKey) -endfunction -function DestroyParameterTrigger takes trigger Trigger returns nothing - call FlushChildHashtable(udg_DB, GetHandleId(Trigger)) - call DestroyTrigger(Trigger) -endfunction -function SaveUnitParameterInteger takes unit whichUnit,integer ParameterKey,integer Value returns nothing - call SaveInteger(udg_DB, GetHandleId(whichUnit), ParameterKey, Value) -endfunction -function LoadUnitParameterInteger takes unit whichUnit,integer ParameterKey returns integer - return LoadInteger(udg_DB, GetHandleId(whichUnit), ParameterKey) -endfunction -function UnitParameterIntegerExists takes unit whichUnit,integer ParameterKey returns boolean - return HaveSavedInteger(udg_DB, GetHandleId(whichUnit), ParameterKey) -endfunction -function SaveDestructableParameterInteger takes destructable whichDestructable,integer ParameterKey,integer Value returns nothing - call SaveInteger(udg_DB, GetHandleId(whichDestructable), ParameterKey, Value) -endfunction -function LoadDestructableParameterInteger takes destructable whichDestructable,integer ParameterKey returns integer - return LoadInteger(udg_DB, GetHandleId(whichDestructable), ParameterKey) -endfunction -function DestructableParameterIntegerExists takes destructable whichDestructable,integer ParameterKey returns boolean - return HaveSavedInteger(udg_DB, GetHandleId(whichDestructable), ParameterKey) -endfunction -function FlushUnitParameters takes unit whichUnit returns nothing - call FlushChildHashtable(udg_DB, GetHandleId(whichUnit)) -endfunction -function PlayerIsOnlineUser takes integer playerId returns boolean - local player whichPlayer= Player(playerId) - local boolean result= GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING - set whichPlayer=null - return result -endfunction -function DropAllItemsFromHero takes unit hero returns integer - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i >= bj_MAX_INVENTORY ) - if ( UnitItemInSlot(hero, i) != null ) then - call UnitRemoveItemFromSlot(hero, i) - set result=result + 1 - endif - set i=i + 1 - endloop - return result -endfunction -function DropAllItemsFromHero1 takes player whichPlayer returns integer - return DropAllItemsFromHero(udg_Hero[GetPlayerId(whichPlayer)]) -endfunction -function DropAllItemsFromHero2 takes player whichPlayer returns integer - return DropAllItemsFromHero(udg_Hero2[GetPlayerId(whichPlayer)]) -endfunction -function DropAllItemsFromHero3 takes player whichPlayer returns integer - return DropAllItemsFromHero(udg_Hero3[GetPlayerId(whichPlayer)]) -endfunction -function IsHauntedGoldMine takes integer unitTypeId returns boolean - if ( unitTypeId == UNDEAD_MINE ) then - return true - elseif ( unitTypeId == ELF_MINE ) then - return true - elseif ( unitTypeId == DWARF_MINE ) then - return true - elseif ( unitTypeId == DWARF_MINE_2 ) then - return true - elseif ( unitTypeId == DWARF_MINE_3 ) then - return true - elseif ( unitTypeId == DALARAN_MINE ) then - return true - elseif ( unitTypeId == SATYR_MINE ) then - return true - endif - - return false -endfunction -function WoWReforgedUtils___FilterFunctionIsHauntedGoldMine takes nothing returns boolean - return IsHauntedGoldMine(GetUnitTypeId(GetFilterUnit())) -endfunction -function WoWReforgedUtils___ForFunctionKillUnit takes nothing returns nothing - call KillUnit(GetEnumUnit()) -endfunction -function KillAllHauntedGoldMines takes player whichPlayer returns nothing - set bj_wantDestroyGroup=true - call ForGroupBJ(GetUnitsOfPlayerMatching(whichPlayer, Filter(function WoWReforgedUtils___FilterFunctionIsHauntedGoldMine)), function WoWReforgedUtils___ForFunctionKillUnit) -endfunction -function EnumLivingTreeDestructablesInCircleFilter takes nothing returns boolean - local boolean result= IsDestructableAliveBJ(GetFilterDestructable()) and (IsTree(GetDestructableTypeId((GetFilterDestructable())))) // INLINED!! - local location destLoc= null - if ( result ) then - set destLoc=GetDestructableLoc(GetFilterDestructable()) - set result=DistanceBetweenPoints(destLoc, bj_enumDestructableCenter) <= bj_enumDestructableRadius - call RemoveLocation(destLoc) - set destLoc=null - endif - return result -endfunction -function RandomLivingTreeDestructableInCircle takes real radius,location loc returns destructable - local boolexpr whichFilter= Filter(function EnumLivingTreeDestructablesInCircleFilter) - local rect r - if ( radius >= 0 ) then - set bj_enumDestructableCenter=loc - set bj_enumDestructableRadius=radius - set bj_destRandomConsidered=0 - set bj_destRandomCurrentPick=null - set r=GetRectFromCircleBJ(loc, radius) - call EnumDestructablesInRect(r, whichFilter, function RandomDestructableInRectBJEnum) - call RemoveRect(r) - set r=null - endif - call h__DestroyBoolExpr(whichFilter) - set whichFilter=null - return bj_destRandomCurrentPick -endfunction -function LoadTOCFiles takes nothing returns nothing - call BlzLoadTOCFile("war3mapImported\\wowrTOC.toc") -endfunction -function AddRecipeWoWReforged takes nothing returns integer - set udg_TmpInteger=AddRecipe(udg_TmpItemTypeId , udg_TmpItemTypeId2) - set udg_TmpInteger2=1 - return udg_TmpInteger -endfunction -function AddRecipeUnitWoWReforged takes nothing returns integer - set udg_TmpInteger=AddRecipe(udg_TmpUnitType , udg_TmpItemTypeId2) - set Crafting___recipesIsUnit[(udg_TmpInteger )]=( true) // INLINED!! - set udg_TmpInteger2=1 - return udg_TmpInteger -endfunction -function AddRecipeRequirementWoWReforged takes nothing returns integer - local integer requirement= AddRecipeRequirementItem(udg_TmpInteger , udg_TmpItemTypeId , udg_TmpInteger2 , false) - set udg_TmpInteger2=1 - return requirement -endfunction -function AddRecipeRequirementWoWReforgedNonConsuming takes nothing returns integer - local integer requirement= AddRecipeRequirementItem(udg_TmpInteger , udg_TmpItemTypeId , udg_TmpInteger2 , true) - set udg_TmpInteger2=1 - return requirement -endfunction -function SetRecipeMinRequirementsWoWReforged takes nothing returns nothing - set Crafting___recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! -endfunction -function IsWall takes integer buildingId returns boolean - return buildingId == WALL -endfunction -function AddWoWReforgedTinyBuildingItem takes nothing returns nothing - call SaveInteger(TinyBuildingsLimits___h, (udg_TmpAbilityCode ), 0, ( udg_TmpUnitType)) // INLINED!! -endfunction -function WoWReforgedUtils___FilterIsGivableUnit takes nothing returns boolean - return GetOwningPlayer(GetFilterUnit()) == WoWReforgedUtils___tmpPlayer and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_PEON) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') <= 0 -endfunction -function UpdateGiveUnitsForPlayer takes player whichPlayer,real x,real y returns nothing - local integer playerId= GetConvertedPlayerId(whichPlayer) - set WoWReforgedUtils___tmpPlayer=whichPlayer - call GroupClear(udg_GivenUnitsToFreelancer[playerId]) - call GroupEnumUnitsInRange(udg_GivenUnitsToFreelancer[playerId], x, y, 512.0, Filter(function WoWReforgedUtils___FilterIsGivableUnit)) -endfunction -function InitTmpLocations takes nothing returns nothing - if udg_TmpLocation == null then - set udg_TmpLocation=Location(0.0, 0.0) - endif - - if udg_TmpLocation2 == null then - set udg_TmpLocation2=Location(0.0, 0.0) - endif -endfunction -function MoveTmpLocationToUnit takes unit whichUnit returns nothing - call InitTmpLocations() - call MoveLocationToUnit(udg_TmpLocation , whichUnit) -endfunction -function MoveTmpLocation takes real x,real y returns nothing - call InitTmpLocations() - call MoveLocation(udg_TmpLocation, x, y) -endfunction -function MoveTmpLocationToRect takes rect whichRect returns nothing - call InitTmpLocations() - call MoveLocation(udg_TmpLocation, GetRectCenterX(whichRect), GetRectCenterY(whichRect)) -endfunction -function MoveTmpLocationToDestructable takes destructable d returns nothing - call InitTmpLocations() - call MoveLocation(udg_TmpLocation, GetDestructableX(d), GetDestructableY(d)) -endfunction -function MoveTmpLocationToPolarProjectionOfUnit takes unit whichUnit,real face,real distance returns nothing - call InitTmpLocations() - call MoveLocation(udg_TmpLocation, PolarProjectionX(GetUnitX(whichUnit) , face , distance), PolarProjectionY(GetUnitY(whichUnit) , face , distance)) -endfunction -function MoveTmpLocationToRandomPointInRect takes rect whichRect returns nothing - call InitTmpLocations() - call MoveLocation(udg_TmpLocation, GetRandomReal(GetRectMinX(whichRect), GetRectMaxX(whichRect)), GetRandomReal(GetRectMinY(whichRect), GetRectMaxY(whichRect))) -endfunction -function FilterIsNoInvulnerableInvalidTarget takes unit target returns boolean - return GetUnitTypeId(target) != BACK_PACK and GetUnitTypeId(target) != EQUIPMENT_BAG and GetUnitAbilityLevel(target, 'Avul') <= 0 -endfunction -function FilterAlliedTargetsNonStructureMana takes unit caster,unit target,integer abilityId returns boolean - return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and GetUnitState(target, UNIT_STATE_MAX_MANA) > 0.0 and FilterIsNoInvulnerableInvalidTarget(target) -endfunction -function SetAuraAlliedTargetsNonStructureMana takes nothing returns nothing - set auraFilterFunc=(1) -endfunction -function FilterAlliedTargetsNonStructure takes unit caster,unit target,integer abilityId returns boolean - return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and FilterIsNoInvulnerableInvalidTarget(target) -endfunction -function SetAuraAlliedTargetsNonStructure takes nothing returns nothing - set auraFilterFunc=(2) -endfunction -function FilterAlliedTargetsNonStructureNoSummoned takes unit caster,unit target,integer abilityId returns boolean - return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and not IsUnitType(target, UNIT_TYPE_SUMMONED) and FilterIsNoInvulnerableInvalidTarget(target) -endfunction -function SetAuraAlliedTargetsNonStructureNoSummoned takes nothing returns nothing - set auraFilterFunc=(3) -endfunction -function FilterAlliedTargets takes unit caster,unit target,integer abilityId returns boolean - return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and FilterIsNoInvulnerableInvalidTarget(target) -endfunction -function SetAuraAlliedTargets takes nothing returns nothing - set auraFilterFunc=(4) -endfunction -function FilterEnemyTargets takes unit caster,unit target,integer abilityId returns boolean - return not IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and FilterIsNoInvulnerableInvalidTarget(target) -endfunction -function SetAuraEnemyTargets takes nothing returns nothing - set auraFilterFunc=(5) -endfunction -function FilterEnemyTargetsNonStructure takes unit caster,unit target,integer abilityId returns boolean - return not IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and FilterIsNoInvulnerableInvalidTarget(target) -endfunction -function SetAuraEnemyTargetsNonStructure takes nothing returns nothing - set auraFilterFunc=(6) -endfunction -function AddWoWReforgedAura takes nothing returns nothing - call AddAura(udg_TmpAbilityCode , udg_TmpAbilityCode2 , udg_TmpAbilityCode3 , auraFilterFunc , udg_TmpReal , udg_TmpBoolean , udg_TmpInteger , udg_TmpReal2 , udg_TmpInteger2 , udg_TmpReal3) -endfunction -function WoWReforgedUtils___FilterFunctionMassSpell takes nothing returns boolean - local unit caster= (MassSpell___filterCaster) // INLINED!! - local integer abilityId= (MassSpell___filterAbilityId) // INLINED!! - local unit u= GetFilterUnit() - local boolean result= false - if ( abilityId == 'A1WL' or abilityId == 'A11A' ) then // Mass Inner Fire - set result=IsUnitAliveBJ(u) and not IsUnitType(u, UNIT_TYPE_STRUCTURE) and not IsUnitEnemy(u, GetOwningPlayer(caster)) - elseif ( abilityId == 'A14P' ) then // Mass Charm - set result=IsUnitAliveBJ(u) and not IsUnitType(u, UNIT_TYPE_STRUCTURE) and GetUnitAbilityLevel(u, 'Avul') > 0 and GetUnitLevel(u) <= GetUnitAbilityLevel(caster, abilityId) * 5 - endif - - set caster=null - set u=null - - return result -endfunction -function AddWoWReforgedMassSpell takes nothing returns nothing - local integer s= AddMassSpell(udg_TmpAbilityCode , udg_TmpString , Filter(function WoWReforgedUtils___FilterFunctionMassSpell)) - if ( udg_TmpAbilityCode2 != 0 ) then - call SaveInteger(MassSpell___h, (udg_TmpAbilityCode2 ), 0, ( s)) // INLINED!! - endif - if ( udg_TmpAbilityCode3 != 0 ) then - call SaveInteger(MassSpell___h, (udg_TmpAbilityCode3 ), 0, ( s)) // INLINED!! - endif - - set udg_TmpAbilityCode2=0 - set udg_TmpAbilityCode3=0 -endfunction -function DisplayNewBonusConfig takes nothing returns nothing - call h__BJDebugMsg("NewBonus EXTENDED: on") - call h__BJDebugMsg("DamageInterface: on") - call h__BJDebugMsg("Evasion: on") - call h__BJDebugMsg("CriticalStrike: on") - call h__BJDebugMsg("SpellPower: on") - call h__BJDebugMsg("LifeSteal: on") - call h__BJDebugMsg("SpellVamp: on") - call h__BJDebugMsg("Tenacity: on") -endfunction -function GetUcam takes integer unitTypeId returns integer - if ( (LoadBoolean(ObjectDataFields___h, (unitTypeId ), ( OBJECT_DATA_FIELD_UCAM))) ) then // INLINED!! - return 1 - endif - - return 0 -endfunction -function DisplayUnitRespawnInfo takes unit whichUnit,player whichPlayer returns nothing - local integer unitIndex= (UnitGroupRespawnSystem___GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit)))) // INLINED!! - local integer groupIndex= - 1 - if ( IsRespawnUnitValid(unitIndex) ) then - set groupIndex=(UnitGroupRespawnSystem___respawnUnitGroupIndex[(unitIndex)]) // INLINED!! - endif - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Unit respawn index: " + I2S(unitIndex) + "\nUnit group index: " + I2S(groupIndex)) -endfunction -function WoWReforgedUtils___TriggerConditionLevel takes nothing returns boolean - if ( GetHeroLevel(GetTriggerUnit()) == MAX_HERO_LEVEL ) then - call AutoSkillHero(GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedUtils___Init takes nothing returns nothing - set udg_DB=InitHashtable() - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedUtils___levelTrigger, EVENT_PLAYER_HERO_LEVEL) - call TriggerAddCondition(WoWReforgedUtils___levelTrigger, Condition(function WoWReforgedUtils___TriggerConditionLevel)) -endfunction -//library WoWReforgedUtils ends -//library JumpSpellvJASSJangoFett: - - function s__JumpingStomp_DestructableFilter takes nothing returns boolean - if GetDestructableLife(GetFilterDestructable()) > 0 then - if (IsTree(GetDestructableTypeId((GetFilterDestructable())))) then // INLINED!! - call KillDestructable(GetFilterDestructable()) - endif - endif - return false - endfunction - - function s__JumpingStomp_TargetFilter takes nothing returns boolean - return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitAlly(GetFilterUnit(), GetOwningPlayer(EVENT_JUMP_UNIT)) - endfunction - - function s__JumpingStomp_onFinish takes nothing returns boolean - local real x - local real y - local real damage= 0.0 - local integer i= 0 - local integer max= 0 - local group t= null - local integer level= GetUnitAbilityLevel(EVENT_JUMP_UNIT, JumpSpellvJASSJangoFett__AID3) - if not IsUnitType(EVENT_JUMP_UNIT, UNIT_TYPE_DEAD) then - set x=GetUnitX(EVENT_JUMP_UNIT) - set y=GetUnitY(EVENT_JUMP_UNIT) - call DestroyEffect(AddSpecialEffect(JumpSpellvJASSJangoFett__EFF, x, y)) - call SetRect(JumpSpellvJASSJangoFett__REC, x - JumpSpellvJASSJangoFett__AOE, y - JumpSpellvJASSJangoFett__AOE, x + JumpSpellvJASSJangoFett__AOE, y + JumpSpellvJASSJangoFett__AOE) - call EnumDestructablesInRect(JumpSpellvJASSJangoFett__REC, Condition(function s__JumpingStomp_DestructableFilter), null) - endif - - if ( level > 0 ) then - set damage=20.0 + I2R(level) * 25.0 - set t=CreateGroup() - call GroupEnumUnitsInRange(t, x, y, 256.0, Filter(function s__JumpingStomp_TargetFilter)) - set i=0 - set max=BlzGroupGetSize(t) - loop - exitwhen ( i == max ) - call UnitDamageTarget(EVENT_JUMP_UNIT, BlzGroupUnitAt(t, i), damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) - set i=i + 1 - endloop - call GroupClear(t) - call DestroyGroup(t) - set t=null - endif - //set ST = TAB[GetHandleId(EVENT_JUMP_UNIT)] - //call ST.remove() - return false - endfunction - - function s__JumpingStomp_canCast takes nothing returns boolean - local integer abilityId= GetSpellAbilityId() - return abilityId == JumpSpellvJASSJangoFett__AID or abilityId == JumpSpellvJASSJangoFett__AID2 or abilityId == JumpSpellvJASSJangoFett__AID3 - endfunction - - function s__JumpingStomp_startJump takes nothing returns nothing - local unit u= GetTriggerUnit() - local real x0= GetUnitX(u) - local real y0= GetUnitY(u) - local real x1= GetSpellTargetX() - local real y1= GetSpellTargetY() - // Here I make each jump take at least 0.5 seconds. The distance add to the jump time with 0.5 factor. - local real time= 0.5 + 0.5 * SquareRoot(( x1 - x0 ) * ( x1 - x0 ) + ( y1 - y0 ) * ( y1 - y0 )) / JumpSpellvJASSJangoFett__SPEED - call s__Jump_start(u , x1 , y1 , JumpSpellvJASSJangoFett__MAX_HEIGHT , time , JumpSpellvJASSJangoFett__GRAVITY) - set u=null - endfunction - - function s__JumpingStomp_onCast takes nothing returns boolean - local integer abilityId= GetSpellAbilityId() - if ( abilityId == JumpSpellvJASSJangoFett__AID or abilityId == JumpSpellvJASSJangoFett__AID2 or abilityId == JumpSpellvJASSJangoFett__AID3 ) then - call s__JumpingStomp_startJump() - endif - - return false - endfunction - - function s__JumpingStomp_onOrder takes nothing returns boolean - if GetIssuedOrderId() == JumpSpellvJASSJangoFett__OID and not IsPointJumpable(GetOrderPointX() , GetOrderPointY()) then - call PauseUnit(GetTriggerUnit(), true) - call IssueImmediateOrder(GetTriggerUnit(), "stop") - call PauseUnit(GetTriggerUnit(), false) - call SimError(GetTriggerPlayer() , "Can't jump there.") - endif - return false - endfunction - - function s__JumpingStomp_onInit takes nothing returns nothing - local trigger t= CreateTrigger() - call TriggerRegisterVariableEvent(t, "EVENT_JUMP_FINISH", EQUAL, 1) - call TriggerAddCondition(t, Condition(function s__JumpingStomp_onFinish)) - - set t=CreateTrigger() - call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) - call TriggerAddCondition(t, Condition(function s__JumpingStomp_onOrder)) - - set t=CreateTrigger() - call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(t, Condition(function s__JumpingStomp_canCast)) - call TriggerAddCondition(t, Condition(function s__JumpingStomp_onCast)) - endfunction -//library JumpSpellvJASSJangoFett ends -//library SaveCodeSystem: -function CheckStringForDuplicatedCharacters takes string source returns nothing - local boolean foundDuplicated= false - local integer i= 0 - local integer j= 0 - loop - exitwhen ( i == StringLength(source) ) - set j=0 - loop - exitwhen ( j == StringLength(source) ) - if ( i != j and SubString(source, i, i + 1) == SubString(source, j, j + 1) ) then - set foundDuplicated=true - call h__BJDebugMsg("Duplicated digit at " + I2S(i) + " and " + I2S(j) + ": " + SubString(source, i, i + 1)) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - if ( not foundDuplicated ) then - call h__BJDebugMsg("No duplicates have been found!") - endif -endfunction -function CheckStringForNonAsciiCharacters takes string source returns nothing - local integer i= 0 - loop - exitwhen ( i == StringLength(source) ) - call Char2Ascii(SubString(source, i, i + 1)) - set i=i + 1 - endloop -endfunction -function CheckSaveCodeDigitsUnique takes nothing returns nothing - call CheckStringForDuplicatedCharacters(SAVE_CODE_DIGITS) -endfunction -function CheckSaveCodeDigitsAscii takes nothing returns nothing - call CheckStringForNonAsciiCharacters(SAVE_CODE_DIGITS) -endfunction -// Returns the base for the custom number system. -function GetMaxSaveCodeDigitsEx takes string alphabet returns integer - return StringLength(alphabet) -endfunction -function GetMaxSaveCodeDigits takes nothing returns integer - return (StringLength((SAVE_CODE_DIGITS))) // INLINED!! -endfunction -function ConvertDecimalDigitToSaveCodeDigit takes integer digit returns string - return SubString(SAVE_CODE_DIGITS, digit, digit + 1) -endfunction -function IndexOfSaveCodeDigitEx takes string symbol,string alphabet returns integer - return (IndexOfStringEx((symbol ) , ( alphabet) , 0)) // INLINED!! -endfunction -function IndexOfSaveCodeDigit takes string symbol returns integer - return (IndexOfStringEx(((symbol ) ) , ( ( SAVE_CODE_DIGITS)) , 0)) // INLINED!! -endfunction -function GetObfuscationSaveCodeDigitsEx takes string alphabet returns string - // we want to have the separator in it so we can obfuscate the whole save code with separators. - return alphabet + SAVE_CODE_SEGMENT_SEPARATOR -endfunction -function GetObfuscationSaveCodeDigits takes nothing returns string - return ((SAVE_CODE_DIGITS) + SAVE_CODE_SEGMENT_SEPARATOR) // INLINED!! -endfunction -function GetMaxObfuscationSaveCodeDigitsEx takes string alphabet returns integer - return (StringLength((alphabet))) + 1 // INLINED!! -endfunction -function GetMaxObfuscationSaveCodeDigits takes nothing returns integer - return ((StringLength(((SAVE_CODE_DIGITS)))) + 1) // INLINED!! -endfunction -function GetShiftedSaveCodeSplitPositionEx takes integer n,string alphabet returns integer - return ModuloInteger(n, ((StringLength(((alphabet)))) + 1)) // INLINED!! -endfunction -function GetShiftedSaveCodeSplitPosition takes integer n returns integer - return (ModuloInteger((n ), ((StringLength(((( SAVE_CODE_DIGITS))))) + 1))) // INLINED!! -endfunction -// Use a hash value (like the player name's hash) to move the symbol table. This might prevent reproducing savecodes too easily. -function GetShiftedSaveCodeDigitsEx takes integer n,string alphabet returns string - local integer max= ((StringLength(((alphabet)))) + 1) // INLINED!! - local string saveCodeDigits= ((alphabet) + SAVE_CODE_SEGMENT_SEPARATOR) // INLINED!! - local integer splitPosition= (ModuloInteger((n ), ((StringLength(((( alphabet))))) + 1))) // INLINED!! - return SubString(saveCodeDigits, splitPosition, ((StringLength(((alphabet)))) + 1)) + SubString(saveCodeDigits, 0, splitPosition) // INLINED!! -endfunction -function GetShiftedSaveCodeDigits takes integer n returns string - return GetShiftedSaveCodeDigitsEx(n , SAVE_CODE_DIGITS) -endfunction -// TODO Can be slow for big numbers. Maybe move into a separate trigger with a new OpLimit. -function ConvertDecimalNumberToSaveCodeSegment takes integer number returns string - local string result= "" - local integer start= number - local integer base= (StringLength((SAVE_CODE_DIGITS))) // INLINED!! - local integer mod= 0 - //call BJDebugMsg("Converting number " + I2S(start)) - loop - //call BJDebugMsg("Dividing number " + I2S(start) + " by " + I2S(base)) - set mod=ModuloInteger(start, base) - set start=start / base - set result=ConvertDecimalDigitToSaveCodeDigit(mod) + result - exitwhen ( start == 0 ) - //call BJDebugMsg("Result: " + result) - endloop - return result + SAVE_CODE_SEGMENT_SEPARATOR -endfunction -function ConvertSaveCodeToObfuscatedVersion takes string saveCode,integer hash returns string - local string shiftedSaveCodeDigits= (GetShiftedSaveCodeDigitsEx((hash) , SAVE_CODE_DIGITS)) // INLINED!! - local string saveCodeDigits= ((SAVE_CODE_DIGITS) + SAVE_CODE_SEGMENT_SEPARATOR) // INLINED!! - local integer index= - 1 - local string result= "" - local integer i= 0 - //call BJDebugMsg("Shifted digits: " + shiftedSaveCodeDigits) - loop - exitwhen ( i == StringLength(saveCode) ) - set index=(IndexOfStringEx((SubString(saveCode, i, i + 1) ) , ( saveCodeDigits) , 0)) // INLINED!! - if ( index != - 1 ) then - set result=result + SubString(shiftedSaveCodeDigits, index, index + 1) - else - set result=result + SAVE_CODE_SYMBOL_UNKNOWN - endif - set i=i + 1 - endloop - return result -endfunction -function ConvertSaveCodeFromObfuscatedVersionEx takes string saveCode,integer hash,string alphabet returns string - local string shiftedSaveCodeDigits= GetShiftedSaveCodeDigitsEx(hash , alphabet) - local integer splitPosition= (ModuloInteger((hash ), ((StringLength(((( alphabet))))) + 1))) // INLINED!! - local integer shiftedIndex= - 1 - local integer originalIndex= - 1 - local string result= "" - local integer i= 0 - //call BJDebugMsg("Shifted digits: " + shiftedSaveCodeDigits) - loop - exitwhen ( i == StringLength(saveCode) ) - set shiftedIndex=(IndexOfStringEx((SubString(saveCode, i, i + 1) ) , ( shiftedSaveCodeDigits) , 0)) // INLINED!! - if ( shiftedIndex != - 1 ) then - set result=result + SubString(((alphabet) + SAVE_CODE_SEGMENT_SEPARATOR), shiftedIndex, shiftedIndex + 1) // INLINED!! - else - set result=result + SAVE_CODE_SYMBOL_UNKNOWN - endif - set i=i + 1 - endloop - return result -endfunction -function ConvertSaveCodeFromObfuscatedVersion takes string saveCode,integer hash returns string - return ConvertSaveCodeFromObfuscatedVersionEx(saveCode , hash , SAVE_CODE_DIGITS) -endfunction -function PowI takes integer x,integer y returns integer - local integer result= 1 - local integer i= 0 - loop - exitwhen ( i == y ) - set result=result * x - set i=i + 1 - endloop - return result -endfunction -// Convert our number system into the decimal system number. -function ConvertSaveCodeSegmentIntoDecimalNumberEx takes string symbol,integer n,string alphabet returns integer - local integer index= (IndexOfStringEx(((symbol ) ) , ( ( alphabet)) , 0)) // INLINED!! - if ( index != - 1 ) then - //call BJDebugMsg("Index " + I2S(index) + " for symbol " + symbol + " pow " + I2S(GetMaxSaveCodeDigits()) + ", " + I2S(n)) - return index * PowI((StringLength((alphabet))) , n) // INLINED!! - endif - //call BJDebugMsg("Cannot find symbol: " + symbol + " with n: " + I2S(n)) - return 0 -endfunction -function ConvertSaveCodeSegmentIntoDecimalNumber takes string symbol,integer n returns integer - return ConvertSaveCodeSegmentIntoDecimalNumberEx(symbol , n , SAVE_CODE_DIGITS) -endfunction -// the separator comes after a segment -function GetSaveCodeSegments takes string saveCode returns integer - local integer separatorCounter= 0 - local integer i= 0 - loop - exitwhen ( i == StringLength(saveCode) ) - if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then - set separatorCounter=separatorCounter + 1 - endif - set i=i + 1 - endloop - return separatorCounter -endfunction -// includes the separator character! -function GetSaveCodeUntil takes string saveCode,integer excludedIndex returns string - local integer separatorCounter= 0 - local integer index= StringLength(saveCode) - local integer i= 0 - loop - exitwhen ( separatorCounter >= excludedIndex or i == StringLength(saveCode) ) - if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then - set separatorCounter=separatorCounter + 1 - set index=i + 1 // include the separator character! - endif - set i=i + 1 - endloop - return SubString(saveCode, 0, index) -endfunction - function ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx takes string saveCode,integer index,string alphabet returns integer - local string substr= "" - local integer result= 0 - local integer separatorCounter= 0 - local integer n= - 1 - local integer i= 0 - loop - exitwhen ( separatorCounter > index or i == StringLength(saveCode) ) - if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then - set separatorCounter=separatorCounter + 1 - elseif ( separatorCounter == index ) then - set substr=substr + SubString(saveCode, i, i + 1) - set n=n + 1 - endif - set i=i + 1 - endloop - // convert into decimal number - //call BJDebugMsg("Calculate number back " + substr) - set i=0 - loop - exitwhen ( i == StringLength(substr) ) - set result=result + ConvertSaveCodeSegmentIntoDecimalNumberEx(SubString(substr, i, i + 1) , n , alphabet) - //call BJDebugMsg("Result " + I2S(result)) - set n=n - 1 - set i=i + 1 - endloop - return result -endfunction -function ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCode takes string saveCode,integer index returns integer - return ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , index , SAVE_CODE_DIGITS) -endfunction -// Strings are just obfuscated per character. -// Otherwise, we would need to store the length per character. -// The characters must be in the savecode alphabet. Otherwise, they will become a ? character. -function ConvertStringToSaveCodeSegment takes string whichString,integer hash returns string - local string result= "" - local string character= "" - local integer i= 0 - loop - exitwhen ( i == StringLength(whichString) ) - set character=SubString(whichString, i, i + 1) - // no space characters please - if ( character == " " ) then - set character="_" - endif - set result=result + ConvertSaveCodeToObfuscatedVersion(character , hash) - set i=i + 1 - endloop - return result + SAVE_CODE_SEGMENT_SEPARATOR -endfunction -function ConvertSaveCodeSegmentIntoStringFromSaveCode takes string saveCode,integer index,integer hash returns string - local string substr= "" - local string character= "" - local string result= "" - local integer separatorCounter= 0 - local integer n= - 1 - local integer i= 0 - loop - exitwhen ( separatorCounter > index or i == StringLength(saveCode) ) - if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then - set separatorCounter=separatorCounter + 1 - elseif ( separatorCounter == index ) then - set substr=substr + SubString(saveCode, i, i + 1) - set n=n + 1 - endif - set i=i + 1 - endloop - // convert into decimal number - //call BJDebugMsg("Calculate number back " + substr) - set i=0 - loop - exitwhen ( i == StringLength(substr) ) - set character=(ConvertSaveCodeFromObfuscatedVersionEx((SubString(substr, i, i + 1) ) , ( hash) , SAVE_CODE_DIGITS)) // INLINED!! - // underscores are space characters by default - if ( character == "_" ) then - set character=" " - endif - set result=result + character - //call BJDebugMsg("Result " + I2S(result)) - set n=n - 1 - set i=i + 1 - endloop - return result -endfunction -// We don't want to handle negative numbers. -function AbsStringHash takes string whichString returns integer - return IAbsBJ(StringHash(whichString)) -endfunction -// If the string hash value is too big, the savecodes get too long. -function CompressedAbsStringHash takes string whichString returns integer - local integer absStringHash= (IAbsBJ(StringHash((whichString)))) // INLINED!! - if ( SAVE_CODE_COMPRESS_STRING_HASHS ) then - return ModuloInteger(absStringHash, (StringLength((SAVE_CODE_DIGITS))) * 3) // INLINED!! - endif - return absStringHash -endfunction -function IsCharacterUpperCase takes string letter returns boolean - return letter == "A" or letter == "B" or letter == "C" or letter == "D" or letter == "E" or letter == "F" or letter == "G" or letter == "H" or letter == "I" or letter == "J" or letter == "K" or letter == "L" or letter == "M" or letter == "N" or letter == "O" or letter == "P" or letter == "Q" or letter == "R" or letter == "S" or letter == "T" or letter == "U" or letter == "V" or letter == "W" or letter == "X" or letter == "Y" or letter == "Z" -endfunction -function ColoredSaveCode takes string saveCode returns string - local string result= "" - local string char= "" - local integer i= 0 - loop - exitwhen ( i == StringLength(saveCode) ) - set char=SubString(saveCode, i, i + 1) - if ( IsCharacterUpperCase(char) ) then - set result=result + "|cffffcc00" + char + "|r" - elseif ( char == "|" ) then - set result=result + "||" // escape to avoid invalid color codes - else - set result=result + char - endif - set i=i + 1 - endloop - return result -endfunction -function AppendFileContent takes string content returns string - return "\r\n" + content -endfunction -function AppendFileContentLeft takes string content returns string - return "\r\n" + content -endfunction -function CreateSaveCodeTextFile takes string playerName,string info,string fileName,string saveCode returns nothing - local string singleplayer= "no" - local string singlePlayerFileName= "Multiplayer" - local string gameMode= "Freelancer" - local string gameType= "Normal" - local string content= "" - call PreloadGenClear() - call PreloadGenStart() - set content=content + ("\r\n" + ("Code: -load " + saveCode)) // INLINED!! - set content=content + ("\r\n" + (info)) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - call Preload(content) - // The line below creates the file at the specified location - call PreloadGenEnd(fileName) -endfunction -//library SaveCodeSystem ends -//library SpellsMeteorKnockbackType: -function SpellsMeteorKnockbackType__onUnitHit takes integer kb,unit hit returns nothing - //if (not IsUnitAlly(hit, GetOwningPlayer(kb.caster))) then - //call UnitDamageTarget(kb.caster, hit, GetUnitAbilityLevel(kb.caster, 'A0W7') * 100.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) - //endif -endfunction -function SpellsMeteorKnockbackType__onDestructableHit takes integer kb,destructable hit returns nothing - if ( (IsTree(GetDestructableTypeId((hit)))) ) then // INLINED!! - call KillDestructable(hit) - endif -endfunction -function SpellsMeteorKnockbackType__filterFunction takes integer kb,unit enum returns boolean - return not IsUnitAlly(enum, GetOwningPlayer(s__Knockback_caster[kb])) -endfunction -function SpellsMeteorKnockbackType__Init takes nothing returns nothing - set SpellsMeteorKnockbackType_kbType=s__KnockbackType__allocate() - set s__KnockbackType_onUnitHitAction[SpellsMeteorKnockbackType_kbType]=(3) - set s__KnockbackType_onDestructableHitAction[SpellsMeteorKnockbackType_kbType]=(3) - set s__KnockbackType_filterFunc[SpellsMeteorKnockbackType_kbType]=(3) -endfunction -//library SpellsMeteorKnockbackType ends -//library SpellsSlideKnockbackType: -function SpellsSlideKnockbackType__onUnitHit takes integer kb,unit hit returns nothing - if ( not IsUnitAlly(hit, GetOwningPlayer(s__Knockback_caster[kb])) ) then - call UnitDamageTarget(s__Knockback_caster[kb], hit, GetUnitAbilityLevel(s__Knockback_caster[kb], 'A0W7') * 100.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) - endif -endfunction -function SpellsSlideKnockbackType__onDestructableHit takes integer kb,destructable hit returns nothing - if ( (IsTree(GetDestructableTypeId((hit)))) ) then // INLINED!! - call KillDestructable(hit) - endif -endfunction -function SpellsSlideKnockbackType__filterFunction takes integer kb,unit enum returns boolean - return not IsUnitAlly(enum, GetOwningPlayer(s__Knockback_caster[kb])) -endfunction -function SpellsSlideKnockbackType__Init takes nothing returns nothing - set SpellsSlideKnockbackType_kbType=s__KnockbackType__allocate() - set s__KnockbackType_onUnitHitAction[SpellsSlideKnockbackType_kbType]=(4) - set s__KnockbackType_onDestructableHitAction[SpellsSlideKnockbackType_kbType]=(4) - set s__KnockbackType_filterFunc[SpellsSlideKnockbackType_kbType]=(4) -endfunction -//library SpellsSlideKnockbackType ends -//library WoWReforgedBanners: -function GetMaxBanners takes nothing returns integer - return WoWReforgedBanners___skinCounter -endfunction -function AddBanner takes integer itemTypeId,integer unitTypeId returns integer - local integer index= WoWReforgedBanners___skinCounter - set WoWReforgedBanners___skinItemTypeId[index]=itemTypeId - set WoWReforgedBanners___skinUnitTypeId[index]=unitTypeId - set WoWReforgedBanners___skinCounter=WoWReforgedBanners___skinCounter + 1 - return index -endfunction -function GetBannerItemTypeId takes integer index returns integer - return WoWReforgedBanners___skinItemTypeId[index] -endfunction -function GetBannerUnitTypeId takes integer index returns integer - return WoWReforgedBanners___skinUnitTypeId[index] -endfunction -function GetBannerByUnitTypeId takes integer id returns integer - local integer i= 0 - local integer max= (WoWReforgedBanners___skinCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( (WoWReforgedBanners___skinUnitTypeId[(i)]) == id ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function IsBanner takes integer id returns boolean - return GetBannerByUnitTypeId(id) != - 1 -endfunction -function MapBannerToItem takes integer id returns integer - local integer index= GetBannerByUnitTypeId(id) - if ( index != - 1 ) then - return (WoWReforgedBanners___skinItemTypeId[(index)]) // INLINED!! - endif - return 0 -endfunction -function WoWReforgedBanners___AddBannersShop takes unit shop returns nothing - local integer i= 0 - //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - call EnablePagedButtons(shop) - loop - exitwhen ( i >= WoWReforgedBanners___skinCounter ) -call AddPagedButtonsId((shop ) , ( (WoWReforgedBanners___skinItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - //call BJDebugMsg("Skill " + I2S(i)) // Stops at 189 - set i=i + 1 - endloop - //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - - //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") -endfunction -function WoWReforgedBanners___TriggerConditionConstructed takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == BANNER_SHOP ) then - call WoWReforgedBanners___AddBannersShop(GetConstructedStructure()) - endif - return false -endfunction -function WoWReforgedBanners___TriggerConditionSummoned takes nothing returns boolean - if ( GetUnitTypeId(GetSummonedUnit()) == BANNER_SHOP ) then - call WoWReforgedBanners___AddBannersShop(GetSummonedUnit()) - endif - return false -endfunction -function WoWReforgedBanners___TriggerConditionDeath takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == BANNER_SHOP ) then - // TODO Disable shop manually? - //call ClearSkillsShop(GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedBanners___ForGroupEnableShop takes nothing returns nothing - call WoWReforgedBanners___AddBannersShop(GetEnumUnit()) -endfunction -function WoWReforgedBanners___FilterBuilding takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == BANNER_SHOP_NEUTRAL -endfunction -function WoWReforgedBanners___UpdateAllShops takes nothing returns nothing - local timer t= GetExpiredTimer() - local group g= CreateGroup() - - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedBanners___FilterBuilding)) - call ForGroup(g, function WoWReforgedBanners___ForGroupEnableShop) - - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them - - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function WoWReforgedBanners___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBanners___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedBanners___constructionTrigger, Condition(function WoWReforgedBanners___TriggerConditionConstructed)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBanners___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedBanners___summonTrigger, Condition(function WoWReforgedBanners___TriggerConditionSummoned)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBanners___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedBanners___deathTrigger, Condition(function WoWReforgedBanners___TriggerConditionDeath)) - - call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedBanners___UpdateAllShops) - // banners - call AddBanner(ITEM_TINY_BANNER_STORMWIND , BANNER_STORMWIND) - call AddBanner(ITEM_TINY_BANNER_KUL_TIRAS , BANNER_KUL_TIRAS) - call AddBanner(ITEM_TINY_BANNER_DALARAN , BANNER_DALARAN) - call AddBanner(ITEM_TINY_BANNER_ALTERAC , BANNER_ALTERAC) - call AddBanner(ITEM_TINY_BANNER_GILNEAS , BANNER_GILNEAS) - call AddBanner(ITEM_TINY_BANNER_THERAMORE , BANNER_THERAMORE) - call AddBanner(ITEM_TINY_BANNER_STROMGARDE , BANNER_STROMGARDE) - call AddBanner(ITEM_TINY_BANNER_LORDAERON , BANNER_LORDAERON) - call AddBanner(ITEM_TINY_BANNER_HIGH_ELF , BANNER_HIGH_ELF) - call AddBanner(ITEM_TINY_BANNER_BLOOD_ELF , BANNER_BLOOD_ELF) - call AddBanner(ITEM_TINY_BANNER_BRONZEBEARD , BANNER_BRONZEBEARD) - call AddBanner(ITEM_TINY_BANNER_IRONFORGE , BANNER_IRONFORGE) - call AddBanner(ITEM_TINY_BANNER_WILDHAMMER , BANNER_WILDHAMMER) - call AddBanner(ITEM_TINY_BANNER_STORMPIKE , BANNER_STORMPIKE) - call AddBanner(ITEM_TINY_BANNER_DARK_IRON , BANNER_DARK_IRON) - call AddBanner(ITEM_TINY_BANNER_EXPLORERS , BANNER_EXPLORERS) - call AddBanner(ITEM_TINY_BANNER_ORC , BANNER_ORC) - call AddBanner(ITEM_TINY_BANNER_UNDEAD , BANNER_UNDEAD) - call AddBanner(ITEM_TINY_BANNER_NIGHT_ELF , BANNER_NIGHT_ELF) - call AddBanner(ITEM_TINY_BANNER_PANDAREN , BANNER_PANDAREN) -endfunction -//library WoWReforgedBanners ends -//library WoWReforgedBosses: -function IsBoss takes integer unitTypeId returns boolean - local boolean result= false - local unit boss= null - local integer i= 0 - loop - exitwhen ( i >= BlzGroupGetSize(udg_Bosses) or result ) - set boss=BlzGroupUnitAt(udg_Bosses, i) - if ( GetUnitTypeId(boss) == unitTypeId ) then - set result=true - endif - set boss=null - set i=i + 1 - endloop - return result -endfunction -function UpdateBossPlayerHeroes takes nothing returns nothing - local unit boss= null - local unit boss1= null - local unit boss2= null - local unit boss3= null - local integer i= 0 - loop - exitwhen ( i >= BlzGroupGetSize(udg_Bosses) ) - set boss=BlzGroupUnitAt(udg_Bosses, i) - if ( boss1 == null or GetHeroLevel(boss) > GetHeroLevel(boss1) ) then - set boss1=boss - endif - set i=i + 1 - endloop - set i=0 - loop - exitwhen ( i >= BlzGroupGetSize(udg_Bosses) ) - set boss=BlzGroupUnitAt(udg_Bosses, i) - if ( boss != boss1 and ( boss2 == null or GetHeroLevel(boss) > GetHeroLevel(boss2) ) ) then - set boss2=boss - endif - set i=i + 1 - endloop - set i=0 - loop - exitwhen ( i >= BlzGroupGetSize(udg_Bosses) ) - set boss=BlzGroupUnitAt(udg_Bosses, i) - if ( boss != boss1 and boss != boss2 and ( boss3 == null or GetHeroLevel(boss) > GetHeroLevel(boss3) ) ) then - set boss3=boss - endif - set i=i + 1 - endloop - - call SetPlayerHero1(udg_BossesPlayer , boss1) - call SetPlayerHero2(udg_BossesPlayer , boss2) - call SetPlayerHero3(udg_BossesPlayer , boss3) -endfunction -function GetLegendaryItemsMax takes nothing returns integer - return WoWReforgedBosses___legendaryItemsCounter -endfunction -function GetLegendaryItemTypeId takes integer index returns integer - return WoWReforgedBosses___legendaryItemTypeId[index] -endfunction -function GetLegendaryItemBoss takes integer index returns unit - return WoWReforgedBosses___legendaryItemBoss[index] -endfunction -function GetLegendaryItemBuilding takes integer index returns unit - return WoWReforgedBosses___legendaryItemBuilding[index] -endfunction -function GetLegendaryItemRect takes integer index returns rect - return WoWReforgedBosses___legendaryItemRect[index] -endfunction -function GetLegendaryItemByBoss takes unit boss returns integer - local integer i= 0 - local integer max= (WoWReforgedBosses___legendaryItemsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( (WoWReforgedBosses___legendaryItemBoss[(i)]) == boss ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetLegendaryItemByItemTypeId takes integer itemTypeId returns integer - local integer i= 0 - local integer max= (WoWReforgedBosses___legendaryItemsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( (WoWReforgedBosses___legendaryItemTypeId[(i)]) == itemTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetUnitLegendaryItemsCount takes unit hero returns integer - local item slotItem= null - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(hero, i) - if ( slotItem != null and GetLegendaryItemByItemTypeId(GetItemTypeId(slotItem)) != - 1 ) then - set result=result + 1 - endif - set slotItem=null - set i=i + 1 - endloop - return result -endfunction -function AddLegendaryItem takes nothing returns nothing - set WoWReforgedBosses___legendaryItemTypeId[WoWReforgedBosses___legendaryItemsCounter]=udg_TmpItemTypeId - set WoWReforgedBosses___legendaryItemBoss[WoWReforgedBosses___legendaryItemsCounter]=udg_TmpUnit - set WoWReforgedBosses___legendaryItemBuilding[WoWReforgedBosses___legendaryItemsCounter]=udg_TmpUnit2 - set WoWReforgedBosses___legendaryItemRect[WoWReforgedBosses___legendaryItemsCounter]=udg_TmpRect - - set udg_LegendaryItemType[WoWReforgedBosses___legendaryItemsCounter]=udg_TmpItemTypeId - set udg_LegendaryItemDropRect[WoWReforgedBosses___legendaryItemsCounter]=udg_TmpRect - - set WoWReforgedBosses___legendaryItemsCounter=WoWReforgedBosses___legendaryItemsCounter + 1 - set udg_LegendaryItemTypeSize=udg_LegendaryItemTypeSize + 1 -endfunction -function WoWReforgedBosses___TriggerConditionBossDeath takes nothing returns boolean - local unit dyingUnit= GetDyingUnit() - local integer index= - 1 - if ( IsUnitType(dyingUnit, UNIT_TYPE_HERO) and ( GetOwningPlayer(dyingUnit) == udg_BossesPlayer or IsUnitInGroup(dyingUnit, udg_Bosses) ) ) then - set index=GetLegendaryItemByBoss(dyingUnit) - if ( index != - 1 ) then - call SetUnitInvulnerable((WoWReforgedBosses___legendaryItemBuilding[(index)]), false) // INLINED!! - endif - endif - - set dyingUnit=null - return false -endfunction -function WoWReforgedBosses___Init takes nothing returns nothing - set WoWReforgedBosses___bossDeathTrigger=CreateTrigger() - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBosses___bossDeathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedBosses___bossDeathTrigger, Condition(function WoWReforgedBosses___TriggerConditionBossDeath)) -endfunction -//library WoWReforgedBosses ends -//library WoWReforgedCamera: -function ToggleCameraLock takes player whichPlayer returns nothing - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - if ( not udg_CamLockPlayerEnabled[convertedPlayerId] ) then - set udg_CamLockPlayerEnabled[convertedPlayerId]=true - set udg_CamLockPlayerTarget[convertedPlayerId]=udg_Held[convertedPlayerId] - call SetCameraTargetControllerNoZForPlayer(whichPlayer, udg_CamLockPlayerTarget[convertedPlayerId], 0, 0, false) - else - set udg_CamLockPlayerEnabled[convertedPlayerId]=false - call ResetToGameCameraForPlayer(whichPlayer, 0) - endif -endfunction -function ToggleCameraRpg takes player whichPlayer returns nothing - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - local integer playerId= GetPlayerId(whichPlayer) - if ( IsInSinglePlayer() ) then - if ( not udg_CamRPGPlayerEnabled[convertedPlayerId] ) then - set udg_CamRPGPlayerEnabled[convertedPlayerId]=true - if ( udg_Held[convertedPlayerId] != null ) then - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_ALWAYSHINT, "Use the arrow keys to move the camera, press Control and IJKL to move your hero, select another hero to change the camera.") - call s__AThirdPersonCamera_enable(s__AThirdPersonCamera_playerThirdPersonCamera(whichPlayer),udg_Hero[playerId] , 0.0) - set KeyMovementSystem__Unit[GetPlayerId((whichPlayer ))]=( udg_Hero[playerId]) // INLINED!! - call TimerStart(KeyMovementSystem__UpdateTimer, KeyMovementSystem_TIMER_INTERVAL, true, function KeyMovementSystem__TimerFunctionUpdate) // INLINED!! - call UnitAddTypeBJ(UNIT_TYPE_PEON, udg_Held[convertedPlayerId]) - call FogEnableOff() - call FogMaskEnableOff() - call ShowAllTextTagsForPlayer(whichPlayer , false) - endif - else - set udg_CamRPGPlayerEnabled[convertedPlayerId]=false - set udg_CamLockPlayerEnabled[convertedPlayerId]=false - call s__AThirdPersonCamera_disable(s__AThirdPersonCamera_playerThirdPersonCamera(whichPlayer)) - set KeyMovementSystem__Unit[GetPlayerId((whichPlayer))]=null // INLINED!! - call ResetToGameCameraForPlayer(whichPlayer, 0) - call UnitRemoveAbilityBJ('Abun', udg_Held[convertedPlayerId]) - call UnitRemoveTypeBJ(UNIT_TYPE_PEON, udg_Held[convertedPlayerId]) - call FogEnableOn() - call FogMaskEnableOn() - call ShowAllTextTagsForPlayer(whichPlayer , true) - endif - else - call SimError(whichPlayer , "Only available in singleplayer.") - endif -endfunction -//library WoWReforgedCamera ends -//library WoWReforgedClanShop: -function WoWReforgedClanShop___FilterIsClanShop takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == CLAN_SHOP -endfunction -function GetClanBannersCount takes nothing returns integer - return WoWReforgedClanShop___clanBannersCount -endfunction -function GetClanBanner takes integer index returns integer - return WoWReforgedClanShop___clanBanners[index] -endfunction -function GetClanBannerIndex takes integer itemTypeId returns integer - local integer max= (WoWReforgedClanShop___clanBannersCount) // INLINED!! - local integer i= 0 - loop - exitwhen ( i == max ) - if ( (WoWReforgedClanShop___clanBanners[(i)]) == itemTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function AddClanBanner takes integer itemTypeId returns integer - local integer index= WoWReforgedClanShop___clanBannersCount - set WoWReforgedClanShop___clanBanners[index]=itemTypeId - set WoWReforgedClanShop___clanBannersCount=WoWReforgedClanShop___clanBannersCount + 1 - return index -endfunction -function GetClanSoundsCount takes nothing returns integer - return WoWReforgedClanShop___clanSoundsCount -endfunction -function GetClanSoundItemTypeId takes integer index returns integer - return WoWReforgedClanShop___clanSoundsItemTypeIds[index] -endfunction -function GetClanSoundSound takes integer index returns sound - return WoWReforgedClanShop___clanSoundsSounds[index] -endfunction -function GetClanSoundName takes integer index returns string - return GetObjectName((WoWReforgedClanShop___clanSoundsItemTypeIds[(index)])) // INLINED!! -endfunction -function GetClanSoundIndex takes sound whichSound returns integer - local integer max= (WoWReforgedClanShop___clanSoundsCount) // INLINED!! - local integer i= 0 - loop - exitwhen ( i == max ) - if ( (WoWReforgedClanShop___clanSoundsSounds[(i)]) == whichSound ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetClanSoundIndexByItemTypeId takes integer itemTypeId returns integer - local integer max= (WoWReforgedClanShop___clanSoundsCount) // INLINED!! - local integer i= 0 - loop - exitwhen ( i == max ) - if ( (WoWReforgedClanShop___clanSoundsItemTypeIds[(i)]) == itemTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function AddClanSound takes integer itemTypeId,sound whichSound returns integer - local integer index= WoWReforgedClanShop___clanSoundsCount - set WoWReforgedClanShop___clanSoundsItemTypeIds[index]=itemTypeId - set WoWReforgedClanShop___clanSoundsSounds[index]=whichSound - set WoWReforgedClanShop___clanSoundsCount=WoWReforgedClanShop___clanSoundsCount + 1 - return index -endfunction -function WoWReforgedClanShop___AddClanShop takes unit shop returns nothing - local integer max= 0 - local integer i= 0 - - call EnablePagedButtons(shop) - call SetPagedButtonsSlotsPerPage(shop , 9) - - call NextPagedButtonsPage(shop , "Clan") -call AddPagedButtonsId((shop ) , ( CLAN_CREATE_CLAN) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! -call AddPagedButtonsId((shop ) , ( CLAN_TINY_CLAN_HALL) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - - call NextPagedButtonsPage(shop , "Clan Sounds") - set i=0 - set max=(WoWReforgedClanShop___clanSoundsCount) // INLINED!! - loop - exitwhen ( i == max ) -call AddPagedButtonsId((shop ) , ( (WoWReforgedClanShop___clanSoundsItemTypeIds[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop - - call NextPagedButtonsPage(shop , "Clan Banners") - set i=0 - set max=(WoWReforgedClanShop___clanBannersCount) // INLINED!! - loop - exitwhen ( i == max ) -call AddPagedButtonsId((shop ) , ( (WoWReforgedClanShop___clanBanners[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop - - call SetPagedButtonsPage(shop , 0) -endfunction -function WoWReforgedClanShop___ForGroupAddClanShop takes nothing returns nothing - call WoWReforgedClanShop___AddClanShop(GetEnumUnit()) -endfunction -function WoWReforgedClanShop___TimerFunctionAddClanShops takes nothing returns nothing - local timer t= GetExpiredTimer() - local group g= CreateGroup() - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), WoWReforgedClanShop___filterIsClanShop) - call ForGroup(g, function WoWReforgedClanShop___ForGroupAddClanShop) - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function WoWReforgedClanShop___TriggerConditionSellItem takes nothing returns boolean - local item i= GetSoldItem() - local integer itemTypeId= GetItemTypeId(i) - local integer soundIndex= GetClanSoundIndexByItemTypeId(itemTypeId) - local integer bannerIndex= GetClanBannerIndex(itemTypeId) - local player owner= GetOwningPlayer(GetBuyingUnit()) - local integer clan= udg_ClanPlayerClan[GetConvertedPlayerId(owner)] - if ( soundIndex != - 1 ) then - if ( clan != 0 ) then - if ( udg_ClanPlayerRank[GetConvertedPlayerId(owner)] == udg_ClanRankLeader ) then - set udg_ClanSound[clan]=(WoWReforgedClanShop___clanSoundsSounds[(soundIndex)]) // INLINED!! - call h__DisplayTimedTextToPlayer(owner, 0.0, 0.0, 4.0, "Changed clan sound to: " + GetItemName(i)) - else - call SimError(owner , "Your clan rank must be Leader.") - endif - else - call SimError(owner , "You need a clan.") - endif - call h__RemoveItem(i) - elseif ( bannerIndex != - 1 ) then - if ( clan != 0 ) then - if ( udg_ClanPlayerRank[GetConvertedPlayerId(owner)] == udg_ClanRankLeader ) then - set udg_ClanIcon[clan]=itemTypeId - call h__DisplayTimedTextToPlayer(owner, 0.0, 0.0, 4.0, "Changed clan banner to: " + GetItemName(i)) - else - call SimError(owner , "Your clan rank must be Leader.") - endif - else - call SimError(owner , "You need a clan.") - endif - call h__RemoveItem(i) - endif - set i=null - set owner=null - return false -endfunction -function WoWReforgedClanShop___Init takes nothing returns nothing - set WoWReforgedClanShop___filterIsClanShop=Filter(function WoWReforgedClanShop___FilterIsClanShop) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedClanShop___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedClanShop___sellTrigger, Condition(function WoWReforgedClanShop___TriggerConditionSellItem)) - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedClanShop___TimerFunctionAddClanShops) - - call AddClanSound(CLAN_HORN_SOUND , gg_snd_TheHornOfCenarius) - call AddClanSound(CLAN_LAUGH_SOUND , gg_snd_SargerasLaugh) - - call AddClanBanner(CLAN_BANNER_HUMAN) - call AddClanBanner(CLAN_BANNER_ORC) - call AddClanBanner(CLAN_BANNER_UNDEAD) - call AddClanBanner(CLAN_BANNER_NIGHT_ELF) - call AddClanBanner(CLAN_BANNER_PANDAREN) - call AddClanBanner(CLAN_BANNER_DWARF) - call AddClanBanner(CLAN_BANNER_GNOME) -endfunction -//library WoWReforgedClanShop ends -//library WoWReforgedEquipmentBags: -function GetMaxEquipmentBags takes player whichPlayer returns integer - local integer heroLevel= GetHighestHeroLevel(whichPlayer) - if ( heroLevel >= HERO_JOURNEY_EQUIPMENT_BAG_1 ) then - if ( heroLevel >= HERO_JOURNEY_EQUIPMENT_BAG_2 ) then - if ( heroLevel >= HERO_JOURNEY_EQUIPMENT_BAG_3 ) then - return MAX_EQUIPMENT_BAGS - endif - - return 2 - endif - - return 1 - endif - - return 0 -endfunction -function GetEquipmentBagsCount takes player whichPlayer returns integer - return BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) -endfunction -function EquipmentBagListItemTypeIds takes nothing returns string - local string result= "" - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedEquipmentBags___registeredItemTypeIdsCounter ) - if ( i > 0 ) then - set result=result + ", " - endif - set result=result + GetObjectName(WoWReforgedEquipmentBags___registeredItemTypeIds[i]) - set i=i + 1 - endloop - return result -endfunction -function EquipmentBagSetAbilityCount takes integer itemTypeId,integer count returns nothing - call SaveInteger(WoWReforgedEquipmentBags___h, itemTypeId, 0, count) -endfunction -function EquipmentBagGetAbilityCount takes integer itemTypeId returns integer - return LoadInteger(WoWReforgedEquipmentBags___h, itemTypeId, 0) -endfunction -function EquipmentBagGetAbilityId takes integer itemTypeId,integer index returns integer - return LoadInteger(WoWReforgedEquipmentBags___h, itemTypeId, index) -endfunction -function EquipmentBagGetAbilityIdStacking takes integer itemTypeId,integer abilityId returns boolean - return LoadBoolean(WoWReforgedEquipmentBags___stackingHashTable, itemTypeId, abilityId) -endfunction -function EquipmentBagRegisterAbilityEx takes integer itemTypeId,integer abilityId,boolean stacking returns nothing - local integer i= 0 - local boolean found= false - local integer count= (LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId), 0)) + 1 // INLINED!! - call SaveInteger(WoWReforgedEquipmentBags___h, itemTypeId, count, abilityId) - call SaveBoolean(WoWReforgedEquipmentBags___stackingHashTable, itemTypeId, abilityId, stacking) - call SaveInteger(WoWReforgedEquipmentBags___h, (itemTypeId ), 0, ( count)) // INLINED!! - // we store all item type IDs for player information - loop - exitwhen ( i >= WoWReforgedEquipmentBags___registeredItemTypeIdsCounter or found ) - if ( WoWReforgedEquipmentBags___registeredItemTypeIds[i] == itemTypeId ) then - set found=true - endif - set i=i + 1 - endloop - if ( not found ) then - set WoWReforgedEquipmentBags___registeredItemTypeIds[WoWReforgedEquipmentBags___registeredItemTypeIdsCounter]=itemTypeId - set WoWReforgedEquipmentBags___registeredItemTypeIdsCounter=WoWReforgedEquipmentBags___registeredItemTypeIdsCounter + 1 - endif -endfunction -function EquipmentBagRegisterAbility takes nothing returns nothing - call EquipmentBagRegisterAbilityEx(udg_TmpItemTypeId , udg_TmpAbilityCode , udg_TmpBoolean) -endfunction -function EquipmentBagAddAbilities takes unit bag,item whichItem returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(bag)) - local integer itemTypeId= GetItemTypeId(whichItem) - local integer count= (LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId), 0)) // INLINED!! - local integer abilityId= 0 - local boolean stacking= false - local unit hero= udg_Hero[playerId] - local integer i= 1 - if ( hero != null ) then - loop - exitwhen ( i > count ) - set abilityId=(LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId ), ( i))) // INLINED!! - set stacking=(LoadBoolean(WoWReforgedEquipmentBags___stackingHashTable, (itemTypeId ), ( abilityId))) // INLINED!! - if ( stacking or GetUnitAbilityLevel(hero, abilityId) <= 0 ) then - call UnitAddAbility(hero, abilityId) - endif - set i=i + 1 - endloop - endif - set hero=null -endfunction -function WoWReforgedEquipmentBags___CountItemsOfTypeFromHero takes unit hero,integer itemTypeId returns integer - local item whichItem= null - local integer count= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set whichItem=UnitItemInSlot(hero, i) - if ( whichItem != null and GetItemTypeId(whichItem) == itemTypeId ) then - set count=count + 1 - endif - set whichItem=null - set i=i + 1 - endloop - return count -endfunction -function EquipmentBagRemoveAbilities takes unit bag,item whichItem returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(bag)) - local integer itemTypeId= GetItemTypeId(whichItem) - local integer count= (LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId), 0)) // INLINED!! - local integer abilityId= 0 - local boolean stacking= false - local unit hero= udg_Hero[playerId] - local integer i= 1 - if ( hero != null ) then - loop - exitwhen ( i > count ) - set abilityId=(LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId ), ( i))) // INLINED!! - set stacking=(LoadBoolean(WoWReforgedEquipmentBags___stackingHashTable, (itemTypeId ), ( abilityId))) // INLINED!! - if ( stacking or WoWReforgedEquipmentBags___CountItemsOfTypeFromHero(hero , itemTypeId) == 0 ) then - call UnitRemoveAbility(hero, abilityId) - endif - set i=i + 1 - endloop - endif - set hero=null -endfunction -function RemoveEquipmentBags takes player whichPlayer returns nothing - local integer max= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! - local unit equipmentBag= null - local integer i= 0 - loop - exitwhen ( i >= max ) - set equipmentBag=BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) - call DropAllItemsFromHero(equipmentBag) - call DisableItemCraftingUnit(equipmentBag) - call h__RemoveUnit(equipmentBag) - set equipmentBag=null - set i=i + 1 - endloop - call GroupClear(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) -endfunction -function UpdateEquipmentBagHeroLevels takes player whichPlayer returns nothing - local integer highHeroLevel= GetHighestHeroLevel(whichPlayer) - local integer max= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! - local unit equipmentBag= null - local integer i= 0 - loop - exitwhen ( i >= max ) - set equipmentBag=BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) - call SuspendHeroXP(equipmentBag, false) - if ( GetHeroLevel(equipmentBag) < highHeroLevel ) then - call SetHeroLevel(equipmentBag, highHeroLevel, true) - endif - call SuspendHeroXP(equipmentBag, true) - set equipmentBag=null - set i=i + 1 - endloop - //call BJDebugMsg("Update equipment bag hero levels to highest hero level " + I2S(highHeroLevel)) -endfunction -function WoWReforgedEquipmentBags___CreateSingleEquipmentBag takes player whichPlayer,integer index returns unit - local integer playerId= GetPlayerId(whichPlayer) - local unit equipmentBag= CreateUnit(whichPlayer, EQUIPMENT_BAG, GetUnitX(udg_Hero[playerId]), GetUnitY(udg_Hero[playerId]), bj_UNIT_FACING) - local string equipmentBagName= "Equipment Bag " + I2S(index) - call SuspendHeroXP(equipmentBag, true) - call GroupAddUnit(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], equipmentBag) - call UnitRemoveAbility(equipmentBag, 'A02N') - call UnitAddAbility(equipmentBag, 'AInv') - call BlzSetUnitName(equipmentBag, equipmentBagName) - call BlzSetHeroProperName(equipmentBag, equipmentBagName) - return equipmentBag -endfunction -function CreateEquipmentBags takes player whichPlayer,integer equipmentBags returns nothing - local integer max= GetMaxEquipmentBags(whichPlayer) - local integer i= 0 - loop - exitwhen ( i >= max ) - call WoWReforgedEquipmentBags___CreateSingleEquipmentBag(whichPlayer , (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) + 1) // INLINED!! - set i=i + 1 - endloop - call UpdateEquipmentBagHeroLevels(whichPlayer) - call LinkItemCraftingGroupInventories(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) -endfunction -function WoWReforgedEquipmentBags___ForGroupRemoveUnit takes nothing returns nothing - //call BJDebugMsg("Remove 1") - call DropAllItemsFromHero(GetEnumUnit()) - //call BJDebugMsg("Remove 2") - call DisableItemCraftingUnit(GetEnumUnit()) - //call BJDebugMsg("Remove 3") - call h__RemoveUnit(GetEnumUnit()) - //call BJDebugMsg("Remove 4") -endfunction -function RecreateEquipmentBags takes player whichPlayer,integer equipmentBags returns nothing - local integer oldMax= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! - local integer max= IMaxBJ(oldMax, equipmentBags) - local unit equipmentBag= null - local integer sourceHandleId= 0 - local group oldBags= CopyGroup(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) - local group removingBags= CreateGroup() - local integer i= 0 - set max=IMinBJ(max, GetMaxEquipmentBags(whichPlayer)) - loop - exitwhen ( i >= max ) - //call BJDebugMsg("Equipment bags old max " + I2S(oldMax) + " and max " + I2S(max) + " and i " + I2S(i)) - if ( i < oldMax ) then - set equipmentBag=BlzGroupUnitAt(oldBags, i) - //call BJDebugMsg("Adding bag with ID " + I2S(GetHandleId(equipmentBag))) - call GroupAddUnit(removingBags, equipmentBag) - set sourceHandleId=GetHandleId(equipmentBag) - else - set sourceHandleId=0 - endif - set equipmentBag=WoWReforgedEquipmentBags___CreateSingleEquipmentBag(whichPlayer , i + 1) - if ( sourceHandleId > 0 ) then - call ApplyAllHeroLearnedSkills(equipmentBag , sourceHandleId) - endif - set equipmentBag=null - set i=i + 1 - endloop - //call BJDebugMsg("Remove 1 old equipment bags with count " + I2S(CountUnitsInGroup(removingBags))) - call GroupRemoveGroup(removingBags, udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) - //call BJDebugMsg("Remove 2 old equipment bags with count " + I2S(CountUnitsInGroup(removingBags))) - call ForGroup(removingBags, function WoWReforgedEquipmentBags___ForGroupRemoveUnit) - call GroupClear(removingBags) - call DestroyGroup(removingBags) - set removingBags=null - call GroupClear(oldBags) - call DestroyGroup(oldBags) - set oldBags=null - call UpdateEquipmentBagHeroLevels(whichPlayer) - call LinkItemCraftingGroupInventories(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) -endfunction -function ResetEquipmentBags takes player whichPlayer returns nothing - //call BJDebugMsg("Equipment bags size " + I2S(GetEquipmentBagsCount(whichPlayer))) - call ForGroup(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], function WoWReforgedEquipmentBags___ForGroupRemoveUnit) - call GroupClear(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) -endfunction -function AddEquipmentBag takes player whichPlayer returns nothing - local integer max= GetMaxEquipmentBags(whichPlayer) - if ( (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) < max ) then // INLINED!! - call WoWReforgedEquipmentBags___CreateSingleEquipmentBag(whichPlayer , (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) + 1) // INLINED!! - call UpdateEquipmentBagHeroLevels(whichPlayer) - call LinkItemCraftingGroupInventories(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) - else - call SimError(whichPlayer , "Maximum number of equipment bags: " + I2S(max)) - endif -endfunction -function RecreateAllEquipmentBags takes player whichPlayer returns nothing - local integer count= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! - call RecreateEquipmentBags(whichPlayer , count) -endfunction -//library WoWReforgedEquipmentBags ends -//library WoWReforgedEvolution: -function WoWReforgedEvolution__FilterIsEvolutionAffected takes nothing returns boolean - local unit filterUnit= GetFilterUnit() - local boolean result= not IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and not IsUnitType(filterUnit, UNIT_TYPE_HERO) and not IsUnitIllusion(filterUnit) - set filterUnit=null - return result -endfunction -function WoWReforgedEvolution__SetUnitEvolutionFields takes unit whichUnit,integer evolutionLevel,integer level,real armor returns nothing - //local integer lifeBonus = evolutionLevel * 50 - // devotion aura etc. - // do not kill summoned units with timed life buffs - call UnitRemoveBuffsEx(whichUnit, true, true, true, true, false, true, true) - call BlzSetUnitIntegerField(whichUnit, UNIT_IF_LEVEL, level) - call BlzSetUnitRealField(whichUnit, UNIT_RF_DEFENSE, armor) - // Using the research instead leads to an overflow and negative maximum life. - //call BlzSetUnitMaxHP(whichUnit, R2I(GetUnitState(whichUnit, UNIT_STATE_MAX_LIFE)) + lifeBonus) - //call SetUnitState(whichUnit, UNIT_STATE_LIFE, GetUnitState(whichUnit, UNIT_STATE_LIFE) + I2R(lifeBonus)) -endfunction -function WoWReforgedEvolution__SetEvolutionLevelEx takes player whichPlayer,integer levels returns nothing - local integer bonus= levels / 10 - local group units= CreateGroup() - local unit member= null - local integer i= 0 - local integer max= 0 - call GroupEnumUnitsOfPlayer(units, whichPlayer, Filter(function WoWReforgedEvolution__FilterIsEvolutionAffected)) - set max=BlzGroupGetSize(units) - loop - exitwhen ( i == max ) - set member=BlzGroupUnitAt(units, i) - call WoWReforgedEvolution__SetUnitEvolutionFields(member , levels , BlzGetUnitIntegerField(member, UNIT_IF_LEVEL) + bonus , BlzGetUnitRealField(member, UNIT_RF_DEFENSE) + I2R(bonus)) - set member=null - set i=i + 1 - endloop - call GroupClear(units) - call DestroyGroup(units) - set units=null -endfunction -function WoWReforgedEvolution__SetEvolutionLevel takes player whichPlayer,integer levels returns nothing - if ( levels != 0 ) then - call WoWReforgedEvolution__SetEvolutionLevelEx(whichPlayer , levels) - endif -endfunction -function SetEvolutionLevelOfPlayer takes player whichPlayer,integer level returns nothing - call h__SetPlayerTechResearched(whichPlayer, UPG_EVOLUTION, level) -endfunction -function GetEvolutionLevelOfPlayer takes player whichPlayer returns integer - return GetPlayerTechCountSimple(UPG_EVOLUTION, whichPlayer) -endfunction -function SetEvolution takes unit whichUnit returns nothing - local player owner= GetOwningPlayer(whichUnit) - local integer evolutionLevel= (GetPlayerTechCountSimple(UPG_EVOLUTION, (owner))) // INLINED!! - local integer bonus= evolutionLevel / 10 - local integer unitTypeId= GetUnitTypeId(whichUnit) - if ( bonus != 0 ) then - call WoWReforgedEvolution__SetUnitEvolutionFields(whichUnit , evolutionLevel , GetUnitLevelByType(unitTypeId , owner) + bonus , GetUnitDefenseByType(unitTypeId , owner) + R2I(bonus)) - endif - set owner=null -endfunction -function AddEvolution takes unit whichUnit returns nothing - local integer evolutionLevel= (GetPlayerTechCountSimple(UPG_EVOLUTION, (GetOwningPlayer(whichUnit)))) // INLINED!! - local integer bonus= evolutionLevel / 10 - if ( bonus != 0 ) then - call WoWReforgedEvolution__SetUnitEvolutionFields(whichUnit , evolutionLevel , BlzGetUnitIntegerField(whichUnit, UNIT_IF_LEVEL) + bonus , BlzGetUnitRealField(whichUnit, UNIT_RF_DEFENSE) + I2R(bonus)) - endif -endfunction -function UpgradeEvolution takes player whichPlayer returns nothing - call WoWReforgedEvolution__SetEvolutionLevel(whichPlayer , 1) -endfunction -function SetEvolutionLevelForCreeps takes integer level returns nothing - call h__SetPlayerTechResearched((Player(PLAYER_NEUTRAL_AGGRESSIVE) ), UPG_EVOLUTION, ( level)) // INLINED!! - call h__SetPlayerTechResearched((udg_BossesPlayer ), UPG_EVOLUTION, ( level)) // INLINED!! -endfunction -function WoWReforgedEvolution__HookSetPlayerTechResearched takes player whichPlayer,integer techid,integer setToLevel returns nothing - if ( techid == UPG_EVOLUTION ) then - call WoWReforgedEvolution__SetEvolutionLevel(whichPlayer , setToLevel - (GetPlayerTechCountSimple(UPG_EVOLUTION, (whichPlayer)))) // INLINED!! - endif -endfunction -function WoWReforgedEvolution__HookAddPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing - if ( techid == UPG_EVOLUTION ) then - call WoWReforgedEvolution__SetEvolutionLevel(whichPlayer , levels) - endif -endfunction -function WoWReforgedEvolution__HookBlzDecPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing - if ( techid == UPG_EVOLUTION ) then - call WoWReforgedEvolution__SetEvolutionLevel(whichPlayer , - levels) - endif -endfunction -//processed hook: hook SetPlayerTechResearched WoWReforgedEvolution__HookSetPlayerTechResearched -//processed hook: hook AddPlayerTechResearched WoWReforgedEvolution__HookAddPlayerTechResearched -//processed hook: hook BlzDecPlayerTechResearched WoWReforgedEvolution__HookBlzDecPlayerTechResearched -//library WoWReforgedEvolution ends -//library WoWReforgedHeroes: -function WoWReforgedHeroes___AddHeroPagedButtonsConfig takes integer id,string modelPath returns nothing - call AddPagedButtonsConfigHero(id , 0 , 0 , 1 , 1 , 0 , 0 , modelPath) -endfunction -function GetHeroesMax takes nothing returns integer - return udg_HeroUnitTypeIndex -endfunction -function GetHeroRace takes integer index returns integer - return udg_HeroRace[index] -endfunction -function GetHeroUnitType takes integer index returns integer - return udg_HeroUnitType[index] -endfunction -function GetHeroIsBonus takes integer index returns boolean - return udg_HeroIsBonus[index] -endfunction -function GetHeroIndexByUnitTypeId takes integer unitTypeId returns integer - local integer i= 0 - loop - exitwhen ( i >= udg_MaxHeroUnitTypes ) - if ( (udg_HeroUnitType[(i)]) == unitTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function PlayerCanBuyHeroEx takes player whichPlayer,integer unitTypeId returns boolean - local integer index= GetHeroIndexByUnitTypeId(unitTypeId) - if ( index > - 1 ) then - return PlayerHasUnlocked(whichPlayer , (udg_HeroUnitType[(index)])) and ( not (udg_HeroIsBonus[(index)]) or GetHeroLevel1(whichPlayer) >= HERO_JOURNEY_BONUS_HEROS or udg_UnlockedAll ) // INLINED!! - endif - return true -endfunction -function PlayerCanBuyHero takes player whichPlayer,unit hero returns boolean - return PlayerCanBuyHeroEx(whichPlayer , GetUnitTypeId(hero)) -endfunction -function PlayerCanBuyHeroErrorMessageEx takes player whichPlayer,integer unitTypeId returns string - local integer index= GetHeroIndexByUnitTypeId(unitTypeId) - if ( index > - 1 ) then - if ( not PlayerHasUnlocked(whichPlayer , (udg_HeroUnitType[(index)])) ) then // INLINED!! - return "Hero is restricted to accounts: " + GetAllUnlockedAccountNames((udg_HeroUnitType[(index)])) // INLINED!! - elseif ( (udg_HeroIsBonus[(index)]) and GetHeroLevel1(whichPlayer) < HERO_JOURNEY_BONUS_HEROS and not udg_UnlockedAll ) then // INLINED!! - return "Bonus hero requires hero level " + I2S(HERO_JOURNEY_BONUS_HEROS) + " or \"-unlock\"." - endif - endif - return "" -endfunction -function PlayerCanBuyHeroErrorMessage takes player whichPlayer,unit hero returns string - return PlayerCanBuyHeroErrorMessageEx(whichPlayer , GetUnitTypeId(hero)) -endfunction -function AddHeroWoWReforged takes nothing returns integer - local integer index= udg_HeroUnitTypeIndex - set udg_HeroUnitType[index]=udg_TmpUnitType - set udg_HeroRace[index]=udg_TmpInteger - set udg_HeroIsBonus[index]=udg_TmpBoolean - set udg_HeroCategory[index]=udg_TmpString - set udg_HeroAccountNames[index]=udg_TmpString2 - set udg_HeroUnitTypeIndex=udg_HeroUnitTypeIndex + 1 - set udg_MaxHeroUnitTypes=udg_HeroUnitTypeIndex - - call AddPagedButtonsConfigHero((udg_TmpUnitType ) , 0 , 0 , 1 , 1 , 0 , 0 , ( udg_TmpString3)) // INLINED!! - - if ( udg_TmpBoolean2 ) then - call SaveBoolean(ObjectDataFields___h, (udg_TmpUnitType ), ( OBJECT_DATA_FIELD_UCAM ), ( true)) // INLINED!! - endif - - - set udg_TmpBoolean=false - set udg_TmpBoolean2=false - set udg_TmpString2="" - set udg_TmpString3="" - - return index -endfunction -function AddHeroAbilityWoWReforged takes nothing returns nothing - //call AddObjectIdIntegerListFieldValue(udg_TmpUnitType, OBJECT_DATA_FIELD_UHAB, udg_TmpAbilityCode) - call RegisterHeroAbilityEx(udg_TmpUnitType , udg_TmpAbilityCode , MAX_HERO_SPELL_LEVEL) -endfunction -function GetHeroCategory takes integer index returns string - return udg_HeroCategory[index] -endfunction -function ChooseRandomHeroFromRace takes integer whichRace returns integer - local integer array heroIndices - local integer heroIndicesCounter= 0 - local integer i= 0 - loop - exitwhen ( i >= udg_MaxHeroUnitTypes ) - if ( ( udg_HeroRace[i] == whichRace or whichRace == udg_RaceFreelancer ) ) then - //call BJDebugMsg("Adding index " + I2S(i) + " possible heroes for race " + GetObjectName(udg_RaceTavernItemType[whichRace]) + ": " + GetObjectName(udg_HeroUnitType[i])) - set heroIndices[heroIndicesCounter]=i - set heroIndicesCounter=heroIndicesCounter + 1 - endif - set i=i + 1 - endloop - - //call BJDebugMsg("Got " + I2S(heroIndicesCounter) + " possible heroes for race " + GetObjectName(udg_RaceTavernItemType[whichRace])) - - if ( heroIndicesCounter > 0 ) then - return heroIndices[GetRandomInt(0, heroIndicesCounter - 1)] - endif - - return 0 -endfunction -//library WoWReforgedHeroes ends -//library WoWReforgedKnockbackSimple: -////////////////////Vexorian's Check Pathability//////////////////// -function CheckPathabilityTrickGet takes nothing returns nothing - set bj_rescueChangeColorUnit=bj_rescueChangeColorUnit or ( GetEnumItem() != bj_itemRandomCurrentPick ) -endfunction -function CheckPathabilityTrick takes real x,real y returns boolean - local integer i= 30 - local real X - local real Y - local rect r - call SetItemPosition(It, x, y) - set X=GetItemX(It) - x - set Y=GetItemY(It) - y - if X * X + Y * Y <= 100 then - return true - endif - set r=Rect(x - i, y - i, x + i, y + i) - set bj_rescueChangeColorUnit=false - call EnumItemsInRect(r, null, function CheckPathabilityTrickGet) - call RemoveRect(r) - set r=null - return bj_rescueChangeColorUnit -endfunction -function CheckPathability takes real x,real y returns boolean - local boolean b= CheckPathabilityTrick(x , y) - call SetItemVisible(It, false) - return b -endfunction -/////////////////////////////////////////////////////////////////// -function Knockback_TreeFilter takes nothing returns boolean - return (IsTree(GetDestructableTypeId((GetFilterDestructable())))) // INLINED!! -endfunction -function Knockback_KillTree takes nothing returns nothing - call KillDestructable(GetEnumDestructable()) -endfunction -function WoWReforgedKnockbackSimple__Loop takes nothing returns nothing - local integer knock - local integer i= 0 - local real x - local real y - local rect r - loop - exitwhen i >= Total - set knock=ar[i] - set x=GetUnitX(s__WoWReforgedKnockbackSimple__KnockbackS_target[knock]) + s__WoWReforgedKnockbackSimple__KnockbackS_d1[knock] * s__WoWReforgedKnockbackSimple__KnockbackS_cos[knock] - set y=GetUnitY(s__WoWReforgedKnockbackSimple__KnockbackS_target[knock]) + s__WoWReforgedKnockbackSimple__KnockbackS_d1[knock] * s__WoWReforgedKnockbackSimple__KnockbackS_sin[knock] - if s__WoWReforgedKnockbackSimple__KnockbackS_r[knock] != 0 then - set r=Rect(x - s__WoWReforgedKnockbackSimple__KnockbackS_r[knock], y - s__WoWReforgedKnockbackSimple__KnockbackS_r[knock], x + s__WoWReforgedKnockbackSimple__KnockbackS_r[knock], y + s__WoWReforgedKnockbackSimple__KnockbackS_r[knock]) - call EnumDestructablesInRect(r, filter, function Knockback_KillTree) - call RemoveRect(r) - endif - if CheckPathability(x , y) then - call SetUnitX(s__WoWReforgedKnockbackSimple__KnockbackS_target[knock], x) - call SetUnitY(s__WoWReforgedKnockbackSimple__KnockbackS_target[knock], y) - call DestroyEffect(AddSpecialEffectTargetUnitBJ(s__WoWReforgedKnockbackSimple__KnockbackS_attachmentPoint[knock], s__WoWReforgedKnockbackSimple__KnockbackS_target[knock], s__WoWReforgedKnockbackSimple__KnockbackS_efect[knock])) - endif - set s__WoWReforgedKnockbackSimple__KnockbackS_d1[knock]=s__WoWReforgedKnockbackSimple__KnockbackS_d1[knock] - s__WoWReforgedKnockbackSimple__KnockbackS_d2[knock] - if s__WoWReforgedKnockbackSimple__KnockbackS_d1[knock] <= 0 or not CheckPathability(x , y) then - set ar[i]=ar[Total - 1] - set Total=Total - 1 - call PauseUnit(s__WoWReforgedKnockbackSimple__KnockbackS_target[knock], false) - call GroupRemoveUnit(knockbackTargets, s__WoWReforgedKnockbackSimple__KnockbackS_target[knock]) - call s__WoWReforgedKnockbackSimple__KnockbackS_deallocate(knock) - endif - set i=i + 1 - endloop - if Total == 0 then - call PauseTimer(Timer) - endif -endfunction -function KnockbackUnitSimple takes unit target,real distance,real angle,real duration,real radius,string efect,string attachmentPoint returns nothing - local integer kd= s__WoWReforgedKnockbackSimple__KnockbackS__allocate() - local integer q= R2I(duration / Interval) - set s__WoWReforgedKnockbackSimple__KnockbackS_target[kd]=target - set s__WoWReforgedKnockbackSimple__KnockbackS_d1[kd]=2 * distance / ( q + 1 ) - set s__WoWReforgedKnockbackSimple__KnockbackS_d2[kd]=s__WoWReforgedKnockbackSimple__KnockbackS_d1[kd] / q - set s__WoWReforgedKnockbackSimple__KnockbackS_cos[kd]=Cos(angle * bj_DEGTORAD) - set s__WoWReforgedKnockbackSimple__KnockbackS_sin[kd]=Sin(angle * bj_DEGTORAD) - set s__WoWReforgedKnockbackSimple__KnockbackS_r[kd]=radius - set s__WoWReforgedKnockbackSimple__KnockbackS_efect[kd]=efect - set s__WoWReforgedKnockbackSimple__KnockbackS_attachmentPoint[kd]=attachmentPoint - call PauseUnit(target, true) - if Total == 0 then - call TimerStart(Timer, Interval, true, function WoWReforgedKnockbackSimple__Loop) - endif - set ar[Total]=kd - set Total=Total + 1 - call GroupAddUnit(knockbackTargets, target) -endfunction -function GetKnockbackTargets takes nothing returns group - return knockbackTargets -endfunction -function IsUnitKnockbackTarget takes unit whichUnit returns boolean - return IsUnitInGroup(whichUnit, knockbackTargets) -endfunction -function WoWReforgedKnockbackSimple__Init takes nothing returns nothing - set knockbackTargets=CreateGroup() - set It=CreateItem('ciri', 0, 0) - set filter=Filter(function Knockback_TreeFilter) -endfunction -//library WoWReforgedKnockbackSimple ends -//library WoWReforgedLearnableSkillsShop: -function GetSkillShopCooldownTimer takes player whichPlayer,integer slot returns timer - return WoWReforgedLearnableSkillsShop___cooldownTimer[Index2D(GetPlayerId(whichPlayer) , slot , RESKILL_MAX_SLOTS)] -endfunction -function GetSkillSlotFromShopType takes integer unitTypeId returns integer - if ( unitTypeId == SPELL_BOOK ) then - return - 1 - elseif ( unitTypeId == HERO_SPELLS_SLOT_1 ) then - return 0 - elseif ( unitTypeId == HERO_SPELLS_SLOT_2 ) then - return 1 - elseif ( unitTypeId == HERO_SPELLS_SLOT_3 ) then - return 2 - elseif ( unitTypeId == HERO_SPELLS_SLOT_4 ) then - return 3 - elseif ( unitTypeId == HERO_SPELLS_SLOT_5 ) then - return 4 - endif - return - 1 -endfunction -function WoWReforgedLearnableSkillsShop___AddLearnableSkillsToShop takes unit shop returns nothing - local integer slot= GetSkillSlotFromShopType(GetUnitTypeId(shop)) - local integer max= (WoWReforgedLearnableSkills___learnableSkillCounter) // INLINED!! - local integer currentSlot= - 1 - local integer i= 0 - //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - call EnablePagedButtons(shop) - call SetPagedButtonsSlotsPerPage(shop , 9) - loop - exitwhen ( i >= max ) - if ( slot == - 1 or (WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) == slot ) then // INLINED!! - if ( slot == - 1 and ( currentSlot == - 1 or currentSlot != (WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) ) ) then // INLINED!! - call NextPagedButtonsPage(shop , "Slot " + I2S(slot + 1)) - endif - set currentSlot=(WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) // INLINED!! -call AddPagedButtonsId((shop ) , ( (WoWReforgedLearnableSkills___learnableSkillLearnItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - endif - //call BJDebugMsg("Skill " + I2S(i)) // Stops at 189 - set i=i + 1 - endloop - //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - - //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") -endfunction -function IsEquipmentBag takes integer unitTypeId returns boolean - return unitTypeId == EQUIPMENT_BAG -endfunction -function IsAllowedToReskillEquipmentBag takes player whichPlayer returns boolean - return GetHeroLevel1(whichPlayer) >= RESKILL_HERO_LEVEL or udg_VIPOnForPlayer[GetConvertedPlayerId(whichPlayer)] or udg_UnlockedAll -endfunction -function WoWReforgedLearnableSkillsShop___TriggerAction1SellItem takes nothing returns nothing - local unit shop= GetSellingUnit() - local integer slot= GetSkillSlotFromShopType(GetUnitTypeId(shop)) - local unit hero= GetBuyingUnit() - local player owner= GetOwningPlayer(hero) - local integer unitTypeId= GetUnitTypeId(hero) - local integer itemTypeId= GetItemTypeId(GetSoldItem()) - local integer shopUnitTypeId= GetUnitTypeId(shop) - local integer index= GetLearnableSkillByLearnItemTypeId(itemTypeId) - if ( index != - 1 ) then - if ( ( ((unitTypeId) == EQUIPMENT_BAG) and IsAllowedToReskillEquipmentBag(owner) ) or ( not ((unitTypeId) == EQUIPMENT_BAG) and IsReskillableHero(unitTypeId) ) ) then // INLINED!! - if ( not ((GetUnitTypeId(hero)) == EQUIPMENT_BAG) or not (WoWReforgedLearnableSkills___learnableSkillForbidEquipmentBag[(index)]) ) then // INLINED!! - if ( RectContainsUnit(gg_rct_Player_Selection, hero) or TimerGetRemaining((WoWReforgedLearnableSkillsShop___cooldownTimer[Index2D(GetPlayerId((owner )) , ( (WoWReforgedLearnableSkills___learnableSkillSlot[(index)])) , RESKILL_MAX_SLOTS)])) <= 0.0 ) then // INLINED!! - call DisableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! - call UnskillHero(hero) - call ResetLearnableSkillsForHero(hero , (WoWReforgedLearnableSkills___learnableSkillSlot[(index)])) // INLINED!! - call AddLearnableSkillToHero(hero , index) - call EnableTrigger(WoWReforgedHeroSkills___unlearnTrigger) // INLINED!! - call ApplyAllHeroLearnedSkills(hero , GetHandleId(hero)) // TODO Get the ability IDs before learning. - call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Added ability " + GetObjectName((WoWReforgedLearnableSkills___learnableSkillAbilityId[(index)]))) // INLINED!! - // cooldown is annoying - //call TimerStart(GetSkillShopCooldownTimer(owner, GetLearnableSkillSlot(index)), 60.0, false, null) - else - call SimError(owner , "Wait " + FormatTime(TimerGetRemaining((WoWReforgedLearnableSkillsShop___cooldownTimer[Index2D(GetPlayerId((owner )) , ( (WoWReforgedLearnableSkills___learnableSkillSlot[(index)])) , RESKILL_MAX_SLOTS)]))) + " until you can learn another skill from slot " + I2S(slot + 1) + ".") // INLINED!! - endif - else - call SimError(owner , "This spell is not allowed for Equipment Backpacks.") - endif - else - call SimError(owner , "Only the Void Lord hero, Archangel hero, Sea Giant hero or Equipment Backpacks at hero level 75 can change their hero abilities.") - endif - //else - //call BJDebugMsg("No matching learnable skill for item " + GetItemName(GetSoldItem())) - endif - set shop=null - set hero=null - set owner=null -endfunction -function WoWReforgedLearnableSkillsShop___TriggerConditionConstructed takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == SPELL_BOOK ) then - call WoWReforgedLearnableSkillsShop___AddLearnableSkillsToShop(GetConstructedStructure()) - endif - return false -endfunction -function WoWReforgedLearnableSkillsShop___TriggerConditionSummoned takes nothing returns boolean - if ( GetUnitTypeId(GetSummonedUnit()) == SPELL_BOOK ) then - call WoWReforgedLearnableSkillsShop___AddLearnableSkillsToShop(GetSummonedUnit()) - endif - return false -endfunction -function WoWReforgedLearnableSkillsShop___TriggerConditionDeath takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == SPELL_BOOK ) then - // TODO Disable shop manually? - //call ClearSkillsShop(GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedLearnableSkillsShop___ForGroupEnableShop takes nothing returns nothing - call WoWReforgedLearnableSkillsShop___AddLearnableSkillsToShop(GetEnumUnit()) -endfunction -function WoWReforgedLearnableSkillsShop___FilterBuilding takes nothing returns boolean - local integer unitTypeId= GetUnitTypeId(GetFilterUnit()) - return unitTypeId == HERO_SPELLS_SLOT_1 or unitTypeId == HERO_SPELLS_SLOT_2 or unitTypeId == HERO_SPELLS_SLOT_3 or unitTypeId == HERO_SPELLS_SLOT_4 or unitTypeId == HERO_SPELLS_SLOT_5 -endfunction -function WoWReforgedLearnableSkillsShop___UpdateAllShops takes nothing returns nothing - local group g= CreateGroup() - - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedLearnableSkillsShop___FilterBuilding)) - call ForGroup(g, function WoWReforgedLearnableSkillsShop___ForGroupEnableShop) - - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function WoWReforgedLearnableSkillsShop___Init takes nothing returns nothing - local integer j= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set j=0 - loop - exitwhen ( j >= 5 ) - set WoWReforgedLearnableSkillsShop___cooldownTimer[Index2D(i , j , 5)]=CreateTimer() - set j=j + 1 - endloop - set i=i + 1 - endloop - call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddAction(WoWReforgedLearnableSkillsShop___sellTrigger, function WoWReforgedLearnableSkillsShop___TriggerAction1SellItem) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedLearnableSkillsShop___constructionTrigger, Condition(function WoWReforgedLearnableSkillsShop___TriggerConditionConstructed)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedLearnableSkillsShop___summonTrigger, Condition(function WoWReforgedLearnableSkillsShop___TriggerConditionSummoned)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedLearnableSkillsShop___deathTrigger, Condition(function WoWReforgedLearnableSkillsShop___TriggerConditionDeath)) - - call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedLearnableSkillsShop___UpdateAllShops) -endfunction -//library WoWReforgedLearnableSkillsShop ends -//library WoWReforgedProfessionsTavern: -function WoWReforgedProfessionsTavern___AddProfessionsTavern takes unit tavern returns nothing - local integer i= 0 - call EnablePagedButtons(tavern) - call SetPagedButtonsSlotsPerPage(tavern , 10) - -call AddPagedButtonsId((tavern ) , ( ITEM_TYPE_RANDOM_PROFESSION) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - - set i=0 - loop - exitwhen ( i >= (WoWReforgedProfessions___professionsCounter) ) // INLINED!! -call AddPagedButtonsId((tavern ) , ( GetProfessionItemTypeId(i)) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop - call SetPagedButtonsPage(tavern , 0) -endfunction -function WoWReforgedProfessionsTavern___ForGroupAddProfessionsTavern takes nothing returns nothing - call WoWReforgedProfessionsTavern___AddProfessionsTavern(GetEnumUnit()) -endfunction -function WoWReforgedProfessionsTavern___TimerFunctionAddProfessionsTaverns takes nothing returns nothing - call ForGroupBJ(GetUnitsOfTypeIdAll(PROFESSIONS_TAVERN), function WoWReforgedProfessionsTavern___ForGroupAddProfessionsTavern) - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function SelectRandomProfession takes unit buyingUnit,unit tavern returns nothing - local player owner= GetOwningPlayer(buyingUnit) - local integer array availableIds - local integer availableIdsCounter= 0 - local integer id= 0 - local integer random= 0 - local integer page= 0 - local integer index= 0 - local integer i= 1 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - loop - exitwhen ( i >= max ) - set id=GetProfessionItemTypeId(i) - //if (PlayerCanPickRaceEx(owner, id)) then - set availableIds[availableIdsCounter]=id - set availableIdsCounter=availableIdsCounter + 1 - //endif - set i=i + 1 - endloop - - set random=GetRandomInt(0, availableIdsCounter - 1) - set id=availableIds[random] - //call BJDebugMsg("Selected random " + GetObjectName(id)) - set index=GetPagedButtonIndex(tavern , id) - //call BJDebugMsg("index " + I2S(index)) - set page=GetPagedButtonsPageByIndex(tavern , index) - //call BJDebugMsg("page " + I2S(page)) - call SetPagedButtonsPage(tavern , page) - call IssueNeutralImmediateOrderById(owner, tavern, id) - - set owner=null -endfunction -function WoWReforgedProfessionsTavern___TriggerConditionSellItem takes nothing returns boolean - if ( GetItemTypeId(GetSoldItem()) == ITEM_TYPE_RANDOM_PROFESSION ) then - call SelectRandomProfession(GetBuyingUnit() , GetTriggerUnit()) - call h__RemoveItem(GetSoldItem()) - endif - return false -endfunction -function WoWReforgedProfessionsTavern___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedProfessionsTavern___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedProfessionsTavern___sellTrigger, Condition(function WoWReforgedProfessionsTavern___TriggerConditionSellItem)) - - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedProfessionsTavern___TimerFunctionAddProfessionsTaverns) -endfunction -//library WoWReforgedProfessionsTavern ends -//library WoWReforgedResurrectionStone: -function IsResurrectionStone takes integer unitTypeId returns boolean - return unitTypeId == RESURRECTION_STONE_0 or unitTypeId == RESURRECTION_STONE_1 -endfunction -function IsUnitResurrectionStone takes unit whichUnit returns boolean - return IsResurrectionStone(GetUnitTypeId(whichUnit)) -endfunction -function GetResurrectionStoneFromUnit takes unit whichUnit returns integer - return LoadInteger(WoWReforgedResurrectionStone__h, GetHandleId(whichUnit), 0) -endfunction -function ResurrectionStoneHasHeroOfPlayer takes integer r,player whichPlayer returns boolean - local boolean result= false - local unit u= null - local integer i= 0 - local integer max= BlzGroupGetSize(s__ResurrectionStone_g[r]) - loop - exitwhen ( i == max or result ) - set u=BlzGroupUnitAt(s__ResurrectionStone_g[r], i) - if ( GetOwningPlayer(u) == whichPlayer ) then - set result=true - endif - set u=null - set i=i + 1 - endloop - return result -endfunction -function DeactivateResurrectionStone takes player whichPlayer,integer heroIndex returns nothing - local integer r= 0 - local integer playerId= GetPlayerId(whichPlayer) - local integer index= Index2D(playerId , heroIndex , MAX_HEROES) - local unit hero= GetPlayerHeroByIndex(whichPlayer , heroIndex) - if ( WoWReforgedResurrectionStone__heroResurrectionStones[index] != 0 ) then - set r=WoWReforgedResurrectionStone__heroResurrectionStones[index] - call GroupRemoveUnit(s__ResurrectionStone_g[r], hero) - if ( not ResurrectionStoneHasHeroOfPlayer(r , whichPlayer) ) then - call UnitShareVision(s__ResurrectionStone_u[r], whichPlayer, false) - endif - if ( BlzGroupGetSize(s__ResurrectionStone_g[r]) == 0 ) then - call SetUnitAnimation(s__ResurrectionStone_u[r], "stand") - endif - endif - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, "Deactivated Resurrection Stone.") - set hero=null -endfunction -function WoWReforgedResurrectionStone__TriggerConditionActivate takes nothing returns boolean - local integer r= LoadInteger(WoWReforgedResurrectionStone__h, GetHandleId(GetTriggeringTrigger()), 0) - - return s__ResurrectionStone_u[r] == GetSellingUnit() -endfunction -function WoWReforgedResurrectionStone__GetHeroIndex takes unit hero returns integer - local integer index= GetPlayerHeroIndex(GetOwningPlayer(hero) , hero) - if ( index == - 1 ) then - return 0 - endif - return index -endfunction -function WoWReforgedResurrectionStone__TriggerActionActivate takes nothing returns nothing - local integer r= LoadInteger(WoWReforgedResurrectionStone__h, GetHandleId(GetTriggeringTrigger()), 0) - local unit hero= GetBuyingUnit() - local player owner= GetOwningPlayer(hero) - local integer playerId= GetPlayerId(owner) - local integer index= 0 - local item whichItem= GetSoldItem() - local integer itemTypeId= GetItemTypeId(whichItem) - local effect e= null - if ( itemTypeId == ITEM_ACTIVATE_RESURRECTION_STONE ) then - if ( IsPlayerHero(hero) ) then - set index=Index2D(playerId , WoWReforgedResurrectionStone__GetHeroIndex(hero) , MAX_HEROES) - if ( WoWReforgedResurrectionStone__heroResurrectionStones[index] != 0 ) then - call GroupRemoveUnit(s__ResurrectionStone_g[r], hero) - if ( not ResurrectionStoneHasHeroOfPlayer(r , owner) ) then - call UnitShareVision(s__ResurrectionStone_u[r], owner, false) - endif - if ( BlzGroupGetSize(s__ResurrectionStone_g[r]) == 0 ) then - call SetUnitAnimation(s__ResurrectionStone_u[r], "stand") - endif - endif - call GroupAddUnit(s__ResurrectionStone_g[r], hero) - set WoWReforgedResurrectionStone__heroResurrectionStones[index]=r - call UnitShareVision(s__ResurrectionStone_u[r], owner, true) - call SetUnitAnimation(s__ResurrectionStone_u[r], "stand alternate") - set e=AddSpecialEffect("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl", GetUnitX(s__ResurrectionStone_u[r]), GetUnitY(s__ResurrectionStone_u[r])) - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, "Activated Resurrection Stone.") - call PolledWait(2.0) - call DestroyEffect(e) - set e=null - else - call SimError(owner , "Only one of your heroes can activate the Resurrection Stone.") - endif - - call h__RemoveItem(whichItem) - elseif ( itemTypeId == ITEM_DEACTIVATE_RESURRECTION_STONE ) then - if ( IsPlayerHero(hero) ) then - call DeactivateResurrectionStone(owner , WoWReforgedResurrectionStone__GetHeroIndex(hero)) - else - call SimError(owner , "Only one of your heroes can activate the Resurrection Stone.") - endif - - call h__RemoveItem(whichItem) - endif - set whichItem=null - set hero=null - set owner=null -endfunction -function AddResurrectionStone takes unit u,rect revivalRect,real facing returns integer - local integer r= s__ResurrectionStone__allocate() - set s__ResurrectionStone_u[r]=u - set s__ResurrectionStone_revivalRect[r]=revivalRect - set s__ResurrectionStone_facing[r]=facing - call TriggerRegisterAnyUnitEventBJ(s__ResurrectionStone_activationTrigger[r], EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(s__ResurrectionStone_activationTrigger[r], Condition(function WoWReforgedResurrectionStone__TriggerConditionActivate)) - call TriggerAddAction(s__ResurrectionStone_activationTrigger[r], function WoWReforgedResurrectionStone__TriggerActionActivate) - call SaveInteger(WoWReforgedResurrectionStone__h, GetHandleId(s__ResurrectionStone_activationTrigger[r]), 0, r) - call SaveInteger(WoWReforgedResurrectionStone__h, GetHandleId(u), 0, r) - - return r -endfunction -function AddResurrectionStoneWoWReforged takes nothing returns nothing - call AddResurrectionStone(udg_TmpUnit , udg_TmpRect , udg_TmpReal) -endfunction -function WoWReforgedResurrectionStone__TimerFunctionResurrect takes nothing returns nothing - local integer index= LoadInteger(WoWReforgedResurrectionStone__h, GetHandleId(GetExpiredTimer()), 0) - local integer playerId= LoadInteger(WoWReforgedResurrectionStone__h, GetHandleId(GetExpiredTimer()), 1) - local integer i= LoadInteger(WoWReforgedResurrectionStone__h, GetHandleId(GetExpiredTimer()), 2) - local integer r= WoWReforgedResurrectionStone__heroResurrectionStones[index] - local real x= GetRectCenterX(s__ResurrectionStone_revivalRect[r]) - local real y= GetRectCenterY(s__ResurrectionStone_revivalRect[r]) - local unit hero= GetPlayerHeroByIndex(Player(playerId) , i) - call ReviveHero(hero, x, y, true) - call SetUnitFacing(hero, s__ResurrectionStone_facing[r]) - call PingMinimapForPlayer(Player(playerId), x, y, 6.0) - call SetUnitAnimation(s__ResurrectionStone_u[r], "stand alternate") -endfunction -function WoWReforgedResurrectionStone__TriggerConditionDeath takes nothing returns boolean - local player owner= GetOwningPlayer(GetTriggerUnit()) - local integer r= 0 - local integer index= 0 - if ( IsPlayerHero(GetTriggerUnit()) ) then - set index=Index2D(GetPlayerId(owner) , WoWReforgedResurrectionStone__GetHeroIndex(GetTriggerUnit()) , MAX_HEROES) - set r=WoWReforgedResurrectionStone__heroResurrectionStones[index] - if ( r != 0 ) then - call TimerStart(WoWReforgedResurrectionStone__heroResurrectionTimers[index], RESURRECTION_TIME, false, function WoWReforgedResurrectionStone__TimerFunctionResurrect) - call SetUnitAnimation(s__ResurrectionStone_u[r], "stand work") - endif - endif - set owner=null - return false -endfunction -function WoWReforgedResurrectionStone__TriggerConditionReviveStart takes nothing returns boolean - local integer r= 0 - local integer index= 0 - if ( IsPlayerHero(GetRevivingUnit()) ) then - set index=Index2D(GetPlayerId(GetOwningPlayer(GetRevivingUnit())) , WoWReforgedResurrectionStone__GetHeroIndex(GetRevivingUnit()) , MAX_HEROES) - call PauseTimer(WoWReforgedResurrectionStone__heroResurrectionTimers[index]) - set r=WoWReforgedResurrectionStone__heroResurrectionStones[index] - if ( r != 0 ) then - call SetUnitAnimation(s__ResurrectionStone_u[r], "stand alternate") - endif - endif - return false -endfunction -function WoWReforgedResurrectionStone__TriggerConditionChat takes nothing returns boolean - local string msg= GetEventPlayerChatString() - if ( msg == "-noresurrect" ) then - if ( (udg_Hero[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! - call DeactivateResurrectionStone(GetTriggerPlayer() , 0) - endif - if ( (udg_Hero2[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! - call DeactivateResurrectionStone(GetTriggerPlayer() , 1) - endif - if ( (udg_Hero3[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! - call DeactivateResurrectionStone(GetTriggerPlayer() , 2) - endif - elseif ( msg == "-noresurrect1" ) then - if ( (udg_Hero[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! - call DeactivateResurrectionStone(GetTriggerPlayer() , 0) - else - call SimError(GetTriggerPlayer() , "No hero 1.") - endif - elseif ( msg == "-noresurrect2" ) then - if ( (udg_Hero2[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! - call DeactivateResurrectionStone(GetTriggerPlayer() , 1) - else - call SimError(GetTriggerPlayer() , "No hero 2.") - endif - elseif ( msg == "-noresurrect3" ) then - if ( (udg_Hero3[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! - call DeactivateResurrectionStone(GetTriggerPlayer() , 2) - else - call SimError(GetTriggerPlayer() , "No hero 3.") - endif - endif - return false -endfunction -function WoWReforgedResurrectionStone__Init takes nothing returns nothing - local integer i= 0 - local integer j= 0 - local integer index= 0 - local player slotPlayer= null - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - set j=0 - loop - exitwhen ( j == MAX_HEROES ) - set index=Index2D(i , j , MAX_HEROES) - set WoWReforgedResurrectionStone__heroResurrectionTimers[index]=CreateTimer() - call SaveInteger(WoWReforgedResurrectionStone__h, GetHandleId(WoWReforgedResurrectionStone__heroResurrectionTimers[index]), 0, index) - call SaveInteger(WoWReforgedResurrectionStone__h, GetHandleId(WoWReforgedResurrectionStone__heroResurrectionTimers[index]), 1, i) - call SaveInteger(WoWReforgedResurrectionStone__h, GetHandleId(WoWReforgedResurrectionStone__heroResurrectionTimers[index]), 2, j) - set WoWReforgedResurrectionStone__heroResurrectionStones[index]=0 - set j=j + 1 - endloop - call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone__chatTrigger, slotPlayer, "-noresurrect", true) - call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone__chatTrigger, slotPlayer, "-noresurrect1", true) - call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone__chatTrigger, slotPlayer, "-noresurrect2", true) - call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone__chatTrigger, slotPlayer, "-noresurrect3", true) - set slotPlayer=null - set i=i + 1 - endloop - call TriggerRegisterAnyUnitEventBJ(WoWReforgedResurrectionStone__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedResurrectionStone__deathTrigger, Condition(function WoWReforgedResurrectionStone__TriggerConditionDeath)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedResurrectionStone__reviveTrigger, EVENT_PLAYER_HERO_REVIVE_START) - call TriggerAddCondition(WoWReforgedResurrectionStone__reviveTrigger, Condition(function WoWReforgedResurrectionStone__TriggerConditionReviveStart)) - - call TriggerAddCondition(WoWReforgedResurrectionStone__chatTrigger, Condition(function WoWReforgedResurrectionStone__TriggerConditionChat)) -endfunction -//library WoWReforgedResurrectionStone ends -//library WoWReforgedSkins: -function GetMaxSkins takes nothing returns integer - return WoWReforgedSkins___skinCounter -endfunction -function AddSkin takes integer itemTypeId,integer unitTypeId returns integer - local integer index= WoWReforgedSkins___skinCounter - set WoWReforgedSkins___skinItemTypeId[index]=itemTypeId - set WoWReforgedSkins___skinUnitTypeId[index]=unitTypeId - set WoWReforgedSkins___skinCounter=WoWReforgedSkins___skinCounter + 1 - return index -endfunction -function GetSkinItemTypeId takes integer index returns integer - return WoWReforgedSkins___skinItemTypeId[index] -endfunction -function GetSkinUnitTypeId takes integer index returns integer - return WoWReforgedSkins___skinUnitTypeId[index] -endfunction -function AddSkinWoWReforged takes nothing returns integer - return AddSkin(udg_TmpItemTypeId , udg_TmpUnitType) -endfunction -function GetSkinByItemTypeId takes integer itemTypeId returns integer - local integer result= - 1 - local integer i= 0 - loop - exitwhen ( i == WoWReforgedSkins___skinCounter ) - if ( WoWReforgedSkins___skinItemTypeId[i] == itemTypeId ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function IsCustomizableHero takes integer unitTypeId returns boolean - return unitTypeId == VOID_LORD_RANGE_STRENGTH or unitTypeId == VOID_LORD_RANGE_AGILITY or unitTypeId == VOID_LORD_RANGE_INTELLIGENCE or unitTypeId == VOID_LORD_MELEE_STRENGTH or unitTypeId == VOID_LORD_MELEE_AGILITY or unitTypeId == VOID_LORD_MELEE_INTELLIGENCE or unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE or unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE or unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE or unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE or unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE or unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE -endfunction -function WoWReforgedSkins___GetRandomSkinForPlayer takes player whichPlayer returns integer - local integer array availableSkins - local integer availableSkinsCounter= 0 - local integer i= 0 - loop - exitwhen ( i == WoWReforgedSkins___skinCounter ) - if ( PlayerHasUnlocked(whichPlayer , (WoWReforgedSkins___skinUnitTypeId[(i)])) ) then // INLINED!! - set availableSkins[availableSkinsCounter]=(WoWReforgedSkins___skinUnitTypeId[(i)]) // INLINED!! - set availableSkinsCounter=availableSkinsCounter + 1 - endif - set i=i + 1 - endloop - return availableSkins[GetRandomInt(0, availableSkinsCounter - 1)] -endfunction -function RandomizeHeroSkin takes unit hero returns boolean - local integer unitTypeId= GetUnitTypeId(hero) - local player owner= GetOwningPlayer(hero) - if ( IsCustomizableHero(unitTypeId) ) then - call BlzSetUnitSkin(hero, WoWReforgedSkins___GetRandomSkinForPlayer(owner)) - - return true - else - call SimError(owner , "Only customizable heroes can change their skin.") - endif - - set owner=null - - return false -endfunction -function WoWReforgedSkins___AddSkinsShop takes unit shop returns nothing - local integer i= 0 - //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - call EnablePagedButtons(shop) - loop - exitwhen ( i >= WoWReforgedSkins___skinCounter ) -call AddPagedButtonsId((shop ) , ( (WoWReforgedSkins___skinItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - //call BJDebugMsg("Skill " + I2S(i)) // Stops at 189 - set i=i + 1 - endloop - //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - - //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") -endfunction -function WoWReforgedSkins___TriggerAction1SellItem takes nothing returns nothing - local unit shop= GetSellingUnit() - local unit hero= GetBuyingUnit() - local player owner= GetOwningPlayer(hero) - local integer unitTypeId= GetUnitTypeId(hero) - local item whichItem= GetSoldItem() - local integer itemTypeId= GetItemTypeId(whichItem) - local integer shopUnitTypeId= GetUnitTypeId(shop) - local integer index= GetSkinByItemTypeId(itemTypeId) - if ( index != - 1 ) then - if ( IsCustomizableHero(unitTypeId) ) then - if ( PlayerHasUnlocked(owner , (WoWReforgedSkins___skinUnitTypeId[(index)])) ) then // INLINED!! - call BlzSetUnitSkin(hero, (WoWReforgedSkins___skinUnitTypeId[(index)])) // INLINED!! - call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Chaned skin to " + GetObjectName((WoWReforgedSkins___skinUnitTypeId[(index)]))) // INLINED!! - else - call SimError(owner , "Skin is restricted to certain accounts: " + GetAllUnlockedAccountNames((WoWReforgedSkins___skinUnitTypeId[(index)]))) // INLINED!! - endif - else - call SimError(owner , "Only customizable heroes can change their skin.") - endif - call h__RemoveItem(whichItem) - endif - set whichItem=null - set shop=null - set hero=null - set owner=null -endfunction -function WoWReforgedSkins___TriggerConditionConstructed takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == SKINS ) then - call WoWReforgedSkins___AddSkinsShop(GetConstructedStructure()) - endif - return false -endfunction -function WoWReforgedSkins___TriggerConditionSummoned takes nothing returns boolean - if ( GetUnitTypeId(GetSummonedUnit()) == SKINS ) then - call WoWReforgedSkins___AddSkinsShop(GetSummonedUnit()) - endif - return false -endfunction -function WoWReforgedSkins___TriggerConditionDeath takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == SKINS ) then - // TODO Disable shop manually? - //call ClearSkillsShop(GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedSkins___ForGroupEnableShop takes nothing returns nothing - call WoWReforgedSkins___AddSkinsShop(GetEnumUnit()) -endfunction -function WoWReforgedSkins___FilterBuilding takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == SKINS_NEUTRAL -endfunction -function WoWReforgedSkins___UpdateAllShops takes nothing returns nothing - local group g= CreateGroup() - - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedSkins___FilterBuilding)) - call ForGroup(g, function WoWReforgedSkins___ForGroupEnableShop) - - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function WoWReforgedSkins___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddAction(WoWReforgedSkins___sellTrigger, function WoWReforgedSkins___TriggerAction1SellItem) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedSkins___constructionTrigger, Condition(function WoWReforgedSkins___TriggerConditionConstructed)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedSkins___summonTrigger, Condition(function WoWReforgedSkins___TriggerConditionSummoned)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedSkins___deathTrigger, Condition(function WoWReforgedSkins___TriggerConditionDeath)) - - call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedSkins___UpdateAllShops) -endfunction -//library WoWReforgedSkins ends -//library WoWReforgedSummonedUnits: -function SelectNextSummonedUnit takes player whichPlayer returns unit - local unit result= GetNextUnitToSelect(WoWReforgedSummonedUnits__summonedUnits[GetPlayerId(whichPlayer)] , whichPlayer) - - if ( result != null ) then - call SelectUnitForPlayerSingle(result, whichPlayer) - call SmartCameraPanToUnit(whichPlayer , result , 0.0) - else - call SimError(whichPlayer , "No summoned unit.") - endif - - return result -endfunction -function AddSummonedUnit takes unit whichUnit returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(whichUnit)) - call GroupAddUnit(WoWReforgedSummonedUnits__summonedUnits[playerId], whichUnit) -endfunction -function WoWReforgedSummonedUnits__TriggerConditionSummon takes nothing returns boolean - local integer playerId= GetPlayerId(GetOwningPlayer(GetSummonedUnit())) - call GroupAddUnit(WoWReforgedSummonedUnits__summonedUnits[playerId], GetSummonedUnit()) - return false -endfunction - -function WoWReforgedSummonedUnits__TriggerConditionDeath takes nothing returns boolean - local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) - if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedSummonedUnits__summonedUnits[playerId]) ) then - call GroupRemoveUnit(WoWReforgedSummonedUnits__summonedUnits[playerId], GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedSummonedUnits__TriggerConditionChangeOwner takes nothing returns boolean - local integer sourcePlayerId= GetPlayerId(GetChangingUnitPrevOwner()) - local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) - if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedSummonedUnits__summonedUnits[sourcePlayerId]) ) then - call GroupRemoveUnit(WoWReforgedSummonedUnits__summonedUnits[sourcePlayerId], GetTriggerUnit()) - call GroupAddUnit(WoWReforgedSummonedUnits__summonedUnits[playerId], GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedSummonedUnits__Init takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set WoWReforgedSummonedUnits__summonedUnits[i]=CreateGroup() - set i=i + 1 - endloop - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSummonedUnits__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedSummonedUnits__summonTrigger, Condition(function WoWReforgedSummonedUnits__TriggerConditionSummon)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSummonedUnits__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedSummonedUnits__deathTrigger, Condition(function WoWReforgedSummonedUnits__TriggerConditionDeath)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSummonedUnits__changeOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) - call TriggerAddCondition(WoWReforgedSummonedUnits__changeOwnerTrigger, Condition(function WoWReforgedSummonedUnits__TriggerConditionChangeOwner)) -endfunction -function WoWReforgedSummonedUnits__RemoveUnitHook takes unit whichUnit returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(whichUnit)) - if ( IsUnitInGroup(whichUnit, WoWReforgedSummonedUnits__summonedUnits[playerId]) ) then - call GroupRemoveUnit(WoWReforgedSummonedUnits__summonedUnits[playerId], whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit WoWReforgedSummonedUnits__RemoveUnitHook -//library WoWReforgedSummonedUnits ends -//library WoWReforgedVIPs: -function GetVIPPlayers takes nothing returns force - return WoWReforgedVIPs___vipPlayers -endfunction -function GetNonVIPPlayers takes nothing returns force - local force result= CreateForce() - local integer i= 0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - if ( not IsPlayerInForce(Player(i), WoWReforgedVIPs___vipPlayers) ) then - call ForceAddPlayer(result, Player(i)) - endif - set i=i + 1 - endloop - return result -endfunction -function IsAccountVIP takes string account returns boolean - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedVIPs___vipCounter ) - if ( StringCase(WoWReforgedVIPs___vips[i], false) == StringCase(account, false) ) then - return true - endif - set i=i + 1 - endloop - return false -endfunction -function IsPlayerVIP takes player whichPlayer returns boolean - return IsPlayerInForce(whichPlayer, WoWReforgedVIPs___vipPlayers) -endfunction -function WelcomeVIP takes player whichPlayer returns nothing - call QuestMessageForPlayer(whichPlayer , bj_QUESTMESSAGE_ALWAYSHINT , "Welcome " + GetPlayerNameColored(whichPlayer) + "! You are an official VIP member of this map.") -endfunction -function WelcomeVIPs takes nothing returns nothing - local force nonVipPlayers= GetNonVIPPlayers() - local string txt= null - local integer i= 0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - if ( (IsPlayerInForce((Player(i)), WoWReforgedVIPs___vipPlayers)) ) then // INLINED!! - if ( txt != null ) then - set txt=txt + ", " - endif - set txt=txt + GetPlayerNameColored(Player(i)) - call WelcomeVIP(Player(i)) - endif - set i=i + 1 - endloop - if ( txt != null ) then - call h__QuestMessageBJ(nonVipPlayers, bj_QUESTMESSAGE_ALWAYSHINT, "Welcome the VIPS: " + txt + " !") - call PlaySoundBJ(gg_snd_UtherReturns) - endif - call ForceClear(nonVipPlayers) - call DestroyForce(nonVipPlayers) - set nonVipPlayers=null -endfunction -function UpdateResearchesForVIP takes player whichPlayer returns nothing - call h__SetPlayerTechResearched(whichPlayer, 'R04Y', 1) - call h__SetPlayerTechResearched(whichPlayer, 'R06B', 1) - call h__SetPlayerTechResearched(whichPlayer, 'R06C', 1) -endfunction -function GetVIPsInfoText takes nothing returns string - local string text= "VIPS:" - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedVIPs___vipCounter ) - set text=text + "\n- " + WoWReforgedVIPs___vips[i] - set i=i + 1 - endloop - return text -endfunction -function DisplayVIPs takes player to returns nothing - local string text= GetVIPsInfoText() - call h__DisplayTimedTextToPlayer(to, 0.0, 0.0, 6.0, text) -endfunction -function WoWReforgedVIPs___AddVIP takes string vip returns integer - local integer index= WoWReforgedVIPs___vipCounter - set WoWReforgedVIPs___vips[index]=vip - set WoWReforgedVIPs___vipCounter=WoWReforgedVIPs___vipCounter + 1 - return index -endfunction -// Shame on you for adding yourself here! -function WoWReforgedVIPs___InitVIPs takes nothing returns nothing - call WoWReforgedVIPs___AddVIP("Barade#2569") - call WoWReforgedVIPs___AddVIP("Barade") - call WoWReforgedVIPs___AddVIP("WorldEdit") - call WoWReforgedVIPs___AddVIP("Runeblade14") - call WoWReforgedVIPs___AddVIP("Runeblade14#2451") - call WoWReforgedVIPs___AddVIP("Antidenseman#1202") - call WoWReforgedVIPs___AddVIP("Chaoskrieger#21738") -endfunction -function SyncVIPsFromPlayers takes nothing returns nothing - local boolean isVip= false - local integer i= 0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - set isVip=IsAccountVIP(GetPlayerName(Player(i))) - set udg_VIPOnForPlayer[i + 1]=isVip - if ( isVip ) then - call ForceAddPlayer(WoWReforgedVIPs___vipPlayers, Player(i)) - call UpdateResearchesForVIP(Player(i)) - endif - set i=i + 1 - endloop - call WelcomeVIPs() -endfunction -function WoWReforgedVIPs___Init takes nothing returns nothing - call WoWReforgedVIPs___InitVIPs() -endfunction -//library WoWReforgedVIPs ends -//library WowReforgedRespawnUtils: -// Call after game time has elapsed and the preplaced groups have been created. -function InitUnitRespawns takes nothing returns nothing - local integer groupIndex= - 1 - local integer i= 0 - loop - exitwhen ( i >= (UnitGroupRespawnSystem___respawnUnitCounter) ) // INLINED!! - if ( IsRespawnUnitValid(i) and (UnitGroupRespawnSystem___respawnUnitOwner[(i)]) != null and (UnitGroupRespawnSystem___respawnUnitOwner[(i)]) == udg_Gaia ) then // INLINED!! - set UnitGroupRespawnSystem___respawnUnitTimeout[(i )]=(( 300.0)*1.0) // INLINED!! - set groupIndex=(UnitGroupRespawnSystem___respawnUnitGroupIndex[(i)]) // INLINED!! - if ( IsRespawnUnitGroupValid(groupIndex) ) then - set UnitGroupRespawnSystem___respawnUnitGroupItemDropEnabled[(groupIndex )]=( false) // INLINED!! - endif - endif - set i=i + 1 - endloop -endfunction -function GetRespawnBuildingSize takes nothing returns real - return 1400.0 -endfunction -function GetRespawnGroupOfDestructable takes destructable whichDestructable returns integer - if ( (HaveSavedInteger(udg_DB, GetHandleId((whichDestructable )), ( 0))) ) then // INLINED!! - return (LoadInteger(udg_DB, GetHandleId((whichDestructable )), ( 0))) // INLINED!! - endif - return - 1 -endfunction -function FilterFunctionIsBuilding takes nothing returns boolean - local unit filterUnit= GetFilterUnit() - local player owner= GetOwningPlayer(filterUnit) - local boolean result= IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and owner != Player(PLAYER_NEUTRAL_AGGRESSIVE) and owner != Player(PLAYER_NEUTRAL_PASSIVE) and owner != udg_TheBurningLegion - set owner=null - set filterUnit=null - return result -endfunction -function RespawnRectContainsNoBuilding takes location respawnCenter returns boolean - local group BuildingGroup= GetUnitsInRangeOfLocMatching((1400.0), respawnCenter, Filter(function FilterFunctionIsBuilding)) // INLINED!! - set bj_wantDestroyGroup=true - return IsUnitGroupEmptyBJ(BuildingGroup) -endfunction -function RespawnAllGroupsInRange takes real x,real y,real range returns integer - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i == (UnitGroupRespawnSystem___respawnUnitCounter) ) // INLINED!! - if ( IsRespawnUnitValid(i) and DistanceBetweenCoordinates(x , y , (UnitGroupRespawnSystem___respawnUnitX[(i)]) , (UnitGroupRespawnSystem___respawnUnitY[(i)])) <= range ) then // INLINED!! - call RespawnUnit(i) - set result=result + 1 - endif - set i=i + 1 - endloop - return result -endfunction -function RespawnAllItemsInRange takes real x,real y,real range returns integer - local integer result= 0 - local integer i= 0 - loop - exitwhen ( i == (ItemRespawnSystem__respawnItemCounter) ) // INLINED!! - if ( IsRespawnItemValid(i) and (ItemRespawnSystem__respawnItemItem[(i)]) == null and DistanceBetweenCoordinates(x , y , (ItemRespawnSystem__respawnItemX[(i)]) , (ItemRespawnSystem__respawnItemY[(i)])) <= range ) then // INLINED!! - call RespawnItem(i) - set result=result + 1 - endif - set i=i + 1 - endloop - return result -endfunction -function HookAddUnitToGroup takes unit whichUnit,group whichGroup returns nothing - set udg_LastAddedUnitToGroup=whichUnit -endfunction -//processed hook: hook GroupAddUnitSimple HookAddUnitToGroup -//library WowReforgedRespawnUtils ends -//library WoWReforgedAiPlayersUi: - -function WoWReforgedAiPlayersUi__UpdateComputerPlayersTitle takes nothing returns nothing - call BlzFrameSetText(WoWReforgedAiPlayersUi__TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi__Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi__MaxPages) + ")") -endfunction -function GetAiPlayersWithConfig takes nothing returns force - local player aiPlayer= null - local force result= CreateForce() - local integer i= 0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - set aiPlayer=Player(i) - if ( GetPlayerController(aiPlayer) == MAP_CONTROL_COMPUTER and GetPlayerSlotState(aiPlayer) == PLAYER_SLOT_STATE_PLAYING and GetMapAllowConfigureAIPlayer(aiPlayer) and aiPlayer != udg_BossesPlayer ) then - call ForceAddPlayer(result, aiPlayer) - endif - set aiPlayer=null - set i=i + 1 - endloop - return result -endfunction -function CountAiPlayersWithConfig takes nothing returns integer - local force aiPlayers= GetAiPlayersWithConfig() - local integer result= CountPlayersInForceBJ(aiPlayers) - call ForceClear(aiPlayers) - call DestroyForce(aiPlayers) - set aiPlayers=null - return result -endfunction -function WoWReforgedAiPlayersUi__SetVisible takes boolean visible returns nothing - local integer currentPage= WoWReforgedAiPlayersUi__Page - local integer counterStart= currentPage * AI_PLAYERS_UI_MAX_PLAYERS - local integer counterEnd= counterStart + AI_PLAYERS_UI_MAX_PLAYERS - 1 - local integer counter= 0 - local integer i= 0 - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__BackgroundFrame, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__TitleFrame, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerName, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnColor, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnTeam, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHero, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevel, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocation, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnRace, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnProfession, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartGold, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumber, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimit, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolution, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayers, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroes, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnExpansions, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControl, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnDifficulty, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__ApplyButton, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__PreviousPageButton, visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__NextPageButton, visible) - set i=0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - if ( IsPlayerInForce(Player(i), WoWReforgedAiPlayersUi__Force) ) then - if ( ( visible and counter >= counterStart and counter <= counterEnd ) or not visible ) then - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUpFrame[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDownFrame[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUpFrame[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDownFrame[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUpFrame[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDownFrame[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox[counter], visible) - call BlzFrameSetVisible(WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit[counter], visible) - endif - set counter=counter + 1 - endif - set i=i + 1 - endloop -endfunction -function SetAiPlayersUiVisibleForPlayer takes player whichPlayer,boolean visible returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call WoWReforgedAiPlayersUi__SetVisible(visible) - endif -endfunction -function ShowAiPlayersUiForPlayer takes player whichPlayer returns nothing - call SetAiPlayersUiVisibleForPlayer(whichPlayer , true) -endfunction -function HideAiPlayersUiForPlayer takes player whichPlayer returns nothing - call SetAiPlayersUiVisibleForPlayer(whichPlayer , false) -endfunction -function HideAiPlayersUi takes nothing returns nothing - call WoWReforgedAiPlayersUi__SetVisible(false) -endfunction -function WoWReforgedAiPlayersUi__TriggerActionSyncData takes nothing returns nothing - local player triggerPlayer= GetTriggerPlayer() - local string prefix= BlzGetTriggerSyncPrefix() - local string data= BlzGetTriggerSyncData() - local integer playerId= GetPlayerId(triggerPlayer) - local string indexString= StringTokenEx(data , 1 , "_" , false) - local integer index= S2I(indexString) - local string actualData= StringTokenEx(data , 2 , "_" , false) - //call BJDebugMsg("Synced data " + data + " with prefix " + prefix + " leading to index " + I2S(index) + " and actual data: " + actualData + ".") - if ( data == "Done" ) then - set WoWReforgedAiPlayersUi__SyncDone[playerId]=true - //call BJDebugMsg("Synced done") - elseif ( StringStartsWith(data , "PlayerName") ) then - set WoWReforgedAiPlayersUi__PlayerNames[index]=actualData - elseif ( StringStartsWith(data , "Color") ) then - set WoWReforgedAiPlayersUi__Color[index]=S2I(actualData) - elseif ( StringStartsWith(data , "Team") ) then - set WoWReforgedAiPlayersUi__Teams[index]=S2I(actualData) - elseif ( StringStartsWith(data , "HeroStartLevel") ) then - set WoWReforgedAiPlayersUi__HeroStartLevels[index]=S2I(actualData) - elseif ( StringStartsWith(data , "StartHero") ) then - set WoWReforgedAiPlayersUi__Heroes[index]=S2I(actualData) - elseif ( StringStartsWith(data , "StartLocation") ) then - set WoWReforgedAiPlayersUi__StartLocations[index]=S2I(actualData) - elseif ( StringStartsWith(data , "Races") ) then - set WoWReforgedAiPlayersUi__Races[index]=S2I(actualData) - elseif ( StringStartsWith(data , "Profession") ) then - set WoWReforgedAiPlayersUi__Professions[index]=S2I(actualData) - elseif ( StringStartsWith(data , "StartGold") ) then - set WoWReforgedAiPlayersUi__StartGold[index]=S2I(actualData) - elseif ( StringStartsWith(data , "StartLumber") ) then - set WoWReforgedAiPlayersUi__StartLumber[index]=S2I(actualData) - elseif ( StringStartsWith(data , "FoodLimit") ) then - set WoWReforgedAiPlayersUi__FoodLimit[index]=S2I(actualData) - elseif ( StringStartsWith(data , "StartEvolution") ) then - set WoWReforgedAiPlayersUi__StartEvolution[index]=S2I(actualData) - elseif ( StringStartsWith(data , "AttackPlayers") ) then - set WoWReforgedAiPlayersUi__AttackPlayers[index]=S2I(actualData) - elseif ( StringStartsWith(data , "HeroesCount") ) then - set WoWReforgedAiPlayersUi__HeroesCount[index]=S2I(actualData) - elseif ( StringStartsWith(data , "Expansions") ) then - set WoWReforgedAiPlayersUi__Expansions[index]=S2I(actualData) - elseif ( StringStartsWith(data , "SharedControl") ) then - set WoWReforgedAiPlayersUi__SharedControl[index]=S2I(actualData) - elseif ( StringStartsWith(data , "Difficulty") ) then - set WoWReforgedAiPlayersUi__Difficulty[index]=S2I(actualData) - endif - set triggerPlayer=null -endfunction -function WoWReforgedAiPlayersUi__SyncData takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer index= 0 - local integer counter= WoWReforgedAiPlayersUi__Counter - local integer i= 0 - loop - exitwhen ( i >= counter ) - set index=i - if ( GetLocalPlayer() == whichPlayer ) then - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "PlayerName_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "Color_" + I2S(index) + "_" + I2S(WoWReforgedAiPlayersUi__ColorLocal[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "Team_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit[index])))) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "StartHero_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index])))) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "HeroStartLevel_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "StartLocation_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit[index])))) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "Races_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index])))) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "Profession_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit[index])))) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "StartGold_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "StartLumber_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "FoodLimit_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "StartEvolution_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "AttackPlayers_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox[index])))) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "HeroesCount_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "Expansions_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "SharedControl_" + I2S(index) + "_" + I2S(WoWReforgedAiPlayersUi__SharedControlAsync[index])) - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "Difficulty_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit[index])))) - endif - set i=i + 1 - endloop - if ( GetLocalPlayer() == whichPlayer ) then - call BlzSendSyncData(WoWReforgedAiPlayersUi__PREFIX, "Done") - endif - // wait for sync is done - loop - exitwhen ( WoWReforgedAiPlayersUi__SyncDone[playerId] ) - call TriggerSleepAction(5.0) - //call BJDebugMsg("Polling") - endloop - set WoWReforgedAiPlayersUi__SyncDone[playerId]=false -endfunction -function WoWReforgedAiPlayersUi__ApplyFunction takes nothing returns nothing - call SetAiPlayersUiVisibleForPlayer((GetTriggerPlayer()) , false) // INLINED!! - call WoWReforgedAiPlayersUi__SyncData(GetTriggerPlayer()) - set udg_TmpPlayer2=GetTriggerPlayer() - call ConditionalTriggerExecute(gg_trg_Computer_Start_Lobby_Settings) -endfunction -function WoWReforgedAiPlayersUi__GetPlayerIndex takes player whichPlayer returns integer - local integer index= 0 - local integer i= 0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - if ( IsPlayerInForce(Player(i), WoWReforgedAiPlayersUi__Force) ) then - if ( Player(i) == whichPlayer ) then - return index - else - set index=index + 1 - endif - endif - set i=i + 1 - endloop - return - 1 -endfunction -function AiPlayersUIGetPlayerName takes player whichPlayer returns string - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__PlayerNames[index] - endif - return GetPlayerName(whichPlayer) -endfunction -function AiPlayersUIGetColor takes player whichPlayer returns playercolor - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return ConvertPlayerColor(WoWReforgedAiPlayersUi__Color[index]) - endif - return GetPlayerColor(whichPlayer) -endfunction -function AiPlayersUIGetTeam takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__Teams[index] - endif - return GetPlayerTeam(whichPlayer) -endfunction -function AiPlayersUIGetHero takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - local integer frameValue= 0 - if ( index != - 1 ) then - set frameValue=WoWReforgedAiPlayersUi__Heroes[index] - - if ( frameValue == AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM_MATCHING_RACE ) then - return ChooseRandomHeroFromRace(udg_PlayerRace[GetConvertedPlayerId(whichPlayer)]) - elseif ( frameValue == AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM ) then - return GetRandomInt(0, udg_MaxHeroUnitTypes - 1) - endif - endif - return frameValue - AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM - 1 -endfunction -function AiPlayersUIGetHeroStartLevel takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__HeroStartLevels[index] - endif - return 1 -endfunction -function AiPlayersUIChooseComputerStartLocation takes integer startIndex returns integer - local integer i= startIndex - loop - exitwhen ( i >= udg_Max_TownHalls ) - if ( not udg_ComputerStartLocationTaken[i] ) then - return i - endif - set i=i + 1 - endloop - if ( startIndex > 0 ) then - return AiPlayersUIChooseComputerStartLocation(0) - endif - return - 1 -endfunction -function AiPlayersUIGetPlayerWarlord takes player whichPlayer returns boolean - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - local integer random= GetRandomInt(0, 1) - local integer frameValue= 0 - if ( index != - 1 and udg_AIFreelancers and udg_AIWarlords ) then - set frameValue=WoWReforgedAiPlayersUi__Races[index] - if ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM ) then - return random == 0 - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_FREELANCER ) then - return false - endif - return AiPlayersUIChooseComputerStartLocation(0) > - 1 - endif - return ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM and random == 0 ) or ( not udg_AIFreelancers and udg_AIWarlords ) and AiPlayersUIChooseComputerStartLocation(0) > - 1 -endfunction -function GetRandomRaceWithAISupport takes nothing returns integer - local integer array r - local integer c= 0 - set r[c]=udg_RaceAllianceOfLordaeron - set c=c + 1 - set r[c]=udg_RaceOldHorde - set c=c + 1 - set r[c]=udg_RaceHuman - set c=c + 1 - set r[c]=udg_RaceBloodElf - set c=c + 1 - set r[c]=udg_RaceDwarf - set c=c + 1 - set r[c]=udg_RaceHighElf - set c=c + 1 - set r[c]=udg_RaceGnome - set c=c + 1 - set r[c]=udg_RaceTroll - set c=c + 1 - set r[c]=udg_RaceDraenei - set c=c + 1 - set r[c]=udg_RaceNightElf - set c=c + 1 - set r[c]=udg_RaceFurbolg - set c=c + 1 - set r[c]=udg_RaceDalaran - set c=c + 1 - set r[c]=udg_RaceKulTiras - set c=c + 1 - set r[c]=udg_RaceOrc - set c=c + 1 - set r[c]=udg_RaceUndead - set c=c + 1 - set r[c]=udg_RaceDemon - set c=c + 1 - set r[c]=udg_RaceNaga - set c=c + 1 - set r[c]=udg_RacePandaren - set c=c + 1 - set r[c]=udg_RaceVrykul - set c=c + 1 - set r[c]=udg_RaceLordaeron - set c=c + 1 - set r[c]=udg_RaceStormwind - set c=c + 1 - set r[c]=udg_RaceWorgen - set c=c + 1 - set r[c]=udg_RaceNerubian - set c=c + 1 - set r[c]=udg_RaceTuskarr - set c=c + 1 - set r[c]=udg_RaceOgre - set c=c + 1 - set r[c]=udg_RaceSatyr - set c=c + 1 - set r[c]=udg_RaceCentaur - set c=c + 1 - set r[c]=udg_RaceEredar - set c=c + 1 - set r[c]=udg_RaceFelOrc - set c=c + 1 - set r[c]=udg_RaceFacelessOne - set c=c + 1 - set r[c]=udg_RaceGnoll - set c=c + 1 - set r[c]=udg_RaceKobold - set c=c + 1 - set r[c]=udg_RaceQuillboar - set c=c + 1 - set r[c]=udg_RaceBandit - set c=c + 1 - set r[c]=udg_RaceDragonkin - set c=c + 1 - - return r[GetRandomInt(0, c - 1)] -endfunction -function GetRandomAllianceRaceWithAISupport takes nothing returns integer - local integer array r - local integer c= 0 - set r[c]=udg_RaceAllianceOfLordaeron - set c=c + 1 - set r[c]=udg_RaceHuman - set c=c + 1 - set r[c]=udg_RaceDwarf - set c=c + 1 - set r[c]=udg_RaceHighElf - set c=c + 1 - set r[c]=udg_RaceGnome - set c=c + 1 - set r[c]=udg_RaceDraenei - set c=c + 1 - set r[c]=udg_RaceNightElf - set c=c + 1 - set r[c]=udg_RaceFurbolg - set c=c + 1 - set r[c]=udg_RaceDalaran - set c=c + 1 - set r[c]=udg_RaceKulTiras - set c=c + 1 - set r[c]=udg_RacePandaren - set c=c + 1 - set r[c]=udg_RaceVrykul - set c=c + 1 - set r[c]=udg_RaceLordaeron - set c=c + 1 - set r[c]=udg_RaceStormwind - set c=c + 1 - set r[c]=udg_RaceWorgen - set c=c + 1 - set r[c]=udg_RaceTuskarr - set c=c + 1 - set r[c]=udg_RaceEredar - set c=c + 1 - set r[c]=udg_RaceGnoll - set c=c + 1 - set r[c]=udg_RaceKobold - set c=c + 1 - set r[c]=udg_RaceQuillboar - set c=c + 1 - set r[c]=udg_RaceBandit - set c=c + 1 - set r[c]=udg_RaceDragonkin - set c=c + 1 - - return r[GetRandomInt(0, c - 1)] -endfunction -function GetRandomHordeRaceWithAISupport takes nothing returns integer - local integer array r - local integer c= 0 - set r[c]=udg_RaceBloodElf - set c=c + 1 - set r[c]=udg_RaceTroll - set c=c + 1 - set r[c]=udg_RaceFurbolg - set c=c + 1 - set r[c]=udg_RaceOldHorde - set c=c + 1 - set r[c]=udg_RaceOrc - set c=c + 1 - set r[c]=udg_RaceUndead - set c=c + 1 - set r[c]=udg_RaceDemon - set c=c + 1 - set r[c]=udg_RaceNaga - set c=c + 1 - set r[c]=udg_RacePandaren - set c=c + 1 - set r[c]=udg_RaceNerubian - set c=c + 1 - set r[c]=udg_RaceTuskarr - set c=c + 1 - set r[c]=udg_RaceOgre - set c=c + 1 - set r[c]=udg_RaceSatyr - set c=c + 1 - set r[c]=udg_RaceCentaur - set c=c + 1 - set r[c]=udg_RaceEredar - set c=c + 1 - set r[c]=udg_RaceFelOrc - set c=c + 1 - set r[c]=udg_RaceFacelessOne - set c=c + 1 - set r[c]=udg_RaceGnoll - set c=c + 1 - set r[c]=udg_RaceKobold - set c=c + 1 - set r[c]=udg_RaceQuillboar - set c=c + 1 - set r[c]=udg_RaceDragonkin - set c=c + 1 - - return r[GetRandomInt(0, c - 1)] -endfunction -function AiPlayersUIGetPlayerRace takes player whichPlayer,integer startLocation returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - local integer frameValue= 0 - local integer random= 0 - local race whichRace= GetPlayerRace(whichPlayer) - if ( index != - 1 ) then - set frameValue=WoWReforgedAiPlayersUi__Races[index] - //constant integer AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM = 1 - if ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_MATCHING_START_LOCATION ) then - return udg_TownHallRace[startLocation] - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_WARLORD ) then - return GetRandomRaceWithAISupport() - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_ALLIANCE ) then - return GetRandomAllianceRaceWithAISupport() - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_HORDE ) then - return GetRandomHordeRaceWithAISupport() - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_OLD_HORDE ) then - return udg_RaceOldHorde - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_ALLIANCE ) then - return udg_RaceAllianceOfLordaeron - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_HUMAN ) then - return udg_RaceHuman - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_ORC ) then - return udg_RaceOrc - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_UNDEAD ) then - return udg_RaceUndead - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_NIGHT_ELF ) then - return udg_RaceNightElf - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_BLOOD_ELF ) then - return udg_RaceBloodElf - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_NAGA ) then - return udg_RaceNaga - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DRAENEI ) then - return udg_RaceDraenei - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DEMON ) then - return udg_RaceDemon - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_FURBOLG ) then - return udg_RaceFurbolg - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DWARF ) then - return udg_RaceDwarf - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_GOBLIN ) then - return udg_RaceGoblin - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_HIGH_ELF ) then - return udg_RaceHighElf - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_GNOME ) then - return udg_RaceGnome - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DALARAN ) then - return udg_RaceDalaran - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_KUL_TIRAS ) then - return udg_RaceKulTiras - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_LORDAERON ) then - return udg_RaceLordaeron - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_STORMWIND ) then - return udg_RaceStormwind - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_PANDAREN ) then - return udg_RacePandaren - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_TROLL ) then - return udg_RaceTroll - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_TAUREN ) then - return udg_RaceTauren - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_VRYKUL ) then - return udg_RaceVrykul - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_TUSKARR ) then - return udg_RaceTuskarr - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_MURLOC ) then - return udg_RaceMurloc - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_OGRE ) then - return udg_RaceOgre - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_EREDAR ) then - return udg_RaceEredar - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_FEL_ORC ) then - return udg_RaceFelOrc - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_FACELESS_ONE ) then - return udg_RaceFacelessOne - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_SATYR ) then - return udg_RaceSatyr - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_CENTAUR ) then - return udg_RaceCentaur - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_GNOLL ) then - return udg_RaceGnoll - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_KOBOLD ) then - return udg_RaceKobold - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_QUILLBOAR ) then - return udg_RaceQuillboar - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_BANDIT ) then - return udg_RaceBandit - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DUNGEON ) then - return udg_RaceDungeon - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DRAGONKIN ) then - return udg_RaceDragonkin - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_NERUBIAN ) then - return udg_RaceNerubian - elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_WORGEN ) then - return udg_RaceWorgen - endif - endif - // use player lobby settings instead - if ( whichRace == RACE_HUMAN ) then - set random=GetRandomInt(0, 6) - if ( random == 0 ) then - return udg_RaceAllianceOfLordaeron - elseif ( random == 1 ) then - return udg_RaceHuman - elseif ( random == 2 ) then - return udg_RaceBloodElf - elseif ( random == 3 ) then - return udg_RaceDwarf - elseif ( random == 4 ) then - return udg_RaceHighElf - elseif ( random == 5 ) then - return udg_RaceDalaran - else - return udg_RaceKulTiras - endif - elseif ( whichRace == RACE_ORC ) then - set random=GetRandomInt(0, 3) - if ( random == 0 ) then - return udg_RaceOldHorde - elseif ( random == 1 ) then - return udg_RaceOrc - elseif ( random == 2 ) then - return udg_RaceDraenei - else - return udg_RaceGoblin - endif - elseif ( whichRace == RACE_UNDEAD ) then - set random=GetRandomInt(0, 1) - if ( random == 0 ) then - return udg_RaceUndead - else - return udg_RaceDemon - endif - elseif ( whichRace == RACE_NIGHTELF ) then - set random=GetRandomInt(0, 2) - if ( random == 0 ) then - return udg_RaceNightElf - elseif ( random == 1 ) then - return udg_RaceNaga - else - return udg_RaceFurbolg - endif - endif - return udg_RaceNone -endfunction -function AiPlayersUIGetPlayerProfession takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - local integer frameValue= 0 - local race whichRace= GetPlayerRace(whichPlayer) - if ( index != - 1 ) then - set frameValue=WoWReforgedAiPlayersUi__Professions[index] - if ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_HERBALIST ) then - return udg_ProfessionHerbalist - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ALCHEMIST ) then - return udg_ProfessionAlchemist - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_WEAPON_SMITH ) then - return udg_ProfessionWeaponSmith - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ARMORER ) then - return udg_ProfessionArmourer - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ENGINEER ) then - return udg_ProfessionEngineer - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_DRAGON_BREEDER ) then - return udg_ProfessionDragonBreeder - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_LORE_MASTER ) then - return udg_ProfessionLoreMaster - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_RUNE_FORGER ) then - return udg_ProfessionRuneforger - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_SORCERER ) then - return udg_ProfessionSorcerer - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_JEWELCRAFTER ) then - return udg_ProfessionJewelcrafter - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ARCHAEOLOGIST ) then - return udg_ProfessionArchaeologist - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_WITCH_DOCTOR ) then - return udg_ProfessionWitchDoctor - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_TAMER ) then - return udg_ProfessionTamer - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_NECROMANCER ) then - return udg_ProfessionNecromancer - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_GOLEM_SCULPTOR ) then - return udg_ProfessionGolemSculptor - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_WARLOCK ) then - return udg_ProfessionWarlock - elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ASTROMANCER ) then - return udg_ProfessionAstromancer - endif - endif - - return GetRandomProfession() -endfunction -function AiPlayersUIGetStartLocation takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - local integer frameValue= 0 - if ( index != - 1 ) then - set frameValue=WoWReforgedAiPlayersUi__StartLocations[index] - if ( frameValue == AI_PLAYERS_UI_START_LOCATION_MENU_ITEM_RANDOM ) then - return AiPlayersUIChooseComputerStartLocation(GetRandomInt(0, udg_Max_TownHalls - 1)) - else - return AiPlayersUIChooseComputerStartLocation(frameValue - 1) - endif - endif - return AiPlayersUIChooseComputerStartLocation(0) -endfunction -function AiPlayersUIGetStartGold takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__StartGold[index] - endif - return AI_PLAYERS_UI_START_GOLD -endfunction -function AiPlayersUIGetStartLumber takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__StartLumber[index] - endif - return AI_PLAYERS_UI_START_LUMBER -endfunction -function AiPlayersUIGetFoodLimit takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__FoodLimit[index] - endif - return 300 -endfunction -function AiPlayersUIGetStartEvolution takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__StartEvolution[index] - endif - return 1 -endfunction -function AiPlayersUIGetAttackPlayers takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__AttackPlayers[index] - endif - return 1 -endfunction -function AiPlayersUIGetHeroesCount takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__HeroesCount[index] - endif - return 1 -endfunction -function AiPlayersUIGetExpansions takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__Expansions[index] - endif - return 1 -endfunction -function AiPlayersUIGetSharedControl takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__SharedControl[index] - endif - return 1 -endfunction -function AiPlayersUIGetDifficulty takes player whichPlayer returns integer - local integer index= WoWReforgedAiPlayersUi__GetPlayerIndex(whichPlayer) - if ( index != - 1 ) then - return WoWReforgedAiPlayersUi__Difficulty[index] - endif - return 1 // normal -endfunction -function WoWReforgedAiPlayersUi__ColorPopupMenuFunction takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - - //call BJDebugMsg("Texture: " + GetPlayerColorTexture(ConvertPlayerColor(ColorLocal[index]))) - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - set WoWReforgedAiPlayersUi__ColorLocal[index]=R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index])) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((ConvertPlayerColor(WoWReforgedAiPlayersUi__ColorLocal[index]))) , 2)), 0, true) // INLINED!! - endif -endfunction -function WoWReforgedAiPlayersUi__ColorUpFunction takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - - //call BJDebugMsg("Texture: " + GetPlayerColorTexture(ConvertPlayerColor(ColorLocal[index]))) - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( WoWReforgedAiPlayersUi__ColorLocal[index] == 0 ) then - set WoWReforgedAiPlayersUi__ColorLocal[index]=23 - else - set WoWReforgedAiPlayersUi__ColorLocal[index]=WoWReforgedAiPlayersUi__ColorLocal[index] - 1 - endif - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index], WoWReforgedAiPlayersUi__ColorLocal[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((ConvertPlayerColor(WoWReforgedAiPlayersUi__ColorLocal[index]))) , 2)), 0, true) // INLINED!! - endif - call PlayClickSound(GetTriggerPlayer()) -endfunction -function WoWReforgedAiPlayersUi__ColorDownFunction takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - - //call BJDebugMsg("Texture: " + GetPlayerColorTexture(ConvertPlayerColor(ColorLocal[index]))) - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( WoWReforgedAiPlayersUi__ColorLocal[index] == 23 ) then - set WoWReforgedAiPlayersUi__ColorLocal[index]=0 - else - set WoWReforgedAiPlayersUi__ColorLocal[index]=WoWReforgedAiPlayersUi__ColorLocal[index] + 1 - endif - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index], WoWReforgedAiPlayersUi__ColorLocal[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((ConvertPlayerColor(WoWReforgedAiPlayersUi__ColorLocal[index]))) , 2)), 0, true) // INLINED!! - endif - call PlayClickSound(GetTriggerPlayer()) -endfunction -function WoWReforgedAiPlayersUi__HeroUpFunction takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index]) == 0 ) then - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], AI_PLAYERS_UI_HEROES_MENU_ITEM_FINAL) - else - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index]) - 1) - endif - endif - - call PlayClickSound(GetTriggerPlayer()) -endfunction -function WoWReforgedAiPlayersUi__HeroDownFunction takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index]) == AI_PLAYERS_UI_HEROES_MENU_ITEM_FINAL ) then - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], 0) - else - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index]) + 1) - endif - endif - - call PlayClickSound(GetTriggerPlayer()) -endfunction -function WoWReforgedAiPlayersUi__RaceUpFunction takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index]) == 0 ) then - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], AI_PLAYERS_UI_RACES_MENU_ITEM_DRAGONKIN) - else - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index]) - 1) - endif - endif - - call PlayClickSound(GetTriggerPlayer()) -endfunction -function WoWReforgedAiPlayersUi__RaceDownFunction takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index]) == AI_PLAYERS_UI_RACES_MENU_ITEM_DRAGONKIN ) then - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], 0) - else - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index]) + 1) - endif - endif - - call PlayClickSound(GetTriggerPlayer()) -endfunction -function WoWReforgedAiPlayersUi__PreviousPageFunction takes nothing returns nothing - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( WoWReforgedAiPlayersUi__Page == 0 ) then - set WoWReforgedAiPlayersUi__Page=WoWReforgedAiPlayersUi__MaxPages - 1 - else - set WoWReforgedAiPlayersUi__Page=WoWReforgedAiPlayersUi__Page - 1 - endif - call BlzFrameSetText(WoWReforgedAiPlayersUi__TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi__Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi__MaxPages) + ")") // INLINED!! - endif - - call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , false) - call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , true) -endfunction -function WoWReforgedAiPlayersUi__NextPageFunction takes nothing returns nothing - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( WoWReforgedAiPlayersUi__Page == WoWReforgedAiPlayersUi__MaxPages - 1 ) then - set WoWReforgedAiPlayersUi__Page=0 - else - set WoWReforgedAiPlayersUi__Page=WoWReforgedAiPlayersUi__Page + 1 - endif - call BlzFrameSetText(WoWReforgedAiPlayersUi__TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi__Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi__MaxPages) + ")") // INLINED!! - endif - - call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , false) - call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , true) -endfunction -function WoWReforgedAiPlayersUi__TriggerConditionCheckSharedControl takes nothing returns boolean - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - set WoWReforgedAiPlayersUi__SharedControlAsync[index]=1 - return false -endfunction -function WoWReforgedAiPlayersUi__TriggerConditionUncheckSharedControl takes nothing returns boolean - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! - set WoWReforgedAiPlayersUi__SharedControlAsync[index]=0 - return false -endfunction -function CreateAiPlayersUiEx takes force aiPlayers returns nothing - local integer i= 0 - local integer counter= 0 - local player aiPlayer= null - local integer index= 0 - local real x - local real y - local integer playerColor= 0 - local integer team= 0 - set WoWReforgedAiPlayersUi__BackgroundFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__BackgroundFrame, FRAMEPOINT_TOPLEFT, UI_FULLSCREEN_X, UI_FULLSCREEN_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__BackgroundFrame, FRAMEPOINT_BOTTOMRIGHT, UI_FULLSCREEN_X + UI_FULLSCREEN_WIDTH, UI_FULLSCREEN_Y - UI_FULLSCREEN_HEIGHT) - set WoWReforgedAiPlayersUi__TitleFrame=BlzCreateFrameByType("TEXT", "AiPlayersGuiTitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__TitleFrame, FRAMEPOINT_TOPLEFT, UI_FULLSCREEN_X, UI_FULLSCREEN_TITLE_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__TitleFrame, FRAMEPOINT_BOTTOMRIGHT, UI_FULLSCREEN_X + UI_FULLSCREEN_WIDTH, UI_FULLSCREEN_TITLE_Y - UI_FULLSCREEN_TITLE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi__Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi__MaxPages) + ")") // INLINED!! - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__TitleFrame, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - // header line - set WoWReforgedAiPlayersUi__LabelFrameColumnPlayerName=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLinePlayerName", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerName, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerName, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X + AI_PLAYERS_UI_COLUMN_PLAYER_NAME_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerName, "Name") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerName, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnColor=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineColor", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColor, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColor, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + AI_PLAYERS_UI_COLUMN_COLOR_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnColor, "Color") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnColor, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnTeam=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineTeam", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnTeam, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_TEAM_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnTeam, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_TEAM_X + AI_PLAYERS_UI_COLUMN_TEAM_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnTeam, "Team") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnTeam, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnHero=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineHero", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHero, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHero, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + AI_PLAYERS_UI_COLUMN_HERO_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnHero, "Hero") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnHero, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevel=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineHeroStartLevel", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevel, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevel, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X + AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevel, "Level") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevel, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnStartLocation=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartLocation", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocation, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocation, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X + AI_PLAYERS_UI_COLUMN_START_LOCATION_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocation, "Location (Warlord only)") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocation, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnRace=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineRace", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRace, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRace, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + AI_PLAYERS_UI_COLUMN_RACE_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnRace, "Race") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnRace, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnProfession=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineProfession", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnProfession, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PROFESSION_X, AI_PLAYERS_UI_LINE_HEADERS_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnProfession, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PROFESSION_X + AI_PLAYERS_UI_COLUMN_PROFESSION_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnProfession, "Profession") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnProfession, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - // new line - set y=AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEIGHT - AI_PLAYERS_UI_LINE_HEIGHT_SPACING - set WoWReforgedAiPlayersUi__LabelFrameColumnStartGold=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartGold", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartGold, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_GOLD_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartGold, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_GOLD_X + AI_PLAYERS_UI_COLUMN_START_GOLD_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartGold, "Gold") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnStartGold, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnStartLumber=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartLumber", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumber, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumber, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X + AI_PLAYERS_UI_COLUMN_START_LUMBER_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumber, "Lumber") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumber, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimit=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineFoodLimit", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimit, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimit, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X + AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimit, "Max. Food") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimit, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolution=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartEvolution", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolution, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolution, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X + AI_PLAYERS_UI_COLUMN_START_EVOLUTION_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolution, "Evolution") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolution, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayers=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineAttackPlayers", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayers, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayers, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X + AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayers, "Attacks") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayers, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroes=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineHeroes", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroes, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HEROES_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroes, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HEROES_X + AI_PLAYERS_UI_COLUMN_HEROES_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnHeroes, "Heroes") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnHeroes, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnExpansions=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineExpansions", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnExpansions, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnExpansions, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X + AI_PLAYERS_UI_COLUMN_EXPANSIONS_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnExpansions, "Expansions") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnExpansions, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnSharedControl=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineSharedControl", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControl, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControl, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X + AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControl, "Shared") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControl, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - - set WoWReforgedAiPlayersUi__LabelFrameColumnDifficulty=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineDifficulty", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnDifficulty, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnDifficulty, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X + AI_PLAYERS_UI_COLUMN_DIFFICULTY_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnDifficulty, "Difficulty") - call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi__LabelFrameColumnDifficulty, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) - set y=AI_PLAYERS_UI_LINE_HEADERS_Y - 2 * ( AI_PLAYERS_UI_LINE_HEADERS_HEIGHT + AI_PLAYERS_UI_LINE_SPACING_Y ) - - if ( WoWReforgedAiPlayersUi__Force != null ) then - call ForceClear(WoWReforgedAiPlayersUi__Force) - call DestroyForce(WoWReforgedAiPlayersUi__Force) - set WoWReforgedAiPlayersUi__Force=null - endif - - set WoWReforgedAiPlayersUi__Force=CreateForce() - // players - set i=0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - set aiPlayer=Player(i) - if ( IsPlayerInForce(aiPlayer, aiPlayers) ) then - call ForceAddPlayer(WoWReforgedAiPlayersUi__Force, aiPlayer) - set index=counter - set WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X + AI_PLAYERS_UI_COLUMN_PLAYER_NAME_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit[index], GetPlayerName(aiPlayer)) - set WoWReforgedAiPlayersUi__PlayerNames[index]=GetPlayerName(aiPlayer) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnPlayerNameEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index]=BlzCreateFrame("PlayerColorsPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + AI_PLAYERS_UI_COLUMN_COLOR_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - set playerColor=IMinBJ(23, GetHandleId(GetPlayerColor(aiPlayer))) - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index], playerColor) - set WoWReforgedAiPlayersUi__ColorLocal[index]=playerColor - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index], true) - - set WoWReforgedAiPlayersUi__ColorPopupMenuTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__ColorPopupMenuTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnColorPopup[index], FRAMEEVENT_POPUPMENU_ITEM_CHANGED) - call TriggerAddAction(WoWReforgedAiPlayersUi__ColorPopupMenuTrigger[index], function WoWReforgedAiPlayersUi__ColorPopupMenuFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__ColorPopupMenuTrigger[index] )), ( 0 ), ( index)) // INLINED!! - - set WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index]=BlzCreateFrameByType("BACKDROP", "ColorFrame" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_EDIT_X, y - 0.04) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_EDIT_X + AI_PLAYERS_UI_COLUMN_COLOR_EDIT_WIDTH, y - 0.04 - AI_PLAYERS_UI_COLUMN_COLOR_EDIT_HEIGHT) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(aiPlayer))) , 2)), 0, true) // INLINED!! - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnColorEdit[index], true) - set WoWReforgedAiPlayersUi__ColorLocal[index]=playerColor - - //call BJDebugMsg("Texture: " + GetPlayerColorTexture(GetPlayerColor(aiPlayer))) - - set WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[index]=BlzCreateFrameByType("BUTTON", "ColorUpButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, y - 0.04) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + 0.02, y - 0.02 - 0.04) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUpFrame[index]=BlzCreateFrameByType("BACKDROP", "ColorUpFrame" + I2S(index), WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUpFrame[index], WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUpFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUpFrame[index], true) - - set WoWReforgedAiPlayersUi__ColorUpTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__ColorUpTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowUp[index], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__ColorUpTrigger[index], function WoWReforgedAiPlayersUi__ColorUpFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__ColorUpTrigger[index] )), ( 0 ), ( index)) // INLINED!! - - set WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[index]=BlzCreateFrameByType("BUTTON", "ColorDownButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, y - 0.07) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + 0.02, y - 0.02 - 0.07) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDownFrame[index]=BlzCreateFrameByType("BACKDROP", "ColoreDownFrame" + I2S(index), WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDownFrame[index], WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDownFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDownFrame[index], true) - - set WoWReforgedAiPlayersUi__ColorDownTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__ColorDownTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnColorArrowDown[index], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__ColorDownTrigger[index], function WoWReforgedAiPlayersUi__ColorDownFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__ColorDownTrigger[index] )), ( 0 ), ( index)) // INLINED!! - - set WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit[index]=BlzCreateFrame("TeamPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_TEAM_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_TEAM_X + AI_PLAYERS_UI_COLUMN_TEAM_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - set team=IMinBJ(3, GetPlayerTeam(aiPlayer)) - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit[index], team) - set WoWReforgedAiPlayersUi__Teams[index]=team - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnTeamEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index]=BlzCreateFrame("HeroesPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + AI_PLAYERS_UI_COLUMN_HERO_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM_MATCHING_RACE) - set WoWReforgedAiPlayersUi__Heroes[index]=AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM_MATCHING_RACE - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[index]=BlzCreateFrameByType("BUTTON", "HeroUpButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, y - 0.04) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + 0.02, y - 0.02 - 0.04) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUpFrame[index]=BlzCreateFrameByType("BACKDROP", "HeroUpFrame" + I2S(index), WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUpFrame[index], WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUpFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUpFrame[index], true) - - set WoWReforgedAiPlayersUi__HeroUpTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__HeroUpTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowUp[index], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__HeroUpTrigger[index], function WoWReforgedAiPlayersUi__HeroUpFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__HeroUpTrigger[index] )), ( 0 ), ( index)) // INLINED!! - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[index]=BlzCreateFrameByType("BUTTON", "HeroDownButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, y - 0.07) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + 0.02, y - 0.02 - 0.07) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDownFrame[index]=BlzCreateFrameByType("BACKDROP", "HeroeDownFrame" + I2S(index), WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDownFrame[index], WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDownFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDownFrame[index], true) - - set WoWReforgedAiPlayersUi__HeroDownTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__HeroDownTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnHeroEditArrowDown[index], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__HeroDownTrigger[index], function WoWReforgedAiPlayersUi__HeroDownFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__HeroDownTrigger[index] )), ( 0 ), ( index)) // INLINED!! - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X + AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit[index], "1") - set WoWReforgedAiPlayersUi__HeroStartLevels[index]=1 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnHeroStartLevelEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit[index]=BlzCreateFrame("StartLocationsPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X + AI_PLAYERS_UI_COLUMN_START_LOCATION_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit[index], 0) - set WoWReforgedAiPlayersUi__StartLocations[index]=0 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnStartLocationEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index]=BlzCreateFrame("RacesPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + AI_PLAYERS_UI_COLUMN_RACE_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], AI_PLAYERS_UI_RACES_MENU_ITEM_MATCHING_START_LOCATION) - set WoWReforgedAiPlayersUi__Races[index]=AI_PLAYERS_UI_RACES_MENU_ITEM_MATCHING_START_LOCATION - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[index]=BlzCreateFrameByType("BUTTON", "RaceUpButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, y - 0.04) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + 0.02, y - 0.02 - 0.04) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUpFrame[index]=BlzCreateFrameByType("BACKDROP", "RaceUpFrame" + I2S(index), WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUpFrame[index], WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUpFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUpFrame[index], true) - - set WoWReforgedAiPlayersUi__RaceUpTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__RaceUpTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowUp[index], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__RaceUpTrigger[index], function WoWReforgedAiPlayersUi__RaceUpFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__RaceUpTrigger[index] )), ( 0 ), ( index)) // INLINED!! - - set WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[index]=BlzCreateFrameByType("BUTTON", "RaceDownButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, y - 0.07) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + 0.02, y - 0.02 - 0.07) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDownFrame[index]=BlzCreateFrameByType("BACKDROP", "RaceDownFrame" + I2S(index), WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDownFrame[index], WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[index]) - call BlzFrameSetTexture(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDownFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDownFrame[index], true) - - set WoWReforgedAiPlayersUi__RaceDownTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__RaceDownTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnRaceEditArrowDown[index], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__RaceDownTrigger[index], function WoWReforgedAiPlayersUi__RaceDownFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__RaceDownTrigger[index] )), ( 0 ), ( index)) // INLINED!! - - set WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit[index]=BlzCreateFrame("ProfessionsPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PROFESSION_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PROFESSION_X + AI_PLAYERS_UI_COLUMN_PROFESSION_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit[index], 0) - set WoWReforgedAiPlayersUi__Professions[index]=0 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnProfessionEdit[index], true) - - // new line - set y=y - AI_PLAYERS_UI_LINE_HEIGHT - AI_PLAYERS_UI_LINE_HEIGHT_SPACING - set WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_GOLD_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_GOLD_X + AI_PLAYERS_UI_COLUMN_START_GOLD_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit[index], I2S(AI_PLAYERS_UI_START_GOLD)) - set WoWReforgedAiPlayersUi__StartGold[index]=AI_PLAYERS_UI_START_GOLD - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnStartGoldEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X + AI_PLAYERS_UI_COLUMN_START_LUMBER_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit[index], I2S(AI_PLAYERS_UI_START_LUMBER)) - set WoWReforgedAiPlayersUi__StartLumber[index]=AI_PLAYERS_UI_START_LUMBER - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnStartLumberEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X + AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit[index], "600") - set WoWReforgedAiPlayersUi__FoodLimit[index]=600 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnFoodLimitEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X + AI_PLAYERS_UI_COLUMN_START_EVOLUTION_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit[index], "1") - set WoWReforgedAiPlayersUi__StartEvolution[index]=1 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnStartEvolutionEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox[index]=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X + AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - set WoWReforgedAiPlayersUi__AttackPlayers[index]=0 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox[index], true) - if ( GetAIDifficulty(aiPlayer) == AI_DIFFICULTY_INSANE ) then - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnAttackPlayerCheckbox[index], 1.0) - endif - - set WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HEROES_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HEROES_X + AI_PLAYERS_UI_COLUMN_HEROES_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit[index], "1") - set WoWReforgedAiPlayersUi__HeroesCount[index]=1 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnHeroesEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X + AI_PLAYERS_UI_COLUMN_EXPANSIONS_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit[index], "0") - set WoWReforgedAiPlayersUi__Expansions[index]=0 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnExpansionsEdit[index], true) - - set WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox[index]=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X + AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - set WoWReforgedAiPlayersUi__SharedControl[index]=0 - set WoWReforgedAiPlayersUi__SharedControlAsync[index]=0 - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox[index], true) - set WoWReforgedAiPlayersUi__checkSharedControlTrigger[index]=CreateTrigger() - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__checkSharedControlTrigger[index] )), ( 0 ), ( index)) // INLINED!! - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__checkSharedControlTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox[index], FRAMEEVENT_CHECKBOX_CHECKED) - call TriggerAddCondition(WoWReforgedAiPlayersUi__checkSharedControlTrigger[index], Condition(function WoWReforgedAiPlayersUi__TriggerConditionCheckSharedControl)) - set WoWReforgedAiPlayersUi__uncheckSharedControlTrigger[index]=CreateTrigger() - call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi__uncheckSharedControlTrigger[index] )), ( 0 ), ( index)) // INLINED!! - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__uncheckSharedControlTrigger[index], WoWReforgedAiPlayersUi__LabelFrameColumnSharedControlCheckbox[index], FRAMEEVENT_CHECKBOX_UNCHECKED) - call TriggerAddCondition(WoWReforgedAiPlayersUi__uncheckSharedControlTrigger[index], Condition(function WoWReforgedAiPlayersUi__TriggerConditionUncheckSharedControl)) - - set WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit[index]=BlzCreateFrame("DifficultyPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X, y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X + AI_PLAYERS_UI_COLUMN_DIFFICULTY_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) - call BlzFrameSetValue(WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit[index], 1) // normal - set WoWReforgedAiPlayersUi__Difficulty[index]=1 // normal - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__LabelFrameColumnDifficultyEdit[index], true) - set y=y - AI_PLAYERS_UI_LINE_HEIGHT - AI_PLAYERS_UI_LINE_SPACING_Y - set counter=counter + 1 - if ( ModuloInteger(counter, AI_PLAYERS_UI_MAX_PLAYERS) == 0 ) then - set y=AI_PLAYERS_UI_LINE_HEADERS_Y - 2 * ( AI_PLAYERS_UI_LINE_HEADERS_HEIGHT + AI_PLAYERS_UI_LINE_SPACING_Y ) - endif - endif - set aiPlayer=null - set i=i + 1 - endloop - set WoWReforgedAiPlayersUi__Counter=counter - set WoWReforgedAiPlayersUi__MaxPages=counter / AI_PLAYERS_UI_MAX_PLAYERS - if ( ModuloInteger(counter, AI_PLAYERS_UI_MAX_PLAYERS) > 0 ) then - set WoWReforgedAiPlayersUi__MaxPages=WoWReforgedAiPlayersUi__MaxPages + 1 - endif - // apply button - set WoWReforgedAiPlayersUi__ApplyButton=BlzCreateFrame("ScriptDialogButton", WoWReforgedAiPlayersUi__BackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__ApplyButton, FRAMEPOINT_TOPLEFT, UI_FULLSCREEN_CLOSE_BUTTON_X, UI_FULLSCREEN_BOTTOM_BUTTON_Y) - call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi__ApplyButton, FRAMEPOINT_BOTTOMRIGHT, UI_FULLSCREEN_CLOSE_BUTTON_X + UI_FULLSCREEN_BOTTOM_BUTTON_WIDTH, UI_FULLSCREEN_BOTTOM_BUTTON_Y - UI_FULLSCREEN_BOTTOM_BUTTON_HEIGHT) - call BlzFrameSetText(WoWReforgedAiPlayersUi__ApplyButton, "|cffFCD20DApply|r") - set WoWReforgedAiPlayersUi__ApplyTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__ApplyTrigger, WoWReforgedAiPlayersUi__ApplyButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__ApplyTrigger, function WoWReforgedAiPlayersUi__ApplyFunction) - // previous page button - set WoWReforgedAiPlayersUi__PreviousPageButton=CreateFullScreenPreviousPageButton(WoWReforgedAiPlayersUi__BackgroundFrame , "|cffFCD20DPrevious Player|r") - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__PreviousPageButton, counter > AI_PLAYERS_UI_MAX_PLAYERS) - set WoWReforgedAiPlayersUi__PreviousPageTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__PreviousPageTrigger, WoWReforgedAiPlayersUi__PreviousPageButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__PreviousPageTrigger, function WoWReforgedAiPlayersUi__PreviousPageFunction) - // next page button - set WoWReforgedAiPlayersUi__NextPageButton=CreateFullScreenNextPageButton(WoWReforgedAiPlayersUi__BackgroundFrame , "|cffFCD20DNext Player|r") - call BlzFrameSetEnable(WoWReforgedAiPlayersUi__NextPageButton, counter > AI_PLAYERS_UI_MAX_PLAYERS) - set WoWReforgedAiPlayersUi__NextPageTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi__NextPageTrigger, WoWReforgedAiPlayersUi__NextPageButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedAiPlayersUi__NextPageTrigger, function WoWReforgedAiPlayersUi__NextPageFunction) - // hide - call WoWReforgedAiPlayersUi__SetVisible(false) // INLINED!! -endfunction -function CreateAiPlayersUI takes nothing returns nothing - local force aiPlayers= GetAiPlayersWithConfig() - call CreateAiPlayersUiEx(aiPlayers) - call ForceClear(aiPlayers) - call DestroyForce(aiPlayers) - set aiPlayers=null -endfunction -function WoWReforgedAiPlayersUi__Init takes nothing returns nothing - // sync trigger - set WoWReforgedAiPlayersUi__SyncTrigger=CreateTrigger() - call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedAiPlayersUi__SyncTrigger , WoWReforgedAiPlayersUi__PREFIX , false) - call TriggerAddAction(WoWReforgedAiPlayersUi__SyncTrigger, function WoWReforgedAiPlayersUi__TriggerActionSyncData) - //call FrameSaverAdd(function HideAiPlayersUi) -endfunction -//library WoWReforgedAiPlayersUi ends -//library WoWReforgedArmorer: -function WoWReforgedArmorer__ForgingHammer takes unit hero,item whichItem,integer defenseBonus returns integer - local integer itemTypeId= GetItemTypeId(whichItem) - local integer count= (LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId), 0)) // INLINED!! - local integer abilityId= 0 - local ability whichAbility= null - local integer result= 0 - local integer i= 1 - loop - exitwhen ( i > count ) - set abilityId=(LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId ), ( i))) // INLINED!! - set whichAbility=BlzGetItemAbility(whichItem, abilityId) - call AddAbilityFieldBonuses(abilityId , whichAbility , 0 , defenseBonus , 0 , 0.0 , 0 , 0 , 0 , 0 , 0.0 , 0 , 0 , 0 , 0) - // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 - call IncUnitAbilityLevel(hero, abilityId) - call DecUnitAbilityLevel(hero, abilityId) - set result=result + 1 - set i=i + 1 - endloop - if ( result > 0 ) then - call h__DisplayTimedTextToPlayer(GetOwningPlayer(hero), 0.0, 0.0, 4.0, "Increased armor bonus of item.") - endif - return result -endfunction -function WoWReforgedArmorer__TriggerConditionCast takes nothing returns boolean - if ( GetSpellAbilityId() == WoWReforgedArmorer__ABILITY_ID ) then - if ( WoWReforgedArmorer__ForgingHammer(GetTriggerUnit() , GetSpellTargetItem() , 2) <= 0 ) then - call SimError(GetOwningPlayer(GetTriggerUnit()) , "Item has no known armor bonus abilities.") - call IssueImmediateOrder(GetTriggerUnit(), "stop") - endif - endif - return false -endfunction -function WoWReforgedArmorer__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmorer__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(WoWReforgedArmorer__castTrigger, Condition(function WoWReforgedArmorer__TriggerConditionCast)) -endfunction -//library WoWReforgedArmorer ends -//library WoWReforgedCraftingStash: -function AddCraftingStash takes unit whichUnit returns nothing - local integer i= udg_RecipeCooking - local integer max= (Crafting___recipesCounter) // INLINED!! - call EnableItemCraftingUnit(whichUnit) - loop - exitwhen ( i >= max ) - call SetItemCraftingRecipeEnabled(whichUnit , i , false) - set i=i + 1 - endloop -endfunction -function AddRequirementsLegendaryItems takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedBosses___legendaryItemsCounter) // INLINED!! - loop - exitwhen ( i == max ) - call AddRecipeRequirementItem(udg_TmpInteger , (WoWReforgedBosses___legendaryItemTypeId[(i)]) , udg_TmpInteger2 , true) // INLINED!! - set i=i + 1 - endloop - set udg_TmpInteger2=1 -endfunction -//library WoWReforgedCraftingStash ends -//library WoWReforgedEnchanter: -function EnchanterSystemSaveBonus takes unit hero,integer bonusType,integer bonus returns nothing - call SaveInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType, bonus) -endfunction -function EnchanterSystemLoadBonus takes unit hero,integer bonusType returns integer - return LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType) -endfunction -function EnchanterSystemSaveBonusReal takes unit hero,integer bonusType,real bonus returns nothing - call SaveReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType, bonus) -endfunction -function EnchanterSystemLoadBonusReal takes unit hero,integer bonusType returns real - return LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType) -endfunction -function EnchanterAddItemBonusesEx takes unit hero,item whichItem,integer bonusHeroStatsAndDefense,real bonusDamage,real bonusHitPoints returns nothing - local integer itemTypeId= GetItemTypeId(whichItem) - local integer count= (LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId), 0)) // INLINED!! - local integer abilityId= 0 - local ability whichAbility= null - local integer i= 1 - loop - exitwhen ( i > count ) - set abilityId=(LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId ), ( i))) // INLINED!! - set whichAbility=BlzGetItemAbility(whichItem, abilityId) - //call BJDebugMsg("Adding bonus to ability " + GetObjectName(abilityId) + " of item " + GetItemName(whichItem)) - call AddAbilityFieldBonuses(abilityId , whichAbility , 0 , bonusHeroStatsAndDefense , bonusHeroStatsAndDefense , 0.0 , bonusDamage , bonusHitPoints , bonusHitPoints , 0 , 0.0 , I2R(bonusHeroStatsAndDefense) , bonusHeroStatsAndDefense , R2I(bonusHitPoints) , R2I(bonusHitPoints)) - // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 - call IncUnitAbilityLevel(hero, abilityId) - call DecUnitAbilityLevel(hero, abilityId) - set i=i + 1 - endloop -endfunction -function IsHeroEnchanted takes unit hero returns boolean - return IsUnitInGroup(hero, WoWReforgedEnchanter__EnchantedUnits) -endfunction -function WoWReforgedEnchanter__EnchanterSystemRemoveUnit takes unit whichUnit returns nothing - call FlushChildHashtable(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(whichUnit)) -endfunction -//processed hook: hook RemoveUnit WoWReforgedEnchanter__EnchanterSystemRemoveUnit -function EnchanterSetHeroBonus takes unit hero returns integer - local item whichItem= null - local integer oldEnchantingBonusHeroStatAndDefense= (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! - local real oldEnchantingBonusDamage= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! - local real oldEnchantingBonusHitPoints= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! - local integer enchantingItemsCounter= 0 - local integer heroStatsAndDefenseBonus= 0 - local real damageBonus= 0 - local real hitPointsBonus= 0 - local integer heroStatsAndDefenseBonusDiff= 0 - local real damageBonusDiff= 0 - local real hitPointsBonusDiff= 0 - local integer itemTypeId= 0 - local integer factor= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set whichItem=UnitItemInSlot(hero, i) - if ( whichItem != null ) then - set itemTypeId=GetItemTypeId(whichItem) - set factor=GetItemCharges(whichItem) - if ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_NOVICE ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_NOVICE * factor - set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_NOVICE * factor - set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_NOVICE * factor - set enchantingItemsCounter=enchantingItemsCounter + 1 - elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_ADVANCED ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_ADVANCED * factor - set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_ADVANCED * factor - set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_ADVANCED * factor - set enchantingItemsCounter=enchantingItemsCounter + 1 - elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_ADEPT ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_ADEPT * factor - set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_ADEPT * factor - set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_ADEPT * factor - set enchantingItemsCounter=enchantingItemsCounter + 1 - elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_MASTER ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_MASTER * factor - set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_MASTER * factor - set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_MASTER * factor - set enchantingItemsCounter=enchantingItemsCounter + 1 - elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_GRAND_MASTER ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_GRAND_MASTER * factor - set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_GRAND_MASTER * factor - set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_GRAND_MASTER * factor - set enchantingItemsCounter=enchantingItemsCounter + 1 - elseif ( itemTypeId == ENCHANTER_HIT_POINTS_BONUS_DOCTOR ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_DOCTOR * factor - set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_DOCTOR * factor - set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_DOCTOR * factor - set enchantingItemsCounter=enchantingItemsCounter + 1 - endif - endif - set whichItem=null - set i=i + 1 - endloop - //call BJDebugMsg("Old Hero stats and defense bonus " + I2S(oldEnchantingBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldEnchantingBonusDamage) + " and hit points bonus " + R2S(oldEnchantingBonusHitPoints)) - set heroStatsAndDefenseBonusDiff=heroStatsAndDefenseBonus - oldEnchantingBonusHeroStatAndDefense - set damageBonusDiff=damageBonus - oldEnchantingBonusDamage - set hitPointsBonusDiff=hitPointsBonus - oldEnchantingBonusHitPoints - //call BJDebugMsg("Hero stats and defense bonus " + I2S(heroStatsAndDefenseBonusDiff) + " and damage bonus " + R2S(damageBonusDiff) + " and hit points bonus " + R2S(hitPointsBonusDiff)) - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set whichItem=UnitItemInSlot(hero, i) - if ( whichItem != null ) then - call EnchanterAddItemBonusesEx(hero , whichItem , heroStatsAndDefenseBonusDiff , damageBonusDiff , hitPointsBonusDiff) - endif - set whichItem=null - set i=i + 1 - endloop - if ( enchantingItemsCounter > 0 ) then - call SaveInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS ), ( heroStatsAndDefenseBonus)) // INLINED!! - call SaveReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS ), (( damageBonus)*1.0)) // INLINED!! - call SaveReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS ), (( hitPointsBonus)*1.0)) // INLINED!! - if ( not IsUnitInGroup(hero, WoWReforgedEnchanter__EnchantedUnits) ) then - call GroupAddUnit(WoWReforgedEnchanter__EnchantedUnits, hero) - endif - elseif ( IsUnitInGroup(hero, WoWReforgedEnchanter__EnchantedUnits) ) then - call FlushChildHashtable(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero))) // INLINED!! - call GroupRemoveUnit(WoWReforgedEnchanter__EnchantedUnits, hero) - endif - return enchantingItemsCounter -endfunction -function EnchanterAddItemBonus takes unit hero,item whichItem returns nothing - local integer oldEnchantingBonusHeroStatAndDefense= (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! - local real oldEnchantingBonusDamage= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! - local real oldEnchantingBonusHitPoints= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! - //call BJDebugMsg("Add old Hero stats and defense bonus " + I2S(oldEnchantingBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldEnchantingBonusDamage) + " and hit points bonus " + R2S(oldEnchantingBonusHitPoints) + " to picked up item " + GetItemName(whichItem)) - call EnchanterAddItemBonusesEx(hero , whichItem , oldEnchantingBonusHeroStatAndDefense , oldEnchantingBonusDamage , oldEnchantingBonusHitPoints) -endfunction -function EnchanterRemoveItemBonus takes unit hero,item whichItem returns nothing - local integer oldEnchantingBonusHeroStatAndDefense= - (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! - local real oldEnchantingBonusDamage= - (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! - local real oldEnchantingBonusHitPoints= - (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! - //call BJDebugMsg("Remove old Hero stats and defense bonus " + I2S(oldEnchantingBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldEnchantingBonusDamage) + " and hit points bonus " + R2S(oldEnchantingBonusHitPoints) + " from dropped item " + GetItemName(whichItem)) - call EnchanterAddItemBonusesEx(hero , whichItem , oldEnchantingBonusHeroStatAndDefense , oldEnchantingBonusDamage , oldEnchantingBonusHitPoints) -endfunction -function EnchanterHeroInfo takes unit hero returns string - local integer oldEnchantingBonusHeroStatAndDefense= (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! - local real oldEnchantingBonusDamage= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! - local real oldEnchantingBonusHitPoints= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! - if ( oldEnchantingBonusHeroStatAndDefense > 0 ) then - return GetUnitName(hero) + " hero stats/defense/summoned units " + I2S(oldEnchantingBonusHeroStatAndDefense) + ", damage " + I2S(R2I(oldEnchantingBonusDamage)) + ", hp/mana " + I2S(R2I(oldEnchantingBonusHitPoints)) - endif - return null -endfunction -function EnchanterInfo takes player whichPlayer returns string - local string text= "Enchantable items: " + EquipmentBagListItemTypeIds() - //local group heroes = GetUnitsSelectedAll(whichPlayer) // TODO Desync. - local group heroes= GetPlayerHeroes(whichPlayer) - local unit hero= null - local string heroTxt= "" - local string txt= null - local integer i= 0 - loop - exitwhen ( i >= BlzGroupGetSize(heroes) ) - set hero=BlzGroupUnitAt(heroes, i) - if ( IsUnitType(hero, UNIT_TYPE_HERO) ) then - set txt=EnchanterHeroInfo(hero) - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, txt) - if ( txt != null ) then - if ( heroTxt != "" ) then - set heroTxt=heroTxt + ", " - endif - set heroTxt=heroTxt + txt - endif - endif - set hero=null - set i=i + 1 - endloop - call GroupClear(heroes) - call DestroyGroup(heroes) - set heroes=null - if ( heroTxt != "" ) then - return heroTxt + ", " + text - endif - return text -endfunction -function WoWReforgedEnchanter__TriggerConditionPickupItem takes nothing returns boolean - if ( (IsUnitInGroup((GetTriggerUnit()), WoWReforgedEnchanter__EnchantedUnits)) ) then // INLINED!! - return true - endif - return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetUnitTypeId(GetTriggerUnit()) != BACK_PACK and GetUnitTypeId(GetTriggerUnit()) != EQUIPMENT_BAG and ( GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_NOVICE or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADEPT or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_MASTER ) -endfunction -function WoWReforgedEnchanter__TriggerActionSetHeroBonus takes nothing returns nothing - if ( GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_NOVICE or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADEPT or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_MASTER ) then - call EnchanterSetHeroBonus(GetTriggerUnit()) - //call DisplayEnchanterHeroInfo(GetOwningPlayer(GetTriggerUnit()), GetTriggerUnit()) - endif - call EnchanterAddItemBonus(GetTriggerUnit() , GetManipulatedItem()) -endfunction -function WoWReforgedEnchanter__TriggerConditionDropItem takes nothing returns boolean - return (IsUnitInGroup((GetTriggerUnit()), WoWReforgedEnchanter__EnchantedUnits)) // INLINED!! -endfunction -function WoWReforgedEnchanter__TriggerActionSetHeroBonusDrop takes nothing returns nothing - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(GetTriggerUnit()) - local item droppedItem= GetManipulatedItem() - call EnchanterRemoveItemBonus(triggerUnit , GetManipulatedItem()) - call TriggerSleepAction(0.0) - if ( GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_NOVICE or GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_ADEPT or GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_MASTER ) then - call EnchanterSetHeroBonus(triggerUnit) - //call DisplayEnchanterHeroInfo(owner, triggerUnit) - endif - set droppedItem=null - set triggerUnit=null - set owner=null -endfunction -function WoWReforgedEnchanter__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedEnchanter__pickupItemTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) - call TriggerAddCondition(WoWReforgedEnchanter__pickupItemTrigger, Condition(function WoWReforgedEnchanter__TriggerConditionPickupItem)) - call TriggerAddAction(WoWReforgedEnchanter__pickupItemTrigger, function WoWReforgedEnchanter__TriggerActionSetHeroBonus) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedEnchanter__dropItemTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddCondition(WoWReforgedEnchanter__dropItemTrigger, Condition(function WoWReforgedEnchanter__TriggerConditionDropItem)) - call TriggerAddAction(WoWReforgedEnchanter__dropItemTrigger, function WoWReforgedEnchanter__TriggerActionSetHeroBonusDrop) -endfunction -//library WoWReforgedEnchanter ends -//library WoWReforgedHeroUtils: -// field 'ucam' -function IsCampaign takes integer objectTypeId returns boolean - if ( (LoadBoolean(ObjectDataFields___h, (objectTypeId ), ( OBJECT_DATA_FIELD_UCAM))) ) then // INLINED!! - call h__BJDebugMsg(GetObjectName(objectTypeId) + " is campaign.") - endif - return (LoadBoolean(ObjectDataFields___h, (objectTypeId ), ( OBJECT_DATA_FIELD_UCAM))) // INLINED!! -endfunction -function GetNpcName takes unit hero returns string - if ( IsUnitType(hero, UNIT_TYPE_HERO) and ( IsCampaign(GetUnitTypeId(hero)) or IsBoss(GetUnitTypeId(hero)) ) ) then - return GetHeroProperName(hero) - endif - - return GetUnitName(hero) -endfunction -//library WoWReforgedHeroUtils ends -//library WoWReforgedHeroesTavern: -function WoWReforgedHeroesTavern___AddHeroToTavern takes nothing returns nothing - local unit tavern= WoWReforgedHeroesTavern___tmpUnit - local integer i= WoWReforgedHeroesTavern___index - local string pageName= WoWReforgedHeroesTavern___tmpString - if ( (udg_HeroCategory[(i)]) != "" and (udg_HeroCategory[(i)]) != null and (udg_HeroCategory[(i)]) != pageName ) then // INLINED!! - set pageName=(udg_HeroCategory[(i)]) // INLINED!! - call NextPagedButtonsPage(tavern , pageName) - set WoWReforgedHeroesTavern___tmpString=pageName - endif -call AddPagedButtonsId((tavern ) , ( (udg_HeroUnitType[(i)])) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! -endfunction -function WoWReforgedHeroesTavern___AddHeroesTavern takes unit tavern returns nothing - local integer i= 0 - local integer max= (udg_HeroUnitTypeIndex) // INLINED!! - local string pageName= "" - call EnablePagedButtons(tavern) - call SetPagedButtonsSlotsPerPage(tavern , 9) - -call AddPagedButtonsId((tavern ) , ( ITEM_TYPE_RANDOM_HERO) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - - set i=0 - loop - exitwhen ( i >= max ) - set WoWReforgedHeroesTavern___index=i - set WoWReforgedHeroesTavern___tmpUnit=tavern - set WoWReforgedHeroesTavern___tmpString=pageName - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedHeroesTavern___AddHeroToTavern)) // INLINED!! - set pageName=WoWReforgedHeroesTavern___tmpString - set i=i + 1 - endloop - - call NextPagedButtonsPage(tavern , "Bosses") - set i=0 - set max=BlzGroupGetSize(udg_Bosses) - loop - exitwhen ( i >= max ) -call AddPagedButtonsId((tavern ) , ( GetUnitTypeId(BlzGroupUnitAt(udg_Bosses, i))) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! - set i=i + 1 - endloop - - call SetPagedButtonsPage(tavern , 0) -endfunction -function WoWReforgedHeroesTavern___ForGroupAddHeroesTavern takes nothing returns nothing - call WoWReforgedHeroesTavern___AddHeroesTavern(GetEnumUnit()) -endfunction -function WoWReforgedHeroesTavern___TimerFunctionAddHeroesTaverns takes nothing returns nothing - call ForGroupBJ(GetUnitsOfTypeIdAll(HEROES_TAVERN), function WoWReforgedHeroesTavern___ForGroupAddHeroesTavern) - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function SelectRandomHero takes unit buyingUnit,unit tavern returns nothing - local player owner= GetOwningPlayer(buyingUnit) - local integer array availableIds - local integer availableIdsCounter= 0 - local integer id= 0 - local integer random= 0 - local integer page= 0 - local integer i= 0 - local integer max= (udg_HeroUnitTypeIndex) // INLINED!! - loop - exitwhen ( i >= max ) - set id=(udg_HeroUnitType[(i)]) // INLINED!! - if ( PlayerCanBuyHeroEx(owner , id) ) then - set availableIds[availableIdsCounter]=id - set availableIdsCounter=availableIdsCounter + 1 - endif - set i=i + 1 - endloop - if ( GetHeroLevel1(owner) >= 50 ) then - set i=0 - set max=BlzGroupGetSize(udg_Bosses) - loop - exitwhen ( i >= max ) - set id=GetUnitTypeId(BlzGroupUnitAt(udg_Bosses, i)) - if ( PlayerCanBuyHeroEx(owner , id) ) then - set availableIds[availableIdsCounter]=id - set availableIdsCounter=availableIdsCounter + 1 - endif - set i=i + 1 - endloop - endif - - set random=GetRandomInt(0, availableIdsCounter - 1) - set id=availableIds[random] - //call BJDebugMsg("Selected random " + GetObjectName(id)) - set WoWReforgedHeroesTavern___index=GetPagedButtonIndex(tavern , id) - //call BJDebugMsg("index " + I2S(index)) - set page=GetPagedButtonsPageByIndex(tavern , WoWReforgedHeroesTavern___index) - //call BJDebugMsg("page " + I2S(page)) - call SetPagedButtonsPage(tavern , page) - call IssueNeutralImmediateOrderById(owner, tavern, id) - - set owner=null -endfunction -function WoWReforgedHeroesTavern___TriggerConditionSellItem takes nothing returns boolean - if ( GetItemTypeId(GetSoldItem()) == ITEM_TYPE_RANDOM_HERO ) then - call SelectRandomHero(GetBuyingUnit() , GetTriggerUnit()) - call h__RemoveItem(GetSoldItem()) - endif - return false -endfunction -function WoWReforgedHeroesTavern___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroesTavern___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedHeroesTavern___sellTrigger, Condition(function WoWReforgedHeroesTavern___TriggerConditionSellItem)) - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedHeroesTavern___TimerFunctionAddHeroesTaverns) -endfunction -//library WoWReforgedHeroesTavern ends -//library WoWReforgedInscriptor: -function InscriptorSystemSaveBonus takes unit hero,integer bonusType,integer bonus returns nothing - call SaveInteger(WoWReforgedInscriptor__h, GetHandleId(hero), bonusType, bonus) -endfunction -function InscriptorSystemLoadBonus takes unit hero,integer bonusType returns integer - return LoadInteger(WoWReforgedInscriptor__h, GetHandleId(hero), bonusType) -endfunction -function InscriptorSystemSaveBonusReal takes unit hero,integer bonusType,real bonus returns nothing - call SaveReal(WoWReforgedInscriptor__h, GetHandleId(hero), bonusType, bonus) -endfunction -function InscriptorSystemLoadBonusReal takes unit hero,integer bonusType returns real - return LoadReal(WoWReforgedInscriptor__h, GetHandleId(hero), bonusType) -endfunction -function InscriptorAddAbilityBonusesEx takes unit hero,ability whichAbility,integer bonusHeroStatsAndDefense,real bonusDamage,real bonusHitPoints returns nothing - local integer abilityId= BlzGetAbilityId(whichAbility) - local integer i= 0 - local integer max= 15 - //call BJDebugMsg("Adding bonus to ability " + GetObjectName(abilityId)) - loop - exitwhen ( i == max ) - call AddAbilityFieldBonuses(abilityId , whichAbility , i , bonusHeroStatsAndDefense , bonusHeroStatsAndDefense , 0.0 , bonusDamage , bonusHitPoints , bonusHitPoints , 0 , 0.0 , I2R(bonusHeroStatsAndDefense) , bonusHeroStatsAndDefense , R2I(bonusHitPoints) , R2I(bonusHitPoints)) - set i=i + 1 - endloop - // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 - //call IncUnitAbilityLevel(hero, abilityId) - //call DecUnitAbilityLevel(hero, abilityId) -endfunction -function IsHeroInscripted takes unit hero returns boolean - return IsUnitInGroup(hero, WoWReforgedInscriptor__targets) -endfunction -function WoWReforgedInscriptor__InscriptorSystemRemoveUnit takes unit whichUnit returns nothing - call FlushChildHashtable(WoWReforgedInscriptor__h, GetHandleId(whichUnit)) -endfunction -//processed hook: hook RemoveUnit WoWReforgedInscriptor__InscriptorSystemRemoveUnit -function InscriptorSetHeroBonus takes unit hero returns integer - local item whichItem= null - local ability whichAbility= null - local integer oldInscriptionBonusHeroStatAndDefense= (LoadInteger(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! - local real oldInscriptionBonusDamage= (LoadReal(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! - local real oldInscriptionBonusHitPoints= (LoadReal(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! - local integer inscriptionItemsCounter= 0 - local integer heroStatsAndDefenseBonus= 0 - local real damageBonus= 0 - local real hitPointsBonus= 0 - local integer heroStatsAndDefenseBonusDiff= 0 - local real damageBonusDiff= 0 - local real hitPointsBonusDiff= 0 - local integer itemTypeId= 0 - local integer factor= 0 - local integer heroSpellLevel= GetUnitAbilityLevel(hero, INSCRIPTION_HERO_SPELL) - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set whichItem=UnitItemInSlot(hero, i) - if ( whichItem != null ) then - set itemTypeId=GetItemTypeId(whichItem) - set factor=GetItemCharges(whichItem) - if ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_NOVICE ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_NOVICE * factor - set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_NOVICE * factor - set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_NOVICE * factor - set inscriptionItemsCounter=inscriptionItemsCounter + 1 - elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_ADVANCED * factor - set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_ADVANCED * factor - set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_ADVANCED * factor - set inscriptionItemsCounter=inscriptionItemsCounter + 1 - elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_ADEPT ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_ADEPT * factor - set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_ADEPT * factor - set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_ADEPT * factor - set inscriptionItemsCounter=inscriptionItemsCounter + 1 - elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_MASTER * factor - set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_MASTER * factor - set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_MASTER * factor - set inscriptionItemsCounter=inscriptionItemsCounter + 1 - elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_GRAND_MASTER ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_GRAND_MASTER * factor - set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_GRAND_MASTER * factor - set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_GRAND_MASTER * factor - set inscriptionItemsCounter=inscriptionItemsCounter + 1 - elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_DOCTOR ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_DOCTOR * factor - set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_DOCTOR * factor - set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_DOCTOR * factor - set inscriptionItemsCounter=inscriptionItemsCounter + 1 - endif - endif - set whichItem=null - set i=i + 1 - endloop - - if ( heroSpellLevel > 0 ) then - set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_MASTER * heroSpellLevel - set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_MASTER * heroSpellLevel - set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_MASTER * heroSpellLevel - set inscriptionItemsCounter=inscriptionItemsCounter + 1 - endif - //call BJDebugMsg("Old Hero stats and defense bonus " + I2S(oldInscriptionBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldInscriptionBonusDamage) + " and hit points bonus " + R2S(oldInscriptionBonusHitPoints)) - set heroStatsAndDefenseBonusDiff=heroStatsAndDefenseBonus - oldInscriptionBonusHeroStatAndDefense - set damageBonusDiff=damageBonus - oldInscriptionBonusDamage - set hitPointsBonusDiff=hitPointsBonus - oldInscriptionBonusHitPoints - //call BJDebugMsg("Hero stats and defense bonus " + I2S(heroStatsAndDefenseBonusDiff) + " and damage bonus " + R2S(damageBonusDiff) + " and hit points bonus " + R2S(hitPointsBonusDiff)) - set i=0 - loop - exitwhen ( i == 20 ) - set whichAbility=BlzGetUnitAbilityByIndex(hero, i) - if ( whichAbility != null and (LoadInteger(WoWReforgedAbilityFields__AbilityFieldCountersHashTable, (BlzGetAbilityId(whichAbility)), 0)) > 0 ) then // INLINED!! - call InscriptorAddAbilityBonusesEx(hero , whichAbility , heroStatsAndDefenseBonusDiff , damageBonusDiff , hitPointsBonusDiff) - endif - set whichAbility=null - set i=i + 1 - endloop - if ( inscriptionItemsCounter > 0 ) then - call SaveInteger(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS ), ( heroStatsAndDefenseBonus)) // INLINED!! - call SaveReal(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_DAMAGE_BONUS ), (( damageBonus)*1.0)) // INLINED!! - call SaveReal(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS ), (( hitPointsBonus)*1.0)) // INLINED!! - if ( not IsUnitInGroup(hero, WoWReforgedInscriptor__targets) ) then - call GroupAddUnit(WoWReforgedInscriptor__targets, hero) - endif - elseif ( IsUnitInGroup(hero, WoWReforgedInscriptor__targets) ) then - call FlushChildHashtable(WoWReforgedInscriptor__h, GetHandleId((hero))) // INLINED!! - call GroupRemoveUnit(WoWReforgedInscriptor__targets, hero) - endif - return inscriptionItemsCounter -endfunction -function InscriptorHeroInfo takes unit hero returns string - local integer oldInscriptionBonusHeroStatAndDefense= (LoadInteger(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! - local real oldInscriptionBonusDamage= (LoadReal(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! - local real oldInscriptionBonusHitPoints= (LoadReal(WoWReforgedInscriptor__h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! - if ( oldInscriptionBonusHeroStatAndDefense > 0 ) then - return GetUnitName(hero) + " hero stats/defense/summoned units " + I2S(oldInscriptionBonusHeroStatAndDefense) + ", damage " + I2S(R2I(oldInscriptionBonusDamage)) + ", hp/mana " + I2S(R2I(oldInscriptionBonusHitPoints)) - endif - return null -endfunction -function InscriptorInfo takes player whichPlayer returns string - local string text= "Inscriptable spells: " + AbilityFieldsListNonItemAbilities() - //local group heroes = GetUnitsSelectedAll(whichPlayer) // TODO Desync. - local group heroes= GetPlayerHeroes(whichPlayer) - local unit hero= null - local string heroTxt= "" - local string txt= null - local integer i= 0 - loop - exitwhen ( i >= BlzGroupGetSize(heroes) ) - set hero=BlzGroupUnitAt(heroes, i) - if ( IsUnitType(hero, UNIT_TYPE_HERO) ) then - set txt=InscriptorHeroInfo(hero) - if ( txt != null ) then - if ( heroTxt != "" ) then - set heroTxt=heroTxt + ", " - endif - set heroTxt=heroTxt + txt - endif - endif - set hero=null - set i=i + 1 - endloop - call GroupClear(heroes) - call DestroyGroup(heroes) - set heroes=null - if ( heroTxt != "" ) then - return heroTxt + ", " + text - endif - return text -endfunction -function DisplayInscriptorHeroInfo takes player whichPlayer,unit hero returns nothing - local string txt= InscriptorHeroInfo(hero) - if ( txt != null ) then - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, txt) - endif -endfunction -function WoWReforgedInscriptor__TriggerConditionPickupItem takes nothing returns boolean - if ( (IsUnitInGroup((GetTriggerUnit()), WoWReforgedInscriptor__targets)) ) then // INLINED!! - return true - endif - return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetUnitTypeId(GetTriggerUnit()) != BACK_PACK and GetUnitTypeId(GetTriggerUnit()) != EQUIPMENT_BAG and ( GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_NOVICE or GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_ADEPT or GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) -endfunction -function WoWReforgedInscriptor__TriggerActionSetHeroBonus takes nothing returns nothing - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - local item manipulatedItem= GetManipulatedItem() - if ( GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_NOVICE or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADEPT or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) then - call InscriptorSetHeroBonus(triggerUnit) - //call DisplayInscriptorHeroInfo(owner, triggerUnit) - endif - set manipulatedItem=null - set triggerUnit=null - set owner=null -endfunction -function WoWReforgedInscriptor__TriggerConditionDropItem takes nothing returns boolean - return (IsUnitInGroup((GetTriggerUnit()), WoWReforgedInscriptor__targets)) // INLINED!! -endfunction -function WoWReforgedInscriptor__TriggerActionSetHeroBonusDrop takes nothing returns nothing - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - local item manipulatedItem= GetManipulatedItem() - call TriggerSleepAction(0.0) - if ( GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_NOVICE or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADEPT or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) then - call InscriptorSetHeroBonus(triggerUnit) - //call DisplayInscriptorHeroInfo(owner, triggerUnit) - endif - set manipulatedItem=null - set triggerUnit=null - set owner=null -endfunction -function WoWReforgedInscriptor__TriggerConditionLearn takes nothing returns boolean - return (IsUnitInGroup((GetTriggerUnit()), WoWReforgedInscriptor__targets)) or GetLearnedSkill() == INSCRIPTION_HERO_SPELL // INLINED!! -endfunction -function WoWReforgedInscriptor__TriggerActionLearn takes nothing returns nothing - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - call InscriptorSetHeroBonus(triggerUnit) - //call DisplayInscriptorHeroInfo(owner, triggerUnit) - set triggerUnit=null - set owner=null -endfunction -function WoWReforgedInscriptor__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedInscriptor__pickupItemTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) - call TriggerAddCondition(WoWReforgedInscriptor__pickupItemTrigger, Condition(function WoWReforgedInscriptor__TriggerConditionPickupItem)) - call TriggerAddAction(WoWReforgedInscriptor__pickupItemTrigger, function WoWReforgedInscriptor__TriggerActionSetHeroBonus) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedInscriptor__dropItemTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddCondition(WoWReforgedInscriptor__dropItemTrigger, Condition(function WoWReforgedInscriptor__TriggerConditionDropItem)) - call TriggerAddAction(WoWReforgedInscriptor__dropItemTrigger, function WoWReforgedInscriptor__TriggerActionSetHeroBonusDrop) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedInscriptor__learnTrigger, EVENT_PLAYER_HERO_SKILL) - call TriggerAddCondition(WoWReforgedInscriptor__learnTrigger, Condition(function WoWReforgedInscriptor__TriggerConditionLearn)) - call TriggerAddAction(WoWReforgedInscriptor__learnTrigger, function WoWReforgedInscriptor__TriggerActionLearn) -endfunction -//library WoWReforgedInscriptor ends -//library WoWReforgedMounts: -function IsUnitMount takes unit mount returns boolean - return HaveSavedHandle(WoWReforgedMounts__h, GetHandleId(mount), WoWReforgedMounts__KEY_HERO) -endfunction -function MountGet takes unit hero returns unit - if ( HaveSavedHandle(WoWReforgedMounts__h, GetHandleId(hero), WoWReforgedMounts__KEY_MOUNT) ) then - return LoadUnitHandle(WoWReforgedMounts__h, GetHandleId(hero), WoWReforgedMounts__KEY_MOUNT) - endif - return null -endfunction -function MountClear takes unit hero returns nothing - local unit mount= LoadUnitHandle(WoWReforgedMounts__h, GetHandleId(hero), WoWReforgedMounts__KEY_MOUNT) - if ( mount != null ) then - call FlushChildHashtable(WoWReforgedMounts__h, GetHandleId(mount)) - set mount=null - endif - call FlushChildHashtable(WoWReforgedMounts__h, GetHandleId(hero)) -endfunction -function GetMount1 takes player whichPlayer returns unit - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null and MountGet((udg_Hero[GetPlayerId((whichPlayer))])) != null ) then // INLINED!! - return MountGet((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - endif - return null -endfunction -function GetMount2 takes player whichPlayer returns unit - if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null and MountGet((udg_Hero2[GetPlayerId((whichPlayer))])) != null ) then // INLINED!! - return MountGet((udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! - endif - return null -endfunction -function GetMount3 takes player whichPlayer returns unit - if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null and MountGet((udg_Hero3[GetPlayerId((whichPlayer))])) != null ) then // INLINED!! - return MountGet((udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! - endif - return null -endfunction -function WoWReforgedMounts__GetMountData takes unit mount returns integer - local player owner= GetOwningPlayer(mount) - local integer playerId= GetPlayerId(owner) - if ( GetMount2(owner) == mount ) then - return WoWReforgedMounts__mountData2[playerId] - elseif ( GetMount3(owner) == mount ) then - return WoWReforgedMounts__mountData3[playerId] - endif - return WoWReforgedMounts__mountData1[playerId] -endfunction -function AddMountAbility takes unit mount,integer abilityId returns nothing - local integer mountData= WoWReforgedMounts__GetMountData(mount) - if ( mountData != 0 ) then - if ( s__MountData_abilityIdsCount[mountData] < WoWReforgedMounts__MAX_ABILITIES ) then - set s___MountData_abilityIds[s__MountData_abilityIds[mountData]+s__MountData_abilityIdsCount[mountData]]=abilityId - set s__MountData_abilityIdsCount[mountData]=s__MountData_abilityIdsCount[mountData] + 1 - else - call SimError(GetOwningPlayer(mount) , "Reached maximum of mount abilities.") - endif - endif -endfunction -function ClearMountAbilities takes unit mount returns nothing - local integer mountData= WoWReforgedMounts__GetMountData(mount) - if ( mountData != 0 ) then - set s__MountData_abilityIdsCount[mountData]=0 - endif -endfunction -function WoWReforgedMounts__RestoreMountAbilities takes unit mount returns nothing - local integer mountData= WoWReforgedMounts__GetMountData(mount) - local integer count= 0 - local integer i= 0 - if ( mountData != 0 ) then - set count=s__MountData_abilityIdsCount[mountData] - loop - exitwhen ( i == count ) - call UnitAddAbility(mount, s___MountData_abilityIds[s__MountData_abilityIds[mountData]+i]) - set i=i + 1 - endloop - endif -endfunction -function SetMountName1 takes player whichPlayer,string name returns nothing - set s__MountData_name[WoWReforgedMounts__mountData1[GetPlayerId(whichPlayer)]]=name - if ( GetMount1(whichPlayer) != null ) then - if ( StringLength(name) == 0 ) then - call BlzSetUnitName(GetMount1(whichPlayer), GetObjectName(GetUnitTypeId(GetMount1(whichPlayer)))) - else - call BlzSetUnitName(GetMount1(whichPlayer), name) - endif - endif -endfunction -function GetMountName1 takes player whichPlayer returns string - return s__MountData_name[WoWReforgedMounts__mountData1[GetPlayerId(whichPlayer)]] -endfunction -function SetMountName2 takes player whichPlayer,string name returns nothing - set s__MountData_name[WoWReforgedMounts__mountData2[GetPlayerId(whichPlayer)]]=name - if ( GetMount2(whichPlayer) != null ) then - if ( StringLength(name) == 0 ) then - call BlzSetUnitName(GetMount2(whichPlayer), GetObjectName(GetUnitTypeId(GetMount2(whichPlayer)))) - else - call BlzSetUnitName(GetMount2(whichPlayer), name) - endif - endif -endfunction -function GetMountName2 takes player whichPlayer returns string - return s__MountData_name[WoWReforgedMounts__mountData2[GetPlayerId(whichPlayer)]] -endfunction -function SetMountName3 takes player whichPlayer,string name returns nothing - set s__MountData_name[WoWReforgedMounts__mountData3[GetPlayerId(whichPlayer)]]=name - if ( GetMount3(whichPlayer) != null ) then - if ( StringLength(name) == 0 ) then - call BlzSetUnitName(GetMount3(whichPlayer), GetObjectName(GetUnitTypeId(GetMount3(whichPlayer)))) - else - call BlzSetUnitName(GetMount3(whichPlayer), name) - endif - endif -endfunction -function GetMountName3 takes player whichPlayer returns string - return s__MountData_name[WoWReforgedMounts__mountData3[GetPlayerId(whichPlayer)]] -endfunction -function MountKill takes unit hero returns nothing - local unit mount= MountGet(hero) - if ( mount != null ) then - call KillUnit(mount) // in case there are transported units - endif - set mount=null - call MountClear(hero) -endfunction -function MountKill1 takes player whichPlayer returns nothing - call MountKill(udg_Hero[GetPlayerId(whichPlayer)]) -endfunction -function MountKill2 takes player whichPlayer returns nothing - call MountKill(udg_Hero2[GetPlayerId(whichPlayer)]) -endfunction -function MountKill3 takes player whichPlayer returns nothing - call MountKill(udg_Hero3[GetPlayerId(whichPlayer)]) -endfunction -function MountReplace takes unit hero,unit mount returns nothing - local player owner= GetOwningPlayer(hero) - call MountKill(hero) - call SaveUnitHandle(WoWReforgedMounts__h, GetHandleId(hero), WoWReforgedMounts__KEY_MOUNT, mount) - call SaveUnitHandle(WoWReforgedMounts__h, GetHandleId(mount), WoWReforgedMounts__KEY_HERO, hero) - if ( hero == (udg_Hero[GetPlayerId((owner))]) and StringLength((s__MountData_name[WoWReforgedMounts__mountData1[GetPlayerId((owner))]])) > 0 ) then // INLINED!! - call BlzSetUnitName(mount, (s__MountData_name[WoWReforgedMounts__mountData1[GetPlayerId((owner))]])) // INLINED!! - call WoWReforgedMounts__RestoreMountAbilities(mount) - elseif ( hero == (udg_Hero2[GetPlayerId((owner))]) and StringLength((s__MountData_name[WoWReforgedMounts__mountData2[GetPlayerId((owner))]])) > 0 ) then // INLINED!! - call BlzSetUnitName(mount, (s__MountData_name[WoWReforgedMounts__mountData2[GetPlayerId((owner))]])) // INLINED!! - call WoWReforgedMounts__RestoreMountAbilities(mount) - elseif ( hero == (udg_Hero3[GetPlayerId((owner))]) and StringLength((s__MountData_name[WoWReforgedMounts__mountData3[GetPlayerId((owner))]])) > 0 ) then // INLINED!! - call BlzSetUnitName(mount, (s__MountData_name[WoWReforgedMounts__mountData3[GetPlayerId((owner))]])) // INLINED!! - call WoWReforgedMounts__RestoreMountAbilities(mount) - endif - set owner=null -endfunction -function MountGetAll takes player whichPlayer returns group - local group result= CreateGroup() - local integer playerId= GetPlayerId(whichPlayer) - if ( udg_Hero[playerId] != null and MountGet(udg_Hero[playerId]) != null ) then - call GroupAddUnit(result, MountGet(udg_Hero[playerId])) - endif - if ( udg_Hero2[playerId] != null and MountGet(udg_Hero2[playerId]) != null ) then - call GroupAddUnit(result, MountGet(udg_Hero2[playerId])) - endif - if ( udg_Hero3[playerId] != null and MountGet(udg_Hero3[playerId]) != null ) then - call GroupAddUnit(result, MountGet(udg_Hero3[playerId])) - endif - return result -endfunction -function MountKillAll takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - if ( udg_Hero[playerId] != null and MountGet(udg_Hero[playerId]) != null ) then - call MountKill(udg_Hero[playerId]) - endif - if ( udg_Hero2[playerId] != null and MountGet(udg_Hero2[playerId]) != null ) then - call MountKill(udg_Hero2[playerId]) - endif - if ( udg_Hero3[playerId] != null and MountGet(udg_Hero3[playerId]) != null ) then - call MountKill(udg_Hero[playerId]) - endif -endfunction -function MountClearAll takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - if ( udg_Hero[playerId] != null ) then - call MountClear(udg_Hero[playerId]) - endif - if ( udg_Hero2[playerId] != null ) then - call MountClear(udg_Hero2[playerId]) - endif - if ( udg_Hero3[playerId] != null ) then - call MountClear(udg_Hero[playerId]) - endif -endfunction -function SelectNextMount takes player whichPlayer returns unit - local group mounts= MountGetAll(whichPlayer) - local unit result= GetNextUnitToSelect(mounts , whichPlayer) - call GroupClear(mounts) - call DestroyGroup(mounts) - set mounts=null - - if ( result != null ) then - call SelectUnitForPlayerSingle(result, whichPlayer) - call SmartCameraPanToUnit(whichPlayer , result , 0.0) - else - call SimError(whichPlayer , "No mounts.") - endif - - return result -endfunction - - function s__WoWReforgedMounts__M_create takes integer unitTypeId,integer abilityId,integer itemTypeId,boolean bonus returns integer - local integer this= s__WoWReforgedMounts__M__allocate() - set s__WoWReforgedMounts__M_unitTypeId[this]=unitTypeId - set s__WoWReforgedMounts__M_abilityId[this]=abilityId - set s__WoWReforgedMounts__M_itemTypeId[this]=itemTypeId - set s__WoWReforgedMounts__M_bonus[this]=bonus - return this - endfunction -function GetMountTypesMax takes nothing returns integer - return WoWReforgedMounts__mountTypesCounter -endfunction -function GetPlayerHasMounts takes player whichPlayer returns boolean - return WoWReforgedMounts__playerHasMounts[GetPlayerId(whichPlayer)] -endfunction -function GetMountType takes integer index returns integer - return WoWReforgedMounts__mountTypes[index] -endfunction -function WoWReforgedMounts__MakeMountTypesAvailable takes player whichPlayer,boolean available returns nothing - local integer max= (WoWReforgedMounts__mountTypesCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i >= max ) - call SetPlayerAbilityAvailable(whichPlayer, s__WoWReforgedMounts__M_abilityId[(WoWReforgedMounts__mountTypes[(i)])], available) // INLINED!! - set i=i + 1 - endloop -endfunction -function WoWReforgedMounts__SetPlayerHasMounts takes player whichPlayer,boolean flag returns nothing - set WoWReforgedMounts__playerHasMounts[GetPlayerId(whichPlayer)]=flag - call WoWReforgedMounts__MakeMountTypesAvailable(whichPlayer , flag) -endfunction -function GetMountTypeByItemTypeId takes integer itemTypeId returns integer - local integer max= (WoWReforgedMounts__mountTypesCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i >= max ) - if ( s__WoWReforgedMounts__M_itemTypeId[(WoWReforgedMounts__mountTypes[(i)])] == itemTypeId ) then // INLINED!! - return (WoWReforgedMounts__mountTypes[(i)]) // INLINED!! - endif - set i=i + 1 - endloop - return 0 -endfunction -function WoWReforgedMounts__GetMountTypeByUnitTypeId takes integer unitTypeId returns integer - local integer max= (WoWReforgedMounts__mountTypesCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i >= max ) - if ( s__WoWReforgedMounts__M_unitTypeId[(WoWReforgedMounts__mountTypes[(i)])] == unitTypeId ) then // INLINED!! - return (WoWReforgedMounts__mountTypes[(i)]) // INLINED!! - endif - set i=i + 1 - endloop - return 0 -endfunction -function WoWReforgedMounts__GetMountTypeByAbilityId takes integer abilityId returns integer - local integer max= (WoWReforgedMounts__mountTypesCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i >= max ) - if ( s__WoWReforgedMounts__M_abilityId[(WoWReforgedMounts__mountTypes[(i)])] == abilityId ) then // INLINED!! - return (WoWReforgedMounts__mountTypes[(i)]) // INLINED!! - endif - set i=i + 1 - endloop - return 0 -endfunction -function GetHeroMountUnitTypeId takes unit hero returns integer - local integer mount= 0 - local integer abilityId= 0 - local integer max= 10 - local integer i= 0 - loop - exitwhen ( i >= max ) - if ( BlzGetUnitAbilityByIndex(hero, i) != null ) then - set abilityId=BlzGetAbilityId(BlzGetUnitAbilityByIndex(hero, i)) - if ( abilityId != 0 ) then - set mount=WoWReforgedMounts__GetMountTypeByAbilityId(abilityId) - if ( mount != 0 ) then - return s__WoWReforgedMounts__M_unitTypeId[mount] - endif - endif - endif - set i=i + 1 - endloop - return 0 -endfunction -function IsMount takes integer unitTypeId returns boolean - return WoWReforgedMounts__GetMountTypeByUnitTypeId(unitTypeId) != 0 -endfunction -function WoWReforgedMounts__ForForceMakeNotAvailable takes nothing returns nothing - call SetPlayerAbilityAvailable(GetEnumPlayer(), WoWReforgedMounts__tmpAbilityId, false) -endfunction -function WoWReforgedMounts__MakeMountTypesNotAvailable takes integer abilityId returns nothing - set WoWReforgedMounts__tmpAbilityId=abilityId - call ForForce(GetPlayersAll(), function WoWReforgedMounts__ForForceMakeNotAvailable) -endfunction -function AddMountType takes nothing returns integer - local integer index= WoWReforgedMounts__mountTypesCounter - local integer m= s__WoWReforgedMounts__M_create(udg_TmpUnitType , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpBoolean) - set WoWReforgedMounts__mountTypes[index]=m - set WoWReforgedMounts__mountTypesCounter=WoWReforgedMounts__mountTypesCounter + 1 - call WoWReforgedMounts__MakeMountTypesNotAvailable(udg_TmpAbilityCode) - set udg_TmpBoolean=false - return m -endfunction -function RemoveRunningWildAbilities takes unit hero returns nothing - call UnitRemoveAbility(hero, WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATH_KNIGHT) - call UnitRemoveAbility(hero, WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATHCLAW) - call UnitRemoveAbility(hero, WoWReforgedMounts_RUNNING_WILD_GREYMANE) -endfunction -function WoWReforgedMounts__GetRunningWildAbilityId takes integer unitTypeId returns integer - if ( unitTypeId == WoWReforgedMounts_WORGEN_DEATH_KNIGHT ) then - return WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATH_KNIGHT - elseif ( unitTypeId == WoWReforgedMounts_WORGEN_DEATHCLAW ) then - return WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATHCLAW - elseif ( unitTypeId == WoWReforgedMounts_WORGEN_GREYMANE ) then - return WoWReforgedMounts_RUNNING_WILD_GREYMANE - endif - return - 1 -endfunction -function WoWReforgedMounts__IsWorgenHero takes integer unitTypeId returns boolean - return unitTypeId == WoWReforgedMounts_WORGEN_DEATH_KNIGHT or unitTypeId == WoWReforgedMounts_WORGEN_DEATHCLAW -endfunction -function WoWReforgedMounts__IsEvokerHero takes integer unitTypeId returns boolean - return unitTypeId == WoWReforgedMounts_EVOKER -endfunction -function WoWReforgedMounts__RemoveMountTypeAbilities takes unit hero returns nothing - local integer max= (WoWReforgedMounts__mountTypesCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i >= max ) - call UnitRemoveAbility(hero, s__WoWReforgedMounts__M_abilityId[(WoWReforgedMounts__mountTypes[(i)])]) // INLINED!! - set i=i + 1 - endloop - call RemoveRunningWildAbilities(hero) -endfunction -function WoWReforgedMounts__ReplaceMountType takes unit hero,integer m returns nothing - local integer abilityId= s__WoWReforgedMounts__M_abilityId[m] - local boolean isRunningWild= s__WoWReforgedMounts__M_itemTypeId[m] == WoWReforgedMounts_RUNNING_WILD_ITEM_TYPE_ID - call WoWReforgedMounts__RemoveMountTypeAbilities(hero) - if ( isRunningWild ) then - set abilityId=WoWReforgedMounts__GetRunningWildAbilityId(GetUnitTypeId(hero)) - endif - if ( abilityId != - 1 ) then - call UnitAddAbility(hero, s__WoWReforgedMounts__M_abilityId[m]) - call UnitMakeAbilityPermanent(hero, true, s__WoWReforgedMounts__M_abilityId[m]) - else - call SimError(GetOwningPlayer(hero) , "Unable to add mount ability.") - endif -endfunction -function WoWReforgedMounts__TriggerConditionSellMount takes nothing returns boolean - local unit hero= GetBuyingUnit() - local player owner= GetOwningPlayer(hero) - local integer unitTypeId= GetUnitTypeId(hero) - local integer itemTypeId= GetItemTypeId(GetSoldItem()) - local integer m= GetMountTypeByItemTypeId(itemTypeId) - if ( m != 0 ) then - if ( not s__WoWReforgedMounts__M_bonus[m] or udg_UnlockedAll or GetHeroLevel1(owner) >= HERO_JOURNEY_BONUS_MOUNTS or (IsPlayerInForce((owner), WoWReforgedVIPs___vipPlayers)) ) then // INLINED!! - if ( PlayerHasUnlocked(owner , s__WoWReforgedMounts__M_unitTypeId[m]) ) then - if ( unitTypeId != BACK_PACK and unitTypeId != EQUIPMENT_BAG ) then - if ( (WoWReforgedMounts__playerHasMounts[GetPlayerId((owner))]) or udg_UnlockedAll ) then // INLINED!! - if ( itemTypeId != WoWReforgedMounts_RUNNING_WILD_ITEM_TYPE_ID or WoWReforgedMounts__IsWorgenHero(unitTypeId) ) then - if ( itemTypeId != WoWReforgedMounts_DRAGON_FORM_ITEM_TYPE_ID or ((unitTypeId) == WoWReforgedMounts_EVOKER) ) then // INLINED!! - call WoWReforgedMounts__ReplaceMountType(hero , m) - call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Adding mount " + GetObjectName(s__WoWReforgedMounts__M_unitTypeId[m])) - else - call SimError(owner , "Only Dracthyr heroes can learn this.") - endif - else - call SimError(owner , "Only Worgen heroes can learn this.") - endif - else - call SimError(owner , "Your hero must be level " + I2S(HERO_JOURNEY_MOUNTS) + " or higher.") - endif - else - call SimError(owner , "Only your heroes can change their mounts.") - endif - else - call SimError(owner , "The mount is restricted to account names: " + GetAllUnlockedAccountNames(s__WoWReforgedMounts__M_unitTypeId[m])) - endif - else - call SimError(owner , "Bonus mounts require VIPs, hero level " + I2S(HERO_JOURNEY_BONUS_MOUNTS) + " or -unlock.") - endif - endif - set hero=null - set owner=null - return false -endfunction -function WoWReforgedMounts__TriggerConditionLevel takes nothing returns boolean - local unit hero= GetLevelingUnit() - local player owner= GetOwningPlayer(hero) - if ( (udg_Hero[GetPlayerId((owner))]) == hero and GetHeroLevel(hero) >= WoWReforgedMounts_MOUNTS_HERO_LEVEL and not (WoWReforgedMounts__playerHasMounts[GetPlayerId((owner))]) ) then // INLINED!! - call WoWReforgedMounts__SetPlayerHasMounts(owner , true) - endif - set hero=null - set owner=null - - return false -endfunction -function WoWReforgedMounts__TriggerConditionSummonMount takes nothing returns boolean - local unit hero= GetSummoningUnit() - local unit mount= GetSummonedUnit() - if ( WoWReforgedMounts__GetMountTypeByUnitTypeId(GetUnitTypeId(mount)) != 0 ) then - call MountReplace(hero , mount) - endif - set hero=null - set mount=null - - return false -endfunction -function WoWReforgedMounts__AddMountTypesToShop takes unit shop returns nothing - local integer max= (WoWReforgedMounts__mountTypesCounter) // INLINED!! - local integer i= 0 - call EnablePagedButtons(shop) - loop - exitwhen ( i >= max ) -call AddPagedButtonsId((shop ) , ( s__WoWReforgedMounts__M_itemTypeId[(WoWReforgedMounts__mountTypes[(i)])]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop -endfunction -function WoWReforgedMounts__TriggerConditionConstructionFinish takes nothing returns boolean - local unit shop= GetConstructedStructure() - if ( GetUnitTypeId(shop) == WoWReforgedMounts_MOUNTS_CAGE ) then - call WoWReforgedMounts__AddMountTypesToShop(shop) - endif - set shop=null - return false -endfunction -function WoWReforgedMounts__ForGroupAddShop takes nothing returns nothing - call WoWReforgedMounts__AddMountTypesToShop(GetEnumUnit()) -endfunction -function AddMountShops takes nothing returns nothing - local group shops= GetUnitsOfTypeIdAll(MOUNTS_SHOP) - call ForGroup(shops, function WoWReforgedMounts__ForGroupAddShop) - call GroupClear(shops) - call DestroyGroup(shops) - set shops=null -endfunction -function WoWReforgedMounts__Init takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set WoWReforgedMounts__mountData1[i]=s__MountData__allocate() - set WoWReforgedMounts__mountData2[i]=s__MountData__allocate() - set WoWReforgedMounts__mountData3[i]=s__MountData__allocate() - set i=i + 1 - endloop - call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedMounts__sellTrigger, Condition(function WoWReforgedMounts__TriggerConditionSellMount)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts__levelTrigger, EVENT_PLAYER_HERO_LEVEL) - call TriggerAddCondition(WoWReforgedMounts__levelTrigger, Condition(function WoWReforgedMounts__TriggerConditionLevel)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedMounts__summonTrigger, Condition(function WoWReforgedMounts__TriggerConditionSummonMount)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedMounts__constructionTrigger, Condition(function WoWReforgedMounts__TriggerConditionConstructionFinish)) -endfunction -//library WoWReforgedMounts ends -//library WoWReforgedRaces: -function GetPlayerRace1 takes player whichPlayer returns integer - return udg_PlayerRace[GetConvertedPlayerId(whichPlayer)] -endfunction -function GetPlayerRace2 takes player whichPlayer returns integer - return udg_PlayerRace2[GetConvertedPlayerId(whichPlayer)] -endfunction -function GetPlayerRace3 takes player whichPlayer returns integer - return udg_PlayerRace3[GetConvertedPlayerId(whichPlayer)] -endfunction -function PlayerHasRace takes player whichPlayer,integer whichRace returns boolean - return (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) == whichRace or (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) == whichRace or (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) == whichRace // INLINED!! -endfunction -function IsRaceUnit takes integer t returns boolean - if ( t == RACE_OBJECT_TYPE_WORKER ) then - return true - elseif ( t == RACE_OBJECT_TYPE_MALE_CITIZEN ) then - return true - elseif ( t == RACE_OBJECT_TYPE_FEMALE_CITIZEN ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TOWN_HALL_4 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_PET ) then - return true - elseif ( t == RACE_OBJECT_TYPE_FOOTMAN ) then - return true - elseif ( t == RACE_OBJECT_TYPE_RIFLEMAN ) then - return true - elseif ( t == RACE_OBJECT_TYPE_KNIGHT ) then - return true - elseif ( t == RACE_OBJECT_TYPE_PRIEST ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SORCERESS ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SPELLBREAKER ) then - return true - elseif ( t == RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SIEGE_ENGINE ) then - return true - elseif ( t == RACE_OBJECT_TYPE_MORTAR ) then - return true - elseif ( t == RACE_OBJECT_TYPE_GRYPHON ) then - return true - elseif ( t == RACE_OBJECT_TYPE_DRAGONHAWK ) then - return true - elseif ( t == RACE_OBJECT_TYPE_AVIARY_3 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_AVIARY_4 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TAUREN ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHADE ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TRANSPORT_SHIP ) then - return true - elseif ( t == RACE_OBJECT_TYPE_FRIGATE ) then - return true - elseif ( t == RACE_OBJECT_TYPE_BATTLESHIP ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_1 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_2 ) then - return true - endif - return false -endfunction -function IsRaceItem takes integer t returns boolean - if ( t == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TIER_1_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TIER_2_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TIER_3_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_FARM_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_ALTAR_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_MILL_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_BLACK_SMITH_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_BARRACKS_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHOP_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_GUARD_TOWER_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_CANNON_TOWER_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_WORKSHOP_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_HOUSING_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHIPYARD_ITEM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM ) then - return true - endif - return false -endfunction -function IsRaceBuilding takes integer t returns boolean - if ( t == RACE_OBJECT_TYPE_FARM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_ALTAR ) then - return true - elseif ( t == RACE_OBJECT_TYPE_MILL ) then - return true - elseif ( t == RACE_OBJECT_TYPE_BLACK_SMITH ) then - return true - elseif ( t == RACE_OBJECT_TYPE_BARRACKS ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHOP ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SCOUT_TOWER ) then - return true - elseif ( t == RACE_OBJECT_TYPE_GUARD_TOWER ) then - return true - elseif ( t == RACE_OBJECT_TYPE_CANNON_TOWER ) then - return true - elseif ( t == RACE_OBJECT_TYPE_ARCANE_TOWER ) then - return true - elseif ( t == RACE_OBJECT_TYPE_ARCANE_SANCTUM ) then - return true - elseif ( t == RACE_OBJECT_TYPE_WORKSHOP ) then - return true - elseif ( t == RACE_OBJECT_TYPE_GRYPHON_AVIARY ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SACRIFICAL_PIT ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TIER_1 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TIER_2 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_TIER_3 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_HOUSING ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHIPYARD ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SPECIAL_BUILDING ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 ) then - return true - endif - return false -endfunction -function IsWaterRaceUnit takes integer t returns boolean - if ( t == RACE_OBJECT_TYPE_TRANSPORT_SHIP ) then - return true - elseif ( t == RACE_OBJECT_TYPE_FRIGATE ) then - return true - elseif ( t == RACE_OBJECT_TYPE_BATTLESHIP ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_1 ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_2 ) then - return true - endif - return false -endfunction -function SetRaceObjectType takes integer whichRace,integer objectType,integer objectTypeId returns nothing - call SaveInteger(WoWReforgedRaces___objectTypeHashTable, objectTypeId, whichRace, objectType) - call SaveInteger(WoWReforgedRaces___objectTypeIdHashTable, objectType, whichRace, objectTypeId) -endfunction -function GetRaceObjectType takes integer whichRace,integer objectTypeId returns integer - return LoadInteger(WoWReforgedRaces___objectTypeHashTable, objectTypeId, whichRace) -endfunction -function GetRaceObjectTypeIncludingDependencyEquivalents takes integer whichRace,integer objectTypeId returns integer - return GetRaceObjectType(whichRace , GetPrimaryDependencyEquivalent(objectTypeId)) -endfunction -function GetRaceObjectTypeId takes integer whichRace,integer objectType returns integer - return LoadInteger(WoWReforgedRaces___objectTypeIdHashTable, objectType, whichRace) -endfunction -function GetObjectRace takes integer objectTypeId returns integer - local integer id= GetPrimaryDependencyEquivalent(objectTypeId) - local integer i= 0 - loop - exitwhen ( i == udg_MaxRaces ) - if ( GetRaceObjectType(i , id) != RACE_OBJECT_TYPE_NONE ) then - return i - endif - set i=i + 1 - endloop - return udg_RaceNone -endfunction -function IsWater takes integer unitTypeId returns boolean - if ( IsWaterRaceUnit(GetObjectRace(unitTypeId)) ) then - return true - endif - - if ( unitTypeId == GNOMISH_SUBMARINE ) then - return true - elseif ( unitTypeId == ENGINEER_SHIP ) then - return true - endif - - return false -endfunction -function IsWaterUnit takes unit whichUnit returns boolean - return ConvertMoveType(BlzGetUnitIntegerField(whichUnit, UNIT_IF_MOVE_TYPE)) == MOVE_TYPE_FLOAT -endfunction -function GetObjectRaceType takes integer objectTypeId returns integer - local integer i= 0 - local integer tmpType= 0 - local integer result= RACE_OBJECT_TYPE_NONE - loop - exitwhen ( i >= udg_MaxRaces or result != RACE_OBJECT_TYPE_NONE ) - set tmpType=(GetRaceObjectType((i ) , GetPrimaryDependencyEquivalent(( objectTypeId)))) // INLINED!! - if ( tmpType != RACE_OBJECT_TYPE_NONE ) then - set result=tmpType - endif - set i=i + 1 - endloop - return result -endfunction -function IsShip takes integer id returns boolean - return IsWaterRaceUnit(GetObjectRaceType(id)) -endfunction -function IsUnitShip takes unit whichUnit returns boolean - return (IsWaterRaceUnit(GetObjectRaceType((GetUnitTypeId(whichUnit))))) // INLINED!! -endfunction -function MapRaceObjectType takes integer objectTypeId,integer targetRace returns integer - local integer i= 0 - local integer tmpType= 0 - loop - exitwhen ( i == udg_MaxRaces ) - set tmpType=(GetRaceObjectType((i ) , GetPrimaryDependencyEquivalent(( objectTypeId)))) // INLINED!! - if ( tmpType != RACE_OBJECT_TYPE_NONE ) then - return GetRaceObjectTypeId(targetRace , tmpType) - endif - set i=i + 1 - endloop - return 0 -endfunction -function GetBuildingRace takes integer buildingID returns integer - return GetObjectRace(buildingID) -endfunction -function IsUnitAllRaces takes integer unitTypeId returns boolean - if ( unitTypeId == SAPPER ) then - return true - elseif ( unitTypeId == SHREDDER ) then - return true - elseif ( unitTypeId == DRILLBOT ) then - return true - elseif ( unitTypeId == HARVEST_CART ) then - return true - elseif ( unitTypeId == ZEPPELIN ) then - return true - elseif ( unitTypeId == GNOMISH_SUBMARINE ) then - return true - elseif ( unitTypeId == ENGINEER_SHIP ) then - return true - elseif ( unitTypeId == PACK_HORSE_PACKED ) then - return true - elseif ( unitTypeId == PACK_HORSE ) then - return true - endif - return false -endfunction -// exclude certain buildings since every race can build them -function IsBuildingAllRaces takes integer buildingID returns boolean - if ( buildingID == POWER_GENERATOR ) then - return true - elseif ( buildingID == PORTAL ) then - return true - elseif ( buildingID == RESEARCH_TENT ) then - return true - elseif ( buildingID == EVENT_HOUSE ) then - return true - elseif ( buildingID == CRAFTING_STASH ) then - return true - elseif ( buildingID == MARKETPLACE ) then - return true - elseif ( buildingID == TRADING_POST ) then - return true - elseif ( buildingID == ANTIMAGIC_WARD ) then - return true - elseif ( buildingID == ARMORY ) then - return true - elseif ( buildingID == BANNER_SHOP ) then - return true - elseif ( buildingID == THIEVES_GUILD ) then - return true - elseif ( buildingID == SPELL_BOOK ) then - return true - elseif ( buildingID == MOUNTS_CAGE ) then - return true - elseif ( buildingID == ALCHEMIST_LAB ) then - return true - elseif ( buildingID == WITCH_HUT ) then - return true - elseif ( buildingID == HERO_ABILITIES ) then - return true - elseif ( buildingID == SKINS ) then - return true - elseif ( buildingID == TEMPLE_OF_DARKNESS ) then - return true - elseif ( buildingID == TEMPLE_OF_LIGHT ) then // Temple of Light - return true - elseif ( buildingID == CLAN_HALL ) then // Clan Hall - return true - elseif ( buildingID == CLAN_TOWER ) then // Clan Tower - return true - elseif ( buildingID == ADVANCED_CLAN_TOWER ) then // Advanced Clan Tower - return true - elseif ( buildingID == WATER_TOWER ) then - return true - elseif ( buildingID == ADVANCED_WATER_TOWER ) then - return true - // Engineer - elseif ( buildingID == CHEST ) then - return true - elseif ( buildingID == 'h020' ) then // Gate horizontal closed - return true - elseif ( buildingID == 'h021' ) then // Gate horizontal open - return true - elseif ( buildingID == 'nft1' ) then // Flame Tower - return true - elseif ( buildingID == 'nft2' ) then // Advanced Flame Tower - return true - elseif ( buildingID == 'ndt1' ) then // Cold Tower - return true - elseif ( buildingID == 'ndt2' ) then // Advanced Cold Tower - return true - elseif ( buildingID == 'ntt1' ) then // Death Tower - return true - elseif ( buildingID == 'ntx2' ) then // Advanced Death Tower - return true - // Profession Warlock - elseif ( buildingID == FEL_FOUNTAIN_WARLOCK ) then - return true - // Archaeologist - elseif ( buildingID == EXCAVATION_SITE ) then - return true - // Ground Wall - // Main piece and cross - elseif ( buildingID == 'h04Q' ) then - return true - // - // Wall Ends - // North End - elseif ( buildingID == 'h094' ) then - return true - // West End - elseif ( buildingID == 'h04S' ) then - return true - // East End - elseif ( buildingID == 'h093' ) then - return true - // South End - elseif ( buildingID == 'h095' ) then - return true - // - // Wall T-Cross - // North End - elseif ( buildingID == 'h0DP' ) then - return true - // South End - elseif ( buildingID == 'h0DQ' ) then - return true - // West End - elseif ( buildingID == 'h0DR' ) then - return true - // East End - elseif ( buildingID == 'h0DS' ) then - return true - // Wall Straight - // Horizontal - elseif ( buildingID == 'h04R' ) then - return true - // Vertical - elseif ( buildingID == 'h096' ) then - return true - // Wall Corner - // South West - elseif ( buildingID == 'h0DT' ) then - return true - // South East - elseif ( buildingID == 'h0DU' ) then - return true - // North East - elseif ( buildingID == 'h0DV' ) then - return true - // North West - elseif ( buildingID == 'h0DW' ) then - return true - // Air Wall - // Main piece and cross - elseif ( buildingID == 'h0DM' ) then - return true - // - // Wall Ends - // North End - elseif ( buildingID == 'h0EO' ) then - return true - // West End - elseif ( buildingID == 'h04S' ) then - return true - // East End - elseif ( buildingID == 'h0EN' ) then - return true - // South End - elseif ( buildingID == 'h095' ) then - return true - // - // Wall T-Cross - // North End - elseif ( buildingID == 'h0EX' ) then - return true - // South End - elseif ( buildingID == 'h0EQ' ) then - return true - // West End - elseif ( buildingID == 'h0EW' ) then - return true - // East End - elseif ( buildingID == 'h0EM' ) then - return true - // Wall Straight - // Horizontal - elseif ( buildingID == 'h0ET' ) then - return true - // Vertical - elseif ( buildingID == 'h0EU' ) then - return true - // Wall Corner - // South West - elseif ( buildingID == 'h0ES' ) then - return true - // South East - elseif ( buildingID == 'h0EY' ) then - return true - // North East - elseif ( buildingID == 'h0EZ' ) then - return true - // North West - elseif ( buildingID == 'h0EP' ) then - return true - // Banners - elseif ( (GetBannerByUnitTypeId((buildingID)) != - 1) ) then // INLINED!! - return true - endif - return false -endfunction -function MapAllRacesBuildingIDToItemID takes integer buildingID returns integer - if ( ((buildingID) == WALL) ) then // INLINED!! - return ITEM_TINY_WALL - elseif ( (GetBannerByUnitTypeId((buildingID)) != - 1) ) then // INLINED!! - return MapBannerToItem(buildingID) - endif - return (LoadInteger(WoWReforgedObjectMappings___h, (buildingID), 0)) // INLINED!! -endfunction -function GetItemRace takes integer itemID returns integer - return GetObjectRace(itemID) -endfunction -function GetUnitIDRace takes integer unitID returns integer - return GetObjectRace(unitID) -endfunction -function MapBuildingID takes integer buildingID,integer targetRace returns integer - return MapRaceObjectType(buildingID , targetRace) -endfunction -// TODO does depend on the food produced, some farms might be converted into more farms. -function MapBuildingNumber takes integer buildingID,integer targetRace returns integer - return 1 -endfunction -function MapBuildingIDToItemID takes integer buildingID,integer targetRace returns integer - local integer raceType= GetObjectRaceType(buildingID) - if ( IsBuildingAllRaces(buildingID) ) then - return MapAllRacesBuildingIDToItemID(buildingID) - elseif ( raceType == RACE_OBJECT_TYPE_TIER_1 ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_TIER_1_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_TIER_2 ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_TIER_2_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_TIER_3 ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_TIER_3_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_FARM ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_FARM_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_ALTAR ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_ALTAR_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_MILL ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_MILL_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_BLACK_SMITH ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_SHOP ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SHOP_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_BARRACKS ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_BARRACKS_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_SCOUT_TOWER ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_GUARD_TOWER ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_CANNON_TOWER ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_ARCANE_TOWER ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_ARCANE_SANCTUM ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_WORKSHOP ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_WORKSHOP_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_GRYPHON_AVIARY ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_SACRIFICAL_PIT ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_HOUSING ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_HOUSING_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_SHIPYARD ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SHIPYARD_ITEM) - elseif ( raceType == RACE_OBJECT_TYPE_SPECIAL_BUILDING ) then - return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM) - endif - return 0 -endfunction -function MapUnitID takes integer unitID,integer targetRace,boolean includingWorkers returns integer - local integer raceType= - 1 - if ( not includingWorkers ) then - set raceType=GetObjectRaceType(unitID) - if ( raceType == RACE_OBJECT_TYPE_WORKER or raceType == RACE_OBJECT_TYPE_MALE_CITIZEN ) then - return 0 - endif - endif - return MapRaceObjectType(unitID , targetRace) -endfunction -// TODO does depend on the food produced, some farms might be converted into more farms. -function MapUnitNumber takes integer unitID,integer targetRace returns integer - return 1 -endfunction -function MapItemID takes integer unitID,integer targetRace returns integer - return MapRaceObjectType(unitID , targetRace) -endfunction -function GetRaceName takes integer whichRace returns string - return GetObjectName(udg_RaceTavernItemType[whichRace]) -endfunction -function AddRaceObjectTypeWoWReforged takes nothing returns nothing - call SetRaceObjectType(udg_TmpInteger , udg_TmpInteger2 , udg_TmpUnitType) -endfunction -function AddRaceItemTypeWoWReforged takes nothing returns nothing - call SetRaceObjectType(udg_TmpInteger , udg_TmpInteger2 , udg_TmpItemTypeId) -endfunction -function IsCitizen takes integer objectTypeId returns boolean - local integer t= GetObjectRaceType(objectTypeId) - return t == RACE_OBJECT_TYPE_MALE_CITIZEN or t == RACE_OBJECT_TYPE_FEMALE_CITIZEN or t == RACE_OBJECT_TYPE_CHILD -endfunction -function AddCreep takes integer objectTypeId returns integer - local integer index= WoWReforgedRaces___objectTypeCreepsCounter - set WoWReforgedRaces___objectTypeCreeps[index]=objectTypeId - set WoWReforgedRaces___objectTypeCreepsCounter=WoWReforgedRaces___objectTypeCreepsCounter + 1 - return index -endfunction -function AddCreepWoWReforged takes nothing returns integer - return AddCreep(udg_TmpUnitType) -endfunction -function GetCreepsMax takes nothing returns integer - return WoWReforgedRaces___objectTypeCreepsCounter -endfunction -function GetCreep takes integer index returns integer - return WoWReforgedRaces___objectTypeCreeps[index] -endfunction - -function AddNeutralUnit takes integer objectTypeId returns integer - local integer index= WoWReforgedRaces___objectTypeNeutralUnitsCounter - set WoWReforgedRaces___objectTypeNeutralUnits[index]=objectTypeId - set WoWReforgedRaces___objectTypeNeutralUnitsCounter=WoWReforgedRaces___objectTypeNeutralUnitsCounter + 1 - return index -endfunction -function AddNeutralUnitWoWReforged takes nothing returns integer - return AddNeutralUnit(udg_TmpUnitType) -endfunction -function GetNeutralUnitsMax takes nothing returns integer - return WoWReforgedRaces___objectTypeNeutralUnitsCounter -endfunction -function GetNeutralUnit takes integer index returns integer - return WoWReforgedRaces___objectTypeNeutralUnits[index] -endfunction -function AddNeutralBuilding takes integer objectTypeId returns integer - local integer index= WoWReforgedRaces___objectTypeNeutralBuildingsCounter - set WoWReforgedRaces___objectTypeNeutralBuildings[index]=objectTypeId - set WoWReforgedRaces___objectTypeNeutralBuildingsCounter=WoWReforgedRaces___objectTypeNeutralBuildingsCounter + 1 - return index -endfunction -function AddNeutralBuildingWoWReforged takes nothing returns integer - return AddNeutralBuilding(udg_TmpUnitType) -endfunction -function GetNeutralBuildingsMax takes nothing returns integer - return WoWReforgedRaces___objectTypeNeutralBuildingsCounter -endfunction -function GetNeutralBuilding takes integer index returns integer - return WoWReforgedRaces___objectTypeNeutralBuildings[index] -endfunction -function IsNeutralBuilding takes integer unitTypeId returns boolean - local integer i= 0 - local integer max= (WoWReforgedRaces___objectTypeNeutralBuildingsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( unitTypeId == (WoWReforgedRaces___objectTypeNeutralBuildings[(i)]) ) then // INLINED!! - return true - endif - set i=i + 1 - endloop - return false -endfunction -function IsUnitNeutralBuilding takes unit whichUnit returns boolean - return IsNeutralBuilding(GetUnitTypeId(whichUnit)) -endfunction -function AddNeutralBuildingMercenaryCamps takes nothing returns nothing - call AddNeutralBuilding(MERCENARY_CAMP_ASHENVALE) - call AddNeutralBuilding(MERCENARY_CAMP_BARRENS) - call AddNeutralBuilding(MERCENARY_CAMP_BLACK_CITADEL) - call AddNeutralBuilding(MERCENARY_CAMP_CITYSCAPE) - call AddNeutralBuilding(MERCENARY_CAMP_DALARAN) - call AddNeutralBuilding(MERCENARY_CAMP_DUNGEON) - call AddNeutralBuilding(MERCENARY_CAMP_FELWOOD) - call AddNeutralBuilding(MERCENARY_CAMP_ICECROWN_GLACIER) - call AddNeutralBuilding(MERCENARY_CAMP_LORDAERON_FALL) - call AddNeutralBuilding(MERCENARY_CAMP_LORDAERON_SUMMER) - call AddNeutralBuilding(MERCENARY_CAMP_LORDAERON_WINTER) - call AddNeutralBuilding(MERCENARY_CAMP_NORHTREND) - call AddNeutralBuilding(MERCENARY_CAMP_SUNKEN_RUINS) - call AddNeutralBuilding(MERCENARY_CAMP_UNDERGROUND) - call AddNeutralBuilding(MERCENARY_CAMP_VILLAGE) - call AddNeutralBuilding(MERCENARY_CAMP_EMERALD_DREAM) - call AddNeutralBuilding(MERCENARY_CAMP_PANDARIA) - call AddNeutralBuilding(MERCENARY_CAMP_SEA) - call AddNeutralBuilding(MERCENARY_CAMP_SUNSTRIDER_ISLE) - call AddNeutralBuilding(MERCENARY_CAMP_NEW_CITADEL) - call AddNeutralBuilding(MERCENARY_CAMP_SKYWALL) - call AddNeutralBuilding(MERCENARY_CAMP_FIRELANDS) - call AddNeutralBuilding(MERCENARY_CAMP_ABYSSAL_MAW) - call AddNeutralBuilding(MERCENARY_CAMP_DEEPHOLM) - call AddNeutralBuilding(MERCENARY_CAMP_SHADOWLANDS) - call AddNeutralBuilding(MERCENARY_CAMP_NYALOTHA) -endfunction -function AddAbility takes integer objectTypeId,integer levels,integer whichRace returns integer - local integer index= WoWReforgedRaces___objectTypeAbilitiesCounter - set WoWReforgedRaces___objectTypeAbilities[index]=objectTypeId - set WoWReforgedRaces___objectTypeAbilitiesLevels[index]=levels - set WoWReforgedRaces___objectTypeAbilitiesRace[index]=whichRace - set WoWReforgedRaces___objectTypeAbilitiesCounter=WoWReforgedRaces___objectTypeAbilitiesCounter + 1 - return index -endfunction -function AddAbilityWoWReforged takes nothing returns integer - return AddAbility(udg_TmpAbilityCode , udg_TmpInteger , udg_TmpInteger2) -endfunction -function GetAbilitiesMax takes nothing returns integer - return WoWReforgedRaces___objectTypeAbilitiesCounter -endfunction -function GetAbility takes integer index returns integer - return WoWReforgedRaces___objectTypeAbilities[index] -endfunction -function GetAbilityLevels takes integer index returns integer - return WoWReforgedRaces___objectTypeAbilitiesLevels[index] -endfunction -function GetAbilityRace takes integer index returns integer - return WoWReforgedRaces___objectTypeAbilitiesRace[index] -endfunction -function IsRaceBonus takes integer r returns boolean - return udg_RaceIsBonus[r] -endfunction -function GetRaceHasFootmanWorker takes integer r returns boolean - return udg_RaceHasFootmanWorker[r] -endfunction -function GetRaceHasBlight takes integer r returns boolean - return udg_RaceHasBlight[r] -endfunction -function GetRaceAIScript takes integer r returns string - return udg_RaceAIScript[r] -endfunction -function GetRaceItemTypeId takes integer r returns integer - return udg_RaceItemType[r] -endfunction -function AddRace takes nothing returns integer - local integer index= udg_MaxRaces - set udg_MaxRaces=udg_MaxRaces + 1 - return index -endfunction -function AddWoWReforgedRace takes nothing returns integer - local integer r= AddRace() - set udg_RaceName[r]=GetObjectName(udg_TmpItemTypeId) - set udg_RaceTavernItemType[r]=udg_TmpItemTypeId - set udg_RaceItemType[r]=udg_TmpItemTypeId2 - set udg_RaceItemTypeTinyCastle[r]=udg_TmpItemTypeId3 - set udg_RaceIsBonus[r]=udg_TmpBoolean - set udg_RaceAIScript[r]=udg_TmpString - set udg_RaceHasFootmanWorker[r]=udg_TmpBoolean2 - set udg_RaceHasBlight[r]=udg_TmpBoolean3 - set udg_TmpInteger=r - - call SetRaceObjectType(r , RACE_OBJECT_TYPE_SCEPTER_ITEM , udg_TmpItemTypeId2) - call SetRaceObjectType(r , RACE_OBJECT_TYPE_TIER_1_ITEM , udg_TmpItemTypeId3) - - set WoWReforgedIcons__raceIcons[(r )]=( GetIconByItemType(udg_TmpItemTypeId)) // INLINED!! - - set udg_TmpBoolean=false - set udg_TmpBoolean2=false - set udg_TmpBoolean3=false - set udg_TmpString="" - - return r -endfunction -function AddUnitTypeCampaign takes nothing returns nothing - call SaveBoolean(ObjectDataFields___h, (udg_TmpUnitType ), ( OBJECT_DATA_FIELD_UCAM ), ( true)) // INLINED!! -endfunction -function GetRacesMax takes nothing returns integer - return udg_MaxRaces -endfunction -function GetRaceByTavernItemTypeId takes integer tavernItemTypeId returns integer - local integer max= (udg_MaxRaces) // INLINED!! - local integer i= 0 - loop - exitwhen ( i == max ) - if ( tavernItemTypeId == udg_RaceTavernItemType[i] ) then - return i - endif - set i=i + 1 - endloop - return udg_RaceNone -endfunction -function PlayerCanPickRaceEx takes player whichPlayer,integer tavernItemTypeId returns boolean - local integer index= GetRaceByTavernItemTypeId(tavernItemTypeId) - if ( index > 0 ) then - return not (udg_RaceIsBonus[(index)]) or udg_UnlockedAll or (IsPlayerInForce((whichPlayer), WoWReforgedVIPs___vipPlayers)) or GetHeroLevel1(whichPlayer) >= 30 // INLINED!! - endif - return false -endfunction -function IsGoldmine takes integer unitTypeId returns boolean - if ( unitTypeId == GOLD_MINE ) then - return true - endif - return GetObjectRaceType(unitTypeId) == RACE_OBJECT_TYPE_MINE -endfunction -function IsUnitGoldmine takes unit whichUnit returns boolean - return IsGoldmine(GetUnitTypeId(whichUnit)) -endfunction -function IsHousing takes integer unitTypeId returns boolean - return GetObjectRaceType(unitTypeId) == RACE_OBJECT_TYPE_HOUSING -endfunction -function IsUnitHousing takes unit whichUnit returns boolean - return (GetObjectRaceType((GetUnitTypeId(whichUnit))) == RACE_OBJECT_TYPE_HOUSING) // INLINED!! -endfunction -function SetRaceTier1 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_1 , id) -endfunction -function SetRaceTier1Item takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_1_ITEM , id) -endfunction -function SetRaceTier2 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_2 , id) -endfunction -function SetRaceTier2Item takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_2_ITEM , id) -endfunction -function SetRaceTier3 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_3 , id) -endfunction -function SetRaceTier3Item takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_3_ITEM , id) -endfunction -function SetRaceFarm takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FARM , id) -endfunction -function SetRaceFarmItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FARM_ITEM , id) -endfunction -function SetRaceBarracks takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BARRACKS , id) -endfunction -function SetRaceBarracksItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BARRACKS_ITEM , id) -endfunction -function SetRaceBlacksmith takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BLACK_SMITH , id) -endfunction -function SetRaceBlacksmithItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , id) -endfunction -function SetRaceMill takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MILL , id) -endfunction -function SetRaceMillItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MILL_ITEM , id) -endfunction -function SetRaceAltar takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ALTAR , id) -endfunction -function SetRaceAltarItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ALTAR_ITEM , id) -endfunction -function SetRaceArcaneSanctum takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM , id) -endfunction -function SetRaceArcaneSanctumItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , id) -endfunction -function SetRaceShop takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHOP , id) -endfunction -function SetRaceShopItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHOP_ITEM , id) -endfunction -function SetRaceScoutTower takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SCOUT_TOWER , id) -endfunction -function SetRaceScoutTowerItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , id) -endfunction -function SetRaceGuardTower takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GUARD_TOWER , id) -endfunction -function SetRaceGuardTowerItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , id) -endfunction -function SetRaceCannonTower takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_CANNON_TOWER , id) -endfunction -function SetRaceCannonTowerItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , id) -endfunction -function SetRaceArcaneTower takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_TOWER , id) -endfunction -function SetRaceArcaneTowerItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , id) -endfunction -function SetRaceWorkshop takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKSHOP , id) -endfunction -function SetRaceWorkshopItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKSHOP_ITEM , id) -endfunction -function SetRaceAviary takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GRYPHON_AVIARY , id) -endfunction -function SetRaceAviaryItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , id) -endfunction -function SetRaceSacrificialPit takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT , id) -endfunction -function SetRaceSacrificalPitItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM , id) -endfunction -function GetRaceHousing takes integer whichRace returns integer - return GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_HOUSING) -endfunction -function SetRaceHousing takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_HOUSING , id) -endfunction -function SetRaceHousingItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_HOUSING_ITEM , id) -endfunction -function GetRaceMine takes integer whichRace returns integer - return GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MINE) -endfunction -function SetRaceMine takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MINE , id) -endfunction -function GetRaceShipyard takes integer r returns integer - return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_SHIPYARD) -endfunction -function SetRaceShipyard takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIPYARD , id) -endfunction -function SetRaceShipyardItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIPYARD_ITEM , id) -endfunction -function SetRaceSpecialBuilding takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING , id) -endfunction -function SetRaceSpecialBuildingItem takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , id) -endfunction -function SetRaceSpecialBuilding2 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , id) -endfunction -function SetRaceSpecialBuilding2Item takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2_ITEM , id) -endfunction -function GetRaceWorker takes integer whichRace returns integer - return GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_WORKER) -endfunction -function SetRaceWorker takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKER , id) -endfunction -function SetRaceTownHall3 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TOWN_HALL_3 , id) -endfunction -function SetRaceTownHall4 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TOWN_HALL_4 , id) -endfunction -function SetRaceFootman takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FOOTMAN , id) -endfunction -function SetRaceRifleman takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_RIFLEMAN , id) -endfunction -function SetRaceKnight takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_KNIGHT , id) -endfunction -function SetRaceBarracks4 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BARRACKS_4 , id) -endfunction -function SetRacePriest takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_PRIEST , id) -endfunction -function SetRaceSorceress takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SORCERESS , id) -endfunction -function SetRaceSpellBreaker takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPELLBREAKER , id) -endfunction -function SetRaceArcaneSanctum4 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 , id) -endfunction -function SetRaceFlyingMachine takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FLYING_MACHINE , id) -endfunction -function SetRaceSiegeEngine takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SIEGE_ENGINE , id) -endfunction -function SetRaceMortar takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MORTAR , id) -endfunction -function SetRaceWorkshop4 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKSHOP_4 , id) -endfunction -function SetRaceTauren takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TAUREN , id) -endfunction -function SetRaceGryphon takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GRYPHON , id) -endfunction -function SetRaceDragonHawk takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_DRAGONHAWK , id) -endfunction -function SetRaceAviary3 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_AVIARY_3 , id) -endfunction -function SetRaceAviary4 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_AVIARY_4 , id) -endfunction -function SetRaceShade takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHADE , id) -endfunction -function SetRaceCitizenMale takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MALE_CITIZEN , id) -endfunction -function SetRaceCitizenFemale takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FEMALE_CITIZEN , id) -endfunction -function SetRaceChild takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_CHILD , id) -endfunction -function SetRacePet takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_PET , id) -endfunction -function SetRaceTransportShip takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TRANSPORT_SHIP , id) -endfunction -function GetRaceTransportShip takes integer r returns integer - return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_TRANSPORT_SHIP) -endfunction -function SetRaceFrigate takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FRIGATE , id) -endfunction -function GetRaceFrigate takes integer r returns integer - return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_FRIGATE) -endfunction -function SetRaceBattleship takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BATTLESHIP , id) -endfunction -function GetRaceBattleship takes integer r returns integer - return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_BATTLESHIP) -endfunction -function SetRaceShipSpecial1 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , id) -endfunction -function GetRaceShipSpecial1 takes integer r returns integer - return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_SHIP_SPECIAL_1) -endfunction -function SetRaceShipSpecial2 takes integer whichRace,integer id returns nothing - call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , id) -endfunction -function GetRaceShipSpecial2 takes integer r returns integer - return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_SHIP_SPECIAL_2) -endfunction -//library WoWReforgedRaces ends -//library WoWReforgedStandardHeroAbilities: - - function s__WoWReforgedStandardHeroAbilities___A_create takes integer itemTypeId,integer abilityId,integer maxLevel,boolean requiresVIP,boolean requiresReskillable,boolean requiresAncientStructure,boolean notAvailable returns integer - local integer this= s__WoWReforgedStandardHeroAbilities___A__allocate() - set s__WoWReforgedStandardHeroAbilities___A_itemTypeId[this]=itemTypeId - set s__WoWReforgedStandardHeroAbilities___A_abilityId[this]=abilityId - set s__WoWReforgedStandardHeroAbilities___A_maxLevel[this]=maxLevel - set s__WoWReforgedStandardHeroAbilities___A_requiresVIP[this]=requiresVIP - set s__WoWReforgedStandardHeroAbilities___A_requiresReskillable[this]=requiresReskillable - set s__WoWReforgedStandardHeroAbilities___A_requiresAncientStructure[this]=requiresAncientStructure - set s__WoWReforgedStandardHeroAbilities___A_notAvailable[this]=notAvailable - return this - endfunction - -function GetStandardHeroAbilitiesMax takes nothing returns integer - return WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter -endfunction -function GetStandardHeroAbilityItemTypeId takes integer index returns integer - return s__WoWReforgedStandardHeroAbilities___A_itemTypeId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[index]] -endfunction -function GetStandardHeroAbilityAbilityId takes integer index returns integer - return s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[index]] -endfunction -function GetStandardHeroAbilityMaxLevel takes integer index returns integer - return s__WoWReforgedStandardHeroAbilities___A_maxLevel[WoWReforgedStandardHeroAbilities___standardHeroAbilities[index]] -endfunction -function GetStandardHeroAbilityRequiresVIP takes integer index returns boolean - return s__WoWReforgedStandardHeroAbilities___A_requiresVIP[WoWReforgedStandardHeroAbilities___standardHeroAbilities[index]] -endfunction -function GetStandardHeroAbilityRequiresReskillable takes integer index returns boolean - return s__WoWReforgedStandardHeroAbilities___A_requiresReskillable[WoWReforgedStandardHeroAbilities___standardHeroAbilities[index]] -endfunction -function GetStandardHeroAbilityRequiresAncientStructure takes integer index returns boolean - return s__WoWReforgedStandardHeroAbilities___A_requiresAncientStructure[WoWReforgedStandardHeroAbilities___standardHeroAbilities[index]] -endfunction -function GetStandardHeroAbilityNotAvailable takes integer index returns boolean - return s__WoWReforgedStandardHeroAbilities___A_notAvailable[WoWReforgedStandardHeroAbilities___standardHeroAbilities[index]] -endfunction -function AddStandardHeroAbility takes integer itemTypeId,integer abilityId,integer maxLevel,boolean requiresVIP,boolean requiresReskillable,boolean requiresAncientStructure,boolean notAvailable returns integer - local integer a= s__WoWReforgedStandardHeroAbilities___A_create(itemTypeId , abilityId , maxLevel , requiresVIP , requiresReskillable , requiresAncientStructure , notAvailable) - set WoWReforgedStandardHeroAbilities___standardHeroAbilities[WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter]=a - set WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter=WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter + 1 - return a -endfunction -function AddStandardHeroAbilityWoWReforged takes nothing returns nothing - call AddStandardHeroAbility(udg_TmpItemTypeId , udg_TmpAbilityCode , udg_TmpInteger , udg_TmpBoolean , udg_TmpBoolean2 , udg_TmpBoolean3 , udg_TmpBoolean4) - set udg_TmpBoolean=false - set udg_TmpBoolean2=false - set udg_TmpBoolean3=false - set udg_TmpBoolean4=false - set udg_TmpInteger=1 -endfunction -function GetStandardHeroAbilityByItemTypeId takes integer itemTypeId returns integer - local integer i= 0 - loop - exitwhen ( i == WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter ) - if ( (s__WoWReforgedStandardHeroAbilities___A_itemTypeId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]]) == itemTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetStandardHeroAbility takes unit hero returns integer - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter ) - if ( GetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]])) > 0 ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetAvailableStandardHeroAbility takes unit hero returns integer - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter ) - if ( GetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]])) > 0 and (s__WoWReforgedStandardHeroAbilities___A_notAvailable[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]]) ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function SetStandardHeroAbilityEnabled takes unit hero,boolean enabled returns nothing - local integer index= GetAvailableStandardHeroAbility(hero) - if ( index != - 1 ) then - //call BJDebugMsg("Enable/disable standard hero ability " + GetObjectName( GetStandardHeroAbilityAbilityId(index))) - call BlzUnitDisableAbility(hero, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]), not enabled, not enabled) // INLINED!! - endif -endfunction -function EnableStandardHeroAbility takes unit hero returns nothing - call SetStandardHeroAbilityEnabled(hero , true) -endfunction -function DisableStandardHeroAbility takes unit hero returns nothing - call SetStandardHeroAbilityEnabled(hero , false) -endfunction -function RemoveStandardHeroAbilitiesForHero takes unit hero returns nothing - local integer i= 0 - loop - exitwhen ( i == WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter ) - call UnitRemoveAbility(hero, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]])) // INLINED!! - set i=i + 1 - endloop -endfunction -function WoWReforgedStandardHeroAbilities___AddStandardHeroAbilitiesToShop takes unit shop returns nothing - local integer max= (WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter) // INLINED!! - local integer i= 0 - //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - call EnablePagedButtons(shop) - loop - exitwhen ( i >= max ) -call AddPagedButtonsId((shop ) , ( (s__WoWReforgedStandardHeroAbilities___A_itemTypeId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop - //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - - //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") -endfunction -function IsUnitTypeNavyHero takes integer unitTypeId returns boolean - if ( unitTypeId == GNOMISH_SUBMARINE_HERO ) then - return true - elseif ( unitTypeId == GNOMISH_SUBMARINE_HERO_PILOT ) then - return true - elseif ( unitTypeId == GOBLIN_SUBMARINE_HERO ) then - return true - elseif ( unitTypeId == GOBLIN_SUBMARINE_HERO_SUBMERGED ) then - return true - elseif ( unitTypeId == DWARF_SUBMARINE_HERO ) then - return true - elseif ( unitTypeId == DWARF_SUBMARINE_HERO_SUBMERGED ) then - return true - elseif ( unitTypeId == HUMAN_BATTLESHIP_HERO ) then - return true - elseif ( unitTypeId == CAPTAIN_HERO ) then - return true - endif - return false -endfunction -function IsAncientStructureHero takes integer unitTypeId returns boolean - if ( unitTypeId == ANCIENT_OF_LORE_HERO ) then - return true - endif - return false -endfunction -function WoWReforgedStandardHeroAbilities___TriggerConditionSellItem takes nothing returns boolean - local unit hero= GetBuyingUnit() - local player owner= GetOwningPlayer(hero) - local integer unitTypeId= GetUnitTypeId(hero) - local item soldItem= GetSoldItem() - local integer index= GetStandardHeroAbilityByItemTypeId(GetItemTypeId(soldItem)) - if ( index != - 1 ) then - if ( IsUnitType(hero, UNIT_TYPE_HERO) and unitTypeId != EQUIPMENT_BAG and unitTypeId != BACK_PACK and unitTypeId != HERO_SELECTOR and not IsUnitTypeNavyHero(unitTypeId) ) then - if ( not (s__WoWReforgedStandardHeroAbilities___A_notAvailable[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]) ) then // INLINED!! - if ( GetHighestHeroLevel(owner) >= udg_HeroJourneyLevelHeroAbilities or udg_UnlockedAll or (IsPlayerInForce((owner), WoWReforgedVIPs___vipPlayers)) ) then // INLINED!! - if ( not (s__WoWReforgedStandardHeroAbilities___A_requiresVIP[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]) or udg_UnlockedAll or (IsPlayerInForce((owner), WoWReforgedVIPs___vipPlayers)) ) then // INLINED!! - if ( not (s__WoWReforgedStandardHeroAbilities___A_requiresReskillable[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]) or IsReskillableHero(unitTypeId) ) then // INLINED!! - if ( not (s__WoWReforgedStandardHeroAbilities___A_requiresAncientStructure[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]) or IsAncientStructureHero(unitTypeId) ) then // INLINED!! - call RemoveStandardHeroAbilitiesForHero(hero) - call UnitAddAbility(hero, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]])) // INLINED!! - call UnitMakeAbilityPermanent(hero, true, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]])) // INLINED!! - call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Adding ability " + GetAbilityName((s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]])) + ".") // INLINED!! - else - call SimError(owner , "Only available for Ancient structure heroes.") - endif - else - call SimError(owner , "Only available for reskillable heroes.") - endif - else - call SimError(owner , "Only available for VIP players.") - endif - else - call SimError(owner , "Requires hero level " + I2S(udg_HeroJourneyLevelHeroAbilities) + " or VIP or everything unlocked.") - endif - else - call SimError(owner , "Not available.") - endif - else - call SimError(owner , "Only heroes can change their standard ability.") - endif - call h__RemoveItem(soldItem) - endif - set hero=null - set soldItem=null - set owner=null - return false -endfunction -function WoWReforgedStandardHeroAbilities___IsUnitTypeStandardHeroAbilitiesShop takes integer unitTypeId returns boolean - return unitTypeId == HERO_ABILITIES or unitTypeId == HERO_ABILITIES_NEUTRAL -endfunction -function WoWReforgedStandardHeroAbilities___IsUnitStandardHeroAbilitiesShop takes unit whichUnit returns boolean - return WoWReforgedStandardHeroAbilities___IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId(whichUnit)) -endfunction -function WoWReforgedStandardHeroAbilities___TriggerConditionConstructed takes nothing returns boolean - if ( (WoWReforgedStandardHeroAbilities___IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetTriggerUnit())))) ) then // INLINED!! - call WoWReforgedStandardHeroAbilities___AddStandardHeroAbilitiesToShop(GetConstructedStructure()) - endif - return false -endfunction -function WoWReforgedStandardHeroAbilities___TriggerConditionSummoned takes nothing returns boolean - if ( (WoWReforgedStandardHeroAbilities___IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetSummonedUnit())))) ) then // INLINED!! - call WoWReforgedStandardHeroAbilities___AddStandardHeroAbilitiesToShop(GetSummonedUnit()) - endif - return false -endfunction -function WoWReforgedStandardHeroAbilities___TriggerConditionDeath takes nothing returns boolean - if ( (WoWReforgedStandardHeroAbilities___IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetTriggerUnit())))) ) then // INLINED!! - // TODO Disable shop manually? - //call ClearSkillsShop(GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedStandardHeroAbilities___ForGroupEnableShop takes nothing returns nothing - call WoWReforgedStandardHeroAbilities___AddStandardHeroAbilitiesToShop(GetEnumUnit()) -endfunction -function WoWReforgedStandardHeroAbilities___FilterBuilding takes nothing returns boolean - return (WoWReforgedStandardHeroAbilities___IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetFilterUnit())))) // INLINED!! -endfunction -function WoWReforgedStandardHeroAbilities___UpdateAllShops takes nothing returns nothing - local group g= CreateGroup() - - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedStandardHeroAbilities___FilterBuilding)) - call ForGroup(g, function WoWReforgedStandardHeroAbilities___ForGroupEnableShop) - - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function WoWReforgedStandardHeroAbilities___TriggerConditionLevel takes nothing returns nothing - local unit hero= GetTriggerUnit() - local integer index= GetStandardHeroAbility(hero) - if ( GetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]])) < (s__WoWReforgedStandardHeroAbilities___A_maxLevel[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]) ) then // INLINED!! - call SetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]), IMinBJ(GetHeroLevel(hero), (s__WoWReforgedStandardHeroAbilities___A_maxLevel[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(index)]]))) // INLINED!! - endif - set hero=null -endfunction -function WoWReforgedStandardHeroAbilities___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedStandardHeroAbilities___sellTrigger, Condition(function WoWReforgedStandardHeroAbilities___TriggerConditionSellItem)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedStandardHeroAbilities___constructionTrigger, Condition(function WoWReforgedStandardHeroAbilities___TriggerConditionConstructed)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedStandardHeroAbilities___summonTrigger, Condition(function WoWReforgedStandardHeroAbilities___TriggerConditionSummoned)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedStandardHeroAbilities___deathTrigger, Condition(function WoWReforgedStandardHeroAbilities___TriggerConditionDeath)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities___levelTrigger, EVENT_PLAYER_HERO_LEVEL) - call TriggerAddCondition(WoWReforgedStandardHeroAbilities___levelTrigger, Condition(function WoWReforgedStandardHeroAbilities___TriggerConditionLevel)) - - call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedStandardHeroAbilities___UpdateAllShops) -endfunction -//library WoWReforgedStandardHeroAbilities ends -//library WoWReforgedStats: -function SetStatsMultiboardVisible takes player whichPlayer,boolean show returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call MultiboardDisplay(udg_StatsMultiboard, show) - endif -endfunction -function ShowStatsMultiboard takes player whichPlayer returns nothing - call SetStatsMultiboardVisible(whichPlayer , true) -endfunction -function HideStatsMultiboard takes player whichPlayer returns nothing - call SetStatsMultiboardVisible(whichPlayer , false) -endfunction -function WoWReforgedStats__ForFunctionUpdateStats takes nothing returns nothing - local multiboarditem mbitem= null - local player whichPlayer= GetEnumPlayer() - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - local boolean isUser= GetPlayerController(whichPlayer) == MAP_CONTROL_USER - local boolean isWarlord= udg_PlayerIsWarlord[convertedPlayerId] - local boolean isBosses= whichPlayer == udg_BossesPlayer - local integer goldUpkeepRate= GetPlayerState(whichPlayer, PLAYER_STATE_GOLD_UPKEEP_RATE) - local integer itemTypeId= 0 - local integer column= 0 - // Player name plus color and number - local string text= GetPlayerNameColored(whichPlayer) - local integer value= 0 - if ( isUser and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_LEFT ) then - set text=text + " (left)" - elseif ( GetPlayerState(whichPlayer, PLAYER_STATE_GAME_RESULT) == 1 ) then - set text=text + " (defeated)" - endif - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemValue(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Team - set column=column + 1 - set text=I2S(GetPlayerTeam(whichPlayer) + 1) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemValue(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Clan - set column=column + 1 - if ( isUser ) then - set itemTypeId=udg_ClanIcon[udg_ClanPlayerClan[convertedPlayerId]] - set text=GetIconByItemType(itemTypeId) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - endif - // Game Mode/Race 1 - set column=column + 1 - if ( whichPlayer != udg_BossesPlayer ) then - if ( isWarlord ) then - set value=udg_PlayerRace[convertedPlayerId] - set text=GetIconByRace(value) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - else - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNMercenaryCamp.blp") - call MultiboardReleaseItem(mbitem) - endif - endif - // Race 2 - set column=column + 1 - if ( isUser ) then - if ( isWarlord ) then - set value=udg_PlayerRace2[convertedPlayerId] - set text=GetIconByRace(value) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - else - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNMercenaryCamp.blp") - call MultiboardReleaseItem(mbitem) - endif - endif - // Race 3 - set column=column + 1 - if ( isUser ) then - if ( isWarlord ) then - set value=udg_PlayerRace3[convertedPlayerId] - set text=GetIconByRace(value) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - else - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNMercenaryCamp.blp") - call MultiboardReleaseItem(mbitem) - endif - endif - // Profession 1 - set column=column + 1 - if ( not isBosses ) then - set value=udg_PlayerProfession[convertedPlayerId] - set text=GetIconByProfession(value) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - endif - // Profession 2 - set column=column + 1 - if ( not isBosses ) then - set value=udg_PlayerProfession2[convertedPlayerId] - set text=GetIconByProfession(value) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - endif - // Profession 3 - set column=column + 1 - if ( not isBosses ) then - set value=udg_PlayerProfession3[convertedPlayerId] - set text=GetIconByProfession(value) - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - endif - // Hero Icon/Level 1 - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemStyle(mbitem, true, true) - set text=I2S(GetHeroLevel(udg_Held[convertedPlayerId])) - call MultiboardSetItemValue(mbitem, text) - set value=GetUnitTypeId(udg_Held[convertedPlayerId]) - set text=GetIconByUnitType(value) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Hero Icon/Level 2 - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemStyle(mbitem, true, true) - set text=I2S(GetHeroLevel(udg_Held2[convertedPlayerId])) - call MultiboardSetItemValue(mbitem, text) - set value=GetUnitTypeId(udg_Held2[convertedPlayerId]) - set text=GetIconByUnitType(value) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Hero Icon/Level 3 - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - call MultiboardSetItemStyle(mbitem, true, true) - set text=I2S(GetHeroLevel(udg_Held3[convertedPlayerId])) - call MultiboardSetItemValue(mbitem, text) - set value=GetUnitTypeId(udg_Held3[convertedPlayerId]) - set text=GetIconByUnitType(value) - call MultiboardSetItemIcon(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Hero Kills - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - set text=I2S(udg_HeroKills[convertedPlayerId]) - call MultiboardSetItemValue(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Unit Kills - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - set text=I2S(udg_UnitKills[convertedPlayerId]) - call MultiboardSetItemValue(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Gold - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - set text=I2S(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_GOLD)) - call MultiboardSetItemValue(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Lumber - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - set text=I2S(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER)) - call MultiboardSetItemValue(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Food - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - set text=I2S(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_FOOD_USED)) + "/" + I2S(IMinBJ(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_FOOD_CAP), GetPlayerState(whichPlayer, PLAYER_STATE_FOOD_CAP_CEILING))) - call MultiboardSetItemValue(mbitem, text) - if ( goldUpkeepRate == 0 ) then - call MultiboardSetItemValueColor(mbitem, PercentTo255(0.0), PercentTo255(100.00), PercentTo255(0.0), 255) - else - if ( goldUpkeepRate >= 60 ) then - call MultiboardSetItemValueColor(mbitem, PercentTo255(100.0), PercentTo255(0.00), PercentTo255(0.0), 255) - else - call MultiboardSetItemValueColor(mbitem, PercentTo255(100.0), PercentTo255(80.00), PercentTo255(20.0), 255) - endif - endif - call MultiboardReleaseItem(mbitem) - // Evolution - set column=column + 1 - set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats__currentRow, column) - set text=I2S((GetPlayerTechCountSimple(UPG_EVOLUTION, (whichPlayer)))) // INLINED!! - call MultiboardSetItemValue(mbitem, text) - call MultiboardReleaseItem(mbitem) - // Increase counter - set WoWReforgedStats__currentRow=WoWReforgedStats__currentRow + 1 - set whichPlayer=null -endfunction -function UpdateStats takes nothing returns nothing - local string header= "Stats (" + I2S(udg_PlayingUsers) + "/" + I2S(udg_TotalUsers) + ") " + FormatTimeString(udg_GameTime) - if ( IsInSinglePlayer() ) then - set header=header + " - Singleplayer" - else - set header=header + " - Multiplayer" - endif - set header=header + " " + MAP_VERSION - call MultiboardSetTitleText(udg_StatsMultiboard, header) - // Player Columns - set WoWReforgedStats__currentRow=1 - call ForForce(udg_StatsPlayers, function WoWReforgedStats__ForFunctionUpdateStats) -endfunction -//library WoWReforgedStats ends -//library WoWReforgedWeaponSmith: -function WoWReforgedWeaponSmith__ForgingHammer takes unit hero,item whichItem,real damageBonus returns integer - local integer itemTypeId= GetItemTypeId(whichItem) - local integer count= (LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId), 0)) // INLINED!! - local integer abilityId= 0 - local ability whichAbility= null - local integer result= 0 - local integer i= 1 - loop - exitwhen ( i > count ) - set abilityId=(LoadInteger(WoWReforgedEquipmentBags___h, (itemTypeId ), ( i))) // INLINED!! - set whichAbility=BlzGetItemAbility(whichItem, abilityId) - call AddAbilityFieldBonuses(abilityId , whichAbility , 0 , 0 , 0 , 0.0 , damageBonus , 0 , 0 , 0 , 0.0 , 0 , 0 , 0 , 0) - // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 - call IncUnitAbilityLevel(hero, abilityId) - call DecUnitAbilityLevel(hero, abilityId) - set result=result + 1 - set i=i + 1 - endloop - if ( result > 0 ) then - call h__DisplayTimedTextToPlayer(GetOwningPlayer(hero), 0.0, 0.0, 4.0, "Increased damage bonus of item.") - endif - return result -endfunction -function WoWReforgedWeaponSmith__TriggerConditionCast takes nothing returns boolean - if ( GetSpellAbilityId() == WoWReforgedWeaponSmith__ABILITY_ID ) then - if ( WoWReforgedWeaponSmith__ForgingHammer(GetTriggerUnit() , GetSpellTargetItem() , 2) <= 0 ) then - call SimError(GetOwningPlayer(GetTriggerUnit()) , "Item has no known damage bonus abilities.") - call IssueImmediateOrder(GetTriggerUnit(), "stop") - endif - endif - return false -endfunction -function WoWReforgedWeaponSmith__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedWeaponSmith__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(WoWReforgedWeaponSmith__castTrigger, Condition(function WoWReforgedWeaponSmith__TriggerConditionCast)) -endfunction -//library WoWReforgedWeaponSmith ends -//library CinematicsRaces: -function CinematicsRaces___CreateRaceUnit takes integer whichRace,player whichPlayer,group g,integer t,rect whichRect returns nothing - local integer id= GetRaceObjectTypeId(whichRace , t) - local unit u= null - if ( t != 0 and GenerateId(id) ) then - set u=CreateUnit(whichPlayer, id, GetRectCenterX(whichRect), GetRectCenterY(whichRect), 270.0) - call SetUnitInvulnerable(u, true) - call PauseUnit(u, true) - call SetUnitLifePercentBJ(u, 100.0) - call SetUnitManaPercentBJ(u, 100.0) - call SetUnitAnimation(u, "Stand Victory") - call GroupAddUnit(g, u) - endif -endfunction -function PlayRaceMusic takes integer whichRace returns nothing - //call PlayThematicMusicBJ( "war3mapImported\\trollolol.swf.mp3" ) - //call StopMusic(false) - if ( whichRace == udg_RaceOldHorde ) then - call PlayThematicMusic("Music\\War2IntroMusic.flac") - elseif ( whichRace == udg_RaceHuman ) then - call PlayThematicMusic("Music\\HumanVictory.flac") - elseif ( whichRace == udg_RaceOrc ) then - call PlayThematicMusic("Music\\OrcVictory.flac") - elseif ( whichRace == udg_RaceUndead ) then - call PlayThematicMusic("Music\\UndeadVictory.flac") - elseif ( whichRace == udg_RaceNightElf ) then - call PlayThematicMusic("Music\\UndeadNightElf.flac") - elseif ( whichRace == udg_RaceBloodElf ) then - call PlayThematicMusic("Music\\BloodElfTheme.flac") - elseif ( whichRace == udg_RaceNaga ) then - call PlayThematicMusic("Music\\NagaTheme.flac") - endif -endfunction - -function CreateRacesCinematicGroup takes integer whichRace,player whichPlayer returns nothing - set GenerateIds___generatedIdsCounter=0 // INLINED!! - if ( whichRace > udg_RaceNone and whichRace < (udg_MaxRaces) ) then // INLINED!! - set CinematicsRaces___currentRace=whichRace - set CinematicsRaces___owner=whichPlayer - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FARM , gg_rct_race_farm) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SCOUT_TOWER , gg_rct_race_scout_tower) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_GUARD_TOWER , gg_rct_race_guard_tower) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_CANNON_TOWER , gg_rct_race_cannon_tower) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ARCANE_TOWER , gg_rct_race_arcane_tower) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TIER_1 , gg_rct_race_tier_1) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TIER_2 , gg_rct_race_tier_2) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TIER_3 , gg_rct_race_tier_3) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ALTAR , gg_rct_race_altar) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BARRACKS , gg_rct_race_barracks) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BLACK_SMITH , gg_rct_race_black_smith) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_MILL , gg_rct_race_mill) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_WORKSHOP , gg_rct_race_workshop) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ARCANE_SANCTUM , gg_rct_race_arcane_sanctum) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_GRYPHON_AVIARY , gg_rct_race_gryphon_aviary) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SACRIFICAL_PIT , gg_rct_race_sacrificial_pit) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHOP , gg_rct_race_shop) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_HOUSING , gg_rct_race_housing) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHIPYARD , gg_rct_race_shipyard) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SPECIAL_BUILDING , gg_rct_race_special_1) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , gg_rct_race_special_2) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_MALE_CITIZEN , gg_rct_race_citizen_male) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FEMALE_CITIZEN , gg_rct_race_citizen_female) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_CHILD , gg_rct_race_child) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_PET , gg_rct_race_pet) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_WORKER , gg_rct_race_worker) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TOWN_HALL_3 , gg_rct_race_town_hall_3) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TOWN_HALL_4 , gg_rct_race_town_hall_4) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FOOTMAN , gg_rct_race_footman) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_RIFLEMAN , gg_rct_race_rifleman) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_KNIGHT , gg_rct_race_knight) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BARRACKS_4 , gg_rct_race_barracks_4) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_PRIEST , gg_rct_race_priest) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SORCERESS , gg_rct_race_sorceress) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SPELLBREAKER , gg_rct_race_spell_breaker) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 , gg_rct_race_arcane_sanctum_4) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FLYING_MACHINE , gg_rct_race_flying_machine) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SIEGE_ENGINE , gg_rct_race_siege_engine) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_MORTAR , gg_rct_race_mortar) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_WORKSHOP_4 , gg_rct_race_workshop_4) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_GRYPHON , gg_rct_race_gryphon) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_DRAGONHAWK , gg_rct_race_dragonhawk) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_AVIARY_3 , gg_rct_race_aviary_3) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_AVIARY_4 , gg_rct_race_aviary_4) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TAUREN , gg_rct_race_tauren) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TRANSPORT_SHIP , gg_rct_race_transport_ship) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FRIGATE , gg_rct_race_frigate) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BATTLESHIP , gg_rct_race_battleship) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , gg_rct_race_ship_special_1) - call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , gg_rct_race_ship_special_2) - endif -endfunction -function CinematicsRaces___ForGroupRemoveUnit takes nothing returns nothing - call h__RemoveUnit(GetEnumUnit()) -endfunction - -function CleanupCinematicRace takes nothing returns nothing - call ForGroup(CinematicsRaces___whichGroup, function CinematicsRaces___ForGroupRemoveUnit) - call GroupClear(CinematicsRaces___whichGroup) -endfunction - -function NextCinematicRace takes nothing returns nothing - call CleanupCinematicRace() - if ( CinematicsRaces___currentRace >= (udg_MaxRaces) - 1 ) then // INLINED!! - set CinematicsRaces___currentRace=udg_RaceFreelancer - else - set CinematicsRaces___currentRace=CinematicsRaces___currentRace + 1 - endif - call PlayRaceMusic(CinematicsRaces___currentRace) - call CreateRacesCinematicGroup(CinematicsRaces___currentRace , CinematicsRaces___owner) -endfunction -function GetCinematicRaceText takes nothing returns string - return (GetObjectName(udg_RaceTavernItemType[(CinematicsRaces___currentRace)])) + " (" + I2S(CinematicsRaces___currentRace) + "/" + I2S((udg_MaxRaces)) + ")\nUse the left and right arrow keys to change the previewed race. Use the escape key to skip." // INLINED!! -endfunction -function PreviousCinematicRace takes nothing returns nothing - call CleanupCinematicRace() - if ( CinematicsRaces___currentRace == 0 ) then - set CinematicsRaces___currentRace=(udg_MaxRaces) - 1 // INLINED!! - else - set CinematicsRaces___currentRace=CinematicsRaces___currentRace - 1 - endif - call CreateRacesCinematicGroup(CinematicsRaces___currentRace , CinematicsRaces___owner) -endfunction -//library CinematicsRaces ends -//library MaxResearchConfig: -function UnitHasMaxHpResearch takes unit whichUnit,integer id returns boolean - if ( id == UPG_EVOLUTION ) then - return not IsUnitType(whichUnit, UNIT_TYPE_HERO) and not IsUnitType(whichUnit, UNIT_TYPE_STRUCTURE) - elseif ( id == UPG_IMPROVED_MASONRY ) then - //return GetPrimaryDependencyEquivalent(GetUnitTypeId(whichUnit)) == HIDEOUT - return not IsUnitType(whichUnit, UNIT_TYPE_HERO) and IsUnitType(whichUnit, UNIT_TYPE_STRUCTURE) - elseif ( id == UPG_IMPROVED_MOUNT ) then - return (WoWReforgedMounts__GetMountTypeByUnitTypeId((GetUnitTypeId(whichUnit))) != 0) // INLINED!! - elseif ( id == UPG_IMPROVED_HAND_OF_GOD ) then - return GetUnitTypeId(whichUnit) == DIVINE_GOLEM - elseif ( id == UPG_IMPROVED_CLAN ) then - return GetPrimaryDependencyEquivalent(GetUnitTypeId(whichUnit)) == CLAN_EMISSARY - elseif ( id == UPG_IMPROVED_CLAN_HALL ) then - return GetPrimaryDependencyEquivalent(GetUnitTypeId(whichUnit)) == CLAN_HALL - elseif ( id == UPG_OGRE_STRENGTH ) then - return GetUnitAbilityLevel(whichUnit, MaxResearchConfig_OGRE_STRENGTH_ABILITY_ID) > 0 - endif - - return false -endfunction -//library MaxResearchConfig ends -//library SaveCodeObjectSystem: -function GetSaveObjectUnitMax takes nothing returns integer - return SaveObjectUnitCounter -endfunction -function GetSaveObjectBuildingMax takes nothing returns integer - return SaveObjectBuildingCounter -endfunction -function GetSaveObjectResearchMax takes nothing returns integer - return SaveObjectResearchCounter -endfunction -function DisplaySaveObjectCounters takes nothing returns nothing - call h__BJDebugMsg("Save Object Unit Counter: " + I2S(SaveObjectUnitCounter)) - call h__BJDebugMsg("Save Object Building Counter: " + I2S(SaveObjectBuildingCounter)) - call h__BJDebugMsg("Save Object Item Counter: " + I2S(SaveObjectItemCounter)) - call h__BJDebugMsg("Save Object Research Counter: " + I2S(SaveObjectResearchCounter)) -endfunction -function DisplayDuplicateSaveObjects takes nothing returns nothing - local integer j - local integer i= 0 - call h__BJDebugMsg("Save Object Duplicates:") - loop - exitwhen ( i == SaveObjectUnitCounter ) - set j=0 - loop - exitwhen ( j == SaveObjectUnitCounter ) - if ( i != j and SaveObjectIdUnit[i] == SaveObjectIdUnit[j] ) then - call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdUnit[i]) + " with indices " + I2S(i) + " and " + I2S(j)) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - set i=0 - loop - exitwhen ( i == SaveObjectBuildingCounter ) - set j=0 - loop - exitwhen ( j == SaveObjectBuildingCounter ) - if ( i != j and SaveObjectIdBuilding[i] == SaveObjectIdBuilding[j] ) then - call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdBuilding[i]) + " with indices " + I2S(i) + " and " + I2S(j)) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - set i=0 - loop - exitwhen ( i == SaveObjectItemCounter ) - set j=0 - loop - exitwhen ( j == SaveObjectItemCounter ) - if ( i != j and SaveObjectIdItem[i] == SaveObjectIdItem[j] ) then - call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdItem[i]) + " with indices " + I2S(i) + " and " + I2S(j)) - endif - set j=j + 1 - endloop - - set j=0 - loop - exitwhen ( j == (WoWReforgedQuests__questsMax) ) // INLINED!! - if ( SaveObjectIdItem[i] == (WoWReforgedQuests__questReward[(j)]) ) then // INLINED!! - call h__BJDebugMsg("Quest reward item save object " + GetObjectName(SaveObjectIdItem[i]) + " with indices " + I2S(i) + " and " + I2S(j)) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - set i=0 - loop - exitwhen ( i == SaveObjectResearchCounter ) - set j=0 - loop - exitwhen ( j == SaveObjectResearchCounter ) - if ( i != j and SaveObjectIdResearch[i] == SaveObjectIdResearch[j] ) then - call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdResearch[i]) + " with indices " + I2S(i) + " and " + I2S(j)) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function AddSaveObjectUnitTypeEx takes string name,integer id returns integer - local integer index= SaveObjectUnitCounter - set SaveObjectNameUnit[index]=name - set SaveObjectIdUnit[index]=id - set SaveObjectUnitCounter=SaveObjectUnitCounter + 1 - return index -endfunction -function AddSaveObjectBuildingTypeEx takes string name,integer id returns integer - local integer index= SaveObjectBuildingCounter - set SaveObjectNameBuilding[index]=name - set SaveObjectIdBuilding[index]=id - set SaveObjectBuildingCounter=SaveObjectBuildingCounter + 1 - return index -endfunction -function AddSaveObjectUnitType takes nothing returns integer - if ( IsUnitIdType(udg_TmpUnitType, UNIT_TYPE_STRUCTURE) ) then - return AddSaveObjectBuildingTypeEx(GetObjectName(udg_TmpUnitType) , udg_TmpUnitType) - else - return AddSaveObjectUnitTypeEx(GetObjectName(udg_TmpUnitType) , udg_TmpUnitType) - endif -endfunction -function GetSaveObjectUnitType takes integer id returns integer - local integer i= 0 - loop - exitwhen ( i == SaveObjectUnitCounter ) - if ( SaveObjectIdUnit[i] == id ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetSaveObjectUnitId takes integer number returns integer - return SaveObjectIdUnit[number] -endfunction -function GetSaveObjectBuildingType takes integer id returns integer - local integer i= 0 - loop - exitwhen ( i == SaveObjectBuildingCounter ) - if ( SaveObjectIdBuilding[i] == id ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetSaveObjectBuildingId takes integer number returns integer - return SaveObjectIdBuilding[number] -endfunction -function AddSaveObjectItemTypeEx takes string name,integer id returns integer - local integer index= SaveObjectItemCounter - set SaveObjectNameItem[index]=name - set SaveObjectIdItem[index]=id - set SaveObjectItemCounter=SaveObjectItemCounter + 1 - return index -endfunction -function AddSaveObjectItemType takes nothing returns integer - return AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) -endfunction -function GetSaveObjectItemType takes integer id returns integer - local integer i= 0 - loop - exitwhen ( i == SaveObjectItemCounter ) - if ( SaveObjectIdItem[i] == id ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetSaveObjectItemId takes integer number returns integer - return SaveObjectIdItem[number] -endfunction -function GetSaveObjectItemMax takes nothing returns integer - return SaveObjectItemCounter -endfunction -function AddSaveObjectResearchTypeEx takes string name,integer id,integer whichRace returns integer - local integer index= SaveObjectResearchCounter - set SaveObjectNameResearch[index]=name - set SaveObjectIdResearch[index]=id - set SaveObjectRaceResearch[index]=whichRace - set SaveObjectResearchCounter=SaveObjectResearchCounter + 1 - return index -endfunction -function AddSaveObjectResearch takes nothing returns integer - return AddSaveObjectResearchTypeEx(GetObjectName(udg_TmpTechType) , udg_TmpTechType , udg_TmpInteger) -endfunction -function GetSaveObjectResearchType takes integer id returns integer - local integer i= 0 - loop - exitwhen ( i == SaveObjectResearchCounter ) - if ( SaveObjectIdResearch[i] == id ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetSaveObjectResearchId takes integer index returns integer - return SaveObjectIdResearch[index] -endfunction -function GetSaveObjectResearchRace takes integer index returns integer - return SaveObjectRaceResearch[index] -endfunction -function AddRaceItemsSaveObjects takes nothing returns nothing - local integer i= 1 - local integer max= udg_MaxRaces - local integer j= 0 - local integer max2= 0 - local integer array addedObjectTypeIds - local integer addedObjectTypeIdsCounter= 0 - loop - exitwhen ( i == max ) - set j=0 - set max2=RACE_MAX_OBJECT_TYPES - loop - exitwhen ( j == max2 ) - if ( IsRaceItem(j) and GetRaceObjectTypeId(i , j) != 0 ) then - set udg_TmpItemTypeId=GetRaceObjectTypeId(i , j) -call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function AddCreepsSaveObjects takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedRaces___objectTypeCreepsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( (WoWReforgedRaces___objectTypeCreeps[(i)]) != 0 ) then // INLINED!! - set udg_TmpUnitType=(WoWReforgedRaces___objectTypeCreeps[(i)]) // INLINED!! - call AddSaveObjectUnitType() - endif - set i=i + 1 - endloop -endfunction -function AddRaceUnitsSaveObjects takes nothing returns nothing - local integer i= udg_RaceFreelancer - local integer max= udg_MaxRaces - local integer j= 0 - local integer max2= 0 - loop - exitwhen ( i == max ) - set j=0 - set max2=RACE_MAX_OBJECT_TYPES - loop - exitwhen ( j == max2 ) - if ( IsRaceUnit(j) and GetRaceObjectTypeId(i , j) != 0 ) then - set udg_TmpUnitType=GetRaceObjectTypeId(i , j) - call AddSaveObjectUnitType() - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function AddRaceBuildingsSaveObjects takes nothing returns nothing - local integer i= 1 - local integer max= udg_MaxRaces - local integer j= 0 - local integer max2= 0 - local integer array addedObjectTypeIds - local integer addedObjectTypeIdsCounter= 0 - loop - exitwhen ( i == max ) - set j=0 - set max2=RACE_MAX_OBJECT_TYPES - loop - exitwhen ( j == max2 ) - if ( IsRaceBuilding(j) and GetRaceObjectTypeId(i , j) != 0 ) then - set udg_TmpUnitType=GetRaceObjectTypeId(i , j) - call AddSaveObjectUnitType() - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function AddProfessionItemsSaveObjects takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - local integer j= 0 - local integer max2= 0 - local integer k= 0 - local integer max3= 0 - loop - exitwhen ( i == max ) - set udg_TmpItemTypeId=s__Profession_bookItemTypeId[(WoWReforgedProfessions___professions[(i)])] // INLINED!! -call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! - set j=0 - set max2=PROFESSION_RANK_MAX - loop - exitwhen ( j == max2 ) - set k=0 - set max3=GetProfessionCraftedItemsCount(i , j) - loop - exitwhen ( k == max3 ) - if ( GetProfessionCraftedItem(i , j , k) != 0 ) then - set udg_TmpItemTypeId=GetProfessionCraftedItem(i , j , k) -call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! - endif - set k=k + 1 - endloop - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function AddSaveObjectItemTypesFromRecipes takes nothing returns nothing - local integer i= 0 - local integer max= (Crafting___recipesCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( not (Crafting___recipesIsUnit[(i)]) and (Crafting___recipesItemTypeIds[(i)]) != 0 ) then // INLINED!! - set udg_TmpItemTypeId=(Crafting___recipesItemTypeIds[(i)]) // INLINED!! -call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! - endif - set i=i + 1 - endloop -endfunction -function AddSaveObjectItemTypesFromBanners takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedBanners___skinCounter) // INLINED!! - loop - exitwhen ( i == max ) - set udg_TmpItemTypeId=(WoWReforgedBanners___skinItemTypeId[(i)]) // INLINED!! -call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! - set i=i + 1 - endloop -endfunction -function AddSaveObjectBuildingTypesFromBanners takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedBanners___skinCounter) // INLINED!! - loop - exitwhen ( i == max ) - set udg_TmpUnitType=(WoWReforgedBanners___skinUnitTypeId[(i)]) // INLINED!! - call AddSaveObjectUnitType() - set i=i + 1 - endloop -endfunction -//library SaveCodeObjectSystem ends -//library WoWReforgedAchievements: - - function s__Achievement_complete takes integer this,player whichPlayer returns nothing - set s___Achievement_playerCompleted[s__Achievement_playerCompleted[this]+GetPlayerId(whichPlayer)]=true - endfunction - - function s__Achievement_isCompleted takes integer this,player whichPlayer returns boolean - return s___Achievement_playerCompleted[s__Achievement_playerCompleted[this]+GetPlayerId(whichPlayer)] - endfunction - - - function s__Achievement_create takes string name,string description,string icon returns integer - local integer this= s__Achievement__allocate() - set s__Achievement_name[this]=name - set s__Achievement_description[this]=description - set s__Achievement_icon[this]=icon - return this - endfunction -function GetAchievementIsCompletedForPlayer takes integer index,player whichPlayer returns boolean - return (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements__achievements[index])]+GetPlayerId((whichPlayer))]) // INLINED!! -endfunction -function GetMaxAchievements takes nothing returns integer - return WoWReforgedAchievements__achievementsCounter -endfunction -function CountKilledBossesForPlayer takes player whichPlayer returns integer - local integer playerId= GetPlayerId(whichPlayer) - local integer result= 0 - local integer i= 0 - local integer max= BlzGroupGetSize(udg_Bosses) - loop - exitwhen ( i == max ) - if ( LoadBoolean(WoWReforgedAchievements__bossKillsHashTable, GetHandleId(BlzGroupUnitAt(udg_Bosses, i)), playerId) ) then - set result=result + 1 - endif - set i=i + 1 - endloop - return result -endfunction -function CountKilledCreepForPlayer takes player whichPlayer,integer unitTypeId returns integer - local integer playerId= GetPlayerId(whichPlayer) - return LoadInteger(WoWReforgedAchievements__unitTypeKillsHashTable, unitTypeId, playerId) -endfunction -function CountKilledCreepTypesForPlayer takes player whichPlayer returns integer - local integer count= 0 - local integer i= 0 - local integer max= (WoWReforgedRaces___objectTypeCreepsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( CountKilledCreepForPlayer(whichPlayer , (WoWReforgedRaces___objectTypeCreeps[(i)])) > 0 ) then // INLINED!! - set count=count + 1 - endif - set i=i + 1 - endloop - return count -endfunction -function PlayerCountCompletedAchievements takes player whichPlayer returns integer - local integer result= 0 - local integer i= 0 - local integer max= (WoWReforgedAchievements__achievementsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements__achievements[(i )])]+GetPlayerId((( whichPlayer)))]) ) then // INLINED!! - set result=result + 1 - endif - set i=i + 1 - endloop - return result -endfunction -function WoWReforgedAchievements__GetAchievementDescriptionIntern takes integer a,player whichPlayer returns string - local integer playerId= GetPlayerId(whichPlayer) - if ( a == udg_AchievementConqueror ) then - return I2S(BlzGroupGetSize(WoWReforgedAchievements__conquerorTownHalls[playerId])) + "/" + I2S((udg_Max_StartLocations)) // INLINED!! - elseif ( a == udg_AchievementQuestSolver ) then - return I2S(WoWReforgedAchievements__questsCompleted) + "/" + I2S((WoWReforgedQuests__questsMax)) // INLINED!! - elseif ( a == udg_AchievementMasterQuestSolver ) then - return I2S(WoWReforgedAchievements__questsCompleted) + "/" + I2S((WoWReforgedQuests__questsMax)) // INLINED!! - elseif ( a == udg_AchievementBossSlayer ) then - return I2S(CountKilledBossesForPlayer(whichPlayer)) - elseif ( a == udg_AchievementMasterBossSlayer ) then - return I2S(CountKilledBossesForPlayer(whichPlayer)) + "/" + I2S(BlzGroupGetSize(udg_Bosses)) - elseif ( a == udg_AchievementMasterCreepSlayer ) then - return I2S(CountKilledCreepTypesForPlayer(whichPlayer)) + "/" + I2S((WoWReforgedRaces___objectTypeCreepsCounter)) // INLINED!! - elseif ( a == udg_AchievementHeroSlayer ) then - return I2S(WoWReforgedAchievements__playerHeroKills[playerId]) - elseif ( a == udg_AchievementPlayerSlayer ) then - return I2S(WoWReforgedAchievements__playersDefeated) - elseif ( a == udg_AchievementDeforestation ) then - return I2S(WoWReforgedAchievements__treesKilled) + "/10000" - elseif ( a == udg_AchievementWithoutFriends ) then - return I2S(udg_GameTime / 3600) - elseif ( a == udg_AchievementDestroyer ) then - return I2S(R2I(WoWReforgedAchievements__playerDamageCaused[playerId])) + "/50000" - elseif ( a == udg_AchievementTank ) then - return I2S(R2I(WoWReforgedAchievements__playerDamageTaken[playerId])) + "/50000" - elseif ( a == udg_AchievementMasterLocksmith ) then - return I2S(WoWReforgedAchievements__playerLockPicks[playerId]) - elseif ( a == udg_AchievementMasterThief ) then - return I2S(WoWReforgedAchievements__playerPickPockets[playerId]) - elseif ( a == udg_AchievementHolyWarrior ) then - return I2S(WoWReforgedAchievements__playerUndeadKills[playerId]) - elseif ( a == udg_AchievementUnholyWarrior ) then - return I2S(WoWReforgedAchievements__playerNonUndeadKills[playerId]) - elseif ( a == udg_AchievementWarCriminal ) then - return I2S(WoWReforgedAchievements__playerCitizenKills[playerId]) - elseif ( a == udg_AchievementAchievementMaster ) then - return I2S(PlayerCountCompletedAchievements(whichPlayer)) - elseif ( a == udg_AchievementOilTycoon ) then - return I2S(R2I(WoWReforgedAchievements__playerOil[playerId])) + "/50000" - elseif ( a == udg_AchievementPropertyShark ) then - return I2S(WoWReforgedAchievements__playerPropertyCounter[playerId]) + "/6" - elseif ( a == udg_AchievementExplorer ) then - return I2S(WoWReforgedAchievements__playerZonesCounter[playerId]) + "/20" - elseif ( a == udg_AchievementMasterExplorer ) then - return I2S(WoWReforgedAchievements__playerZonesCounter[playerId]) + "/all zones" - elseif ( a == udg_AchievementRacer ) then - return I2S(WoWReforgedAchievements__playerRacingTracks[playerId]) + "/all races" - endif - return "" -endfunction -function AddAchievement takes string name,string description,string icon returns integer - local integer a= s__Achievement_create(name , description , icon) - set WoWReforgedAchievements__achievements[WoWReforgedAchievements__achievementsCounter]=a - set WoWReforgedAchievements__achievementsCounter=WoWReforgedAchievements__achievementsCounter + 1 - return a -endfunction -function AddAchievementWoWReforged takes nothing returns integer - return AddAchievement(udg_TmpString , udg_TmpString2 , udg_TmpString3) -endfunction -function GetAchievementName takes integer index returns string - return s__Achievement_name[WoWReforgedAchievements__achievements[index]] -endfunction -function GetAchievementDescription takes integer index returns string - return s__Achievement_description[WoWReforgedAchievements__achievements[index]] -endfunction -function GetAchievementIcon takes integer index returns string - return s__Achievement_icon[WoWReforgedAchievements__achievements[index]] -endfunction -function GetAchievementCounterDescription takes integer index,player whichPlayer returns string - return WoWReforgedAchievements__GetAchievementDescriptionIntern(WoWReforgedAchievements__achievements[index] , whichPlayer) -endfunction -function GetActualAchievementXP takes player whichPlayer,integer xpToAdd returns integer - if ( IsPlayerFreelancer(whichPlayer) ) then - return R2I(I2R(xpToAdd) * 1.5) - endif - - return xpToAdd -endfunction -function PlayerCompletedAllAchievements takes player whichPlayer returns boolean - local integer i= 0 - local integer max= (WoWReforgedAchievements__achievementsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( not (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements__achievements[(i )])]+GetPlayerId((( whichPlayer)))]) ) then // INLINED!! - return false - endif - set i=i + 1 - endloop - return true -endfunction -function AchievementXPBonusForPlayer takes player whichPlayer,integer xpToAdd,integer a,string msg returns nothing - local integer playerXp= GetActualAchievementXP(whichPlayer , xpToAdd) - call AddHeroXP1(whichPlayer , playerXp , true) - call AddHeroXP2(whichPlayer , playerXp , true) - call AddHeroXP3(whichPlayer , playerXp , true) - set s___Achievement_playerCompleted[s__Achievement_playerCompleted[(a)]+GetPlayerId((whichPlayer))]=true // INLINED!! - call AdjustPlayerStateBJ(playerXp, whichPlayer, PLAYER_STATE_GOLD_GATHERED) - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_UNITAVAILABLE, "|cff0000ff" + StringCase(s__Achievement_name[a], true) + " +" + I2S(playerXp) + " XP and gold:|r " + msg) - - if ( PlayerCompletedAllAchievements(whichPlayer) and not WoWReforgedAchievements__playerCompletedAllAchievements[GetPlayerId(whichPlayer)] ) then - set WoWReforgedAchievements__playerCompletedAllAchievements[GetPlayerId(whichPlayer)]=true - call AchievementXPBonusForPlayer(whichPlayer , 10000 , udg_AchievementAchievementMaster , "Completed all achievements.") - endif -endfunction -function AchievementHintForPlayer takes player whichPlayer,integer a,string msg returns nothing - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff0000ff" + StringCase(s__Achievement_name[a], true) + ":|r " + msg) -endfunction -function AchievementXPBonus takes force whichForce,integer xpToAdd,integer a,string msg returns nothing - local integer i= 0 - local player slotPlayer= null - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( IsPlayerInForce(slotPlayer, whichForce) ) then - call AchievementXPBonusForPlayer(slotPlayer , xpToAdd , a , msg) - endif - set slotPlayer=null - set i=i + 1 - endloop -endfunction -function AchievementCompleteQuest takes nothing returns nothing - set WoWReforgedAchievements__questsCompleted=WoWReforgedAchievements__questsCompleted + 1 - if ( ModuloInteger(WoWReforgedAchievements__questsCompleted, 4) == 0 ) then - call AchievementXPBonus(GetPlayersAll() , WoWReforgedAchievements__questsCompleted * 100 , udg_AchievementQuestSolver , "Completed 4 more quests.") - if ( WoWReforgedAchievements__questsCompleted == (WoWReforgedQuests__questsMax) ) then // INLINED!! - call AchievementXPBonus(GetPlayersAll() , 6000 , udg_AchievementMasterQuestSolver , "Completed all quests.") - endif - endif -endfunction -function AchievementKillBoss takes unit killer,unit boss returns nothing - local player whichPlayer= GetOwningPlayer(killer) - local integer playerId= GetPlayerId(whichPlayer) - local integer count= 0 - call SaveBoolean(WoWReforgedAchievements__bossKillsHashTable, GetHandleId(boss), playerId, true) - set count=CountKilledBossesForPlayer(whichPlayer) - if ( ModuloInteger(count, 5) == 0 and not WoWReforgedAchievements__playerBossKillAchievements[Index2D(count , playerId , bj_MAX_PLAYERS)] ) then - set WoWReforgedAchievements__playerBossKillAchievements[Index2D(count , playerId , bj_MAX_PLAYERS)]=true - call AchievementXPBonusForPlayer(whichPlayer , count * 100 , udg_AchievementBossSlayer , "Killed 5 bosses.") - if ( count == BlzGroupGetSize(udg_Bosses) ) then - call AchievementXPBonusForPlayer(whichPlayer , 5000 , udg_AchievementMasterBossSlayer , "Killed all bosses.") - endif - endif - set whichPlayer=null -endfunction -function AchievementKillCreep takes unit killer,unit creep returns nothing - local player whichPlayer= GetOwningPlayer(killer) - local integer playerId= GetPlayerId(whichPlayer) - local integer unitTypeId= GetUnitTypeId(creep) - local integer count= CountKilledCreepForPlayer(whichPlayer , unitTypeId) + 1 - call SaveInteger(WoWReforgedAchievements__unitTypeKillsHashTable, unitTypeId, playerId, count) - if ( ModuloInteger(count, 50) == 0 ) then - call AchievementXPBonusForPlayer(whichPlayer , count * 2 , udg_AchievementCreepSlayer , "Killed 50 " + GetUnitName(creep) + " creeps.") - endif - if ( not WoWReforgedAchievements__playerHasEveryCreepTypeAchievement[playerId] and CountKilledCreepTypesForPlayer(whichPlayer) == (WoWReforgedRaces___objectTypeCreepsCounter) ) then // INLINED!! - set WoWReforgedAchievements__playerHasEveryCreepTypeAchievement[playerId]=true - call AchievementXPBonusForPlayer(whichPlayer , 5000 , udg_AchievementMasterCreepSlayer , "Killed every creep type.") - endif - set whichPlayer=null -endfunction -function AchievementKillHero takes unit killer returns nothing - local player whichPlayer= GetOwningPlayer(killer) - local integer playerId= GetPlayerId(whichPlayer) - local integer count= WoWReforgedAchievements__playerHeroKills[playerId] + 1 - set WoWReforgedAchievements__playerHeroKills[playerId]=count - if ( ModuloInteger(count, 5) == 0 ) then - call AchievementXPBonusForPlayer(whichPlayer , count * 10 , udg_AchievementHeroSlayer , "Killed 5 enemy heroes.") - endif - set whichPlayer=null -endfunction -function AchievementPlayerDefeat takes player whichPlayer returns nothing - local force enemies= GetPlayersEnemies(whichPlayer) - set WoWReforgedAchievements__playersDefeated=WoWReforgedAchievements__playersDefeated + 1 - call AchievementXPBonus(enemies , 200 , udg_AchievementPlayerSlayer , "Defeated player " + GetPlayerName(whichPlayer) + ".") - call ForceClear(enemies) - call DestroyForce(enemies) - set enemies=null -endfunction -function AchievementTreesKilled takes destructable whichDestructable returns nothing - if ( (IsTree(GetDestructableTypeId((whichDestructable)))) ) then // INLINED!! - set WoWReforgedAchievements__treesKilled=WoWReforgedAchievements__treesKilled + 1 - if ( ModuloInteger(WoWReforgedAchievements__treesKilled, 10000) == 0 ) then - call AchievementXPBonus(GetPlayersAll() , 5000 , udg_AchievementDeforestation , "Killed " + I2S(WoWReforgedAchievements__treesKilled) + " trees.") - endif - endif -endfunction -function Achievement2Hours takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( WoWReforgedAchievements__playerHeroDeaths[i] == 0 ) then - call AchievementXPBonusForPlayer(Player(i) , 2000 , udg_AchievementSurvivor , " hours without your hero dying.") - endif - set i=i + 1 - endloop - call AchievementXPBonus(GetPlayersAll() , 1000 , udg_AchievementWithoutFriends , "2 hours played.") -endfunction -function Achievement4Hours takes nothing returns nothing - call AchievementXPBonus(GetPlayersAll() , 2000 , udg_AchievementWithoutFriends , "4 hours played.") -endfunction -function Achievement6Hours takes nothing returns nothing - call AchievementXPBonus(GetPlayersAll() , 3000 , udg_AchievementWithoutFriends , "6 hours played.") -endfunction -function Achievement8Hours takes nothing returns nothing - call AchievementXPBonus(GetPlayersAll() , 4000 , udg_AchievementWithoutFriends , "8 hours played.") -endfunction -function Achievement10Hours takes nothing returns nothing - call AchievementXPBonus(GetPlayersAll() , 5000 , udg_AchievementWithoutFriends , "10 hours played.") -endfunction -function AchievementDemonHunter takes nothing returns nothing - call AchievementXPBonus(GetPlayersAll() , 10000 , udg_AchievementDemonHunter , "Killed Archimonde within 30 minutes.") -endfunction -function GetAchievements takes player whichPlayer returns string - local string msg= "Achievements:" - local integer i= 0 - local integer max= (WoWReforgedAchievements__achievementsCounter) // INLINED!! - loop - exitwhen ( i == max ) - set msg=msg + "\n- " + (s__Achievement_name[WoWReforgedAchievements__achievements[(i)]]) + ": " + (s__Achievement_description[WoWReforgedAchievements__achievements[(i)]]) // INLINED!! - if ( (WoWReforgedAchievements__GetAchievementDescriptionIntern(WoWReforgedAchievements__achievements[(i )] , ( whichPlayer))) != "" ) then // INLINED!! - set msg=msg + " (" + (WoWReforgedAchievements__GetAchievementDescriptionIntern(WoWReforgedAchievements__achievements[(i )] , ( whichPlayer))) + ")" // INLINED!! - endif - set i=i + 1 - endloop - return msg -endfunction -// quest whichQuest -function AddAchievementsToQuest takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedAchievements__achievementsCounter) // INLINED!! - loop - exitwhen ( i == max ) -call CreateQuestItem(bj_lastCreatedQuest , ((s__Achievement_name[WoWReforgedAchievements__achievements[(i)]]) + ": " + (s__Achievement_description[WoWReforgedAchievements__achievements[(i)]]))) // INLINED!! - //call CreateQuestItemBJ(whichQuest, GetAchievementName(i) + ": " + GetAchievementDescription(i)) - set i=i + 1 - endloop -endfunction -function AchievementOverpopulation takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - if ( not WoWReforgedAchievements__playerOverpopulation[playerId] ) then - set WoWReforgedAchievements__playerOverpopulation[playerId]=true - call AchievementXPBonusForPlayer(whichPlayer , 1500 , udg_AchievementOverpopulation , "Using 600 food.") - endif -endfunction -function AchievementLockPick takes unit hero returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(hero)) - set WoWReforgedAchievements__playerLockPicks[playerId]=WoWReforgedAchievements__playerLockPicks[playerId] + 1 - if ( ModuloInteger(WoWReforgedAchievements__playerLockPicks[playerId], 50) == 0 ) then - call AchievementXPBonusForPlayer(GetOwningPlayer(hero) , 1000 , udg_AchievementMasterLocksmith , "Unlocked 50 chests.") - endif -endfunction -function AchievementPickpocket takes unit hero,unit target,item stolenItem returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(hero)) - set WoWReforgedAchievements__playerPickPockets[playerId]=WoWReforgedAchievements__playerPickPockets[playerId] + 1 - if ( ModuloInteger(WoWReforgedAchievements__playerPickPockets[playerId], 50) == 0 ) then - call AchievementXPBonusForPlayer(GetOwningPlayer(hero) , 1000 , udg_AchievementMasterThief , "Stolen 50 items.") - endif -endfunction -function AchievementHolyWarrior takes unit killer returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(killer)) - set WoWReforgedAchievements__playerUndeadKills[playerId]=WoWReforgedAchievements__playerUndeadKills[playerId] + 1 - if ( ModuloInteger(WoWReforgedAchievements__playerUndeadKills[playerId], 100) == 0 ) then - call AchievementXPBonusForPlayer(GetOwningPlayer(killer) , 1000 , udg_AchievementHolyWarrior , "Killed 100 Undead.") - endif -endfunction -function AchievementUnholyWarrior takes unit killer returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(killer)) - set WoWReforgedAchievements__playerNonUndeadKills[playerId]=WoWReforgedAchievements__playerNonUndeadKills[playerId] + 1 - if ( ModuloInteger(WoWReforgedAchievements__playerNonUndeadKills[playerId], 100) == 0 ) then - call AchievementXPBonusForPlayer(GetOwningPlayer(killer) , 1000 , udg_AchievementUnholyWarrior , "Killed 100 non-Undead.") - endif -endfunction -function AchievementWarCriminal takes unit killer returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(killer)) - set WoWReforgedAchievements__playerCitizenKills[playerId]=WoWReforgedAchievements__playerCitizenKills[playerId] + 1 - if ( ModuloInteger(WoWReforgedAchievements__playerCitizenKills[playerId], 100) == 0 ) then - call AchievementXPBonusForPlayer(GetOwningPlayer(killer) , 1000 , udg_AchievementWarCriminal , "Killed 100 citizens.") - endif -endfunction -function AchievementPropertyShark takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - set WoWReforgedAchievements__playerPropertyCounter[playerId]=WoWReforgedAchievements__playerPropertyCounter[playerId] + 1 - - if ( ModuloInteger(WoWReforgedAchievements__playerPropertyCounter[playerId], 6) == 0 ) then - call AchievementXPBonusForPlayer(whichPlayer , 5000 , udg_AchievementPropertyShark , "Purchased 6 properties.") - endif -endfunction -function AchievementPropertyLandowner takes player whichPlayer,integer maxProperties returns nothing - local integer playerId= GetPlayerId(whichPlayer) - //set playerPropertyCounter[playerId] = playerPropertyCounter[playerId] + 1 // AchievementPropertyShark - - if ( WoWReforgedAchievements__playerPropertyCounter[playerId] == maxProperties ) then - call AchievementXPBonusForPlayer(whichPlayer , 10000 , udg_AchievementLandowner , "Purchased all properties.") - endif -endfunction -function AchievementExplorer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - set WoWReforgedAchievements__playerZonesCounter[playerId]=WoWReforgedAchievements__playerZonesCounter[playerId] + 1 - - if ( ModuloInteger(WoWReforgedAchievements__playerZonesCounter[playerId], 20) == 0 ) then - call AchievementXPBonusForPlayer(whichPlayer , 1000 , udg_AchievementExplorer , "Newly discovered 20 zones.") - endif -endfunction -function AchievementMasterExplorer takes player whichPlayer,integer maxZones returns nothing - local integer playerId= GetPlayerId(whichPlayer) - set WoWReforgedAchievements__playerZonesCounter[playerId]=WoWReforgedAchievements__playerZonesCounter[playerId] + 1 - - if ( WoWReforgedAchievements__playerZonesCounter[playerId] == maxZones ) then - call AchievementXPBonusForPlayer(whichPlayer , 10000 , udg_AchievementMasterExplorer , "Newly discovered all existing zones.") - endif -endfunction -function AchievementRacer takes player whichPlayer,integer maxRacingTracks returns nothing - local integer playerId= GetPlayerId(whichPlayer) - set WoWReforgedAchievements__playerRacingTracks[playerId]=WoWReforgedAchievements__playerRacingTracks[playerId] + 1 - - if ( WoWReforgedAchievements__playerRacingTracks[playerId] == maxRacingTracks ) then - call AchievementXPBonusForPlayer(whichPlayer , 2000 , udg_AchievementRacer , "Finished all races.") - endif -endfunction -function WoWReforgedAchievements__QuestSetCompletedBJHook takes quest whichQuest,boolean completed returns nothing - if ( not IsQuestRequired(whichQuest) ) then - call AchievementCompleteQuest() - endif -endfunction -//processed hook: hook QuestSetCompletedBJ WoWReforgedAchievements__QuestSetCompletedBJHook -function WoWReforgedAchievements__TriggerConditionDamage takes nothing returns boolean - local unit source= GetEventDamageSource() - local player sourceOwner= GetOwningPlayer(source) - local integer playerIdSource= GetPlayerId(sourceOwner) - local unit target= BlzGetEventDamageTarget() - local player targetOwner= GetOwningPlayer(target) - local integer playerIdTarget= GetPlayerId(targetOwner) - if ( IsPlayerHero(source) and IsUnitEnemy(source, targetOwner) ) then - set WoWReforgedAchievements__playerDamageCaused[playerIdSource]=WoWReforgedAchievements__playerDamageCaused[playerIdSource] + GetEventDamage() - if ( WoWReforgedAchievements__playerDamageCaused[playerIdSource] > 0.0 and ModuloReal(WoWReforgedAchievements__playerDamageCaused[playerIdSource], 50000.0) == 0 ) then - call AchievementXPBonusForPlayer(sourceOwner , 2000 , udg_AchievementDestroyer , "50000 damage caused.") - endif - endif - if ( IsPlayerHero(target) and IsUnitEnemy(target, sourceOwner) ) then - set WoWReforgedAchievements__playerDamageTaken[playerIdTarget]=WoWReforgedAchievements__playerDamageTaken[playerIdTarget] + GetEventDamage() - if ( WoWReforgedAchievements__playerDamageTaken[playerIdTarget] > 0.0 and ModuloReal(WoWReforgedAchievements__playerDamageTaken[playerIdTarget], 50000.0) == 0 ) then - call AchievementXPBonusForPlayer(targetOwner , 2000 , udg_AchievementTank , "50000 damage received.") - endif - endif - set source=null - set sourceOwner=null - set target=null - set targetOwner=null - return false -endfunction -function WoWReforgedAchievements__TriggerConditionDeath takes nothing returns boolean - local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) - - if ( IsPlayerHero(GetTriggerUnit()) ) then - set WoWReforgedAchievements__playerHeroDeaths[playerId]=WoWReforgedAchievements__playerHeroDeaths[playerId] + 1 - endif - - if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) and GetKillingUnit() != null and not IsUnitAlly(GetKillingUnit(), GetOwningPlayer(GetTriggerUnit())) and not IsUnitType(GetKillingUnit(), UNIT_TYPE_UNDEAD) ) then - call AchievementHolyWarrior(GetKillingUnit()) - endif - - if ( not IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) and GetKillingUnit() != null and not IsUnitAlly(GetKillingUnit(), GetOwningPlayer(GetTriggerUnit())) and IsUnitType(GetKillingUnit(), UNIT_TYPE_UNDEAD) ) then - call AchievementUnholyWarrior(GetKillingUnit()) - endif - - if ( GetKillingUnit() != null and not IsUnitAlly(GetKillingUnit(), GetOwningPlayer(GetTriggerUnit())) and IsCitizen(GetUnitTypeId(GetTriggerUnit())) ) then - call AchievementWarCriminal(GetKillingUnit()) - endif - - if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedAchievements__conquerorTownHalls[playerId]) ) then - call GroupRemoveUnit(WoWReforgedAchievements__conquerorTownHalls[playerId], GetTriggerUnit()) - endif - - return false -endfunction -function WoWReforgedAchievements__TriggerConditionGather takes nothing returns boolean - local player owner= GetOwningPlayer((Resources___triggerWorker)) // INLINED!! - local integer playerId= GetPlayerId(owner) - if ( (Resources___triggerResource) == udg_ResourceOil ) then // INLINED!! - set WoWReforgedAchievements__playerOil[playerId]=WoWReforgedAchievements__playerOil[playerId] + (Resources___triggerResourceAmount) // INLINED!! - - if ( WoWReforgedAchievements__playerOil[playerId] >= 50000 and not (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements__achievements[(udg_AchievementOilTycoon )])]+GetPlayerId((( owner)))]) ) then // INLINED!! - call AchievementXPBonusForPlayer(owner , 1000 , udg_AchievementOilTycoon , "Gathered 50 000 Oil.") - endif - endif - - return false -endfunction -function WoWReforgedAchievements__HasUnitForStartLocation takes player whichPlayer,integer index returns boolean - local integer playerId= GetPlayerId(whichPlayer) - local boolean result= false - local unit u= null - local integer i= 0 - local integer max= BlzGroupGetSize(WoWReforgedAchievements__conquerorTownHalls[playerId]) - loop - exitwhen ( i == max or result ) - set u=BlzGroupUnitAt(WoWReforgedAchievements__conquerorTownHalls[playerId], i) - if ( GetStartLocationRectByCoordinates(GetUnitX(u) , GetUnitY(u)) == index ) then - set result=true - endif - set u=null - set i=i + 1 - endloop - return result -endfunction -function WoWReforgedAchievements__TriggerConditionConstructionFinished takes nothing returns boolean - local unit b= GetConstructedStructure() - local player owner= GetOwningPlayer(b) - local integer playerId= GetPlayerId(owner) - local integer index= - 1 - if ( IsUnitType(b, UNIT_TYPE_TOWNHALL) and not (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements__achievements[(udg_AchievementConqueror )])]+GetPlayerId((( owner)))]) ) then // INLINED!! - set index=GetStartLocationRectByCoordinates(GetUnitX(b) , GetUnitY(b)) - if ( index != - 1 and not WoWReforgedAchievements__HasUnitForStartLocation(owner , index) ) then - call GroupAddUnit(WoWReforgedAchievements__conquerorTownHalls[playerId], b) - - if ( BlzGroupGetSize(WoWReforgedAchievements__conquerorTownHalls[playerId]) == (udg_Max_StartLocations) ) then // INLINED!! - call AchievementXPBonusForPlayer(owner , 7000 , udg_AchievementConqueror , "Constructed town halls in " + I2S((udg_Max_StartLocations)) + " start locations.") // INLINED!! - else - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId((owner ))], bj_QUESTMESSAGE_HINT, "|cff0000ff" + StringCase(s__Achievement_name[( udg_AchievementConqueror )], true) + ":|r " + ( "Constructed another town hall in a start location (" + I2S(BlzGroupGetSize(WoWReforgedAchievements__conquerorTownHalls[playerId])) + "/" + I2S((udg_Max_StartLocations)) + ").")) // INLINED!! - endif - endif - endif - - set b=null - set owner=null - - return false -endfunction -function WoWReforgedAchievements__Init takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set WoWReforgedAchievements__conquerorTownHalls[i]=CreateGroup() - set i=i + 1 - endloop - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedAchievements__constructionFinishedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedAchievements__constructionFinishedTrigger, Condition(function WoWReforgedAchievements__TriggerConditionConstructionFinished)) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedAchievements__damageTrigger, EVENT_PLAYER_UNIT_DAMAGED) - call TriggerAddCondition(WoWReforgedAchievements__damageTrigger, Condition(function WoWReforgedAchievements__TriggerConditionDamage)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedAchievements__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedAchievements__deathTrigger, Condition(function WoWReforgedAchievements__TriggerConditionDeath)) - - call TriggerRegisterGatherEvent(WoWReforgedAchievements__gatherTrigger) - call TriggerAddCondition(WoWReforgedAchievements__gatherTrigger, Condition(function WoWReforgedAchievements__TriggerConditionGather)) -endfunction -//library WoWReforgedAchievements ends -//library WoWReforgedAlchemistLab: -function WoWReforgedAlchemistLab__SetShopRace takes unit shop,integer whichRace returns nothing - call SetUnitUserData(shop, whichRace) - call BlzSetUnitName(shop, "Alchemist Lab " + GetObjectName(udg_RaceTavernItemType[whichRace])) - //call BJDebugMsg("Change shop race to " + GetObjectName(udg_RaceTavernItemType[whichRace])) -endfunction -function WoWReforgedAlchemistLab__AddRaceTypesToShop takes unit shop returns nothing - local integer max= udg_MaxRaces - local integer i= 1 - call WoWReforgedAlchemistLab__SetShopRace(shop , udg_RaceHuman) - call EnablePagedButtons(shop) - call SetPagedButtonsSlotsPerPage(shop , 8) - loop - exitwhen ( i >= max ) -call AddPagedButtonsId((shop ) , ( udg_RaceTavernItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop -endfunction -function WoWReforgedAlchemistLab__TriggerConditionConstructionFinish takes nothing returns boolean - local unit shop= GetConstructedStructure() - if ( GetUnitTypeId(shop) == ALCHEMIST_LAB ) then - call WoWReforgedAlchemistLab__AddRaceTypesToShop(shop) - endif - set shop=null - return false -endfunction -function WoWReforgedAlchemistLab__TriggerConditionSell takes nothing returns boolean - local unit shop= GetSellingUnit() - local item soldItem= GetSoldItem() - local integer itemTypeId= GetItemTypeId(soldItem) - local integer max= udg_MaxRaces - local integer i= 1 - //call BJDebugMsg("Shop " + GetUnitName(shop) + " sells item " + GetItemName(soldItem)) - if ( GetUnitTypeId(shop) == ALCHEMIST_LAB ) then - loop - exitwhen ( i >= max ) - if ( itemTypeId == udg_RaceTavernItemType[i] ) then - call WoWReforgedAlchemistLab__SetShopRace(shop , i) - - exitwhen ( true ) - endif - set i=i + 1 - endloop - call h__RemoveItem(soldItem) - endif - set soldItem=null - set shop=null - return false -endfunction -function WoWReforgedAlchemistLab__IsRaceTypeAllowed takes player whichPlayer,integer t,integer targetRace returns boolean - if ( not PlayerHasUnlockedRace(whichPlayer , targetRace) ) then - if ( t == RACE_OBJECT_TYPE_TIER_1 ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_2 ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_3 ) then - return false - elseif ( t == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_1_ITEM ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_2_ITEM ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_3_ITEM ) then - return false - endif - endif - return true -endfunction -function TriggerRegisterConvertEvent takes trigger whichTrigger returns nothing - set WoWReforgedAlchemistLab__convertTriggers[WoWReforgedAlchemistLab__convertTriggersCounter]=whichTrigger - set WoWReforgedAlchemistLab__convertTriggersCounter=WoWReforgedAlchemistLab__convertTriggersCounter + 1 -endfunction -function GetTriggerConverter takes nothing returns unit - return WoWReforgedAlchemistLab__triggerConverter -endfunction -function GetTriggerReplacingUnit takes nothing returns unit - return WoWReforgedAlchemistLab__triggerReplacingUnit -endfunction -function GetTriggerReplacingItem takes nothing returns item - return WoWReforgedAlchemistLab__triggerReplacingItem -endfunction -function WoWReforgedAlchemistLab__ExecuteCallbacks takes unit converter,unit replacingUnit,item replacingItem returns nothing - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedAlchemistLab__convertTriggersCounter ) - if ( IsTriggerEnabled(WoWReforgedAlchemistLab__convertTriggers[i]) ) then - set WoWReforgedAlchemistLab__triggerConverter=converter - set WoWReforgedAlchemistLab__triggerReplacingUnit=replacingUnit - set WoWReforgedAlchemistLab__triggerReplacingItem=replacingItem - call ConditionalTriggerExecute(WoWReforgedAlchemistLab__convertTriggers[i]) - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedAlchemistLab__ConvertUnit takes unit caster,unit target,integer targetRace returns nothing - local player owner= GetOwningPlayer(caster) - local integer targetUnitTypeId= MapUnitID(GetUnitTypeId(target) , targetRace , false) - if ( targetUnitTypeId != 0 ) then - if ( WoWReforgedAlchemistLab__IsRaceTypeAllowed(owner , GetRaceObjectType(targetRace , targetUnitTypeId) , targetRace) ) then - if ( targetUnitTypeId != GetUnitTypeId(target) ) then - call ReplaceUnitBJ(target, targetUnitTypeId, bj_UNIT_STATE_METHOD_RELATIVE) - call WoWReforgedAlchemistLab__ExecuteCallbacks(caster , GetLastReplacedUnitBJ() , null) - else - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "Could not convert the target unit.") - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "Conversion is not allowed.") - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "Could not convert the target unit.") - endif - set owner=null -endfunction -function WoWReforgedAlchemistLab__ConvertItem takes unit caster,item target,integer targetRace returns nothing - local player owner= GetOwningPlayer(caster) - local integer targetItemTypeId= MapRaceObjectType(GetItemTypeId(target) , targetRace) - local item whichItem= null - if ( targetItemTypeId != 0 ) then - if ( WoWReforgedAlchemistLab__IsRaceTypeAllowed(owner , GetRaceObjectType(targetRace , targetItemTypeId) , targetRace) ) then - if ( targetItemTypeId != GetItemTypeId(target) ) then - set whichItem=ReplaceItem(target , targetItemTypeId) - call WoWReforgedAlchemistLab__ExecuteCallbacks(caster , null , whichItem) - else - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "Could not convert the target item.") - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "Conversion is not allowed.") - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(owner , "Could not convert the target item.") - endif - set owner=null -endfunction -function WoWReforgedAlchemistLab__TriggerConditionCast takes nothing returns boolean - local unit shop= GetTriggerUnit() - local integer abilityId= GetSpellAbilityId() - local integer targetRace= GetUnitUserData(shop) - local unit targetUnit= GetSpellTargetUnit() - local item targetItem= GetSpellTargetItem() - - if ( abilityId == ABILITY_ID_CONVERT_UNIT or abilityId == ABILITY_ID_CONVERT_ITEM ) then - if ( targetUnit != null ) then - call WoWReforgedAlchemistLab__ConvertUnit(shop , targetUnit , targetRace) - elseif ( targetItem != null ) then - call WoWReforgedAlchemistLab__ConvertItem(shop , targetItem , targetRace) - endif - endif - - set shop=null - set targetUnit=null - set targetItem=null - - return false -endfunction -function WoWReforgedAlchemistLab__ForGroupAddShop takes nothing returns nothing - call WoWReforgedAlchemistLab__AddRaceTypesToShop(GetEnumUnit()) -endfunction -function AddAlchemistLabShops takes nothing returns nothing - local group shops= GetUnitsOfTypeIdAll(ALCHEMIST_LAB) - call ForGroup(shops, function WoWReforgedAlchemistLab__ForGroupAddShop) - call GroupClear(shops) - call DestroyGroup(shops) - set shops=null -endfunction -function WoWReforgedAlchemistLab__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedAlchemistLab__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedAlchemistLab__constructionTrigger, Condition(function WoWReforgedAlchemistLab__TriggerConditionConstructionFinish)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedAlchemistLab__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedAlchemistLab__sellTrigger, Condition(function WoWReforgedAlchemistLab__TriggerConditionSell)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedAlchemistLab__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(WoWReforgedAlchemistLab__castTrigger, Condition(function WoWReforgedAlchemistLab__TriggerConditionCast)) -endfunction -//library WoWReforgedAlchemistLab ends -//library WoWReforgedAltars: -function IsAltar takes integer unitTypeId returns boolean - if ( unitTypeId == FOUNTAIN_OF_LIFE ) then - return true - endif - - return GetObjectRaceType(unitTypeId) == RACE_OBJECT_TYPE_ALTAR -endfunction -function IsAltarFilter takes nothing returns boolean - return IsAltar(GetUnitTypeId(GetFilterUnit())) -endfunction -function WoWReforgedAltars__IsResurrectionStoneFilter takes nothing returns boolean - return (IsResurrectionStone(GetUnitTypeId((GetFilterUnit())))) and ResurrectionStoneHasHeroOfPlayer((LoadInteger(WoWReforgedResurrectionStone__h, GetHandleId((GetFilterUnit())), 0)) , WoWReforgedAltars__filterPlayer) // INLINED!! -endfunction -function SelectNextAltar takes player whichPlayer returns unit - local group altars= CreateGroup() - local group resurrectionStones= CreateGroup() - local unit result= null - call GroupEnumUnitsOfPlayer(altars, whichPlayer, Filter(function IsAltarFilter)) - set WoWReforgedAltars__filterPlayer=whichPlayer - call GroupEnumUnitsInRect(resurrectionStones, GetPlayableMapRect(), Filter(function WoWReforgedAltars__IsResurrectionStoneFilter)) - call GroupAddGroup(resurrectionStones, altars) - set result=GetNextUnitToSelect(altars , whichPlayer) - call GroupClear(altars) - call DestroyGroup(altars) - set altars=null - call GroupClear(resurrectionStones) - call DestroyGroup(resurrectionStones) - set resurrectionStones=null - - if ( result != null ) then - call SelectUnitForPlayerSingle(result, whichPlayer) - call SmartCameraPanToUnit(whichPlayer , result , 0.0) - else - call SimError(whichPlayer , "No altars.") - endif - - return result -endfunction -//library WoWReforgedAltars ends -//library WoWReforgedBuilder: -function EnableBuilder takes unit whichUnit returns nothing - local integer max= 0 - local integer i= 0 - local integer max2= 0 - local integer j= 0 - call EnablePagedButtons(whichUnit) - - call SetPagedButtonsCurrentPageName(whichUnit , "Players") -call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_PLAYER_RED) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! -call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_NEUTRAL_HOSTILE) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! -call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_NEUTRAL_PASSIVE) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - - call AddPagedButtonsSpacersRemaining(whichUnit) - - call SetPagedButtonsCurrentPageName(whichUnit , "Colors") -call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_COLOR_RED) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - call AddPagedButtonsSpacersRemaining(whichUnit) - - call SetPagedButtonsCurrentPageName(whichUnit , "Creeps") - set i=0 - set max=(WoWReforgedRaces___objectTypeCreepsCounter) // INLINED!! - loop - exitwhen ( i >= max ) - if ( (WoWReforgedRaces___objectTypeCreeps[(i)]) != 0 ) then // INLINED!! -call AddPagedButtonsId((whichUnit ) , ( (WoWReforgedRaces___objectTypeCreeps[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - endif - set i=i + 1 - endloop - - call SetPagedButtonsCurrentPageName(whichUnit , "Units") - set max=(udg_MaxRaces) // INLINED!! - loop - exitwhen ( i >= max ) - set max2=RACE_MAX_OBJECT_TYPES - set j=0 - loop - exitwhen ( j >= max2 ) - if ( GetRaceObjectTypeId(i , j) != 0 ) then -call AddPagedButtonsId((whichUnit ) , ( GetRaceObjectTypeId(i , j)) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function WoWReforgedBuilder___GetTargetPlayer takes player whichPlayer returns player - return Player(WoWReforgedBuilder___targetPlayerIndex[GetPlayerId(whichPlayer)]) -endfunction -function WoWReforgedBuilder___TriggerConditionSell takes nothing returns boolean - local unit b= GetSellingUnit() - local integer itemTypeId= GetItemTypeId(GetSoldItem()) - local player owner= GetOwningPlayer(b) - local integer playerId= GetPlayerId(owner) - if ( GetUnitTypeId(b) == BUILDER ) then - if ( itemTypeId == ITEM_TYPE_ID_PLAYER_RED ) then - set WoWReforgedBuilder___targetPlayerIndex[playerId]=0 - elseif ( itemTypeId == ITEM_TYPE_ID_NEUTRAL_HOSTILE ) then - set WoWReforgedBuilder___targetPlayerIndex[playerId]=PLAYER_NEUTRAL_AGGRESSIVE - elseif ( itemTypeId == ITEM_TYPE_ID_NEUTRAL_PASSIVE ) then - set WoWReforgedBuilder___targetPlayerIndex[playerId]=PLAYER_NEUTRAL_PASSIVE - elseif ( itemTypeId == ITEM_TYPE_ID_COLOR_RED ) then - call SetPlayerColor((Player(WoWReforgedBuilder___targetPlayerIndex[GetPlayerId((owner))])), PLAYER_COLOR_RED) // INLINED!! - else - call CreateUnit((Player(WoWReforgedBuilder___targetPlayerIndex[GetPlayerId((owner))])), itemTypeId, GetUnitX(b), GetUnitY(b), GetUnitFacing(b)) // INLINED!! - endif - call h__RemoveItem(GetSoldItem()) - endif - set b=null - set owner=null - return false -endfunction -function WoWReforgedBuilder___TriggerConditionOrder takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == BUILDER ) then - if ( GetIssuedOrderId() == OrderId("smart") or GetIssuedOrderId() == OrderId("move") ) then - call IssuePointOrder(GetTriggerUnit(), "blink", GetOrderPointX(), GetOrderPointY()) - endif - endif - return false -endfunction -function WoWReforgedBuilder___TriggerConditionOrderTarget takes nothing returns boolean - if ( GetUnitTypeId(GetTriggerUnit()) == BUILDER ) then - if ( GetIssuedOrderId() == OrderId("smart") or GetIssuedOrderId() == OrderId("move") ) then - call IssuePointOrder(GetTriggerUnit(), "blink", GetWidgetX(GetOrderTarget()), GetWidgetY(GetOrderTarget())) - endif - endif - return false -endfunction -function WoWReforgedBuilder___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBuilder___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedBuilder___sellTrigger, Condition(function WoWReforgedBuilder___TriggerConditionSell)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBuilder___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) - call TriggerAddCondition(WoWReforgedBuilder___orderTrigger, Condition(function WoWReforgedBuilder___TriggerConditionOrder)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedBuilder___orderTargetTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) - call TriggerAddCondition(WoWReforgedBuilder___orderTargetTrigger, Condition(function WoWReforgedBuilder___TriggerConditionOrderTarget)) -endfunction -//library WoWReforgedBuilder ends -//library WoWReforgedClans: -function GetPlayerClan takes player whichPlayer returns integer - return udg_ClanPlayerClan[GetConvertedPlayerId(whichPlayer)] -endfunction -function PlayerHasClan takes player whichPlayer returns boolean - return (udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))]) != 0 // INLINED!! -endfunction -function GetClanName takes integer clan returns string - return udg_ClanName[clan] -endfunction -function GetClanIcon takes integer clan returns integer - return udg_ClanIcon[clan] -endfunction -function GetClanIconPath takes integer clan returns string - return GetItemTypeIcon((udg_ClanIcon[(clan)])) // INLINED!! -endfunction -function GetClanSound takes integer clan returns sound - return udg_ClanSound[clan] -endfunction -function GetClanRankName takes integer rank returns string - if ( rank == udg_ClanRankLeader ) then - return "Leader" - elseif ( rank == udg_ClanRankCaptain ) then - return "Captain" - else - return "Member" - endif -endfunction -function WoWReforgedClans___TimerFunctionClanResources takes nothing returns nothing - local integer i= 0 - local integer j= 0 - local integer gold= 0 - local integer lumber= 0 - loop - exitwhen ( i == udg_ClanCounter ) - if ( udg_ClanAIPlayer[i] != null ) then - set gold=IMinBJ(100, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_GOLD)) - set lumber=IMinBJ(100, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_LUMBER)) - set j=0 - loop - exitwhen ( j == bj_MAX_PLAYERS ) - if ( IsPlayerInForce(Player(j), udg_ClanPlayers[i]) ) then - if ( gold > 0 ) then - call SetPlayerStateBJ(Player(j), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(j), PLAYER_STATE_RESOURCE_GOLD) + gold / CountPlayersInForceBJ(udg_ClanPlayers[i])) - endif - if ( lumber > 0 ) then - call SetPlayerStateBJ(Player(j), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(Player(j), PLAYER_STATE_RESOURCE_LUMBER) + lumber / CountPlayersInForceBJ(udg_ClanPlayers[i])) - endif - if ( udg_ClanShowAIResourcesMessage[GetConvertedPlayerId(Player(j))] and gold > 0 or lumber > 0 ) then - call h__DisplayTextToPlayer(Player(j), 0, 0, GetPlayerNameColored(udg_ClanAIPlayer[i]) + " gave your clan " + I2S(gold) + " gold and " + I2S(lumber) + " lumber which has been split amongst all online clan players. Enter \"-clanaioff\" to hide these messages.") - endif - endif - set j=j + 1 - endloop - // do not remove the resources to limit the player - //if (gold > 0) then - //call SetPlayerStateBJ(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_GOLD) - gold) - //endif - //if (lumber > 0) then - //call SetPlayerStateBJ(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_LUMBER) - lumber) - //endif - endif - set i=i + 1 - endloop -endfunction -// Chooses one AI player to share gold and lumber with all clan players every X seconds. -function PickClanAIPlayer takes integer clan returns player - local player result= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( Player(i) != udg_BossesPlayer and Player(i) != udg_TheBurningLegion and Player(i) != udg_Gaia and GetPlayerController(Player(i)) == MAP_CONTROL_COMPUTER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then - if ( result == null ) then - set result=Player(i) - // prefer warlords due to more gold and lumber - elseif ( result != null and udg_PlayerIsWarlord[GetConvertedPlayerId(Player(i))] and not udg_PlayerIsWarlord[GetConvertedPlayerId(result)] ) then - set result=Player(i) - endif - endif - set i=i + 1 - endloop - if ( result != null ) then - set udg_ClanAIPlayer[clan]=result - call TimerStart(WoWReforgedClans___clanResourceTimer, 300.0, true, function WoWReforgedClans___TimerFunctionClanResources) - set i=0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then - set udg_ClanShowAIResourcesMessage[GetConvertedPlayerId(Player(i))]=true - endif - set i=i + 1 - endloop - endif - return result -endfunction -function GetClanPlayerNames takes integer clan returns string - local string result= "" - local integer counter= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then - if ( counter > 0 ) then - set result=result + ", " - endif - set result=result + GetPlayerNameColored(Player(i)) - set counter=counter + 1 - endif - set i=i + 1 - endloop - return result -endfunction -function GetClansInfo takes nothing returns string - local string result= "Clans:\n" - local integer i= 1 - loop - exitwhen ( i >= udg_ClanCounter ) - set result=result + "- " + udg_ClanName[i] + " (" + I2S(CountPlayersInForceBJ(udg_ClanPlayers[i])) + " player(s): " + GetClanPlayerNames(i) + ")\n" - set i=i + 1 - endloop - return result -endfunction -//library WoWReforgedClans ends -//library WoWReforgedCreeps: -function CompareCreeps takes nothing returns nothing - local group g= CreateGroup() - local unit u= null - local integer max= (WoWReforgedRaces___objectTypeCreepsCounter) // INLINED!! - local integer i= 0 - local integer j= 0 - local integer max2= 0 - local boolean found= false - call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_AGGRESSIVE), null) - loop - exitwhen ( i >= max ) - if ( not IsCritter((WoWReforgedRaces___objectTypeCreeps[(i)])) ) then // INLINED!! - set found=false - set j=0 - set max2=BlzGroupGetSize(g) - loop - exitwhen ( j >= max2 or found ) - set u=BlzGroupUnitAt(g, j) - if ( (WoWReforgedRaces___objectTypeCreeps[(i)]) == GetUnitTypeId(u) ) then // INLINED!! - set found=true - endif - set u=null - set j=j + 1 - endloop - if ( not found ) then - call h__BJDebugMsg("Missing creep type " + GetObjectName((WoWReforgedRaces___objectTypeCreeps[(i)]))) // INLINED!! - endif - endif - set i=i + 1 - endloop - - // critters - call GroupClear(g) - call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), null) - set i=0 - loop - exitwhen ( i >= max ) - if ( IsCritter((WoWReforgedRaces___objectTypeCreeps[(i)])) ) then // INLINED!! - set found=false - set j=0 - set max2=BlzGroupGetSize(g) - loop - exitwhen ( j >= max2 or found ) - set u=BlzGroupUnitAt(g, j) - if ( (WoWReforgedRaces___objectTypeCreeps[(i)]) == GetUnitTypeId(u) ) then // INLINED!! - set found=true - endif - set u=null - set j=j + 1 - endloop - if ( not found ) then - call h__BJDebugMsg("Missing critter type " + GetObjectName((WoWReforgedRaces___objectTypeCreeps[(i)]))) // INLINED!! - endif - endif - set i=i + 1 - endloop - call GroupClear(g) - - call DestroyGroup(g) - set g=null -endfunction -//library WoWReforgedCreeps ends -//library WoWReforgedRacesLimits: -function SetRacesLimits takes integer housingLimit,integer towerLimit returns nothing - local integer max= (udg_MaxRaces) // INLINED!! - local integer i= 1 - loop - exitwhen ( i == max ) - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_HOUSING) != 0 ) then - call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_HOUSING) , housingLimit) - endif - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SCOUT_TOWER) != 0 ) then - call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SCOUT_TOWER) , towerLimit) - endif - - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_GUARD_TOWER) != 0 ) then - call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_GUARD_TOWER) , towerLimit) - endif - - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CANNON_TOWER) != 0 ) then - call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CANNON_TOWER) , towerLimit) - endif - - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_ARCANE_TOWER) != 0 ) then - call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_ARCANE_TOWER) , towerLimit) - endif - - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING) != 0 ) then - call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING) , 1) - endif - - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2) != 0 ) then - call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2) , 1) - endif - set i=i + 1 - endloop -endfunction -function AddRacesLimits takes nothing returns nothing - call SetRacesLimits(udg_HousingLimit , udg_TowerLimit) -endfunction -function ResetRacesLimits takes nothing returns nothing - call SetRacesLimits(- 1 , - 1) -endfunction -//library WoWReforgedRacesLimits ends -//library WoWReforgedRacesTavern: -function WoWReforgedRacesTavern___AddRacesTavern takes unit tavern returns nothing - local integer i= 1 - call EnablePagedButtons(tavern) - call SetPagedButtonsSlotsPerPage(tavern , 10) - -call AddPagedButtonsId((tavern ) , ( ITEM_TYPE_RANDOM_RACE) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - - set i=1 // skip udg_RaceNone - loop - exitwhen ( i >= (udg_MaxRaces) ) // INLINED!! -call AddPagedButtonsId((tavern ) , ( udg_RaceTavernItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop - call SetPagedButtonsPage(tavern , 0) -endfunction -function WoWReforgedRacesTavern___ForGroupAddRacesTavern takes nothing returns nothing - call WoWReforgedRacesTavern___AddRacesTavern(GetEnumUnit()) -endfunction -function WoWReforgedRacesTavern___TimerFunctionAddRacesTaverns takes nothing returns nothing - call ForGroupBJ(GetUnitsOfTypeIdAll(RACES_TAVERN), function WoWReforgedRacesTavern___ForGroupAddRacesTavern) - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function SelectRandomRace takes unit buyingUnit,unit tavern returns nothing - local player owner= GetOwningPlayer(buyingUnit) - local integer array availableIds - local integer availableIdsCounter= 0 - local integer id= 0 - local integer random= 0 - local integer page= 0 - local integer index= 0 - local integer i= 1 - local integer max= (udg_MaxRaces) // INLINED!! - loop - exitwhen ( i >= max ) - set id=udg_RaceTavernItemType[i] - if ( PlayerCanPickRaceEx(owner , id) ) then - set availableIds[availableIdsCounter]=id - set availableIdsCounter=availableIdsCounter + 1 - endif - set i=i + 1 - endloop - - set random=GetRandomInt(0, availableIdsCounter - 1) - set id=availableIds[random] - //call BJDebugMsg("Selected random " + GetObjectName(id)) - set index=GetPagedButtonIndex(tavern , id) - //call BJDebugMsg("index " + I2S(index)) - set page=GetPagedButtonsPageByIndex(tavern , index) - //call BJDebugMsg("page " + I2S(page)) - call SetPagedButtonsPage(tavern , page) - call IssueNeutralImmediateOrderById(owner, tavern, id) - - set owner=null -endfunction -function WoWReforgedRacesTavern___TriggerConditionSellItem takes nothing returns boolean - if ( GetItemTypeId(GetSoldItem()) == ITEM_TYPE_RANDOM_RACE ) then - call SelectRandomRace(GetBuyingUnit() , GetTriggerUnit()) - call h__RemoveItem(GetSoldItem()) - endif - return false -endfunction -function WoWReforgedRacesTavern___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedRacesTavern___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedRacesTavern___sellTrigger, Condition(function WoWReforgedRacesTavern___TriggerConditionSellItem)) - - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedRacesTavern___TimerFunctionAddRacesTaverns) -endfunction -//library WoWReforgedRacesTavern ends -//library WoWReforgedRecreateHeroItems: -function WoWReforgedRecreateHeroItems___UnitAddItemByIdIfNotInInventory takes unit hero,integer itemTypeId returns item - if ( not UnitHasItemOfTypeBJ(hero, itemTypeId) ) then - return UnitAddItemById(hero, itemTypeId) - endif - return null -endfunction -function RecreateHeroItems takes player whichPlayer returns nothing - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - if ( (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) != udg_ProfessionNone ) then // INLINED!! - call WoWReforgedRecreateHeroItems___UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetProfessionBookItemTypeId((udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]))) // INLINED!! - endif - if ( (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) != udg_ProfessionNone and (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! - call WoWReforgedRecreateHeroItems___UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetProfessionBookItemTypeId((udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]))) // INLINED!! - endif - if ( (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) != udg_ProfessionNone and (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) and (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! - call WoWReforgedRecreateHeroItems___UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetProfessionBookItemTypeId((udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]))) // INLINED!! - endif - if ( (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) != udg_RaceNone ) then // INLINED!! - call WoWReforgedRecreateHeroItems___UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetRaceObjectTypeId((udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) , RACE_OBJECT_TYPE_SCEPTER_ITEM)) // INLINED!! - endif - if ( (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) != udg_RaceNone and (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! - call WoWReforgedRecreateHeroItems___UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetRaceObjectTypeId((udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) , RACE_OBJECT_TYPE_SCEPTER_ITEM)) // INLINED!! - endif - if ( (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) != udg_RaceNone and (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) and (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! - call WoWReforgedRecreateHeroItems___UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetRaceObjectTypeId((udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) , RACE_OBJECT_TYPE_SCEPTER_ITEM)) // INLINED!! - endif - call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Recreated profession and race items.") - else - call SimError(whichPlayer , "Hero 1 must be picked before.") - endif -endfunction -//library WoWReforgedRecreateHeroItems ends -//library WoWReforgedResources: -function GetMineTypeIndex takes integer unitTypeId returns integer - local integer i= 0 - loop - exitwhen ( i == WoWReforgedResources___maxMines ) - if ( WoWReforgedResources___mineTypes[i] == unitTypeId ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function AddWoWReforgedReturnBuilding takes unit whichUnit returns nothing - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - call GroupAddUnit(Resources___returnBuildings, (whichUnit)) // INLINED!! - loop - exitwhen ( i == max ) - call SetUnitReturnResource(whichUnit , (s__Resource_resources[(i)]) , true) // INLINED!! - set i=i + 1 - endloop -endfunction -function AddWoWReforgedOilShip takes unit producer,unit worker returns nothing - call AddWorker(worker) - call AddResourceToWorker(worker , udg_ResourceOil , 'A1PL' , "harvest" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 200 , 20 , "gold") - if ( producer != null ) then - call ReorderWorkerToMineRally(producer , worker) - endif -endfunction -function AddWoWReforgedWorker takes unit producer,unit worker returns nothing - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - call AddWorker(worker) - loop - exitwhen ( i == max ) - if ( not IsStandardResource((s__Resource_resources[(i)])) ) then // INLINED!! - call AddResourceToWorker(worker , (s__Resource_resources[(i)]) , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 10 , 20 , "gold") // INLINED!! - endif - set i=i + 1 - endloop - if ( producer != null ) then - call ReorderWorkerToMineRally(producer , worker) - endif -endfunction -function AddWoWReforgedFaithWorker takes unit producer,unit worker returns nothing - call AddWorker(worker) - call AddResourceToWorker(worker , udg_ResourceFavor , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") - if ( producer != null ) then - call ReorderWorkerToMineRally(producer , worker) - endif -endfunction -function AddWoWReforgedFaithMine takes unit mine returns nothing - call AddMineEx(mine , udg_ResourceFavor , 200) -endfunction -function AddRandomMine takes integer buildingTypeId,integer resource,integer startAmount returns integer - local integer index= WoWReforgedResources___maxMines - set WoWReforgedResources___maxMines=WoWReforgedResources___maxMines + 1 - set WoWReforgedResources___mineTypes[index]=buildingTypeId - set WoWReforgedResources___mineResource[index]=resource - set WoWReforgedResources___mineStartAmount[index]=startAmount - return index -endfunction -function AddRandomWaterMine takes integer buildingTypeId,integer resource,integer startAmount returns integer - local integer index= WoWReforgedResources___maxWaterMines - set WoWReforgedResources___maxWaterMines=WoWReforgedResources___maxWaterMines + 1 - set WoWReforgedResources___waterMineTypes[index]=buildingTypeId - set WoWReforgedResources___waterMineResource[index]=resource - set WoWReforgedResources___waterMineStartAmount[index]=startAmount - return index -endfunction -function WoWReforgedResources___FilterIsFishSchool takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == FISH_SCHOOL -endfunction -function WoWReforgedResources___ForGroupAddFishSchool takes nothing returns nothing - call AddMineEx(GetEnumUnit() , udg_ResourceMeat , 50000) -endfunction -function InitFishSchools takes nothing returns nothing - local group fishSchools= CreateGroup() - call GroupEnumUnitsInRect(fishSchools, GetPlayableMapRect(), Filter(function WoWReforgedResources___FilterIsFishSchool)) - call ForGroup(fishSchools, function WoWReforgedResources___ForGroupAddFishSchool) - call GroupClear(fishSchools) - call DestroyGroup(fishSchools) - set fishSchools=null -endfunction -function WoWReforgedResources___FilterIsBerryBushes takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == BERRY_BUSHES -endfunction -function WoWReforgedResources___ForGroupAddBerryBushes takes nothing returns nothing - call AddMineEx(GetEnumUnit() , udg_ResourceFruits , 500) -endfunction -function InitBerryBushes takes nothing returns nothing - local group berryBushes= CreateGroup() - call GroupEnumUnitsInRect(berryBushes, GetPlayableMapRect(), Filter(function WoWReforgedResources___FilterIsBerryBushes)) - call ForGroup(berryBushes, function WoWReforgedResources___ForGroupAddBerryBushes) - call GroupClear(berryBushes) - call DestroyGroup(berryBushes) - set berryBushes=null -endfunction -// Call after initializing the global variables. -function InitRandomMines takes nothing returns nothing - call AddRandomMine(GEMSTONES_MINE , udg_ResourceGemstones , 500) - call AddRandomMine(ORE_MINE , udg_ResourceIron , 5000) - call AddRandomMine(WELL , udg_ResourceWater , 5000) - call AddRandomMine(OIL_PLATFORM , udg_ResourceOil , 1000) - call AddRandomMine(FOOD_FARM , udg_ResourceGrain , 5000) - call AddRandomMine(POWER_CRYSTAL_MINE , udg_ResourceElectricity , 2000) - call AddRandomMine(MONUMENT , udg_ResourceFavor , 2000) - call AddRandomMine(FRUIT_STAND , udg_ResourceFruits , 5000) - call AddRandomMine(ROCKS_MINE , udg_ResourceRock , 2000) - call AddRandomMine(ARGUNITE_MINE , udg_ResourceArgunite , 2000) - call AddRandomMine(FEL_MINE , udg_ResourceFel , 2000) - call AddRandomWaterMine(WATER_OIL_PLATFORM , udg_ResourceOil , 20000) -endfunction -function WoWReforgedResources___FilterIsRandomMine takes nothing returns boolean - return GetMineTypeIndex(GetUnitTypeId(GetFilterUnit())) != - 1 -endfunction -function WoWReforgedResources___ForGroupRemoveUnit takes nothing returns nothing - call h__RemoveUnit(GetEnumUnit()) -endfunction -function RemoveRandomMinesAtAIStartLocation takes integer computerStartLocation returns nothing - local real x= GetRectCenterX(udg_TownHallLocation[computerStartLocation]) - local real y= GetRectCenterY(udg_TownHallLocation[computerStartLocation]) - local group mines= CreateGroup() - call GroupEnumUnitsInRange(mines, x, y, 4096.0, Filter(function WoWReforgedResources___FilterIsRandomMine)) - call ForGroup(mines, function WoWReforgedResources___ForGroupRemoveUnit) - call GroupClear(mines) - call DestroyGroup(mines) - set mines=null -endfunction -function CreateMine takes unit source,integer index returns unit - local real x= GetUnitX(source) - local real y= GetUnitY(source) - local unit result= ReplaceUnitBJ(source, WoWReforgedResources___mineTypes[index], bj_UNIT_STATE_METHOD_MAXIMUM) - call SetUnitOwner(result, Player(PLAYER_NEUTRAL_PASSIVE), true) - call SetUnitX(result, x) - call SetUnitY(result, y) - - call AddMineEx(result , WoWReforgedResources___mineResource[index] , WoWReforgedResources___mineStartAmount[index]) - - return result -endfunction -function FillMine takes unit source returns nothing - local integer index= GetMineTypeIndex(GetUnitTypeId(source)) - if ( index != - 1 ) then - call CreateMine(source , index) - endif -endfunction -function WoWReforgedResources___ReplaceMineEnumUnit takes nothing returns nothing - call FillMine(GetEnumUnit()) -endfunction -function FillAllMines takes nothing returns nothing - local group g= CreateGroup() - call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), Filter(function WoWReforgedResources___FilterIsRandomMine)) - call ForGroup(g, function WoWReforgedResources___ReplaceMineEnumUnit) - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function CreateRandomMine takes unit source returns unit - local integer random= GetRandomInt(0, WoWReforgedResources___maxMines - 1) - local real x= GetUnitX(source) - local real y= GetUnitY(source) - local unit result= ReplaceUnitBJ(source, WoWReforgedResources___mineTypes[random], bj_UNIT_STATE_METHOD_MAXIMUM) - call SetUnitOwner(result, Player(PLAYER_NEUTRAL_PASSIVE), true) - call SetUnitX(result, x) - call SetUnitY(result, y) - - call AddMineEx(result , WoWReforgedResources___mineResource[random] , WoWReforgedResources___mineStartAmount[random]) - - return result -endfunction -function CreateRandomWaterMine takes unit source returns unit - local integer random= GetRandomInt(0, WoWReforgedResources___maxWaterMines - 1) - local real x= GetUnitX(source) - local real y= GetUnitY(source) - local unit result= ReplaceUnitBJ(source, WoWReforgedResources___waterMineTypes[random], bj_UNIT_STATE_METHOD_MAXIMUM) - call SetUnitOwner(result, Player(PLAYER_NEUTRAL_PASSIVE), true) - call SetUnitX(result, x) - call SetUnitY(result, y) - - call AddMineEx(result , WoWReforgedResources___waterMineResource[random] , WoWReforgedResources___waterMineStartAmount[random]) - - return result -endfunction -function GetRandomResourceExceptFood takes nothing returns integer - local integer r - local integer counter= 0 - local integer array resources - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - loop - exitwhen ( i == max ) - set r=(s__Resource_resources[(i)]) // INLINED!! - if ( r != Resources_FOOD and r != Resources_FOOD_MAX ) then - set resources[counter]=r - set counter=counter + 1 - endif - set i=i + 1 - endloop - - return resources[GetRandomInt(0, counter - 1)] -endfunction -function CreateRandomResources takes unit hero returns nothing - if ( GetRandomInt(0, 1) == 0 ) then - call CustomBounty(hero , GetRandomResourceExceptFood() , GetRandomInt(0, 50)) - endif -endfunction -function RewardFlotsam takes unit flotsam,unit killer returns nothing - if ( GetRandomInt(0, 1) == 0 ) then - call CustomBounty(flotsam , GetRandomResourceExceptFood() , GetRandomInt(5, 50)) - endif -endfunction -function UseMeatItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceMeat , 30) -endfunction -function UseFishItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceMeat , 30) -endfunction -function UseBananaItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceFruits , 30) -endfunction -function UseLemonItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceFruits , 30) -endfunction -function UseOrangeItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceFruits , 30) -endfunction -function UseGarlicItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceFruits , 30) -endfunction -function UsePumpkinItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceFruits , 30) -endfunction -function UseAppleItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceFruits , 30) -endfunction -function UseBundleOfWheatItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceGrain , 30) -endfunction -function UseBlackPowderItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceBlackPowder , 12) -endfunction -function UseRockItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceRock , 25) -endfunction -function UseMilkItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceMilk , 30) -endfunction -function UseWoolItem takes unit hero returns nothing - call CustomBounty(hero , udg_ResourceWool , 30) -endfunction -function AddFishingBoat takes unit producer,unit worker returns nothing - call AddWorker(worker) - call AddResourceToWorker(worker , udg_ResourceMeat , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 200 , 20 , "gold") - if ( producer != null ) then - call ReorderWorkerToMineRally(producer , worker) - endif -endfunction -function AddFarmhand takes unit producer,unit worker returns nothing - call AddWorker(worker) - call AddResourceToWorker(worker , udg_ResourceMeat , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") - call AddResourceToWorker(worker , udg_ResourceGrain , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") - call AddResourceToWorker(worker , udg_ResourceWater , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") - if ( producer != null ) then - call ReorderWorkerToMineRally(producer , worker) - endif -endfunction -function AddFarmerSheep takes unit farm,unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceMeat , 30) -endfunction -function AddFarmerChicken takes unit farm,unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceMeat , 10) -endfunction -function AddFarmerCow takes unit farm,unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceMeat , 100) -endfunction -function AddFarmerPig takes unit farm,unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceMeat , 60) -endfunction -function AddFarm takes unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceGrain , 200) - call SetMineExplodesOnDeath(whichUnit , false) -endfunction -function AddWheatField takes unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceGrain , 300) -endfunction -function AddCowshed takes unit whichUnit returns nothing - call AddLoadedMine(whichUnit , udg_ResourceMilk , 800 , 5) - call SetLoadedMineAllowedWorkerUnitTypeId(whichUnit , COW , true) - call SetMineExplodesOnDeath(whichUnit , true) -endfunction -function AddSheepfold takes unit whichUnit returns nothing - call AddLoadedMine(whichUnit , udg_ResourceWool , 800 , 5) - call SetLoadedMineAllowedWorkerUnitTypeId(whichUnit , SHEEP , true) - call SetMineExplodesOnDeath(whichUnit , true) -endfunction -function AddWaterSupply takes unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceWater , 500) - call SetMineExplodesOnDeath(whichUnit , false) -endfunction -function AddGranary takes unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceGrain , 400) - call SetMineExplodesOnDeath(whichUnit , false) -endfunction -function AddWindMill takes unit whichUnit returns nothing - call AddMineEx(whichUnit , udg_ResourceGrain , 600) - call SetMineExplodesOnDeath(whichUnit , false) -endfunction -function AddOilBoat takes unit producer,unit worker returns nothing - call AddWorker(worker) - call AddResourceToWorker(worker , udg_ResourceOil , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 100 , 100 , "gold") - if ( producer != null ) then - call ReorderWorkerToMineRally(producer , worker) - endif -endfunction -function AddWoWReforgedResource takes nothing returns integer - set udg_TmpInteger=(s__Resource_create((udg_TmpString))) // INLINED!! - set s__Resource_goldExchangeRate[(udg_TmpInteger )]=(( udg_TmpReal)*1.0) // INLINED!! - set s__Resource_icon[(udg_TmpInteger )]=( udg_TmpIcon) // INLINED!! - set s__Resource_iconAtt[(udg_TmpInteger )]=( udg_TmpIcon2) // INLINED!! - set s__Resource_description[(udg_TmpInteger )]=( udg_TmpString2) // INLINED!! - set s__Resource_red[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! - set s__Resource_green[(udg_TmpInteger )]=( udg_TmpInteger3) // INLINED!! - set s__Resource_blue[(udg_TmpInteger )]=( udg_TmpInteger4) // INLINED!! - - return udg_TmpInteger -endfunction -function IsSellableResource takes integer index returns boolean - return index >= 0 and index < (s__Resource_resourcesCount) and (s__Resource_resources[(index)]) != Resources_FOOD and (s__Resource_resources[(index)]) != Resources_FOOD_MAX // INLINED!! -endfunction -function ShowResourceInfo takes player whichPlayer returns nothing - local string msg= "" - local group selected= GetUnitsSelectedAll(whichPlayer) - local unit first= null - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - local integer r= 0 - set first=FirstOfGroup(selected) - if ( first != null ) then - loop - exitwhen ( i == max ) - set r=(s__Resource_resources[(i)]) // INLINED!! - if ( (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) > 0 or (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! - if ( (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! - if ( not (IsUnitInGroup((first), Resources___mines)) ) then // INLINED!! - if ( msg != "" ) then - set msg=msg + ", " - endif - set msg=msg + "Max " + (s__Resource_name[(r)]) + ": " + I2S((LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX)))) // INLINED!! - endif - endif - if ( (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! - if ( msg != "" ) then - set msg=msg + ", " - endif - set msg=msg + "Carried " + (s__Resource_name[(r)]) + ": " + I2S((LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX)))) // INLINED!! - endif - if ( not (IsUnitInGroup((first), Resources___mines)) and (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE_PER_HIT , Resources___KEY_MAX))) > 0 ) then // INLINED!! - if ( msg != "" ) then - set msg=msg + ", " - endif - - set msg=msg + "Per Hit " + (s__Resource_name[(r)]) + ": " + I2S((LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE_PER_HIT , Resources___KEY_MAX)))) // INLINED!! - endif - endif - if ( (LoadBoolean(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RETURN_RESOURCE , Resources___KEY_MAX))) ) then // INLINED!! - if ( msg != "" ) then - set msg=msg + ", " - endif - - set msg=msg + "Allows returning " + (s__Resource_name[(r)]) // INLINED!! - endif - set i=i + 1 - endloop - if ( msg == "" ) then - set msg="No resources." - endif - call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, msg) - set first=null - else - call SimError(whichPlayer , "Empty selection.") - endif - call GroupClear(selected) - call DestroyGroup(selected) - set selected=null -endfunction -function SellAllResources takes player whichPlayer returns nothing - local integer r= 0 - local integer gold= 0 - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - loop - exitwhen ( i == max ) - set r=(s__Resource_resources[(i)]) // INLINED!! - if ( r != Resources_GOLD and r != Resources_LUMBER and r != Resources_FOOD and r != Resources_FOOD_MAX and (s__Resource_goldExchangeRate[(r)]) > 0.0 and GetPlayerResource(whichPlayer , r) > 0 ) then // INLINED!! - set gold=gold + ExchangePlayerResource(whichPlayer , r , Resources_GOLD , GetPlayerResource(whichPlayer , r)) - endif - set i=i + 1 - endloop - call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Sold all resources for " + I2S(gold) + " gold.") -endfunction -function SellAllLumber takes player whichPlayer returns nothing - local integer gold= 0 - if ( (s__Resource_goldExchangeRate[(Resources_LUMBER)]) > 0.0 and GetPlayerResource(whichPlayer , Resources_LUMBER) > 0 ) then // INLINED!! - set gold=ExchangePlayerResource(whichPlayer , Resources_LUMBER , Resources_GOLD , GetPlayerResource(whichPlayer , Resources_LUMBER)) - endif - call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Sold all lumber for " + I2S(gold) + " gold.") -endfunction -function AddNeutralBuildingMines takes nothing returns nothing - local integer i= 0 - local integer max= WoWReforgedResources___maxMines - loop - exitwhen ( i == max ) - call AddNeutralUnit(WoWReforgedResources___mineTypes[i]) - set i=i + 1 - endloop - set i=0 - set max=WoWReforgedResources___maxWaterMines - loop - exitwhen ( i == max ) - call AddNeutralUnit(WoWReforgedResources___waterMineTypes[i]) - set i=i + 1 - endloop -endfunction -//library WoWReforgedResources ends -//library WoWReforgedSaddle: -function Saddle takes unit mount returns boolean - local boolean result= false - local group cargo= (s__UnitEventEx__Cargo_copyGroup((GetUnitUserData(((mount)))))) // INLINED!! - local integer i= 0 - local integer max= BlzGroupGetSize(cargo) - loop - exitwhen ( i == max or result ) - if ( UnitHasItemOfTypeBJ(BlzGroupUnitAt(cargo, i), WoWReforgedSaddle_ITEM_TYPE_ID) ) then - set result=true - endif - set i=i + 1 - endloop - - if ( result ) then - if ( GetUnitAbilityLevel(mount, WoWReforgedSaddle_ABILITY_ID) == 0 ) then - call UnitAddAbility(mount, WoWReforgedSaddle_ABILITY_ID) - call sc__NewBonusUtils_linkBuff((mount ) , ( BONUS_ATTACK_SPEED ) , (( 0.3 )*1.0) , ( WoWReforgedSaddle_BUFF_ID) , false) // INLINED!! - call sc__NewBonusUtils_linkBuff((mount ) , ( BONUS_MOVEMENT_SPEED ) , (( 150.0 )*1.0) , ( WoWReforgedSaddle_BUFF_ID) , false) // INLINED!! - endif - else - call UnitRemoveAbility(mount, WoWReforgedSaddle_ABILITY_ID) - endif - - call GroupClear(cargo) - call DestroyGroup(cargo) - set cargo=null - - return result -endfunction -function WoWReforgedSaddle__Load takes nothing returns nothing - if ( (WoWReforgedMounts__GetMountTypeByUnitTypeId((GetUnitTypeId((UnitEventEx__eventOther)))) != 0) ) then // INLINED!! - call Saddle((UnitEventEx__eventOther)) // INLINED!! - endif -endfunction -function WoWReforgedSaddle__Unload takes nothing returns nothing - if ( (WoWReforgedMounts__GetMountTypeByUnitTypeId((GetUnitTypeId((UnitEventEx__eventOther)))) != 0) ) then // INLINED!! - call Saddle((UnitEventEx__eventOther)) // INLINED!! - endif -endfunction -function WoWReforgedSaddle__Init takes nothing returns nothing -call RegisterIndexNativeEvent(bj_MAX_PLAYER_SLOTS , (EVENT_ON_CARGO_LOAD ) , ( function WoWReforgedSaddle__Load)) // INLINED!! -call RegisterIndexNativeEvent(bj_MAX_PLAYER_SLOTS , (EVENT_ON_CARGO_UNLOAD ) , ( function WoWReforgedSaddle__Unload)) // INLINED!! -endfunction -//library WoWReforgedSaddle ends -//library WoWReforgedSceptersShop: -function AddSceptersShop takes unit shop returns nothing - local integer i= 0 - local integer max= (udg_MaxRaces) // INLINED!! - call EnablePagedButtons(shop) - loop - exitwhen ( i == max ) -call AddPagedButtonsId((shop ) , ( udg_RaceItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop -endfunction -function WoWReforgedSceptersShop__FilterIsSceptersShop takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == SCEPTERS_SHOP -endfunction -function WoWReforgedSceptersShop__ForGroupAddSceptersShop takes nothing returns nothing - call AddSceptersShop(GetEnumUnit()) -endfunction -function AddAllSceptersShops takes nothing returns nothing - local group shops= CreateGroup() - call GroupEnumUnitsInRect(shops, GetPlayableMapRect(), Filter(function WoWReforgedSceptersShop__FilterIsSceptersShop)) - call ForGroup(shops, function WoWReforgedSceptersShop__ForGroupAddSceptersShop) - call GroupClear(shops) - call DestroyGroup(shops) - set shops=null -endfunction -function WoWReforgedSceptersShop__TimerFunctionAddAllSceptersShop takes nothing returns nothing - call AddAllSceptersShops() - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function WoWReforgedSceptersShop__Init takes nothing returns nothing - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedSceptersShop__TimerFunctionAddAllSceptersShop) -endfunction -//library WoWReforgedSceptersShop ends -//library WoWReforgedThievesGuild: -function GetThiefStockUpdateTimerHandleId takes nothing returns integer - return GetHandleId(WoWReforgedThievesGuild__stockUpdateTimer) -endfunction -//=========================================================================== -// Find a sellable item of the given type and level, and then add it. -// -function WoWReforgedThievesGuild__UpdateEachStockBuildingEnum takes nothing returns nothing - local integer iteration= 0 - local integer pickedItemId - loop - set pickedItemId=ChooseRandomItemEx(bj_stockPickedItemType, bj_stockPickedItemLevel) - exitwhen IsItemIdSellable(pickedItemId) - // If we get hung up on an entire class/level combo of unsellable - // items, or a very unlucky series of random numbers, give up. - set iteration=iteration + 1 - if ( iteration > bj_STOCK_MAX_ITERATIONS ) then - return - endif - endloop - call AddItemToStock(GetEnumUnit(), pickedItemId, 1, 1) -endfunction -//=========================================================================== -function WoWReforgedThievesGuild__UpdateEachStockBuilding takes itemtype iType,integer iLevel returns nothing - set bj_stockPickedItemType=iType - set bj_stockPickedItemLevel=iLevel - call ForGroup(WoWReforgedThievesGuild__thievesGuilds, function WoWReforgedThievesGuild__UpdateEachStockBuildingEnum) -endfunction -//=========================================================================== -// Update stock inventory. -// -function WoWReforgedThievesGuild__PerformStockUpdates takes nothing returns nothing - local integer pickedItemId - local itemtype pickedItemType - local integer pickedItemLevel= 0 - local integer allowedCombinations= 0 - local integer iLevel - // Give each type/level combination a chance of being picked. - set iLevel=1 - loop - if ( bj_stockAllowedPermanent[iLevel] ) then - set allowedCombinations=allowedCombinations + 1 - if ( GetRandomInt(1, allowedCombinations) == 1 ) then - set pickedItemType=ITEM_TYPE_PERMANENT - set pickedItemLevel=iLevel - endif - endif - if ( bj_stockAllowedCharged[iLevel] ) then - set allowedCombinations=allowedCombinations + 1 - if ( GetRandomInt(1, allowedCombinations) == 1 ) then - set pickedItemType=ITEM_TYPE_CHARGED - set pickedItemLevel=iLevel - endif - endif - if ( bj_stockAllowedArtifact[iLevel] ) then - set allowedCombinations=allowedCombinations + 1 - if ( GetRandomInt(1, allowedCombinations) == 1 ) then - set pickedItemType=ITEM_TYPE_ARTIFACT - set pickedItemLevel=iLevel - endif - endif - set iLevel=iLevel + 1 - exitwhen iLevel > bj_MAX_ITEM_LEVEL - endloop - // Make sure we found a valid item type to add. - if ( allowedCombinations == 0 ) then - return - endif - call WoWReforgedThievesGuild__UpdateEachStockBuilding(pickedItemType , pickedItemLevel) -endfunction -//=========================================================================== -// Perform the first update, and then arrange future updates. -// -function WoWReforgedThievesGuild__StartStockUpdates takes nothing returns nothing - call WoWReforgedThievesGuild__PerformStockUpdates() - call TimerStart(WoWReforgedThievesGuild__stockUpdateTimer, bj_STOCK_RESTOCK_INTERVAL, true, function WoWReforgedThievesGuild__PerformStockUpdates) -endfunction -function IsThievesGuild takes integer unitTypeId returns boolean - return unitTypeId == THIEVES_GUILD_THIEF or unitTypeId == THIEVES_GUILD or unitTypeId == BANDIT_THIEVES_GUILD -endfunction -function IsUnitThievesGuild takes unit whichUnit returns boolean - return IsThievesGuild(GetUnitTypeId(whichUnit)) -endfunction -function WoWReforgedThievesGuild__IsValidUnit takes player previousOwner,unit whichUnit returns boolean - local integer unitTypeId= GetUnitTypeId(whichUnit) - if ( previousOwner != Player(PLAYER_NEUTRAL_AGGRESSIVE) ) then - return false - elseif ( IsUnitType(whichUnit, UNIT_TYPE_HERO) ) then - return false - elseif ( IsUnitType(whichUnit, UNIT_TYPE_PEON) ) then - return false - elseif ( IsUnitType(whichUnit, UNIT_TYPE_STRUCTURE) ) then - return false - elseif ( IsUnitType(whichUnit, UNIT_TYPE_SUMMONED) ) then - return false - elseif ( IsCitizen(unitTypeId) ) then - return false - endif - return true -endfunction -function WoWReforgedThievesGuild__ForGroupAddUnitToThievesGuild takes nothing returns nothing - local integer unitTypeId= GetUnitTypeId(WoWReforgedThievesGuild__tmpUnit) - local integer whichRace= GetObjectRace(unitTypeId) - local unit u= GetEnumUnit() - local player owner= GetOwningPlayer(u) - //call BJDebugMsg("Checking thieves guild " + GetUnitName(u) + " with enemy " + GetUnitName(tmpUnit)) - if ( IsPlayerEnemy(WoWReforgedThievesGuild__tmpPreviousOwner, owner) and ( whichRace == udg_RaceNone or PlayerHasRace(owner , whichRace) ) ) then - call AddUnitToStock(u, GetUnitTypeId(WoWReforgedThievesGuild__tmpUnit), 1, 1) - endif - set u=null - set owner=null -endfunction -function WoWReforgedThievesGuild__AddUnitToThievesGuild takes player previousOwner,unit whichUnit returns nothing - set WoWReforgedThievesGuild__tmpUnit=whichUnit - set WoWReforgedThievesGuild__tmpPreviousOwner=previousOwner - call ForGroup(WoWReforgedThievesGuild__thievesGuilds, function WoWReforgedThievesGuild__ForGroupAddUnitToThievesGuild) -endfunction -function WoWReforgedThievesGuild__TriggerConditionDeath takes nothing returns boolean - local unit u= GetTriggerUnit() - local player owner= GetOwningPlayer(u) - if ( IsUnitInGroup(u, WoWReforgedThievesGuild__thievesGuilds) ) then - call GroupRemoveUnit(WoWReforgedThievesGuild__thievesGuilds, u) - elseif ( WoWReforgedThievesGuild__IsValidUnit(owner , u) ) then - call WoWReforgedThievesGuild__AddUnitToThievesGuild(owner , u) - endif - set u=null - set owner=null - return false -endfunction -function WoWReforgedThievesGuild__TriggerConditionChangesOwner takes nothing returns boolean - local unit u= GetTriggerUnit() - if ( WoWReforgedThievesGuild__IsValidUnit(GetChangingUnitPrevOwner() , u) ) then - call WoWReforgedThievesGuild__AddUnitToThievesGuild(GetChangingUnitPrevOwner() , u) - endif - set u=null - return false -endfunction -function WoWReforgedThievesGuild__TriggerConditionConstructFinish takes nothing returns boolean - local unit b= GetConstructedStructure() - local integer unitTypeId= GetUnitTypeId(b) - if ( IsThievesGuild(unitTypeId) ) then - call GroupAddUnit(WoWReforgedThievesGuild__thievesGuilds, b) - - if ( unitTypeId == THIEVES_GUILD_THIEF or unitTypeId == BANDIT_THIEVES_GUILD ) then - call SetItemTypeSlots(b, 6) - call SetUnitTypeSlots(b, 6) - else - call SetItemTypeSlots(b, 0) - call SetUnitTypeSlots(b, 12) - endif - endif - set b=null - return false -endfunction -function WoWReforgedThievesGuild__RemovePurchasedUnit takes nothing returns nothing - call RemoveUnitFromStock(GetSellingUnit(), GetUnitTypeId(GetSoldUnit())) -endfunction -function WoWReforgedThievesGuild__TriggerConditionSell takes nothing returns boolean - if ( (IsThievesGuild(GetUnitTypeId((GetSellingUnit())))) ) then // INLINED!! - call RemoveUnitFromStock(GetSellingUnit(), GetUnitTypeId(GetSoldUnit())) // INLINED!! - endif - return false -endfunction -function WoWReforgedThievesGuild__TriggerConditionSellItem takes nothing returns boolean - if ( (IsThievesGuild(GetUnitTypeId((GetSellingUnit())))) ) then // INLINED!! - call RemovePurchasedItem() - endif - return false -endfunction -function WoWReforgedThievesGuild__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedThievesGuild__deathTrigger, Condition(function WoWReforgedThievesGuild__TriggerConditionDeath)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild__changesOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) - call TriggerAddCondition(WoWReforgedThievesGuild__changesOwnerTrigger, Condition(function WoWReforgedThievesGuild__TriggerConditionChangesOwner)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild__constructFinishTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedThievesGuild__constructFinishTrigger, Condition(function WoWReforgedThievesGuild__TriggerConditionConstructFinish)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild__sellUnitTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(WoWReforgedThievesGuild__sellUnitTrigger, Condition(function WoWReforgedThievesGuild__TriggerConditionSell)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild__sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedThievesGuild__sellItemTrigger, Condition(function WoWReforgedThievesGuild__TriggerConditionSellItem)) - - // Arrange the first update. - call TimerStart(WoWReforgedThievesGuild__stockUpdateTimer, bj_STOCK_RESTOCK_INITIAL_DELAY, false, function WoWReforgedThievesGuild__StartStockUpdates) -endfunction -function WoWReforgedThievesGuild__RemoveUnitHook takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, WoWReforgedThievesGuild__thievesGuilds) ) then - call GroupRemoveUnit(WoWReforgedThievesGuild__thievesGuilds, whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit WoWReforgedThievesGuild__RemoveUnitHook -//library WoWReforgedThievesGuild ends -//library WoWReforgedWitchHut: -function RemoveAllWitchHutAbilities takes unit whichUnit returns nothing - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedWitchHut__unitTypeIdsCounter ) - call UnitRemoveAbility(whichUnit, WoWReforgedWitchHut__abilityIds[i]) - set i=i + 1 - endloop - if ( (HaveSavedHandle(WoWReforgedMounts__h, GetHandleId((whichUnit)), WoWReforgedMounts__KEY_HERO)) ) then // INLINED!! - call ClearMountAbilities(whichUnit) - endif -endfunction -function EnableWitchHut takes unit whichUnit returns nothing - local integer i= 0 - call GroupAddUnit(WoWReforgedWitchHut__witchHuts, whichUnit) - call EnablePagedButtons(whichUnit) -call AddPagedButtonsId((whichUnit ) , ( WoWReforgedWitchHut_UNIT_TYPE_REMOVE_ABILITIES) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! - loop - exitwhen ( i >= WoWReforgedWitchHut__unitTypeIdsCounter ) -call AddPagedButtonsId((whichUnit ) , ( WoWReforgedWitchHut__unitTypeIds[i]) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! - set i=i + 1 - endloop -endfunction -function IsWitchHut takes unit whichUnit returns boolean - return IsUnitInGroup(whichUnit, WoWReforgedWitchHut__witchHuts) -endfunction -function DisableWitchHut takes unit whichUnit returns nothing - call GroupRemoveUnit(WoWReforgedWitchHut__witchHuts, whichUnit) - call DisablePagedButtons(whichUnit) -endfunction -function AddWitchHutAbility takes integer abilityId,integer unitTypeId returns integer - local integer index= WoWReforgedWitchHut__unitTypeIdsCounter - call SaveInteger(WoWReforgedWitchHut__h, unitTypeId, 0, abilityId) - set WoWReforgedWitchHut__abilityIds[index]=abilityId - set WoWReforgedWitchHut__unitTypeIds[index]=unitTypeId - set WoWReforgedWitchHut__unitTypeIdsCounter=index + 1 - - return index -endfunction -function AddWoWReforgedWitchHutAbility takes nothing returns nothing - call AddWitchHutAbility(udg_TmpAbilityCode , udg_TmpUnitType) -endfunction -function WoWReforgedWitchHut__TriggerConditionConstructFinish takes nothing returns boolean - if ( GetUnitTypeId(GetConstructedStructure()) == WoWReforgedWitchHut_UNIT_TYPE ) then - call EnableWitchHut(GetConstructedStructure()) - endif - return false -endfunction -function WoWReforgedWitchHut__TriggerConditionConstructDeath takes nothing returns boolean - if ( (IsUnitInGroup((GetTriggerUnit()), WoWReforgedWitchHut__witchHuts)) ) then // INLINED!! - call DisableWitchHut(GetTriggerUnit()) - endif - return false -endfunction -function WoWReforgedWitchHut__TriggerConditionSell takes nothing returns boolean - local unit soldUnit= GetSoldUnit() - local unit buyingUnit= GetBuyingUnit() - local unit sellingUnit= GetSellingUnit() - local integer soldUnitTypeId= GetUnitTypeId(soldUnit) - local integer abilityId= 0 - if ( (IsUnitInGroup((sellingUnit), WoWReforgedWitchHut__witchHuts)) ) then // INLINED!! - set abilityId=LoadInteger(WoWReforgedWitchHut__h, soldUnitTypeId, 0) - if ( soldUnitTypeId == WoWReforgedWitchHut_UNIT_TYPE_REMOVE_ABILITIES ) then - call RemoveAllWitchHutAbilities(buyingUnit) - call h__DisplayTimedTextToPlayer(GetOwningPlayer(buyingUnit), 0.0, 0.0, 4.0, "Removed all added abilities from " + GetUnitName(buyingUnit) + ".") - elseif ( abilityId != 0 ) then - call UnitAddAbility(buyingUnit, abilityId) - if ( (HaveSavedHandle(WoWReforgedMounts__h, GetHandleId((buyingUnit)), WoWReforgedMounts__KEY_HERO)) ) then // INLINED!! - call AddMountAbility(buyingUnit , abilityId) - endif - call h__DisplayTimedTextToPlayer(GetOwningPlayer(buyingUnit), 0.0, 0.0, 4.0, "Added ability to " + GetUnitName(buyingUnit) + ": " + GetObjectName(abilityId)) - endif - call h__RemoveUnit(soldUnit) - endif - set soldUnit=null - set buyingUnit=null - set sellingUnit=null - return false -endfunction -function WoWReforgedWitchHut__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedWitchHut__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedWitchHut__constructionTrigger, Condition(function WoWReforgedWitchHut__TriggerConditionConstructFinish)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedWitchHut__deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedWitchHut__deathTrigger, Condition(function WoWReforgedWitchHut__TriggerConditionConstructDeath)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedWitchHut__sellTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(WoWReforgedWitchHut__sellTrigger, Condition(function WoWReforgedWitchHut__TriggerConditionSell)) -endfunction -function WoWReforgedWitchHut__HookRemoveUnit takes unit whichUnit returns nothing - if ( (IsUnitInGroup((whichUnit), WoWReforgedWitchHut__witchHuts)) ) then // INLINED!! - call DisableWitchHut(whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit WoWReforgedWitchHut__HookRemoveUnit -//library WoWReforgedWitchHut ends -//library WoWReforgedWrapUp: -function GetBuildingItemId takes integer unitTypeId returns integer - local integer targetRace= (GetObjectRace((unitTypeId))) // INLINED!! - if ( targetRace != udg_RaceNone or IsBuildingAllRaces(unitTypeId) ) then - return MapBuildingIDToItemID(unitTypeId , targetRace) - endif - - return 0 -endfunction -function FilterIsWrapableBuilding takes nothing returns boolean - local unit filterUnit= GetFilterUnit() - local boolean result= IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and GetBuildingItemId(GetUnitTypeId(filterUnit)) != 0 and IsUnitInGroup(filterUnit, WoWReforgedWrapUp___constructedBuildings) - set filterUnit=null - return result -endfunction -function CancelAllOrdersInBuilding takes unit whichBuilding returns nothing - local integer i= 0 - loop - exitwhen ( i == 8 ) // all slots - call IssueImmediateOrderById(whichBuilding, 851976) - set i=i + 1 - endloop -endfunction -function WrapUpBuilding takes real x,real y,unit source returns item - local integer unitTypeId= GetUnitTypeId(source) - local integer itemTypeId= GetBuildingItemId(unitTypeId) - local item whichItem= null - if ( itemTypeId != 0 ) then - set whichItem=CreateItem(itemTypeId, x, y) - call SetItemCharges(whichItem, 1) - call IssueImmediateOrder(source, "stop") - call DropItemsFromHero(source) - call CancelAllOrdersInBuilding(source) - call UnitRemoveAbility(source, 'A0NY') // Spawn Fire Elementals - call KillUnit(source) // kill to unload units etc. - endif - return whichItem -endfunction -function WrapUpAllBuildings takes unit caster,real x,real y returns integer - local player whichPlayer= GetOwningPlayer(caster) - local group allBuildings= CreateGroup() - local integer counter= 0 - local integer i= 0 - local integer max= 0 - local integer j= 0 - local item whichItem= null - local item array allItems - local integer allItemsCounter= 0 - set WoWReforgedWrapUp___tmpPlayer=whichPlayer - call GroupEnumUnitsInRange(allBuildings, x, y, 1024.0, Filter(function FilterIsWrapableBuilding)) - set max=BlzGroupGetSize(allBuildings) - loop - exitwhen ( i == max ) - set whichItem=WrapUpBuilding(GetUnitX(caster) , GetUnitY(caster) , BlzGroupUnitAt(allBuildings, i)) - if ( whichItem != null ) then - set counter=counter + 1 - call UnitAddItem(caster, whichItem) - set allItems[allItemsCounter]=whichItem - set allItemsCounter=allItemsCounter + 1 - endif - set whichItem=null - set i=i + 1 - endloop - call GroupClear(allBuildings) - call DestroyGroup(allBuildings) - set allBuildings=null - set whichPlayer=null - - // group all items of the same type - set i=0 - set max=allItemsCounter - loop - exitwhen ( i == allItemsCounter ) - if ( allItems[i] != null ) then - set j=i + 1 - loop - exitwhen ( j >= allItemsCounter ) - if ( allItems[j] != null and GetItemCharges(allItems[i]) < 100 and GetItemTypeId(allItems[i]) == GetItemTypeId(allItems[j]) ) then - call SetItemCharges(allItems[i], IMaxBJ(GetItemCharges(allItems[i]), 1) + IMaxBJ(GetItemCharges(allItems[j]), 1)) - call h__RemoveItem(allItems[j]) - set allItems[j]=null - endif - set j=j + 1 - endloop - endif - set i=i + 1 - endloop - return counter -endfunction -function WoWReforgedWrapUp___TriggerActionConstructed takes nothing returns nothing - call GroupAddUnit(WoWReforgedWrapUp___constructedBuildings, GetConstructedStructure()) -endfunction -function WoWReforgedWrapUp___TriggerConditionIsConstructed takes nothing returns boolean - return IsUnitInGroup(GetTriggerUnit(), WoWReforgedWrapUp___constructedBuildings) -endfunction -function WoWReforgedWrapUp___TriggerActionDeath takes nothing returns nothing - call GroupRemoveUnit(WoWReforgedWrapUp___constructedBuildings, GetTriggerUnit()) -endfunction -function WoWReforgedWrapUp___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedWrapUp___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddAction(WoWReforgedWrapUp___constructionTrigger, function WoWReforgedWrapUp___TriggerActionConstructed) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedWrapUp___deathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(WoWReforgedWrapUp___deathTrigger, Condition(function WoWReforgedWrapUp___TriggerConditionIsConstructed)) - call TriggerAddAction(WoWReforgedWrapUp___deathTrigger, function WoWReforgedWrapUp___TriggerActionDeath) -endfunction -function WoWReforgedWrapUp___HookRemoveConstructedBuilding takes unit whichUnit returns nothing - if ( IsUnitInGroup(whichUnit, WoWReforgedWrapUp___constructedBuildings) ) then - call GroupRemoveUnit(WoWReforgedWrapUp___constructedBuildings, whichUnit) - endif -endfunction -//processed hook: hook RemoveUnit WoWReforgedWrapUp___HookRemoveConstructedBuilding -//library WoWReforgedWrapUp ends -//library WowReforgedMultiply: -function MultiplyUnit takes unit caster,unit target returns nothing - local integer i= 0 - local unit copy= null - local item copyItem= null - local integer factor= GetUnitAbilityLevel(caster, WowReforgedMultiply_ABILITY_ID) - if ( IsUnitAlly(target, GetOwningPlayer(caster)) and not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_PEON) and not IsUnitType(target, UNIT_TYPE_TOWNHALL) ) then - if ( IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then - set copyItem=WrapUpBuilding(GetUnitX(target) , GetUnitY(target) , target) - if ( copyItem != null ) then - call SetItemCharges(copyItem, factor) - else - call IssueImmediateOrder(caster, "stop") - call SimError(GetOwningPlayer(caster) , "Invalid building.") - endif - else - set i=0 - loop - exitwhen ( i == factor ) - set copy=CreateUnit(GetOwningPlayer(caster), GetUnitTypeId(target), GetUnitX(target), GetUnitY(target), GetUnitFacing(target)) - call SetUnitLifeBJ(copy, GetUnitState(target, UNIT_STATE_LIFE)) - call SetUnitManaBJ(copy, GetUnitState(target, UNIT_STATE_MANA)) - call UnitApplyTimedLife(copy, WowReforgedMultiply_BUFF_ID, WowReforgedMultiply_DURATION) - set i=i + 1 - endloop - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(GetOwningPlayer(caster) , "Invalid target.") - endif -endfunction -function MultiplyItem takes unit caster,item target returns item - local item copy= null - local integer factor= GetUnitAbilityLevel(caster, WowReforgedMultiply_ABILITY_ID) - if ( not IsItemInvulnerable(target) ) then - set copy=CreateItem(GetItemTypeId(target), GetItemX(target), GetItemY(target)) - if ( GetItemCharges(target) > 1 ) then - call SetItemCharges(copy, factor) - endif - else - call IssueImmediateOrder(caster, "stop") - call SimError(GetOwningPlayer(caster) , "Invalid target.") - endif - return copy -endfunction -function WowReforgedMultiply__TriggerConditionCast takes nothing returns boolean - if ( GetSpellAbilityId() == WowReforgedMultiply_ABILITY_ID ) then - if ( GetSpellTargetUnit() != null ) then - call MultiplyUnit(GetTriggerUnit() , GetSpellTargetUnit()) - elseif ( GetSpellTargetItem() != null ) then - call MultiplyItem(GetTriggerUnit() , GetSpellTargetItem()) - else - call IssueImmediateOrder(GetTriggerUnit(), "stop") - call SimError(GetOwningPlayer(GetTriggerUnit()) , "Invalid target.") - endif - endif - return false -endfunction -function WowReforgedMultiply__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WowReforgedMultiply__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) - call TriggerAddCondition(WowReforgedMultiply__castTrigger, Condition(function WowReforgedMultiply__TriggerConditionCast)) -endfunction -//library WowReforgedMultiply ends -//library MaxHpResearch: -function AddMaxHpResearchAbsolute takes integer id,integer maxHpBase,integer maxHpLevel returns integer - local integer this= s__R__allocate() - local integer index= MaxHpResearch___researchesCounter - - set s__R_id[this]=id - set s__R_maxHpBase[this]=maxHpBase - set s__R_maxHpLevel[this]=maxHpLevel - set s__R_isPercentage[this]=false - - set MaxHpResearch___researches[index]=this - set MaxHpResearch___researchesCounter=MaxHpResearch___researchesCounter + 1 - - return this -endfunction -function AddMaxHpResearchPercentage takes integer id,real percentageBase,real percentageLevel returns integer - local integer this= s__R__allocate() - local integer index= MaxHpResearch___researchesCounter - - set s__R_id[this]=id - set s__R_percentageBase[this]=percentageBase - set s__R_percentageLevel[this]=percentageLevel - set s__R_isPercentage[this]=true - - set MaxHpResearch___researches[index]=this - set MaxHpResearch___researchesCounter=MaxHpResearch___researchesCounter + 1 - - return this -endfunction -function ApplyMaxHpResearchEffect takes unit whichUnit,integer level,integer research returns nothing - local integer maxHp= BlzGetUnitMaxHP(whichUnit) - local integer lifeBonus= 0 - if ( s__R_isPercentage[research] ) then - set lifeBonus=R2I(I2R(maxHp) * ( s__R_percentageBase[research] + s__R_percentageLevel[research] * I2R(level) )) - else - set lifeBonus=s__R_maxHpBase[research] + level * s__R_maxHpLevel[research] - endif - call BlzSetUnitMaxHP(whichUnit, maxHp + lifeBonus) - call SetUnitState(whichUnit, UNIT_STATE_LIFE, GetUnitState(whichUnit, UNIT_STATE_LIFE) + I2R(lifeBonus)) -endfunction -function ApplyMaxHpResearch takes unit whichUnit,integer r,integer level returns nothing - if ( level > 0 and UnitHasMaxHpResearch(whichUnit , s__R_id[r]) ) then - call ApplyMaxHpResearchEffect(whichUnit , level , r) - endif -endfunction -function ApplyAllMaxHpResearches takes unit whichUnit,player previousOwner returns nothing - local integer level= 0 - local integer i= 0 - loop - exitwhen ( i == MaxHpResearch___researchesCounter ) - set level=GetPlayerTechCount(GetOwningPlayer(whichUnit), s__R_id[MaxHpResearch___researches[i]], false) - if ( previousOwner != null ) then - set level=level - GetPlayerTechCount(previousOwner, s__R_id[MaxHpResearch___researches[i]], false) - endif - call ApplyMaxHpResearch(whichUnit , MaxHpResearch___researches[i] , level) - set i=i + 1 - endloop -endfunction -function GetMaxHpResearch takes integer id returns integer - local integer i= 0 - loop - exitwhen ( i == MaxHpResearch___researchesCounter ) - if ( s__R_id[MaxHpResearch___researches[i]] == id ) then - return MaxHpResearch___researches[i] - endif - set i=i + 1 - endloop - return 0 -endfunction -function MaxHpResearch___FilterIsAffectedUnit takes nothing returns boolean - return UnitHasMaxHpResearch(GetFilterUnit() , s__R_id[MaxHpResearch___filterResearch]) -endfunction -function ApplyMaxHpResearchToAllUnitsEx takes player whichPlayer,integer research,integer levels returns nothing - local group g= CreateGroup() - local integer i= 0 - local integer max= 0 - set MaxHpResearch___filterResearch=research - call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function MaxHpResearch___FilterIsAffectedUnit)) - set max=BlzGroupGetSize(g) - loop - exitwhen ( i == max ) - call ApplyMaxHpResearch(BlzGroupUnitAt(g, i) , research , levels) - set i=i + 1 - endloop - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function ApplyMaxHpResearchToAllUnits takes player whichPlayer,integer id,integer levels returns nothing - local integer r= GetMaxHpResearch(id) - if ( r != 0 ) then - call ApplyMaxHpResearchToAllUnitsEx(whichPlayer , r , levels) - endif -endfunction -function MaxHpResearch___TriggerConditionTrain takes nothing returns boolean - call ApplyAllMaxHpResearches(GetTrainedUnit() , null) - return false -endfunction -function MaxHpResearch___TriggerConditionSummon takes nothing returns boolean - call ApplyAllMaxHpResearches(GetSummonedUnit() , null) - return false -endfunction -function MaxHpResearch___TriggerConditionSell takes nothing returns boolean - call ApplyAllMaxHpResearches(GetSoldUnit() , null) - return false -endfunction -function MaxHpResearch___TriggerConditionChangeOwner takes nothing returns boolean - call ApplyAllMaxHpResearches(GetTriggerUnit() , GetChangingUnitPrevOwner()) - return false -endfunction -function MaxHpResearch___TriggerConditionResearch takes nothing returns boolean - call ApplyMaxHpResearchToAllUnits(GetOwningPlayer(GetTriggerUnit()) , GetResearched() , 1) - return false -endfunction -function MaxHpResearch___TriggerConditionUpgrade takes nothing returns boolean - call ApplyAllMaxHpResearches(GetTriggerUnit() , null) - return false -endfunction -function MaxHpResearch___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(MaxHpResearch___trainTrigger, EVENT_PLAYER_UNIT_TRAIN_FINISH) - call TriggerAddCondition(MaxHpResearch___trainTrigger, Condition(function MaxHpResearch___TriggerConditionTrain)) - - call TriggerRegisterAnyUnitEventBJ(MaxHpResearch___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(MaxHpResearch___summonTrigger, Condition(function MaxHpResearch___TriggerConditionSummon)) - - call TriggerRegisterAnyUnitEventBJ(MaxHpResearch___sellTrigger, EVENT_PLAYER_UNIT_SELL) - call TriggerAddCondition(MaxHpResearch___sellTrigger, Condition(function MaxHpResearch___TriggerConditionSell)) - - call TriggerRegisterAnyUnitEventBJ(MaxHpResearch___changeOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) - call TriggerAddCondition(MaxHpResearch___changeOwnerTrigger, Condition(function MaxHpResearch___TriggerConditionChangeOwner)) - - call TriggerRegisterAnyUnitEventBJ(MaxHpResearch___researchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) - call TriggerAddCondition(MaxHpResearch___researchTrigger, Condition(function MaxHpResearch___TriggerConditionResearch)) - - call TriggerRegisterAnyUnitEventBJ(MaxHpResearch___upgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) - call TriggerAddCondition(MaxHpResearch___upgradeTrigger, Condition(function MaxHpResearch___TriggerConditionUpgrade)) -endfunction -function MaxHpResearch___HookSetPlayerTechResearched takes player whichPlayer,integer techid,integer setToLevel returns nothing - call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , setToLevel - GetPlayerTechCountSimple(techid, whichPlayer)) -endfunction -function MaxHpResearch___HookAddPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing - call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , levels) -endfunction -function MaxHpResearch___HookBlzDecPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing - call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , - levels) -endfunction -//processed hook: hook SetPlayerTechResearched MaxHpResearch___HookSetPlayerTechResearched -//processed hook: hook AddPlayerTechResearched MaxHpResearch___HookAddPlayerTechResearched -//processed hook: hook BlzDecPlayerTechResearched MaxHpResearch___HookBlzDecPlayerTechResearched -//library MaxHpResearch ends -//library WoWReforgedArena: -function GetArenaTicketsMax takes nothing returns integer - return WoWReforgedArena__ticketsCounter -endfunction -function GetArenaTicket takes integer index returns integer - return WoWReforgedArena__tickets[index] -endfunction -function GetArenaTicketByTicket takes integer itemTypeId returns integer - local integer i= 0 - local integer max= (WoWReforgedArena__ticketsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( s__ArenaTicket_itemTypeId[(WoWReforgedArena__tickets[(i)])] == itemTypeId ) then // INLINED!! - return (WoWReforgedArena__tickets[(i)]) // INLINED!! - endif - set i=i + 1 - endloop - return 0 -endfunction -function GetArenaTicketByReward takes integer itemTypeId returns integer - local integer i= 0 - local integer max= (WoWReforgedArena__ticketsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena__tickets[(i)])] == itemTypeId ) then // INLINED!! - return (WoWReforgedArena__tickets[(i)]) // INLINED!! - endif - set i=i + 1 - endloop - return 0 -endfunction -function GetArenaTicketByOpponent takes integer unitTypeId returns integer - local integer i= 0 - local integer max= (WoWReforgedArena__ticketsCounter) // INLINED!! - local integer j= 0 - local integer max2= 0 - loop - exitwhen ( i == max ) - set j=0 - set max2=s__ArenaTicket_unitTypeIdsCounter[(WoWReforgedArena__tickets[(i)])] // INLINED!! - loop - exitwhen ( j == max2 ) - if ( s___ArenaTicket_unitTypeIds[s__ArenaTicket_unitTypeIds[(WoWReforgedArena__tickets[(i)])]+j] == unitTypeId ) then // INLINED!! - return (WoWReforgedArena__tickets[(i)]) // INLINED!! - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - return 0 -endfunction -function IsArenaReward takes integer itemTypeId returns boolean - return GetArenaTicketByReward(itemTypeId) != 0 -endfunction -function IsArenaOpponent takes integer unitTypeId returns boolean - return GetArenaTicketByOpponent(unitTypeId) != 0 -endfunction -function AddArenaTicket takes integer itemTypeId,integer rewardItemTypeId returns integer - local integer this= s__ArenaTicket__allocate() - set s__ArenaTicket_itemTypeId[this]=itemTypeId - set s__ArenaTicket_rewardItemTypeId[this]=rewardItemTypeId - - set WoWReforgedArena__tickets[WoWReforgedArena__ticketsCounter]=this - set WoWReforgedArena__ticketsCounter=WoWReforgedArena__ticketsCounter + 1 - - return this -endfunction -function AddArenaTicketUnitType takes integer unitTypeId,integer count returns nothing - local integer t= WoWReforgedArena__tickets[WoWReforgedArena__ticketsCounter - 1] - set s___ArenaTicket_unitTypeIds[s__ArenaTicket_unitTypeIds[t]+s__ArenaTicket_unitTypeIdsCounter[t]]=unitTypeId - set s___ArenaTicket_unitTypeIdsCounts[s__ArenaTicket_unitTypeIdsCounts[t]+s__ArenaTicket_unitTypeIdsCounter[t]]=count - set s__ArenaTicket_unitTypeIdsCounter[t]=s__ArenaTicket_unitTypeIdsCounter[t] + 1 -endfunction -function AddSaveObjectItemTypesFromArena takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedArena__ticketsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena__tickets[(i)])] != 0 ) then // INLINED!! - call AddSaveObjectItemTypeEx(GetObjectName(s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena__tickets[(i)])]) , s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena__tickets[(i)])]) // INLINED!! - endif - set i=i + 1 - endloop -endfunction -function SpawnArenaEnemies takes integer t,rect whichRect,rect targetRect returns nothing - local real x= 0.0 - local real y= 0.0 - local real targetX= GetRectCenterX(targetRect) - local real targetY= GetRectCenterY(targetRect) - local location l= null - local integer i= 0 - local integer max= s__ArenaTicket_unitTypeIdsCounter[t] - local integer j= 0 - local integer max2= 0 - local unit u= null - loop - exitwhen ( i == max ) - set j=0 - set max2=s___ArenaTicket_unitTypeIdsCounts[s__ArenaTicket_unitTypeIdsCounts[t]+i] - loop - exitwhen ( j == max2 ) - set l=GetRandomLocInRect(whichRect) - set x=GetLocationX(l) - set y=GetLocationY(l) - set u=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), s___ArenaTicket_unitTypeIds[s__ArenaTicket_unitTypeIds[t]+i], x, y, AngleBetweenCoordinatesDeg(x , y , targetX , targetY)) - call UnitAddSleepPerm(u, false) - call IssuePointOrder(u, "patrol", targetX, targetY) - call RemoveLocation(l) - set l=null - set u=null - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function EnterArena takes unit hero,rect whichRect,rect targetRect,string enterMessage,sound enterSound returns boolean - local location l= null - local player owner= GetOwningPlayer(hero) - local integer playerId= GetPlayerId(owner) - local boolean found= false - local item whichItem= null - local integer t= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set whichItem=UnitItemInSlot(hero, i) - if ( whichItem != null ) then - set t=GetArenaTicketByTicket(GetItemTypeId(whichItem)) - if ( t != 0 ) then - set found=true - call h__RemoveItem(whichItem) - set whichItem=null - call SpawnArenaEnemies(t , whichRect , targetRect) - endif - endif - set i=i + 1 - endloop - if ( found ) then - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_WARNING, enterMessage) - set l=GetRectCenter(targetRect) - call PanCameraToTimedLocForPlayer(owner, l, 0) - call RemoveLocation(l) - set l=null - set l=GetRectCenter(whichRect) - call PlaySoundAtPointBJ(enterSound, 100, l, 0) - call RemoveLocation(l) - set l=null - endif - set owner=null - return found -endfunction -function WoWReforgedArena__Init takes nothing returns nothing - call AddArenaTicket(ITEM_TYPE_TICKET_1 , ITEM_TYPE_STONE_TOKEN) - call AddArenaTicketUnitType('nogr' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_2 , ITEM_TYPE_TALISMAN_OF_THE_WILD) - call AddArenaTicketUnitType('nowb' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_3 , ITEM_TYPE_ICE_SHARD) - call AddArenaTicketUnitType('nmgw' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_4 , ITEM_TYPE_GLOVES_OF_SPELL_MASTERY) - call AddArenaTicketUnitType('nbzk' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_5 , ITEM_TYPE_SHAMAN_CLAWS) - call AddArenaTicketUnitType('nogn' , 2) - call AddArenaTicketUnitType('nogo' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_6 , ITEM_TYPE_THUNDERLIZARD_DIAMOND) - call AddArenaTicketUnitType('nehy' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_7 , ITEM_TYPE_SHIELD_OF_HONOR) - call AddArenaTicketUnitType('nwna' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_8 , ITEM_TYPE_SERATHIL) - call AddArenaTicketUnitType('nsqa' , 1) - call AddArenaTicketUnitType('nsqo' , 2) - call AddArenaTicket(ITEM_TYPE_TICKET_9 , ITEM_TYPE_STONEMAUL_ARENA_MASTER_BELT) - call AddArenaTicketUnitType('nsqa' , 1) - call AddArenaTicketUnitType('nsqo' , 2) - call AddArenaTicketUnitType('n00B' , 1) -endfunction -//library WoWReforgedArena ends -//library WoWReforgedCheats: -function GetHelpTextCheats takes nothing returns string - return "-cheats, -nocheats, -creeps, -cinoutro, -cinlichking, -cinoldgods, -cininvasion, -boots, -terrain, -heroskills, -bonus, -quests, -fields, -read, -write, -maxresources, -respawngroupcounter, -respawnall, -maxlevel, -levelX, -col, -medivh, -revive, -resetrepick, -demigodlight, -demigoddark, -trydemigod, -orderon, -orderoff, -kill, -fill, -share, -unitinfo, -checksave, -generatesave, -savecounters, -savecodeduplicates, -savecodemissing, -combination, -foldername, -autoskill, -orbs, -herolevels, -deathwing, -claws, -clawsbonus, -regennight, -craft, -legendary, -professions, -achievementscheat, -aigui, -aicraft, -aiharveston/off, -day, -night, -jaina, -arena, -evolution, -evolutioncreeps, -nagaquest4, -website" -endfunction -function CheatItems takes player whichPlayer returns nothing - local unit hero= (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! - local item whichItem= null - local integer i= 0 - local integer max= (SaveObjectItemCounter) // INLINED!! - - // contain race and profession items - set i=1 - loop - exitwhen ( i == max ) - if ( (SaveObjectIdItem[(i)]) != 0 ) then // INLINED!! - set whichItem=UnitAddItemById(hero, (SaveObjectIdItem[(i)])) // INLINED!! - if ( GetItemCharges(whichItem) > 0 ) then - call SetItemCharges(whichItem, 100) - endif - else - call h__BJDebugMsg("Warning: Item save object with index " + I2S(i) + " is 0.") - endif - set i=i + 1 - endloop - - set i=0 - set max=udg_LegendaryItemTypeSize - loop - exitwhen ( i == max ) - if ( udg_LegendaryItemType[i] != 0 ) then - set whichItem=UnitAddItemById(hero, udg_LegendaryItemType[i]) - else - call h__BJDebugMsg("Warning: Legendary item with index " + I2S(i) + " is 0.") - endif - set i=i + 1 - endloop - - set i=0 - set max=(WoWReforgedQuests__questsMax) // INLINED!! - loop - exitwhen ( i == max ) - if ( (WoWReforgedQuests__questReward[(i)]) != 0 ) then // INLINED!! - set whichItem=UnitAddItemById(hero, (WoWReforgedQuests__questReward[(i)])) // INLINED!! - else - call h__BJDebugMsg("Warning: Quest reward item with index " + I2S(i) + " is 0.") - endif - set i=i + 1 - endloop -endfunction -function CheatMaxResources takes player whichPlayer returns nothing - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - loop - exitwhen ( i == max ) - call SetPlayerResource(whichPlayer , (s__Resource_resources[(i)]) , 9999999) // INLINED!! - set i=i + 1 - endloop -endfunction -function CheatHeroSkills takes player whichPlayer returns nothing - local unit hero= null - local integer i= 0 - local integer max= (udg_HeroUnitTypeIndex) // INLINED!! - loop - exitwhen ( i == max ) - set hero=CreateUnit(whichPlayer, (udg_HeroUnitType[(i)]), 0.0, 0.0, 0.0) // INLINED!! - call SetHeroLevel(hero, MAX_HERO_LEVEL, false) - call AutoSkillHero(hero) - call h__RemoveUnit(hero) - set hero=null - set i=i + 1 - endloop - set i=0 - set max=BlzGroupGetSize(udg_Bosses) - loop - exitwhen ( i == max ) - set hero=CreateUnit(whichPlayer, GetUnitTypeId(BlzGroupUnitAt(udg_Bosses, i)), 0.0, 0.0, 0.0) - call SetHeroLevel(hero, MAX_HERO_LEVEL, false) - call AutoSkillHero(hero) - call h__RemoveUnit(hero) - set hero=null - set i=i + 1 - endloop -endfunction -function WoWReforgedCheats__ForGroupCheckSaveCodeMissing takes nothing returns nothing - local integer unitTypeId= GetUnitTypeId(GetEnumUnit()) - local integer index= GetSaveObjectUnitType(unitTypeId) - - if ( index == - 1 ) then - set index=GetSaveObjectBuildingType(unitTypeId) - endif - - if ( index == - 1 ) then - call h__BJDebugMsg("Missing save code for unit type " + GetObjectName(unitTypeId)) - endif -endfunction -function WoWReforgedCheats__ForItemGroupCheckSaveCodeMissing takes nothing returns nothing - local integer unitTypeId= GetItemTypeId(GetEnumItem()) - local integer index= GetSaveObjectItemType(unitTypeId) - - if ( index == - 1 ) then - call h__BJDebugMsg("Missing save code for item type " + GetObjectName(unitTypeId)) - endif -endfunction -function CheatSaveCodeMissing takes nothing returns nothing - local group g= CreateGroup() - call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_AGGRESSIVE), null) - call ForGroup(g, function WoWReforgedCheats__ForGroupCheckSaveCodeMissing) - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call EnumItemsInRect(GetPlayableMapRect(), null, function WoWReforgedCheats__ForItemGroupCheckSaveCodeMissing) -endfunction -function WoWReforgedCheats__PrintProfession takes integer p returns nothing - local integer i= 0 - local integer max= PROFESSION_RANK_MAX - local integer j= 0 - local integer max2= 0 - call h__BJDebugMsg("- " + GetProfessionName(p)) - loop - exitwhen ( i >= max ) - set j=0 - set max2=GetProfessionCraftedItemsCount(p , i) - call h__BJDebugMsg(GetProfessionName(p) + " Rank " + GetRankName(i) + " with count " + I2S(max2)) - loop - exitwhen ( j >= max2 ) - if ( GetProfessionCraftedUnit(p , i , j) != 0 ) then - call h__BJDebugMsg(GetProfessionName(p) + " " + GetObjectName(GetProfessionCraftedUnit(p , i , j)) + " with count " + I2S(GetProfessionCraftedCount(p , i , j))) - elseif ( GetProfessionCraftedItem(p , i , j) != 0 ) then - call h__BJDebugMsg(GetProfessionName(p) + " " + GetObjectName(GetProfessionCraftedItem(p , i , j)) + " with count " + I2S(GetProfessionCraftedCount(p , i , j))) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function CheatProfessions takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! - loop - exitwhen ( i == max ) - call WoWReforgedCheats__PrintProfession(i) - set i=i + 1 - endloop -endfunction -function CheatBoots takes player whichPlayer returns nothing - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Created Boots of Teleportation for your first hero.") - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call UnitAddItemById((udg_Hero[GetPlayerId((whichPlayer))]), ITEM_BOOTS_OF_TELEPORTATION) // INLINED!! - endif -endfunction -function CheatTerrain takes player whichPlayer returns nothing - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Tile: " + A2S(GetTerrainType(GetCameraTargetPositionX(), GetCameraTargetPositionY()))) -endfunction -function CheatOrderOn takes nothing returns nothing -endfunction -function CheatOrderOff takes nothing returns nothing -endfunction -//library WoWReforgedCheats ends -//library WoWReforgedHunterSaveCodes: -function AddSaveCodeItemsTrophies takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedHunter__trophyCounter) // INLINED!! - loop - exitwhen ( i == max ) - call AddSaveObjectItemTypeEx(GetObjectName((WoWReforgedHunter__trophyItemTypeIds[(i)])) , (WoWReforgedHunter__trophyItemTypeIds[(i)])) // INLINED!! - set i=i + 1 - endloop -endfunction -//library WoWReforgedHunterSaveCodes ends -//library WoWReforgedItemSets: -//processed: function interface OnItemSetFunction takes unit hero, ItemSet s returns nothing -function UnitHasItemSet takes unit whichUnit returns boolean - return LoadBoolean(WoWReforgedItemSets__h, GetHandleId(whichUnit), 0) -endfunction -function WoWReforgedItemSets__SetUnitHasItemSet takes unit whichUnit,boolean flag returns nothing - call SaveBoolean(WoWReforgedItemSets__h, GetHandleId(whichUnit), 0, flag) -endfunction -function WoWReforgedItemSets__ClearUnitHasItemSet takes unit whichUnit returns nothing - call FlushChildHashtable(WoWReforgedItemSets__h, GetHandleId(whichUnit)) -endfunction -//processed hook: hook RemoveUnit WoWReforgedItemSets__ClearUnitHasItemSet -function WoWReforgedItemSets__CheckAllItemSets takes unit whichUnit returns nothing - local integer s= 0 - local integer j= 0 - local integer counter= 0 - local integer i= 0 - loop - exitwhen ( i == WoWReforgedItemSets__itemSetsCounter ) - set s=WoWReforgedItemSets__itemSets[i] - set counter=0 - set j=0 - loop - exitwhen ( j == s__ItemSet_componentsCounter[s] ) - if ( UnitHasItemOfTypeBJ(whichUnit, s___ItemSet_components[s__ItemSet_components[s]+j]) ) then - set counter=counter + 1 - endif - set j=j + 1 - endloop - if ( counter == s__ItemSet_componentsCounter[s] ) then - if ( not (LoadBoolean(WoWReforgedItemSets__h, GetHandleId((whichUnit)), 0)) ) then // INLINED!! - call SaveBoolean(WoWReforgedItemSets__h, GetHandleId((whichUnit )), 0, ( true)) // INLINED!! - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(whichUnit))], bj_QUESTMESSAGE_HINT, "Completed item set " + s__ItemSet_name[s] + ".") - call sc___prototype145_execute(s__ItemSet_onComplete[s],whichUnit , s) - endif - else - if ( (LoadBoolean(WoWReforgedItemSets__h, GetHandleId((whichUnit)), 0)) ) then // INLINED!! - call FlushChildHashtable(WoWReforgedItemSets__h, GetHandleId((whichUnit))) // INLINED!! - call sc___prototype145_execute(s__ItemSet_onUncomplete[s],whichUnit , s) - endif - endif - set i=i + 1 - endloop -endfunction -function AddItemSetComponentsToSaveCodes takes nothing returns nothing - local integer s= 0 - local integer j= 0 - local integer counter= 0 - local integer i= 0 - loop - exitwhen ( i == WoWReforgedItemSets__itemSetsCounter ) - set s=WoWReforgedItemSets__itemSets[i] - set counter=0 - set j=0 - loop - exitwhen ( j == s__ItemSet_componentsCounter[s] ) - call AddSaveObjectItemTypeEx(GetObjectName(s___ItemSet_components[s__ItemSet_components[s]+j]) , s___ItemSet_components[s__ItemSet_components[s]+j]) - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function AddItemSet takes string name,integer onComplete,integer onUncomplete returns integer - local integer this= s__ItemSet__allocate() - set s__ItemSet_name[this]=name - set s__ItemSet_onComplete[this]=onComplete - set s__ItemSet_onUncomplete[this]=onUncomplete - set WoWReforgedItemSets__itemSets[WoWReforgedItemSets__itemSetsCounter]=this - set WoWReforgedItemSets__itemSetsCounter=WoWReforgedItemSets__itemSetsCounter + 1 - return this -endfunction -function AddItemSetComponent takes integer s,integer id returns integer - local integer index= s__ItemSet_componentsCounter[s] - set s___ItemSet_components[s__ItemSet_components[s]+index]=id - set s__ItemSet_componentsCounter[s]=s__ItemSet_componentsCounter[s] + 1 - return index -endfunction -function WoWReforgedItemSets__TriggerActionPickup takes nothing returns nothing - call WoWReforgedItemSets__CheckAllItemSets(GetTriggerUnit()) -endfunction -function WoWReforgedItemSets__TriggerActionDrop takes nothing returns nothing - call TriggerSleepAction(0.5) // wait for the item to be dropped - call WoWReforgedItemSets__CheckAllItemSets(GetTriggerUnit()) -endfunction -function WoWReforgedItemSets__OnCompleteHolySet takes unit hero,integer s returns nothing -call sc__NewBonus_add((hero ) , ( BONUS_ARMOR ) , (( 10.0)*1.0)) // INLINED!! -endfunction -function WoWReforgedItemSets__OnUncompleteHolySet takes unit hero,integer s returns nothing -call sc__NewBonus_add((hero ) , ( BONUS_ARMOR ) , (( - 10.0)*1.0)) // INLINED!! -endfunction -function WoWReforgedItemSets__Init takes nothing returns nothing - local integer s= 0 - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedItemSets__pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) - call TriggerAddAction(WoWReforgedItemSets__pickupTrigger, function WoWReforgedItemSets__TriggerActionPickup) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedItemSets__dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddAction(WoWReforgedItemSets__dropTrigger, function WoWReforgedItemSets__TriggerActionDrop) - - // All sets - set s=AddItemSet("Holy Set" , (1) , (2)) - call AddItemSetComponent(s , ITEM_HOLY_CREST) - call AddItemSetComponent(s , ITEM_HOLY_BOOTS) - call AddItemSetComponent(s , ITEM_HOLY_GAUNTLET) - call AddItemSetComponent(s , ITEM_HOLY_ARMOR) - call AddItemSetComponent(s , ITEM_HOLY_SHIELD) - call AddItemSetComponent(s , ITEM_HOLY_SWORD) -endfunction -//library WoWReforgedItemSets ends -//library WoWReforgedRacing: -function GetRacingTracksCount takes nothing returns integer - return WoWReforgedRacing__racingTracksCounter -endfunction -function GetRacingTrack takes integer index returns integer - return WoWReforgedRacing__racingTracks[index] -endfunction -function RacingTrackWasFinished takes integer racingTrack,player whichPlayer returns boolean - return s___RacingTrack_finished[s__RacingTrack_finished[racingTrack]+GetPlayerId(whichPlayer)] -endfunction -function WoWReforgedRacing__RefreshRacingTrackCheckpointEffect takes integer racingTrack,integer playerId returns nothing - local player whichPlayer= Player(playerId) - local integer index= s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[racingTrack]+playerId] - if ( s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId] != null ) then - if ( index > 0 ) then - call UnitShareVision(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index - 1], whichPlayer, false) - endif - call DestroyEffect(s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId]) - set s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId]=null - endif - set s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId]=AddSpecialEffectTarget(WoWReforgedRacing_CHECKPOINT_TARGET_EFFECT, s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index], "overhead") - call BlzSetSpecialEffectColorByPlayer(s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId], whichPlayer) - call UnitShareVision(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index], whichPlayer, true) - call PingMinimapForPlayer(whichPlayer, GetUnitX(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index]), GetUnitY(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index]), 6.0) - set whichPlayer=null -endfunction -function WoWReforgedRacing__SetCheckPointsVisible takes integer racingTrack,boolean visible returns nothing - local integer max= s__RacingTrack_checkpointsCounter[racingTrack] - local integer i= 0 - loop - exitwhen ( i == max ) - call ShowUnit(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+i], visible) - set i=i + 1 - endloop -endfunction -function WoWReforgedRacing__SetAllCheckPointsVisible takes boolean visible returns nothing - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedRacing__racingTracksCounter ) - call WoWReforgedRacing__SetCheckPointsVisible(WoWReforgedRacing__racingTracks[i] , visible) - set i=i + 1 - endloop -endfunction -function WoWReforgedRacing__HideCheckPointsVisible takes nothing returns nothing - call WoWReforgedRacing__SetAllCheckPointsVisible(false) -endfunction -function WoWReforgedRacing__SetCheckPointsDone takes integer racingTrack,integer done returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[racingTrack]+i]=done - set i=i + 1 - endloop -endfunction -function WoWReforgedRacing__RefreshAllCheckPointEffects takes integer racingTrack returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - call WoWReforgedRacing__RefreshRacingTrackCheckpointEffect(racingTrack , i) - set i=i + 1 - endloop -endfunction -function GetPlayerRacingTrackNextCheckPoint takes player whichPlayer returns unit - if ( WoWReforgedRacing__currentRacingTrack == 0 ) then - return null - endif - return s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[WoWReforgedRacing__currentRacingTrack]+s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[WoWReforgedRacing__currentRacingTrack]+GetPlayerId(whichPlayer)]] -endfunction -function WoWReforgedRacing__DestoyAllCheckPointEffects takes integer racingTrack returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+i] != null ) then - call DestroyEffect(s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+i]) - set s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+i]=null - call UnitShareVision(GetPlayerRacingTrackNextCheckPoint(Player(i)), Player(i), false) - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedRacing__FinishRacingTrack takes integer racingTrack returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[racingTrack]+i] >= s__RacingTrack_checkpointsCounter[racingTrack] and not s___RacingTrack_finished[s__RacingTrack_finished[racingTrack]+i] ) then - set s___RacingTrack_finished[s__RacingTrack_finished[racingTrack]+i]=true - call AchievementRacer(Player(i) , (WoWReforgedRacing__racingTracksCounter)) // INLINED!! - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedRacing__ResetRaceWinners takes nothing returns nothing - set WoWReforgedRacing__firstPlace=null - set WoWReforgedRacing__secondPlace=null - set WoWReforgedRacing__thirdPlace=null -endfunction -function GetRacingWinners takes nothing returns string - local string msg= "1st: " - if ( WoWReforgedRacing__firstPlace != null ) then - set msg=msg + GetPlayerNameColored(WoWReforgedRacing__firstPlace) - else - set msg=msg + "-" - endif - set msg=msg + ", 2nd: " - if ( WoWReforgedRacing__secondPlace != null ) then - set msg=msg + GetPlayerNameColored(WoWReforgedRacing__secondPlace) - else - set msg=msg + "-" - endif - set msg=msg + ", 3rd: " - if ( WoWReforgedRacing__thirdPlace != null ) then - set msg=msg + GetPlayerNameColored(WoWReforgedRacing__thirdPlace) - else - set msg=msg + "-" - endif - return msg -endfunction -function GiveRaceRewards takes nothing returns nothing - if ( WoWReforgedRacing__firstPlace != null ) then - call UnitAddItemById((udg_Hero[GetPlayerId((WoWReforgedRacing__firstPlace))]), s__RacingTrack_firstPlaceTrophyItemTypeId[WoWReforgedRacing__currentRacingTrack]) // INLINED!! - endif - if ( WoWReforgedRacing__secondPlace != null ) then - call UnitAddItemById((udg_Hero[GetPlayerId((WoWReforgedRacing__firstPlace))]), s__RacingTrack_secondPlaceTrophyItemTypeId[WoWReforgedRacing__currentRacingTrack]) // INLINED!! - endif - if ( WoWReforgedRacing__thirdPlace != null ) then - call UnitAddItemById((udg_Hero[GetPlayerId((WoWReforgedRacing__firstPlace))]), s__RacingTrack_thirdPlaceTrophyItemTypeId[WoWReforgedRacing__currentRacingTrack]) // INLINED!! - endif -endfunction -function EndRace takes integer racingTrack returns boolean - if ( WoWReforgedRacing__currentRacingTrack == racingTrack ) then - call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_SECRET, "Race " + s__RacingTrack_name[WoWReforgedRacing__currentRacingTrack] + " has ended and the winners are: " + GetRacingWinners()) - call GiveRaceRewards() - set WoWReforgedRacing__currentRacingTrack=0 - call TimerDialogDisplay(WoWReforgedRacing__currentRacingTrackTimerDialog, false) - call WoWReforgedRacing__SetCheckPointsVisible(racingTrack , false) - call WoWReforgedRacing__DestoyAllCheckPointEffects(racingTrack) - call WoWReforgedRacing__FinishRacingTrack(racingTrack) - call WoWReforgedRacing__ResetRaceWinners() - - return true - endif - - return false -endfunction -function WoWReforgedRacing__TimerFunctionEndRace takes nothing returns nothing - if ( WoWReforgedRacing__currentRacingTrack != 0 ) then - call EndRace(WoWReforgedRacing__currentRacingTrack) - endif -endfunction -function GetRacingTrackDistance takes integer racingTrack returns real - local real distance= 0.0 - local integer max= s__RacingTrack_checkpointsCounter[racingTrack] - local integer i= 0 - loop - exitwhen ( i + 1 >= max ) - set distance=distance + DistanceBetweenUnits(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+i] , s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+i + 1]) - set i=i + 1 - endloop - return distance -endfunction -function GetRacingTrackDuration takes integer racingTrack returns real - return GetRacingTrackDistance(racingTrack) / 100.0 -endfunction -function StartRace takes integer racingTrack returns boolean - if ( WoWReforgedRacing__currentRacingTrack == 0 ) then - set WoWReforgedRacing__currentRacingTrack=racingTrack - call WoWReforgedRacing__SetCheckPointsVisible(racingTrack , true) - call WoWReforgedRacing__SetCheckPointsDone(racingTrack , 0) - call WoWReforgedRacing__ResetRaceWinners() - call WoWReforgedRacing__RefreshAllCheckPointEffects(racingTrack) - - call TimerStart(WoWReforgedRacing__currentRacingTrackTimer, (GetRacingTrackDistance((racingTrack)) / 100.0), false, function WoWReforgedRacing__TimerFunctionEndRace) // INLINED!! - if ( WoWReforgedRacing__currentRacingTrackTimerDialog == null ) then - set WoWReforgedRacing__currentRacingTrackTimerDialog=CreateTimerDialog(WoWReforgedRacing__currentRacingTrackTimer) - endif - call TimerDialogSetTitle(WoWReforgedRacing__currentRacingTrackTimerDialog, s__RacingTrack_name[racingTrack]) - call TimerDialogDisplay(WoWReforgedRacing__currentRacingTrackTimerDialog, true) - - return true - endif - - return false -endfunction -function WoWReforgedRacing__CheckAllPlayersForRaceEnd takes nothing returns boolean - local player slotPlayer= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER and s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[WoWReforgedRacing__currentRacingTrack]+i] < s__RacingTrack_checkpointsCounter[WoWReforgedRacing__currentRacingTrack] ) then - return false - endif - set i=i + 1 - endloop - return true -endfunction -function WoWReforgedRacing__CheckForRaceEnd takes nothing returns nothing - if ( WoWReforgedRacing__currentRacingTrack != 0 ) then - if ( WoWReforgedRacing__CheckAllPlayersForRaceEnd() ) then - call EndRace(WoWReforgedRacing__currentRacingTrack) - endif - endif -endfunction -function WoWReforgedRacing__PlaceRaceWinner takes player whichPlayer returns nothing - if ( WoWReforgedRacing__firstPlace == null ) then - set WoWReforgedRacing__firstPlace=whichPlayer - elseif ( WoWReforgedRacing__secondPlace == null and WoWReforgedRacing__firstPlace != whichPlayer ) then - set WoWReforgedRacing__secondPlace=whichPlayer - elseif ( WoWReforgedRacing__thirdPlace == null and WoWReforgedRacing__firstPlace != whichPlayer and WoWReforgedRacing__secondPlace != whichPlayer ) then - set WoWReforgedRacing__thirdPlace=whichPlayer - endif - call WoWReforgedRacing__CheckForRaceEnd() -endfunction -function GetRacingTrackByItemTypeId takes integer itemTypeId returns integer - local integer i= 0 - loop - exitwhen ( i == WoWReforgedRacing__racingTracksCounter ) - if ( itemTypeId == s__RacingTrack_itemTypeId[WoWReforgedRacing__racingTracks[i]] ) then - return WoWReforgedRacing__racingTracks[i] - endif - set i=i + 1 - endloop - return 0 -endfunction -function AddRacingTrack takes string name,integer itemTypeId,integer firstPlaceTrophyItemTypeId,integer secondPlaceTrophyItemTypeId,integer thirdPlaceTrophyItemTypeId returns integer - local integer this= s__RacingTrack__allocate() - set s__RacingTrack_name[this]=name - set s__RacingTrack_itemTypeId[this]=itemTypeId - set s__RacingTrack_firstPlaceTrophyItemTypeId[this]=firstPlaceTrophyItemTypeId - set s__RacingTrack_secondPlaceTrophyItemTypeId[this]=secondPlaceTrophyItemTypeId - set s__RacingTrack_thirdPlaceTrophyItemTypeId[this]=thirdPlaceTrophyItemTypeId - - set WoWReforgedRacing__racingTracks[WoWReforgedRacing__racingTracksCounter]=this - set WoWReforgedRacing__racingTracksCounter=WoWReforgedRacing__racingTracksCounter + 1 - - return this -endfunction -function AddRacingTrackCheckpoint takes integer t,unit whichUnit returns nothing - local integer index= s__RacingTrack_checkpointsCounter[t] - local location l= GetUnitLoc(whichUnit) - local region r= CreateRegion() - local integer handleId= GetHandleId(r) - call RegionAddRect(r, GetRectFromCircleBJ(l, WoWReforgedRacing_CHECKPOINT_RADIUS)) - call RemoveLocation(l) - set l=null - call SaveInteger(WoWReforgedRacing__h, handleId, 0, t) - call SaveInteger(WoWReforgedRacing__h, handleId, 1, index) - set s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[t]+index]=whichUnit - set s__RacingTrack_checkpointsCounter[t]=index + 1 - call TriggerRegisterEnterRegion(WoWReforgedRacing__enterCheckpointTrigger, r, null) -endfunction -function AddRacingTrackWoWReforged takes nothing returns nothing - set udg_TmpInteger=AddRacingTrack(udg_TmpString , udg_TmpItemTypeId , udg_TmpItemTypeId2 , udg_TmpItemTypeId3 , udg_TmpItemTypeId4) -endfunction -function AddRacingTrackCheckpointWoWReforged takes nothing returns nothing - call AddRacingTrackCheckpoint(udg_TmpInteger , udg_TmpUnit) -endfunction -function WoWReforgedRacing__TriggerConditionSellItem takes nothing returns boolean - local integer t= GetRacingTrackByItemTypeId(GetItemTypeId(GetSoldItem())) - local player owner= GetOwningPlayer(GetBuyingUnit()) - if ( t != 0 ) then - if ( StartRace(t) ) then - call h__RemoveItem(GetSoldItem()) - else - call SimError(owner , "Race is already running: " + s__RacingTrack_name[WoWReforgedRacing__currentRacingTrack]) - call RefundItem(GetSoldItem() , owner) - endif - endif - set owner=null - return false -endfunction -function WoWReforgedRacing__TriggerConditionEnterCheckpoint takes nothing returns boolean - local integer handleId= GetHandleId(GetTriggeringRegion()) - local integer t= LoadInteger(WoWReforgedRacing__h, handleId, 0) - local integer index= LoadInteger(WoWReforgedRacing__h, handleId, 1) - local unit hero= GetTriggerUnit() - local player owner= GetOwningPlayer(hero) - local integer playerId= GetPlayerId(owner) - if ( t != 0 and WoWReforgedRacing__currentRacingTrack == t and IsPlayerHero1(hero) and s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId] == index ) then - set s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId]=s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId] + 1 - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_SECRET, "Checkpoints: " + I2S(s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId]) + "/" + I2S(s__RacingTrack_checkpointsCounter[t])) - if ( s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId] >= s__RacingTrack_checkpointsCounter[t] ) then - call WoWReforgedRacing__PlaceRaceWinner(owner) - else - call WoWReforgedRacing__RefreshRacingTrackCheckpointEffect(t , playerId) - endif - endif - set owner=null - set hero=null - return false -endfunction -function WoWReforgedRacing__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedRacing__sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedRacing__sellItemTrigger, Condition(function WoWReforgedRacing__TriggerConditionSellItem)) - - call TriggerAddCondition(WoWReforgedRacing__enterCheckpointTrigger, Condition(function WoWReforgedRacing__TriggerConditionEnterCheckpoint)) - - call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedRacing__HideCheckPointsVisible)) // INLINED!! -endfunction -//library WoWReforgedRacing ends -//library WoWReforgedResearches: - -function GetResearch takes integer index returns integer - return WoWReforgedResearches__researches[index] -endfunction -function AddResearch takes integer researchId,integer whichRace returns integer - local integer r= s__Research__allocate() - set s__Research_researchId[r]=researchId - set s__Research_whichRace[r]=whichRace - set s__Research_levels[r]=GetPlayerTechMaxAllowed(Player(0), researchId) - - set WoWReforgedResearches__lastCreatedResearch=r - - set WoWReforgedResearches__researches[WoWReforgedResearches__researchesCounter]=r - set WoWReforgedResearches__researchesCounter=WoWReforgedResearches__researchesCounter + 1 - - return r -endfunction -//, integer goldCostBase, integer lumberCostBase, integer timeBase - //set r.goldCostBase = goldCostBase - //set r.lumberCostBase = lumberCostBase - //set r.timeBase = whichRace -function AddResearchLevelData takes integer goldIncrement,integer lumberIncrement,integer timeIncrement returns nothing - set s__Research_goldIncrement[WoWReforgedResearches__lastCreatedResearch]=goldIncrement - set s__Research_lumberIncrement[WoWReforgedResearches__lastCreatedResearch]=lumberIncrement - set s__Research_timeIncrement[WoWReforgedResearches__lastCreatedResearch]=timeIncrement -endfunction -//function AddResearchUnitType takes integer unitTypeId returns nothing -//function AddResearchAbility takes integer abilityId returns nothing -function AddResearchWoWReforged takes nothing returns integer - return AddResearch(udg_TmpTechType , udg_TmpInteger) -endfunction -function GetResearchesMax takes nothing returns integer - return WoWReforgedResearches__researchesCounter -endfunction -function GetResearchId takes integer r returns integer - return s__Research_researchId[r] -endfunction -function GetResearchRace takes integer r returns integer - return s__Research_whichRace[r] -endfunction -function GetResearchLevels takes integer r returns integer - return s__Research_levels[r] -endfunction -function GetResearchGoldCostBase takes integer r returns integer - return s__Research_goldCostBase[r] -endfunction -function GetResearchLumberCostBase takes integer r returns integer - return s__Research_lumberCostBase[r] -endfunction -function GetResearchTimeBase takes integer r returns integer - return s__Research_timeBase[r] -endfunction -//function GetResearchUnitTypeCount takes Research r returns integer -//function GetResearchUnitTypeByIndex takes integer researchId, integer index returns integer -//function GetResearchAbilityCount takes integer researchId returns integer -//function GetResearchAbilityByIndex takes integer researchId, integer index returns integer -function ExcludeResearchFromSaveObjects takes integer researchId returns boolean - if ( researchId == UPG_EVOLUTION ) then - return true - elseif ( researchId == UPG_CHEAP_EVOLUTION ) then - return true - elseif ( researchId == UPG_IMPROVED_POWER_GENERATOR ) then - return true - elseif ( researchId == UPG_IMPROVED_MOUNT ) then - return true - elseif ( researchId == UPG_IMPROVED_HAND_OF_GOD ) then - return true - elseif ( researchId == UPG_IMPROVED_MASONRY ) then - return true - elseif ( researchId == UPG_IMPROVED_NAVY ) then - return true - elseif ( researchId == UPG_IMPROVED_CREEP_HUNTER ) then - return true - // clan researches are part of the clan savecode - elseif ( researchId == UPG_IMPROVED_CLAN_HALL ) then - return true - elseif ( researchId == UPG_IMPROVED_CLAN ) then - return true - endif - return false -endfunction -function AddResearchSaveObjects takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedResearches__researchesCounter) // INLINED!! - local integer r= 0 - loop - exitwhen ( i == max ) - set r=(WoWReforgedResearches__researches[(i)]) // INLINED!! - if ( not ExcludeResearchFromSaveObjects(s__Research_researchId[r]) and s__Research_researchId[r] != 0 ) then - set udg_TmpTechType=s__Research_researchId[r] -call AddSaveObjectResearchTypeEx(GetObjectName(udg_TmpTechType) , udg_TmpTechType , udg_TmpInteger) // INLINED!! - endif - set i=i + 1 - endloop -endfunction -function GetResearchesTotalForRace takes integer whichRace returns integer - local integer i= 0 - local integer max= (WoWReforgedResearches__researchesCounter) // INLINED!! - local integer counter= 0 - local integer r= 0 - loop - exitwhen ( i == max ) - set r=(WoWReforgedResearches__researches[(i)]) // INLINED!! - if ( s__Research_whichRace[r] == whichRace ) then - set counter=counter + s__Research_levels[r] - endif - set i=i + 1 - endloop - return counter -endfunction -function GetResearchesResearchedForRace takes integer whichRace,player whichPlayer returns integer - local integer i= 0 - local integer max= (WoWReforgedResearches__researchesCounter) // INLINED!! - local integer counter= 0 - local integer r= 0 - loop - exitwhen ( i == max ) - set r=(WoWReforgedResearches__researches[(i)]) // INLINED!! - if ( s__Research_whichRace[r] == whichRace ) then - set counter=counter + GetPlayerTechCountSimple(s__Research_researchId[r], whichPlayer) - endif - set i=i + 1 - endloop - return counter -endfunction -function GetResearchesPercentageForRace takes integer whichRace,player whichPlayer returns real - return I2R(GetResearchesResearchedForRace(whichRace , whichPlayer)) / I2R(GetResearchesTotalForRace(whichRace)) * 100.0 -endfunction -function ResearchAllForPlayer takes player whichPlayer,integer whichRace returns nothing - local integer r= 0 - local integer i= 0 - local integer max= (WoWReforgedResearches__researchesCounter) // INLINED!! - loop - exitwhen ( i == max ) - set r=(WoWReforgedResearches__researches[(i)]) // INLINED!! - if ( (s__Research_whichRace[(r)]) == whichRace and GetPlayerTechCount(whichPlayer, (s__Research_researchId[(r)]), false) < (s__Research_levels[(r)]) ) then // INLINED!! - call h__SetPlayerTechResearched(whichPlayer, (s__Research_researchId[(r)]), (s__Research_levels[(r)])) // INLINED!! - endif - set i=i + 1 - endloop -endfunction -//library WoWReforgedResearches ends -//library WoWReforgedZones: - - // seasons - - function s__Zone_create takes nothing returns integer - local integer this= s__Zone__allocate() - set s__Zone_r[this]=CreateRegion() - return this - endfunction -function GetZonesMax takes nothing returns integer - return WoWReforgedZones__zonesCounter -endfunction -function WoWReforgedZones__AddZoneRectEx takes integer z,rect whichRect returns nothing - call RegionAddRect(s__Zone_r[z], whichRect) - set s___Zone_rects[s__Zone_rects[z]+s__Zone_rectsCounter[z]]=whichRect - set s__Zone_rectsCounter[z]=s__Zone_rectsCounter[z] + 1 -endfunction -function AddZoneEx takes string name,rect whichRect,string icon,string description,playercolor color,string id,integer treeTypeId returns integer - local integer z= s__Zone_create() - set s__AbstractZone_name[z]=name - call WoWReforgedZones__AddZoneRectEx(z , whichRect) - call TriggerRegisterEnterRegion(WoWReforgedZones__enterTrigger, s__Zone_r[z], null) - set s__AbstractZone_icon[z]=icon - set s__AbstractZone_description[z]=description - set s__Zone_color[z]=color - set s__AbstractZone_id[z]=id - set s__Zone_treeTypeId[z]=treeTypeId - set s__AbstractZone_zoneType[z]=ZONE_TYPE_ZONE - - if ( WoWReforgedZones__currentContinent != 0 ) then - set s__AbstractZone_parent[z]=WoWReforgedZones__currentContinent - elseif ( WoWReforgedZones__currentWorld != 0 ) then - set s__AbstractZone_parent[z]=WoWReforgedZones__currentWorld - endif - - set WoWReforgedZones__zones[WoWReforgedZones__zonesCounter]=z - set WoWReforgedZones__zonesCounter=WoWReforgedZones__zonesCounter + 1 - - set WoWReforgedZones__currentZone=z - - return z -endfunction -function AddZone takes nothing returns integer - return AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) -endfunction -function AddZoneWorldEx takes string name,string icon,string description,string id returns integer - local integer z= s__AbstractZone__allocate() - set s__AbstractZone_name[z]=name - set s__AbstractZone_icon[z]=icon - set s__AbstractZone_description[z]=description - set s__AbstractZone_zoneType[z]=ZONE_TYPE_WORLD - set s__AbstractZone_parent[z]=0 - - set WoWReforgedZones__zones[WoWReforgedZones__zonesCounter]=z - set WoWReforgedZones__zonesCounter=WoWReforgedZones__zonesCounter + 1 - - set WoWReforgedZones__currentWorld=z - - return z -endfunction -function AddZoneWorld takes nothing returns integer - return AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) -endfunction -function AddZoneContinentEx takes string name,string icon,string description,string id returns integer - local integer z= s__AbstractZone__allocate() - set s__AbstractZone_name[z]=name - set s__AbstractZone_icon[z]=icon - set s__AbstractZone_description[z]=description - set s__AbstractZone_zoneType[z]=ZONE_TYPE_CONTINENT - - set WoWReforgedZones__currentContinent=z - - if ( WoWReforgedZones__currentWorld != 0 ) then - set s__AbstractZone_parent[z]=WoWReforgedZones__currentWorld - endif - - set WoWReforgedZones__zones[WoWReforgedZones__zonesCounter]=z - set WoWReforgedZones__zonesCounter=WoWReforgedZones__zonesCounter + 1 - - return z -endfunction -function AddZoneContinent takes nothing returns integer - return AddZoneContinentEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) -endfunction -function ResetZoneCurrentWorld takes nothing returns nothing - set WoWReforgedZones__currentWorld=0 -endfunction -function ResetZoneCurrentContinent takes nothing returns nothing - set WoWReforgedZones__currentContinent=0 -endfunction -function AddZoneRect takes nothing returns nothing - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) -endfunction -function SetZoneTerrainTypeLordaeron takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON -endfunction -function SetZoneTerrainTypeAshenvale takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE -endfunction -function SetZoneTerrainTypeNorthrend takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND -endfunction -function SetZoneTerrainTypeBarrens takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS -endfunction -function SetZoneTerrainTypeOutland takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND -endfunction -function SetZoneTerrainTypeSunkenRuins takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS -endfunction -function SetZoneTerrainTypeSea takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA -endfunction -function SetZoneTerrainTypeDungeon takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON -endfunction -function SetZoneTerrainTypeUnderground takes nothing returns nothing - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON -endfunction -function GetZone takes integer index returns integer - return WoWReforgedZones__zones[index] -endfunction -function GetZoneName takes integer z returns string - return s__AbstractZone_name[z] -endfunction -function GetZoneRectsCounter takes integer z returns integer - return s__Zone_rectsCounter[z] -endfunction -function GetZoneRect takes integer z,integer index returns rect - return s___Zone_rects[s__Zone_rects[z]+index] -endfunction -function GetZoneArea takes integer z returns real - local real result= 0.0 - local integer i= 0 - local integer max= (s__Zone_rectsCounter[(z)]) // INLINED!! - loop - exitwhen ( i == max ) - set result=result + GetRectWidthBJ((s___Zone_rects[s__Zone_rects[(z )]+( i)])) * GetRectHeightBJ((s___Zone_rects[s__Zone_rects[(z )]+( i)])) // INLINED!! - set i=i + 1 - endloop - return result -endfunction -function GetZoneAreaOfChildren takes integer zone returns real - local integer z= 0 - local real result= 0.0 - local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - loop - exitwhen ( i == max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - if ( s__AbstractZone_parent[z] == zone and s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE ) then - set result=result + GetZoneArea((z)) - endif - set i=i + 1 - endloop - return result -endfunction -function GetZoneAreaOfGrandChildren takes integer zone returns real - local integer z= 0 - local real result= 0.0 - local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - loop - exitwhen ( i == max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - if ( s__AbstractZone_parent[z] == zone ) then - if ( s__AbstractZone_zoneType[z] == ZONE_TYPE_CONTINENT ) then - set result=result + GetZoneAreaOfChildren(z) - elseif ( s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE ) then - set result=result + GetZoneArea((z)) - endif - endif - set i=i + 1 - endloop - return result -endfunction -function GetZoneTotalArea takes integer zone returns real - if ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_WORLD ) then - return GetZoneAreaOfGrandChildren(zone) - elseif ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_CONTINENT ) then - return GetZoneAreaOfChildren(zone) - elseif ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_ZONE ) then - return GetZoneArea((zone)) - endif - return 0.0 -endfunction -function GetZoneIcon takes integer z returns string - return s__AbstractZone_icon[z] -endfunction -function GetZoneDescription takes integer z returns string - return s__AbstractZone_description[z] -endfunction -function GetZoneColor takes integer z returns playercolor - return s__Zone_color[z] -endfunction -function GetZoneId takes integer z returns string - return s__AbstractZone_id[z] -endfunction -function GetZoneTreeTypeId takes integer z returns integer - return s__Zone_treeTypeId[z] -endfunction -function GetZoneTerrainType takes integer z returns integer - return s__Zone_terrainType[z] -endfunction -function GetZoneDiscoveringMessage takes integer z returns string - return "Discovered: |cff00ff00" + s__AbstractZone_name[z] + "|r" -endfunction -function GetZoneEnteringMessage takes integer z returns string - return "Entering now: |cff00ff00" + s__AbstractZone_name[z] + "|r" -endfunction -function GetZoneIndexByCoordinates takes real x,real y returns integer - local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer result= - 1 - local integer z= 0 - loop - exitwhen ( i == max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - if ( s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE and IsPointInRegion(s__Zone_r[(z)], x, y) ) then - set result=i - endif - set i=i + 1 - endloop - return result -endfunction -function GetZoneByCoordinates takes real x,real y returns integer - local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer z= 0 - loop - exitwhen ( i == max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - if ( s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE and IsPointInRegion(s__Zone_r[(z)], x, y) ) then - return (z) - endif - set i=i + 1 - endloop - return 0 -endfunction -function GetZoneRectByCoordinates takes integer z,real x,real y returns integer - local integer i= 0 - local integer max= (s__Zone_rectsCounter[(z)]) // INLINED!! - loop - exitwhen ( i == max ) - if ( RectContainsCoords((s___Zone_rects[s__Zone_rects[(z )]+( i)]), x, y) ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function GetZoneNameByCoordinates takes real x,real y returns string - local integer z= GetZoneByCoordinates(x , y) - if ( z != 0 ) then - return s__AbstractZone_name[z] - endif - return "" -endfunction -function GetPlayerShowZoneHints takes player whichPlayer returns boolean - return udg_PlayerShowZonesHints[GetConvertedPlayerId(whichPlayer)] -endfunction -function SetPlayerShowZoneHints takes player whichPlayer,boolean show returns nothing - set udg_PlayerShowZonesHints[GetConvertedPlayerId(whichPlayer)]=show -endfunction -function ShowCurrentZoneEx takes player whichPlayer,unit first returns nothing - local real x= GetUnitX(first) - local real y= GetUnitY(first) - local integer z= GetZoneByCoordinates(x , y) - if ( z != 0 ) then - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff00ff00" + s__AbstractZone_name[z] + "|r") - else - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff00ff00Unknown|r") - endif -endfunction -function GetZoneFullHint takes integer zone returns string - local string msg= "|cff00ff00" + s__AbstractZone_name[zone] + "|r" - if ( s__AbstractZone_parent[zone] != 0 ) then - set msg=msg + " - |cff00ff00" + s__AbstractZone_name[s__AbstractZone_parent[zone]] + "|r" - - if ( s__AbstractZone_parent[s__AbstractZone_parent[zone]] != 0 ) then - set msg=msg + " - |cff00ff00" + s__AbstractZone_name[s__AbstractZone_parent[s__AbstractZone_parent[zone]]] + "|r" - endif - endif - - set msg=msg + "\n" + s__AbstractZone_description[zone] - - return msg -endfunction -function ShowCurrentZoneFullEx takes player whichPlayer,unit first returns nothing - local real x= GetUnitX(first) - local real y= GetUnitY(first) - local integer z= GetZoneByCoordinates(x , y) - if ( z != 0 ) then - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, GetZoneFullHint(z)) - else - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff00ff00Unknown|r") - endif -endfunction -function WoWReforgedZones__GetFirstSelected takes player whichPlayer returns unit - local group g= GetUnitsSelectedAll(whichPlayer) - local unit first= FirstOfGroup(g) - call GroupClear(g) - call DestroyGroup(g) - set g=null - return first -endfunction -function WoWReforgedZones__GetMainUnit takes player whichPlayer returns unit - return WoWReforgedZones__GetFirstSelected(whichPlayer) -endfunction -function ShowCurrentZone takes player whichPlayer returns nothing - local unit first= (WoWReforgedZones__GetFirstSelected((whichPlayer))) // INLINED!! - if ( first != null ) then - call ShowCurrentZoneEx(whichPlayer , first) - set first=null - else - call SimError(whichPlayer , "No unit selected.") - endif -endfunction -function ShowCurrentZoneFull takes player whichPlayer returns nothing - local unit first= (WoWReforgedZones__GetFirstSelected((whichPlayer))) // INLINED!! - if ( first != null ) then - call ShowCurrentZoneFullEx(whichPlayer , first) - set first=null - else - call SimError(whichPlayer , "No unit selected.") - endif -endfunction -function WoWReforgedZones__TriggerConditionEnter takes nothing returns boolean - local unit enteringUnit= GetEnteringUnit() - local player owner= GetOwningPlayer(enteringUnit) - local integer playerId= GetPlayerId(owner) - local integer z= 0 - if ( IsPlayerHero(enteringUnit) ) then - set z=GetZoneByCoordinates(GetUnitX(enteringUnit) , GetUnitY(enteringUnit)) - if ( z != 0 ) then - if ( s___Zone_discovered[s__Zone_discovered[z]+playerId] ) then - if ( (udg_PlayerShowZonesHints[GetConvertedPlayerId((owner))]) ) then // INLINED!! - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, ("Entering now: |cff00ff00" + s__AbstractZone_name[(z)] + "|r")) // INLINED!! - endif - else - set s___Zone_discovered[s__Zone_discovered[z]+playerId]=true - if ( (udg_PlayerShowZonesHints[GetConvertedPlayerId((owner))]) ) then // INLINED!! - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, ("Discovered: |cff00ff00" + s__AbstractZone_name[(z)] + "|r")) // INLINED!! - endif - call AchievementExplorer(owner) - call AchievementMasterExplorer(owner , (WoWReforgedZones__zonesCounter)) // INLINED!! - endif - endif - endif - set enteringUnit=null - set owner=null - return false -endfunction -function WoWReforgedZones__Init takes nothing returns nothing - call TriggerAddCondition(WoWReforgedZones__enterTrigger, Condition(function WoWReforgedZones__TriggerConditionEnter)) -endfunction -//library WoWReforgedZones ends -//library WoWReforgedAllRaces: -function InitRaceFreelancer takes nothing returns nothing - local integer r= udg_RaceFreelancer - - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( FREELANCER_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_FREELANCER_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( FREELANCER_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_FREELANCER_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( FREELANCER_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_FREELANCER_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( FREELANCER_MERCENARY_CAMP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_FREELANCER_MERCENARY_CAMP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( FREELANCER_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_FREELANCER_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( FREELANCER_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_FREELANCER_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( FREELANCER_ADVANCED_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_FREELANCER_ADVANCED_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( FREELANCER_ADVANCED_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_FREELANCER_ADVANCED_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( FREELANCER_ADVANCED_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_FREELANCER_ADVANCED_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( FREELANCER_MERCENARY_CAMP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_FREELANCER_MERCENARY_CAMP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( FREELANCER_HOUSING)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_FREELANCER_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - //call SetRaceSpecialBuilding(r, HUMAN_ARCANE_OBSERVATORY) - //call SetRaceSpecialBuildingItem(r, ITEM_HUMAN_SPECIAL_BUILDING) - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( FREELANCER_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_FREELANCER_SHIPYARD)) // INLINED!! - - // researches - call AddResearch(UPG_FREELANCER_MAGIC_SENTRY , r) - call AddResearch(UPG_FREELANCER_MASONRY , r) - call AddResearch(UPG_FREELANCER_CHEAP_EVOLUTION , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( FREELANCER_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( CREEP_UNBROKEN_DARK_WEAVER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( CREEP_EREDAR_WARLOCK)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( CREEP_BANDIT_LORD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( CREEP_DARK_TROLL_PRIEST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( CREEP_WRAITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( CREEP_DARK_WIZARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( CREEP_SEA_GIANT_BEHEMOTH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( CREEP_SEA_GIANT_BEHEMOTH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( CREEP_HARPY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( CREEP_DOOM_GUARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( CREEP_GREEN_DRAKE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( CREEP_HARPY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( FREELANCER_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( FREELANCER_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( FREELANCER_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( FREELANCER_PET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( ORC_TRANSPORT_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( ORC_FRIGATE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( ORC_JUGGERNAUGHT)) // INLINED!! -endfunction -function InitRaceOldHorde takes nothing returns nothing - local integer r= udg_RaceOldHorde - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( OLD_HORDE_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( OLD_HORDE_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( OLD_HORDE_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( OLD_HORDE_FARM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( OLD_HORDE_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( OLD_HORDE_BLACKSMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( OLD_HORDE_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( OLD_HORDE_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( OLD_HORDE_TEMPLE_OF_THE_DAMNED)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( OLD_HORDE_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( OLD_HORDE_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( OLD_HORDE_GUARD_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( OLD_HORDE_CANNON_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( OLD_HORDE_CANNON_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( OLD_HORDE_GOBLIN_ALCHEMIST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( OLD_HORDE_DRAGON_ROOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SACRIFICAL_PIT , ( OLD_HORDE_OGRE_MOUND)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( OLD_HORDE_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - //constant integer OLD_HORDE_FOUNDRY = 'o07V' - //constant integer OLD_HORDE_OIL_PLATFORM = 'o07X' - //constant integer OLD_HORDE_OIL_REFINERY = 'o088' - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( OLD_HORDE_FOUNDRY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , ( OLD_HORDE_OIL_REFINERY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( OLD_HORDE_SHIPYARD)) // INLINED!! - - // researches - call AddResearch(UPG_HORDE_BACKPACK , r) - call AddResearch(UPG_HORDE_BERSERKER_REGENERATION , r) - call AddResearch(UPG_HORDE_BERSERKER_SCOUTING , r) - call AddResearch(UPG_HORDE_DEATH_AND_DECAY , r) - call AddResearch(UPG_HORDE_HASTE , r) - call AddResearch(UPG_HORDE_OGRE_MAGES , r) - call AddResearch(UPG_HORDE_RAISE_DEAD , r) - call AddResearch(UPG_HORDE_LIGHTER_AXES , r) - call AddResearch(UPG_HORDE_TROLL_BERSERKER_TRAINING , r) - call AddResearch(UPG_HORDE_UNHOLY_ARMOR , r) - call AddResearch(UPG_HORDE_UPGRADE_CANNONS , r) - call AddResearch(UPG_HORDE_UPGRADE_CATAPULT , r) - call AddResearch(UPG_HORDE_UPGRADE_SHIELDS , r) - call AddResearch(UPG_HORDE_UPGRADE_SHIP_ARMOR , r) - call AddResearch(UPG_HORDE_UPGRADE_THROWING_AXES , r) - call AddResearch(UPG_HORDE_UPGRADE_WEAPONS , r) - call AddResearch(UPG_HORDE_UPGRADE_WHIRLWIND , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( OLD_HORDE_WORKER_BASE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( OLD_HORDE_GRUNT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( OLD_HORDE_TROLL_AXETHROWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( OLD_HORDE_OGRE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( OLD_HORDE_DEATH_KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( OLD_HORDE_DEATH_KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( OLD_HORDE_DEATH_KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( OLD_HORDE_CATPULT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( OLD_HORDE_GOBLIN_SAPPERS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( OLD_HORDE_GOBLIN_ZEPPELIN)) // INLINED!! - //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( OLD_HORDE_DRAGON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( OLD_HORDE_GOBLIN_ZEPPELIN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( OLD_HORDE_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( OLD_HORDE_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( OLD_HORDE_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( OLD_HORDE_PET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( ORC_TRANSPORT_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( ORC_FRIGATE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( ORC_JUGGERNAUGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , ( OLD_HORDE_GREAT_SEE_TURTLE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , ( OLD_HORDE_OIL_TANKER)) // INLINED!! -endfunction -function InitRaceAllianceOfLordaeron takes nothing returns nothing - local integer r= udg_RaceAllianceOfLordaeron - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( ALLIANCE_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( ALLIANCE_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( ALLIANCE_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( ALLIANCE_FARM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( ALLIANCE_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( ALLIANCE_BLACKSMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( ALLIANCE_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( ALLIANCE_CHURCH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( ALLIANCE_MAGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( ALLIANCE_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( ALLIANCE_SCOUT_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( ALLIANCE_GUARD_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( ALLIANCE_CANNON_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( ALLIANCE_CANNON_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( ALLIANCE_GNOMISH_INVENTOR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( ALLIANCE_AVIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SACRIFICAL_PIT , ( ALLIANCE_STABLES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( ALLIANCE_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - //ALLIANCE_OIL_PLATFORM - //call SetRaceSpecialBuilding(r, OLD_HORDE_FOUNDRY) - //call SetRaceSpecialBuilding2(r, OLD_HORDE_OIL_REFINERY) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( ALLIANCE_SHIPYARD)) // INLINED!! - - // researches - call AddResearch(UPG_ALLIANCE_BACKPACK , r) - call AddResearch(UPG_ALLIANCE_BLIZZARD , r) - call AddResearch(UPG_ALLIANCE_ELVEN_RANGER_TRAINING , r) - call AddResearch(UPG_ALLIANCE_HEALING , r) - call AddResearch(UPG_ALLIANCE_INVISIBILITY , r) - call AddResearch(UPG_ALLIANCE_PALADINS , r) - call AddResearch(UPG_ALLIANCE_POLYMORPH , r) - call AddResearch(UPG_ALLIANCE_SLOW , r) - call AddResearch(UPG_ALLIANCE_UPGRADE_ARROWS , r) - call AddResearch(UPG_ALLIANCE_UPGRADE_BALLISTAS , r) - call AddResearch(UPG_ALLIANCE_UPGRADE_SHIELDS , r) - call AddResearch(UPG_ALLIANCE_UPGRADE_SWORDS , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( ALLIANCE_WORKER_BASE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( ALLIANCE_FOOTMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( ALLIANCE_ELVEN_ARCHER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( ALLIANCE_KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( ALLIANCE_MAGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( ALLIANCE_MAGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( ALLIANCE_MAGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( ALLIANCE_BALLISTA)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( ALLIANCE_DEMOLITION_SQUAD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( ALLIANCE_FLYING_MACHINE)) // INLINED!! - //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( ALLIANCE_GRYPHON_RIDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( ALLIANCE_FLYING_MACHINE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( ALLIANCE_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( ALLIANCE_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( ALLIANCE_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( ALLIANCE_PET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! - //call SetRaceShipSpecial1(r, OLD_HORDE_GREAT_SEE_TURTLE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , ( ALLIANCE_OIL_TANKER)) // INLINED!! -endfunction -function InitRaceHuman takes nothing returns nothing - local integer r= udg_RaceHuman - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( TOWN_HALL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_HUMAN_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( KEEP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_HUMAN_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( CASTLE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_HUMAN_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( HOUSE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_HUMAN_FARM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_HUMAN_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( BLACKSMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_HUMAN_BLACK_SMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( LUMBER_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_HUMAN_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( HUMAN_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_HUMAN_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( ARCANE_SANCTUM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_HUMAN_ARCANE_SANCTUM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( ARCANE_VAULT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_HUMAN_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_HUMAN_SCOUT_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( GUARD_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_HUMAN_GUARD_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( CANNON_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_HUMAN_CANNON_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( ARCANE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_HUMAN_ARCANE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( WORKSHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_HUMAN_WORKSHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( AVIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_HUMAN_GRYPHON_AVIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( HUMAN_HOUSING)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_HUMAN_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( HUMAN_ARCANE_OBSERVATORY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_HUMAN_SPECIAL_BUILDING)) // INLINED!! - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( HUMAN_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_HUMAN_SHIPYARD)) // INLINED!! - - // researches - call AddResearch(UPG_HUMAN_BACKPACK , r) - call AddResearch(UPG_MASONRY , r) - call AddResearch(UPG_SIGHT , r) - call AddResearch(UPG_DEFEND , r) - call AddResearch(UPG_BREEDING , r) - call AddResearch(UPG_PRAYING , r) - call AddResearch(UPG_SORCERY , r) - call AddResearch(UPG_LEATHER , r) - call AddResearch(UPG_ARMOR , r) - call AddResearch(UPG_MELEE , r) - call AddResearch(UPG_RANGED , r) - call AddResearch(UPG_BANDIT_WOOD , r) - call AddResearch(UPG_GUN_RANGE , r) - call AddResearch(UPG_WOOD , r) - call AddResearch(UPG_SENTINEL , r) - call AddResearch(UPG_BOMBS , r) - call AddResearch(UPG_HAMMERS , r) - call AddResearch(UPG_CONT_MAGIC , r) - call AddResearch(UPG_FRAGS , r) - call AddResearch(UPG_TANK , r) - call AddResearch(UPG_FLAK , r) - call AddResearch(UPG_CLOUD , r) - call AddResearch(UPG_HUMAN_SUNDERING_BLADES , r) - call AddResearch(UPG_HUMAN_FLARE , r) - call AddResearch(UPG_HUMAN_ARCANE_OBSERVATORY , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( PEASANT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( FOOTMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( RIFLEMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( PRIEST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( SORCERESS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( SPELL_BREAKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( TANK)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( MORTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( GYRO)) // INLINED!! - //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( GRYPHON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( HUMAN_DRAGON_HAWK)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( HUMAN_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( HUMAN_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( HUMAN_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( HUMAN_PET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! -endfunction -function InitRaceOrc takes nothing returns nothing - local integer r= udg_RaceOrc - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( GREAT_HALL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_ORC_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( STRONGHOLD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_ORC_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( FORTRESS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_ORC_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( BURROW)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_ORC_BURROW)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( ORC_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_ORC_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( FORGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_ORC_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( FORGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_ORC_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( ORC_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_ORC_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( LODGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_ORC_LODGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( VOODOO_LOUNGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_ORC_VOODOO_LOUNGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( BESTIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_ORC_BEASTIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( TOTEM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_ORC_TOTEM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( ORC_HOUSING)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_ORC_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( FOUNTAIN_OF_BLOOD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_ORC_SPECIAL_BUILDING)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , ( FEL_DRAGON_ROOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( ORC_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_ORC_SHIPYARD)) // INLINED!! - - // researches - call AddResearch(UPG_ORC_BACKPACK , r) - call AddResearch(UPG_ORC_MELEE , r) - call AddResearch(UPG_ORC_RANGED , r) - call AddResearch(UPG_ORC_ARMOR , r) - call AddResearch(UPG_ORC_WAR_DRUMS , r) - call AddResearch(UPG_ORC_PILLAGE , r) - call AddResearch(UPG_ORC_BERSERK , r) - call AddResearch(UPG_ORC_PULVERIZE , r) - call AddResearch(UPG_ORC_ENSNARE , r) - call AddResearch(UPG_ORC_VENOM , r) - call AddResearch(UPG_ORC_DOCS , r) - call AddResearch(UPG_ORC_SHAMAN , r) - call AddResearch(UPG_ORC_SPIKES , r) - call AddResearch(UPG_ORC_BURROWS , r) - call AddResearch(UPG_ORC_REGEN , r) - call AddResearch(UPG_ORC_FIRE , r) - call AddResearch(UPG_ORC_SWALKER , r) - call AddResearch(UPG_ORC_BERSERKER , r) - call AddResearch(UPG_ORC_NAPTHA , r) - call AddResearch(UPG_FEL , r) - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( PEON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( GRUNT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( HEAD_HUNTER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( RAIDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( WITCH_DOCTOR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( SHAMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( SPIRIT_WALKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( KODO_BEAST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( CATAPULT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( BATRIDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( TAUREN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( WYVERN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( BATRIDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( ORC_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( ORC_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( ORC_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( ORC_PET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( ORC_TRANSPORT_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( ORC_FRIGATE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( ORC_JUGGERNAUGHT)) // INLINED!! -endfunction -function InitRaceUndead takes nothing returns nothing - local integer r= udg_RaceUndead -endfunction -function InitRaceNightElf takes nothing returns nothing - local integer r= udg_RaceNightElf -endfunction -function InitRaceStormwind takes nothing returns nothing - local integer r= udg_RaceStormwind - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( STORMWIND_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_STORMWIND_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( STORMWIND_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_STORMWIND_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( STORMWIND_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_STORMWIND_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( STORMWIND_FARM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_STORMWIND_FARM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( STORMWIND_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_STORMWIND_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( STORMWIND_BLACKSMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_STORMWIND_BLACKSMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( STORMWIND_LUMBER_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_STORMWIND_LUMBER_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( STORMWIND_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_STORMWIND_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( STORMWIND_MAGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_STORMWIND_MAGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( STORMWIND_ARCANE_VAULT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_STORMWIND_ARCANE_VAULT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( STORMWIND_SCOUT_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_STORMWIND_SCOUT_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( STORMWIND_GUARD_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_STORMWIND_GUARD_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( STORMWIND_CANNON_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_STORMWIND_CANNON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( STORMWIND_ARCANE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_STORMWIND_ARCANE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( STORMWIND_WORKSHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_STORMWIND_WORKSHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( STORMWIND_AVIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_STORMWIND_AVIARY)) // INLINED!! - //call SetRaceSacrificialPit(r, DALARAN_ELEMENTAL_SANCTUARY_1) - //call SetRaceMine(r, DALARAN_MINE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( STORMWIND_HOUSING)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_STORMWIND_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( STORMWIND_CATHEDRAL_OF_LIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_STORMWIND_CATHEDRAL_OF_LIGHT)) // INLINED!! - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( STORMWIND_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_STORMWIND_SHIPYARD)) // INLINED!! - call AddResearch(UPG_STORMWIND_LUMBER , r) - call AddResearch(UPG_STORMWIND_MASONRY , r) - call AddResearch(UPG_STORMWIND_MELEE , r) - call AddResearch(UPG_STORMWIND_ARMOR , r) - call AddResearch(UPG_STORMWIND_RANGED , r) - call AddResearch(UPG_STORMWIND_LEATHER , r) - call AddResearch(UPG_STORMWIND_DEFEND , r) - call AddResearch(UPG_STORMWIND_BOWS , r) - call AddResearch(UPG_STORMWIND_MARKSMANSHIP , r) - call AddResearch(UPG_STORMWIND_SUNDERING_BLADES , r) - call AddResearch(UPG_STORMWIND_BACKPACK , r) - call AddResearch(UPG_STORMWIND_SORCERY , r) - call AddResearch(UPG_STORMWIND_MAGE , r) - call AddResearch(UPG_STORMWIND_PRIEST , r) - call AddResearch(UPG_STORMWIND_ANIMAL , r) - call AddResearch(UPG_STORMWIND_UNMOUNT , r) - call AddResearch(UPG_STORMWIND_MAGIC_SENTRY , r) - call AddResearch(UPG_STORMWIND_REINFORCED_DEFENSES , r) - call AddResearch(UPG_STORMWIND_CATHEDRAL_OF_LIGHT , r) - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( STORMWIND_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( STORMWIND_FOOTMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( STORMWIND_RANGER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( STORMWIND_KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( STORMWIND_PRIEST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( STORMWIND_SORCERESS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( STORMWIND_MAGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( STORMWIND_ALLIANCE_SIEGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( STORMWIND_CANNON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( STORMWIND_AIR_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_4 , ( STORMWIND_BANNER_CARRIER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( STORMWIND_BISHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( STORMWIND_GRYPHON_RIDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( STORMWIND_EAGLE_KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_3 , ( STORMWIND_GRYPHON_KNIGHT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_4 , ( STORMWIND_LION_RIDER)) // INLINED!! - //call SetRaceShade(r, DALARAN_MUTANT) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( STORMWIND_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( STORMWIND_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( STORMWIND_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( STORMWIND_PET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! -endfunction -function InitRaceDalaran takes nothing returns nothing - local integer r= udg_RaceDalaran - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( DALARAN_TIER_1)) // INLINED!! - //call SetRaceTier1Item(r, ITEM_HUMAN_TIER_1) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( DALARAN_TIER_2)) // INLINED!! - //call SetRaceTier2Item(r, ITEM_HUMAN_TIER_2) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DALARAN_TIER_3)) // INLINED!! - //call SetRaceTier3Item(r, ITEM_HUMAN_TIER_3) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( DALARAN_POWER_GENERATOR)) // INLINED!! - //call SetRaceFarmItem(r, ITEM_HUMAN_FARM) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( DALARAN_BARRACKS)) // INLINED!! - //call SetRaceBarracksItem(r, ITEM_HUMAN_BARRACKS) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( DALARAN_BLACKSMITH)) // INLINED!! - //call SetRaceBlacksmithItem(r, ITEM_HUMAN_BLACK_SMITH) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( DALARAN_BLACKSMITH)) // INLINED!! - //call SetRaceMillItem(r, ITEM_HUMAN_MILL) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( DALARAN_ALTAR)) // INLINED!! - //call SetRaceAltarItem(r, ITEM_HUMAN_ALTAR) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( DALARAN_ARCANE_SANCTUM)) // INLINED!! - //call SetRaceArcaneSanctumItem(r, ITEM_HUMAN_ARCANE_SANCTUM) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( DALARAN_SHOP)) // INLINED!! - //call SetRaceShopItem(r, ITEM_HUMAN_SHOP) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( DALARAN_GUARD_TOWER_1)) // INLINED!! - //call SetRaceScoutTowerItem(r, ITEM_HUMAN_SCOUT_TOWER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( DALARAN_GUARD_TOWER_2)) // INLINED!! - //call SetRaceGuardTowerItem(r, ITEM_HUMAN_GUARD_TOWER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( DALARAN_GUARD_TOWER_2)) // INLINED!! - //call SetRaceCannonTowerItem(r, ITEM_HUMAN_CANNON_TOWER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( DALARAN_GUARD_TOWER_2)) // INLINED!! - //call SetRaceArcaneTowerItem(r, ITEM_HUMAN_ARCANE_TOWER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( DALARAN_ZOO)) // INLINED!! - //call SetRaceWorkshopItem(r, ITEM_HUMAN_WORKSHOP) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( DALARAN_AVIARY)) // INLINED!! - //call SetRaceAviaryItem(r, ITEM_HUMAN_GRYPHON_AVIARY) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SACRIFICAL_PIT , ( DALARAN_ELEMENTAL_SANCTUARY_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MINE , ( DALARAN_MINE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DALARAN_HOUSING)) // INLINED!! - //call SetRaceHousingItem(r, ITEM_HUMAN_HOUSING) - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( DALARAN_VIOLET_CITADEL)) // INLINED!! - //call SetRaceSpecialBuildingItem(r, ITEM_HUMAN_SPECIAL_BUILDING) - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DALARAN_SHIPYARD)) // INLINED!! - //call SetRaceShipyardItem(r, ITEM_HUMAN_SHIPYARD) - - call AddResearch(UPG_DALARAN_GOLD , r) - call AddResearch(UPG_DALARAN_MELEE , r) - call AddResearch(UPG_DALARAN_ARMOR , r) - call AddResearch(UPG_DALARAN_CR_ATTACK , r) - call AddResearch(UPG_DALARAN_CR_ARMOR , r) - call AddResearch(UPG_DALARAN_DEFEND , r) - call AddResearch(UPG_DALARAN_SORCERESS , r) - call AddResearch(UPG_DALARAN_WIZARD , r) - call AddResearch(UPG_DALARAN_FIRE_MAGE , r) - call AddResearch(UPG_DALARAN_GOLEM , r) - call AddResearch(UPG_DALARAN_ANIMAL , r) - call AddResearch(UPG_DALARAN_CLOUD , r) - call AddResearch(UPG_DALARAN_BACKPACK , r) - call AddResearch(UPG_DALARAN_MAGIC_SENTRY , r) - call AddResearch(UPG_DALARAN_BLINK , r) - call AddResearch(UPG_DALARAN_MANA_SHIELD , r) - call AddResearch(UPG_DALARAN_SPAWN_FIRE_ELEMENTALS , r) - call AddResearch(UPG_DALARAN_SHIELD , r) - call AddResearch(UPG_DALARAN_ELEMENTAL , r) - call AddResearch(UPG_DALARAN_FEEDBACK , r) - call AddResearch(UPG_DALARAN_FLYING_CITY , r) - call AddResearch(UPG_DALARAN_VIOLET_CITADEL , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( DALARAN_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TOWN_HALL_3 , ( DALARAN_SAND_ELEMENTAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DALARAN_PIKEMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DALARAN_APPRENTICE_WIZARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DALARAN_SUPPLY_CART)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_4 , ( DALARAN_REJECT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DALARAN_WIZARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( DALARAN_SORCERESS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( DALARAN_FIRE_MAGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 , ( DALARAN_FROST_ELEMENTAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( DALARAN_GUARDIAN_GOLEM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( DALARAN_FLESH_GOLEM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( DALARAN_FIRE_ELEMENTAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_4 , ( DALARAN_VOID_ELEMENTAL)) // INLINED!! - //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DALARAN_AIR_ELEMENTAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( DALARAN_DRAGON_HAWK)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_3 , ( DALARAN_LIGHTNING_ELEMENTAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_4 , ( DALARAN_POISON_ELEMENTAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHADE , ( DALARAN_MUTANT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DALARAN_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DALARAN_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DALARAN_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DALARAN_PET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , ( DALARAN_WATER_ELEMENTAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , ( DALARAN_SEA_ELEMENTAL)) // INLINED!! -endfunction -function InitRaceCentaur takes nothing returns nothing - local integer r= udg_RaceCentaur - - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( CENTAUR_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( CENTAUR_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( CENTAUR_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( CENTAUR_TENT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( CENTAUR_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( CENTAUR_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( CENTAUR_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( CENTAUR_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( CENTAUR_LODGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( CENTAUR_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( CENTAUR_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( CENTAUR_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( CENTAUR_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( CENTAUR_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( CENTAUR_ROOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( CENTAUR_KHAN_TENT)) // INLINED!! - //call SetRaceSacrificialPit(r, KOBOLD_TUNNEL) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( CENTAUR_HOUSING)) // INLINED!! - //call SetRaceMine(r, KOBOLD_BOULDER_TOWER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( ORC_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( CENTAUR_SPECIAL_BUILDING)) // INLINED!! - //call SetRaceSpecialBuilding2(r, KOBOLD_BOULDER_TOWER) - // researches - call AddResearch(UPG_CENTAUR_BACKPACK , r) - call AddResearch(UPG_CENTAUR_DIVINER , r) - call AddResearch(UPG_CENTAUR_HORSE_SHOES , r) - call AddResearch(UPG_CENTAUR_REINCARNATION , r) - call AddResearch(UPG_CENTAUR_SPECIAL_BUILDING , r) - call AddResearch(UPG_CENTAUR_SORCERER , r) - call AddResearch(UPG_CENTAUR_SEARING_ARROWS , r) - call AddResearch(UPG_CENTAUR_MELEE , r) - call AddResearch(UPG_CENTAUR_RANGED , r) - call AddResearch(UPG_CENTAUR_ARMOR , r) - call AddResearch(UPG_CENTAUR_RIDE_DOWN , r) - call AddResearch(UPG_CENTAUR_TRUE_SIGHT , r) - call AddResearch(UPG_CENTAUR_SLEEP , r) - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( CENTAUR_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( CENTAUR_DRUDGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( CENTAUR_ARCHER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( CENTAUR_OUTRUNNER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( CENTAUR_DIVINER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( CENTAUR_SORCERER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( CENTAUR_SORCERER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( CENTAUR_OUTRUNNER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( CENTAUR_KHAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( CENTAUR_EAGLE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( CENTAUR_HARPY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( CENTAUR_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( CENTAUR_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( CENTAUR_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( CENTAUR_PET)) // INLINED!! -endfunction -function InitRaceGnoll takes nothing returns nothing - local integer r= udg_RaceGnoll - - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( GNOLL_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( GNOLL_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( GNOLL_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( GNOLL_HUT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( GNOLL_KENNEL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( GNOLL_LUMBERYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( GNOLL_LUMBERYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( GNOLL_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( GNOLL_ELEMENTAL_GROVE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( GNOLL_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( GNOLL_BATTLE_ARENA)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( GNOLL_BATTLE_ARENA)) // INLINED!! - //call SetRaceSacrificialPit(r, KOBOLD_TUNNEL) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( GNOLL_HOUSING)) // INLINED!! - //call SetRaceMine(r, KOBOLD_BOULDER_TOWER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( KOBOLD_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( KOBOLD_MINES)) // INLINED!! - //call SetRaceSpecialBuilding2(r, KOBOLD_BOULDER_TOWER) - // researches - call AddResearch(UPG_GNOLL_BACKPACK , r) - call AddResearch(UPG_GNOLL_ENVENOMED_WEAPONS , r) - call AddResearch(UPG_GNOLL_ENSLAVEMENT , r) - call AddResearch(UPG_GNOLL_BARREL_FORM , r) - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( GNOLL_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( GNOLL_BRUTE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( GNOLL_ASSASSIN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( GNOLL_OVERSEER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( GNOLL_MYSTWEAVER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( GNOLL_TREASURE_HUNTER)) // INLINED!! - //call SetRaceSpellBreaker(r, QUILLBOAR_NECROMANCER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( GNOLL_ROCKBREAKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( GNOLL_WARLORD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( GNOLL_WARHAWK)) // INLINED!! - //call SetRaceDragonHawk(r, QUILLBOAR_HARPY_WINDWITCH) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( GNOLL_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( GNOLL_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( GNOLL_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( GNOLL_PET)) // INLINED!! -endfunction -function InitRaceKobold takes nothing returns nothing - local integer r= udg_RaceKobold - - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( KOBOLD_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( KOBOLD_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( KOBOLD_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( KOBOLD_CAVERN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( KOBOLD_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( KOBOLD_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( KOBOLD_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( KOBOLD_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( KOBOLD_LODGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( KOBOLD_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( KOBOLD_BOULDER_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( KOBOLD_ADVANCED_BOULDER_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( KOBOLD_ADVANCED_BOULDER_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( KOBOLD_ADVANCED_BOULDER_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( KOBOLD_BEASTIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( KOBOLD_TUNNEL)) // INLINED!! - //call SetRaceSacrificialPit(r, KOBOLD_TUNNEL) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( KOBOLD_HOUSING)) // INLINED!! - //call SetRaceMine(r, KOBOLD_BOULDER_TOWER) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( KOBOLD_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( KOBOLD_MINES)) // INLINED!! - //call SetRaceSpecialBuilding2(r, KOBOLD_BOULDER_TOWER) - // researches - call AddResearch(UPG_KOBOLD_BACKPACK , r) - call AddResearch(UPG_KOBOLD_BURROW , r) - call AddResearch(UPG_KOBOLD_CANDLES , r) - call AddResearch(UPG_KOBOLD_MELEE , r) - call AddResearch(UPG_KOBOLD_ARMOR , r) - call AddResearch(UPG_KOBOLD_GEOMANCER , r) - call AddResearch(UPG_KOBOLD_MINING , r) - call AddResearch(UPG_KOBOLD_GOLD_COINS , r) - call AddResearch(UPG_KOBOLD_MINES , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( KOBOLD_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( KOBOLD_WARRIOR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( KOBOLD_HUNTER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( KOBOLD_TUNNELER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( KOBOLD_GEOMANCER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( KOBOLD_MUSHROOM_CASTER)) // INLINED!! - //call SetRaceSpellBreaker(r, QUILLBOAR_NECROMANCER) - //call SetRaceSiegeEngine(r, QUILLBOAR_QUILBEAST) - //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) - //call SetRaceGryphon(r, QUILLBOAR_HARPY_ROGUE) - //call SetRaceDragonHawk(r, QUILLBOAR_HARPY_WINDWITCH) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( KOBOLD_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( KOBOLD_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( KOBOLD_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( KOBOLD_PET)) // INLINED!! -endfunction -function InitRaceQuillboar takes nothing returns nothing - local integer r= udg_RaceQuillboar - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( QUILLBOAR_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( QUILLBOAR_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( QUILLBOAR_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( QUILLBOAR_HUT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( QUILLBOAR_TRAINING_CAMP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( QUILLBOAR_FORGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( QUILLBOAR_FORGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( QUILLBOAR_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( QUILLBOAR_HOUSE_OF_ANCESTRY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( QUILLBOAR_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( QUILLBOAR_ANIMAL_BATTLE_GROUNDS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( QUILLBOAR_SACRIFICIAL_GROUNDS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( QUILLBOAR_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - //call SetRaceShipyard(r, QUILLBOAR_THORNY_SPIRE) - //call SetRaceSpecialBuilding(r, QUILLBOAR_THORNY_SPIRE) - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - - // researches - call AddResearch(UPG_QUILLBOAR_BACKPACK , r) - call AddResearch(UPG_QUILLBOAR_MEDICINE_MAN , r) - call AddResearch(UPG_QUILLBOAR_MYSTIC , r) - call AddResearch(UPG_QUILLBOAR_NECROMANCER , r) - call AddResearch(UPG_QUILLBOAR_QUIL_SPRAY , r) - call AddResearch(UPG_QUILLBOAR_QUILLS , r) - call AddResearch(UPG_QUILLBOAR_THORNS_AURA , r) - call AddResearch(UPG_QUILLBOAR_MELEE , r) - call AddResearch(UPG_QUILLBOAR_RANGED , r) - call AddResearch(UPG_QUILLBOAR_ARMOR , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( QUILLBOAR_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( QUILLBOAR_QUILLBOAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( QUILLBOAR_HUNTER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( QUILLBOAR_RAIDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( QUILLBOAR_MEDICINE_MAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( QUILLBOAR_MYSTIC)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( QUILLBOAR_NECROMANCER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( QUILLBOAR_QUILBEAST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( QUILLBOAR_CHIEFTAIN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( QUILLBOAR_HARPY_ROGUE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( QUILLBOAR_HARPY_WINDWITCH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( QUILLBOAR_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( QUILLBOAR_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( QUILLBOAR_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( QUILLBOAR_PET)) // INLINED!! -endfunction -function InitRaceBandit takes nothing returns nothing - local integer r= udg_RaceBandit - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( BANDIT_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_TINY_BANDIT_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( BANDIT_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_TINY_BANDIT_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( BANDIT_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_TINY_BANDIT_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( BANDIT_TENT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_TINY_BANDIT_TENT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( BANDIT_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_TINY_BANDIT_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( BANDIT_BLACKSMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_TINY_BANDIT_BLACKSMITH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( BANDIT_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_TINY_BANDIT_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( BANDIT_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_TINY_BANDIT_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( BANDIT_CHURCH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_TINY_BANDIT_CHURCH)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( BANDIT_MARKET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_TINY_BANDIT_MARKET)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( BANDIT_PRISON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_TINY_BANDIT_PRISON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( BANDIT_AVIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_TINY_BANDIT_AVIARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( BANDIT_HOUSING)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_TINY_BANDIT_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - //call SetRaceShipyard(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( BANDIT_THIEVES_GUILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_TINY_BANDIT_THIEVES_GUILD)) // INLINED!! - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( BANDIT_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_TINY_BANDIT_SHIPYARD)) // INLINED!! - - // researches - call AddResearch(UPG_BANDIT_BACKPACK , r) - call AddResearch(UPG_BANDIT_ENSNARE , r) - call AddResearch(UPG_BANDIT_SHADOW_MELD , r) - call AddResearch(UPG_BANDIT_ROB , r) - call AddResearch(UPG_BANDIT_ENVENOMED_WEAPONS , r) - call AddResearch(UPG_BANDIT_ENSLAVEMENT , r) - call AddResearch(UPG_BANDIT_WIZARD , r) - call AddResearch(UPG_BANDIT_HERETIC , r) - call AddResearch(UPG_BANDIT_SLAVE_MASTER , r) - call AddResearch(UPG_BANDIT_ARMOR , r) - call AddResearch(UPG_BANDIT_MELEE , r) - call AddResearch(UPG_BANDIT_RANGED , r) - call AddResearch(UPG_BANDIT_WOOD , r) - call AddResearch(UPG_BANDIT_FEATHER_ATTACK , r) - call AddResearch(UPG_BANDIT_TRUE_SIGHT , r) - call AddResearch(UPG_BANDIT_STORM_HAMMERS , r) - call AddResearch(UPG_BANDIT_RIDE_DOWN , r) - call AddResearch(UPG_BANDIT_RESISTANT_SKIN , r) - call AddResearch(UPG_BANDIT_THIEVES_GUILD , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( BANDIT_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( BANDIT_BANDIT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( BANDIT_BRIGAND)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( BANDIT_BANDIT_LORD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( BANDIT_WIZARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( BANDIT_HERETIC)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( BANDIT_SLAVE_MASTER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( BANDIT_CARGE_CART)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( BANDIT_AMBAL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( BANDIT_CROSSBOWMAN)) // INLINED!! - //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( BANDIT_GRYPHON_RAIDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( BANDIT_CROW)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_3 , ( BANDIT_FLYING_SPEAR_THROWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( BANDIT_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( BANDIT_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( BANDIT_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( BANDIT_PET)) // INLINED!! -endfunction -function InitRaceDungeon takes nothing returns nothing - local integer r= udg_RaceDungeon - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( DUNGEON_TIER_1)) // INLINED!! - //call SetRaceTier1Item(r, ITEM_TINY_BANDIT_TIER_1) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( DUNGEON_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_DUNGEON_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DUNGEON_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_DUNGEON_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( DUNGEON_CAGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_DUNGEON_CAGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( DUNGEON_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_DUNGEON_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( DUNGEON_TORTURE_CHAMBER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_DUNGEON_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( DUNGEON_TORTURE_CHAMBER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_DUNGEON_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( DUNGEON_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_DUNGEON_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( DUNGEON_BRAZIER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_DUNGEON_BRAZIER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( DUNGEON_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_DUNGEON_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( DUNGEON_PRISON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_DUNGEON_PRISON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( DUNGEON_DRAGON_ROOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_DUNGEON_DRAGON_ROOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DUNGEON_HOUSING)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_DUNGEON_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - //call SetRaceShipyard(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( DUNGEON_THRONE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_DUNGEON_THRONE)) // INLINED!! - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DUNGEON_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_DUNGEON_SHIPYARD)) // INLINED!! - - // researches - call AddResearch(UPG_DUNGEON_BACKPACK , r) - call AddResearch(UPG_DUNGEON_MELEE , r) - call AddResearch(UPG_DUNGEON_ARMOR , r) - call AddResearch(UPG_DUNGEON_RANGED , r) - call AddResearch(UPG_DUNGEON_EAT_TREE , r) - call AddResearch(UPG_DUNGEON_BURNING_ARROWS , r) - call AddResearch(UPG_DUNGEON_GHOST , r) - call AddResearch(UPG_DUNGEON_FIRE_REVENANT , r) - call AddResearch(UPG_DUNGEON_SKELETON_BONES , r) - call AddResearch(UPG_DUNGEON_CREATE_CORPSE , r) - call AddResearch(UPG_DUNGEON_CAPTURE , r) - call AddResearch(UPG_DUNGEON_DEVOUR , r) - call AddResearch(UPG_DUNGEON_BERSERK , r) - call AddResearch(UPG_DUNGEON_SLEEP_FORM , r) - call AddResearch(DUNGEON_SPIKES , r) - call AddResearch(UPG_DUNGEON_THRONE , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( DUNGEON_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DUNGEON_SKELETON_WARRIOR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DUNGEON_SKELETON_ARCHER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DUNGEON_SKELETON_BERSERKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DUNGEON_FIRE_REVENANT)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( DUNGEON_GHOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( DUNGEON_HERETIC)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( DUNGEON_SALAMANDER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( DUNGEON_SLUDGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( DUNGEON_WAR_GOLEM)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( DUNGEON_LORD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DUNGEON_RED_DRAGON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( DUNGEON_WILDKIN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHADE , ( DUNGEON_PRISONER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DUNGEON_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DUNGEON_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DUNGEON_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DUNGEON_PET)) // INLINED!! -endfunction -function InitRaceDragonkin takes nothing returns nothing - local integer r= udg_RaceDragonkin - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( DRAGONKIN_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( DRAGONKIN_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DRAGONKIN_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( DRAGONKIN_NEST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( DRAGONKIN_BARRACKS)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( DRAGONKIN_FORGE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( DRAGONKIN_QUARRY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( DRAGONKIN_ALTAR)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( DRAGONKIN_ARCANE_TEMPLE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( DRAGONKIN_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( DRAGONKIN_ARENA)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( DRAGONKIN_ROOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DRAGONKIN_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DRAGONKIN_SHIPYARD)) // INLINED!! - //call SetRaceSpecialBuilding(r, QUILLBOAR_THORNY_SPIRE) - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - - // researches - call AddResearch(UPG_DRAGONKIN_BACKPACK , r) - call AddResearch(UPG_DRAGONKIN_SPELL_DAMAGE_REDUCTION , r) - call AddResearch(UPG_DRAGONKIN_RESISTANT_SKIN , r) - call AddResearch(UPG_DRAGONKIN_FIRE_ATTACK , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( DRAGONKIN_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DRAGONKIN_FOOTMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DRAGONKIN_RIFLEMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DRAGONKIN_DRAGON_PRIEST)) // INLINED!! - - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DRAGONKIN_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DRAGONKIN_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DRAGONKIN_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DRAGONKIN_PET)) // INLINED!! -endfunction -function InitRaceVillage takes nothing returns nothing - local integer r= udg_RaceVillage - // buildings - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( VILLAGE_TIER_1)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( VILLAGE_TIER_2)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DRAGONKIN_TIER_3)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( VILLAGE_INN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( VILLAGE_STABLES)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( VILLAGE_FRUIT_STAND)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( VILLAGE_GRANARY)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( VILLAGE_TAVERN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( VILLAGE_ANIMAL_PEN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( VILLAGE_SHOP)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( VILLAGE_OUTPOST)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( VILLAGE_BELL_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( VILLAGE_BELL_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( VILLAGE_BELL_TOWER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( VILLAGE_BARN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( VILLAGE_WIND_MILL)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DRAGONKIN_HOUSING)) // INLINED!! - //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DRAGONKIN_SHIPYARD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( DRAGONKIN_WYRMREST_TEMPLE)) // INLINED!! - //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) - - // researches - call AddResearch(UPG_DRAGONKIN_BACKPACK , r) - call AddResearch(UPG_DRAGONKIN_SPELL_DAMAGE_REDUCTION , r) - call AddResearch(UPG_DRAGONKIN_RESISTANT_SKIN , r) - call AddResearch(UPG_DRAGONKIN_FIRE_ATTACK , r) - call AddResearch(UPG_DRAGONKIN_WYRMREST_TEMPLE , r) - - // units - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( VILLAGE_WORKER)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DRAGONKIN_FOOTMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DRAGONKIN_RIFLEMAN)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DRAGONKIN_DRAGON_PRIEST)) // INLINED!! - - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DRAGONKIN_CITIZEN_MALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DRAGONKIN_CITIZEN_FEMALE)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DRAGONKIN_CHILD)) // INLINED!! - call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DRAGONKIN_PET)) // INLINED!! -endfunction -function InitRaces takes nothing returns nothing - call InitRaceFreelancer() - call InitRaceOldHorde() - call InitRaceAllianceOfLordaeron() - call InitRaceHuman() - call InitRaceOrc() - call InitRaceUndead() - call InitRaceNightElf() - call InitRaceStormwind() - call InitRaceDalaran() - call InitRaceCentaur() - call InitRaceGnoll() - call InitRaceKobold() - call InitRaceQuillboar() - call InitRaceBandit() - call InitRaceDungeon() - call InitRaceDragonkin() - call InitRaceVillage() -endfunction -//library WoWReforgedAllRaces ends -//library WoWReforgedCalendar: -//processed: function interface CalendarEventFunction takes CalendarEvent e returns nothing -function GetCalendarChangeSecondTimerHandleId takes nothing returns integer - return GetHandleId(WoWReforgedCalendar__changeSecondTimer) -endfunction -function GetCalendarThunderTimerHandleId takes nothing returns integer - return GetHandleId(WoWReforgedCalendar__thunderTimer) -endfunction -function GetCalendarWeatherTimerHandleId takes nothing returns integer - return GetHandleId(WoWReforgedCalendar__weatherTimer) -endfunction -function IsBetweenCalendarDay takes integer startDay,real startTimeOfDay,integer endDay,real endTimeOfDay returns boolean - if ( WoWReforgedCalendar__days < startDay or WoWReforgedCalendar__days > endDay ) then - return false - elseif ( startDay == endDay and not IsBetweenTimeOfDay(startTimeOfDay , endTimeOfDay) ) then - return false - elseif ( WoWReforgedCalendar__days == startDay and not IsBetweenTimeOfDay(startTimeOfDay , 0.0) ) then - return false - elseif ( WoWReforgedCalendar__days == endDay and IsBetweenTimeOfDay(0.0 , endTimeOfDay) ) then - return false - endif - return false -endfunction -function WoWReforgedCalendar__TriggerActionVote takes nothing returns nothing - local integer e= LoadInteger(WoWReforgedCalendar__h, GetHandleId(GetTriggeringTrigger()), 0) - if ( s__CalendarEvent_running[e] ) then - if ( s__CalendarEvent_endFunc[e] != 0 ) then - call h__DisplayTextToForce(GetPlayersAll(), "Event ending: " + s__CalendarEvent_name[e]) - call sc___prototype26_execute(s__CalendarEvent_endFunc[e],e) - set s__CalendarEvent_running[e]=false - endif - else - if ( s__CalendarEvent_startFunc[e] != 0 ) then - set s__CalendarEvent_running[e]=true - call h__DisplayTextToForce(GetPlayersAll(), "Event starting: " + s__CalendarEvent_name[e]) - call sc___prototype26_execute(s__CalendarEvent_startFunc[e],e) - endif - endif -endfunction -function GetCalendarEventsMax takes nothing returns integer - return WoWReforgedCalendar__calendarEventsCounter -endfunction -function GetCalendarEvent takes integer index returns integer - return WoWReforgedCalendar__calendarEvents[index] -endfunction -function AddCalendarEvent takes string name,string vote,integer startDay,real startTimeOfDay,integer endDay,real endTimeOfDay,integer startFunc,integer endFunc,string icon returns integer - local integer e= s__CalendarEvent__allocate() - set s__CalendarEvent_name[e]=name - set s__CalendarEvent_vote[e]=vote - set s__CalendarEvent_startDay[e]=startDay - set s__CalendarEvent_startTimeOfDay[e]=startTimeOfDay - set s__CalendarEvent_endDay[e]=endDay - set s__CalendarEvent_endTimeOfDay[e]=endTimeOfDay - set s__CalendarEvent_startFunc[e]=startFunc - set s__CalendarEvent_endFunc[e]=endFunc - set s__CalendarEvent_icon[e]=icon - set WoWReforgedCalendar__calendarEvents[WoWReforgedCalendar__calendarEventsCounter]=e - set WoWReforgedCalendar__calendarEventsCounter=WoWReforgedCalendar__calendarEventsCounter + 1 - - call SaveInteger(WoWReforgedCalendar__h, GetHandleId(s__CalendarEvent_voteTrigger[e]), 0, e) - call TriggerAddAction(s__CalendarEvent_voteTrigger[e], function WoWReforgedCalendar__TriggerActionVote) - set udg_TmpString=name - set udg_TmpString2=vote - set udg_TmpTrigger=s__CalendarEvent_voteTrigger[e] - call AddWowReforgedVote() - - return e -endfunction -// use when dropping more food during harvesting season or candy during halloween -function IsCalendarEventRunning takes integer e returns boolean - return s__CalendarEvent_running[e] -endfunction -// call this on every change of time -function WoWReforgedCalendar__CheckCalendarEvents takes nothing returns nothing - local integer e= 0 - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedCalendar__calendarEventsCounter ) - set e=WoWReforgedCalendar__calendarEvents[i] - if ( s__CalendarEvent_running[e] ) then - if ( not IsBetweenCalendarDay(s__CalendarEvent_startDay[e] , s__CalendarEvent_startTimeOfDay[e] , s__CalendarEvent_endDay[e] , s__CalendarEvent_endTimeOfDay[e]) ) then - if ( s__CalendarEvent_endFunc[e] != 0 ) then - call sc___prototype26_execute(s__CalendarEvent_endFunc[e],e) - set s__CalendarEvent_running[e]=false - endif - endif - else - if ( IsBetweenCalendarDay(s__CalendarEvent_startDay[e] , s__CalendarEvent_startTimeOfDay[e] , s__CalendarEvent_endDay[e] , s__CalendarEvent_endTimeOfDay[e]) ) then - if ( s__CalendarEvent_startFunc[e] != 0 ) then - set s__CalendarEvent_running[e]=true - call h__DisplayTextToForce(GetPlayersAll(), "Event starting: " + s__CalendarEvent_name[e]) - call sc___prototype26_execute(s__CalendarEvent_startFunc[e],e) - endif - endif - endif - set i=i + 1 - endloop -endfunction -function GetRunningCalendarEvent takes nothing returns integer - local integer e= 0 - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedCalendar__calendarEventsCounter ) - set e=WoWReforgedCalendar__calendarEvents[i] - if ( s__CalendarEvent_running[e] ) then - return e - endif - set i=i + 1 - endloop - return 0 -endfunction -function AddTreeMapping takes integer summerId,integer fallId,integer winterId,integer winterSnowyId,integer easterId,integer christmasId returns integer - local integer t= s__TreeMapping__allocate() - set s__TreeMapping_summerId[t]=summerId - set s__TreeMapping_fallId[t]=fallId - set s__TreeMapping_winterId[t]=winterId - set s__TreeMapping_winterSnowyId[t]=winterSnowyId - set s__TreeMapping_easterId[t]=easterId - set s__TreeMapping_christmasId[t]=christmasId - - call SaveInteger(WoWReforgedCalendar__h, summerId, 0, t) - call SaveInteger(WoWReforgedCalendar__h, fallId, 0, t) - call SaveInteger(WoWReforgedCalendar__h, winterId, 0, t) - call SaveInteger(WoWReforgedCalendar__h, winterSnowyId, 0, t) - call SaveInteger(WoWReforgedCalendar__h, easterId, 0, t) - call SaveInteger(WoWReforgedCalendar__h, christmasId, 0, t) - - return t -endfunction -function GetTreeMappingById takes integer id returns integer - if ( HaveSavedInteger(WoWReforgedCalendar__h, id, 0) ) then - return LoadInteger(WoWReforgedCalendar__h, id, 0) - endif - return 0 -endfunction -function AddTileMapping takes integer summerId,integer fallId,integer winterId returns integer - local integer t= s__TileMapping__allocate() - set s__TileMapping_summerId[t]=summerId - set s__TileMapping_fallId[t]=fallId - set s__TileMapping_winterId[t]=winterId - set WoWReforgedCalendar__tileMappings[WoWReforgedCalendar__tileMappingsCounter]=t - set WoWReforgedCalendar__tileMappingsCounter=WoWReforgedCalendar__tileMappingsCounter + 1 - - call SaveInteger(WoWReforgedCalendar__h, summerId, 0, t) - call SaveInteger(WoWReforgedCalendar__h, fallId, 0, t) - call SaveInteger(WoWReforgedCalendar__h, winterId, 0, t) - - return t -endfunction -function GetTileMappingById takes integer id returns integer - return LoadInteger(WoWReforgedCalendar__h, id, 0) -endfunction -function GetCurrentWeatherIcon takes nothing returns string - if ( WoWReforgedCalendar__weatherRunning ) then - return "ReplaceableTextures\\CommandButtons\\BTNRainyWeather.blp" - endif - return "ReplaceableTextures\\CommandButtons\\BTNOrbOfTheSun.blp" -endfunction -function GetCurrentWeatherName takes nothing returns string - if ( WoWReforgedCalendar__weatherRunning ) then - return "Bad" - endif - return "Good" -endfunction -function GetSeasonName takes integer s returns string - if ( s == SEASON_SUMMER ) then - return "Summer" - elseif ( s == SEASON_SPRING ) then - return "Spring" - elseif ( s == SEASON_FALL ) then - return "Fall" - endif - return "Winter" -endfunction -function GetSeasonIcon takes integer s returns string - if ( s == SEASON_SUMMER ) then - return "ReplaceableTextures\\CommandButtons\\BTNOrbOfTheSun.blp" - elseif ( s == SEASON_SPRING ) then - return "ReplaceableTextures\\CommandButtons\\BTNFlower1.blp" - elseif ( s == SEASON_FALL ) then - return "ReplaceableTextures\\CommandButtons\\BTNEntangled Gold Mine (Fall).blp" - endif - return "ReplaceableTextures\\CommandButtons\\BTNSnowFlake.blp" -endfunction -function GetCurrentSeason takes nothing returns integer - return WoWReforgedCalendar__season -endfunction -function GetPassedTime takes nothing returns integer - return udg_GameTime -endfunction -function GetCurrentDay takes nothing returns integer - return WoWReforgedCalendar__days -endfunction -function GetCurrentYear takes nothing returns integer - return WoWReforgedCalendar__years -endfunction -function GetCurrentMonth takes nothing returns integer - return WoWReforgedCalendar__days / DAYS_PER_MONTH + 1 -endfunction -function GetDayByMonth takes integer day,integer month returns integer - return day + ( month - 1 ) * DAYS_PER_MONTH -endfunction -function GetMonthName takes integer month returns string - if ( month == JANUARY ) then - return "January" - elseif ( month == FEBRUARY ) then - return "February" - elseif ( month == MARCH ) then - return "March" - elseif ( month == APRIL ) then - return "April" - elseif ( month == MAY ) then - return "May" - elseif ( month == JUNE ) then - return "June" - elseif ( month == JULY ) then - return "July" - elseif ( month == AUGUST ) then - return "August" - elseif ( month == SEPTEMBER ) then - return "September" - elseif ( month == OCTOBER ) then - return "October" - elseif ( month == NOVEMBER ) then - return "November" - elseif ( month == DECEMBER ) then - return "December" - endif - - return "Unknown" -endfunction -function GetCurrentDate takes nothing returns string - return I2S((WoWReforgedCalendar__years)) + "-" + I2SW((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar__days) , 2) // INLINED!! -endfunction -function GetTimeText takes nothing returns string - return (I2S((WoWReforgedCalendar__years)) + "-" + I2SW((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar__days) , 2)) + "\nMonth: " + GetMonthName((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1)) + "\nSeason: " + GetSeasonName((WoWReforgedCalendar__season)) + "\nTime of Day: " + (FormatTimeOfDayEx(GetTimeOfDay())) + "\nTotal passed time: " + FormatTimeString((udg_GameTime)) + "\nWeather Report: Rain/Snow/Storm in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar__weatherTimer))) + " and thunder/lightning in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar__thunderTimer))) // INLINED!! -endfunction -function DisplayTime takes player whichPlayer returns nothing - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, ((I2S((WoWReforgedCalendar__years)) + "-" + I2SW((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar__days) , 2)) + "\nMonth: " + GetMonthName((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1)) + "\nSeason: " + GetSeasonName((WoWReforgedCalendar__season)) + "\nTime of Day: " + (FormatTimeOfDayEx(GetTimeOfDay())) + "\nTotal passed time: " + FormatTimeString((udg_GameTime)) + "\nWeather Report: Rain/Snow/Storm in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar__weatherTimer))) + " and thunder/lightning in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar__thunderTimer))))) // INLINED!! -endfunction -function WoWReforgedCalendar__FilterIsTree takes nothing returns boolean - return GetTreeMappingById(GetDestructableTypeId(GetFilterDestructable())) != 0 -endfunction -function WoWReforgedCalendar__ReplaceTreeEx takes destructable d,integer t returns nothing - local real x= GetDestructableX(d) - local real y= GetDestructableY(d) - local real life= GetDestructableLife(d) - local integer targetId= s__TreeMapping_summerId[t] - if ( WoWReforgedCalendar__easterTrees ) then - set targetId=s__TreeMapping_easterId[t] - elseif ( WoWReforgedCalendar__christmasTrees ) then - set targetId=s__TreeMapping_christmasId[t] - elseif ( WoWReforgedCalendar__targetSeason == SEASON_SUMMER ) then - set targetId=s__TreeMapping_summerId[t] - elseif ( WoWReforgedCalendar__targetSeason == SEASON_FALL ) then - set targetId=s__TreeMapping_fallId[t] - elseif ( WoWReforgedCalendar__targetSeason == SEASON_WINTER ) then - if ( WoWReforgedCalendar__weatherRunning ) then - set targetId=s__TreeMapping_winterSnowyId[t] - else - set targetId=s__TreeMapping_winterId[t] - endif - elseif ( WoWReforgedCalendar__targetSeason == SEASON_SPRING ) then - set targetId=s__TreeMapping_summerId[t] - endif - if ( targetId != 0 ) then - call RemoveDestructable(d) - set d=null - set d=CreateDestructable(targetId, x, y, GetRandomDirectionDeg(), 1.0, 0) - call SetDestructableLife(d, life) - set d=null - endif -endfunction -function WoWReforgedCalendar__ReplaceTree takes nothing returns nothing - local destructable d= GetEnumDestructable() - local integer t= GetTreeMappingById(GetDestructableTypeId(d)) - if ( t != 0 ) then - call WoWReforgedCalendar__ReplaceTreeEx(d , t) - endif - set d=null -endfunction -function WoWReforgedCalendar__ReplaceTreeNewOpLimit takes nothing returns nothing - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceTree)) // INLINED!! -endfunction -function WoWReforgedCalendar__ReplaceTrees takes rect r,integer source,integer target returns nothing - set WoWReforgedCalendar__sourceSeason=source - set WoWReforgedCalendar__targetSeason=target - call EnumDestructablesInRect(r, WoWReforgedCalendar__treeFilter, function WoWReforgedCalendar__ReplaceTreeNewOpLimit) -endfunction -function WoWReforgedCalendar__ReplaceAffectedWithTrees takes integer source,integer target returns nothing - local integer z= 0 - local integer t= TERRAIN_TYPE_NONE - local integer j= 0 - local integer max2= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i >= max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - set t=(s__Zone_terrainType[(z)]) // INLINED!! - if ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) then - //call BJDebugMsg(GetZoneName(z) + " has terrain Lordaeron with rects counter " + I2S(GetZoneRectsCounter(z))) - set j=0 - set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! - loop - exitwhen ( j >= max2 ) - call WoWReforgedCalendar__ReplaceTrees((s___Zone_rects[s__Zone_rects[(z )]+( j)]) , source , target) // INLINED!! - set j=j + 1 - endloop - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedCalendar__ReplaceWithWinterTrees takes nothing returns nothing - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , SEASON_WINTER) -endfunction -function WoWReforgedCalendar__ReplaceWithSummerTrees takes nothing returns nothing - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , SEASON_SUMMER) -endfunction -function WoWReforgedCalendar__ReplaceWithFallTrees takes nothing returns nothing - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , SEASON_FALL) -endfunction -function WoWReforgedCalendar__GetEffectIndex takes integer zoneIndex,integer rectIndex returns integer - return Index2D(zoneIndex , rectIndex , MAX_ZONE_RECTS) -endfunction -function WoWReforgedCalendar__HasWeather takes integer t returns boolean - return t != TERRAIN_TYPE_NONE -endfunction -function WoWReforgedCalendar__GetRandomWeatherEffect takes integer t returns integer - if ( t == TERRAIN_TYPE_ASHENVALE ) then - if ( (WoWReforgedCalendar__season) == SEASON_WINTER ) then // INLINED!! - return GetRandomSnowWeatherEffect() - else - return GetRandomAshenvaleRainWeatherEffect() - endif - elseif ( t == TERRAIN_TYPE_LORDAERON ) then - if ( (WoWReforgedCalendar__season) == SEASON_WINTER ) then // INLINED!! - return GetRandomSnowWeatherEffect() - else - return GetRandomLordaeronRainWeatherEffect() - endif - elseif ( t == TERRAIN_TYPE_NORTHREND ) then - return GetRandomSnowWeatherEffect() - elseif ( t == TERRAIN_TYPE_BARRENS ) then - return WIND_HEAVY - elseif ( t == TERRAIN_TYPE_OUTLAND ) then - return GetRandomOutlandWindWeatherEffect() - elseif ( t == TERRAIN_TYPE_SUNKEN_RUINS ) then - return GetRandomAshenvaleRainWeatherEffect() - elseif ( t == TERRAIN_TYPE_SEA ) then - return GetRandomSeaWeatherEffect() - elseif ( t == TERRAIN_TYPE_DUNGEON ) then - return GetRandomDungeonWhiteFogEffect() - endif - - return 0 -endfunction -function WoWReforgedCalendar__ForForceAddWeatherResourceBonus takes nothing returns nothing - call AddPlayerResourceBonus(GetEnumPlayer() , udg_ResourceWater , 20) -endfunction -function WoWReforgedCalendar__ForForceRemoveWeatherResourceBonus takes nothing returns nothing - call RemovePlayerResourceBonus(GetEnumPlayer() , udg_ResourceWater , 20) -endfunction -function WoWReforgedCalendar__AddWeatherResourceBonus takes nothing returns nothing - call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceAddWeatherResourceBonus) -endfunction -function WoWReforgedCalendar__RemoveWeatherResourceBonus takes nothing returns nothing - call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceRemoveWeatherResourceBonus) -endfunction -function WoWReforgedCalendar__EnumUnitFillWater takes nothing returns nothing - call SetUnitResource(GetEnumUnit() , udg_ResourceWater , (LoadInteger(Resources___h, GetHandleId((GetEnumUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX)))) // INLINED!! -endfunction -function WoWReforgedCalendar__RainAddResourceBonus takes rect r returns nothing - local group g= CreateGroup() - call GroupEnumUnitsInRect(g, r, WoWReforgedCalendar__filterIsMineWithResourceWaterNotFull) - call ForGroup(g, function WoWReforgedCalendar__EnumUnitFillWater) - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function WoWReforgedCalendar__RemoveWeatherEffects takes nothing returns nothing - local integer z= 0 - local integer t= TERRAIN_TYPE_NONE - local integer j= 0 - local integer max2= 0 - local integer index= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer i= 0 - if ( WoWReforgedCalendar__weatherRunning ) then - call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceRemoveWeatherResourceBonus) // INLINED!! - set WoWReforgedCalendar__weatherRunning=false - endif - loop - exitwhen ( i >= max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - set t=(s__Zone_terrainType[(z)]) // INLINED!! - set j=0 - set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! - loop - exitwhen ( j >= max2 ) - set index=(Index2D((i ) , ( j) , MAX_ZONE_RECTS)) // INLINED!! - if ( WoWReforgedCalendar__weather[index] != null ) then - call EnableWeatherEffect(WoWReforgedCalendar__weather[index], false) - call RemoveWeatherEffect(WoWReforgedCalendar__weather[index]) - set WoWReforgedCalendar__weather[index]=null - set WoWReforgedCalendar__weatherEffectIds[index]=0 - call RegionClearRect(WoWReforgedCalendar__rainyRegion, (s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! - endif - if ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) then - call WoWReforgedCalendar__ReplaceTrees((s___Zone_rects[s__Zone_rects[(z )]+( j)]) , (WoWReforgedCalendar__season) , (WoWReforgedCalendar__season)) // INLINED!! - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function WoWReforgedCalendar__AddWeatherEffects takes nothing returns nothing - local integer z= 0 - local integer t= TERRAIN_TYPE_NONE - local integer j= 0 - local integer max2= 0 - local integer index= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer i= 0 - if ( not WoWReforgedCalendar__weatherRunning ) then - call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceAddWeatherResourceBonus) // INLINED!! - set WoWReforgedCalendar__weatherRunning=true - endif - loop - exitwhen ( i >= max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - set t=(s__Zone_terrainType[(z)]) // INLINED!! - if ( ((t) != TERRAIN_TYPE_NONE) ) then // INLINED!! - set j=0 - set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! - loop - exitwhen ( j >= max2 ) - set index=(Index2D((i ) , ( j) , MAX_ZONE_RECTS)) // INLINED!! - if ( WoWReforgedCalendar__weather[index] != null ) then - call EnableWeatherEffect(WoWReforgedCalendar__weather[index], false) - call RemoveWeatherEffect(WoWReforgedCalendar__weather[index]) - set WoWReforgedCalendar__weather[index]=null - set WoWReforgedCalendar__weatherEffectIds[index]=0 - call RegionClearRect(WoWReforgedCalendar__rainyRegion, (s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! - endif - set WoWReforgedCalendar__weatherEffectIds[index]=WoWReforgedCalendar__GetRandomWeatherEffect(t) - if ( WoWReforgedCalendar__weatherEffectIds[index] != 0 ) then - set WoWReforgedCalendar__weather[index]=AddWeatherEffect((s___Zone_rects[s__Zone_rects[(z )]+( j)]), WoWReforgedCalendar__weatherEffectIds[index]) // INLINED!! - call EnableWeatherEffect(WoWReforgedCalendar__weather[index], true) - call RegionAddRect(WoWReforgedCalendar__rainyRegion, (s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! - - if ( IsRainWeatherEffect(WoWReforgedCalendar__weatherEffectIds[index]) ) then - call WoWReforgedCalendar__RainAddResourceBonus((s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! - endif - endif - - if ( ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) and (WoWReforgedCalendar__season) == SEASON_WINTER ) then // INLINED!! - call WoWReforgedCalendar__ReplaceTrees((s___Zone_rects[s__Zone_rects[(z )]+( j)]) , SEASON_WINTER , SEASON_WINTER) // INLINED!! - endif - set j=j + 1 - endloop - endif - set i=i + 1 - endloop -endfunction -function IsCameraInRainyArea takes nothing returns boolean - return IsPointInRegion(WoWReforgedCalendar__rainyRegion, GetCameraTargetPositionX(), GetCameraTargetPositionY()) // async -endfunction -function Lightning takes nothing returns nothing - if ( (IsPointInRegion(WoWReforgedCalendar__rainyRegion, GetCameraTargetPositionX(), GetCameraTargetPositionY())) ) then // async // INLINED!! - //call PlaySound("Sound\\Doodads\\Cinematic\\Lightningbolt\\LightningBolt1.flac") - // call PlaySound("Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.flac") - call StartSound(gg_snd_LightningBoltWeather) - call CinematicFilterGenericBJ(1.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 100.0) - //call BJDebugMsg("Lightning") - endif -endfunction -function Thunder takes nothing returns nothing - if ( (IsPointInRegion(WoWReforgedCalendar__rainyRegion, GetCameraTargetPositionX(), GetCameraTargetPositionY())) ) then // async // INLINED!! - call StartSound(gg_snd_RollingThunder1) - //call PlaySound("Sound\\Ambient\\DoodadEffects\\RollingThunder1.flac") - //call BJDebugMsg("Thunder") - endif -endfunction -function WoWReforgedCalendar__TimerFunctionThunder takes nothing returns nothing - if ( GetRandomInt(0, 1) == 0 ) then - call Thunder() - else - call Lightning() - endif -endfunction -function WoWReforgedCalendar__StopThunder takes nothing returns nothing - call PauseTimer(WoWReforgedCalendar__thunderTimer) -endfunction -function WoWReforgedCalendar__StartThunder takes nothing returns nothing - call TimerStart(WoWReforgedCalendar__thunderTimer, GetRandomReal(MIN_THUNDER_DURATION, MAX_THUNDER_DURATION), true, function WoWReforgedCalendar__TimerFunctionThunder) -endfunction -function WoWReforgedCalendar__TimerFunctionEndWeather takes nothing returns nothing - //call NewOpLimit(function RemoveWeatherEffects) - call PauseTimer(WoWReforgedCalendar__thunderTimer) // INLINED!! -endfunction -function WoWReforgedCalendar__EndWeather takes nothing returns nothing - call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_WEATHER_DURATION, MAX_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionEndWeather) -endfunction -function WoWReforgedCalendar__TimerFunctionStartWeather takes nothing returns nothing - //call NewOpLimit(function AddWeatherEffects) - call TimerStart(WoWReforgedCalendar__thunderTimer, GetRandomReal(MIN_THUNDER_DURATION, MAX_THUNDER_DURATION), true, function WoWReforgedCalendar__TimerFunctionThunder) // INLINED!! - call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_WEATHER_DURATION, MAX_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionEndWeather) // INLINED!! -endfunction -function StartWeather takes nothing returns nothing - call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionStartWeather) -endfunction -function StartWeatherImmediately takes nothing returns nothing - call TimerStart(WoWReforgedCalendar__weatherTimer, 0.0, false, function WoWReforgedCalendar__TimerFunctionStartWeather) -endfunction -function StopWeather takes nothing returns nothing - call PauseTimer(WoWReforgedCalendar__weatherTimer) - call PauseTimer(WoWReforgedCalendar__thunderTimer) - call PauseTimer(WoWReforgedCalendar__thunderTimer) // INLINED!! -endfunction -function WoWReforgedCalendar__ReplaceWithTerrain takes rect whichRect,integer source,integer target returns nothing - local real x= GetRectMinX(whichRect) - local real y= 0.0 - local real maxX= GetRectMaxX(whichRect) - local real maxY= GetRectMaxY(whichRect) - local integer t= 0 - local integer targetId= 0 - loop - exitwhen ( x >= maxX ) - set y=GetRectMinY(whichRect) - //call BJDebugMsg("ReplaceWithTerrain 2") - loop - exitwhen ( y >= maxY ) - set t=(LoadInteger(WoWReforgedCalendar__h, (GetTerrainType(x, y)), 0)) // INLINED!! - //call BJDebugMsg("ReplaceWithTerrain 3") - if ( t != 0 ) then - if ( target == SEASON_WINTER ) then - set targetId=s__TileMapping_winterId[t] - elseif ( target == SEASON_SUMMER ) then - set targetId=s__TileMapping_summerId[t] - elseif ( target == SEASON_SPRING ) then - set targetId=s__TileMapping_summerId[t] - elseif ( target == SEASON_FALL ) then - set targetId=s__TileMapping_fallId[t] - endif - call SetTerrainType(x, y, targetId, GetTerrainVariance(x, y), 1, 0) - //call BJDebugMsg("ReplaceWithTerrain 4") - endif - //call BJDebugMsg("ReplaceWithTerrain 5") - set y=y + bj_CELLWIDTH - endloop - set x=x + bj_CELLWIDTH - endloop -endfunction -function WoWReforgedCalendar__ReplaceWithTerrainNewOpLmit takes nothing returns nothing - call WoWReforgedCalendar__ReplaceWithTerrain(udg_TmpRect , WoWReforgedCalendar__sourceSeason , WoWReforgedCalendar__targetSeason) -endfunction -function WoWReforgedCalendar__ReplaceAffectedWithTerrain takes integer source,integer target returns nothing - local integer z= 0 - local integer t= TERRAIN_TYPE_NONE - local integer j= 0 - local integer max2= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i >= max ) - set z=(WoWReforgedZones__zones[(i)]) // INLINED!! - set t=(s__Zone_terrainType[(z)]) // INLINED!! - if ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) then - set j=0 - set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! - loop - exitwhen ( j >= max2 ) - set udg_TmpRect=(s___Zone_rects[s__Zone_rects[(z )]+( j)]) // INLINED!! - set WoWReforgedCalendar__sourceSeason=source - set WoWReforgedCalendar__targetSeason=target - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithTerrainNewOpLmit)) // INLINED!! - set j=j + 1 - endloop - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedCalendar__ReplaceWithWinterTerrain takes nothing returns nothing - call WoWReforgedCalendar__ReplaceAffectedWithTerrain((WoWReforgedCalendar__season) , SEASON_WINTER) // INLINED!! -endfunction -function WoWReforgedCalendar__ReplaceWithSummerTerrain takes nothing returns nothing - call WoWReforgedCalendar__ReplaceAffectedWithTerrain((WoWReforgedCalendar__season) , SEASON_SUMMER) // INLINED!! -endfunction -function WoWReforgedCalendar__ReplaceWithFallTerrain takes nothing returns nothing - call WoWReforgedCalendar__ReplaceAffectedWithTerrain((WoWReforgedCalendar__season) , SEASON_FALL) // INLINED!! -endfunction -function WoWReforgedCalendar__ForForceAddFallResourceBonus takes nothing returns nothing - call AddPlayerResourceBonus(GetEnumPlayer() , udg_ResourceGrain , 20) -endfunction -function WoWReforgedCalendar__ForForceRemoveFallResourceBonus takes nothing returns nothing - call RemovePlayerResourceBonus(GetEnumPlayer() , udg_ResourceGrain , 20) -endfunction -function WoWReforgedCalendar__ResourceBonus takes integer previousSeason,integer currentSeason returns nothing - if ( previousSeason == SEASON_FALL ) then - call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceRemoveFallResourceBonus) - elseif ( currentSeason == SEASON_FALL ) then - call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceAddFallResourceBonus) - endif -endfunction -function Winter takes nothing returns nothing - call SetSkyModel("Environment\\Sky\\LordaeronWinterSky\\LordaeronWinterSky.mdl") - call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithWinterTerrain)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithWinterTrees)) // INLINED!! - call WoWReforgedCalendar__ResourceBonus((WoWReforgedCalendar__season) , SEASON_WINTER) // INLINED!! - set WoWReforgedCalendar__season=SEASON_WINTER - call StopWeather() - call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionStartWeather) // INLINED!! -endfunction -function Summer takes nothing returns nothing - call SetSkyModel("Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl") - call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithSummerTerrain)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithSummerTrees)) // INLINED!! - call WoWReforgedCalendar__ResourceBonus((WoWReforgedCalendar__season) , SEASON_SUMMER) // INLINED!! - set WoWReforgedCalendar__season=SEASON_SUMMER - call StopWeather() - call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionStartWeather) // INLINED!! -endfunction -function Spring takes nothing returns nothing - call SetSkyModel("Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl") - call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithSummerTerrain)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithSummerTrees)) // INLINED!! - call WoWReforgedCalendar__ResourceBonus((WoWReforgedCalendar__season) , SEASON_SPRING) // INLINED!! - set WoWReforgedCalendar__season=SEASON_SPRING - call StopWeather() - call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionStartWeather) // INLINED!! -endfunction -function Fall takes nothing returns nothing - call SetSkyModel("Environment\\Sky\\LordaeronSummerSky\\LordaeronFallSky.mdl") - call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithFallTerrain)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceWithFallTrees)) // INLINED!! - call WoWReforgedCalendar__ResourceBonus((WoWReforgedCalendar__season) , SEASON_FALL) // INLINED!! - set WoWReforgedCalendar__season=SEASON_FALL - call StopWeather() - call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionStartWeather) // INLINED!! -endfunction -function IsSeasonsEnabled takes nothing returns boolean - return WoWReforgedCalendar__seasonsEnabled -endfunction -function HappyNewYear takes nothing returns nothing - call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_ITEMACQUIRED, "Happy new year for the year " + I2S((WoWReforgedCalendar__years)) + "!") // INLINED!! -endfunction -function WeatherPrediction takes player whichPlayer returns nothing - local string msg= "" - if ( WoWReforgedCalendar__weatherRunning ) then - set msg="Snowfall/Storm/Rain with thunder in " + FormatTime(TimerGetRemaining(WoWReforgedCalendar__thunderTimer)) - set msg=msg + " ending in " + FormatTime(TimerGetRemaining(WoWReforgedCalendar__weatherTimer)) - else - set msg="Next Snowfall/Storm/Rain in " + FormatTime(TimerGetRemaining(WoWReforgedCalendar__weatherTimer)) - endif - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, msg) -endfunction -function WoWReforgedCalendar__TriggerConditionTimeOfDay takes nothing returns boolean - if ( WoWReforgedCalendar__days == DAYS_PER_YEAR ) then - set WoWReforgedCalendar__days=1 - set WoWReforgedCalendar__years=WoWReforgedCalendar__years + 1 - - call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_ITEMACQUIRED, "Happy new year for the year " + I2S((WoWReforgedCalendar__years)) + "!") // INLINED!! - else - set WoWReforgedCalendar__days=WoWReforgedCalendar__days + 1 - endif - - if ( (WoWReforgedCalendar__seasonsEnabled) ) then // INLINED!! - if ( WoWReforgedCalendar__days == SUMMER_DAY ) then - set WoWReforgedCalendar__season=SEASON_SUMMER - call Summer() - elseif ( WoWReforgedCalendar__days == SPRING_DAY ) then - set WoWReforgedCalendar__season=SEASON_SPRING - call Spring() - elseif ( WoWReforgedCalendar__days == FALL_DAY ) then - set WoWReforgedCalendar__season=SEASON_FALL - call Fall() - elseif ( WoWReforgedCalendar__days == WINTER_DAY ) then - set WoWReforgedCalendar__season=SEASON_WINTER - call Winter() - endif - endif - - return false -endfunction -function StartCurrentSeason takes nothing returns nothing - if ( WoWReforgedCalendar__days >= FALL_DAY ) then - set WoWReforgedCalendar__season=SEASON_FALL - call Fall() - elseif ( WoWReforgedCalendar__days >= SUMMER_DAY ) then - set WoWReforgedCalendar__season=SEASON_SUMMER - call Summer() - elseif ( WoWReforgedCalendar__days >= SPRING_DAY ) then - set WoWReforgedCalendar__season=SEASON_SPRING - call Spring() - else - set WoWReforgedCalendar__season=SEASON_WINTER - call Winter() - endif -endfunction -function EnableCalendar takes nothing returns nothing - call EnableTrigger(WoWReforgedCalendar__changeDayTrigger) - call TimerStart(WoWReforgedCalendar__changeSecondTimer, 0.01, true, function WoWReforgedCalendar__CheckCalendarEvents) - call StartCurrentSeason() -endfunction -function DisableCalendar takes nothing returns nothing - call DisableTrigger(WoWReforgedCalendar__changeDayTrigger) - call PauseTimer(WoWReforgedCalendar__changeSecondTimer) - call PauseTimer(WoWReforgedCalendar__weatherTimer) - call PauseTimer(WoWReforgedCalendar__thunderTimer) -endfunction -function EnableSeasons takes nothing returns nothing - set WoWReforgedCalendar__seasonsEnabled=true - call EnableCalendar() -endfunction -function DisableSeasons takes nothing returns nothing - set WoWReforgedCalendar__seasonsEnabled=false - call DisableCalendar() -endfunction -function WoWReforgedCalendar__TimerFunctionStartSeason takes nothing returns nothing - call StartCurrentSeason() - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function WoWReforgedCalendar__StartEaster takes integer e returns nothing - set WoWReforgedCalendar__easterTrees=true - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) - call PlaySoundBJ(gg_snd_EasterIntro) -endfunction -function WoWReforgedCalendar__EndEaster takes integer e returns nothing - set WoWReforgedCalendar__easterTrees=false - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) -endfunction -function WoWReforgedCalendar__StartChristmas takes integer e returns nothing - set WoWReforgedCalendar__christmasTrees=true - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) -endfunction -function WoWReforgedCalendar__EndChristmas takes integer e returns nothing - set WoWReforgedCalendar__christmasTrees=false - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) -endfunction -function WoWReforgedCalendar__StartNewYear takes integer e returns nothing - local integer index= 0 - local integer zone= 0 - local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer j= 0 - local integer max2= 0 - loop - exitwhen ( i == max ) - set zone=(WoWReforgedZones__zones[(i)]) // INLINED!! - set max2=(s__Zone_rectsCounter[(zone)]) // INLINED!! - set j=0 - loop - exitwhen ( j == max2 ) - set index=Index2D(i , j , MAX_ZONE_RECTS) - set WoWReforgedCalendar__newYearEffects[index]=AddSpecialEffect("war3mapImported\\Firework3.mdx", GetRectCenterX((s___Zone_rects[s__Zone_rects[(zone )]+( j)])), GetRectCenterY((s___Zone_rects[s__Zone_rects[(zone )]+( j)]))) // INLINED!! - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function WoWReforgedCalendar__EndNewYear takes integer e returns nothing - local integer index= 0 - local integer zone= 0 - local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer j= 0 - local integer max2= 0 - loop - exitwhen ( i == max ) - set zone=(WoWReforgedZones__zones[(i)]) // INLINED!! - set max2=(s__Zone_rectsCounter[(zone)]) // INLINED!! - set j=0 - loop - exitwhen ( j == max2 ) - set index=Index2D(i , j , MAX_ZONE_RECTS) - if ( WoWReforgedCalendar__newYearEffects[index] != null ) then - call DestroyEffect(WoWReforgedCalendar__newYearEffects[index]) - set WoWReforgedCalendar__newYearEffects[index]=null - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function WoWReforgedCalendar__IsMineWithResourceWaterNotFull takes nothing returns boolean - return (IsUnitInGroup((GetFilterUnit()), Resources___mines)) and (LoadInteger(Resources___h, GetHandleId((GetFilterUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) > 0 and (LoadInteger(Resources___h, GetHandleId((GetFilterUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) < (LoadInteger(Resources___h, GetHandleId((GetFilterUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) // INLINED!! -endfunction -function WoWReforgedCalendar__Init takes nothing returns nothing - set WoWReforgedCalendar__rainyRegion=CreateRegion() - - call TriggerRegisterGameStateEventTimeOfDay(WoWReforgedCalendar__changeDayTrigger, EQUAL, 0.0) - call TriggerAddCondition(WoWReforgedCalendar__changeDayTrigger, Condition(function WoWReforgedCalendar__TriggerConditionTimeOfDay)) - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedCalendar__TimerFunctionStartSeason) - call TimerStart(WoWReforgedCalendar__changeSecondTimer, 0.01, true, function WoWReforgedCalendar__CheckCalendarEvents) - - set WoWReforgedCalendar__treeFilter=Filter(function WoWReforgedCalendar__FilterIsTree) - - set WoWReforgedCalendar__filterIsMineWithResourceWaterNotFull=Filter(function WoWReforgedCalendar__IsMineWithResourceWaterNotFull) - - call AddTreeMapping(SUMMER_TREE_WALL , FALL_TREE_WALL , WINTER_TREE_WALL , SNOWY_TREE_WALL , EASTERN_TREE_WALL_1 , CHRISTMAS_TREE_WALL) - call AddTreeMapping(CITYSCAPE_SUMMER_TREE_WALL , CITYSCAPE_FALL_TREE_WALL , CITYSCAPE_WINTER_TREE_WALL , CITYSCAPE_SNOWY_TREE_WALL , CARROT_TREE_WALL_1 , CITYSCAPE_CHRISTMAS_TREE_WALL) - call AddTreeMapping(VILLAGE_TREE_WALL , VILLAGE_TREE_WALL_FALL , VILLAGE_TREE_WALL_WINTER , VILLAGE_SNOWY_TREE_WALL , CARROT_TREE_WALL_1 , CITYSCAPE_CHRISTMAS_TREE_WALL) - call AddTreeMapping(ASHENVALE_TREE_WALL , ASHENVALE_TREE_WALL_FALL , ASHENVALE_TREE_WALL_WINTER , ASHENVALE_SNOWY_TREE_WALL , CARROT_TREE_WALL_2 , ASHENVALE_CHRISTMAS_TREE_WALL) - call AddTreeMapping(ASHENVALE_CANOPY_TREE , ASHENVALE_CANOPY_TREE_FALL , ASHENVALE_CANOPY_TREE_WINTER , ASHENVALE_CANOPY_TREE_WINTER , CARROT_TREE_WALL_2 , ASHENVALE_CANOPY_CHRISTMAS_TREE_WALL) - call AddTreeMapping(AZUREMYST_ISLES_TREE_WALL , AZUREMYST_ISLES_TREE_WALL_FALL , AZUREMYST_ISLES_TREE_WALL_WINTER , AZUREMYST_ISLES_TREE_WALL_WINTER , CARROT_TREE_WALL_1 , AZUREMYST_ISLES_CHRISTMAS_TREE_WALL) - call AddTreeMapping(CRANNIES_SUMMER , CRANNIES_FALL , CRANNIES_WINTER , CRANNIES_WINTER_SNOWY , 0 , 0) - - call AddTileMapping(TILE_TYPE_GRASS , TILE_TYPE_DARK_GRASS , TILE_TYPE_SNOW) - - set easter=AddCalendarEvent("Easter" , "-easter" , ((22 ) + ( ( MARCH) - 1 ) * DAYS_PER_MONTH) , 0.0 , ((25 ) + ( ( APRIL) - 1 ) * DAYS_PER_MONTH) , 24.0 , (1) , (2) , "ReplaceableTextures\\CommandButtons\\BTNEasterWabbit.blp") // INLINED!! - set christmas=AddCalendarEvent("Christmas" , "-christmas" , ((24 ) + ( ( DECEMBER) - 1 ) * DAYS_PER_MONTH) , 22.0 , ((26 ) + ( ( DECEMBER) - 1 ) * DAYS_PER_MONTH) , 24.0 , (3) , (4) , "ReplaceableTextures\\CommandButtons\\BTNSanta.blp") // INLINED!! - set newyear=AddCalendarEvent("New Year" , "-newyear" , ((30 ) + ( ( DECEMBER) - 1 ) * DAYS_PER_MONTH) , 22.0 , ((1 ) + ( ( JANUARY) - 1 ) * DAYS_PER_MONTH) , 3.0 , (5) , (6) , "ReplaceableTextures\\CommandButtons\\BTNFirework.blp") // INLINED!! - set thanksgiving=AddCalendarEvent("Thanksgiving" , "-thanksgiving" , ((6 ) + ( ( OCTOBER) - 1 ) * DAYS_PER_MONTH) , 0.0 , ((8 ) + ( ( OCTOBER) - 1 ) * DAYS_PER_MONTH) , 24.0 , 0 , 0 , "ReplaceableTextures\\CommandButtons\\BTNWheat.blp") // INLINED!! - set halloween=AddCalendarEvent("Halloween " , "-halloween" , ((30 ) + ( ( OCTOBER) - 1 ) * DAYS_PER_MONTH) , 22.0 , ((1 ) + ( ( NOVEMBER) - 1 ) * DAYS_PER_MONTH) , 3.0 , 0 , 0 , "ReplaceableTextures\\CommandButtons\\BTNPumpkinMonster.blp") // INLINED!! - set carnival=AddCalendarEvent("Carnival" , "-carnival" , ((14 ) + ( ( FEBRUARY) - 1 ) * DAYS_PER_MONTH) , 0.0 , ((4 ) + ( ( MARCH) - 1 ) * DAYS_PER_MONTH) , 24.0 , 0 , 0 , "ReplaceableTextures\\CommandButtons\\BTNMasks.blp") // INLINED!! -endfunction -//library WoWReforgedCalendar ends -//library WoWReforgedMassForestation: -function WoWReforgedMassForestation__GetMatchingTreeType takes real x,real y returns integer - local integer zone= GetZoneByCoordinates(x , y) - local string name= null - if ( zone != 0 and (s__Zone_treeTypeId[(zone)]) != 0 ) then // INLINED!! - return (s__Zone_treeTypeId[(zone)]) // INLINED!! - endif - - return RUINS_TREE_WALL -endfunction -function WoWReforgedMassForestation__FilterIsValidEnemyUnit takes nothing returns boolean - if ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) ) then - return false - elseif ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) ) then - return false - elseif ( IsUnitAlly(GetFilterUnit(), WoWReforgedMassForestation__owner) ) then - return false - elseif ( GetUnitAbilityLevel(GetFilterUnit(), 'Avul') > 0 ) then - return false - elseif ( GetUnitLevel(GetFilterUnit()) > WoWReforgedMassForestation__abilityLevel ) then - return false - endif - - return true -endfunction -function WoWReforgedMassForestation__ForGroupConvertIntoTree takes nothing returns nothing - local unit u= GetEnumUnit() - local real x= GetUnitX(u) - local real y= GetUnitY(u) - local real face= GetUnitFacing(u) - call h__RemoveUnit(u) - set u=null - call QueueDestructableAnimation(CreateDestructable(WoWReforgedMassForestation__GetMatchingTreeType(x , y), x, y, face, 1.0, 0), "birth") -endfunction -function MassForestation takes unit caster,integer abilityId,real x,real y returns boolean - local group g= CreateGroup() - local boolean result= false - set WoWReforgedMassForestation__owner=GetOwningPlayer(caster) - set WoWReforgedMassForestation__abilityLevel=GetUnitAbilityLevel(caster, abilityId) * 5 - call GroupEnumUnitsInRange(g, x, y, 256.0, Filter(function WoWReforgedMassForestation__FilterIsValidEnemyUnit)) - set WoWReforgedMassForestation__owner=null - set result=BlzGroupGetSize(g) > 0 - if ( result ) then - call ForGroup(g, function WoWReforgedMassForestation__ForGroupConvertIntoTree) - call GroupClear(g) - endif - - call DestroyGroup(g) - set g=null - - return result -endfunction -function WoWReforgedMassForestation__TriggerConditionCast takes nothing returns boolean - if ( ( GetSpellAbilityId() == WoWReforgedMassForestation_ABILITY_ID or GetSpellAbilityId() == WoWReforgedMassForestation_ABILITY_ID_2 ) and not MassForestation(GetTriggerUnit() , GetSpellAbilityId() , GetSpellTargetX() , GetSpellTargetY()) ) then - call IssueImmediateOrder(GetTriggerUnit(), "stop") - call SimError(GetOwningPlayer(GetTriggerUnit()) , "No valid targets.") - endif - return false -endfunction -function WoWReforgedMassForestation__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedMassForestation__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(WoWReforgedMassForestation__castTrigger, Condition(function WoWReforgedMassForestation__TriggerConditionCast)) -endfunction -//library WoWReforgedMassForestation ends -//library WoWReforgedMaxHpResearch: -function WoWReforgedMaxHpResearch__Init takes nothing returns nothing - call AddMaxHpResearchAbsolute(UPG_EVOLUTION , 50 , 50) - call AddMaxHpResearchPercentage(UPG_IMPROVED_MASONRY , 0.1 , 0.1) - call AddMaxHpResearchAbsolute(UPG_IMPROVED_MOUNT , 50 , 50) - call AddMaxHpResearchAbsolute(UPG_IMPROVED_HAND_OF_GOD , 200 , 200) - call AddMaxHpResearchPercentage(UPG_IMPROVED_CLAN , 0.1 , 0.1) - call AddMaxHpResearchPercentage(UPG_IMPROVED_CLAN_HALL , 0.1 , 0.1) - call AddMaxHpResearchAbsolute(UPG_OGRE_STRENGTH , 250 , 250) -endfunction -//library WoWReforgedMaxHpResearch ends -//library WoWReforgedPings: -// Non leaking ping functions: -function PingUnitForPlayer takes unit whichUnit,player whichPlayer returns nothing - call PingMinimapForPlayer(whichPlayer, GetUnitX(whichUnit), GetUnitY(whichUnit), PING_DURATION) -endfunction -function PingUnitForPlayerWoWReforged takes nothing returns nothing - call PingUnitForPlayer(udg_TmpUnit , udg_TmpPlayer) -endfunction -function PingItemForPlayer takes item whichItem,player whichPlayer returns nothing - call PingMinimapForPlayer(whichPlayer, GetItemX(whichItem), GetItemY(whichItem), PING_DURATION) -endfunction -function PingItemForPlayerWoWReforged takes nothing returns nothing - call PingItemForPlayer(udg_TmpItem , udg_TmpPlayer) -endfunction -function PingRectForPlayer takes rect whichRect,player whichPlayer returns nothing - call PingMinimapForPlayer(whichPlayer, GetRectCenterX(whichRect), GetRectCenterY(whichRect), PING_DURATION) -endfunction -function PingRectForPlayerWoWReforged takes nothing returns nothing - call PingRectForPlayer(udg_TmpRect , udg_TmpPlayer) -endfunction -function PingDestructableForPlayer takes destructable whichDestructable,player whichPlayer returns nothing - call PingMinimapForPlayer(whichPlayer, GetDestructableX(whichDestructable), GetDestructableY(whichDestructable), PING_DURATION) -endfunction -function PingDestructableForPlayerWoWReforged takes nothing returns nothing - call PingDestructableForPlayer(udg_TmpDestructible , udg_TmpPlayer) -endfunction -function GetBossPingRed takes unit boss returns integer - if ( GetHeroLevel(boss) >= 75 ) then - return 0 - elseif ( GetHeroLevel(boss) >= 65 ) then - return 255 - endif - - return 0 -endfunction -function GetBossPingGreen takes unit boss returns integer - if ( GetHeroLevel(boss) >= 65 ) then - return 0 - endif - - return 255 -endfunction -function GetBossPingBlue takes unit boss returns integer - return 0 -endfunction -function PingBossForPlayer takes unit boss,player whichPlayer returns nothing - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call PingMinimapEx(GetUnitX(boss), GetUnitY(boss), 4.0, GetBossPingRed(boss), GetBossPingGreen(boss), GetBossPingBlue(boss), false) - //call StartSound(bj_pingMinimapSound) - endif -endfunction -function PingBosses takes player whichPlayer returns nothing - local integer i= 0 - local integer max= BlzGroupGetSize(udg_Bosses) - loop - exitwhen ( i == max ) - call PingBossForPlayer(BlzGroupUnitAt(udg_Bosses, i) , whichPlayer) - set i=i + 1 - endloop -endfunction -function WoWReforgedPings__FilterIsFreelancerHero takes nothing returns boolean - return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and GetUnitTypeId(GetFilterUnit()) != EQUIPMENT_BAG and GetUnitTypeId(GetFilterUnit()) != BACKPACK and IsPlayerFreelancer(GetOwningPlayer(GetFilterUnit())) and IsUnitAlly(GetFilterUnit(), WoWReforgedPings__owner) -endfunction -function GetFreelancerHeroes takes player whichPlayer returns group - local group g= CreateGroup() - set WoWReforgedPings__owner=whichPlayer - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedPings__FilterIsFreelancerHero)) - return g -endfunction -function PingFreelancerForPlayer takes unit hero,player whichPlayer returns nothing - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call PingMinimapEx(GetUnitX(hero), GetUnitY(hero), 4.0, 0, 255, 0, false) - //call StartSound(bj_pingMinimapSound) - endif -endfunction -function PingFreelancers takes player whichPlayer returns nothing - local group g= GetFreelancerHeroes(whichPlayer) - local integer i= 0 - local integer max= BlzGroupGetSize(g) - loop - exitwhen ( i == max ) - call PingFreelancerForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) - set i=i + 1 - endloop - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function GetAltars takes player whichPlayer returns group - local group g= CreateGroup() - call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function IsAltarFilter)) - return g -endfunction -function PingAltarForPlayer takes unit altar,player whichPlayer returns nothing - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call PingMinimapEx(GetUnitX(altar), GetUnitY(altar), 4.0, 0, 255, 0, false) - //call StartSound(bj_pingMinimapSound) - endif -endfunction -function PingAltars takes player whichPlayer returns nothing - local group g= GetAltars(whichPlayer) - local integer i= 0 - local integer max= BlzGroupGetSize(g) - loop - exitwhen ( i == max ) - call PingAltarForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) - set i=i + 1 - endloop - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function WoWReforgedPings__IsResurrectionStoneFilter takes nothing returns boolean - return (IsResurrectionStone(GetUnitTypeId((GetFilterUnit())))) // INLINED!! -endfunction -function GetResurrectionStones takes player whichPlayer returns group - local group g= CreateGroup() - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedPings__IsResurrectionStoneFilter)) - return g -endfunction -function PingResurrectionStoneForPlayer takes unit u,player whichPlayer returns nothing - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call PingMinimapEx(GetUnitX(u), GetUnitY(u), 4.0, 0, 255, 0, false) - //call StartSound(bj_pingMinimapSound) - endif -endfunction -function PingRacingTrackNextCheckPointForPlayer takes player whichPlayer returns nothing - local unit u= GetPlayerRacingTrackNextCheckPoint(whichPlayer) - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call PingMinimapEx(GetUnitX(u), GetUnitY(u), 4.0, 0, 255, 0, false) - //call StartSound(bj_pingMinimapSound) - endif - set u=null -endfunction -function PingResurrectionStones takes player whichPlayer returns nothing - local group g= GetResurrectionStones(whichPlayer) - local integer i= 0 - local integer max= BlzGroupGetSize(g) - loop - exitwhen ( i == max ) - call PingResurrectionStoneForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) - set i=i + 1 - endloop - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function WoWReforgedPings__IsNpcFilter takes nothing returns boolean - return (GetNpcIndexByUnitTypeId((GetUnitTypeId((GetFilterUnit())))) != - 1) // INLINED!! -endfunction -function GetNpcs takes nothing returns group - local group g= CreateGroup() - call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), Filter(function WoWReforgedPings__IsNpcFilter)) - return g -endfunction -function PingNpcForPlayer takes unit altar,player whichPlayer returns nothing - if ( GetLocalPlayer() == whichPlayer ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call PingMinimapEx(GetUnitX(altar), GetUnitY(altar), 4.0, 0, 255, 0, false) - //call StartSound(bj_pingMinimapSound) - endif -endfunction -function PingNpcs takes player whichPlayer returns nothing - local group g= GetNpcs() - local integer i= 0 - local integer max= BlzGroupGetSize(g) - loop - exitwhen ( i == max ) - call PingNpcForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) - set i=i + 1 - endloop - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -//library WoWReforgedPings ends -//library WoWReforgedPortals: -function IsPortal takes integer unitTypeId returns boolean - return unitTypeId == PORTAL or unitTypeId == PORTAL_NEUTRAL or unitTypeId == PORTAL_NEUTRAL_2 or unitTypeId == PORTAL_NEUTRAL_FREELANCER or unitTypeId == PORTAL_NEUTRAL_WATER -endfunction -function UpdatePortalName takes unit whichUnit,boolean activate,real destinationX,real destinationY returns nothing - local integer zone= 0 - - if ( activate ) then - set zone=GetZoneByCoordinates(destinationX , destinationY) - if ( zone != 0 ) then - call BlzSetUnitName(whichUnit, "Portal to " + (s__AbstractZone_name[(zone)])) // INLINED!! - call SetUnitColor(whichUnit, (s__Zone_color[(zone)])) // INLINED!! - else - call BlzSetUnitName(whichUnit, "Portal") - endif - else - call BlzSetUnitName(whichUnit, "Disabled Portal") - endif -endfunction -function UpdatePortalNameByItself takes unit whichUnit returns nothing - call UpdatePortalName(whichUnit , WaygateIsActive(whichUnit) , WaygateGetDestinationX(whichUnit) , WaygateGetDestinationY(whichUnit)) -endfunction -function WoWReforgedPortals__FilterIsPortal takes nothing returns boolean - return IsPortal(GetUnitTypeId(GetFilterUnit())) -endfunction -function WoWReforgedPortals__ForGroupUpdateName takes nothing returns nothing - call UpdatePortalNameByItself(GetEnumUnit()) -endfunction -function InitNames takes nothing returns nothing - local group g= CreateGroup() - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedPortals__FilterIsPortal)) - call ForGroup(g, function WoWReforgedPortals__ForGroupUpdateName) - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -function WoWReforgedPortals__TimerFunctionInitNames takes nothing returns nothing - local timer t= GetExpiredTimer() - call InitNames() - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function WoWReforgedPortals__TriggerConditionConstructFinished takes nothing returns boolean - if ( IsPortal(GetUnitTypeId(GetConstructedStructure())) ) then - call UpdatePortalNameByItself(GetConstructedStructure()) - endif - return false -endfunction -function WoWReforgedPortals__Init takes nothing returns nothing - set WoWReforgedPortals__initialized=true - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedPortals__TimerFunctionInitNames) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedPortals__constructFinishedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedPortals__constructFinishedTrigger, Condition(function WoWReforgedPortals__TriggerConditionConstructFinished)) -endfunction -function WoWReforgedPortals__HookWaygateActivate takes unit waygate,boolean activate returns nothing - if ( WoWReforgedPortals__initialized and IsPortal(GetUnitTypeId(waygate)) ) then - call UpdatePortalName(waygate , activate , WaygateGetDestinationX(waygate) , WaygateGetDestinationY(waygate)) - endif -endfunction -function WoWReforgedPortals__HookWaygateActivateBJ takes boolean activate,unit waygate returns nothing - if ( WoWReforgedPortals__initialized and IsPortal(GetUnitTypeId(waygate)) ) then - call UpdatePortalName(waygate , activate , WaygateGetDestinationX(waygate) , WaygateGetDestinationY(waygate)) - endif -endfunction -function WoWReforgedPortals__HookWaygateSetDestination takes unit waygate,real x,real y returns nothing - if ( WoWReforgedPortals__initialized and IsPortal(GetUnitTypeId(waygate)) ) then - call UpdatePortalName(waygate , WaygateIsActive(waygate) , x , y) - endif -endfunction -function WoWReforgedPortals__HookWaygateSetDestinationLocBJ takes unit waygate,location loc returns nothing - if ( WoWReforgedPortals__initialized and IsPortal(GetUnitTypeId(waygate)) ) then - call UpdatePortalName(waygate , WaygateIsActive(waygate) , GetLocationX(loc) , GetLocationY(loc)) - endif -endfunction -//processed hook: hook WaygateActivate WoWReforgedPortals__HookWaygateActivate -//processed hook: hook WaygateActivateBJ WoWReforgedPortals__HookWaygateActivateBJ -//processed hook: hook WaygateSetDestination WoWReforgedPortals__HookWaygateSetDestination -//processed hook: hook WaygateSetDestinationLocBJ WoWReforgedPortals__HookWaygateSetDestinationLocBJ -//library WoWReforgedPortals ends -//library WoWReforgedCalendarMultiboard: -function GetCalendarMultiboardTimerHandleId takes nothing returns integer - return GetHandleId(WoWReforgedCalendarMultiboard__t) -endfunction -function ShowCalendarMultiboard takes nothing returns nothing - call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, true) -endfunction -function HideCalendarMultiboard takes nothing returns nothing - call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, false) -endfunction -function ShowCalendarMultiboardForPlayer takes player whichPlayer returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, true) // INLINED!! - endif -endfunction -function HideCalendarMultiboardForPlayer takes player whichPlayer returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, false) // INLINED!! - endif -endfunction -function WoWReforgedCalendarMultiboard__UpdateMultiboard takes nothing returns nothing - local multiboarditem mbitem= null - local integer e= GetRunningCalendarEvent() - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 0, 1) - call MultiboardSetItemIcon(mbitem, GetSeasonIcon((WoWReforgedCalendar__season))) // INLINED!! - call MultiboardSetItemValue(mbitem, GetSeasonName((WoWReforgedCalendar__season))) // INLINED!! - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 1, 1) - call MultiboardSetItemIcon(mbitem, GetCurrentWeatherIcon()) - call MultiboardSetItemValue(mbitem, GetCurrentWeatherName()) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 2, 1) - call MultiboardSetItemValue(mbitem, (I2S((WoWReforgedCalendar__years)) + "-" + I2SW((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar__days) , 2))) // INLINED!! - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 3, 1) - call MultiboardSetItemValue(mbitem, GetMonthName((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1))) // INLINED!! - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 4, 1) - call MultiboardSetItemValue(mbitem, (FormatTimeOfDayEx(GetTimeOfDay()))) // INLINED!! - if ( IsNight() ) then - call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNElunesBlessing.blp") - else - call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNDay Time2.blp") - endif - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 5, 1) - if ( e != 0 ) then - call MultiboardSetItemValue(mbitem, s__CalendarEvent_name[e]) - call MultiboardSetItemValue(mbitem, s__CalendarEvent_icon[e]) - call MultiboardSetItemStyle(mbitem, true, true) - else - call MultiboardSetItemValue(mbitem, "-") - call MultiboardSetItemStyle(mbitem, true, false) - endif - call MultiboardReleaseItem(mbitem) -endfunction -function WoWReforgedCalendarMultiboard__TimerFunctionCreateMultiboard takes nothing returns nothing - local multiboarditem mbitem= null - - set WoWReforgedCalendarMultiboard__m=CreateMultiboard() - call MultiboardSetTitleText(WoWReforgedCalendarMultiboard__m, "Calendar") - call MultiboardSetColumnCount(WoWReforgedCalendarMultiboard__m, 2) - call MultiboardSetRowCount(WoWReforgedCalendarMultiboard__m, 6) - call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, false) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 0, 0) - call MultiboardSetItemValue(mbitem, "Season:") - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 0, 1) - call MultiboardSetItemStyle(mbitem, true, true) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 1, 0) - call MultiboardSetItemValue(mbitem, "Weather:") - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 1, 1) - call MultiboardSetItemStyle(mbitem, true, true) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 2, 0) - call MultiboardSetItemValue(mbitem, "Date:") - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 2, 1) - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 3, 0) - call MultiboardSetItemValue(mbitem, "Month:") - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 3, 1) - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 4, 0) - call MultiboardSetItemValue(mbitem, "Time:") - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 4, 1) - call MultiboardSetItemStyle(mbitem, true, true) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 5, 0) - call MultiboardSetItemValue(mbitem, "Event:") - call MultiboardSetItemStyle(mbitem, true, false) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 5, 1) - call MultiboardSetItemStyle(mbitem, true, true) - call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) - call MultiboardReleaseItem(mbitem) - - call TimerStart(WoWReforgedCalendarMultiboard__t, 0.3, true, function WoWReforgedCalendarMultiboard__UpdateMultiboard) - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function FixCalendarMultiboardTitleColor takes nothing returns nothing - call MultiboardSetTitleTextColorBJ(WoWReforgedCalendarMultiboard__m, 100, 80, 20, 0) -endfunction -function WoWReforgedCalendarMultiboard__Init takes nothing returns nothing - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedCalendarMultiboard__TimerFunctionCreateMultiboard) -endfunction -//library WoWReforgedCalendarMultiboard ends -//library WoWReforgedProperties: -function GetMaxProperties takes nothing returns integer - return WoWReforgedProperties__propertiesCounter -endfunction -function GetProperty takes integer index returns integer - return WoWReforgedProperties__properties[index] -endfunction -function GetPropertyIndex takes unit whichUnit returns integer - local integer handleId= GetHandleId(whichUnit) - if ( HaveSavedInteger(WoWReforgedProperties__h, handleId, 0) ) then - return LoadInteger(WoWReforgedProperties__h, GetHandleId(whichUnit), 0) - endif - return - 1 -endfunction -function PlayerOwnsPropertyOfRace takes player whichPlayer,integer whichRace returns boolean - local integer i= 0 - local integer max= 0 - local integer index= 0 - local unit whichUnit= null - if ( whichRace == udg_RaceNone ) then - return true - endif - - set max=BlzGroupGetSize(WoWReforgedProperties__properiesGroup) - loop - exitwhen ( i == max ) - set whichUnit=BlzGroupUnitAt(WoWReforgedProperties__properiesGroup, i) - set index=GetPropertyIndex(whichUnit) - if ( index != - 1 and s__Property_soldRace[(WoWReforgedProperties__properties[(index)])] == whichRace ) then // INLINED!! - return true - endif - set whichUnit=null - set i=i + 1 - endloop - - return false -endfunction -function PropertyAllowsItemTypeId takes player whichPlayer,integer whichRace,integer itemTypeId returns boolean - local integer t= GetRaceObjectType(whichRace , itemTypeId) - - if ( t == RACE_OBJECT_TYPE_NONE ) then - return true - elseif ( t == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_1_ITEM ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_2_ITEM ) then - return false - elseif ( t == RACE_OBJECT_TYPE_TIER_3_ITEM ) then - return false - endif - - return PlayerOwnsPropertyOfRace(whichPlayer , GetObjectRace(itemTypeId)) -endfunction -function WoWReforgedProperties__GetPropertyIndexByUnitTypeId takes integer unitTypeId returns integer - local integer i= 0 - local integer max= (WoWReforgedProperties__propertiesCounter) // INLINED!! - loop - exitwhen ( i >= max ) - if ( s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])] == unitTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function IsProperty takes integer unitTypeId returns boolean - return WoWReforgedProperties__GetPropertyIndexByUnitTypeId(unitTypeId) != - 1 -endfunction -function IsUnitProperty takes unit whichUnit returns boolean - return (WoWReforgedProperties__GetPropertyIndexByUnitTypeId((GetUnitTypeId(whichUnit))) != - 1) // INLINED!! -endfunction -function AddProperty takes integer unitTypeId,integer purchaseUnitTypeId,integer resource,integer maxWorkers,integer soldRace,boolean shipyard returns integer - local integer property= s__Property__allocate() - set s__Property_unitTypeId[property]=unitTypeId - set s__Property_purchaseUnitTypeId[property]=purchaseUnitTypeId - set s__Property_resource[property]=resource - set s__Property_maxWorkers[property]=maxWorkers - set s__Property_soldRace[property]=soldRace - set s__Property_shipyard[property]=shipyard - - set WoWReforgedProperties__properties[WoWReforgedProperties__propertiesCounter]=property - set WoWReforgedProperties__propertiesCounter=WoWReforgedProperties__propertiesCounter + 1 - - return property -endfunction -function AddPropertyWoWReforged takes nothing returns nothing - set udg_TmpInteger=AddProperty(udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpInteger , udg_TmpInteger2 , udg_TmpInteger3 , udg_TmpBoolean) - set udg_TmpBoolean=false -endfunction -function WoWReforgedProperties__RegisterAllWorkersForLoadedMine takes unit mine returns nothing - local integer i= 0 - local integer max= (udg_MaxRaces) // INLINED!! - loop - exitwhen ( i >= max ) - // TODO new op limit for each? - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_WORKER) != 0 ) then - call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_WORKER)) , true) // INLINED!! - endif - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_MALE_CITIZEN) != 0 ) then - call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_MALE_CITIZEN)) , true) // INLINED!! - endif - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_FEMALE_CITIZEN) != 0 ) then - call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_FEMALE_CITIZEN)) , true) // INLINED!! - endif - if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CHILD) != 0 ) then - call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CHILD)) , true) // INLINED!! - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedProperties__AddUnitType takes integer index,unit shop,integer t returns nothing - local integer unitTypeId= GetRaceObjectTypeId(s__Property_soldRace[(WoWReforgedProperties__properties[(index)])] , t) // INLINED!! - if ( unitTypeId != 0 and GenerateId(unitTypeId) ) then -call AddPagedButtonsId((shop ) , ( unitTypeId) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! - endif -endfunction -function WoWReforgedProperties__AddItemType takes integer index,unit shop,integer t returns nothing - local integer itemTypeId= GetRaceObjectTypeId(s__Property_soldRace[(WoWReforgedProperties__properties[(index)])] , t) // INLINED!! - if ( itemTypeId != 0 and GenerateId(itemTypeId) ) then -call AddPagedButtonsId((shop ) , ( itemTypeId) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - endif -endfunction -function WoWReforgedProperties__PurchaseProperty takes integer index,unit whichUnit,player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - - call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_UNITACQUIRED, "Purchased property " + GetUnitName(whichUnit)) - - call SetUnitOwner(whichUnit, whichPlayer, true) - - call ResearchAllForPlayer(whichPlayer , s__Property_soldRace[(WoWReforgedProperties__properties[(index)])]) // INLINED!! - - call AchievementPropertyShark(whichPlayer) - call AchievementPropertyLandowner(whichPlayer , (WoWReforgedProperties__propertiesCounter)) // INLINED!! - - call RemoveUnitFromStock(whichUnit, s__Property_purchaseUnitTypeId[(WoWReforgedProperties__properties[(index)])]) // INLINED!! - - call AddLoadedMine(whichUnit , s__Property_resource[(WoWReforgedProperties__properties[(index)])] , 9999999 , s__Property_maxWorkers[(WoWReforgedProperties__properties[(index)])]) // INLINED!! - call SetMineExplodesOnDeath(whichUnit , false) - call UnitAddAbility(whichUnit, WoWReforgedProperties_CARGO_HOLD_ABILITY_ID) - call UnitAddAbility(whichUnit, WoWReforgedProperties_LOAD_ABILITY_ID) - call UnitAddAbility(whichUnit, WoWReforgedProperties_UNLOAD_ABILITY_ID) - - call ResourcesGui_StartUpdateTimerForUnits(whichUnit , null) // update resources UI - - call EnablePagedButtons(whichUnit) - call SetPagedButtonsSlotsPerPage(whichUnit , 7) - set GenerateIds___generatedIdsCounter=0 // INLINED!! - call NextPagedButtonsPage(whichUnit , "(Units)") - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TOWN_HALL_3) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TOWN_HALL_4) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FEMALE_CITIZEN) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_CHILD) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_PET) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FOOTMAN) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_RIFLEMAN) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_KNIGHT) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_BARRACKS_4) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_PRIEST) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SORCERESS) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SPELLBREAKER) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_GRYPHON) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_DRAGONHAWK) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_AVIARY_3) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_AVIARY_4) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FLYING_MACHINE) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SIEGE_ENGINE) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_MORTAR) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_WORKSHOP_4) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TAUREN) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SHADE) - - if ( s__Property_shipyard[(WoWReforgedProperties__properties[(index)])] ) then // INLINED!! - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TRANSPORT_SHIP) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FRIGATE) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_BATTLESHIP) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SHIP_SPECIAL_1) - call WoWReforgedProperties__AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SHIP_SPECIAL_2) - endif - - call NextPagedButtonsPage(whichUnit , "(Buildings)") - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_FARM_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_ALTAR_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_MILL_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_BARRACKS_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SHOP_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_WORKSHOP_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SHIPYARD_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM) - call WoWReforgedProperties__AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2_ITEM) - - call WoWReforgedProperties__RegisterAllWorkersForLoadedMine(whichUnit) - - call ShowPagedButtonsUI(whichPlayer , whichUnit) -endfunction -function PingProperties takes player whichPlayer returns nothing - local integer i= 0 - local integer max= BlzGroupGetSize(WoWReforgedProperties__properiesGroup) - loop - exitwhen ( i >= max ) - call PingUnitForPlayer(BlzGroupUnitAt(WoWReforgedProperties__properiesGroup, i) , whichPlayer) - set i=i + 1 - endloop -endfunction -function WoWReforgedProperties__GetPropertyIndexByPurchaseUnitTypeId takes integer unitTypeId returns integer - local integer i= 0 - local integer max= (WoWReforgedProperties__propertiesCounter) // INLINED!! - loop - exitwhen ( i >= max ) - if ( s__Property_purchaseUnitTypeId[(WoWReforgedProperties__properties[(i)])] == unitTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function WoWReforgedProperties__TriggerActionPurchase takes nothing returns nothing - local integer unitTypeId= GetUnitTypeId(GetSoldUnit()) - local integer index= WoWReforgedProperties__GetPropertyIndexByPurchaseUnitTypeId(unitTypeId) - if ( index != - 1 ) then - call h__RemoveUnit(GetSoldUnit()) - call WoWReforgedProperties__PurchaseProperty(index , GetSellingUnit() , GetOwningPlayer(GetBuyingUnit())) - endif -endfunction -function WoWReforgedProperties__FilterIsProperty takes nothing returns boolean - return (WoWReforgedProperties__GetPropertyIndexByUnitTypeId((GetUnitTypeId(GetFilterUnit()))) != - 1) // INLINED!! -endfunction -function WoWReforgedProperties__ForGroupUpdateProperties takes nothing returns nothing - local unit p= GetEnumUnit() - local integer index= WoWReforgedProperties__GetPropertyIndexByUnitTypeId(GetUnitTypeId(p)) - if ( index != - 1 ) then - call GroupAddUnit(WoWReforgedProperties__properiesGroup, p) - call SaveInteger(WoWReforgedProperties__h, GetHandleId(p), 0, index) - call UnitAddAbility(p, 'Asud') - call UnitAddAbility(p, WoWReforgedProperties_SELECT_UNIT_ABILITY_ID) - call UnitAddAbility(p, WoWReforgedProperties_SELECT_HERO_ABILITY_ID) - call UnitAddAbility(p, 'Avul') - call AddUnitToStock(p, s__Property_purchaseUnitTypeId[(WoWReforgedProperties__properties[(index)])], 1, 1) // INLINED!! - endif - set p=null -endfunction -function WoWReforgedProperties__TimerFunctionUpdateProperties takes nothing returns nothing - local timer t= GetExpiredTimer() - local group g= CreateGroup() - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedProperties__FilterIsProperty)) - call ForGroup(g, function WoWReforgedProperties__ForGroupUpdateProperties) - call GroupClear(g) - call DestroyGroup(g) - set g=null - call PauseTimer(t) - call DestroyTimer(t) - set t=null -endfunction -function WoWReforgedProperties__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedProperties__purchaseTrigger, EVENT_PLAYER_UNIT_SELL) - // Use a trigger action because of ResourcesGui_StartUpdateTimerForUnits and the player selection. - call TriggerAddAction(WoWReforgedProperties__purchaseTrigger, function WoWReforgedProperties__TriggerActionPurchase) - call TimerStart(CreateTimer(), 1.0, false, function WoWReforgedProperties__TimerFunctionUpdateProperties) -endfunction -//library WoWReforgedProperties ends -//library WoWReforgedItemCheck: -function IsTome takes integer itemTypeId returns boolean - if ( itemTypeId == TOME_OF_AGILITY ) then - return true - elseif ( itemTypeId == TOME_OF_AGILITY_2 ) then - return true - elseif ( itemTypeId == TOME_OF_EXPERIENCE ) then - return true - elseif ( itemTypeId == TOME_OF_GREATER_EXPERIENCE ) then - return true - elseif ( itemTypeId == TOME_OF_INTELLIGENCE ) then - return true - elseif ( itemTypeId == TOME_OF_INTELLIGENCE_2 ) then - return true - elseif ( itemTypeId == TOME_OF_KNOWLEDGE ) then - return true - elseif ( itemTypeId == TOME_OF_STRENGTH ) then - return true - elseif ( itemTypeId == TOME_OF_STRENGTH_2 ) then - return true - elseif ( itemTypeId == TOME_OF_POWER ) then - return true - elseif ( itemTypeId == TOME_OF_ARMOR ) then - return true - elseif ( itemTypeId == TOME_OF_DAMAGE ) then - return true - endif - return false -endfunction -// TODO Make this function faster by caching item type races and professions! -function CanItemTypeIdBePickedUp takes integer itemTypeId,unit hero returns boolean - local player heroOwner= GetOwningPlayer(hero) - local integer unitTypeId= GetUnitTypeId(hero) - local integer playerId= GetConvertedPlayerId(heroOwner) - local integer itemRace= udg_RaceNone - local integer itemProfession= udg_ProfessionNone - local boolean result= false - if ( udg_PlayerUnlockedAllRaces[playerId] ) then - set result=true - else - set itemRace=(GetObjectRace((itemTypeId))) // INLINED!! - set itemProfession=GetBookItemProfession(itemTypeId) - set result=( itemRace == udg_RaceNone or itemRace == udg_PlayerRace[playerId] or itemRace == udg_PlayerRace2[playerId] or itemRace == udg_PlayerRace3[playerId] or PropertyAllowsItemTypeId(heroOwner , itemRace , itemTypeId) ) and ( itemProfession == udg_ProfessionNone or itemProfession == udg_PlayerProfession[playerId] or itemProfession == udg_PlayerProfession2[playerId] or itemProfession == udg_PlayerProfession3[playerId] or PropertyAllowsItemTypeId(heroOwner , itemRace , itemTypeId) ) - endif - - if ( result and not udg_Tomes and unitTypeId != BACKPACK ) then - set result=not IsTome(itemTypeId) - endif - - set heroOwner=null - return result -endfunction -function GetItemTypeIdPickupErrorReason takes integer itemTypeId,unit hero returns string - local player heroOwner= GetOwningPlayer(hero) - local integer unitTypeId= GetUnitTypeId(hero) - local integer playerId= GetConvertedPlayerId(heroOwner) - local integer itemRace= udg_RaceNone - local integer itemProfession= udg_ProfessionNone - if ( not udg_PlayerUnlockedAllRaces[playerId] ) then - set itemRace=(GetObjectRace((itemTypeId))) // INLINED!! - if ( itemRace != udg_RaceNone and itemRace != udg_PlayerRace[playerId] and itemRace != udg_PlayerRace2[playerId] and itemRace != udg_PlayerRace3[playerId] ) then - return "Belongs to race " + udg_RaceName[itemRace] + "!" - endif - set itemProfession=GetBookItemProfession(itemTypeId) - if ( itemProfession != udg_ProfessionNone and itemProfession != udg_PlayerProfession[playerId] and itemProfession != udg_PlayerProfession2[playerId] and itemProfession != udg_PlayerProfession3[playerId] ) then - return "Belongs to profession " + udg_ProfessionName[itemProfession] + "!" - endif - endif - - if ( not udg_Tomes and unitTypeId != BACKPACK and not IsTome(itemTypeId) ) then - return "Tomes are disabled." - endif - return null -endfunction -function IsUniqueScepterOrProfessionBook takes item whichItem,unit hero returns boolean - local integer itemTypeId= GetItemTypeId(whichItem) - if ( GetUnitTypeId(hero) == BACKPACK ) then - return true - endif - if ( GetBookItemProfession(itemTypeId) != udg_ProfessionNone or GetObjectRaceType(itemTypeId) == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then - return CountItemsOfItemTypeId(hero , itemTypeId) <= 1 - endif - return true -endfunction -function CanItemBePickedUp takes item whichItem,unit hero returns boolean - local player heroOwner= GetOwningPlayer(hero) - local player itemOwner= GetItemPlayer(whichItem) - local boolean result= ( itemOwner == null or itemOwner == Player(PLAYER_NEUTRAL_PASSIVE) or itemOwner == heroOwner ) and IsUniqueScepterOrProfessionBook(whichItem , hero) and CanItemTypeIdBePickedUp(GetItemTypeId(whichItem) , hero) - set heroOwner=null - set itemOwner=null - return result -endfunction -function GetItemPickupErrorReason takes item whichItem,unit hero returns string - local player heroOwner= GetOwningPlayer(hero) - local player itemOwner= GetItemPlayer(whichItem) - local string result= null - if ( itemOwner != null and itemOwner != Player(PLAYER_NEUTRAL_PASSIVE) and itemOwner != heroOwner ) then - set result="Owner is " + GetPlayerNameColored(itemOwner) + "!" - elseif ( not IsUniqueScepterOrProfessionBook(whichItem , hero) ) then - set result="Item can be only once it inventory!" - else - set result=GetItemTypeIdPickupErrorReason(GetItemTypeId(whichItem) , hero) - endif - set heroOwner=null - set itemOwner=null - return result -endfunction -//library WoWReforgedItemCheck ends -//library WoWReforgedBackpacks: -function SetPlayerBagInfo takes player whichPlayer,boolean info returns nothing - set WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId(whichPlayer)]=info -endfunction -function GetPlayerBagInfo takes player whichPlayer returns boolean - return WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId(whichPlayer)] -endfunction -function GetPlayerBackpack takes player whichPlayer returns unit - return WoWReforgedBackpacks___Backpack[GetPlayerId(whichPlayer)] -endfunction -function PlayerHasBackpack takes player whichPlayer returns boolean - return (WoWReforgedBackpacks___Backpack[GetPlayerId((whichPlayer))]) != null // INLINED!! -endfunction -function GetBackpackItemIndex takes integer playerId,integer page,integer slot returns integer - return Index3D(playerId , page , slot , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) -endfunction -function GetBackpackItemTypeId takes integer index returns integer - return WoWReforgedBackpacks___BackpackItemType[index] -endfunction -function GetBackpackItemCharges takes integer index returns integer - return WoWReforgedBackpacks___BackpackItemCharges[index] -endfunction -function GetBackpackItemIsPawnable takes integer index returns boolean - return WoWReforgedBackpacks___BackpackItemPawnable[index] -endfunction -function GetBackpackItemTooltipExtended takes integer index returns string - return WoWReforgedBackpacks___BackpackItemTooltipExtended[index] -endfunction -function GetBackpackItemPlayer takes integer index returns player - return WoWReforgedBackpacks___BackpackItemPlayer[index] -endfunction -function ClearBackpackItem takes integer index returns nothing - set WoWReforgedBackpacks___BackpackItemType[index]=0 - set WoWReforgedBackpacks___BackpackItemCharges[index]=0 - set WoWReforgedBackpacks___BackpackItemPawnable[index]=false - set WoWReforgedBackpacks___BackpackItemInvulnerable[index]=false - set WoWReforgedBackpacks___BackpackItemName[index]="" - set WoWReforgedBackpacks___BackpackItemDescription[index]="" - set WoWReforgedBackpacks___BackpackItemTooltip[index]="" - set WoWReforgedBackpacks___BackpackItemTooltipExtended[index]="" - set WoWReforgedBackpacks___BackpackItemPlayer[index]=null -endfunction -function SetBackpackItemFromItem takes item whichItem,integer index returns nothing - set WoWReforgedBackpacks___BackpackItemType[index]=GetItemTypeId(whichItem) - set WoWReforgedBackpacks___BackpackItemCharges[index]=GetItemCharges(whichItem) - set WoWReforgedBackpacks___BackpackItemPawnable[index]=IsItemPawnable(whichItem) - set WoWReforgedBackpacks___BackpackItemInvulnerable[index]=IsItemInvulnerable(whichItem) - set WoWReforgedBackpacks___BackpackItemName[index]=GetItemName(whichItem) - set WoWReforgedBackpacks___BackpackItemDescription[index]=BlzGetItemDescription(whichItem) - set WoWReforgedBackpacks___BackpackItemTooltip[index]=BlzGetItemTooltip(whichItem) - set WoWReforgedBackpacks___BackpackItemTooltipExtended[index]=BlzGetItemExtendedTooltip(whichItem) - set WoWReforgedBackpacks___BackpackItemPlayer[index]=GetItemPlayer(whichItem) -endfunction -function ApplyBackpackItem takes item whichItem,integer index returns nothing - call SetItemCharges(whichItem, WoWReforgedBackpacks___BackpackItemCharges[index]) - call SetItemPawnable(whichItem, WoWReforgedBackpacks___BackpackItemPawnable[index]) - call SetItemDroppable(whichItem, true) // all items must be droppable in the backpack! - call SetItemInvulnerable(whichItem, WoWReforgedBackpacks___BackpackItemInvulnerable[index]) - call BlzSetItemName(whichItem, WoWReforgedBackpacks___BackpackItemName[index]) - call BlzSetItemDescription(whichItem, WoWReforgedBackpacks___BackpackItemDescription[index]) - call BlzSetItemTooltip(whichItem, WoWReforgedBackpacks___BackpackItemTooltip[index]) - call BlzSetItemExtendedTooltip(whichItem, WoWReforgedBackpacks___BackpackItemTooltipExtended[index]) - call SetItemPlayer(whichItem, WoWReforgedBackpacks___BackpackItemPlayer[index], false) -endfunction -function SetBackpackItemFromIndex takes integer index,integer sourceIndex returns nothing - set WoWReforgedBackpacks___BackpackItemType[index]=WoWReforgedBackpacks___BackpackItemType[sourceIndex] - set WoWReforgedBackpacks___BackpackItemCharges[index]=WoWReforgedBackpacks___BackpackItemCharges[sourceIndex] - set WoWReforgedBackpacks___BackpackItemPawnable[index]=WoWReforgedBackpacks___BackpackItemPawnable[sourceIndex] - set WoWReforgedBackpacks___BackpackItemInvulnerable[index]=WoWReforgedBackpacks___BackpackItemInvulnerable[sourceIndex] - set WoWReforgedBackpacks___BackpackItemName[index]=WoWReforgedBackpacks___BackpackItemName[sourceIndex] - set WoWReforgedBackpacks___BackpackItemDescription[index]=WoWReforgedBackpacks___BackpackItemDescription[sourceIndex] - set WoWReforgedBackpacks___BackpackItemTooltip[index]=WoWReforgedBackpacks___BackpackItemTooltip[sourceIndex] - set WoWReforgedBackpacks___BackpackItemTooltipExtended[index]=WoWReforgedBackpacks___BackpackItemTooltipExtended[sourceIndex] - set WoWReforgedBackpacks___BackpackItemPlayer[index]=WoWReforgedBackpacks___BackpackItemPlayer[sourceIndex] -endfunction -function BackpackCountItemsOfItemTypeForPlayer takes player whichPlayer,integer itemTypeId returns integer - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - local integer result= 0 - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - if ( WoWReforgedBackpacks___BackpackPageNumber[playerId] == i ) then - if ( UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j) != null and GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j)) == itemTypeId ) then - set result=result + 1 - endif - else - if ( WoWReforgedBackpacks___BackpackItemType[index] == itemTypeId ) then - set result=result + 1 - endif - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - return result -endfunction -function Hero1CountItemsOfItemType takes unit hero,integer itemTypeId returns integer - local player owner= GetOwningPlayer(hero) - local integer convertedPlayerId= GetConvertedPlayerId(owner) - local integer result= CountItemsOfItemTypeId(hero , itemTypeId) - local integer i= 0 - loop - exitwhen ( i == BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((owner))])) ) // INLINED!! - set result=result + CountItemsOfItemTypeId(BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((owner))]), i) , itemTypeId) // INLINED!! - set i=i + 1 - endloop - set owner=null - return result -endfunction -function PlayerCountItemsOfItemType takes player whichPlayer,integer itemTypeId returns integer - local integer result= BackpackCountItemsOfItemTypeForPlayer(whichPlayer , itemTypeId) - local unit hero1= (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! - local unit hero2= (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! - local unit hero3= (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! - if ( hero1 != null ) then - set result=result + Hero1CountItemsOfItemType(hero1 , itemTypeId) - endif - if ( hero2 != null ) then - set result=result + Hero1CountItemsOfItemType(hero2 , itemTypeId) - endif - if ( hero3 != null ) then - set result=result + Hero1CountItemsOfItemType(hero3 , itemTypeId) - endif - return result -endfunction -function HeroDropRandomItem takes unit hero returns item - local player owner= GetOwningPlayer(hero) - local integer playerId= GetPlayerId(owner) - local integer convertedPlayerId= GetConvertedPlayerId(owner) - local unit array heroes - local integer array slots - local integer counter= 0 - local unit bag= null - local integer maxBags= 0 - local integer i= 0 - local integer j= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - if ( UnitItemInSlot(hero, i) != null ) then - set heroes[counter]=hero - set slots[counter]=i - set counter=counter + 1 - endif - set i=i + 1 - endloop - if ( hero == (udg_Hero[GetPlayerId((owner))]) ) then // INLINED!! - set maxBags=BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((owner))])) // INLINED!! - set i=0 - loop - exitwhen ( i == maxBags ) - set bag=BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((owner))]), i) // INLINED!! - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - if ( UnitItemInSlot(bag, j) != null ) then - set heroes[counter]=bag - set slots[counter]=j - set counter=counter + 1 - endif - set j=j + 1 - endloop - set bag=null - set i=i + 1 - endloop - endif - set owner=null - if ( counter > 0 ) then - set i=GetRandomInt(0, counter) - return UnitRemoveItemFromSlot(heroes[i], slots[i]) - endif - return null -endfunction -function RemoveAllBackpackItemTypesForPlayer takes player whichPlayer,integer itemTypeId returns integer - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - local integer result= 0 - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - if ( WoWReforgedBackpacks___BackpackPageNumber[playerId] == i ) then - if ( UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j) != null and GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j)) == itemTypeId ) then - call h__RemoveItem(UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j)) - set result=result + 1 - endif - else - if ( WoWReforgedBackpacks___BackpackItemType[index] == itemTypeId ) then - call ClearBackpackItem(index) - set result=result + 1 - endif - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - return result -endfunction -// This does not clear the backpack inventory! -function DropBackpackForPlayerTo takes player whichPlayer,real x,real y returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - local item whichItem= null - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - if ( WoWReforgedBackpacks___BackpackPageNumber[playerId] == i ) then - set whichItem=CreateItem(GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j)), x, y) - else - set whichItem=CreateItem(WoWReforgedBackpacks___BackpackItemType[index], x, y) - endif - call ApplyBackpackItem(whichItem , index) - if ( WoWReforgedBackpacks___BackpackPageNumber[playerId] == i ) then - call SetItemCharges(whichItem, GetItemCharges(UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j))) - else - call SetItemCharges(whichItem, WoWReforgedBackpacks___BackpackItemCharges[index]) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - - call UpdateItemsForBackpackUIEvaluate(whichPlayer) -endfunction -function DropBackpackForPlayer takes player whichPlayer,rect whichRect returns nothing - call DropBackpackForPlayerTo(whichPlayer , GetRectCenterX(whichRect) , GetRectCenterY(whichRect)) -endfunction -function DropBackpack takes player whichPlayer returns integer - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - local item whichItem= null - local real x= GetUnitX(WoWReforgedBackpacks___Backpack[playerId]) - local real y= GetUnitY(WoWReforgedBackpacks___Backpack[playerId]) - local integer result= 0 - // drop before so they won't have to be cleared or removed - set result=DropAllItemsFromHero(WoWReforgedBackpacks___Backpack[playerId]) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index3D(playerId , WoWReforgedBackpacks___BackpackPageNumber[playerId] , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - call ClearBackpackItem(index) - set j=j + 1 - endloop - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - if ( WoWReforgedBackpacks___BackpackItemType[index] != 0 ) then - set whichItem=CreateItem(WoWReforgedBackpacks___BackpackItemType[index], x, y) - call ApplyBackpackItem(whichItem , index) - call SetItemCharges(whichItem, WoWReforgedBackpacks___BackpackItemCharges[index]) - call ClearBackpackItem(index) - set result=result + 1 - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - - call UpdateItemsForBackpackUIEvaluate(whichPlayer) - return result -endfunction -function DropQuestItemFromCreepHeroAtRect takes unit hero,integer itemTypeId,rect whichRect returns item - local item whichItem= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY or whichItem != null ) - if ( GetItemTypeId(UnitItemInSlot(hero, i)) == itemTypeId ) then - call h__RemoveItem(UnitItemInSlot(hero, i)) - set whichItem=CreateItem(itemTypeId, GetRectCenterX(whichRect), GetRectCenterY(whichRect)) - call SetItemInvulnerable(whichItem, true) - endif - set i=i + 1 - endloop - return whichItem -endfunction -function DropQuestItemFromHeroAtRect takes player whichPlayer,integer itemTypeId,rect whichRect returns item - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - local item whichItem= DropQuestItemFromCreepHeroAtRect((udg_Hero[GetPlayerId((whichPlayer))]) , itemTypeId , whichRect) // INLINED!! - // Check second hero inventory - if ( whichItem == null and (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - set whichItem=DropQuestItemFromCreepHeroAtRect((udg_Hero2[GetPlayerId((whichPlayer))]) , itemTypeId , whichRect) // INLINED!! - endif - // Check third hero inventory - if ( whichItem == null and (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - set whichItem=DropQuestItemFromCreepHeroAtRect((udg_Hero3[GetPlayerId((whichPlayer))]) , itemTypeId , whichRect) // INLINED!! - endif - // Check Equipment Bags - if ( whichItem == null and (udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))]) != null ) then // INLINED!! - set i=0 - loop - exitwhen ( i == BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) or whichItem != null ) // INLINED!! - set whichItem=DropQuestItemFromCreepHeroAtRect(BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))]), i) , itemTypeId , whichRect) // INLINED!! - set i=i + 1 - endloop - endif - // Check the backpack - if ( whichItem == null ) then - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES or whichItem != null ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY or whichItem != null ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - if ( WoWReforgedBackpacks___BackpackItemType[index] == itemTypeId or ( WoWReforgedBackpacks___BackpackPageNumber[playerId] == i and GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j)) == itemTypeId ) ) then - if ( WoWReforgedBackpacks___BackpackPageNumber[playerId] == i ) then - call h__RemoveItem(UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], j)) - endif - call ClearBackpackItem(index) - set whichItem=CreateItem(itemTypeId, GetRectCenterX(whichRect), GetRectCenterY(whichRect)) - call SetItemInvulnerable(whichItem, true) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - endif - return whichItem -endfunction -function DropQuestItemFromHeroAtRectByDyingUnit takes integer itemTypeId,rect whichRect returns item - return DropQuestItemFromHeroAtRect(GetOwningPlayer(GetDyingUnit()) , itemTypeId , whichRect) -endfunction -function DropQuestItemFromDyingUnit takes nothing returns item - return DropQuestItemFromHeroAtRectByDyingUnit(udg_TmpItemTypeId , udg_TmpRect) -endfunction -function ClearCurrentBackpackPageForPlayer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer j= 0 - local integer index= 0 - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index3D(playerId , WoWReforgedBackpacks___BackpackPageNumber[playerId] , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - //call BJDebugMsg("Clearing item at index " + I2S(index)) - call ClearBackpackItem(index) - set j=j + 1 - endloop -endfunction -function ClearBackpackForPlayer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - //call BJDebugMsg("Clearing item at index " + I2S(index)) - call ClearBackpackItem(index) - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function AddItemToBackpackForPlayer takes player whichPlayer,item whichItem returns boolean - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - local integer itemRespawn= - 1 - local item slotItem= null - // try to add it to the inventory first - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - exitwhen ( whichItem == null ) - set slotItem=UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], i) - if ( slotItem == null or ( GetItemCharges(whichItem) > 0 and GetItemTypeId(whichItem) == GetItemTypeId(slotItem) and GetMaxStacksByItemTypeId(GetItemTypeId(whichItem)) >= GetItemCharges(slotItem) + GetItemCharges(whichItem) ) ) then - if ( UnitAddItem(WoWReforgedBackpacks___Backpack[playerId], whichItem) ) then - if ( (WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! - call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Added " + GetItemName(whichItem) + " to backpack bag " + I2S(WoWReforgedBackpacks___BackpackPageNumber[playerId] + 1) + " by stacking it to slot " + I2S(i + 1) + "." )) - endif - set whichItem=null - return true - else - // TODO Seems to happen for slots with the same item type. If this does not work by default, we have to change the charges and update the backpack page. - if ( (WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! - call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Problem on adding " + GetItemName(whichItem) + " to backpack bag " + I2S(WoWReforgedBackpacks___BackpackPageNumber[playerId] + 1) + " by stacking it to slot " + I2S(i + 1) + "." )) - endif - endif - endif - set slotItem=null - set i=i + 1 - endloop - // try adding it to another bag then - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - exitwhen ( whichItem == null ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - exitwhen ( whichItem == null ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - // empty slot - if ( WoWReforgedBackpacks___BackpackItemType[index] == 0 ) then - if ( (WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! - call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Added " + GetItemName(whichItem) + " to backpack bag " + I2S(i + 1) + " to empty slot " + I2S(j + 1) + "." )) - endif - call SetBackpackItemFromItem(whichItem , index) - set itemRespawn=(ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId((whichItem)))) // INLINED!! - call h__RemoveItem(whichItem) - set whichItem=null - if ( itemRespawn != - 1 ) then - call StartItemRespawn(itemRespawn) - endif - return true - // stack - elseif ( GetItemCharges(whichItem) > 0 and GetItemTypeId(whichItem) == WoWReforgedBackpacks___BackpackItemType[index] and GetMaxStacksByItemTypeId(WoWReforgedBackpacks___BackpackItemType[index]) >= WoWReforgedBackpacks___BackpackItemCharges[index] + GetItemCharges(whichItem) ) then - if ( (WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! - call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Added " + GetItemName(whichItem) + " to backpack bag " + I2S(i + 1) + " by stacking it to slot " + I2S(j + 1) + "." )) - endif - set WoWReforgedBackpacks___BackpackItemCharges[index]=WoWReforgedBackpacks___BackpackItemCharges[index] + GetItemCharges(whichItem) - set itemRespawn=(ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId((whichItem)))) // INLINED!! - call h__RemoveItem(whichItem) - set whichItem=null - if ( itemRespawn != - 1 ) then - call StartItemRespawn(itemRespawn) - endif - return true - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - - call UpdateItemsForBackpackUIEvaluate(whichPlayer) - return false -endfunction -function DestroyBackpackSystemForPlayer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - if ( WoWReforgedBackpacks___Backpack[playerId] != null ) then - call h__RemoveUnit(WoWReforgedBackpacks___Backpack[playerId]) - set WoWReforgedBackpacks___Backpack[playerId]=null - endif - call ClearBackpackForPlayer(whichPlayer) -endfunction -function DisableItemPickupTriggers takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - call DisableTrigger(WoWReforgedBackpacks___BackpackTriggerPickup[playerId]) - call DisableTrigger(WoWReforgedBackpacks___BackpackTriggerDrop[playerId]) -endfunction -function EnableItemPickupTriggers takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - call EnableTrigger(WoWReforgedBackpacks___BackpackTriggerPickup[playerId]) - call EnableTrigger(WoWReforgedBackpacks___BackpackTriggerDrop[playerId]) -endfunction -function GetBackpackPageNumber takes player whichPlayer returns integer - local integer playerId= GetPlayerId(whichPlayer) - return WoWReforgedBackpacks___BackpackPageNumber[playerId] -endfunction -function RefreshBackpackPage takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer page= GetBackpackPageNumber(whichPlayer) - local integer i= 0 - local integer index= 0 - local item whichItem= null - call DisableItemPickupTriggers(whichPlayer) - // Create All Items From Next/Previous Page - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set index=Index3D(playerId , page , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - if ( WoWReforgedBackpacks___BackpackItemType[index] != 0 ) then - //call BJDebugMsg("Item type " + GetObjectName(BackpackItemType[index]) + " at index " + I2S(index)) - call UnitAddItemToSlotById(WoWReforgedBackpacks___Backpack[playerId], WoWReforgedBackpacks___BackpackItemType[index], i) - set whichItem=UnitItemInSlot(WoWReforgedBackpacks___Backpack[playerId], i) - call ApplyBackpackItem(whichItem , index) - //else - //call BJDebugMsg("Empty at index " + I2S(index)) - endif - set i=i + 1 - endloop - call EnableItemPickupTriggers(whichPlayer) -endfunction -function ChangeBackpackPageEx takes player whichPlayer,integer newBackpackPage returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer index= 0 - local item SlotItem= null - call DisableItemPickupTriggers(whichPlayer) - // Save All Items - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set index=Index3D(playerId , WoWReforgedBackpacks___BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - set SlotItem=UnitItemInSlot((WoWReforgedBackpacks___Backpack[GetPlayerId((whichPlayer))]), i) // INLINED!! - if ( SlotItem != null ) then - call SetBackpackItemFromItem(SlotItem , index) - //call BJDebugMsg("Storing at index " + I2S(index) + " with type " + GetObjectName(BackpackItemType[index])) - call h__RemoveItem(SlotItem) - set SlotItem=null - else - //call BJDebugMsg("Storing empty at index " + I2S(index)) - call ClearBackpackItem(index) - endif - set i=i + 1 - endloop - call EnableItemPickupTriggers(whichPlayer) - // change page - set WoWReforgedBackpacks___BackpackPageNumber[playerId]=newBackpackPage - call BlzSetUnitName((WoWReforgedBackpacks___Backpack[GetPlayerId((whichPlayer))]), "Bag " + I2S(newBackpackPage + 1)) // INLINED!! - //call DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ("Open Bag " + I2S(newBackpackPage + 1) + ".")) - call RefreshBackpackPage(whichPlayer) -endfunction -function ChangeToNextFreeBagInBackpack takes player whichPlayer returns integer - local integer playerId= GetPlayerId(whichPlayer) - local integer currentPage= WoWReforgedBackpacks___BackpackPageNumber[playerId] - local integer result= - 1 - local integer index= 0 - local integer j= 0 - local integer i= currentPage - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - exitwhen ( result != - 1 ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - exitwhen ( result != - 1 ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - // empty slot - if ( WoWReforgedBackpacks___BackpackItemType[index] == 0 ) then - set result=i - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - if ( result == - 1 ) then - set i=0 - loop - exitwhen ( i >= currentPage ) - exitwhen ( result != - 1 ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - exitwhen ( result != - 1 ) - set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - // empty slot - if ( WoWReforgedBackpacks___BackpackItemType[index] == 0 ) then - set result=i - endif - set j=j + 1 - endloop - set i=i + 1 - endloop - endif - - if ( result != - 1 ) then - call ChangeBackpackPageEx(whichPlayer , result) - endif - - return result -endfunction -function ChangeToFirstBagInBackpack takes player whichPlayer returns nothing - call ChangeBackpackPageEx(whichPlayer , 0) -endfunction -function ChangeToLastBagInBackpack takes player whichPlayer returns nothing - call ChangeBackpackPageEx(whichPlayer , BACKPACK_MAX_PAGES - 1) -endfunction -function ChangeBackpackPage takes player whichPlayer,boolean next returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer page= WoWReforgedBackpacks___BackpackPageNumber[playerId] - local integer newPage= 0 - if ( next ) then - if ( page != ( BACKPACK_MAX_PAGES - 1 ) ) then - set newPage=page + 1 - else - set newPage=0 - endif - else - if ( page != 0 ) then - set newPage=page - 1 - else - set newPage=BACKPACK_MAX_PAGES - 1 - endif - endif - call ChangeBackpackPageEx(whichPlayer , newPage) -endfunction -function ClearHeroInventory takes unit hero returns nothing - local item slotItem= null - local integer i= 0 - loop - exitwhen ( i >= bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(hero, i) - if ( slotItem != null ) then - call h__RemoveItem(slotItem) - set slotItem=null - endif - set i=i + 1 - endloop -endfunction -// Starts from left to right and tries to stack all items of the same type which can be stacked or move items to empty slots. -function OrderBackpack takes player whichPlayer returns integer - local integer playerId= GetPlayerId(whichPlayer) - local integer orderedItems= 0 - local integer index1= 0 - local integer index2= 0 - local integer maxCharges1= 0 - local integer charges1= 0 - local integer charges2= 0 - local integer stackedCharges= 0 - local integer itemTypeId1= 0 - local integer itemTypeId2= 0 - local integer i= 0 - local integer j= 0 - local integer k= 0 - local integer l= 0 - local integer countEmptySlotsAfter= 0 - local integer remainingSlotsAfter= 0 - local boolean doneWithCurrentSlot= false - local boolean doneWithAll= false - loop - exitwhen ( i == BACKPACK_MAX_PAGES or doneWithAll ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY or doneWithAll ) - set index1=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - set itemTypeId1=WoWReforgedBackpacks___BackpackItemType[index1] - set charges1=WoWReforgedBackpacks___BackpackItemCharges[index1] - set maxCharges1=GetMaxStacksByItemTypeId(itemTypeId1) - set doneWithCurrentSlot=itemTypeId1 != 0 and ( charges1 == 0 ) or ( charges1 >= maxCharges1 ) // stop if the slot is already full - set countEmptySlotsAfter=0 - set remainingSlotsAfter=( bj_MAX_INVENTORY - j - 1 ) + IMaxBJ(0, ( BACKPACK_MAX_PAGES - i - 1 )) * bj_MAX_INVENTORY - set k=i - loop - exitwhen ( k >= BACKPACK_MAX_PAGES or doneWithCurrentSlot ) - if ( k == i ) then - set l=j + 1 - else - set l=0 - endif - loop - exitwhen ( l >= bj_MAX_INVENTORY or doneWithCurrentSlot ) - set index2=Index3D(playerId , k , l , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - set itemTypeId2=WoWReforgedBackpacks___BackpackItemType[index2] - set charges2=WoWReforgedBackpacks___BackpackItemCharges[index2] - // stack items - if ( itemTypeId1 != 0 and itemTypeId1 == itemTypeId2 and charges1 > 0 and charges1 < maxCharges1 ) then - set orderedItems=orderedItems + 1 - - set stackedCharges=IMinBJ(charges2, maxCharges1 - charges1) - set charges1=charges1 + stackedCharges - set WoWReforgedBackpacks___BackpackItemCharges[index1]=charges1 - if ( stackedCharges == charges2 ) then - call ClearBackpackItem(index2) - set countEmptySlotsAfter=countEmptySlotsAfter + 1 - else - set WoWReforgedBackpacks___BackpackItemCharges[index2]=charges2 - stackedCharges - endif - set doneWithCurrentSlot=charges1 >= maxCharges1 - // move the item to this empty slot - elseif ( itemTypeId1 == 0 and itemTypeId2 != 0 ) then - set orderedItems=orderedItems + 1 - set countEmptySlotsAfter=countEmptySlotsAfter + 1 - - set itemTypeId1=itemTypeId2 - set charges1=charges2 - set maxCharges1=GetMaxStacksByItemTypeId(itemTypeId2) - call SetBackpackItemFromIndex(index1 , index2) - call ClearBackpackItem(index2) - - set doneWithCurrentSlot=charges1 == 0 or charges1 >= maxCharges1 // stop if it is not stackable - elseif ( itemTypeId2 == 0 ) then - set countEmptySlotsAfter=countEmptySlotsAfter + 1 - endif - set l=l + 1 - endloop - set k=k + 1 - endloop - - //call BJDebugMsg("Remaining slots after " + I2S(remainingSlotsAfter) + " and empty slots " + I2S(countEmptySlotsAfter)) - - // stop early if there are only empty slots remaining - set doneWithAll=( countEmptySlotsAfter >= remainingSlotsAfter ) - - set j=j + 1 - endloop - set i=i + 1 - endloop - call ClearHeroInventory((WoWReforgedBackpacks___Backpack[GetPlayerId((whichPlayer))])) // INLINED!! - call RefreshBackpackPage(whichPlayer) - call UpdateItemsForBackpackUIEvaluate(whichPlayer) - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Ordered " + I2S(orderedItems) + " items." )) - - return orderedItems -endfunction -function WoWReforgedBackpacks___TriggerConditionChangeBackpackPage takes nothing returns boolean - return GetSpellAbilityId() == BACKPACK_NEXT_PAGE_ABILITY_ID or GetSpellAbilityId() == BACKPACK_PREVIOUS_PAGE_ABILITY_ID -endfunction -function WoWReforgedBackpacks___TriggerFunctionChangeBackpackPage takes nothing returns nothing - if ( GetSpellAbilityId() == BACKPACK_NEXT_PAGE_ABILITY_ID ) then - call ChangeBackpackPage(GetOwningPlayer(GetTriggerUnit()) , true) - elseif ( GetSpellAbilityId() == BACKPACK_PREVIOUS_PAGE_ABILITY_ID ) then - call ChangeBackpackPage(GetOwningPlayer(GetTriggerUnit()) , false) - endif - call UpdateItemsForBackpackUIEvaluate(GetOwningPlayer(GetTriggerUnit())) -endfunction -function WoWReforgedBackpacks___TriggerConditionPickupBackpackItem takes nothing returns boolean - local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) - return GetTriggerUnit() == WoWReforgedBackpacks___Backpack[playerId] -endfunction -function WoWReforgedBackpacks___TriggerFunctionPickupBackpackItem takes nothing returns nothing - local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) - local item whichItem= null - local integer index= 0 - local integer i= 0 - // update the backpack items from the current inventory - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set whichItem=UnitItemInSlot(GetTriggerUnit(), i) - if ( whichItem != null ) then - set index=Index3D(playerId , WoWReforgedBackpacks___BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - call SetBackpackItemFromItem(whichItem , index) - set whichItem=null - endif - set i=i + 1 - endloop - call UpdateItemsForBackpackUIEvaluate(GetOwningPlayer(GetTriggerUnit())) -endfunction -function WoWReforgedBackpacks___TriggerConditionDropBackpackItem takes nothing returns boolean - return GetTriggerUnit() == WoWReforgedBackpacks___Backpack[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] -endfunction -function WoWReforgedBackpacks___TriggerFunctionDropBackpackItem takes nothing returns nothing - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - local integer playerId= GetPlayerId(owner) - local integer index= 0 - local integer i= 0 - call TriggerSleepAction(0.0) // TODO Apparently the item is still there without sleeping. - loop - exitwhen ( i == bj_MAX_INVENTORY ) - if ( UnitItemInSlot(triggerUnit, i) == null ) then - set index=Index3D(playerId , WoWReforgedBackpacks___BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - //call BJDebugMsg("Dropping item at index " + I2S(index) + " with type " + GetObjectName(BackpackItemType[index])) - set WoWReforgedBackpacks___BackpackItemType[index]=0 - set WoWReforgedBackpacks___BackpackItemCharges[index]=0 - endif - set i=i + 1 - endloop - call UpdateItemsForBackpackUIEvaluate(owner) - set owner=null - set triggerUnit=null -endfunction -function WoWReforgedBackpacks___IsMoveItemOrder takes integer orderId returns boolean - return orderId >= A_ORDER_ID_MOVE_SLOT_0 and orderId <= A_ORDER_ID_MOVE_SLOT_5 -endfunction -function WoWReforgedBackpacks___IsRedirectOrder takes integer orderId returns boolean - return orderId == A_ORDER_ID_SMART or orderId == A_ORDER_ID_MOVE or orderId == A_ORDER_ID_DROP_ITEM -endfunction -function WoWReforgedBackpacks___TriggerConditionMoveBackpackItem takes nothing returns boolean - local integer orderId= GetIssuedOrderId() - return GetTriggerUnit() == WoWReforgedBackpacks___Backpack[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] and ( WoWReforgedBackpacks___IsMoveItemOrder(orderId) or WoWReforgedBackpacks___IsRedirectOrder(orderId) ) -endfunction -function WoWReforgedBackpacks___TriggerFunctionMoveBackpackItem takes nothing returns nothing - local integer orderId= GetIssuedOrderId() - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - local integer playerId= GetPlayerId(owner) - local integer i= 0 - local item whichItem= null - local integer index= 0 - local item orderTargetItem= GetOrderTargetItem() - local unit orderTargetUnit= GetOrderTargetUnit() - local boolean smartOrder= WoWReforgedBackpacks___IsRedirectOrder(orderId) - local boolean moveItem= WoWReforgedBackpacks___IsMoveItemOrder(orderId) - if ( moveItem ) then - call TriggerSleepAction(0.0) // TODO Apparently the item is still there without sleeping. - //call BJDebugMsg("Moved item!") - // update all items of the current bag after moving the item - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set index=Index3D(playerId , WoWReforgedBackpacks___BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) - set whichItem=UnitItemInSlot(triggerUnit, i) - if ( whichItem == null ) then - //call BJDebugMsg("Dropping item at index " + I2S(index) + " with type " + GetObjectName(BackpackItemType[index])) - call ClearBackpackItem(index) - else - call SetBackpackItemFromItem(whichItem , index) - endif - set i=i + 1 - endloop - call UpdateItemsForBackpackUIEvaluate(owner) - elseif ( (udg_Hero[GetPlayerId((owner))]) != null and WoWReforgedBackpacks___IsRedirectOrder(orderId) ) then // INLINED!! - if ( orderTargetItem != null ) then - // redirect order to hero - call IssueTargetOrderById((udg_Hero[GetPlayerId((owner))]), orderId, orderTargetItem) // INLINED!! - elseif ( orderTargetUnit != null ) then - if ( orderId == A_ORDER_ID_DROP_ITEM ) then - if ( DistanceBetweenUnits(triggerUnit , orderTargetUnit) > 200.0 ) then - call IssueTargetOrderById((udg_Hero[GetPlayerId((owner))]), A_ORDER_ID_MOVE, orderTargetUnit) // INLINED!! - endif - else - call IssueTargetOrderById((udg_Hero[GetPlayerId((owner))]), orderId, orderTargetUnit) // INLINED!! - endif - endif - endif - set orderTargetItem=null - set orderTargetUnit=null - set owner=null - set triggerUnit=null -endfunction -function InventoryIsFull takes unit whichUnit,integer itemTypeId returns boolean - local integer size= UnitInventorySize(whichUnit) - local item whichItem= null - local integer i= 0 - loop - exitwhen ( i == size ) - set whichItem=UnitItemInSlot(whichUnit, i) - if ( whichItem == null or ( GetItemTypeId(whichItem) == itemTypeId and GetMaxStacksByItemTypeId(itemTypeId) > GetItemCharges(whichItem) ) ) then - return false - endif - set whichItem=null - set i=i + 1 - endloop - return true -endfunction -function WoWReforgedBackpacks___TriggerConditionOrderBackpackItem takes nothing returns boolean - return (udg_Hero[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) == GetTriggerUnit() and GetIssuedOrderId() == A_ORDER_ID_SMART and GetOrderTargetItem() != null and not IsItemPowerup(GetOrderTargetItem()) and InventoryIsFull(GetTriggerUnit() , GetItemTypeId(GetOrderTargetItem())) // INLINED!! -endfunction -// This code is directly taken from the system "EasyItemStacknSplit v2.7.4" and allows picking up items even if the inventory is full. -function WoWReforgedBackpacks___TimerFunctionPickupItem takes nothing returns nothing - local integer i= 0 - local player slotPlayer= null - local unit hero= null - local item targetItem= null - local boolean noTargets= true - local real x= 0.0 - local real y= 0.0 - local integer order= 0 - set i=0 - loop - exitwhen ( i >= bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - set hero=(udg_Hero[GetPlayerId((slotPlayer))]) // INLINED!! - set targetItem=WoWReforgedBackpacks___BackpackTargetItem[i] - if ( targetItem != null and hero != null ) then - //call BJDebugMsg("Update backpack for player " + GetPlayerName(slotPlayer) + " with target item " + GetItemName(targetItem) + ".") - if ( GetWidgetLife(hero) > 0.0 and GetWidgetLife(targetItem) > 0.0 ) then - //call BJDebugMsg("Order to item with full inventory periodically.") - if ( GetUnitCurrentOrder(hero) == 851986 ) then // move - set x=GetItemX(targetItem) - GetUnitX(hero) - set y=GetItemY(targetItem) - GetUnitY(hero) - if ( x * x + y * y <= 22500 ) then - call IssueImmediateOrder(hero, "stop") - // TODO play fake sound - call SetUnitFacing(hero, bj_RADTODEG * Atan2(GetItemY(targetItem) - GetUnitY(hero), GetItemX(targetItem) - GetUnitX(hero))) - - if ( CanItemBePickedUp(targetItem , hero) ) then - if ( not AddItemToBackpackForPlayer(slotPlayer , targetItem) ) then - call SimError(slotPlayer , "Inventory is full.") - endif - else - call SimError(slotPlayer , GetItemName(targetItem) + " cannot be picked up: " + GetItemPickupErrorReason(targetItem , hero)) - endif - set WoWReforgedBackpacks___BackpackTargetItem[i]=null - endif - endif - else - //call BJDebugMsg("Reset ordering to item with full inventory.") - set WoWReforgedBackpacks___BackpackTargetItem[i]=null - endif - if ( WoWReforgedBackpacks___BackpackTargetItem[i] != null ) then - set noTargets=false - endif - endif - set hero=null - set targetItem=null - set slotPlayer=null - set i=i + 1 - endloop - if ( noTargets ) then - set WoWReforgedBackpacks___BackpackPickupTimerHasStarted=false - call PauseTimer(GetExpiredTimer()) - endif -endfunction -function WoWReforgedBackpacks___TriggerFunctionOrderBackpackItem takes nothing returns nothing - local unit hero= GetTriggerUnit() - local player owner= GetOwningPlayer(hero) - local integer playerId= GetPlayerId(owner) - local item whichItem= GetOrderTargetItem() - //call BJDebugMsg("Order to item with full inventory start.") - set WoWReforgedBackpacks___BackpackTargetItem[playerId]=whichItem - if ( not WoWReforgedBackpacks___BackpackPickupTimerHasStarted ) then - set WoWReforgedBackpacks___BackpackPickupTimerHasStarted=true - call TimerStart(WoWReforgedBackpacks___BackpackPickupTimer, 0.05, true, function WoWReforgedBackpacks___TimerFunctionPickupItem) - endif - call IssuePointOrder(GetTriggerUnit(), "move", GetItemX(whichItem), GetItemY(whichItem)) - set hero=null - set owner=null - set whichItem=null -endfunction -function CreateBackpackForPlayer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - set WoWReforgedBackpacks___Backpack[playerId]=CreateUnit(whichPlayer, BACK_PACK, GetUnitX((udg_Hero[GetPlayerId((whichPlayer))])), GetUnitY((udg_Hero[GetPlayerId((whichPlayer))])), 0.00) // INLINED!! - call SuspendHeroXP(WoWReforgedBackpacks___Backpack[playerId], true) - call SetUnitInvulnerable(WoWReforgedBackpacks___Backpack[playerId], true) - call BlzSetUnitName(WoWReforgedBackpacks___Backpack[playerId], "Bag 1") - // Change Ruckack Page Trigger - if ( WoWReforgedBackpacks___BackpackTriggerChangePage[playerId] == null ) then - set WoWReforgedBackpacks___BackpackTriggerChangePage[playerId]=CreateTrigger() - call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks___BackpackTriggerChangePage[playerId], whichPlayer, EVENT_PLAYER_UNIT_SPELL_CHANNEL, null) - call TriggerAddCondition(WoWReforgedBackpacks___BackpackTriggerChangePage[playerId], Condition(function WoWReforgedBackpacks___TriggerConditionChangeBackpackPage)) - call TriggerAddAction(WoWReforgedBackpacks___BackpackTriggerChangePage[playerId], function WoWReforgedBackpacks___TriggerFunctionChangeBackpackPage) - endif - if ( WoWReforgedBackpacks___BackpackTriggerPickup[playerId] == null ) then - set WoWReforgedBackpacks___BackpackTriggerPickup[playerId]=CreateTrigger() - call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks___BackpackTriggerPickup[playerId], whichPlayer, EVENT_PLAYER_UNIT_PICKUP_ITEM, null) - call TriggerAddCondition(WoWReforgedBackpacks___BackpackTriggerPickup[playerId], Condition(function WoWReforgedBackpacks___TriggerConditionPickupBackpackItem)) - call TriggerAddAction(WoWReforgedBackpacks___BackpackTriggerPickup[playerId], function WoWReforgedBackpacks___TriggerFunctionPickupBackpackItem) - endif - if ( WoWReforgedBackpacks___BackpackTriggerDrop[playerId] == null ) then - set WoWReforgedBackpacks___BackpackTriggerDrop[playerId]=CreateTrigger() - call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks___BackpackTriggerDrop[playerId], whichPlayer, EVENT_PLAYER_UNIT_DROP_ITEM, null) - call TriggerAddCondition(WoWReforgedBackpacks___BackpackTriggerDrop[playerId], Condition(function WoWReforgedBackpacks___TriggerConditionDropBackpackItem)) - call TriggerAddAction(WoWReforgedBackpacks___BackpackTriggerDrop[playerId], function WoWReforgedBackpacks___TriggerFunctionDropBackpackItem) - endif - if ( WoWReforgedBackpacks___BackpackTriggerMove[playerId] == null ) then - set WoWReforgedBackpacks___BackpackTriggerMove[playerId]=CreateTrigger() - call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks___BackpackTriggerMove[playerId], whichPlayer, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null) - call TriggerAddCondition(WoWReforgedBackpacks___BackpackTriggerMove[playerId], Condition(function WoWReforgedBackpacks___TriggerConditionMoveBackpackItem)) - call TriggerAddAction(WoWReforgedBackpacks___BackpackTriggerMove[playerId], function WoWReforgedBackpacks___TriggerFunctionMoveBackpackItem) - endif - if ( WoWReforgedBackpacks___BackpackTriggerOrder[playerId] == null ) then - set WoWReforgedBackpacks___BackpackTriggerOrder[playerId]=CreateTrigger() - call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks___BackpackTriggerOrder[playerId], whichPlayer, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null) - call TriggerAddCondition(WoWReforgedBackpacks___BackpackTriggerOrder[playerId], Condition(function WoWReforgedBackpacks___TriggerConditionOrderBackpackItem)) - call TriggerAddAction(WoWReforgedBackpacks___BackpackTriggerOrder[playerId], function WoWReforgedBackpacks___TriggerFunctionOrderBackpackItem) - endif -endfunction -function RefreshBackpackForPlayer takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - if ( WoWReforgedBackpacks___Backpack[playerId] != null ) then - call DisableItemPickupTriggers(whichPlayer) - call h__RemoveUnit(WoWReforgedBackpacks___Backpack[playerId]) - set WoWReforgedBackpacks___Backpack[playerId]=null - call EnableItemPickupTriggers(whichPlayer) - endif - call CreateBackpackForPlayer(whichPlayer) - call RefreshBackpackPage(whichPlayer) - call UpdateItemsForBackpackUIEvaluate(whichPlayer) -endfunction -function WoWReforgedBackpacks___TimerFunctionUpdateLocationsOfBackpackAndEquipmentBags takes nothing returns nothing - local player slotPlayer= null - local unit hero1= null - local integer countEquipmentBags= 0 - local integer i= 0 - local real x= 0.0 - local real y= 0.0 - local integer j= 0 - local unit bag= null - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( PlayerIsOnlineUser(i) ) then - set slotPlayer=Player(i) - set hero1=(udg_Hero[GetPlayerId((slotPlayer))]) // INLINED!! - if ( hero1 != null ) then - // get hero position even in transporter - set x=GetUnitActualX(hero1) - set y=GetUnitActualY(hero1) - else - set x=GetStartLocationX(i) - set y=GetStartLocationY(i) - endif - if ( WoWReforgedBackpacks___Backpack[i] != null ) then - set bag=WoWReforgedBackpacks___Backpack[i] - call SetUnitX(bag, x) - call SetUnitY(bag, y) - set bag=null - endif - if ( (udg_EquipmentBags[GetConvertedPlayerId((slotPlayer))]) != null ) then // INLINED!! - set countEquipmentBags=BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((slotPlayer))])) // INLINED!! - set j=0 - loop - exitwhen ( j == countEquipmentBags ) - set bag=BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((slotPlayer))]), j) // INLINED!! - call SetUnitX(bag, x) - call SetUnitY(bag, y) - // update hero stats for replaced hero spells - if ( hero1 != null ) then - call SetHeroStr(bag, GetHeroStr(hero1, false), true) - //call SetHeroStr(bag, GetHeroStrBonus(hero1), false) - call SetHeroAgi(bag, GetHeroAgi(hero1, false), true) - //call SetHeroAgi(bag, GetHeroAgiBonus(hero1), false) - call SetHeroInt(bag, GetHeroInt(hero1, false), true) - //call SetHeroInt(bag, GetHeroIntBonus(hero1), false) - else - call SetHeroStr(bag, 10, true) - //call SetHeroStr(bag, 0, false) - call SetHeroAgi(bag, 10, true) - //call SetHeroAgi(bag, 0, false) - call SetHeroInt(bag, 10, true) - //call SetHeroInt(bag, 0, false) - endif - set bag=null - set j=j + 1 - endloop - endif - set hero1=null - set slotPlayer=null - endif - set i=i + 1 - endloop -endfunction -function GetBackpackUpdateLocatiomTimerHandleId takes nothing returns integer - return GetHandleId(WoWReforgedBackpacks___BackpackUpdateLocationTimer) -endfunction -function WoWReforgedBackpacks___Init takes nothing returns nothing - local integer i= 0 - loop - set WoWReforgedBackpacks___BackpackPlayerBagInfo[i]=true - set i=i + 1 - exitwhen ( i == bj_MAX_PLAYERS ) - endloop - call TimerStart(WoWReforgedBackpacks___BackpackUpdateLocationTimer, BACKPACK_MOVE_INTERVAL, true, function WoWReforgedBackpacks___TimerFunctionUpdateLocationsOfBackpackAndEquipmentBags) -endfunction -//library WoWReforgedBackpacks ends -//library WoWReforgedBackpackUI: -function UpdateItemsForBackpackUI takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer itemTypeId= 0 - local integer index= 0 - local integer i= 0 - local integer j= 0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index2D(i , j , bj_MAX_INVENTORY) - set itemTypeId=(WoWReforgedBackpacks___BackpackItemType[(index)]) // INLINED!! - //call BlzFrameSetTexture(BackpackItemFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) - if ( itemTypeId == 0 ) then - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackItemBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], false) - else - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackItemBackdropFrame[index], GetIconByItemType(itemTypeId), 0, true) - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], I2S((WoWReforgedBackpacks___BackpackItemCharges[(index)]))) // INLINED!! - if ( WoWReforgedBackpackUI__BackpackUIVisible[playerId] and (WoWReforgedBackpacks___BackpackItemCharges[(index)]) > 0 ) then // INLINED!! - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], true) - endif - endif - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function BackpackUIExists takes nothing returns boolean - return WoWReforgedBackpackUI__BackpackBackgroundFrame != null -endfunction -function WoWReforgedBackpackUI__TriggerActionSyncData takes nothing returns nothing - local player whichPlayer= GetTriggerPlayer() - local string prefix= BlzGetTriggerSyncPrefix() - local string data= BlzGetTriggerSyncData() - local integer bag= S2I(data) - call ChangeBackpackPageEx(whichPlayer , bag) - set whichPlayer=null -endfunction -function WoWReforgedBackpackUI__SyncBag takes nothing returns nothing - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 1))) // INLINED!! - local integer bag= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 2))) // INLINED!! - local integer slot= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 3))) // INLINED!! - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackTooltipText, "Changed to bag " + I2S(bag + 1) + ".") - call BlzSendSyncData("BackpackUI", I2S(bag)) - endif -endfunction -function ShowBackpackUI takes player whichPlayer returns nothing - local integer i= 0 - local integer j= 0 - local integer index= 0 - local integer playerId= GetPlayerId(whichPlayer) - if ( not (WoWReforgedBackpackUI__BackpackBackgroundFrame != null) ) then // INLINED!! - return - endif - set WoWReforgedBackpackUI__BackpackUIVisible[playerId]=true - call UpdateItemsForBackpackUI(whichPlayer) - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackBackgroundFrame, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTitleFrame, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__Checkbox, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackCloseButton, true) - //call BlzFrameSetVisible(BackpackItemGoldFrame[GetPlayerId(whichPlayer)], true) - //call BlzFrameSetVisible(BackpackItemGoldIconFrame[GetPlayerId(whichPlayer)], true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipIcon, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipModel, false) - endif - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index2D(i , j , bj_MAX_INVENTORY) - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemFrame[index], true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBackdropFrame[index], true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], WoWReforgedBackpackUI__Checked[playerId]) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBagFrame[index], WoWReforgedBackpackUI__Checked[playerId]) - endif - if ( (WoWReforgedBackpacks___BackpackItemType[(index)]) != 0 and GetItemTypePerishable((WoWReforgedBackpacks___BackpackItemType[(index)])) ) then // INLINED!! - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], true) - endif - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function HideBackpackUI takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local integer i= 0 - local integer j= 0 - local integer index= 0 - if ( not (WoWReforgedBackpackUI__BackpackBackgroundFrame != null) ) then // INLINED!! - return - endif - set WoWReforgedBackpackUI__BackpackUIVisible[playerId]=false - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackBackgroundFrame, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTitleFrame, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__Checkbox, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackCloseButton, false) - //call BlzFrameSetVisible(BackpackItemGoldFrame[GetPlayerId(whichPlayer)], false) - //call BlzFrameSetVisible(BackpackItemGoldIconFrame[GetPlayerId(whichPlayer)], false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipIcon, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipModel, false) - endif - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index2D(i , j , bj_MAX_INVENTORY) - if ( whichPlayer == GetLocalPlayer() ) then - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemFrame[index], false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBackdropFrame[index], false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBagFrame[index], false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], false) - endif - set j=j + 1 - endloop - set i=i + 1 - endloop -endfunction -function HideBackpackUIForAllPlayers takes nothing returns nothing - local integer i= 0 - if ( (WoWReforgedBackpackUI__BackpackBackgroundFrame != null) ) then // INLINED!! - loop - exitwhen ( i == bj_MAX_PLAYERS ) - call HideBackpackUI(Player(i)) - set i=i + 1 - endloop - endif -endfunction -function BackpackClickItemFunction takes nothing returns nothing - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call WoWReforgedBackpackUI__SyncBag() - endif -endfunction -function WoWReforgedBackpackUI__EnterItemFunction takes nothing returns nothing - local integer playerId= GetPlayerId(GetTriggerPlayer()) - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 1))) // INLINED!! - local integer bag= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 2))) // INLINED!! - local integer slot= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 3))) // INLINED!! - local string tooltip= "Empty slot " + I2S(slot + 1) + " at bag " + I2S(bag + 1) + "." - local integer itemTypeId= (WoWReforgedBackpacks___BackpackItemType[(index)]) // INLINED!! - local integer c= 0 - local integer cDefault= 0 - //call BJDebugMsg("Entering item " + I2S(index)) - if ( itemTypeId != 0 ) then - if ( (WoWReforgedBackpacks___BackpackItemPawnable[(index)]) ) then // INLINED!! - set tooltip=GetObjectName(itemTypeId) - - if ( (WoWReforgedBackpacks___BackpackItemCharges[(index)]) > 1 ) then // INLINED!! - set tooltip=tooltip + " (|cffffcc00" + I2S((WoWReforgedBackpacks___BackpackItemCharges[(index)])) + "|r)" // INLINED!! - endif - - set tooltip=tooltip + "|n" - if ( GetItemValueGold(itemTypeId) > 0 ) then - //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], true) - set tooltip=tooltip + "|cffFCD20D" + I2S(IMaxBJ(1, (WoWReforgedBackpacks___BackpackItemCharges[(index)])) * GetItemValueGold(itemTypeId)) + " Gold|r" // INLINED!! - else - //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], false) - endif - if ( GetItemValueLumber(itemTypeId) > 0 ) then - if ( GetItemValueGold(itemTypeId) > 0 ) then - set tooltip=tooltip + " " - endif - set tooltip=tooltip + "|cffFCD20D" + I2S(IMaxBJ(1, (WoWReforgedBackpacks___BackpackItemCharges[(index)])) * GetItemValueLumber(itemTypeId)) + " Lumber|r" // INLINED!! - endif - else - //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], false) - set tooltip=GetObjectName(itemTypeId) + "|n|n" + (WoWReforgedBackpacks___BackpackItemTooltipExtended[(index)]) // INLINED!! - endif - else - //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], false) - endif - - if ( itemTypeId != 0 ) then - set c=GetPagedButtonsConfig(itemTypeId) - set cDefault=GetPagedButtonsConfig(0) - - if ( (WoWReforgedBackpacks___BackpackItemPawnable[(index)]) ) then // INLINED!! - set tooltip=tooltip + "|n|n|cff808080Drop item on shop to sell|R|n" + (WoWReforgedBackpacks___BackpackItemTooltipExtended[(index)]) // INLINED!! - endif - if ( (WoWReforgedBackpacks___BackpackItemPlayer[(index)]) != null and (WoWReforgedBackpacks___BackpackItemPlayer[(index)]) != Player(PLAYER_NEUTRAL_PASSIVE) ) then // INLINED!! - set tooltip=tooltip + "|n|nOwner: " + GetPlayerNameColored((WoWReforgedBackpacks___BackpackItemPlayer[(index)])) // INLINED!! - endif - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackTooltipIcon, GetIconByItemType(itemTypeId), 0, false) - //call BJDebugMsg("Icon " + GetIconByItemType(itemTypeId) + " for item type " + GetObjectName(itemTypeId)) - - if ( c != 0 ) then - call BlzFrameSetModel(WoWReforgedBackpackUI__BackpackTooltipModel, s__PagedButtonsConfig_modelPath[c], 1) - call BlzFrameSetScale(WoWReforgedBackpackUI__BackpackTooltipModel, s__PagedButtonsConfig_modelScale[c]) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipModel, FRAMEPOINT_CENTER, s__PagedButtonsConfig_modelX[c], s__PagedButtonsConfig_modelY[c]) - else - call BlzFrameSetModel(WoWReforgedBackpackUI__BackpackTooltipModel, GetItemTypeModel(itemTypeId), 0) - call BlzFrameSetScale(WoWReforgedBackpackUI__BackpackTooltipModel, s__PagedButtonsConfig_modelScale[cDefault]) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipModel, FRAMEPOINT_CENTER, s__PagedButtonsConfig_modelX[cDefault], s__PagedButtonsConfig_modelY[cDefault]) - endif - call BlzFrameSetSpriteAnimate(WoWReforgedBackpackUI__BackpackTooltipModel, 2, 0) - - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipIcon, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipModel, true) - endif - else - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipIcon, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipModel, false) - endif - endif - set tooltip=tooltip + "|n|n|cff808080Click to open the bag.|R|n" - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackTooltipText, tooltip) - endif -endfunction -function WoWReforgedBackpackUI__LeaveItemFunction takes nothing returns nothing - local integer playerId= GetPlayerId(GetTriggerPlayer()) - local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 1))) // INLINED!! - //call BJDebugMsg("Leave item " + I2S(index)) - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackTooltipIcon, "", 0, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipIcon, false) - call BlzFrameSetModel(WoWReforgedBackpackUI__BackpackTooltipModel, "", 0) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipModel, false) - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackTooltipText, "") - endif -endfunction -function WoWReforgedBackpackUI__CheckedFunction takes nothing returns nothing - set WoWReforgedBackpackUI__Checked[GetPlayerId(GetTriggerPlayer())]=true - call ShowBackpackUI(GetTriggerPlayer()) -endfunction - -function WoWReforgedBackpackUI__UncheckedFunction takes nothing returns nothing - set WoWReforgedBackpackUI__Checked[GetPlayerId(GetTriggerPlayer())]=false - call ShowBackpackUI(GetTriggerPlayer()) -endfunction -function WoWReforgedBackpackUI__CheckboxEnterItemFunction takes nothing returns nothing - local integer playerId= GetPlayerId(GetTriggerPlayer()) - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackTooltipText, "Hide bag numbers.") - endif -endfunction -function WoWReforgedBackpackUI__CheckboxLeaveItemFunction takes nothing returns nothing - local integer playerId= GetPlayerId(GetTriggerPlayer()) - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackTooltipText, "") - endif -endfunction -function WoWReforgedBackpackUI__CloseFunction takes nothing returns nothing - call HideBackpackUI(GetTriggerPlayer()) -endfunction -function CreateBackpackUI takes nothing returns nothing - local integer i= 0 - local integer j= 0 - local real x= 0.0 - local real y= 0.0 - local integer index= 0 - set WoWReforgedBackpackUI__BackpackBackgroundFrame=CreateFullScreenFrame() - set WoWReforgedBackpackUI__BackpackTitleFrame=CreateFullScreenTitle("BackpackTitle" , "Backpack") - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTitleFrame, false) - set x=WoWReforgedBackpackUI__UI_SLOT_X - set y=WoWReforgedBackpackUI__UI_SLOT_Y - set i=0 - loop - exitwhen ( i == BACKPACK_MAX_PAGES ) - set j=0 - loop - exitwhen ( j == bj_MAX_INVENTORY ) - set index=Index2D(i , j , bj_MAX_INVENTORY) - set WoWReforgedBackpackUI__BackpackItemFrame[index]=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemFrame[index], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemFrame[index], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE, y - WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE) - //call BlzFrameSetTexture(BackpackItemFrame[index], GetIconByItemType(0), 0, true) - //call BlzFrameSetText(BackpackItemFrame[index], I2S(index)) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemFrame[index], false) - set WoWReforgedBackpackUI__BackpackItemBackdropFrame[index]=BlzCreateFrameByType("BACKDROP", "BackdropFrame" + I2S(index), WoWReforgedBackpackUI__BackpackItemFrame[index], "", 1) - call BlzFrameSetAllPoints(WoWReforgedBackpackUI__BackpackItemBackdropFrame[index], WoWReforgedBackpackUI__BackpackItemFrame[index]) -// call BlzFrameSetTexture(BackpackItemBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBackdropFrame[index], false) - - set WoWReforgedBackpackUI__BackpackItemTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__BackpackItemTrigger[index], WoWReforgedBackpackUI__BackpackItemFrame[index], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedBackpackUI__BackpackItemTrigger[index], function BackpackClickItemFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI__BackpackItemTrigger[index] )), ( 1 ), ( index)) // INLINED!! - call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI__BackpackItemTrigger[index] )), ( 2 ), ( i)) // INLINED!! - call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI__BackpackItemTrigger[index] )), ( 3 ), ( j)) // INLINED!! - - set WoWReforgedBackpackUI__BackpackItemTooltipOnTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__BackpackItemTooltipOnTrigger[index], WoWReforgedBackpackUI__BackpackItemFrame[index], FRAMEEVENT_MOUSE_ENTER) - call TriggerAddAction(WoWReforgedBackpackUI__BackpackItemTooltipOnTrigger[index], function WoWReforgedBackpackUI__EnterItemFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI__BackpackItemTooltipOnTrigger[index] )), ( 1 ), ( index)) // INLINED!! - call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI__BackpackItemTooltipOnTrigger[index] )), ( 2 ), ( i)) // INLINED!! - call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI__BackpackItemTooltipOnTrigger[index] )), ( 3 ), ( j)) // INLINED!! - - set WoWReforgedBackpackUI__BackpackItemTooltipOffTrigger[index]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__BackpackItemTooltipOffTrigger[index], WoWReforgedBackpackUI__BackpackItemFrame[index], FRAMEEVENT_MOUSE_LEAVE) - call TriggerAddAction(WoWReforgedBackpackUI__BackpackItemTooltipOffTrigger[index], function WoWReforgedBackpackUI__LeaveItemFunction) - call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI__BackpackItemTooltipOffTrigger[index] )), ( 1 ), ( index)) // INLINED!! - // TODO Mouse down and mouse up to drag & drop to another bag or switch or do it like Warcraft's inventory with right click and left click. Add the icon of the item to the mouse cursor. If you click on the map it is dropped, if you click on the inventory it is dropped there. - - set WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index]=BlzCreateFrameByType("BACKDROP", "ItemBagBackrgroundFrame" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedBackpackUI__BACKPACK_UI_CHARGES_BACKGROUND_SIZE, y - WoWReforgedBackpackUI__BACKPACK_UI_CHARGES_BACKGROUND_SIZE) - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], false) - call BlzFrameSetLevel(WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], 1) - - set WoWReforgedBackpackUI__BackpackItemBagFrame[index]=BlzCreateFrameByType("TEXT", "bag" + I2S(index), WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedBackpackUI__BackpackItemBagFrame[index], WoWReforgedBackpackUI__BackpackItemBagBackgroundFrame[index]) - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackItemBagFrame[index], I2S(i + 1)) - call BlzFrameSetTextAlignment(WoWReforgedBackpackUI__BackpackItemBagFrame[index], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) - call BlzFrameSetScale(WoWReforgedBackpackUI__BackpackItemBagFrame[index], 0.7) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemBagFrame[index], false) - call BlzFrameSetEnable(WoWReforgedBackpackUI__BackpackItemBagFrame[index], false) - call BlzFrameSetLevel(WoWReforgedBackpackUI__BackpackItemBagFrame[index], 2) - - set WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index]=BlzCreateFrameByType("BACKDROP", "ItemChargesBackrgroundFrame" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], FRAMEPOINT_TOPLEFT, x + WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE - WoWReforgedBackpackUI__BACKPACK_UI_CHARGES_BACKGROUND_SIZE, y - WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE + WoWReforgedBackpackUI__BACKPACK_UI_CHARGES_BACKGROUND_SIZE) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE, y - WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE) - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], false) - call BlzFrameSetLevel(WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], 1) - - set WoWReforgedBackpackUI__BackpackItemChargesFrame[index]=BlzCreateFrameByType("TEXT", "charges" + I2S(index), WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index], "", 0) - call BlzFrameSetAllPoints(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], WoWReforgedBackpackUI__BackpackItemChargesBackgroundFrame[index]) - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], "|cffFFFFFFCharges|r") - call BlzFrameSetTextAlignment(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) - call BlzFrameSetScale(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], 0.7) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], false) - call BlzFrameSetEnable(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], false) - call BlzFrameSetLevel(WoWReforgedBackpackUI__BackpackItemChargesFrame[index], 2) - - set x=x + WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE + WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SPACE - set j=j + 1 - endloop - set i=i + 1 - // every 3 bags start another line - if ( ModuloInteger(i, 3) == 0 ) then - set x=WoWReforgedBackpackUI__UI_SLOT_X - set y=y - WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SIZE - WoWReforgedBackpackUI__BACKPACK_UI_BUTTON_SPACE - endif - endloop - set WoWReforgedBackpackUI__BackpackTooltipFrame=BlzCreateFrame("EscMenuBackdrop", WoWReforgedBackpackUI__BackpackBackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipFrame, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_X, WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_Y) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipFrame, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_X + WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_WIDTH, WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_Y - WoWReforgedBackpackUI__UI_TOOLTIP_FRAME_HEIGHT) - set WoWReforgedBackpackUI__BackpackItemGoldFrame=BlzCreateFrame("BACKDROP", WoWReforgedBackpackUI__BackpackBackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemGoldFrame, FRAMEPOINT_TOPLEFT, 0.69, 0.50) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemGoldFrame, FRAMEPOINT_BOTTOMRIGHT, 0.71, 0.48) - //call BlzFrameSetAllPoints(BackpackItemGoldFrame, BackpackBackgroundFrame) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemGoldFrame, false) - - set WoWReforgedBackpackUI__BackpackItemGoldIconFrame=BlzCreateFrameByType("BACKDROP", "TooltipGoldFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemGoldIconFrame, FRAMEPOINT_TOPLEFT, 0.67, 0.50) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackItemGoldIconFrame, FRAMEPOINT_BOTTOMRIGHT, 0.69, 0.48) - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackItemGoldIconFrame, "UI\\Feedback\\Resources\\ResourceGold.blp", 0, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackItemGoldIconFrame, false) - - set WoWReforgedBackpackUI__BackpackTooltipIcon=BlzCreateFrameByType("BACKDROP", "TooltipIconFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipIcon, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI__UI_TOOLTIP_ICON_X, WoWReforgedBackpackUI__UI_TOOLTIP_ICON_Y) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipIcon, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI__UI_TOOLTIP_ICON_X + WoWReforgedBackpackUI__UI_TOOLTIP_ICON_SIZE, WoWReforgedBackpackUI__UI_TOOLTIP_ICON_Y - WoWReforgedBackpackUI__UI_TOOLTIP_ICON_SIZE) - call BlzFrameSetTexture(WoWReforgedBackpackUI__BackpackTooltipIcon, "ReplaceableTextures\\WorldEditUI\\Editor-Random-Item.blp", 0, true) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipIcon, false) - - - set WoWReforgedBackpackUI__BackpackTooltipModel=BlzCreateFrameByType("SPRITE", "TooltipModelFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipModel, FRAMEPOINT_TOPLEFT, 0.65, 0.20) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipModel, FRAMEPOINT_BOTTOMRIGHT, 0.70, 0.12) - call BlzFrameSetModel(WoWReforgedBackpackUI__BackpackTooltipModel, "Abilities\\Weapons\\RockBoltMissile\\RockBoltMissile.mdl", 0) - call BlzFrameSetScale(WoWReforgedBackpackUI__BackpackTooltipModel, 0.00006) - call BlzFrameSetSpriteAnimate(WoWReforgedBackpackUI__BackpackTooltipModel, 2, 0) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackTooltipModel, false) - - set WoWReforgedBackpackUI__BackpackTooltipText=BlzCreateFrameByType("TEXT", "BackpackTooltipText", WoWReforgedBackpackUI__BackpackBackgroundFrame, "", 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipText, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI__UI_TOOLTIP_X, WoWReforgedBackpackUI__UI_TOOLTIP_Y) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__BackpackTooltipText, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI__UI_TOOLTIP_X + WoWReforgedBackpackUI__UI_TOOLTIP_WIDTH, WoWReforgedBackpackUI__UI_TOOLTIP_Y - WoWReforgedBackpackUI__UI_TOOLTIP_HEIGHT) - call BlzFrameSetText(WoWReforgedBackpackUI__BackpackTooltipText, "") - call BlzFrameSetEnable(WoWReforgedBackpackUI__BackpackTooltipText, false) - call BlzFrameSetScale(WoWReforgedBackpackUI__BackpackTooltipText, 1.00) - call BlzFrameSetTextAlignment(WoWReforgedBackpackUI__BackpackTooltipText, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_LEFT) - //call BlzFrameSetTooltip(Frame05, BackpackTooltipText) - - set WoWReforgedBackpackUI__Checkbox=BlzCreateFrame("QuestCheckBox2", WoWReforgedBackpackUI__BackpackBackgroundFrame, 0, 0) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__Checkbox, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI__UI_CHECKBOX_X, WoWReforgedBackpackUI__UI_CHECKBOX_Y) - call BlzFrameSetAbsPoint(WoWReforgedBackpackUI__Checkbox, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI__UI_CHECKBOX_X + WoWReforgedBackpackUI__UI_CHECKBOX_SIZE, WoWReforgedBackpackUI__UI_CHECKBOX_Y - WoWReforgedBackpackUI__UI_CHECKBOX_SIZE) - call BlzFrameSetScale(WoWReforgedBackpackUI__Checkbox, 1.00) - set WoWReforgedBackpackUI__CheckTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__CheckTrigger, WoWReforgedBackpackUI__Checkbox, FRAMEEVENT_CHECKBOX_CHECKED) - call TriggerAddAction(WoWReforgedBackpackUI__CheckTrigger, function WoWReforgedBackpackUI__CheckedFunction) - - set WoWReforgedBackpackUI__UncheckTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__UncheckTrigger, WoWReforgedBackpackUI__Checkbox, FRAMEEVENT_CHECKBOX_UNCHECKED) - call TriggerAddAction(WoWReforgedBackpackUI__UncheckTrigger, function WoWReforgedBackpackUI__UncheckedFunction) - - set WoWReforgedBackpackUI__CheckboxTooltipOnTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__CheckboxTooltipOnTrigger, WoWReforgedBackpackUI__Checkbox, FRAMEEVENT_MOUSE_ENTER) - call TriggerAddAction(WoWReforgedBackpackUI__CheckboxTooltipOnTrigger, function WoWReforgedBackpackUI__CheckboxEnterItemFunction) - - set WoWReforgedBackpackUI__CheckboxTooltipOffTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__CheckboxTooltipOffTrigger, WoWReforgedBackpackUI__Checkbox, FRAMEEVENT_MOUSE_LEAVE) - call TriggerAddAction(WoWReforgedBackpackUI__CheckboxTooltipOffTrigger, function WoWReforgedBackpackUI__CheckboxLeaveItemFunction) - - set WoWReforgedBackpackUI__BackpackCloseButton=CreateFullScreenCloseButton() - set WoWReforgedBackpackUI__BackpackCloseTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI__BackpackCloseTrigger, WoWReforgedBackpackUI__BackpackCloseButton, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedBackpackUI__BackpackCloseTrigger, function WoWReforgedBackpackUI__CloseFunction) - set WoWReforgedBackpackUI__BackpackSyncTrigger=CreateTrigger() - call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedBackpackUI__BackpackSyncTrigger , "BackpackUI" , false) - call TriggerAddAction(WoWReforgedBackpackUI__BackpackSyncTrigger, function WoWReforgedBackpackUI__TriggerActionSyncData) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackBackgroundFrame, false) - call BlzFrameSetVisible(WoWReforgedBackpackUI__BackpackCloseButton, false) - - //call FrameSaverAdd(function HideBackpackUIForAllPlayers) -endfunction -//library WoWReforgedBackpackUI ends -//library WoWReforgedComputer: -function GetComputerAINavy takes player whichPlayer returns group - return udg_ComputerNavy[GetPlayerId(whichPlayer)] -endfunction -function ComputerAINavyAttacks takes player whichPlayer returns nothing - local integer target= GetRandomInt(0, udg_NavyAttackLocationsCounter) - local rect targetRect= udg_NavyAttackLocations[target] - local real x= GetRectCenterX(targetRect) - local real y= GetRectCenterY(targetRect) - local string zone= GetZoneNameByCoordinates(x , y) - call GroupPointOrder((udg_ComputerNavy[GetPlayerId((whichPlayer))]), "attack", x, y) // INLINED!! - call h__BlzDisplayChatMessage(whichPlayer, 0, "My navy will attack " + zone + "!") - if ( IsPlayerAlly(whichPlayer, GetLocalPlayer()) ) then - call PingMinimapEx(x, y, 4.0, 0, 255, 0, false) - endif - set targetRect=null -endfunction -function ComputerAINavyIsReadyForAttack takes player whichPlayer returns boolean - return BlzGroupGetSize((udg_ComputerNavy[GetPlayerId((whichPlayer))])) >= 5 // INLINED!! -endfunction -function ComputerAITrainNavy takes unit shipyard returns boolean - local player owner= GetOwningPlayer(shipyard) - local integer r= (udg_PlayerRace[GetConvertedPlayerId((owner))]) // INLINED!! - local integer unitTypeId= (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_BATTLESHIP)) // INLINED!! - if ( (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_FRIGATE)) != 0 and GetRandomInt(0, 1) == 1 ) then // INLINED!! - set unitTypeId=(GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_FRIGATE)) // INLINED!! - endif - if ( unitTypeId != 0 ) then - return IssueImmediateOrderById(shipyard, unitTypeId) - endif - - return false -endfunction -function WoWReforgedComputer__IsRaceMine takes integer r,integer unitTypeId returns boolean - return r != udg_RaceNone and ( unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_MINE)) or unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_HOUSING)) ) // INLINED!! -endfunction -function WoWReforgedComputer__IsRaceWorker takes integer r,integer unitTypeId returns boolean - return r != udg_RaceNone and unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_WORKER)) // INLINED!! -endfunction -function WoWReforgedComputer__FilterIsUnitMineOrHousingOfRace takes nothing returns boolean - local unit u= GetFilterUnit() - local integer unitTypeId= GetUnitTypeId(u) - local player owner= GetOwningPlayer(u) - local boolean result= WoWReforgedComputer__IsRaceMine((udg_PlayerRace[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer__IsRaceMine((udg_PlayerRace2[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer__IsRaceMine((udg_PlayerRace3[GetConvertedPlayerId((owner))]) , unitTypeId) // INLINED!! - //call BJDebugMsg("Checking mine " + GetUnitName(u) + " for player " + GetPlayerName(owner) + " with race " + GetRaceName(GetPlayerRace1(owner)) + " and race mine " + GetObjectName(GetRaceMine(GetPlayerRace1(owner)))) - set owner=null - set u=null - return result -endfunction -function WoWReforgedComputer__FilterIsUnitFreeWorker takes nothing returns boolean - local unit u= GetFilterUnit() - local integer unitTypeId= GetUnitTypeId(u) - local player owner= GetOwningPlayer(u) - local boolean result= IsUnitAliveBJ(u) and not IsUnitLoaded(u) and GetUnitCurrentOrder(u) != OrderId("harvest") and ( WoWReforgedComputer__IsRaceWorker((udg_PlayerRace[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer__IsRaceWorker((udg_PlayerRace2[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer__IsRaceWorker((udg_PlayerRace3[GetConvertedPlayerId((owner))]) , unitTypeId) ) // INLINED!! - set owner=null - set u=null - return result -endfunction -function WoWReforgedComputer__AutoLoadMineAI takes unit mine returns nothing - local integer mineRace= GetObjectRace(GetUnitTypeId(mine)) - local unit worker= null - local integer i= 0 - local integer max= 0 - local group usedWorkers= CreateGroup() - // TODO How to detect how many workers are already in the mine? - set max=BlzGroupGetSize(WoWReforgedComputer__autoLoadMineWorkers) - set i=0 - loop - exitwhen ( i == max or BlzGroupGetSize(usedWorkers) >= WoWReforgedComputer_MAX_WORKERS_PER_MINE ) // stop at 5 workers per mine - set worker=BlzGroupUnitAt(WoWReforgedComputer__autoLoadMineWorkers, i) - if ( GetObjectRace(GetUnitTypeId(worker)) == mineRace ) then - set WoWReforgedComputer__autoLoadMineCounter=WoWReforgedComputer__autoLoadMineCounter + 1 - call IssueTargetOrder(worker, "smart", mine) - call GroupAddUnit(usedWorkers, worker) - endif - set worker=null - set i=i + 1 - endloop - //call BJDebugMsg("Used Workers: " + I2S(BlzGroupGetSize(usedWorkers)) + " for mine " + GetUnitName(mine)) - call GroupRemoveGroup(usedWorkers, WoWReforgedComputer__autoLoadMineWorkers) - call GroupClear(usedWorkers) - call DestroyGroup(usedWorkers) - set usedWorkers=null -endfunction -function WoWReforgedComputer__ForGroupAutoLoadMine takes nothing returns nothing - call WoWReforgedComputer__AutoLoadMineAI(GetEnumUnit()) -endfunction -function AutloadWorkersIntoMinesAI takes player whichPlayer returns nothing - local group mines= CreateGroup() - local group workers= CreateGroup() - call GroupEnumUnitsOfPlayer(mines, whichPlayer, Filter(function WoWReforgedComputer__FilterIsUnitMineOrHousingOfRace)) - call GroupEnumUnitsOfPlayer(workers, whichPlayer, Filter(function WoWReforgedComputer__FilterIsUnitFreeWorker)) - //call BJDebugMsg("Mines: " + I2S(BlzGroupGetSize(mines))) - //call BJDebugMsg("Workers: " + I2S(BlzGroupGetSize(workers))) - set WoWReforgedComputer__autoLoadMineCounter=0 - set WoWReforgedComputer__autoLoadMineWorkers=workers - call ForGroup(mines, function WoWReforgedComputer__ForGroupAutoLoadMine) - call GroupClear(mines) - call DestroyGroup(mines) - call GroupClear(workers) - call DestroyGroup(workers) - set workers=null - // gets annoying - //call DisplayTimedTextToForce(GetPlayersAll(), 4.0, "Auto loaded " + I2S(autoLoadMineCounter) + " workers for player " + GetPlayerNameColored(whichPlayer)) - set mines=null -endfunction -function StartingUnitsPeons takes player whichPlayer,location l,integer whichRace returns nothing - local integer peonId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_WORKER) - local integer ghoulId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_FOOTMAN) - local real peonX= GetLocationX(l) - local real peonY= GetLocationY(l) - 224.00 - local real unitSpacing= 64.00 - local unit peon= null - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - // Spawn Peasants directly south of the town hall. - set peon=CreateUnit(whichPlayer, peonId, peonX + 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) - set peon=CreateUnit(whichPlayer, peonId, peonX + 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) - set peon=CreateUnit(whichPlayer, peonId, peonX + 0.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) - if ( (udg_RaceHasFootmanWorker[(whichRace)]) ) then // INLINED!! - set peon=CreateUnit(whichPlayer, ghoulId, peonX - 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - set WoWReforgedComputer__ghoul[GetPlayerId(whichPlayer)]=peon - else - set peon=CreateUnit(whichPlayer, peonId, peonX - 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) - set peon=CreateUnit(whichPlayer, peonId, peonX - 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) - endif -endfunction -function StartingUnitsShredders takes player whichPlayer,location l,integer whichRace returns nothing - local real peonX= GetLocationX(l) - local real peonY= GetLocationY(l) - 412.00 - local real unitSpacing= 64.00 - local unit peon= null - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - // Spawn Peasants directly south of the town hall. - set peon=CreateUnit(whichPlayer, SHREDDER, peonX + 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - set peon=CreateUnit(whichPlayer, SHREDDER, peonX + 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) - set peon=CreateUnit(whichPlayer, SHREDDER, peonX + 0.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) - call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) -endfunction -function WoWReforgedComputer__FilterFunctionIsMine takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == GOLD_MINE -endfunction -function StartingUnitsReplaceMine takes player whichPlayer,unit mine,integer whichRace returns nothing - local integer mineId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MINE) - local location l= GetUnitLoc(mine) - call ReplaceUnitBJ(mine, mineId, bj_UNIT_STATE_METHOD_RELATIVE) - call SetUnitOwner(GetLastReplacedUnitBJ(), whichPlayer, true) - call SetResourceAmount(GetLastReplacedUnitBJ(), 1000000) - call StartingUnitsPeons(whichPlayer , l , whichRace) - - if ( (udg_RaceHasBlight[(whichRace)]) ) then // INLINED!! - // Create a patch of blight around the gold mine. - call SetBlightLoc(whichPlayer, l, 768, true) - endif - - call RemoveLocation(l) - set l=null -endfunction -function StartingUnitsReplaceAllMines takes player whichPlayer,location l,integer whichRace returns nothing - local group mines= GetUnitsInRangeOfLocMatching(2048.00, l, Filter(function WoWReforgedComputer__FilterFunctionIsMine)) - local integer max= BlzGroupGetSize(mines) - local integer i= 0 - loop - exitwhen ( i == max ) - call StartingUnitsReplaceMine(whichPlayer , BlzGroupUnitAt(mines, i) , whichRace) - set i=i + 1 - endloop - call GroupClear(mines) - call DestroyGroup(mines) - set mines=null -endfunction -function StartingUnitsAndPickAIStandard takes player whichPlayer,location l,integer whichRace,boolean recreate returns nothing - local integer townHallId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_TIER_1) - local unit townHall= CreateUnitAtLoc(whichPlayer, townHallId, l, bj_UNIT_FACING) - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - call GroupAddUnit(udg_ComputerTownHalls[convertedPlayerId], townHall) - call GroupAddUnit(udg_ComputerBuildings[convertedPlayerId], townHall) - // Spawn Peasants directly south of the town hall. - call StartingUnitsPeons(whichPlayer , l , whichRace) - call StartingUnitsShredders(whichPlayer , l , whichRace) - if ( not recreate ) then - call StartCampaignAI(whichPlayer, (udg_RaceAIScript[(whichRace)])) // INLINED!! - endif - if ( (udg_RaceHasFootmanWorker[(whichRace)]) ) then // INLINED!! - call RecycleGuardPosition(WoWReforgedComputer__ghoul[GetPlayerId(whichPlayer)]) - endif -endfunction -function StartingUnitsAndPickAIEx takes player whichPlayer,location l,integer whichRace,boolean recreate returns nothing - local integer mineId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MINE) - call PingMinimap(GetLocationX(l), GetLocationY(l), 4.0) - //call BJDebugMsg("Create starting units with peons for player " + GetPlayerName(whichPlayer) + " and race " + I2S(whichRace)) - call StartingUnitsAndPickAIStandard(whichPlayer , l , whichRace , recreate) - if ( mineId != 0 ) then - call StartingUnitsReplaceAllMines(whichPlayer , l , whichRace) - call EnableTrigger(gg_trg_Computer_Auto_Load_Mines) - call AutloadWorkersIntoMinesAI(whichPlayer) - endif -endfunction -function StartingUnitsAndPickAI takes player whichPlayer,location l,integer whichRace returns nothing - call StartingUnitsAndPickAIEx(whichPlayer , l , whichRace , false) -endfunction -function RecreateStartingUnitsAI takes player whichPlayer returns nothing - local location l= GetRectCenter(udg_TownHallLocation[udg_ComputerStartLocation[GetConvertedPlayerId(whichPlayer)]]) - call StartingUnitsAndPickAIEx(whichPlayer , l , (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) , true) // INLINED!! - call RemoveLocation(l) - set l=null -endfunction -function WoWReforgedComputer__FilterIsRemovableUnit takes nothing returns boolean - local integer unitTypeId= GetUnitTypeId(GetFilterUnit()) - return unitTypeId != FOUNTAIN_OF_LIFE and unitTypeId != GNOMISH_LOCOMOTIVE_TRAIN and not IsUnitInGroup(GetFilterUnit(), udg_ClanHalls) -endfunction -function WoWReforgedComputer__ForGroupRemoveUnit takes nothing returns nothing - call DropItemsFromHero(GetEnumUnit()) - call h__RemoveUnit(GetEnumUnit()) -endfunction -function RemovePlayerUnits takes player whichPlayer returns nothing - local group g= CreateGroup() - call KillAllHauntedGoldMines(whichPlayer) - call MountKillAll(whichPlayer) - call DropBackpackForPlayer(whichPlayer , gg_rct_redirect_forbidden_zone) - call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function WoWReforgedComputer__FilterIsRemovableUnit)) - call ForGroup(g, function WoWReforgedComputer__ForGroupRemoveUnit) - call GroupClear(g) - call DestroyGroup(g) - set g=null -endfunction -//library WoWReforgedComputer ends -//library WoWReforgedDemigod: -function BecomeDemigod takes unit hero,integer unitTypeId returns unit - local unit replaced= ReplaceHero(hero , unitTypeId , bj_UNIT_STATE_METHOD_RELATIVE , false , false) - call RefreshBackpackForPlayer(GetOwningPlayer(replaced)) - call RecreateAllEquipmentBags(GetOwningPlayer(replaced)) - call h__DisplayTimedTextToPlayer(GetOwningPlayer(replaced), 0, 0, 30, GetPlayerNameColored(GetOwningPlayer(replaced)) + " has become an \"Eternal Guardian\" (demigod)!") - call SetPlayerTechResearchedSwap(UPG_DEMIGOD, 1, GetOwningPlayer(replaced)) - return replaced -endfunction -function BecomeDemigodLight takes unit hero returns unit - return BecomeDemigod(hero , DEMIGOD_LIGHT) -endfunction -function BecomeDemigodDark takes unit hero returns unit - return BecomeDemigod(hero , DEMIGOD_DARK) -endfunction -function GetUnitsInRectOfPlayerAndTypeFilter takes nothing returns boolean - return GetOwningPlayer(GetFilterUnit()) == bj_groupEnumOwningPlayer and GetUnitTypeId(GetFilterUnit()) == bj_groupEnumTypeId -endfunction -function CountDemigodDragonsEx takes player whichPlayer,integer unitTypeId,rect whichRect returns integer - local group g= CreateGroup() - local integer count= 0 - set bj_groupEnumOwningPlayer=whichPlayer - set bj_groupEnumTypeId=unitTypeId - call GroupEnumUnitsInRect(g, whichRect, Filter(function GetUnitsInRectOfPlayerAndTypeFilter)) - set count=BlzGroupGetSize(g) - call GroupClear(g) - call DestroyGroup(g) - set g=null - return count -endfunction -function CountDemigodDragons takes nothing returns integer - return CountDemigodDragonsEx(udg_TmpPlayer , udg_TmpUnitType , udg_TmpRect) -endfunction -//library WoWReforgedDemigod ends -//library WoWReforgedHeroTransformation: -function ReplaceHeroForTransformation takes unit hero,integer unitTypeId returns unit - local integer sourceHandleId= GetHandleId(hero) - local force selectedForce= GetSelectedForce(hero) - local integer heroStandardAbilityIndex= GetStandardHeroAbility(hero) - local unit replacedUnit= ReplaceHero(hero , unitTypeId , bj_UNIT_STATE_METHOD_RELATIVE , true , false) - if ( heroStandardAbilityIndex != - 1 ) then - call RemoveStandardHeroAbilitiesForHero(replacedUnit) - call UnitAddAbility(replacedUnit, (s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(heroStandardAbilityIndex)]])) // INLINED!! - endif - if ( IsPlayerInForce(GetLocalPlayer(), selectedForce) ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call SelectUnit(replacedUnit, true) - endif - call ApplyAllHeroLearnedSkills(replacedUnit , sourceHandleId) - //call ResetHeroLearnedSkills(sourceHandleId) - call ForceClear(selectedForce) - call DestroyForce(selectedForce) - set selectedForce=null - return replacedUnit -endfunction - - function s__WoWReforgedHeroTransformation__HeroTransformationItemType_getUnitTypeId takes integer this,unit source returns integer - local integer sourcePrimaryAttribute= BlzGetUnitIntegerField(source, UNIT_IF_PRIMARY_ATTRIBUTE) - if ( sourcePrimaryAttribute == 3 ) then - return s__WoWReforgedHeroTransformation__HeroTransformationItemType_agilityUnitTypeId[this] - elseif ( sourcePrimaryAttribute == 2 ) then - return s__WoWReforgedHeroTransformation__HeroTransformationItemType_intelligenceUnitTypeId[this] - endif - - return s__WoWReforgedHeroTransformation__HeroTransformationItemType_strengthUnitTypeId[this] - endfunction - - function s__WoWReforgedHeroTransformation__HeroTransformationItemType_matchesUnit takes integer this,unit whichUnit returns boolean - local integer unitTypeId= GetUnitTypeId(whichUnit) - return unitTypeId == s__WoWReforgedHeroTransformation__HeroTransformationItemType_strengthUnitTypeId[this] or unitTypeId == s__WoWReforgedHeroTransformation__HeroTransformationItemType_agilityUnitTypeId[this] or unitTypeId == s__WoWReforgedHeroTransformation__HeroTransformationItemType_intelligenceUnitTypeId[this] - endfunction -function AddHeroTransformationItemTypeIdEx takes integer id,integer strengthUnitTypeId,integer agilityUnitTypeId,integer intelligenceUnitTypeId returns integer - local integer index= WoWReforgedHeroTransformation__typesCounter - local integer t= s__WoWReforgedHeroTransformation__HeroTransformationItemType__allocate() - set s__WoWReforgedHeroTransformation__HeroTransformationItemType_id[t]=id - set s__WoWReforgedHeroTransformation__HeroTransformationItemType_strengthUnitTypeId[t]=strengthUnitTypeId - set s__WoWReforgedHeroTransformation__HeroTransformationItemType_agilityUnitTypeId[t]=agilityUnitTypeId - set s__WoWReforgedHeroTransformation__HeroTransformationItemType_intelligenceUnitTypeId[t]=intelligenceUnitTypeId - set WoWReforgedHeroTransformation__types[index]=t - set WoWReforgedHeroTransformation__typesCounter=WoWReforgedHeroTransformation__typesCounter + 1 - return index -endfunction -function AddHeroTransformationItemTypeId takes nothing returns integer - return AddHeroTransformationItemTypeIdEx(udg_TmpItemTypeId , udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpUnitType3) -endfunction -function AddHeroTransformationAbilityId takes nothing returns integer - return AddHeroTransformationItemTypeIdEx(udg_TmpAbilityCode , udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpUnitType3) -endfunction -function SetHeroOriginalUnitType takes player owner,integer heroIndex,integer unitTypeId returns nothing - set WoWReforgedHeroTransformation__playerHeroOriginalUnitTypeId[Index2D(GetPlayerId(owner) , 0 , WoWReforgedHeroTransformation__MAX_HEROES)]=unitTypeId -endfunction -function GetHeroOriginalUnitType takes player owner,integer heroIndex returns integer - return WoWReforgedHeroTransformation__playerHeroOriginalUnitTypeId[Index2D(GetPlayerId(owner) , 0 , WoWReforgedHeroTransformation__MAX_HEROES)] -endfunction -function IsOriginalUnitTypeCustomizableAttributesHero takes unit hero returns boolean - local integer heroIndex= GetPlayerHeroIndex(GetOwningPlayer(hero) , hero) - return heroIndex != - 1 and IsCustomizableAttributesHero(GetHeroOriginalUnitType(GetOwningPlayer(hero) , heroIndex)) -endfunction -function WoWReforgedHeroTransformation__FindMatchingType takes integer id returns integer - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedHeroTransformation__typesCounter ) - if ( s__WoWReforgedHeroTransformation__HeroTransformationItemType_id[(WoWReforgedHeroTransformation__types[i])] == id ) then - return (WoWReforgedHeroTransformation__types[i]) - endif - set i=i + 1 - endloop - return 0 -endfunction -function WoWReforgedHeroTransformation__TransformForId takes unit hero,integer id returns boolean - local player owner= GetOwningPlayer(hero) - local integer heroIndex= GetPlayerHeroIndex(owner , hero) - local integer matchingType= WoWReforgedHeroTransformation__FindMatchingType(id) - local boolean result= false - if ( matchingType != 0 and heroIndex != - 1 ) then - call DisableTrigger(WoWReforgedHeroTransformation__pickupTrigger) - if ( GetHeroOriginalUnitType(owner , heroIndex) == 0 ) then - //call BJDebugMsg("Hero original unit type: " + GetObjectName(GetUnitTypeId(hero))) - call SetHeroOriginalUnitType(owner , heroIndex , GetUnitTypeId(hero)) - endif - call ReplaceHeroForTransformation(hero , s__WoWReforgedHeroTransformation__HeroTransformationItemType_getUnitTypeId(matchingType,hero)) - call RefreshBackpackForPlayer(owner) - call RecreateAllEquipmentBags(owner) - call EnableTrigger(WoWReforgedHeroTransformation__pickupTrigger) - set result=true - endif - set owner=null - return result -endfunction -function WoWReforgedHeroTransformation__TransformByHeroInventory takes unit hero returns nothing - local item slotItem= null - local integer i= 0 - loop - set slotItem=UnitItemInSlot(hero, i) - if ( slotItem != null and WoWReforgedHeroTransformation__TransformForId(hero , GetItemTypeId(slotItem)) ) then - call h__BJDebugMsg("Still transforming because of item " + GetItemName(slotItem) + " in inventory.") - set slotItem=null - exitwhen ( true ) - endif - set slotItem=null - set i=i + 1 - exitwhen ( i == bj_MAX_INVENTORY ) - endloop - set udg_TmpUnit=hero - call ConditionalTriggerExecute(gg_trg_Bosses_On_Transform) -endfunction -function TransformHeroBack takes unit hero returns unit - local player owner= GetOwningPlayer(hero) - local integer heroIndex= GetPlayerHeroIndex(owner , hero) - local integer i= 0 - if ( heroIndex != - 1 ) then - loop - exitwhen ( i >= WoWReforgedHeroTransformation__typesCounter ) - //call BJDebugMsg("Matching transform type for ability " + GetObjectName(GetSpellAbilityId()) + ": " + I2S(matchingType) + " and hero Index " + I2S(heroIndex)) - if ( heroIndex != - 1 and s__WoWReforgedHeroTransformation__HeroTransformationItemType_matchesUnit((WoWReforgedHeroTransformation__types[i]),hero) ) then - call ReplaceHeroForTransformation(hero , GetHeroOriginalUnitType(owner , heroIndex)) - call SetHeroOriginalUnitType(owner , heroIndex , 0) // allows transforming again - call RefreshBackpackForPlayer(owner) - call RecreateAllEquipmentBags(owner) - call WoWReforgedHeroTransformation__TransformByHeroInventory(GetLastReplacedUnitBJ()) - - return GetLastReplacedUnitBJ() - endif - set i=i + 1 - endloop - endif - set owner=null - return hero -endfunction -function WoWReforgedHeroTransformation__TriggerConditionPickup takes nothing returns boolean - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - local integer heroIndex= GetPlayerHeroIndex(owner , triggerUnit) - local boolean result= IsUnitType(triggerUnit, UNIT_TYPE_HERO) and heroIndex != - 1 and GetHeroOriginalUnitType(owner , heroIndex) == 0 - set triggerUnit=null - set owner=null - return result -endfunction -function WoWReforgedHeroTransformation__TriggerActionPickup takes nothing returns nothing - local unit hero= GetTriggerUnit() - local player owner= GetOwningPlayer(hero) - local item whichItem= GetManipulatedItem() - local integer itemTypeId= GetItemTypeId(whichItem) - // wait for picking the item up into the inventory - call TriggerSleepAction(0.0) - if ( UnitHasItem(hero, whichItem) ) then - call WoWReforgedHeroTransformation__TransformForId(hero , itemTypeId) - endif - set hero=null - set owner=null - set whichItem=null -endfunction -function WoWReforgedHeroTransformation__TriggerConditionDrop takes nothing returns boolean - return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetPlayerHeroIndex(GetOwningPlayer(GetTriggerUnit()) , GetTriggerUnit()) != - 1 -endfunction -function WoWReforgedHeroTransformation__TriggerActionDrop takes nothing returns nothing - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - local integer heroIndex= GetPlayerHeroIndex(owner , triggerUnit) - local integer matchingType= WoWReforgedHeroTransformation__FindMatchingType(GetItemTypeId(GetManipulatedItem())) - if ( matchingType != 0 and heroIndex != - 1 and s__WoWReforgedHeroTransformation__HeroTransformationItemType_matchesUnit(matchingType,triggerUnit) ) then - // wait for dropping the item from the inventory - call TriggerSleepAction(0.0) - // refresh values - set heroIndex=GetPlayerHeroIndex(owner , triggerUnit) - if ( heroIndex != - 1 ) then - call DisableTrigger(WoWReforgedHeroTransformation__dropTrigger) - - if ( GetHeroOriginalUnitType(owner , heroIndex) == 0 ) then - call h__BJDebugMsg("Warning: Original unit type has not been stored.") - endif - - call ReplaceHeroForTransformation(triggerUnit , GetHeroOriginalUnitType(owner , heroIndex)) - call SetHeroOriginalUnitType(owner , heroIndex , 0) // allows transforming again - call RefreshBackpackForPlayer(owner) - call RecreateAllEquipmentBags(owner) - call EnableTrigger(WoWReforgedHeroTransformation__dropTrigger) - call WoWReforgedHeroTransformation__TransformByHeroInventory(GetLastReplacedUnitBJ()) - endif - endif - set triggerUnit=null - set owner=null -endfunction -function WoWReforgedHeroTransformation__TriggerConditionCast takes nothing returns boolean - return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetPlayerHeroIndex(GetOwningPlayer(GetTriggerUnit()) , GetTriggerUnit()) != - 1 -endfunction -function WoWReforgedHeroTransformation__TriggerActionCast takes nothing returns nothing - local unit triggerUnit= GetTriggerUnit() - local player owner= GetOwningPlayer(triggerUnit) - local integer heroIndex= GetPlayerHeroIndex(owner , triggerUnit) - local integer abilityId= GetSpellAbilityId() - local integer matchingType= WoWReforgedHeroTransformation__FindMatchingType(abilityId) - local unit u= null - //call BJDebugMsg("Matching transform type for ability " + GetObjectName(GetSpellAbilityId()) + ": " + I2S(matchingType) + " and hero Index " + I2S(heroIndex)) - if ( matchingType != 0 and heroIndex != - 1 ) then - //if (GetHeroOriginalUnitType(owner, heroIndex) == 0) then - //call TransformForId(triggerUnit, abilityId) - // restore - if ( s__WoWReforgedHeroTransformation__HeroTransformationItemType_matchesUnit(matchingType,triggerUnit) ) then - call ReplaceHeroForTransformation(triggerUnit , GetHeroOriginalUnitType(owner , heroIndex)) - call SetHeroOriginalUnitType(owner , heroIndex , 0) // allows transforming again - call RefreshBackpackForPlayer(owner) - call RecreateAllEquipmentBags(owner) - call WoWReforgedHeroTransformation__TransformByHeroInventory(GetLastReplacedUnitBJ()) - // transform - else - call WoWReforgedHeroTransformation__TransformForId(triggerUnit , abilityId) - endif - endif - set triggerUnit=null - set owner=null -endfunction -function WoWReforgedHeroTransformation__Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroTransformation__pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) - call TriggerAddCondition(WoWReforgedHeroTransformation__pickupTrigger, Condition(function WoWReforgedHeroTransformation__TriggerConditionPickup)) - call TriggerAddAction(WoWReforgedHeroTransformation__pickupTrigger, function WoWReforgedHeroTransformation__TriggerActionPickup) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroTransformation__dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddCondition(WoWReforgedHeroTransformation__dropTrigger, Condition(function WoWReforgedHeroTransformation__TriggerConditionDrop)) - call TriggerAddAction(WoWReforgedHeroTransformation__dropTrigger, function WoWReforgedHeroTransformation__TriggerActionDrop) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroTransformation__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(WoWReforgedHeroTransformation__castTrigger, Condition(function WoWReforgedHeroTransformation__TriggerConditionCast)) - call TriggerAddAction(WoWReforgedHeroTransformation__castTrigger, function WoWReforgedHeroTransformation__TriggerActionCast) -endfunction -//library WoWReforgedHeroTransformation ends -//library WoWReforgedItemUtils: -function ActionFunctionPickupItem takes nothing returns nothing - local player heroOwner= GetOwningPlayer(WoWReforgedItemUtils__pickedupItemsHero) - if ( CanItemBePickedUp(GetEnumItem() , WoWReforgedItemUtils__pickedupItemsHero) and AddItemToBackpackForPlayer(heroOwner , GetEnumItem()) ) then - set WoWReforgedItemUtils__pickedupItemsCounter=WoWReforgedItemUtils__pickedupItemsCounter + 1 - endif - set heroOwner=null -endfunction -function PickupAllItemsAround takes unit hero returns integer - local location tmpLocation= GetUnitLoc(hero) - local rect tmpRect= RectFromCenterSizeBJ(tmpLocation, 2200.00, 2200.00) - set WoWReforgedItemUtils__pickedupItemsCounter=0 - set WoWReforgedItemUtils__pickedupItemsHero=hero - call EnumItemsInRect(tmpRect, null, function ActionFunctionPickupItem) - if ( WoWReforgedItemUtils__pickedupItemsCounter == 1 ) then - call h__DisplayTextToPlayer(GetOwningPlayer(hero), 0, 0, "Picked up 1 item.") - else - call h__DisplayTextToPlayer(GetOwningPlayer(hero), 0, 0, "Picked up " + I2S(WoWReforgedItemUtils__pickedupItemsCounter) + " items.") - endif - call RemoveRect(tmpRect) - set tmpRect=null - call RemoveLocation(tmpLocation) - set tmpLocation=null - return WoWReforgedItemUtils__pickedupItemsCounter -endfunction -function PickupAllItemsAroundByPlayer takes player whichPlayer returns integer - local unit hero= (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! - if ( hero != null ) then - if ( IsUnitAliveBJ(hero) ) then - if ( not (UnitEventEx__Transporter[(GetUnitUserData(((hero))))] != null) ) then // INLINED!! - return PickupAllItemsAround((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - else - call SimError(whichPlayer , "Hero is in transporter.") - endif - else - call SimError(whichPlayer , "Hero is dead.") - endif - else - call SimError(whichPlayer , "No hero picked.") - endif - return 0 -endfunction -function DropAllItemsNotFromRaceForHero takes unit hero returns nothing - local player owner= GetOwningPlayer(hero) - local integer convertedPlayerId= GetConvertedPlayerId(owner) - local boolean playerUnlockedAllRaces= udg_PlayerUnlockedAllRaces[convertedPlayerId] - local integer playerRace1= udg_PlayerRace[convertedPlayerId] - local integer playerRace2= udg_PlayerRace2[convertedPlayerId] - local integer playerRace3= udg_PlayerRace3[convertedPlayerId] - local item slotItem= null - local integer itemRace= udg_RaceNone - local integer i= 0 - if ( not playerUnlockedAllRaces ) then - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(hero, i) - if ( slotItem != null ) then - set itemRace=(GetObjectRace((GetItemTypeId(slotItem)))) // INLINED!! - if ( itemRace != udg_RaceNone and itemRace != playerRace1 and itemRace != playerRace2 and itemRace != playerRace3 ) then - call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Dropping item " + GetItemName(slotItem) + " because it is from another race.") - call UnitRemoveItemFromSlot(hero, i) - endif - endif - set slotItem=null - set i=i + 1 - endloop - endif - set owner=null -endfunction -function DropAllItemsNotFromRace takes player whichPlayer returns nothing - local boolean result= false - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - set result=true - call DropAllItemsNotFromRaceForHero((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - endif - if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - set result=true - call DropAllItemsNotFromRaceForHero((udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! - endif - if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - set result=true - call DropAllItemsNotFromRaceForHero((udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! - endif - if ( not result ) then - call SimError(whichPlayer , "No hero picked.") - endif -endfunction -function DropAllItemsNotFromProfessionForHero takes unit hero returns nothing - local player owner= GetOwningPlayer(hero) - local integer convertedPlayerId= GetConvertedPlayerId(owner) - local integer playerProfession1= udg_PlayerProfession[convertedPlayerId] - local integer playerProfession2= udg_PlayerProfession2[convertedPlayerId] - local integer playerProfession3= udg_PlayerProfession3[convertedPlayerId] - local item slotItem= null - local integer j= 0 - local integer i= 0 - if ( not udg_PlayerUnlockedAllRaces[convertedPlayerId] ) then - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(hero, i) - if ( slotItem != null ) then - set j=0 - loop - exitwhen ( j == udg_Max_Berufe ) - if ( udg_ProfessionItemType[j] == GetItemTypeId(slotItem) and playerProfession1 != j and playerProfession2 != j and playerProfession3 != j ) then - call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Dropping item " + GetItemName(slotItem) + " because it is from another profession.") - call UnitRemoveItemFromSlot(hero, i) - exitwhen ( true ) - endif - set j=j + 1 - endloop - endif - set slotItem=null - set i=i + 1 - endloop - endif - set owner=null -endfunction -function DropAllItemsNotFromProfession takes player whichPlayer returns nothing - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call DropAllItemsNotFromProfessionForHero((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - endif - if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call DropAllItemsNotFromProfessionForHero((udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! - endif - if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call DropAllItemsNotFromProfessionForHero((udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! - endif -endfunction -function DropItemAtRectFromHeroByItemType takes unit hero,integer itemTypeId,rect whichRect returns nothing - local player owner= GetOwningPlayer(hero) - if ( hero == (udg_Hero[GetPlayerId((owner))]) ) then // INLINED!! - call DropQuestItemFromHeroAtRect(owner , itemTypeId , whichRect) - else - call DropQuestItemFromCreepHeroAtRect(hero , itemTypeId , whichRect) - endif - set owner=null -endfunction -//library WoWReforgedItemUtils ends -//library WoWReforgedNeutralZone: -function ResetHeroToNeutralZone takes unit hero,real x,real y,real facing returns nothing - call SetUnitPosition(hero, x, y) - call ReviveHero(hero, x, y, true) - call SetUnitFacing(hero, facing) - call DropAllItemsFromHero(hero) -endfunction -function ResetAllHeroesToNeutralZone takes player whichPlayer returns nothing - local real x= GetMapNeutralZoneX(whichPlayer) - local real y= GetMapNeutralZoneY(whichPlayer) - local real facing= GetMapNeutralZoneFacing(whichPlayer) - - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call ResetHeroToNeutralZone((udg_Hero[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! - endif - if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call ResetHeroToNeutralZone((udg_Hero2[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! - endif - if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call ResetHeroToNeutralZone((udg_Hero3[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! - endif - call DropBackpackForPlayerTo(whichPlayer , x , y) -endfunction -//library WoWReforgedNeutralZone ends -//library WoWReforgedPickpocketing: -function GetBountyGold takes unit whichUnit returns integer - local integer bountyBase= BlzGetUnitIntegerField(whichUnit, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE) - local integer bountyNumberOfDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_GOLD_BOUNTY_AWARDED_NUMBER_OF_DICE) - local integer bountySidesPerDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_GOLD_BOUNTY_AWARDED_SIDES_PER_DIE) - local integer bounty= bountyBase - local integer i= 0 - loop - exitwhen ( i == bountyNumberOfDice ) - set bounty=bounty + GetRandomInt(0, bountySidesPerDice) - set i=i + 1 - endloop - - return bounty -endfunction -function GetBountyLumber takes unit whichUnit returns integer - local integer bountyBase= BlzGetUnitIntegerField(whichUnit, UNIT_IF_LUMBER_BOUNTY_AWARDED_BASE) - local integer bountyNumberOfDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_LUMBER_BOUNTY_AWARDED_NUMBER_OF_DICE) - local integer bountySidesPerDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_LUMBER_BOUNTY_AWARDED_SIDES_PER_DIE) - local integer bounty= bountyBase - local integer i= 0 - loop - exitwhen ( i == bountyNumberOfDice ) - set bounty=bounty + GetRandomInt(0, bountySidesPerDice) - set i=i + 1 - endloop - - return bounty -endfunction -function ShowThiefBounty takes unit hero,unit whichUnit returns nothing - local force whichForce= CreateForce() - local integer bountyGold= R2I(I2R(GetBountyGold(whichUnit)) * PICKPOCKETING_BOUNTY_PERCENTAGE) - local integer bountyLumber= R2I(I2R(GetBountyLumber(whichUnit)) * PICKPOCKETING_BOUNTY_PERCENTAGE) - call ForceAddPlayer(whichForce, GetOwningPlayer(hero)) - if ( bountyGold > 0 ) then - call Bounty(whichForce , GetUnitX(whichUnit) , GetUnitY(whichUnit) , bountyGold) - endif - if ( bountyLumber > 0 ) then - call BountyLumber(whichForce , GetUnitX(whichUnit) - 200.0 , GetUnitY(whichUnit) , bountyLumber) - endif - call ForceClear(whichForce) - call DestroyForce(whichForce) - set whichForce=null -endfunction -function PickpocketingStealItem takes unit hero,unit target returns item - local integer countStealingItem= 0 - local real random= 0.0 - local item stolenItem= null - local real chance= 0 - if ( GetUnitAbilityLevel(hero, PICKPOCKETING_ABILITY_ID) > 0 ) then - set chance=GetUnitAbilityLevel(hero, PICKPOCKETING_ABILITY_ID) * 5.0 + 20 - set countStealingItem=1 - else - if ( hero == udg_Hero[GetPlayerId(GetOwningPlayer(hero))] ) then - set countStealingItem=Hero1CountItemsOfItemType(hero , PICKPOCKETING_ITEM_TYPE_ID) - else - set countStealingItem=CountItemsOfItemTypeId(hero , PICKPOCKETING_ITEM_TYPE_ID) - endif - set chance=chance + I2R(countStealingItem) * PICKPOCKETING_CHANCE - endif - if ( countStealingItem > 0 ) then - set random=GetRandomReal(0.0, 100.0) - if ( random <= chance ) then - set stolenItem=HeroDropRandomItem(target) - if ( stolenItem != null ) then - call AchievementPickpocket(hero , target , stolenItem) - call UnitAddItem(hero, stolenItem) - call h__DisplayTextToPlayer(GetOwningPlayer(target), 0.0, 0.0, GetUnitName(hero) + " has stolen the item " + GetItemName(stolenItem) + " from your unit " + GetUnitName(target) + "!") - call h__DisplayTextToPlayer(GetOwningPlayer(hero), 0.0, 0.0, "Stole item " + GetItemName(stolenItem) + " from " + GetUnitName(target) + "!") - endif - return stolenItem - endif - endif - call ShowThiefBounty(hero , target) - return null -endfunction -//library WoWReforgedPickpocketing ends -//library WoWReforgedEquipment: -function GetEquipmentItemTypeId takes integer index returns integer - return WoWReforgedEquipment___equipmentItemTypeId[index] -endfunction -function GetEquipmentItemTypeCategoryName takes integer index returns string - return WoWReforgedEquipment___equipmentItemTypeCategoryName[index] -endfunction -function GetEquipmentItemTypeCategory takes integer index returns integer - return WoWReforgedEquipment___equipmentItemTypeCategory[index] -endfunction -function GetEquipmentItemTypeCategoryType takes integer index,integer category returns boolean - local integer i= Index2D(index , category , WoWReforgedEquipment_CATEGORY_TYPE_MAX) - return WoWReforgedEquipment___equipmentItemTypeCategoryType[i] -endfunction -function SetEquipmentItemTypeCategoryType takes integer index,integer category,boolean value returns nothing - local integer i= Index2D(index , category , WoWReforgedEquipment_CATEGORY_TYPE_MAX) - set WoWReforgedEquipment___equipmentItemTypeCategoryType[i]=value -endfunction -function GetEquipmentTypeAnimation takes integer index returns integer - return WoWReforgedEquipment___equipmentItemTypeAnimation[index] -endfunction -function SetEquipmentTypeAnimation takes integer index,integer animation returns nothing - set WoWReforgedEquipment___equipmentItemTypeAnimation[index]=animation -endfunction -function AddEquipmentItemType takes integer itemTypeId,string categoryName,integer category,integer animation returns integer - set WoWReforgedEquipment___equipmentItemTypeId[WoWReforgedEquipment___equipmentTypesCounter]=itemTypeId - set WoWReforgedEquipment___equipmentItemTypeCategoryName[WoWReforgedEquipment___equipmentTypesCounter]=categoryName - set WoWReforgedEquipment___equipmentItemTypeCategory[WoWReforgedEquipment___equipmentTypesCounter]=category - set WoWReforgedEquipment___equipmentItemTypeAnimation[WoWReforgedEquipment___equipmentTypesCounter]=animation - set WoWReforgedEquipment___equipmentTypesCounter=WoWReforgedEquipment___equipmentTypesCounter + 1 - return WoWReforgedEquipment___equipmentTypesCounter -endfunction -// VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON -function AddEquipmentItemTypeWoWReforged takes nothing returns integer - local integer index= AddEquipmentItemType(udg_TmpItemTypeId , udg_TmpString , udg_TmpInteger , udg_TmpInteger2) - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON - return index -endfunction -function EquipmentCategoryTwoHanded takes nothing returns nothing - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) -endfunction -function EquipmentCategoryRange takes nothing returns nothing - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) -endfunction -function EquipmentCategoryHead takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_HEAD -endfunction -function EquipmentCategoryLeftHand takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND -endfunction -function EquipmentCategoryRightHand takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND -endfunction -function EquipmentCategoryBody takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_BODY -endfunction -function EquipmentCategoryFoot takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_FOOT -endfunction -function EquipmentAnimationShield takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHIELD -endfunction -function EquipmentAnimationNoWeapon takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON -endfunction -function EquipmentAnimationLeftHandWeapon takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON -endfunction -function EquipmentAnimationTwoHandHammer takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND_HAMMER -endfunction -function EquipmentAnimationTwoWeapons takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_WEAPONS -endfunction -function EquipmentAnimationBow takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_BOW -endfunction -function EquipmentAnimationMinigun takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_MINIGUN -endfunction -function EquipmentAnimationTwoHand takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND -endfunction -function EquipmentAnimationGun takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN -endfunction -function GetMaxEquipmentItemTypes takes nothing returns integer - return WoWReforgedEquipment___equipmentTypesCounter -endfunction -function GetEquipmentItemTypeByItemTypeId takes integer itemTypeId returns integer - local integer i= 0 - loop - exitwhen ( i >= WoWReforgedEquipment___equipmentTypesCounter ) - if ( WoWReforgedEquipment___equipmentItemTypeId[i] == itemTypeId ) then - return i - endif - set i=i + 1 - endloop - return 0 -endfunction -function WoWReforgedEquipment___SetUnitEquipmentType takes unit hero,integer c,integer index returns nothing - call SaveInteger(WoWReforgedEquipment___h, GetHandleId(hero), c, index) -endfunction -function WoWReforgedEquipment___SetUnitEquipmentTypeItem takes unit hero,integer c,item whichItem returns nothing - call SaveItemHandle(WoWReforgedEquipment___h2, GetHandleId(hero), c, whichItem) -endfunction -function GetUnitEquipmentType takes unit hero,integer c returns integer - return LoadInteger(WoWReforgedEquipment___h, GetHandleId(hero), c) -endfunction -function GetUnitEquipmentTypeItem takes unit hero,integer c returns item - return LoadItemHandle(WoWReforgedEquipment___h2, GetHandleId(hero), c) -endfunction -function GetUnitEquipmentTypeByHandleId takes integer handleId,integer c returns integer - return LoadInteger(WoWReforgedEquipment___h, handleId, c) -endfunction -function GetUnitEquipmentTypeItemByHandleId takes integer handleId,integer c returns item - return LoadItemHandle(WoWReforgedEquipment___h2, handleId, c) -endfunction -function DropEquipment takes unit hero,integer c returns nothing - local integer index= (LoadInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( c))) // INLINED!! - if ( index != 0 ) then - //call BJDebugMsg("Drop item " + GetItemName(GetUnitEquipmentTypeItem(hero, c))) - call DisableTrigger(WoWReforgedEquipment___dropTrigger) - call UnitDropItemPoint(hero, (LoadItemHandle(WoWReforgedEquipment___h2, GetHandleId((hero )), ( c))), GetUnitX(hero), GetUnitY(hero)) // INLINED!! - call EnableTrigger(WoWReforgedEquipment___dropTrigger) - call SaveInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( c ), ( 0)) // INLINED!! - call SaveItemHandle(WoWReforgedEquipment___h2, GetHandleId((hero )), ( c ), ( null)) // INLINED!! - else - //call BJDebugMsg("Item in category " + I2S(c) + " is null") - endif -endfunction -function GetRangeUnitTypeId takes integer unitTypeId returns integer - if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE ) then - return CUSTOMIZABLE_HERO_STRENGTH_RANGE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE ) then - return CUSTOMIZABLE_HERO_AGILITY_RANGE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE ) then - return CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE ) then - return CUSTOMIZABLE_HERO_STRENGTH_RANGE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE ) then - return CUSTOMIZABLE_HERO_AGILITY_RANGE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE ) then - return CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE - endif - - return CUSTOMIZABLE_HERO_STRENGTH_RANGE -endfunction -function GetMeleeUnitTypeId takes integer unitTypeId returns integer - if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE ) then - return CUSTOMIZABLE_HERO_STRENGTH_MELEE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE ) then - return CUSTOMIZABLE_HERO_AGILITY_MELEE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE ) then - return CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE ) then - return CUSTOMIZABLE_HERO_STRENGTH_MELEE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE ) then - return CUSTOMIZABLE_HERO_AGILITY_MELEE - elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE ) then - return CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE - endif - - return CUSTOMIZABLE_HERO_STRENGTH_MELEE -endfunction -function ReplaceHeroForEquipment takes unit hero,integer unitTypeId returns unit - local integer i= 0 - local integer oldHandleId= GetHandleId(hero) - local player owner= GetOwningPlayer(hero) - local unit replaced= null - call DisableTrigger(WoWReforgedEquipment___pickupTrigger) - call DisableTrigger(WoWReforgedEquipment___dropTrigger) - set replaced=ReplaceHeroForTransformation(hero , unitTypeId) - call RefreshBackpackForPlayer(owner) - call RecreateAllEquipmentBags(owner) - set i=0 - loop - exitwhen ( i == WoWReforgedEquipment_CATEGORY_MAX ) - call SaveInteger(WoWReforgedEquipment___h, GetHandleId((replaced )), ( i ), ( (LoadInteger(WoWReforgedEquipment___h, (oldHandleId ), ( i))))) // INLINED!! - call SaveItemHandle(WoWReforgedEquipment___h2, GetHandleId((replaced )), ( i ), ( (LoadItemHandle(WoWReforgedEquipment___h2, (oldHandleId ), ( i))))) // INLINED!! - set i=i + 1 - endloop - if ( oldHandleId != GetHandleId(replaced) ) then - call FlushChildHashtable(WoWReforgedEquipment___h, oldHandleId) - call FlushChildHashtable(WoWReforgedEquipment___h2, oldHandleId) - endif - call EnableTrigger(WoWReforgedEquipment___pickupTrigger) - call EnableTrigger(WoWReforgedEquipment___dropTrigger) - set owner=null - return replaced -endfunction -function WoWReforgedEquipment___UpdateEquipmentFromInventory takes unit hero returns nothing - local item slotItem= null - local integer c= 0 - local integer index= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_INVENTORY ) - set slotItem=UnitItemInSlot(hero, i) - if ( slotItem != null ) then - set index=GetEquipmentItemTypeByItemTypeId(GetItemTypeId(slotItem)) - if ( index != 0 ) then - set c=(WoWReforgedEquipment___equipmentItemTypeCategory[(index)]) // INLINED!! - call SaveInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( c ), ( index)) // INLINED!! - call SaveItemHandle(WoWReforgedEquipment___h2, GetHandleId((hero )), ( c ), ( slotItem)) // INLINED!! - endif - endif - set slotItem=null - set i=i + 1 - endloop -endfunction -function WoWReforgedEquipment___TriggerConditionIsCustomizableAttriburesHero takes nothing returns boolean - local integer unitTypeId= GetUnitTypeId(GetTriggerUnit()) - return IsCustomizableAttributesHero(unitTypeId) or unitTypeId == ITEM_VALUES_DUMMY_HERO -endfunction -function WoWReforgedEquipment___TriggerActionPickupItem takes nothing returns nothing - local unit hero= GetTriggerUnit() - local item whichItem= GetManipulatedItem() - local integer unitTypeId= GetUnitTypeId(hero) - local integer c= 0 - local integer indexOld= 0 - local integer index= GetEquipmentItemTypeByItemTypeId(GetItemTypeId(whichItem)) - if ( index != 0 ) then - set c=(WoWReforgedEquipment___equipmentItemTypeCategory[(index)]) // INLINED!! - if ( GetEquipmentItemTypeCategoryType(index , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED) ) then - //call BJDebugMsg("Drop all weapons.") - call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_LEFT_HAND) - call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_RIGHT_HAND) - else - // drop equipped two hand weapons if necessary - if ( (LoadInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_LEFT_HAND))) != 0 and GetEquipmentItemTypeCategoryType((LoadInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_LEFT_HAND))) , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED) ) then // INLINED!! - call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_LEFT_HAND) - endif - - if ( (LoadInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_RIGHT_HAND))) != 0 and GetEquipmentItemTypeCategoryType((LoadInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_RIGHT_HAND))) , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED) ) then // INLINED!! - call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_RIGHT_HAND) - endif - - //call BJDebugMsg("Drop current weapon from category " + I2S(c)) - // always drop the replaced equipment - call DropEquipment(hero , c) - endif - - call SaveInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( c ), ( index)) // INLINED!! - call SaveItemHandle(WoWReforgedEquipment___h2, GetHandleId((hero )), ( c ), ( whichItem)) // INLINED!! - - //call BJDebugMsg("Set equipment " + I2S(c) + " to " + GetItemName(whichItem)) - - if ( GetEquipmentItemTypeCategoryType(index , WoWReforgedEquipment_CATEGORY_TYPE_RANGE) ) then - if ( GetRangeUnitTypeId(unitTypeId) != unitTypeId ) then - //call BJDebugMsg("Replace hero.") - set hero=ReplaceHeroForEquipment(hero , GetRangeUnitTypeId(unitTypeId)) - endif - else - if ( GetMeleeUnitTypeId(unitTypeId) != unitTypeId ) then - //call BJDebugMsg("Replace hero.") - set hero=ReplaceHeroForEquipment(hero , GetMeleeUnitTypeId(unitTypeId)) - endif - endif - - //call UpdateEquipmentFromInventory(hero) - endif - set whichItem=null - set hero=null -endfunction -function WoWReforgedEquipment___TriggerActionDropItem takes nothing returns nothing - local unit hero= GetTriggerUnit() - local integer index= GetEquipmentItemTypeByItemTypeId(GetItemTypeId(GetManipulatedItem())) - local integer c= 0 - if ( index != 0 ) then - set c=(WoWReforgedEquipment___equipmentItemTypeCategory[(index)]) // INLINED!! - //call BJDebugMsg("Drop " + I2S(c) + " with item " + GetItemName(GetUnitEquipmentTypeItem(hero, c))) - call SaveInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( c ), ( 0)) // INLINED!! - call SaveItemHandle(WoWReforgedEquipment___h2, GetHandleId((hero )), ( c ), ( null)) // INLINED!! - //call UpdateEquipmentFromInventory(hero) - endif - set hero=null -endfunction -function WoWReforgedEquipment___TriggerConditionAttack takes nothing returns boolean - return IsCustomizableAttributesHero(BlzGetUnitSkin(GetAttacker())) -endfunction -function WoWReforgedEquipment___TriggerActionAttack takes nothing returns nothing - local unit hero= GetAttacker() - local integer leftHandIndex= (LoadInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_LEFT_HAND))) // INLINED!! - local integer rightHandIndex= (LoadInteger(WoWReforgedEquipment___h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_RIGHT_HAND))) // INLINED!! - if ( rightHandIndex != 0 ) then - if ( leftHandIndex != 0 and (WoWReforgedEquipment___equipmentItemTypeAnimation[(rightHandIndex)]) == VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON ) then // INLINED!! - //call BJDebugMsg("Left hand weapon even with right.") - call SetVillager255Animation(hero , (WoWReforgedEquipment___equipmentItemTypeAnimation[(leftHandIndex)])) // INLINED!! - else - //call BJDebugMsg("Right hand weapon.") - call SetVillager255Animation(hero , (WoWReforgedEquipment___equipmentItemTypeAnimation[(rightHandIndex)])) // INLINED!! - endif - elseif ( leftHandIndex != 0 ) then - //call BJDebugMsg("Left hand weapon.") - //call BJDebugMsg("Left hand weapon index " + I2S(leftHandIndex)) - //call BJDebugMsg("Left hand weapon animation index " + I2S(GetEquipmentTypeAnimation(leftHandIndex))) - call SetVillager255Animation(hero , (WoWReforgedEquipment___equipmentItemTypeAnimation[(leftHandIndex)])) // INLINED!! - else - call SetVillager255Animation(hero , VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON) - endif - set hero=null -endfunction -function WoWReforgedEquipment___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment___pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) - call TriggerAddCondition(WoWReforgedEquipment___pickupTrigger, Condition(function WoWReforgedEquipment___TriggerConditionIsCustomizableAttriburesHero)) - call TriggerAddAction(WoWReforgedEquipment___pickupTrigger, function WoWReforgedEquipment___TriggerActionPickupItem) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment___dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddCondition(WoWReforgedEquipment___dropTrigger, Condition(function WoWReforgedEquipment___TriggerConditionIsCustomizableAttriburesHero)) - call TriggerAddAction(WoWReforgedEquipment___dropTrigger, function WoWReforgedEquipment___TriggerActionDropItem) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment___attackTrigger, EVENT_PLAYER_UNIT_ATTACKED) - call TriggerAddCondition(WoWReforgedEquipment___attackTrigger, Condition(function WoWReforgedEquipment___TriggerConditionAttack)) - call TriggerAddAction(WoWReforgedEquipment___attackTrigger, function WoWReforgedEquipment___TriggerActionAttack) -endfunction -function AddSaveObjectItemTypesFromEquipment takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedEquipment___equipmentTypesCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( (WoWReforgedEquipment___equipmentItemTypeId[(i)]) != 0 ) then // INLINED!! - set udg_TmpItemTypeId=(WoWReforgedEquipment___equipmentItemTypeId[(i)]) // INLINED!! -call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! - endif - set i=i + 1 - endloop -endfunction -function WoWReforgedEquipment___RemoveUnitHook takes unit whichUnit returns nothing - local integer handleId= GetHandleId(whichUnit) - call FlushChildHashtable(WoWReforgedEquipment___h, handleId) - call FlushChildHashtable(WoWReforgedEquipment___h2, handleId) -endfunction -//processed hook: hook RemoveUnit WoWReforgedEquipment___RemoveUnitHook -//library WoWReforgedEquipment ends -//library WoWReforgedSaveCodes: -function GetSaveCodeTypeName takes integer t returns string - if ( t == SAVE_CODE_TYPE_HEROES ) then - return "Heroes" - elseif ( t == SAVE_CODE_TYPE_ITEMS ) then - return "Items" - elseif ( t == SAVE_CODE_TYPE_UNITS ) then - return "Units" - elseif ( t == SAVE_CODE_TYPE_BUILDINGS ) then - return "Buildings" - elseif ( t == SAVE_CODE_TYPE_RESEARCHES ) then - return "Researches" - elseif ( t == SAVE_CODE_TYPE_RESOURCES ) then - return "Resources" - elseif ( t == SAVE_CODE_TYPE_CLAN ) then - return "Clan" - elseif ( t == SAVE_CODE_TYPE_LETTER ) then - return "Letter" - endif - return "Unknown" -endfunction -function GetSinglePlayerStatus takes boolean isSinglePlayer returns string - if ( isSinglePlayer ) then - return "S" - endif - return "M" -endfunction -function GetGameTypeName takes integer gameType returns string - if ( gameType == udg_GameTypeEasy ) then - return "E" - elseif ( gameType == udg_GameTypeHardcore ) then - return "H" - elseif ( gameType == udg_GameTypeFast ) then - return "F" - endif - return "N" -endfunction -// keep the folder name short -// otherwise there won't be any folder -function GetSaveCodeFolderNameEx takes force whichForce,real duration,integer seed returns string - local string result= "wowr-" + GetSinglePlayerStatus(IsInSinglePlayer()) + "-" + GetGameTypeName(udg_GameType) - local integer playerCounter= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( IsPlayerInForce(Player(i), whichForce) ) then - set playerCounter=playerCounter + 1 - endif - set i=i + 1 - endloop - return result + "-" + I2S(playerCounter) + "-" + FormatTimeString(R2I(duration)) + "-S_" + I2S(WoWReforgedSaveCodes___gameSeed) -endfunction -function GetSaveCodeFolderName takes nothing returns string - local force whichForce= CreateForce() - local string result= "" - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if GetPlayerController(Player(i)) == MAP_CONTROL_USER and ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING or GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_LEFT ) then - call ForceAddPlayer(whichForce, Player(i)) - endif - set i=i + 1 - endloop - set result=GetSaveCodeFolderNameEx(whichForce , udg_GameTime , WoWReforgedSaveCodes___gameSeed) - call ForceClear(whichForce) - call DestroyForce(whichForce) - set whichForce=null - return result -endfunction -function GetGeneratedSaveCode takes string saveCode returns integer - local integer i= 0 - loop - exitwhen ( i >= generatedSaveCodesCounter ) - if ( saveCode == generatedSaveCodes[i] ) then - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function IsGeneratedSaveCode takes string saveCode returns boolean - return GetGeneratedSaveCode(saveCode) != - 1 -endfunction -function AddGeneratedSaveCode takes string saveCode returns integer - local integer index= GetGeneratedSaveCode(saveCode) - if ( index == - 1 ) then - set generatedSaveCodes[generatedSaveCodesCounter]=saveCode - set generatedSaveCodesCounter=generatedSaveCodesCounter + 1 - return generatedSaveCodesCounter - endif - return index -endfunction -function DisplayGeneratedSaveCodes takes player whichPlayer returns nothing - local string msg= "" - local integer counter= 0 - local integer i= 0 - loop - exitwhen ( i >= generatedSaveCodesCounter ) - set msg=msg + "\n- " + generatedSaveCodes[i] - set counter=counter + 1 - set i=i + 1 - endloop - call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Generated (" + I2S(counter) + "):" + msg) -endfunction -function GetGeneratedStatus takes boolean generated returns string - if ( generated ) then - return "|cffff0000Yes|r" - endif - return "|cff00ff00No|r" -endfunction -function GetChecksumStatus takes integer checksum,string checkedSaveCode returns string - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - return "|cffff0000Invalid|r" - endif - return "|cff00ff00Valid|r" -endfunction -function ConvertSaveCodeDemigodValueToInfo takes integer value returns string - if ( value == 1 ) then - return "Light Demigod" - elseif ( value == 2 ) then - return "Dark Demigod" - elseif ( value == 3 ) then - return "Any Demigod" - endif - return "No Demigod" -endfunction -function CreateSaveCodeTextFileHeroes takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer xpRate,integer heroLevel,integer xp,integer gold,integer lumber,integer evolutionLevel,integer powerGeneratorLevel,integer handOfGodLevel,integer mountLevel,integer masonryLevel,integer heroKills,integer heroDeaths,integer unitKills,integer unitDeaths,integer buildingsRazed,integer totalBossKills,integer heroLevel2,integer xp2,integer heroLevel3,integer xp3,integer improvedNavyLevel,integer improvedCreepHunterLevel,integer demigodValue,integer equipmentBags,string saveCode returns nothing - local string singleplayer= "no" - local string singlePlayerFileName= "Multiplayer" - local string gameMode= "Freelancer" - local string gameType= "Normal" - local string content= "" - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" - endif - if ( isWarlord ) then - set gameMode="Warlord" - endif - if ( gameTypeNumber == udg_GameTypeEasy ) then - set gameType="Easy" - elseif ( gameTypeNumber == udg_GameTypeFast ) then - set gameType="Fast" - elseif ( gameTypeNumber == udg_GameTypeHardcore ) then - set gameType="Hardcore" - endif - call FileStart() - set content=content + ("\r\n" + ("Code: -load " + saveCode)) // INLINED!! - set content=content + ("\r\n" + ("Player: " + playerName)) // INLINED!! - set content=content + ("\r\n" + ("Singleplayer: " + singleplayer)) // INLINED!! - set content=content + ("\r\n" + ("Game Mode: " + gameMode)) // INLINED!! - set content=content + ("\r\n" + ("Game Type: " + gameType)) // INLINED!! - set content=content + ("\r\n" + ("XP rate: " + I2S(xpRate))) // INLINED!! - set content=content + ("\r\n" + ("Hero Level: " + I2S(heroLevel))) // INLINED!! - set content=content + ("\r\n" + ("XP: " + I2S(xp))) // INLINED!! - set content=content + ("\r\n" + ("Demigod: " + ConvertSaveCodeDemigodValueToInfo(demigodValue))) // INLINED!! - set content=content + ("\r\n" + ("Gold: " + I2S(gold))) // INLINED!! - set content=content + ("\r\n" + ("Lumber: " + I2S(lumber))) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - // The line below creates the log - call Preload((content)) // INLINED!! - set content="" - set content=content + ("\r\n" + ("Evolution: " + I2S(evolutionLevel))) // INLINED!! - set content=content + ("\r\n" + ("Improved Power Generator: " + I2S(powerGeneratorLevel))) // INLINED!! - set content=content + ("\r\n" + ("Hand of God: " + I2S(handOfGodLevel))) // INLINED!! - set content=content + ("\r\n" + ("Improved Mount: " + I2S(mountLevel))) // INLINED!! - set content=content + ("\r\n" + ("Improved Masonry: " + I2S(masonryLevel))) // INLINED!! - set content=content + ("\r\n" + ("Improved Navy: " + I2S(improvedNavyLevel))) // INLINED!! - set content=content + ("\r\n" + ("Improved Creep Hunter: " + I2S(improvedCreepHunterLevel))) // INLINED!! - set content=content + ("\r\n" + ("Equipment Bags: " + I2S(equipmentBags))) // INLINED!! - set content=content + ("\r\n" + ("Hero Kills: " + I2S(heroKills))) // INLINED!! - set content=content + ("\r\n" + ("Hero Deaths: " + I2S(heroDeaths))) // INLINED!! - set content=content + ("\r\n" + ("Unit Kills: " + I2S(unitKills))) // INLINED!! - set content=content + ("\r\n" + ("Unit Deaths: " + I2S(unitDeaths))) // INLINED!! - set content=content + ("\r\n" + ("Buildings Razed: " + I2S(buildingsRazed))) // INLINED!! - set content=content + ("\r\n" + ("Boss Kills: " + I2S(totalBossKills))) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - // The line below creates the log - call Preload((content)) // INLINED!! - set content="" - set content=content + ("\r\n" + ("Hero Level 2: " + I2S(heroLevel2))) // INLINED!! - set content=content + ("\r\n" + ("XP 2: " + I2S(xp2))) // INLINED!! - set content=content + ("\r\n" + ("Hero Level 3: " + I2S(heroLevel3))) // INLINED!! - set content=content + ("\r\n" + ("XP 3: " + I2S(xp3))) // INLINED!! - // The line below creates the log - call Preload((content)) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-level1-" + I2S(heroLevel) + "-level2-" + I2S(heroLevel2) + "-level3-" + I2S(heroLevel3) + "-gold-" + I2S(gold) + "-lumber-" + I2S(lumber) + ".txt")) // INLINED!! -endfunction -// use one single symbol to store these two flags -function GetSinglePlayerAndGameMode takes boolean isSinglePlayer,boolean isWarlord returns integer - if ( isSinglePlayer and isWarlord ) then - //call BJDebugMsg("Save code single player and mode 0") - return 0 - elseif ( isSinglePlayer and not isWarlord ) then - //call BJDebugMsg("Save code single player and mode 1") - return 1 - elseif ( not isSinglePlayer and isWarlord ) then - //call BJDebugMsg("Save code single player and mode 2") - return 2 - else - //call BJDebugMsg("Save code single player and mode 3") - return 3 - endif - return 0 -endfunction -function GetSinglePlayerFromSaveCodeSegment takes integer saveCodeSegment returns boolean - if ( saveCodeSegment == 0 ) then - //call BJDebugMsg("Save code single player and mode 0") - return true - elseif ( saveCodeSegment == 1 ) then - return true - elseif ( saveCodeSegment == 2 ) then - return false - else - return false - endif - return false -endfunction -function GetWarlordFromSaveCodeSegment takes integer saveCodeSegment returns boolean - if ( saveCodeSegment == 0 ) then - //call BJDebugMsg("Save code single player and mode 0") - return true - elseif ( saveCodeSegment == 1 ) then - return false - elseif ( saveCodeSegment == 2 ) then - return true - else - return false - endif - return false -endfunction -function GetSaveCodeEx takes player whichPlayer,string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,integer heroLevel,integer xp,integer gold,integer lumber,integer evolutionLevel,integer powerGeneratorLevel,integer handOfGodLevel,integer mountLevel,integer masonryLevel,integer heroKills,integer heroDeaths,integer unitKills,integer unitDeaths,integer buildingsRazed,integer totalBossKills,integer heroLevel2,integer xp2,integer heroLevel3,integer xp3,integer improvedNavyLevel,integer improvedCreepHunterLevel,integer demigodValue,integer equipmentBags returns string - local integer playerNameHash= CompressedAbsStringHash(playerName) - local string result= "" - - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_HEROES) - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) - set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) - set result=result + ConvertDecimalNumberToSaveCodeSegment(xp) - // resources - set result=result + ConvertDecimalNumberToSaveCodeSegment(gold) - set result=result + ConvertDecimalNumberToSaveCodeSegment(lumber) - // upgrades - set result=result + ConvertDecimalNumberToSaveCodeSegment(evolutionLevel) - set result=result + ConvertDecimalNumberToSaveCodeSegment(powerGeneratorLevel) - set result=result + ConvertDecimalNumberToSaveCodeSegment(handOfGodLevel) - set result=result + ConvertDecimalNumberToSaveCodeSegment(mountLevel) - set result=result + ConvertDecimalNumberToSaveCodeSegment(masonryLevel) - // stats - set result=result + ConvertDecimalNumberToSaveCodeSegment(heroKills) - set result=result + ConvertDecimalNumberToSaveCodeSegment(heroDeaths) - set result=result + ConvertDecimalNumberToSaveCodeSegment(unitKills) - set result=result + ConvertDecimalNumberToSaveCodeSegment(unitDeaths) - set result=result + ConvertDecimalNumberToSaveCodeSegment(buildingsRazed) - set result=result + ConvertDecimalNumberToSaveCodeSegment(totalBossKills) - // hero 2 - set result=result + ConvertDecimalNumberToSaveCodeSegment(xp2) - // hero 3 - set result=result + ConvertDecimalNumberToSaveCodeSegment(xp3) - //call BJDebugMsg("Compressed result: " + result) - //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) - //call BJDebugMsg("Checked save code part: " + result) - // upgrades - set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedNavyLevel) - set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedCreepHunterLevel) - // demigod - set result=result + ConvertDecimalNumberToSaveCodeSegment(demigodValue) - set result=result + ConvertDecimalNumberToSaveCodeSegment(equipmentBags) - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) - endif - // never store savecode files of other players on the disk - if ( GetLocalPlayer() == whichPlayer ) then - call CreateSaveCodeTextFileHeroes(playerName , isSinglePlayer , isWarlord , gameType , xpRate , heroLevel , xp , gold , lumber , evolutionLevel , powerGeneratorLevel , handOfGodLevel , mountLevel , masonryLevel , heroKills , heroDeaths , unitKills , unitDeaths , buildingsRazed , totalBossKills , heroLevel2 , xp2 , heroLevel3 , xp3 , improvedNavyLevel , improvedCreepHunterLevel , demigodValue , equipmentBags , result) - endif - call AddGeneratedSaveCode(result) - return result -endfunction -function GetSaveCodeDemigodValue takes player whichPlayer returns integer - local integer unitTypeId= GetUnitTypeId(udg_Held[GetConvertedPlayerId(whichPlayer)]) - if ( unitTypeId == DEMIGOD_LIGHT ) then - return 1 - elseif ( unitTypeId == DEMIGOD_DARK ) then - return 2 - elseif ( GetPlayerTechCountSimple(UPG_DEMIGOD, whichPlayer) > 0 ) then - return 3 - endif - return 0 -endfunction -function GetSaveCode takes player whichPlayer returns string - local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) - local boolean isSinglePlayer= IsInSinglePlayer() - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - local boolean isWarlord= udg_PlayerIsWarlord[convertedPlayerId] - local integer gameType= udg_GameType - local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) - local integer heroLevel= GetHeroLevel1(whichPlayer) - local integer xp= GetHeroXP1(whichPlayer) - local integer gold= GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_GOLD) - local integer lumber= GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER) - local integer evolutionLevel= GetPlayerTechCountSimple(UPG_EVOLUTION, whichPlayer) - local integer powerGeneratorLevel= GetPlayerTechCountSimple(UPG_IMPROVED_POWER_GENERATOR, whichPlayer) - local integer handOfGodLevel= GetPlayerTechCountSimple(UPG_IMPROVED_HAND_OF_GOD, whichPlayer) - local integer mountLevel= GetPlayerTechCountSimple(UPG_IMPROVED_MOUNT, whichPlayer) - local integer masonryLevel= GetPlayerTechCountSimple(UPG_IMPROVED_MASONRY, whichPlayer) - local integer heroKills= GetPlayerScore(whichPlayer, PLAYER_SCORE_HEROES_KILLED) - local integer heroDeaths= udg_HeroDeaths[convertedPlayerId] - local integer unitKills= GetPlayerScore(whichPlayer, PLAYER_SCORE_UNITS_KILLED) - local integer unitDeaths= udg_UnitsLost[convertedPlayerId] - local integer buildingsRazed= GetPlayerScore(whichPlayer, PLAYER_SCORE_STRUCT_RAZED) - local integer totalBossKills= udg_BossKills[convertedPlayerId] - local integer heroLevel2= GetHeroLevel2(whichPlayer) - local integer xp2= GetHeroXP2(whichPlayer) - local integer heroLevel3= GetHeroLevel3(whichPlayer) - local integer xp3= GetHeroXP3(whichPlayer) - local integer improvedNavyLevel= GetPlayerTechCountSimple(UPG_IMPROVED_NAVY, whichPlayer) - local integer improvedCreepHunterLevel= GetPlayerTechCountSimple(UPG_IMPROVED_CREEP_HUNTER, whichPlayer) - local integer equipmentBags= BlzGroupGetSize(udg_EquipmentBags[convertedPlayerId]) - return GetSaveCodeEx(whichPlayer , GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , heroLevel , xp , gold , lumber , evolutionLevel , powerGeneratorLevel , handOfGodLevel , mountLevel , masonryLevel , heroKills , heroDeaths , unitKills , unitDeaths , buildingsRazed , totalBossKills , heroLevel2 , xp2 , heroLevel3 , xp3 , improvedNavyLevel , improvedCreepHunterLevel , GetSaveCodeDemigodValue(whichPlayer) , equipmentBags) -endfunction -function ReadSaveCodeEx takes string saveCode,integer hash,string alphabet returns string - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Deobfuscating with the hash!") - return ConvertSaveCodeFromObfuscatedVersionEx(saveCode , hash , alphabet) - endif - //call BJDebugMsg("Just returning!") - return saveCode -endfunction -function ReadSaveCode takes string saveCode,integer hash returns string - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Deobfuscating with the hash!") - return (ConvertSaveCodeFromObfuscatedVersionEx((saveCode ) , ( hash) , SAVE_CODE_DIGITS)) // INLINED!! - endif - //call BJDebugMsg("Just returning!") - return saveCode -endfunction -function SetPlayerStateIfHigher takes player whichPlayer,playerstate playerState,integer value returns boolean - if ( value > GetPlayerState(whichPlayer, playerState) ) then - call SetPlayerStateBJ(whichPlayer, playerState, value) - return true - endif - return false -endfunction -function SetPlayerTechResearchedIfHigher takes player whichPlayer,integer techId,integer level returns boolean - if ( level > GetPlayerTechCountSimple(techId, whichPlayer) ) then - call h__SetPlayerTechResearched(whichPlayer, techId, level) - return true - endif - return false -endfunction -function DisplaySaveCodeError takes player whichPlayer,string message returns nothing - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, message) -endfunction -function DisplaySaveCodeErrorAtLeastOne takes player whichPlayer,boolean atLeastOne returns nothing - if ( not atLeastOne ) then - call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "Empty savecode!")) // INLINED!! - endif -endfunction -function DisplaySaveCodeErrorLowerResearch takes player whichPlayer,integer techId returns nothing - call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "Not loading research " + GetObjectName(techId) + " since your current level is higher or equal!")) // INLINED!! -endfunction -function DisplaySaveCodeErrorSameGame takes player whichPlayer returns nothing - call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! -endfunction -function ApplySaveCode3_14 takes player whichPlayer,string s returns boolean - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! - local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local real demigodX= GetRectCenterX(gg_rct_redirect_forbidden_zone) - local real demigodY= GetRectCenterY(gg_rct_redirect_forbidden_zone) - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[convertedPlayerId] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) and xp >= GetHeroXP(udg_Held[convertedPlayerId]) ) then - if ( demigodValue == 1 ) then - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) - if ( udg_Held[convertedPlayerId] != null ) then - set udg_TmpUnit=udg_Held[convertedPlayerId] -call BecomeDemigod((udg_TmpUnit) , DEMIGOD_LIGHT) // INLINED!! - endif - elseif ( demigodValue == 2 ) then - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) - if ( udg_Held[convertedPlayerId] != null ) then - set udg_TmpUnit=udg_Held[convertedPlayerId] -call BecomeDemigod((udg_TmpUnit) , DEMIGOD_DARK) // INLINED!! - endif - elseif ( demigodValue == 3 ) then - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) - endif - call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_GOLD, gold) - call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER, lumber) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_EVOLUTION , evolutionLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_CHEAP_EVOLUTION , evolutionLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_POWER_GENERATOR , powerGeneratorLevel) - set udg_TmpPlayer=whichPlayer - call TriggerExecute(gg_trg_Power_Generator_Update_Heal_Icons) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_HAND_OF_GOD , handOfGodLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MOUNT , mountLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MASONRY , masonryLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_NAVY , improvedNavyLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_CREEP_HUNTER , improvedCreepHunterLevel) - set udg_HeroKills[convertedPlayerId]=heroKills - set udg_HeroDeaths[convertedPlayerId]=heroDeaths - set udg_UnitKills[convertedPlayerId]=unitKills - set udg_UnitsLost[convertedPlayerId]=unitDeaths - set udg_BossKills[convertedPlayerId]=totalBossKills - if ( udg_Held[convertedPlayerId] != null and xp > GetHeroXP(udg_Held[convertedPlayerId]) ) then - call SetHeroXP(udg_Held[convertedPlayerId], xp, true) - endif - if ( udg_Held[convertedPlayerId] == null and xp > udg_CharacterStartXP[convertedPlayerId] ) then - set udg_CharacterStartXP[convertedPlayerId]=xp - set udg_TmpPlayer=whichPlayer - set udg_TmpInteger=GetHeroLevelByXP(xp) - call TriggerExecute(gg_trg_Hero_Journey_Update_from_Level) - endif - if ( udg_Held2[convertedPlayerId] != null and xp2 > GetHeroXP(udg_Held2[convertedPlayerId]) ) then - call SetHeroXP(udg_Held2[convertedPlayerId], xp2, true) - endif - if ( udg_Held2[convertedPlayerId] == null and xp2 > udg_Held2XP[convertedPlayerId] ) then - set udg_Held2XP[convertedPlayerId]=xp2 - endif - if ( udg_Held3[convertedPlayerId] != null and xp3 > GetHeroXP(udg_Held3[convertedPlayerId]) ) then - call SetHeroXP(udg_Held3[convertedPlayerId], xp3, true) - endif - if ( udg_Held3[convertedPlayerId] == null and xp3 > udg_Held3XP[convertedPlayerId] ) then - set udg_Held3XP[convertedPlayerId]=xp3 - endif - call RecreateEquipmentBags(whichPlayer , equipmentBags) - - call AddGeneratedSaveCode(s) - return true - endif - else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! - endif - return false -endfunction -function ApplySaveCodePre3_14 takes player whichPlayer,string s returns boolean - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - local string saveCode= ReadSaveCodeEx(s , CompressedAbsStringHash(GetPlayerName(whichPlayer)) , SAVE_CODE_DIGITS_PRE_3_14) - local integer playerNameHash= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 0 , SAVE_CODE_DIGITS_PRE_3_14) - local integer isSinglePlayerAndWarlord= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 1 , SAVE_CODE_DIGITS_PRE_3_14) - local integer gameType= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 2 , SAVE_CODE_DIGITS_PRE_3_14) - local integer xpRate= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 3 , SAVE_CODE_DIGITS_PRE_3_14) - local integer xp= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 4 , SAVE_CODE_DIGITS_PRE_3_14) - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local integer gold= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 5 , SAVE_CODE_DIGITS_PRE_3_14) - local integer lumber= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 6 , SAVE_CODE_DIGITS_PRE_3_14) - local integer evolutionLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 7 , SAVE_CODE_DIGITS_PRE_3_14) - local integer powerGeneratorLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 8 , SAVE_CODE_DIGITS_PRE_3_14) - local integer handOfGodLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 9 , SAVE_CODE_DIGITS_PRE_3_14) - local integer mountLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 10 , SAVE_CODE_DIGITS_PRE_3_14) - local integer masonryLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 11 , SAVE_CODE_DIGITS_PRE_3_14) - local integer heroKills= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 12 , SAVE_CODE_DIGITS_PRE_3_14) - local integer heroDeaths= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 13 , SAVE_CODE_DIGITS_PRE_3_14) - local integer unitKills= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 14 , SAVE_CODE_DIGITS_PRE_3_14) - local integer unitDeaths= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 15 , SAVE_CODE_DIGITS_PRE_3_14) - local integer buildingsRazed= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 16 , SAVE_CODE_DIGITS_PRE_3_14) - local integer totalBossKills= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 17 , SAVE_CODE_DIGITS_PRE_3_14) - local integer xp2= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 18 , SAVE_CODE_DIGITS_PRE_3_14) - local integer xp3= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 19 , SAVE_CODE_DIGITS_PRE_3_14) - local integer improvedNavyLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 20 , SAVE_CODE_DIGITS_PRE_3_14) - local integer improvedCreepHunterLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 21 , SAVE_CODE_DIGITS_PRE_3_14) - local integer demigodValue= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 22 , SAVE_CODE_DIGITS_PRE_3_14) - local integer equipmentBags= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 23 , SAVE_CODE_DIGITS_PRE_3_14) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , lastSaveCodeSegment , SAVE_CODE_DIGITS_PRE_3_14) - local real demigodX= GetRectCenterX(gg_rct_redirect_forbidden_zone) - local real demigodY= GetRectCenterY(gg_rct_redirect_forbidden_zone) - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[convertedPlayerId] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) and xp >= GetHeroXP(udg_Held[convertedPlayerId]) ) then - if ( demigodValue == 1 ) then - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) - if ( udg_Held[convertedPlayerId] != null ) then - set udg_TmpUnit=udg_Held[convertedPlayerId] -call BecomeDemigod((udg_TmpUnit) , DEMIGOD_LIGHT) // INLINED!! - endif - elseif ( demigodValue == 2 ) then - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) - if ( udg_Held[convertedPlayerId] != null ) then - set udg_TmpUnit=udg_Held[convertedPlayerId] -call BecomeDemigod((udg_TmpUnit) , DEMIGOD_DARK) // INLINED!! - endif - elseif ( demigodValue == 3 ) then - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) - endif - call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_GOLD, gold) - call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER, lumber) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_EVOLUTION , evolutionLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_CHEAP_EVOLUTION , evolutionLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_POWER_GENERATOR , powerGeneratorLevel) - set udg_TmpPlayer=whichPlayer - call TriggerExecute(gg_trg_Power_Generator_Update_Heal_Icons) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_HAND_OF_GOD , handOfGodLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MOUNT , mountLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MASONRY , masonryLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_NAVY , improvedNavyLevel) - call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_CREEP_HUNTER , improvedCreepHunterLevel) - set udg_HeroKills[convertedPlayerId]=heroKills - set udg_HeroDeaths[convertedPlayerId]=heroDeaths - set udg_UnitKills[convertedPlayerId]=unitKills - set udg_UnitsLost[convertedPlayerId]=unitDeaths - set udg_BossKills[convertedPlayerId]=totalBossKills - if ( udg_Held[convertedPlayerId] != null and xp > GetHeroXP(udg_Held[convertedPlayerId]) ) then - call SetHeroXP(udg_Held[convertedPlayerId], xp, true) - endif - if ( udg_Held[convertedPlayerId] == null and xp > udg_CharacterStartXP[convertedPlayerId] ) then - set udg_CharacterStartXP[GetConvertedPlayerId(whichPlayer)]=xp - set udg_TmpPlayer=whichPlayer - set udg_TmpInteger=GetHeroLevelByXP(xp) - call TriggerExecute(gg_trg_Hero_Journey_Update_from_Level) - endif - if ( udg_Held2[convertedPlayerId] != null and xp2 > GetHeroXP(udg_Held2[convertedPlayerId]) ) then - call SetHeroXP(udg_Held2[convertedPlayerId], xp2, true) - endif - if ( udg_Held2[convertedPlayerId] == null and xp2 > udg_Held2XP[convertedPlayerId] ) then - set udg_Held2XP[convertedPlayerId]=xp2 - endif - if ( udg_Held3[convertedPlayerId] != null and xp3 > GetHeroXP(udg_Held3[convertedPlayerId]) ) then - call SetHeroXP(udg_Held3[convertedPlayerId], xp3, true) - endif - if ( udg_Held3[convertedPlayerId] == null and xp3 > udg_Held3XP[convertedPlayerId] ) then - set udg_Held3XP[convertedPlayerId]=xp3 - endif - call RecreateEquipmentBags(whichPlayer , equipmentBags) - - call AddGeneratedSaveCode(s) - return true - endif - else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! - endif - return false -endfunction -function ApplySaveCode takes player whichPlayer,string s returns boolean - return ApplySaveCode3_14(whichPlayer , s) or ApplySaveCodePre3_14(whichPlayer , s) -endfunction -function GetSaveCodeErrors takes player whichPlayer,string s returns string - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string result= "" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - if ( (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - set result=result + "Is from the same game!" - endif - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - - set result=result + "Expected different checksum!" - endif - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - set result=result + "Expected different player name!" - endif - if ( isSinglePlayer != IsInSinglePlayer() ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - if ( isSinglePlayer ) then - set result=result + "Expected singleplayer!" - else - set result=result + "Expected multiplayer!" - endif - endif - if ( gameType != udg_GameType ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - set result=result + "Expected game type: " + I2S(gameType) - endif - if ( isWarlord != udg_PlayerIsWarlord[convertedPlayerId] ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - if ( isWarlord ) then - set result=result + "Expected game mode Warlord!" - else - set result=result + "Expected game mode Freelancer!" - endif - endif - if ( xpRate != R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - set result=result + "Expected XP rate: " + I2S(xpRate) - endif - if ( xp < GetHeroXP(udg_Held[convertedPlayerId]) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - set result=result + "Expected more XP than your current!" - endif - if ( checksum == CompressedAbsStringHash(saveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[convertedPlayerId] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) and xp >= GetHeroXP(udg_Held[convertedPlayerId]) ) then - set result="None errors detected. Stored " + I2S(xp) + "XP." - endif - return result -endfunction -function AppendSaveCodeInfo takes string result,string appended returns string - if ( StringLength(result) > 0 ) then - set result=result + "|n" - endif - return result + appended -endfunction -function GetSaveCodeInfos takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local string playerName= GetPlayerName(whichPlayer) - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "Multiplayer" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "Freelancer" - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! - local string demigodValueInfo= ConvertSaveCodeDemigodValueToInfo(demigodValue) - local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! - local string result= "" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif - if ( isWarlord ) then - set warlordStatus="Warlord" - endif - set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) - set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) - set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) - set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) - set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) - set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) - set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) - set result=AppendSaveCodeInfo(result , "XP: " + I2S(xp)) - set result=AppendSaveCodeInfo(result , "Demigod: " + demigodValueInfo) - set result=AppendSaveCodeInfo(result , "XP 2: " + I2S(xp2)) - set result=AppendSaveCodeInfo(result , "XP 3: " + I2S(xp3)) - set result=AppendSaveCodeInfo(result , "Gold: " + I2S(gold)) - set result=AppendSaveCodeInfo(result , "Lumber: " + I2S(lumber)) - set result=AppendSaveCodeInfo(result , "Evolution: " + I2S(evolutionLevel)) - set result=AppendSaveCodeInfo(result , "Power Generator: " + I2S(powerGeneratorLevel)) - set result=AppendSaveCodeInfo(result , "Hand of God: " + I2S(handOfGodLevel)) - set result=AppendSaveCodeInfo(result , "Mount: " + I2S(mountLevel)) - set result=AppendSaveCodeInfo(result , "Masonry: " + I2S(masonryLevel)) - set result=AppendSaveCodeInfo(result , "Navy: " + I2S(improvedNavyLevel)) - set result=AppendSaveCodeInfo(result , "Creep Hunter: " + I2S(improvedCreepHunterLevel)) - set result=AppendSaveCodeInfo(result , "Equipment Bags: " + I2S(equipmentBags)) - set result=AppendSaveCodeInfo(result , "Hero Kills: " + I2S(heroKills)) - set result=AppendSaveCodeInfo(result , "Hero Deaths: " + I2S(heroDeaths)) - set result=AppendSaveCodeInfo(result , "Hero Kills: " + I2S(unitKills)) - set result=AppendSaveCodeInfo(result , "Unit Deaths: " + I2S(unitDeaths)) - set result=AppendSaveCodeInfo(result , "Buildings Razed: " + I2S(buildingsRazed)) - set result=AppendSaveCodeInfo(result , "Boss kills: " + I2S(totalBossKills)) - return result -endfunction -function GetSaveCodeShortInfos takes string playerName,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "M" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "F" - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! - local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! - local string demigodValueInfo= ConvertSaveCodeDemigodValueToInfo(demigodValue) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local string checksumStatus= "Valid" - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - if ( playerNameHash != CompressedAbsStringHash(playerName) ) then - set playerName="Not yours" - endif - if ( isSinglePlayer ) then - set singlePlayerStatus="S" - endif - if ( isWarlord ) then - set warlordStatus="W" - endif - return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-l1_" + I2S(GetHeroLevelByXP(xp)) + "-l2_" + I2S(GetHeroLevelByXP(xp2)) + "-l3_" + I2S(GetHeroLevelByXP(xp3)) + "-g_" + I2S(gold) + "-l_" + I2S(lumber) + "-e_" + I2S(evolutionLevel) -endfunction -function GetSaveCodeXp1 takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - - return xp -endfunction -function GetSaveCodeXp2 takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - - return xp2 -endfunction -function GetSaveCodeXp3 takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - - return xp3 -endfunction -function GetSaveCodeGold takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - - return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! -endfunction -function GetSaveCodeLumber takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - - return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! -endfunction -function GetSaveCodeHeroKills takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - - return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! -endfunction -function GetSaveCodeHeroDeaths takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - - return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! -endfunction -function GetSaveCodeIsMatching takes player whichPlayer,string s returns boolean - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "M" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "F" - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! - local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! - local string demigodValueInfo= ConvertSaveCodeDemigodValueToInfo(demigodValue) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - return isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +endfunction + + +//library WoWReforgedChangeLog ends +//library WoWReforgedDayNightCycleEffects: + + +function WoWReforgedDayNightCycleEffects___AddDestructableEx takes integer id,boolean hide,real hideDelay returns nothing + set WoWReforgedDayNightCycleEffects___destructableIds[WoWReforgedDayNightCycleEffects___destructableIdsCounter]=id + set WoWReforgedDayNightCycleEffects___destructableHide[WoWReforgedDayNightCycleEffects___destructableIdsCounter]=hide + set WoWReforgedDayNightCycleEffects___destructableHideDelay[WoWReforgedDayNightCycleEffects___destructableIdsCounter]=hideDelay + set WoWReforgedDayNightCycleEffects___destructableIdsCounter=WoWReforgedDayNightCycleEffects___destructableIdsCounter + 1 +endfunction + +function WoWReforgedDayNightCycleEffects___AddDestructable takes integer id returns nothing + call WoWReforgedDayNightCycleEffects___AddDestructableEx(id , false , 0.0) +endfunction + +function WoWReforgedDayNightCycleEffects___GetDestructableIndex takes integer id returns integer + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedDayNightCycleEffects___destructableIdsCounter ) + if ( WoWReforgedDayNightCycleEffects___destructableIds[i] == id ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function WoWReforgedDayNightCycleEffects___FilterIsDayNightDestructable takes nothing returns boolean + return WoWReforgedDayNightCycleEffects___GetDestructableIndex(GetDestructableTypeId(GetFilterDestructable())) != - 1 +endfunction + +function WoWReforgedDayNightCycleEffects___EnumDestructableDayEffect takes nothing returns nothing + local integer index= WoWReforgedDayNightCycleEffects___GetDestructableIndex(GetDestructableTypeId(GetEnumDestructable())) + if ( WoWReforgedDayNightCycleEffects___destructableHide[index] ) then + call ShowDestructable(GetEnumDestructable(), true) + endif + call SetDestructableAnimation(GetEnumDestructable(), "Stand") +endfunction + +function WoWReforgedDayNightCycleEffects___EnumDestructableNightEffect takes nothing returns nothing + local integer index= WoWReforgedDayNightCycleEffects___GetDestructableIndex(GetDestructableTypeId(GetEnumDestructable())) + call SetDestructableAnimation(GetEnumDestructable(), "Death") + if ( WoWReforgedDayNightCycleEffects___destructableHide[index] ) then + call TriggerSleepAction(WoWReforgedDayNightCycleEffects___destructableHideDelay[index]) + call ShowDestructable(GetEnumDestructable(), false) + endif +endfunction + +function WoWReforgedDayNightCycleEffects___AddDoodadEx takes integer id,string dayAnimName,string nightAnimName returns nothing + set WoWReforgedDayNightCycleEffects___doodadIds[WoWReforgedDayNightCycleEffects___doodadIdsCounter]=id + set WoWReforgedDayNightCycleEffects___doodadDayAnimNames[WoWReforgedDayNightCycleEffects___doodadIdsCounter]=dayAnimName + set WoWReforgedDayNightCycleEffects___doodadNightAnimNames[WoWReforgedDayNightCycleEffects___doodadIdsCounter]=nightAnimName + set WoWReforgedDayNightCycleEffects___doodadIdsCounter=WoWReforgedDayNightCycleEffects___doodadIdsCounter + 1 +endfunction + +function WoWReforgedDayNightCycleEffects___AddDoodad takes integer id returns nothing + call WoWReforgedDayNightCycleEffects___AddDoodadEx(id , "Death" , "Stand") +endfunction + +function WoWReforgedDayNightCycleEffects___PlayDoodadAnimations takes boolean day returns nothing + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedDayNightCycleEffects___doodadIdsCounter ) + if ( day ) then + call SetDoodadAnimationRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects___doodadIds[i], WoWReforgedDayNightCycleEffects___doodadDayAnimNames[i], false) + else + call SetDoodadAnimationRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects___doodadIds[i], WoWReforgedDayNightCycleEffects___doodadNightAnimNames[i], false) + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedDayNightCycleEffects___DayEffects takes nothing returns nothing + if ( IsDay() and not WoWReforgedDayNightCycleEffects___effectsIsDaytime ) then + set WoWReforgedDayNightCycleEffects___effectsIsDaytime=true + + call WoWReforgedDayNightCycleEffects___PlayDoodadAnimations(true) + call EnumDestructablesInRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects___filter, function WoWReforgedDayNightCycleEffects___EnumDestructableDayEffect) + endif +endfunction + +function WoWReforgedDayNightCycleEffects___NightEffects takes nothing returns nothing + local real ToD= GetTimeOfDay() + + if ( IsNight() and WoWReforgedDayNightCycleEffects___effectsIsDaytime ) then + set WoWReforgedDayNightCycleEffects___effectsIsDaytime=false + + call WoWReforgedDayNightCycleEffects___PlayDoodadAnimations(false) + call EnumDestructablesInRect(GetPlayableMapRect(), WoWReforgedDayNightCycleEffects___filter, function WoWReforgedDayNightCycleEffects___EnumDestructableNightEffect) + endif +endfunction + +function WoWReforgedDayNightCycleEffects___Init takes nothing returns nothing + set WoWReforgedDayNightCycleEffects___filter=Filter(function WoWReforgedDayNightCycleEffects___FilterIsDayNightDestructable) + //call TriggerAddAction(bj_dncSoundsDay, function DayEffects) + //call TriggerAddAction(bj_dncSoundsNight, function NightEffects) + + // Set up triggers to respond to changes from day to night or vice-versa. + set WoWReforgedDayNightCycleEffects___dayEffectsTrigger=CreateTrigger() + call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects___dayEffectsTrigger, GAME_STATE_TIME_OF_DAY, GREATER_THAN_OR_EQUAL, bj_TOD_DAWN) + call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects___dayEffectsTrigger, GAME_STATE_TIME_OF_DAY, LESS_THAN, bj_TOD_DUSK) + call TriggerAddAction(WoWReforgedDayNightCycleEffects___dayEffectsTrigger, function WoWReforgedDayNightCycleEffects___DayEffects) + + set WoWReforgedDayNightCycleEffects___nightEffectsTrigger=CreateTrigger() + call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects___nightEffectsTrigger, GAME_STATE_TIME_OF_DAY, LESS_THAN, bj_TOD_DAWN) + call TriggerRegisterGameStateEvent(WoWReforgedDayNightCycleEffects___nightEffectsTrigger, GAME_STATE_TIME_OF_DAY, GREATER_THAN_OR_EQUAL, bj_TOD_DUSK) + call TriggerAddAction(WoWReforgedDayNightCycleEffects___nightEffectsTrigger, function WoWReforgedDayNightCycleEffects___NightEffects) + + //call AddDestructable() + + call WoWReforgedDayNightCycleEffects___AddDoodadEx(('YOlp') , "Death" , "Stand") // Post Lantern Cityscape // INLINED!! + call WoWReforgedDayNightCycleEffects___AddDoodadEx(('LOlp') , "Death" , "Stand") // Post Lantern Lordaeron Summer // INLINED!! + call WoWReforgedDayNightCycleEffects___AddDoodadEx(('LObz') , "Death" , "Stand") // Brazier Glowing Loraderon Summer // INLINED!! + call WoWReforgedDayNightCycleEffects___AddDoodadEx(('LOtz') , "Death" , "Stand") // Torch Glowing Lordaeron Summer // INLINED!! + call WoWReforgedDayNightCycleEffects___AddDoodadEx(('ZObz') , "Death" , "Stand") // Brazier Ruins // INLINED!! + call WoWReforgedDayNightCycleEffects___AddDoodadEx(('D013') , "Death" , "Stand") // Gypsy Wagon // INLINED!! + call WoWReforgedDayNightCycleEffects___AddDestructableEx('D00F' , true , 2.167) // Fireflies + call WoWReforgedDayNightCycleEffects___AddDoodadEx('AOgs' , "Stand" , "Stand Alternate") // Statue Guardian of Aszune + call WoWReforgedDayNightCycleEffects___AddDoodadEx('AOks' , "Stand" , "Stand Alternate") // Statue Keeper +endfunction + + +//library WoWReforgedDayNightCycleEffects ends +//library WoWReforgedHeroSkills: + + +function GetHeroLearnedSkillEx takes integer sourceHandleId,integer slot returns integer + return LoadInteger(WoWReforgedHeroSkills__h, sourceHandleId, slot) +endfunction + +function GetHeroLearnedSkill takes unit hero,integer slot returns integer + return (LoadInteger(WoWReforgedHeroSkills__h, (GetHandleId(hero) ), ( slot))) // INLINED!! +endfunction + +function GetHeroLearnedSkillLevelEx takes integer sourceHandleId,integer slot returns integer + return LoadInteger(WoWReforgedHeroSkills__h2, sourceHandleId, slot) +endfunction + +function GetHeroLearnedSkillLevel takes unit hero,integer slot returns integer + return (LoadInteger(WoWReforgedHeroSkills__h2, (GetHandleId(hero) ), ( slot))) // INLINED!! +endfunction + +function IsCustomizableAttributesHero takes integer unitTypeId returns boolean + if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE ) then + return true + endif + if ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE ) then + return true + endif + if ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE ) then + return true + endif + if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE ) then + return true + endif + if ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE ) then + return true + endif + if ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE ) then + return true + endif + return false +endfunction + +function IsUnitCustomizableAttributesHero takes unit hero returns boolean + return IsCustomizableAttributesHero(GetUnitTypeId(hero)) +endfunction + +function IsReskillableHero takes integer unitTypeId returns boolean + if ( unitTypeId == EQUIPMENT_BAG ) then // Equipment Bag + return true + endif + if ( unitTypeId == 'N08V' ) then // Void Lord Range Strength + return true + endif + if ( unitTypeId == 'N06O' ) then // Void Lord Range Agility + return true + endif + if ( unitTypeId == 'N08U' ) then // Void Lord Range Intelligence + return true + endif + if ( unitTypeId == 'N09X' ) then // Void Lord Strength + return true + endif + if ( unitTypeId == 'N0AM' ) then // Void Lord Agility + return true + endif + if ( unitTypeId == 'N0AL' ) then // Void Lord Intelligence + return true + endif + if ( unitTypeId == 'H0A3' ) then // Archangel Strength + return true + endif + if ( unitTypeId == 'H0BN' ) then // Archangel Agility + return true + endif + if ( unitTypeId == 'H0BO' ) then // Archangel Intelligence + return true + endif + if ( unitTypeId == 'H0FB' ) then // Sea Giant Strength + return true + endif + if ( unitTypeId == 'H0F9' ) then // Sea Giant Agility + return true + endif + if ( unitTypeId == 'H0FA' ) then // Sea Giant Intelligence + return true + endif + return IsCustomizableAttributesHero(unitTypeId) +endfunction + +function ApplyHeroLearnedSkillEx takes unit hero,integer sourceHandleId,integer slot,integer level returns boolean + local integer unitTypeId= GetUnitTypeId(hero) + local integer abilityId= (LoadInteger(WoWReforgedHeroSkills__h, (sourceHandleId ), ( slot))) // INLINED!! + local integer index= - 1 + //call BJDebugMsg("Restoring ability " + GetObjectName(abilityId) + " with level " + I2S(level) + " for slot " + I2S(slot)) + if ( abilityId != 0 ) then + if ( IsReskillableHero(unitTypeId) ) then + set index=GetLearnableSkillByAbilityId(abilityId) + if ( index != - 1 ) then + //call BJDebugMsg("Found and restoring it.") + call AddLearnableSkillToHero(hero , index) + call LearnHeroSkill(hero , abilityId , level) + //call BJDebugMsg("Restore ability " + GetObjectName(abilityId) + " to level " + I2S(level) + " at slot " + I2S(slot)) + + return true + else + //call BJDebugMsg("Add ability to reskillable abilities: " + GetObjectName(abilityId)) + + return false + endif + else + //set index = GetHeroAbilityIndex(unitTypeId, abilityId) + + //if (index != -1) then + call LearnHeroSkill(hero , abilityId , level) + + return true + //else + //call BJDebugMsg("Missing hero ability " + GetObjectName(abilityId) + " from hero type " + GetObjectName(unitTypeId)) + + //return false + //endif + endif + endif + + return false +endfunction + +function ApplyHeroLearnedSkill takes unit hero,integer sourceHandleId,integer slot returns boolean + local integer level= (LoadInteger(WoWReforgedHeroSkills__h2, (sourceHandleId ), ( slot))) // INLINED!! + + return ApplyHeroLearnedSkillEx(hero , sourceHandleId , slot , level) +endfunction + +function EnableLearnEvents takes nothing returns nothing + call EnableTrigger(WoWReforgedHeroSkills__learnTrigger) +endfunction + +function DisableLearnEvents takes nothing returns nothing + call DisableTrigger(WoWReforgedHeroSkills__learnTrigger) +endfunction + +function EnableUnlearnEvents takes nothing returns nothing + call EnableTrigger(WoWReforgedHeroSkills__unlearnTrigger) +endfunction + +function DisableUnlearnEvents takes nothing returns nothing + call DisableTrigger(WoWReforgedHeroSkills__unlearnTrigger) +endfunction + +function ApplyAllHeroLearnedSkills takes unit hero,integer sourceHandleId returns nothing + local integer i= 0 + call DisableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! + call UnskillHero(hero) + loop + exitwhen ( i == RESKILL_MAX_SLOTS ) + call ApplyHeroLearnedSkill(hero , sourceHandleId , i) + set i=i + 1 + endloop + call EnableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! +endfunction + +function ApplyAllHeroLearnedSkillsMax takes unit hero,integer sourceHandleId returns nothing + local integer i= 0 + call DisableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! + call UnskillHero(hero) + loop + exitwhen ( i == RESKILL_MAX_SLOTS ) + call ApplyHeroLearnedSkillEx(hero , sourceHandleId , i , MAX_HERO_SPELL_LEVEL) + set i=i + 1 + endloop + call EnableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! +endfunction + +function ResetHeroLearnedSkills takes integer sourceHandleId returns nothing + call FlushChildHashtable(WoWReforgedHeroSkills__h, sourceHandleId) + call FlushChildHashtable(WoWReforgedHeroSkills__h2, sourceHandleId) +endfunction + +function SetHeroLearnedSkillAbilityId takes integer sourceHandleId,integer slot,integer abilityId returns nothing + call SaveInteger(WoWReforgedHeroSkills__h, sourceHandleId, slot, abilityId) +endfunction + +function HasNoHeroAbilityWithCooldown takes unit hero returns boolean + local integer abilityId= 0 + local integer i= 0 + loop + exitwhen ( i == RESKILL_MAX_SLOTS ) + set abilityId=(LoadInteger(WoWReforgedHeroSkills__h, (GetHandleId((hero )) ), ( ( i)))) // INLINED!! + if ( abilityId != 0 and BlzGetUnitAbilityCooldownRemaining(hero, abilityId) > 0.0 ) then + return false + endif + set i=i + 1 + endloop + return true +endfunction + +function RandomizeHeroSkill takes unit hero returns boolean + local integer unitTypeId= GetUnitTypeId(hero) + local integer index= - 1 + local integer i= 0 + if ( HasNoHeroAbilityWithCooldown(hero) ) then + call DisableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! + call UnskillHero(hero) + call ResetAllLearnableSkillsForHero(hero) + call RemoveAllLearnableSkillIconAbilities(hero) + set i=0 + loop + exitwhen ( i == RESKILL_MAX_SLOTS ) + set index=GetRandomLearnableSkillIndex(unitTypeId , i) + if ( index != - 1 ) then + call AddLearnableSkillToHero(hero , index) + call SaveInteger(WoWReforgedHeroSkills__h, (GetHandleId(hero) ), ( i ), ( (WoWReforgedLearnableSkills__learnableSkillAbilityId[(index)]))) // INLINED!! + endif + set i=i + 1 + endloop + call EnableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! + + if ( GetHeroLevel(hero) >= MAX_HERO_LEVEL ) then + call ApplyAllHeroLearnedSkillsMax(hero , GetHandleId(hero)) + else + call ApplyAllHeroLearnedSkills(hero , GetHandleId(hero)) + endif + return true + endif + + return false +endfunction + +function WoWReforgedHeroSkills__TriggerActionLearn takes nothing returns nothing + local unit hero= GetTriggerUnit() + local integer skill= GetLearnedSkill() + local integer slot= BlzGetAbilityIntegerField(BlzGetUnitAbility(hero, skill), ABILITY_IF_BUTTON_POSITION_NORMAL_X) + local integer y= BlzGetAbilityIntegerField(BlzGetUnitAbility(hero, skill), ABILITY_IF_BUTTON_POSITION_NORMAL_Y) + if ( y < 2 ) then + set slot=4 + endif + call SaveInteger(WoWReforgedHeroSkills__h, GetHandleId(hero), slot, skill) + call SaveInteger(WoWReforgedHeroSkills__h2, GetHandleId(hero), slot, GetUnitAbilityLevel(hero, skill)) + //call BJDebugMsg("Learning ability " + GetObjectName(skill) + " with level " + I2S(GetUnitAbilityLevel(hero, skill)) + " for slot " + I2S(slot) + " with Y " + I2S(y)) + set hero=null +endfunction + +function WoWReforgedHeroSkills__TriggerActionUnlearn takes nothing returns nothing + call ResetHeroLearnedSkills(GetHandleId((HeroUtils__unskilledHero))) // INLINED!! +endfunction + +function WoWReforgedHeroSkills__TimerFunctionLearn takes nothing returns nothing + local timer t= GetExpiredTimer() + // TODO Save all hero skills + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function WoWReforgedHeroSkills__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroSkills__learnTrigger, EVENT_PLAYER_HERO_SKILL) + call TriggerAddAction(WoWReforgedHeroSkills__learnTrigger, function WoWReforgedHeroSkills__TriggerActionLearn) + + call TriggerRegisterHeroUnskillEvent(WoWReforgedHeroSkills__unlearnTrigger) + call TriggerAddAction(WoWReforgedHeroSkills__unlearnTrigger, function WoWReforgedHeroSkills__TriggerActionUnlearn) + + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedHeroSkills__TimerFunctionLearn) +endfunction + + +//library WoWReforgedHeroSkills ends +//library WoWReforgedHousing: + + +function GetPlayerHousing takes player whichPlayer returns integer + return WoWReforgedHousing___housings[GetPlayerId(whichPlayer)] +endfunction + +function SetPlayerHousing takes nothing returns nothing + local integer h= (WoWReforgedHousing___housings[GetPlayerId((Player(WoWReforgedHousing___housingsCounter)))]) // INLINED!! + set s__Housing_r[h]=udg_TmpRect + set s__Housing_manager[h]=udg_TmpUnit + set WoWReforgedHousing___housingsCounter=WoWReforgedHousing___housingsCounter + 1 +endfunction + +function GetHousingByCoordinates takes real x,real y returns integer + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( WoWReforgedHousing___housings[i] != 0 and RectContainsCoords(s__Housing_r[WoWReforgedHousing___housings[i]], x, y) ) then + return WoWReforgedHousing___housings[i] + endif + set i=i + 1 + endloop + return 0 +endfunction + +function IsCoordinatesInHousing takes real x,real y returns boolean + return GetHousingByCoordinates(x , y) != 0 +endfunction + +function IsUnitInHousing takes unit whichUnit returns boolean + return GetHousingByCoordinates(GetUnitX(whichUnit) , GetUnitY(whichUnit)) != 0 +endfunction + +function WoWReforgedHousing___ReplaceWithTerrain takes rect whichRect,integer t returns nothing + local real x= GetRectMinX(whichRect) + local real y= 0.0 + local real maxX= GetRectMaxX(whichRect) + local real maxY= GetRectMaxY(whichRect) + loop + exitwhen ( x >= maxX ) + set y=GetRectMinY(whichRect) + loop + exitwhen ( y >= maxY ) + call SetTerrainType(x, y, t, GetTerrainVariance(x, y), 1, 0) + set y=y + bj_CELLWIDTH + endloop + set x=x + bj_CELLWIDTH + endloop +endfunction + +function SetHousingTileset takes integer h,integer t returns nothing + call WoWReforgedHousing___ReplaceWithTerrain(s__Housing_r[h] , t) +endfunction + +function LeaveHousing takes unit whichUnit returns nothing + local player owner= GetOwningPlayer(whichUnit) + call SetUnitPosition(whichUnit, GetMapNeutralZoneX(owner), GetMapNeutralZoneY(owner)) + call SetUnitFacing(whichUnit, GetMapNeutralZoneFacing(owner)) + set owner=null +endfunction + +function EnterHousing takes unit whichUnit,player whichPlayer returns nothing + local integer h= (WoWReforgedHousing___housings[GetPlayerId((whichPlayer))]) // INLINED!! + if ( h != 0 ) then + call SetUnitPosition(whichUnit, GetRectCenterX(s__Housing_r[h]), GetRectCenterY(s__Housing_r[h])) + call SetUnitFacing(whichUnit, 270.0) + if ( GetOwningPlayer(whichUnit) == GetLocalPlayer() ) then + call PanCameraTo(GetUnitX(whichUnit), GetUnitY(whichUnit)) + endif + endif +endfunction + + +function WoWReforgedHousing___TriggerConditionSellItem takes nothing returns boolean + local player owner= GetOwningPlayer(GetBuyingUnit()) + if ( GetItemTypeId(GetSoldItem()) == ITEM_HOUSE_KEY ) then + if ( PlayerHasUnlocked(owner , ITEM_HOUSE_KEY) ) then + if ( (WoWReforgedHousing___housings[GetPlayerId((owner))]) != 0 ) then // INLINED!! + call SetItemInvulnerable(GetSoldItem(), true) + set s__Housing_available[(WoWReforgedHousing___housings[GetPlayerId((owner))])]=true // INLINED!! + else + call SimError(owner , "No housing available.") + call RefundItem(GetSoldItem() , owner) + endif + else + call SimError(owner , "Housings are restricted to certain accounts: " + GetAllUnlockedAccountNames(ITEM_HOUSE_KEY)) + call RefundItem(GetSoldItem() , owner) + endif + endif + set owner=null + return false +endfunction + +function WoWReforgedHousing___TriggerConditionSellUnit takes nothing returns boolean + local unit u= GetSoldUnit() + local integer unitTypeId= GetUnitTypeId(u) + local player owner= GetOwningPlayer(GetBuyingUnit()) + if ( unitTypeId == LEAVE_HOUSING ) then + if ( IsUnitInHousing(GetBuyingUnit()) ) then + call LeaveHousing(GetBuyingUnit()) + else + call SimError(owner , "Not in housing.") + endif + call h__RemoveUnit(u) + elseif ( unitTypeId == GROUND_DIRT ) then + call WoWReforgedHousing___ReplaceWithTerrain(s__Housing_r[((WoWReforgedHousing___housings[GetPlayerId((owner))]) )] , ( 0)) // INLINED!! + call h__RemoveUnit(u) + elseif ( unitTypeId == GROUND_ROUGH_DIRT ) then + call WoWReforgedHousing___ReplaceWithTerrain(s__Housing_r[((WoWReforgedHousing___housings[GetPlayerId((owner))]) )] , ( 1)) // INLINED!! + call h__RemoveUnit(u) + endif + set owner=null + set u=null + return false +endfunction + +function WoWReforgedHousing___TriggerConditionUseItem takes nothing returns boolean + if ( GetItemTypeId(GetManipulatedItem()) == ITEM_HOUSE_KEY ) then + if ( (WoWReforgedHousing___housings[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) != 0 ) then // INLINED!! + if ( IsUnitInHousing(GetTriggerUnit()) ) then + call LeaveHousing(GetTriggerUnit()) + else + call EnterHousing(GetTriggerUnit() , GetOwningPlayer(GetTriggerUnit())) + endif + else + call SimError(GetOwningPlayer(GetTriggerUnit()) , "No housing available.") + endif + endif + return false +endfunction + +function WoWReforgedHousing___TriggerConditionChat takes nothing returns boolean + return false +endfunction + +function WoWReforgedHousing___TriggerConditionCast takes nothing returns boolean + local integer abilityId= GetSpellAbilityId() + if ( abilityId == 'AEbl' and (GetHousingByCoordinates(((GetSpellTargetX() )*1.0) , (( GetSpellTargetY())*1.0)) != 0) ) then // INLINED!! + call IssueImmediateOrder(GetTriggerUnit(), "stop") + call SimError(GetOwningPlayer(GetTriggerUnit()) , "Cannot teleport into player housing.") + endif + return false +endfunction + +function WoWReforgedHousing___Init takes nothing returns nothing + local player slotPlayer= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + set WoWReforgedHousing___housings[i]=s__Housing__allocate() + set s__Housing_p[WoWReforgedHousing___housings[i]]=slotPlayer + call TriggerRegisterPlayerChatEvent(WoWReforgedHousing___chatTrigger, slotPlayer, "-housing", true) + call TriggerRegisterPlayerChatEvent(WoWReforgedHousing___chatTrigger, slotPlayer, "-housingenter", false) + call TriggerRegisterPlayerChatEvent(WoWReforgedHousing___chatTrigger, slotPlayer, "-housingleave", false) + call TriggerRegisterPlayerChatEvent(WoWReforgedHousing___chatTrigger, slotPlayer, "-housinginvite", false) + set slotPlayer=null + set i=i + 1 + endloop + call TriggerAddCondition(WoWReforgedHousing___chatTrigger, Condition(function WoWReforgedHousing___TriggerConditionChat)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing___sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedHousing___sellItemTrigger, Condition(function WoWReforgedHousing___TriggerConditionSellItem)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing___useItemTrigger, EVENT_PLAYER_UNIT_USE_ITEM) + call TriggerAddCondition(WoWReforgedHousing___useItemTrigger, Condition(function WoWReforgedHousing___TriggerConditionUseItem)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing___sellUnitTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(WoWReforgedHousing___sellUnitTrigger, Condition(function WoWReforgedHousing___TriggerConditionSellUnit)) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHousing___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(WoWReforgedHousing___castTrigger, Condition(function WoWReforgedHousing___TriggerConditionCast)) +endfunction + + +//library WoWReforgedHousing ends +//library WoWReforgedMiner: + + +function GetRandomOreItemTypeId takes nothing returns integer + return WoWReforgedMiner___oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner___oreItemTypeIdsCounter - 1)] +endfunction + +function IsOre takes integer itemTypeId returns boolean + local integer i= 0 + loop + exitwhen ( i == WoWReforgedMiner___oreItemTypeIdsCounter ) + if ( itemTypeId == WoWReforgedMiner___oreItemTypeIds[i] ) then + return true + endif + set i=i + 1 + endloop + return false +endfunction + +function AddOreItemTypeId takes integer itemTypeId returns nothing + set WoWReforgedMiner___oreItemTypeIds[WoWReforgedMiner___oreItemTypeIdsCounter]=itemTypeId + set WoWReforgedMiner___oreItemTypeIdsCounter=WoWReforgedMiner___oreItemTypeIdsCounter + 1 +endfunction + +function GetRandomGemItemTypeId takes nothing returns integer + return WoWReforgedMiner___gemItemTypeIds[GetRandomInt(0, WoWReforgedMiner___gemItemTypeIdsCounter - 1)] +endfunction + +function IsGem takes integer itemTypeId returns boolean + local integer i= 0 + loop + exitwhen ( i == WoWReforgedMiner___gemItemTypeIdsCounter ) + if ( itemTypeId == WoWReforgedMiner___gemItemTypeIds[i] ) then + return true + endif + set i=i + 1 + endloop + return false +endfunction + +function AddGemItemTypeId takes integer itemTypeId returns nothing + set WoWReforgedMiner___gemItemTypeIds[WoWReforgedMiner___gemItemTypeIdsCounter]=itemTypeId + set WoWReforgedMiner___gemItemTypeIdsCounter=WoWReforgedMiner___gemItemTypeIdsCounter + 1 +endfunction + +function GetRandomMineralResource takes nothing returns integer + return WoWReforgedMiner___mineralResources[GetRandomInt(0, WoWReforgedMiner___mineralResourcesCounter - 1)] +endfunction + +function AddMineralResource takes integer resource returns nothing + set WoWReforgedMiner___mineralResources[WoWReforgedMiner___mineralResourcesCounter]=resource + set WoWReforgedMiner___mineralResourcesCounter=WoWReforgedMiner___mineralResourcesCounter + 1 +endfunction + +function AddMinerMine takes unit mine returns nothing + call AddMineEx(mine , (WoWReforgedMiner___mineralResources[GetRandomInt(0, WoWReforgedMiner___mineralResourcesCounter - 1)]) , GetRandomInt(200, 1500)) // INLINED!! +endfunction + +function AddWorkerMiner takes unit worker returns nothing + local integer i= 0 + call AddWorker(worker) + loop + exitwhen ( i == WoWReforgedMiner___mineralResourcesCounter ) + call AddResourceToWorker(worker , WoWReforgedMiner___mineralResources[i] , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 200 , 20 , "gold") + set i=i + 1 + endloop +endfunction + +function MinerPickup takes unit hero,item whichItem returns nothing + local integer itemTypeId= GetItemTypeId(whichItem) + if ( ( IsOre(itemTypeId) or IsGem(itemTypeId) ) and UnitHasItemOfTypeBJ(hero, ITEM_PICKAXE) ) then + call SetItemCharges(whichItem, IMaxBJ(1, GetItemCharges(whichItem)) + 1) + endif +endfunction + +function InitMiner takes nothing returns nothing + call AddOreItemTypeId(ITEM_ROCKS) + call AddOreItemTypeId(ITEM_ORE_GOLD) + call AddOreItemTypeId(ITEM_ORE_IRON) + call AddOreItemTypeId(ITEM_ORE_SILVER) + + call AddGemItemTypeId(ITEM_GEM_AMBER) + call AddGemItemTypeId(ITEM_GEM_AMETHYST) + call AddGemItemTypeId(ITEM_GEM_AQUAMARINE) + call AddGemItemTypeId(ITEM_GEM_DIAMOND) + call AddGemItemTypeId(ITEM_GEM_EMERALD) + call AddGemItemTypeId(ITEM_GEM_JADE) + call AddGemItemTypeId(ITEM_GEM_MALACHITE) + call AddGemItemTypeId(ITEM_GEM_OPAL) + call AddGemItemTypeId(ITEM_GEM_RUBY) + call AddGemItemTypeId(ITEM_GEM_SAPPHIRE) + call AddGemItemTypeId(ITEM_GEM_TOPAZ) + call AddGemItemTypeId(ITEM_GEM_TURQUOISE) + + // do after initializing resources + call AddMineralResource(udg_ResourceSilver) + call AddMineralResource(udg_ResourceIron) + call AddMineralResource(udg_ResourceRock) + call AddMineralResource(udg_ResourceGemstones) +endfunction + + +//library WoWReforgedMiner ends +//library WoWReforgedNpcs: + + +function GetMaxNpcs takes nothing returns integer + return WoWReforgedNpcs___npcUnitTypeIdsCount +endfunction + +function GetNpc takes integer index returns integer + return WoWReforgedNpcs___npcUnitTypeIds[index] +endfunction + +function AddNpc takes integer unitTypeId returns integer + local integer index= WoWReforgedNpcs___npcUnitTypeIdsCount + set WoWReforgedNpcs___npcUnitTypeIds[index]=unitTypeId + set WoWReforgedNpcs___npcUnitTypeIdsCount=index + 1 + call SaveBoolean(ObjectDataFields__h, (unitTypeId ), ( OBJECT_DATA_FIELD_UCAM ), ( true)) // INLINED!! + //call AddUnitTypeCampaign() + return index +endfunction + +function AddWoWReforgedNpc takes nothing returns nothing + call AddNpc(udg_TmpUnitType) +endfunction + +function GetNpcIndexByUnitTypeId takes integer unitTypeId returns integer + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedNpcs___npcUnitTypeIdsCount ) + if ( WoWReforgedNpcs___npcUnitTypeIds[i] == unitTypeId ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function IsNpc takes integer unitTypeId returns boolean + return GetNpcIndexByUnitTypeId(unitTypeId) != - 1 +endfunction + +function IsUnitNpc takes unit whichUnit returns boolean + return (GetNpcIndexByUnitTypeId((GetUnitTypeId(whichUnit))) != - 1) // INLINED!! +endfunction + + +function WoWReforgedNpcs___FilterIsUnitType takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == WoWReforgedNpcs___filterUnitTypeId +endfunction + +function GetNpcUnitByUnitTypeId takes integer unitTypeId returns unit + local group g= CreateGroup() + local unit first= null + set WoWReforgedNpcs___filterUnitTypeId=unitTypeId + call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), Filter(function WoWReforgedNpcs___FilterIsUnitType)) + set first=FirstOfGroup(g) + call GroupClear(g) + call DestroyGroup(g) + set g=null + return first +endfunction + + +//library WoWReforgedNpcs ends +//library WoWReforgedPagedButtonsConfig: + +function WoWReforgedPagedButtonsConfig__Init takes nothing returns nothing + call SetPagedButtonsConfigHeroCostsDefault(0 , 0) +endfunction + + +//library WoWReforgedPagedButtonsConfig ends +//library WoWReforgedProspector: + + +function IsGoldItem takes integer itemTypeId returns boolean + local integer i= 0 + loop + exitwhen ( i == WoWReforgedProspector___goldItemTypeIdsCounter ) + if ( itemTypeId == WoWReforgedProspector___goldItemTypeIds[i] ) then + return true + endif + set i=i + 1 + endloop + return false +endfunction + +function AddGoldItemTypeId takes integer itemTypeId returns nothing + set WoWReforgedProspector___goldItemTypeIds[WoWReforgedProspector___goldItemTypeIdsCounter]=itemTypeId + set WoWReforgedProspector___goldItemTypeIdsCounter=WoWReforgedProspector___goldItemTypeIdsCounter + 1 +endfunction + +function ProspectorPickup takes unit hero,item whichItem returns nothing + local integer itemTypeId= GetItemTypeId(whichItem) + if ( IsGoldItem(itemTypeId) and UnitHasItemOfTypeBJ(hero, ITEM_GOLD_DRILL) ) then + call SetItemCharges(whichItem, IMaxBJ(1, GetItemCharges(whichItem)) + 1) + endif +endfunction + +function WoWReforgedProspector___Init takes nothing returns nothing + call AddGoldItemTypeId(ITEM_ORE_GOLD) + call AddGoldItemTypeId(ITEM_GOLD_BARS) + call AddGoldItemTypeId(ITEM_GOLD_COINS) +endfunction + + +//library WoWReforgedProspector ends +//library AStructCoreInterfaceThirdPersonCamera: + + + // key settings + // static construction members + // static members + // dynamic members + // construction members + // members + + // dynamic members + + function s__AThirdPersonCamera_setCamAoa takes integer this,real camAoa returns nothing + set s__AThirdPersonCamera_m_camAoa[this]=camAoa + endfunction + + function s__AThirdPersonCamera_camAoa takes integer this returns real + return s__AThirdPersonCamera_m_camAoa[this] + endfunction + + function s__AThirdPersonCamera_setCamRot takes integer this,real camRot returns nothing + set s__AThirdPersonCamera_m_camRot[this]=camRot + endfunction + + function s__AThirdPersonCamera_camRot takes integer this returns real + return s__AThirdPersonCamera_m_camRot[this] + endfunction + + // construction members + + function s__AThirdPersonCamera_player takes integer this returns player + return s__AThirdPersonCamera_m_player[this] + endfunction + + // members + + function s__AThirdPersonCamera_unit takes integer this returns unit + return s__AThirdPersonCamera_m_unit[this] + endfunction + + function s__AThirdPersonCamera_isEnabled takes integer this returns boolean + return s__AThirdPersonCamera_m_isEnabled[this] + endfunction + + //methods + + function s__AThirdPersonCamera_disable takes integer this returns nothing + if ( TimerGetRemaining(s__AThirdPersonCamera_m_firstPan[this]) > 0.0 ) then + call PauseTimer(s__AThirdPersonCamera_m_firstPan[this]) + endif + set s__AThirdPersonCamera_m_unit[this]=null + set s__AThirdPersonCamera_m_isEnabled[this]=false + endfunction + + /// Functions for distance and offset. These are linear mathematical functions y = mx+t. + function s__AThirdPersonCamera_interpolateDistance takes real angleOfAttack returns real + if ( angleOfAttack <= s__AThirdPersonCamera_distanceAoaMax * bj_DEGTORAD ) then + return s__AThirdPersonCamera_distanceDistanceMax + elseif ( angleOfAttack >= s__AThirdPersonCamera_distanceAoaMin * bj_DEGTORAD ) then + return s__AThirdPersonCamera_distanceDistanceMin + endif + return s__AThirdPersonCamera_m_distanceM * angleOfAttack + s__AThirdPersonCamera_m_distanceT + endfunction + + function s__AThirdPersonCamera_interpolateOffset takes real angleOfAttack returns real + if ( angleOfAttack <= s__AThirdPersonCamera_offsetAoaMax * bj_DEGTORAD ) then + return s__AThirdPersonCamera_offsetOffsetMax + elseif ( angleOfAttack >= s__AThirdPersonCamera_offsetAoaMin * bj_DEGTORAD ) then + return s__AThirdPersonCamera_offsetOffsetMin + endif + return s__AThirdPersonCamera_m_offsetM * angleOfAttack + s__AThirdPersonCamera_m_offsetT + endfunction + + function s__AThirdPersonCamera_cappedReal takes real r,real lowBound,real highBound returns real + if r < lowBound then + return lowBound + elseif r > highBound then + return highBound + endif + return r + endfunction + + function s__AThirdPersonCamera_getActualUnit takes integer this returns unit + local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((s__AThirdPersonCamera_m_unit[this]))))]) // INLINED!! + if ( transporter != null ) then + return transporter + endif + return s__AThirdPersonCamera_m_unit[this] + endfunction + + function s__AThirdPersonCamera_applyCam takes integer this,real duration returns nothing + local real aoa= GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) - 2 * bj_PI + local real offset= s__AThirdPersonCamera_interpolateOffset(aoa) + local real newaoa + local real maxd + local real tarz + local real newx + local real newy + local real newm + local real maxm= - 1 + local real r= s__AThirdPersonCamera_terrainSampling + local real dx + local real dy + + if ( s__AThirdPersonCamera_m_useArrowKeys ) then + if ( s__AThirdPersonCamera_inverted ) then + set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_cappedReal(s__AThirdPersonCamera_m_camRot[this] + ( (s__AArrowKeys_m_horizontal[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) + (s__AArrowKeys_m_horizontalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) ) * s__AThirdPersonCamera_rotInterval , - s__AThirdPersonCamera_maxRot , s__AThirdPersonCamera_maxRot) // INLINED!! + else + set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_cappedReal(s__AThirdPersonCamera_m_camRot[this] - ( (s__AArrowKeys_m_horizontal[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) + (s__AArrowKeys_m_horizontalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) ) * s__AThirdPersonCamera_rotInterval , - s__AThirdPersonCamera_maxRot , s__AThirdPersonCamera_maxRot) // INLINED!! + endif + set s__AArrowKeys_m_horizontalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]=(0) // INLINED!! + set s__AThirdPersonCamera_m_camAoa[this]=s__AThirdPersonCamera_cappedReal(s__AThirdPersonCamera_m_camAoa[this] - ( (s__AArrowKeys_m_vertical[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) + (s__AArrowKeys_m_verticalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]) ) * s__AThirdPersonCamera_aoaInterval , s__AThirdPersonCamera_minAoa , s__AThirdPersonCamera_maxAoa) // INLINED!! + set s__AArrowKeys_m_verticalQuickPress[((s__s__AArrowKeys_m_playerArrowKeys[GetPlayerId((s__AThirdPersonCamera_m_player[this]))]))]=(0) // INLINED!! + endif + + call SetCameraField(CAMERA_FIELD_ROTATION, GetUnitFacing(s__AThirdPersonCamera_getActualUnit(this)) + s__AThirdPersonCamera_m_camRot[this], duration) + call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, s__AThirdPersonCamera_fieldOfView, duration) + call SetCameraField(CAMERA_FIELD_FARZ, s__AThirdPersonCamera_farZ, duration) + call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, s__AThirdPersonCamera_interpolateDistance(aoa), duration) + + call PanCameraToTimed(GetUnitX(s__AThirdPersonCamera_getActualUnit(this)) + offset * Cos(bj_DEGTORAD * GetUnitFacing(s__AThirdPersonCamera_getActualUnit(this))), GetUnitY(s__AThirdPersonCamera_getActualUnit(this)) + offset * Sin(bj_DEGTORAD * GetUnitFacing(s__AThirdPersonCamera_getActualUnit(this))), duration) + + set newx=GetCameraTargetPositionX() + set newy=GetCameraTargetPositionY() + set maxd=s__AThirdPersonCamera_cliffDistance + GetCameraField(CAMERA_FIELD_TARGET_DISTANCE) + set dx=- Cos(GetCameraField(CAMERA_FIELD_ROTATION)) * r + set dy=- Sin(GetCameraField(CAMERA_FIELD_ROTATION)) * r + + call MoveLocation(s__AThirdPersonCamera_m_location, newx, newy) + set tarz=GetCameraTargetPositionZ() + call SetCameraField(CAMERA_FIELD_ZOFFSET, GetCameraField(CAMERA_FIELD_ZOFFSET) + GetLocationZ(s__AThirdPersonCamera_m_location) + s__AThirdPersonCamera_zOffset + GetUnitFlyHeight(s__AThirdPersonCamera_getActualUnit(this)) - tarz, duration) + + loop + exitwhen ( r > maxd ) + set newx=newx + dx + set newy=newy + dy + call MoveLocation(s__AThirdPersonCamera_m_location, newx, newy) + set newm=( GetLocationZ(s__AThirdPersonCamera_m_location) - tarz ) / r + if ( newm > maxm ) then + set maxm=newm + endif + set r=r + s__AThirdPersonCamera_terrainSampling + endloop + set newaoa=- Atan(maxm) * bj_RADTODEG - s__AThirdPersonCamera_angleAboveTerrain + if ( s__AThirdPersonCamera_m_camAoa[this] < newaoa ) then + set newaoa=s__AThirdPersonCamera_m_camAoa[this] + endif + call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, newaoa, duration) + endfunction + + function s__AThirdPersonCamera_enable takes integer this,unit whichUnit,real firstPan returns nothing + if ( (s__AThirdPersonCamera_m_isEnabled[(this)]) ) then // INLINED!! + call s__AThirdPersonCamera_disable(this) + endif + set s__AThirdPersonCamera_m_unit[this]=whichUnit + set s__AThirdPersonCamera_m_isEnabled[this]=true + call TimerStart(s__AThirdPersonCamera_m_firstPan[this], firstPan, false, null) + if ( GetLocalPlayer() == s__AThirdPersonCamera_m_player[this] ) then + call StopCamera() + if ( whichUnit != null ) then + call s__AThirdPersonCamera_applyCam(this,firstPan) + endif + endif + endfunction + + function s__AThirdPersonCamera_pause takes integer this returns nothing + call PauseTimer(s__AThirdPersonCamera_m_firstPan[this]) + set s__AThirdPersonCamera_m_isEnabled[this]=false + endfunction + + function s__AThirdPersonCamera_resume takes integer this returns nothing + call ResumeTimer(s__AThirdPersonCamera_m_firstPan[this]) + set s__AThirdPersonCamera_m_isEnabled[this]=true + endfunction + + function s__AThirdPersonCamera_resetCamAoa takes integer this returns nothing + set s__AThirdPersonCamera_m_camAoa[this]=s__AThirdPersonCamera_defaultAoa + endfunction + + function s__AThirdPersonCamera_resetCamRot takes integer this returns nothing + set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_defaultRot + endfunction + + function s__AThirdPersonCamera_create takes player usedPlayer returns integer + local integer this= s__AThirdPersonCamera__allocate() + // dynamic members + set s__AThirdPersonCamera_m_camAoa[this]=s__AThirdPersonCamera_defaultAoa + set s__AThirdPersonCamera_m_camRot[this]=s__AThirdPersonCamera_defaultRot + // construction members + set s__AThirdPersonCamera_m_player[this]=usedPlayer + // members + set s__AThirdPersonCamera_m_unit[this]=null + set s__AThirdPersonCamera_m_isEnabled[this]=false + set s__AThirdPersonCamera_m_firstPan[this]=CreateTimer() + return this + endfunction + + function s__AThirdPersonCamera_onDestroy takes integer this returns nothing + // construction members + set s__AThirdPersonCamera_m_player[this]=null + // members + set s__AThirdPersonCamera_m_unit[this]=null + call PauseTimer(s__AThirdPersonCamera_m_firstPan[this]) + call DestroyTimer(s__AThirdPersonCamera_m_firstPan[this]) + set s__AThirdPersonCamera_m_firstPan[this]=null + endfunction + +//Generated destructor of AThirdPersonCamera +function s__AThirdPersonCamera_deallocate takes integer this returns nothing + if this==null then + return + elseif (si__AThirdPersonCamera_V[this]!=-1) then + return + endif + call s__AThirdPersonCamera_onDestroy(this) + set si__AThirdPersonCamera_V[this]=si__AThirdPersonCamera_F + set si__AThirdPersonCamera_F=this +endfunction + + function s__AThirdPersonCamera_timerFunctionRefresh takes nothing returns nothing + local player localPlayer= GetLocalPlayer() + local integer playerId= GetPlayerId(localPlayer) + if ( s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId] != 0 and s__AThirdPersonCamera_m_isEnabled[s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId]] ) then + if ( TimerGetRemaining(s__AThirdPersonCamera_m_firstPan[s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId]]) <= s__AThirdPersonCamera_panDuration ) then + call s__AThirdPersonCamera_applyCam(s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId],s__AThirdPersonCamera_panDuration) + else + call s__AThirdPersonCamera_applyCam(s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId],TimerGetRemaining(s__AThirdPersonCamera_m_firstPan[s__s__AThirdPersonCamera_m_playerThirdPersonCamera[playerId]])) + endif + endif + endfunction + + function s__AThirdPersonCamera_init takes boolean useArrowKeys returns nothing + // static construction members + set s__AThirdPersonCamera_m_useArrowKeys=useArrowKeys + // static members + set s__AThirdPersonCamera_m_location=Location(0, 0) + set s__AThirdPersonCamera_m_distanceM=( s__AThirdPersonCamera_distanceDistanceMax - s__AThirdPersonCamera_distanceDistanceMin ) / ( ( s__AThirdPersonCamera_distanceAoaMax - s__AThirdPersonCamera_distanceAoaMin ) * bj_DEGTORAD ) + set s__AThirdPersonCamera_m_distanceT=s__AThirdPersonCamera_distanceDistanceMin - s__AThirdPersonCamera_distanceAoaMin * bj_DEGTORAD * s__AThirdPersonCamera_m_distanceM + set s__AThirdPersonCamera_m_offsetM=( s__AThirdPersonCamera_offsetOffsetMax - s__AThirdPersonCamera_offsetOffsetMin ) / ( ( s__AThirdPersonCamera_offsetAoaMax - s__AThirdPersonCamera_offsetAoaMin ) * bj_DEGTORAD ) + set s__AThirdPersonCamera_m_offsetT=s__AThirdPersonCamera_offsetOffsetMin - s__AThirdPersonCamera_offsetAoaMin * bj_DEGTORAD * s__AThirdPersonCamera_m_offsetM + set s__AThirdPersonCamera_m_timer=CreateTimer() + call TimerStart(s__AThirdPersonCamera_m_timer, s__AThirdPersonCamera_timeout, true, function s__AThirdPersonCamera_timerFunctionRefresh) + endfunction + + function s__AThirdPersonCamera_cleanUp takes nothing returns nothing + call PauseTimer(s__AThirdPersonCamera_m_timer) + call RemoveLocation(s__AThirdPersonCamera_m_location) + set s__AThirdPersonCamera_m_location=null + call DestroyTimer(s__AThirdPersonCamera_m_timer) + set s__AThirdPersonCamera_m_timer=null + endfunction + + function s__AThirdPersonCamera_playerThirdPersonCamera takes player user returns integer + if ( s__s__AThirdPersonCamera_m_playerThirdPersonCamera[GetPlayerId(user)] == 0 ) then + set s__s__AThirdPersonCamera_m_playerThirdPersonCamera[GetPlayerId(user)]= s__AThirdPersonCamera_create(user) + endif + return s__s__AThirdPersonCamera_m_playerThirdPersonCamera[GetPlayerId(user)] + endfunction + + function s__AThirdPersonCamera_timerHandleId takes nothing returns integer + return GetHandleId(s__AThirdPersonCamera_m_timer) + endfunction + + +//library AStructCoreInterfaceThirdPersonCamera ends +//library CameraUtils: + +function SmartCameraPanToUnit takes player whichPlayer,unit target,real duration returns nothing + local real dist + local location cameraLoc= GetCameraTargetPositionLoc() + local real x= GetUnitX(target) + local real y= GetUnitY(target) + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + + set dist=DistanceBetweenCoordinates(x , y , GetLocationX(cameraLoc) , GetLocationY(cameraLoc)) + if ( dist >= bj_SMARTPAN_TRESHOLD_SNAP ) then + // If the user is too far away, snap the camera. + call PanCameraToTimed(x, y, 0) + elseif ( dist >= bj_SMARTPAN_TRESHOLD_PAN ) then + // If the user is moderately close, pan the camera. + call PanCameraToTimed(x, y, duration) + else + // User is close enough, so don't touch the camera. + endif + endif + call RemoveLocation(cameraLoc) +endfunction + + +//library CameraUtils ends +//library CargoLocationSystem: + +function GetUnitActualX takes unit whichUnit returns real + local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((whichUnit))))]) // INLINED!! + if ( transporter != null ) then + return GetUnitX(transporter) + endif + return GetUnitX(whichUnit) +endfunction + +function GetUnitActualY takes unit whichUnit returns real + local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((whichUnit))))]) // INLINED!! + if ( transporter != null ) then + return GetUnitY(transporter) + endif + return GetUnitY(whichUnit) +endfunction + + +//library CargoLocationSystem ends +//library Crafting: + + + +//processed: function interface CraftingRequirementCallback takes integer recipe, unit craftingUnit returns integer + + +function GetCraftingStockUpdateTimerHandleId takes nothing returns integer + return GetHandleId(Crafting__itemCraftingStockUpdateTimer) +endfunction + +function Crafting__Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer + return ( ( Value1 * MaxValue2 ) + Value2 ) +endfunction + +function GetRecipesMax takes nothing returns integer + return Crafting__recipesCounter +endfunction + +function GetRecipeItemTypeId takes integer recipe returns integer + return Crafting__recipesItemTypeIds[recipe] +endfunction + +function GetRecipeUIItemTypeId takes integer recipe returns integer + return Crafting__recipesUIItemTypeIds[recipe] +endfunction + +function AddRecipe takes integer itemTypeId,integer uiItemTypeId returns integer + local integer index= Crafting__recipesCounter + set Crafting__recipesItemTypeIds[index]=itemTypeId + set Crafting__recipesUIItemTypeIds[index]=uiItemTypeId + set Crafting__recipesIsUnit[index]=false + set Crafting__recipesIsSpacer[index]=false + set Crafting__recipesPageName[index]="" + set Crafting__recipesMinRequirements[index]=0 + set Crafting__recipesRequirementCounters[index]=0 + set Crafting__recipesCounter=Crafting__recipesCounter + 1 + set Crafting__lastCreatedRecipe=index + return index +endfunction + +function AddRecipeRequirementItem takes integer recipe,integer itemTypeId,integer charges,boolean consume returns integer + local integer counter= Crafting__recipesRequirementCounters[recipe] + local integer index= Crafting__Index2D(recipe , counter , Crafting_MAX_REQUIREMENTS) + set Crafting__recipesRequirementItemTypeIds[index]=itemTypeId + set Crafting__recipesRequirementCharges[index]=charges + set Crafting__recipesRequirementConsume[index]=consume + set Crafting__recipesRequirementCounters[recipe]=counter + 1 + set Crafting__recipesMinRequirements[recipe]=counter + 1 + return counter +endfunction + +function SetRecipeIsUnit takes integer recipe,boolean flag returns nothing + set Crafting__recipesIsUnit[recipe]=flag +endfunction + +function GetRecipeIsUnit takes integer recipe returns boolean + return Crafting__recipesIsUnit[recipe] +endfunction + +function SetRecipeIsSpacer takes integer recipe,boolean flag returns nothing + set Crafting__recipesIsSpacer[recipe]=flag +endfunction + +function GetRecipeIsSpacer takes integer recipe returns boolean + return Crafting__recipesIsSpacer[recipe] +endfunction + +function AddRecipeSpacer takes string pageName returns integer + local integer recipe= AddRecipe(0 , 0) + set Crafting__recipesIsSpacer[(recipe )]=( true) // INLINED!! + set Crafting__recipesPageName[recipe]=pageName + return recipe +endfunction + +function SetRecipePageName takes integer recipe,string pageName returns nothing + set Crafting__recipesPageName[recipe]=pageName +endfunction + +function GetRecipeNotAvailableForPlayer takes integer recipe,integer playerId returns boolean + local integer index= Crafting__Index2D(recipe , playerId , bj_MAX_PLAYERS) + return Crafting__recipesNotAvailableForPlayer[index] +endfunction + +function SetRecipeNotAvailableForPlayer takes integer recipe,integer playerId,boolean notAvailable returns nothing + local integer index= Crafting__Index2D(recipe , playerId , bj_MAX_PLAYERS) + set Crafting__recipesNotAvailableForPlayer[index]=notAvailable +endfunction + +function GetRecipeAvailableForPlayer takes integer recipe,integer playerId returns boolean + local integer index= Crafting__Index2D(recipe , playerId , bj_MAX_PLAYERS) + return not Crafting__recipesNotAvailableForPlayer[index] +endfunction + +function SetRecipeAvailableForPlayer takes integer recipe,integer playerId,boolean available returns nothing + local integer index= Crafting__Index2D(recipe , playerId , bj_MAX_PLAYERS) + set Crafting__recipesNotAvailableForPlayer[index]=not available +endfunction + +function GetLastCreatedRecipe takes nothing returns integer + return Crafting__lastCreatedRecipe +endfunction + +function SetLastRecipePageName takes string pageName returns nothing + set Crafting__recipesPageName[Crafting__lastCreatedRecipe]=pageName +endfunction + +function GetRecipeRequirementsCount takes integer recipe returns integer + return Crafting__recipesRequirementCounters[recipe] +endfunction + +function GetRecipeRequirementItemTypeId takes integer recipe,integer requirement returns integer + local integer index= Crafting__Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) + return Crafting__recipesRequirementItemTypeIds[index] +endfunction + +function GetRecipeRequirementCharges takes integer recipe,integer requirement returns integer + local integer index= Crafting__Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) + return Crafting__recipesRequirementCharges[index] +endfunction + +function GetRecipeRequirementConsume takes integer recipe,integer requirement returns boolean + local integer index= Crafting__Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) + return Crafting__recipesRequirementConsume[index] +endfunction + +function GetRecipeMinRequirements takes integer recipe returns integer + return Crafting__recipesMinRequirements[recipe] +endfunction + +function SetRecipeMinRequirements takes integer recipe,integer minRequirements returns nothing + set Crafting__recipesMinRequirements[recipe]=minRequirements +endfunction + +function SetRecipeRequirementCallback takes integer callback returns nothing + set Crafting__recipeRequirementCallback=callback +endfunction + +function SetRecipeRequirementCallbackTrigger takes trigger callback returns nothing + set Crafting__recipeRequirementCallbackTrigger=callback +endfunction + +function SetRecipeShowCallbackTrigger takes trigger callback returns nothing + set Crafting__recipeShowCallbackTrigger=callback +endfunction + +function TriggerRegisterItemCraftingEvent takes trigger whichTrigger returns integer + local integer counter= Crafting__craftingCallbackTriggersCounter + set Crafting__craftingCallbackTriggers[counter]=whichTrigger + set Crafting__craftingCallbackTriggersCounter=Crafting__craftingCallbackTriggersCounter + 1 + return counter +endfunction + +function TriggerRegisterUnitCraftingEvent takes trigger whichTrigger returns integer + local integer counter= Crafting__craftingCallbackUnitTriggersCounter + set Crafting__craftingCallbackUnitTriggers[counter]=whichTrigger + set Crafting__craftingCallbackUnitTriggersCounter=Crafting__craftingCallbackUnitTriggersCounter + 1 + return counter +endfunction + +function TriggerRegisterItemDisassembleEvent takes trigger whichTrigger returns integer + local integer counter= Crafting__disassembleCallbackTriggersCounter + set Crafting__disassembleCallbackTriggers[counter]=whichTrigger + set Crafting__disassembleCallbackTriggersCounter=Crafting__disassembleCallbackTriggersCounter + 1 + return counter +endfunction + +function GetTriggerRecipe takes nothing returns integer + return Crafting__triggerRecipe +endfunction + +function GetTriggerCraftingUnit takes nothing returns unit + return Crafting__triggerCraftingUnit +endfunction + +function GetTriggerCraftedItem takes nothing returns item + return Crafting__triggerCraftedItem +endfunction + +function GetTriggerCraftedUnit takes nothing returns unit + return Crafting__triggerCraftedUnit +endfunction + +function GetTriggerCraftedCharges takes nothing returns integer + return Crafting__triggerCraftedCharges +endfunction + +function Crafting__ExecuteCraftingCallbacks takes integer recipe,unit craftingUnit,item craftedItem returns nothing + local integer i= 0 + set Crafting__triggerRecipe=recipe + set Crafting__triggerCraftingUnit=craftingUnit + set Crafting__triggerCraftedItem=craftedItem + loop + exitwhen ( i == Crafting__craftingCallbackTriggersCounter ) + if ( IsTriggerEnabled(Crafting__craftingCallbackTriggers[i]) ) then + call ConditionalTriggerExecute(Crafting__craftingCallbackTriggers[i]) + endif + set i=i + 1 + endloop +endfunction + +function Crafting__ExecuteCraftingCallbacksUnit takes integer recipe,unit craftingUnit,unit craftedUnit returns nothing + local integer i= 0 + set Crafting__triggerRecipe=recipe + set Crafting__triggerCraftingUnit=craftingUnit + set Crafting__triggerCraftedUnit=craftedUnit + loop + exitwhen ( i == Crafting__craftingCallbackUnitTriggersCounter ) + if ( IsTriggerEnabled(Crafting__craftingCallbackUnitTriggers[i]) ) then + call ConditionalTriggerExecute(Crafting__craftingCallbackUnitTriggers[i]) + endif + set i=i + 1 + endloop +endfunction + +function Crafting__ExecuteDisassembleCallbacks takes integer recipe,unit craftingUnit,item craftedItem,unit craftedUnit returns nothing + local integer i= 0 + set Crafting__triggerRecipe=recipe + set Crafting__triggerCraftingUnit=craftingUnit + set Crafting__triggerCraftedItem=craftedItem + set Crafting__triggerCraftedUnit=craftedUnit + loop + exitwhen ( i == Crafting__disassembleCallbackTriggersCounter ) + if ( IsTriggerEnabled(Crafting__disassembleCallbackTriggers[i]) ) then + call ConditionalTriggerExecute(Crafting__disassembleCallbackTriggers[i]) + endif + set i=i + 1 + endloop +endfunction + +function GetRecipeByItemTypeId takes integer itemTypeId returns integer + local integer counter= Crafting__recipesCounter + local integer recipe= 0 + loop + exitwhen ( recipe == counter ) + if ( Crafting__recipesItemTypeIds[recipe] == itemTypeId ) then + return recipe + endif + set recipe=recipe + 1 + endloop + return - 1 +endfunction + +function Crafting__SetItemCraftingUnitGroup takes unit whichUnit,group whichGroup returns nothing + call SaveGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_GROUP, whichGroup) +endfunction + +function Crafting__GetItemCraftingUnitGroup takes unit whichUnit returns group + return LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_GROUP) +endfunction + +function IsItemCraftingRecipeEnabled takes unit whichUnit,integer recipe returns boolean + local integer counter= LoadInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES) + local integer disabledRecipe= 0 + local integer i= 0 + loop + exitwhen ( i >= counter ) + set disabledRecipe=LoadInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES + i) + if ( disabledRecipe == recipe ) then + return false + endif + set i=i + 1 + endloop + return true +endfunction + +function GetRecipeName takes integer recipe returns string + return GetObjectName(Crafting__recipesUIItemTypeIds[recipe]) +endfunction + +function Crafting__CheckRecipeRequirement takes integer recipe,integer requirement,unit whichUnit,integer craftedCharges returns integer + local integer index= Crafting__Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) + local integer requiredItemTypeId= Crafting__recipesRequirementItemTypeIds[index] + local integer requiredCharges= Crafting__recipesRequirementCharges[index] + local integer matchingCharges= 0 + local item slotItem= null + local integer i= 0 + local integer j= 0 + + if ( requiredItemTypeId != 0 ) then + //call BJDebugMsg("CheckRecipeRequirement for recipe " + GetRecipeName(recipe) + " with requirement item " + GetObjectName(requiredItemTypeId)) + + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(whichUnit, i) + if ( slotItem != null and GetItemTypeId(slotItem) == requiredItemTypeId ) then + // check the callback for each charge separately + set j=0 + loop + exitwhen ( j == IMaxBJ(GetItemCharges(slotItem), 1) ) + if ( Crafting__recipeRequirementCallbackTrigger != null ) then + set Crafting__triggerRecipe=recipe + set Crafting__triggerCraftingUnit=whichUnit + set Crafting__triggerCraftedItem=null + set Crafting__triggerCraftedCharges=craftedCharges + matchingCharges / requiredCharges + exitwhen ( not TriggerEvaluate(Crafting__recipeRequirementCallbackTrigger) ) + endif + set matchingCharges=matchingCharges + 1 + set j=j + 1 + endloop + + //call BJDebugMsg("CheckRecipeRequirement " + I2S(matchingCharges) + " for recipe " + GetRecipeName(recipe) + " with slot item " + GetItemName(slotItem)) + endif + + set slotItem=null + set i=i + 1 + endloop + //call BJDebugMsg("Checking recipe requirement for recipe " + GetRecipeName(recipe) + " with item type " + GetObjectName(requiredItemTypeId) + " and found charges: " + I2S(matchingCharges) + " resulting in " + I2S( matchingCharges / recipesRequirementCharges[index])) + return matchingCharges / requiredCharges + endif + + return 0 +endfunction + +function Crafting__ConsumeRecipeRequirement takes integer recipe,integer requirement,integer charges,unit whichUnit returns integer + local integer index= Crafting__Index2D(recipe , requirement , Crafting_MAX_REQUIREMENTS) + local integer requiredItemTypeId= Crafting__recipesRequirementItemTypeIds[index] + local integer matchingCharges= 0 + local integer reducedCharges= 0 + local item slotItem= null + local integer i= 0 + local group whichGroup= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + local integer j= 0 + local unit groupUnit= null + if ( requiredItemTypeId != 0 ) then + set j=0 + loop + exitwhen ( j >= BlzGroupGetSize(whichGroup) ) + set groupUnit=BlzGroupUnitAt(whichGroup, j) + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(groupUnit, i) + if ( slotItem != null and GetItemTypeId(slotItem) == requiredItemTypeId ) then + set reducedCharges=charges * Crafting__recipesRequirementCharges[index] + set matchingCharges=matchingCharges + reducedCharges + //call BJDebugMsg("Consuming " + I2S(reducedCharges) + " of item " + GetItemName(slotItem) + " from unit " + GetUnitName(groupUnit) + ".") + set reducedCharges=GetItemCharges(slotItem) - reducedCharges + if ( reducedCharges > 0 ) then + call SetItemCharges(slotItem, reducedCharges) + else + call h__RemoveItem(slotItem) + endif + endif + set i=i + 1 + endloop + set groupUnit=null + set j=j + 1 + endloop + endif + + set whichGroup=null + + return reducedCharges +endfunction + +function Crafting__CheckRecipeRequirements takes integer recipe,unit whichUnit returns integer + local integer requirementCheckCounter= 0 + local integer result= 0 + local boolean initResult= false + local integer matchingRequirements= 0 + local integer minRequirements= Crafting__recipesMinRequirements[recipe] + local integer counter= Crafting__recipesRequirementCounters[recipe] + local integer i= 0 + local group whichGroup= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + local player owner= GetOwningPlayer(whichUnit) + local integer j= 0 + + if ( Crafting__recipeRequirementCallback != 0 ) then + set result=sc___prototype356_evaluate(Crafting__recipeRequirementCallback,recipe , whichUnit) + endif + + loop + exitwhen ( i >= counter or matchingRequirements >= minRequirements ) + set j=0 + loop + exitwhen ( j >= BlzGroupGetSize(whichGroup) or matchingRequirements >= minRequirements ) + set requirementCheckCounter=Crafting__CheckRecipeRequirement(recipe , i , BlzGroupUnitAt(whichGroup, j) , result) + + if ( requirementCheckCounter > 0 ) then + // TODO What if there is yet another requirement which has more charges? + set matchingRequirements=matchingRequirements + 1 + if ( not initResult ) then // initially result is 0 + set result=requirementCheckCounter + else + set result=IMinBJ(result, requirementCheckCounter) + endif + + //call BJDebugMsg("Checking recipe requirement for recipe " + GetRecipeName(recipe) + " and found charges: " + I2S(requirementCheckCounter) + " resulting in requirements matching " + I2S(matchingRequirements)) + endif + //call BJDebugMsg("Result: " + I2S(result)) + set j=j + 1 + endloop + set i=i + 1 + endloop + set whichGroup=null + + // food check + if ( (Crafting__recipesIsUnit[(recipe)]) ) then // INLINED!! + set result=IMinBJ(( GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_CAP) - GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_USED) ) / GetFoodUsed(Crafting__recipesItemTypeIds[recipe]), result) + endif + + set owner=null + + // make sure that it matches at least the number of minimum requirements is reached + if ( matchingRequirements >= minRequirements ) then + return result + endif + + return 0 +endfunction + +function Crafting__ConsumeRecipeRequirements takes integer recipe,integer charges,unit whichUnit returns integer + local integer result= 0 + local integer counter= Crafting__recipesRequirementCounters[recipe] + local integer matchingRequirements= 0 + local integer minRequirements= Crafting__recipesMinRequirements[recipe] + local integer consumedRequirements= 0 + local boolean consume= false + local integer i= 0 + loop + exitwhen ( i == counter or matchingRequirements >= minRequirements ) + set consume=GetRecipeRequirementConsume(recipe , i) + if ( consume ) then + set consumedRequirements=Crafting__ConsumeRecipeRequirement(recipe , i , charges , whichUnit) + set result=result + consumedRequirements + endif + if ( consumedRequirements > 0 or not consume ) then + set matchingRequirements=matchingRequirements + 1 + endif + set i=i + 1 + endloop + return result +endfunction + +function GetRecipeByUIItemTypeId takes integer uIItemTypeId returns integer + local integer counter= Crafting__recipesCounter + local integer recipe= 0 + loop + exitwhen ( recipe == counter ) + if ( Crafting__recipesUIItemTypeIds[recipe] == uIItemTypeId ) then + return recipe + endif + set recipe=recipe + 1 + endloop + return - 1 +endfunction + +function Crafting__CheckAllRecipesRequirementsForPageEx takes unit whichUnit,integer page returns integer + local integer result= 0 + local integer requirementCheckCounter= 0 + local integer startSlot= page * Crafting_MAX_SLOTS + local integer maxSlot= startSlot + Crafting_MAX_SLOTS + local integer slot= startSlot + local integer recipe= 0 + local group whichGroup= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + local integer j= 0 + local unit groupUnit= null + //call BJDebugMsg("Checking " + I2S(counter) + " recipes for unit " + GetUnitName(whichUnit) + " at page " + I2S(page) + " with " + I2S(recipesPerPage) + " recipes per page.") + loop + exitwhen ( slot >= maxSlot ) + if ( not (sg__PagedButtons_Type_get_whichType(GetPagedButton((whichUnit ) , ( slot))) == PagedButtons_BUTTON_TYPE_SPACER) ) then // INLINED!! + set recipe=GetRecipeByUIItemTypeId(GetPagedButtonId(whichUnit , slot)) + if ( recipe != - 1 ) then + set requirementCheckCounter=Crafting__CheckRecipeRequirements(recipe , whichUnit) + //call BJDebugMsg("Get requirement counter " + I2S(requirementCheckCounter) + " and group size " + I2S(BlzGroupGetSize(whichGroup))) + set j=0 + loop + exitwhen ( j >= BlzGroupGetSize(whichGroup) ) + set groupUnit=BlzGroupUnitAt(whichGroup, j) + if ( IsItemCraftingRecipeEnabled(groupUnit , recipe) ) then + //call BJDebugMsg("Item crafting is enabled." ) + if ( requirementCheckCounter > 0 ) then + set result=result + 1 + + //call BJDebugMsg("Adding UI item type " + GetObjectName(recipesUIItemTypeIds[recipe]) + " to unit " + GetUnitName(groupUnit)) + call RemoveItemFromStock(groupUnit, Crafting__recipesUIItemTypeIds[recipe]) + //call BJDebugMsg("Crafted item: " + GetObjectName(recipesUIItemTypeIds[recipe]) + " with stock " + I2S(requirementCheckCounter)) + // Even although this is 2 it becomes like 1 or something by the paged buttons system? + call AddItemToStock(groupUnit, Crafting__recipesUIItemTypeIds[recipe], requirementCheckCounter, requirementCheckCounter) + else + //call BJDebugMsg("Removing UI item type " + GetObjectName(recipesUIItemTypeIds[recipe]) + " from unit " + GetUnitName(groupUnit)) + call RemoveItemFromStock(groupUnit, Crafting__recipesUIItemTypeIds[recipe]) + call AddItemToStock(groupUnit, Crafting__recipesUIItemTypeIds[recipe], 0, 1) + endif + //else + //call BJDebugMsg("Item crafting is disabled." ) + else + call SimError(GetOwningPlayer(whichUnit) , "Recipe " + (GetObjectName(Crafting__recipesUIItemTypeIds[(recipe)])) + " is disabled.") // INLINED!! + endif + set groupUnit=null + set j=j + 1 + endloop + endif + endif + set slot=slot + 1 + endloop + set whichGroup=null + return result +endfunction + + +function Crafting__CheckAllRecipesRequirementsForPageNewOpLimit takes nothing returns nothing + call Crafting__CheckAllRecipesRequirementsForPageEx(Crafting__tmpUnit , Crafting__tmpInteger0) +endfunction + +function Crafting__CheckAllRecipesRequirementsForPage takes unit whichUnit,integer page returns nothing + set Crafting__tmpUnit=whichUnit + set Crafting__tmpInteger0=page + call ForForce(bj_FORCE_PLAYER[0], (function Crafting__CheckAllRecipesRequirementsForPageNewOpLimit)) // INLINED!! +endfunction + +function Crafting__UpdateStocks takes unit whichUnit returns nothing + call Crafting__CheckAllRecipesRequirementsForPage(whichUnit , GetPagedButtonsPage(whichUnit)) +endfunction + +function Crafting__ClearItemCraftingUnit takes unit whichUnit returns nothing + local group whichGroup= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + if ( whichGroup != null ) then + call GroupRemoveUnit(whichGroup, whichUnit) + if ( BlzGroupGetSize(whichGroup) == 0 ) then + call GroupClear(whichGroup) + call DestroyGroup(whichGroup) + endif + set whichGroup=null + endif + + call FlushChildHashtable(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit)) +endfunction + +function SetItemCraftingRecipeEnabled takes unit whichUnit,integer recipe,boolean enabled returns nothing + local integer page= GetPagedButtonsPage(whichUnit) + local integer counter= LoadInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES) + local integer disabledRecipe= 0 + local boolean found= false + local integer i= 0 + if ( enabled ) then + loop + exitwhen ( i >= counter ) + set disabledRecipe=LoadInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES + i) + if ( found == true ) then + call SaveInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES + i - 1, disabledRecipe) + endif + if ( disabledRecipe == recipe ) then + set found=true + endif + set i=i + 1 + endloop + if ( found ) then + call SaveInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES, counter - 1) + endif + else + loop + exitwhen ( i >= counter ) + set disabledRecipe=LoadInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES + i) + if ( disabledRecipe == recipe ) then + set found=true + endif + set i=i + 1 + endloop + if ( not found ) then + call SaveInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES + counter, recipe) + call SaveInteger(Crafting__itemCraftingUnitsHashTable, GetHandleId(whichUnit), Crafting__HASHTABLE_KEY_DISABLED_RECIPES, counter + 1) + endif + endif + call Crafting__CheckAllRecipesRequirementsForPage(whichUnit , page) +endfunction + +function CraftItem takes item soldItem,unit sellingUnit,unit buyingUnit returns item + local integer page= GetPagedButtonsPage(sellingUnit) + local integer soldItemTypeId= GetItemTypeId(soldItem) + local player owner= GetOwningPlayer(sellingUnit) + local player ownerBuying= GetOwningPlayer(buyingUnit) + local integer playerIdBuying= GetPlayerId(ownerBuying) + local integer charges= 0 + local integer chargesWithFoodLimit= 0 + local integer availableFood= 0 + local item craftedItem= null + local unit craftedUnit= null + local item array additionalCraftedItems + local integer additionalCraftedItemsCounter= 0 + local integer counter= Crafting__recipesCounter + local integer j= 0 + local integer recipe= 0 + loop + exitwhen ( recipe >= counter and craftedItem != null ) + if ( not (Crafting__recipesIsSpacer[(recipe)]) and Crafting__recipesUIItemTypeIds[recipe] == soldItemTypeId ) then // INLINED!! + if ( GetRecipeAvailableForPlayer(recipe , playerIdBuying) ) then + set charges=Crafting__CheckRecipeRequirements(recipe , sellingUnit) + if ( charges > 0 ) then + call h__RemoveItem(soldItem) + set soldItem=null + + if ( (Crafting__recipesIsUnit[(recipe)]) ) then // INLINED!! + set availableFood=GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_CAP) - GetPlayerState(owner, PLAYER_STATE_RESOURCE_FOOD_USED) + set chargesWithFoodLimit=availableFood / GetFoodUsed(Crafting__recipesItemTypeIds[recipe]) + set chargesWithFoodLimit=IMinBJ(chargesWithFoodLimit, charges) + if ( chargesWithFoodLimit > 0 ) then + if ( chargesWithFoodLimit < charges ) then + call SimError(owner , "Can only summon " + I2S(chargesWithFoodLimit) + " creatures due to food limit.") + endif + + set j=0 + loop + exitwhen ( j >= chargesWithFoodLimit ) + set craftedUnit=CreateUnit(owner, Crafting__recipesItemTypeIds[recipe], GetUnitX(sellingUnit), GetUnitY(sellingUnit), GetUnitFacing(sellingUnit)) + call Crafting__ExecuteCraftingCallbacksUnit(recipe , sellingUnit , craftedUnit) + set j=j + 1 + endloop + + call Crafting__ConsumeRecipeRequirements(recipe , chargesWithFoodLimit , sellingUnit) + else + call SimError(owner , "Not enough food to summon any creature.") + endif + else + set craftedItem=CreateItem(Crafting__recipesItemTypeIds[recipe], GetUnitX(sellingUnit), GetUnitY(sellingUnit)) + + if ( GetItemCharges(craftedItem) > 0 ) then + call SetItemCharges(craftedItem, charges) + call Crafting__ExecuteCraftingCallbacks(recipe , sellingUnit , craftedItem) + // create non charged items separately + else + call Crafting__ExecuteCraftingCallbacks(recipe , sellingUnit , craftedItem) + + set j=1 + loop + exitwhen ( j >= charges ) + set craftedItem=CreateItem(Crafting__recipesItemTypeIds[recipe], GetUnitX(sellingUnit), GetUnitY(sellingUnit)) + call Crafting__ExecuteCraftingCallbacks(recipe , sellingUnit , craftedItem) + set additionalCraftedItems[additionalCraftedItemsCounter]=craftedItem + set additionalCraftedItemsCounter=additionalCraftedItemsCounter + 1 + set j=j + 1 + endloop + endif + + call Crafting__ConsumeRecipeRequirements(recipe , charges , sellingUnit) + + // add item after callbacks since it might lead to stacking and the crafted item may become null + // call ite also after consuming requirements since the inventory might have more slots now + call UnitAddItem(sellingUnit, craftedItem) + set j=0 + loop + exitwhen ( j >= additionalCraftedItemsCounter ) + call UnitAddItem(sellingUnit, additionalCraftedItems[j]) // TODO Drops the item next to the crafting unit. + set j=j + 1 + endloop + + endif + endif + else + call SimError(ownerBuying , "Recipe is not available for you.") + endif + endif + set recipe=recipe + 1 + endloop + call Crafting__CheckAllRecipesRequirementsForPage(sellingUnit , page) // update all stocks but after crafting something we might need some delay to update stocks. + set owner=null + set ownerBuying=null + return craftedItem +endfunction + +function Crafting__ForGroupUpdateStocks takes nothing returns nothing + call Crafting__UpdateStocks(GetEnumUnit()) +endfunction + +function Crafting__UpdateAllStocks takes nothing returns nothing + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) +endfunction + +function Crafting__TimerFunctionUpdateItemCraftingStocks takes nothing returns nothing + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) // INLINED!! +endfunction + +function Crafting__ShowRecipeForUnit takes integer recipe,unit whichUnit returns boolean + if ( Crafting__recipeShowCallbackTrigger != null and IsTriggerEnabled(Crafting__recipeShowCallbackTrigger) ) then + set Crafting__triggerRecipe=recipe + set Crafting__triggerCraftingUnit=whichUnit + return TriggerEvaluate(Crafting__recipeShowCallbackTrigger) + endif + return true +endfunction + +function EnableItemCraftingUnit takes unit whichUnit returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(whichUnit)) + local integer i= 0 + local integer index= 0 + local group whichGroup= CreateGroup() + call GroupAddUnit(whichGroup, whichUnit) + call GroupAddUnit(Crafting__itemCraftingUnits, whichUnit) + call SaveGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit )), Crafting__HASHTABLE_KEY_GROUP, ( whichGroup)) // INLINED!! + //call BJDebugMsg("Enable crafting for unit " + GetUnitName(whichUnit)) + call EnablePagedButtons(whichUnit) + call SetPagedButtonsSlotsPerPage(whichUnit , Crafting_MAX_SLOTS) + set i=0 + loop + exitwhen ( i == Crafting__recipesCounter ) + //call BJDebugMsg("Recipe " + I2S(i) + ": " + GetObjectName(recipesUIItemTypeIds[i])) + if ( GetRecipeAvailableForPlayer(i , playerId) and Crafting__ShowRecipeForUnit(i , whichUnit) ) then + if ( Crafting__recipesIsSpacer[i] ) then + call SetPagedButtonsCurrentPageName(whichUnit , Crafting__recipesPageName[i]) + call AddPagedButtonsSpacersRemaining(whichUnit) + else + if ( Crafting__recipesPageName[i] != null and StringLength(Crafting__recipesPageName[i]) > 0 ) then + call SetPagedButtonsCurrentPageName(whichUnit , Crafting__recipesPageName[i]) + endif + set index=(AddPagedButtonsId((whichUnit ) , ( Crafting__recipesUIItemTypeIds[i]) , PagedButtons_BUTTON_TYPE_ITEM)) // INLINED!! + call sg__PagedButtons_SlotType_set_replenish((GetPagedButton(whichUnit , index)),false) // prevents auto replenish + endif + endif + set i=i + 1 + endloop + //call CheckAllRecipesRequirementsForPage(whichUnit, 0, PagedButtonsSystem_SLOTS_PER_PAGE) + + if ( BlzGroupGetSize(Crafting__itemCraftingUnits) == 1 ) then + // This timer is required since we can only set the maximum time to 3600 seconds. + call TimerStart(Crafting__itemCraftingStockUpdateTimer, Crafting_UPDATE_INTERVAL, true, function Crafting__TimerFunctionUpdateItemCraftingStocks) + endif +endfunction + +function DisableItemCraftingUnit takes unit whichUnit returns nothing + call GroupRemoveUnit(Crafting__itemCraftingUnits, whichUnit) + call DisablePagedButtons(whichUnit) + + call Crafting__ClearItemCraftingUnit(whichUnit) + + if ( BlzGroupGetSize(Crafting__itemCraftingUnits) == 0 ) then + call PauseTimer(Crafting__itemCraftingStockUpdateTimer) + endif +endfunction + +function IsItemCraftingUnitEnabled takes unit whichUnit returns boolean + return IsUnitInGroup(whichUnit, Crafting__itemCraftingUnits) +endfunction + +function LinkItemCraftingUnitInventories takes unit whichUnit0,unit whichUnit1 returns group + local group whichGroup0= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit0)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + local group whichGroup1= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit1)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + local integer i= 0 + + if ( whichGroup0 == null ) then + set whichGroup0=CreateGroup() + call GroupAddUnit(whichGroup0, whichUnit0) + endif + + if ( whichGroup1 == null ) then + set whichGroup1=CreateGroup() + call GroupAddUnit(whichGroup1, whichUnit1) + endif + + if ( whichGroup0 != null and whichGroup1 != null ) then + call GroupAddGroup(whichGroup1, whichGroup0) + + set i=0 + loop + exitwhen ( i == BlzGroupGetSize(whichGroup0) ) + call SaveGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((BlzGroupUnitAt(whichGroup0, i) )), Crafting__HASHTABLE_KEY_GROUP, ( whichGroup0)) // INLINED!! + set i=i + 1 + endloop + call GroupClear(whichGroup1) + call DestroyGroup(whichGroup1) + set whichGroup1=null + endif + + call Crafting__UpdateStocks(whichUnit0) + call Crafting__UpdateStocks(whichUnit1) + + return whichGroup0 +endfunction + +function LinkItemCraftingGroupInventories takes group source returns group + local unit first= FirstOfGroup(source) + local integer i= 1 + if ( first != null ) then + loop + exitwhen ( i == BlzGroupGetSize(source) ) + call LinkItemCraftingUnitInventories(BlzGroupUnitAt(source, i) , first) + set i=i + 1 + endloop + set first=null + return (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((first)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + endif + return null +endfunction + +function UnlinkItemCraftingUnitInventories takes unit whichUnit0,unit whichUnit1 returns group + local group whichGroup0= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit0)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + local group whichGroup1= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit1)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + + if ( whichGroup0 != null ) then + call GroupRemoveUnit(whichGroup0, whichUnit1) + endif + + if ( whichGroup1 != null and IsUnitInGroup(whichUnit1, whichGroup1) ) then + call GroupRemoveUnit(whichGroup1, whichUnit1) + if ( BlzGroupGetSize(whichGroup1) == 0 ) then + call GroupClear(whichGroup1) + call DestroyGroup(whichGroup1) + set whichGroup1=null + endif + endif + + set whichGroup1=CreateGroup() + call GroupAddUnit(whichGroup1, whichUnit1) + + call SaveGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit1 )), Crafting__HASHTABLE_KEY_GROUP, ( whichGroup1)) // INLINED!! + + call Crafting__UpdateStocks(whichUnit0) + call Crafting__UpdateStocks(whichUnit1) + + return whichGroup1 +endfunction + +function ItemCraftingUnitInventoriesAreLinked takes unit whichUnit0,unit whichUnit1 returns boolean + local group whichGroup0= (LoadGroupHandle(Crafting__itemCraftingUnitsHashTable, GetHandleId((whichUnit0)), Crafting__HASHTABLE_KEY_GROUP)) // INLINED!! + + return IsUnitInGroup(whichUnit1, whichGroup0) +endfunction + +function Crafting__TriggerConditionIsItemCraftingUnitEnabled takes nothing returns boolean + return (IsUnitInGroup((GetTriggerUnit()), Crafting__itemCraftingUnits)) // INLINED!! +endfunction + +function Crafting__TriggerActionCheckAllRecipesRequirements takes nothing returns nothing + //call BJDebugMsg("Crafter " + GetUnitName(GetTriggerUnit()) + " picks up or drops an item.") + call Crafting__UpdateStocks(GetTriggerUnit()) +endfunction + +function Crafting__TriggerActionCheckAllRecipesRequirementsDelayed takes nothing returns nothing + //call BJDebugMsg("Crafter " + GetUnitName(GetTriggerUnit()) + " picks up or drops an item.") + local unit triggerUnit= GetTriggerUnit() + call TriggerSleepAction(0.0) // wait until item has been dropped + call Crafting__UpdateStocks(triggerUnit) + set triggerUnit=null +endfunction + +function Crafting__TriggerActionCraftItem takes nothing returns nothing + local unit shop= GetSellingUnit() + call CraftItem(GetSoldItem() , shop , GetBuyingUnit()) + call TriggerSleepAction(0.0) // wait until we can refresh the stock + call Crafting__UpdateStocks(shop) + set shop=null +endfunction + +function Crafting__TriggerConditionDisassemble takes nothing returns boolean + return GetSpellAbilityId() == Crafting_DISASSEMBLE_ABILITY_ID +endfunction + +function DisassembleItem takes item soldItem,unit sellingUnit returns integer + local integer recipe= GetRecipeByItemTypeId(GetItemTypeId(soldItem)) + local integer i= 0 + local integer max= 0 + local integer count= IMaxBJ(GetItemCharges(soldItem), 1) + local integer charges= 0 + local item requirement= null + local integer minRequirements= 0 + local integer result= 0 + + if ( recipe != - 1 ) then + call Crafting__ExecuteDisassembleCallbacks(recipe , sellingUnit , soldItem , null) + call h__RemoveItem(soldItem) + set soldItem=null + set i=0 + set max=(Crafting__recipesRequirementCounters[(recipe)]) // INLINED!! + set minRequirements=(Crafting__recipesMinRequirements[(recipe)]) // INLINED!! + loop + exitwhen ( i == max or ( minRequirements > 0 and i > minRequirements ) ) + set requirement=CreateItem(GetRecipeRequirementItemTypeId(recipe , i), GetUnitX(sellingUnit), GetUnitY(sellingUnit)) + set charges=GetRecipeRequirementCharges(recipe , i) * count + if ( GetItemCharges(requirement) > 0 or charges > 1 ) then + call SetItemCharges(requirement, charges) + endif + call UnitAddItem(sellingUnit, requirement) + set result=result + charges + set i=i + 1 + endloop + endif + + return result +endfunction + +function DisassembleUnit takes unit target,unit sellingUnit returns integer + local integer recipe= GetRecipeByItemTypeId(GetUnitTypeId(target)) + local integer i= 0 + local integer max= 0 + local integer count= 1 + local integer charges= 0 + local item requirement= null + local integer minRequirements= 0 + local integer result= 0 + + if ( recipe != - 1 ) then + call Crafting__ExecuteDisassembleCallbacks(recipe , sellingUnit , null , target) + call h__RemoveUnit(target) + set target=null + set i=0 + set max=(Crafting__recipesRequirementCounters[(recipe)]) // INLINED!! + set minRequirements=(Crafting__recipesMinRequirements[(recipe)]) // INLINED!! + loop + exitwhen ( i == max or ( minRequirements > 0 and i > minRequirements ) ) + set requirement=CreateItem(GetRecipeRequirementItemTypeId(recipe , i), GetUnitX(sellingUnit), GetUnitY(sellingUnit)) + set charges=GetRecipeRequirementCharges(recipe , i) * count + if ( GetItemCharges(requirement) > 0 or charges > 1 ) then + call SetItemCharges(requirement, charges) + endif + call UnitAddItem(sellingUnit, requirement) + set result=result + charges + set i=i + 1 + endloop + endif + + return result +endfunction + +function Crafting__TriggerActionDisassembleItem takes nothing returns nothing + local unit sellingUnit= GetTriggerUnit() + local unit target= GetSpellTargetUnit() + local item targetItem= GetSpellTargetItem() + local item slotItem= null + local integer counter= 0 + local integer i= 0 + if ( target != null ) then + if ( (IsUnitInGroup((target), Crafting__itemCraftingUnits)) and GetOwningPlayer(sellingUnit) == GetOwningPlayer(target) ) then // INLINED!! + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(sellingUnit, i) + if ( slotItem != null ) then + set counter=counter + DisassembleItem(slotItem , sellingUnit) + endif + set slotItem=null + set i=i + 1 + endloop + if ( counter == 0 ) then + call SimError(GetOwningPlayer(sellingUnit) , "No items to disassemble.") + endif + else + set counter=DisassembleUnit(target , sellingUnit) + if ( counter == 0 ) then + call SimError(GetOwningPlayer(sellingUnit) , "Unit can not be disassembled.") + endif + endif + elseif ( targetItem != null ) then + set counter=DisassembleItem(targetItem , sellingUnit) + if ( counter == 0 ) then + call SimError(GetOwningPlayer(sellingUnit) , "Item cannot be disassembled.") + endif + endif + set sellingUnit=null + set target=null + set targetItem=null +endfunction + +function Crafting__TriggerConditionChangePage takes nothing returns boolean + return (IsUnitInGroup(((PagedButtons__triggerShop)), Crafting__itemCraftingUnits)) // INLINED!! +endfunction + +function Crafting__TriggerActionChangePage takes nothing returns nothing + call Crafting__UpdateStocks((PagedButtons__triggerShop)) // INLINED!! +endfunction + +function Crafting__TriggerConditionTrainStart takes nothing returns boolean + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) // INLINED!! + return false +endfunction + +function Crafting__TriggerConditionTrainCancel takes nothing returns boolean + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) // INLINED!! + return false +endfunction + +function Crafting__TriggerConditionReviveStart takes nothing returns boolean + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) // INLINED!! + return false +endfunction + +function Crafting__TriggerConditionReviveCancel takes nothing returns boolean + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) // INLINED!! + return false +endfunction + +function Crafting__TriggerConditionSell takes nothing returns boolean + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) // INLINED!! + return false +endfunction + +function Crafting__TriggerConditionDeath takes nothing returns boolean + call ForGroup(Crafting__itemCraftingUnits, function Crafting__ForGroupUpdateStocks) // INLINED!! + return false +endfunction + +function Crafting__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Crafting__pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) + call TriggerAddCondition(Crafting__pickupTrigger, Condition(function Crafting__TriggerConditionIsItemCraftingUnitEnabled)) + call TriggerAddAction(Crafting__pickupTrigger, function Crafting__TriggerActionCheckAllRecipesRequirements) + + call TriggerRegisterAnyUnitEventBJ(Crafting__dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) + call TriggerAddCondition(Crafting__dropTrigger, Condition(function Crafting__TriggerConditionIsItemCraftingUnitEnabled)) + call TriggerAddAction(Crafting__dropTrigger, function Crafting__TriggerActionCheckAllRecipesRequirementsDelayed) + + call TriggerRegisterAnyUnitEventBJ(Crafting__itemCraftTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(Crafting__itemCraftTrigger, Condition(function Crafting__TriggerConditionIsItemCraftingUnitEnabled)) + call TriggerAddAction(Crafting__itemCraftTrigger, function Crafting__TriggerActionCraftItem) + + call TriggerRegisterAnyUnitEventBJ(Crafting__itemDisassembleTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(Crafting__itemDisassembleTrigger, Condition(function Crafting__TriggerConditionDisassemble)) + call TriggerAddAction(Crafting__itemDisassembleTrigger, function Crafting__TriggerActionDisassembleItem) + + call TriggerRegisterChangePagedButtons(Crafting__itemCraftingChangePageTrigger) + call TriggerAddCondition(Crafting__itemCraftingChangePageTrigger, Condition(function Crafting__TriggerConditionChangePage)) + call TriggerAddAction(Crafting__itemCraftingChangePageTrigger, function Crafting__TriggerActionChangePage) + + // update food available + call TriggerRegisterAnyUnitEventBJ(Crafting__trainStartTrigger, EVENT_PLAYER_UNIT_TRAIN_START) + call TriggerAddCondition(Crafting__trainStartTrigger, Condition(function Crafting__TriggerConditionTrainStart)) + + call TriggerRegisterAnyUnitEventBJ(Crafting__trainCancelTrigger, EVENT_PLAYER_UNIT_TRAIN_CANCEL) + call TriggerAddCondition(Crafting__trainCancelTrigger, Condition(function Crafting__TriggerConditionTrainCancel)) + + call TriggerRegisterAnyUnitEventBJ(Crafting__reviveStartTrigger, EVENT_PLAYER_HERO_REVIVE_START) + call TriggerAddCondition(Crafting__reviveStartTrigger, Condition(function Crafting__TriggerConditionReviveStart)) + + call TriggerRegisterAnyUnitEventBJ(Crafting__reviveCancelTrigger, EVENT_PLAYER_HERO_REVIVE_CANCEL) + call TriggerAddCondition(Crafting__reviveCancelTrigger, Condition(function Crafting__TriggerConditionReviveCancel)) + + call TriggerRegisterAnyUnitEventBJ(Crafting__sellTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(Crafting__sellTrigger, Condition(function Crafting__TriggerConditionSell)) + + call TriggerRegisterAnyUnitEventBJ(Crafting__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(Crafting__deathTrigger, Condition(function Crafting__TriggerConditionDeath)) +endfunction + + +//library Crafting ends +//library CriticalStrike: + + // CriticalStrike implements an easy way to register and detect a custom critical event. + // allows the manipulation of a unit critical strike chance and multiplier, as well as + // manipulating the critical damage dealt. + + // It works by monitoring custom critical strike chance and multiplier values given to units. + + // It will only detect custom critical strikes, so all critical chance given to a + // unit must be done so using the public API provided by this system. + + // *CriticalStrike requires DamageInterface. Do not use TriggerSleepAction() with Evasion. + // It also requires optional Evasion so that this library is written after the Evasion + // library, so both custom events will not fire at the same time. + + // The API: + // function RegisterCriticalStrikeEvent(function YourFunction) + // -> YourFunction will run when a unit hits a critical strike. + + // function GetCriticalSource takes nothing returns unit + // -> Returns the unit hitting a critical strike. + + // function GetCriticalTarget takes nothing returns unit + // -> Returns the unit being hit by a critical strike. + + // function GetCriticalDamage takes nothing returns real + // -> Returns the critical strike damage amount. + + // function GetUnitCriticalChance takes unit u returns real + // -> Returns the chance to hit a critical strike to specified unit. + + // function GetUnitCriticalMultiplier takes unit u returns real + // -> Returns the chance to hit a critical strike to specified unit. + + // function SetUnitCriticalChance takes unit u, real value returns nothing + // -> Set's the unit chance to hit a critical strike to specified value. + // -> 15.0 = 15% + + // function SetUnitCriticalMultiplier takes unit u, real value returns nothing + // -> Set's the unit multiplier of damage when hitting a critical to value + // -> 1.0 = increases the multiplier by 1. all units have a multiplier of 1.0 + // by default, so by adding 1.0, for example, the critical damage will be + // 2x the normal damage + + // function SetCriticalEventDamage takes real newValue returns nothing + // -> Modify the critical damage dealt to the specified value. + + // function UnitAddCriticalStrike takes unit u, real chance, real multiplier returns nothing + // -> Adds the specified values of chance and multiplier to a unit + + + + + + function s__Critical_getChance takes unit u returns real + return s__Critical_chance[GetUnitUserData(u)] + endfunction + + function s__Critical_getMultiplier takes unit u returns real + return s__Critical_multiplier[GetUnitUserData(u)] + endfunction + + function s__Critical_setChance takes unit u,real value returns nothing + set s__Critical_chance[GetUnitUserData(u)]=value + endfunction + + function s__Critical_setMultiplier takes unit u,real value returns nothing + set s__Critical_multiplier[GetUnitUserData(u)]=value + endfunction + + function s__Critical_add takes unit u,real chance,real multuplier returns nothing + set s__Critical_chance[GetUnitUserData((u ))]=(( (s__Critical_chance[GetUnitUserData((u))]) + chance)*1.0) // INLINED!! + set s__Critical_multiplier[GetUnitUserData((u ))]=(( (s__Critical_multiplier[GetUnitUserData((u))]) + multuplier)*1.0) // INLINED!! + endfunction + + function s__Critical_text takes unit whichUnit,string text,real duration,integer red,integer green,integer blue,integer alpha returns nothing + local texttag tx= CreateTextTag() + + call h__SetTextTagText(tx, text, s__Critical_TEXT_SIZE) + call SetTextTagPosUnit(tx, whichUnit, 0) + call SetTextTagColor(tx, red, green, blue, alpha) + call SetTextTagLifespan(tx, duration) + call SetTextTagVelocity(tx, 0.0, 0.0355) + call h__SetTextTagPermanent(tx, false) + + set tx=null + endfunction + + function s__Critical_onDamage takes nothing returns nothing + local real amount= GetEventDamage() + + if amount > 0 and GetRandomReal(0, 100) <= s__Critical_chance[s__Unit_id[s__Damage_source]] and s__Damage_isEnemy and not s__Unit_isStructure[s__Damage_target] and s__Critical_multiplier[s__Unit_id[s__Damage_source]] > 0 then + set s__Critical_source=s__Damage_source + set s__Critical_target=s__Damage_target + set s__Critical_damage=amount * ( 1 + s__Critical_multiplier[s__Unit_id[s__Damage_source]] ) + + call TriggerEvaluate(s__Critical_trigger) + call BlzSetEventDamage(s__Critical_damage) + if s__Critical_damage > 0 then + call s__Critical_text(s__Unit_unit[s__Critical_target] , ( I2S(R2I(s__Critical_damage)) + "!" ) , 1.5 , 255 , 0 , 0 , 255) + endif + + set s__Critical_damage=0 + set s__Critical_source=0 + set s__Critical_target=0 + endif + endfunction + + function s__Critical_register takes code c returns nothing + call TriggerAddCondition(s__Critical_trigger, Filter(c)) + endfunction + + function s__Critical_onInit takes nothing returns nothing + call s__Damage_register(null , DAMAGE_TYPE_NORMAL , (function s__Critical_onDamage) , true) // INLINED!! + endfunction + + + + + function RegisterCriticalStrikeEvent takes code c returns nothing + call TriggerAddCondition(s__Critical_trigger, Filter((c))) // INLINED!! + endfunction + + function GetCriticalSource takes nothing returns unit + return s__Unit_unit[s__Critical_source] + endfunction + + function GetCriticalTarget takes nothing returns unit + return s__Unit_unit[s__Critical_target] + endfunction + + function GetCriticalDamage takes nothing returns real + return s__Critical_damage + endfunction + + function GetUnitCriticalChance takes unit u returns real + return (s__Critical_chance[GetUnitUserData((u))]) // INLINED!! + endfunction + + function GetUnitCriticalMultiplier takes unit u returns real + return (s__Critical_multiplier[GetUnitUserData((u))]) // INLINED!! + endfunction + + function SetUnitCriticalChance takes unit u,real value returns nothing + set s__Critical_chance[GetUnitUserData((u ))]=(( value)*1.0) // INLINED!! + endfunction + + function SetUnitCriticalMultiplier takes unit u,real value returns nothing + set s__Critical_multiplier[GetUnitUserData((u ))]=(( value)*1.0) // INLINED!! + endfunction + + function SetCriticalEventDamage takes real newValue returns nothing + set s__Critical_damage=newValue + endfunction + + function UnitAddCriticalStrike takes unit u,real chance,real multiplier returns nothing + call s__Critical_add(u , chance , multiplier) + endfunction + +//library CriticalStrike ends +//library CrowdControl: + + // How to Import: + // 1 - Copy the Utilities library over to your map and follow its install instructions + // 2 - Copy the WorldBounds library over to your map and follow its install instructions + // 3 - Copy the Indexer library over to your map and follow its install instructions + // 4 - Copy the TimerUtils library over to your map and follow its install instructions + // 5 - Copy the RegisterPlayerUnitEvent library over to your map and follow its install instructions + // 6 - Copy the Tenacity library over to your map and follow its install instructions + // 7 - Copy this library into your map + // 8 - Copy the 14 buffs and 15 abilities with the CC prefix and match their raw code below. + + + + + + + + + + + function DisarmUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_disarm(target , duration , model , point , stack) + endfunction + + function IsUnitDisarmed takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__DISARM_BUFF) > 0) // INLINED!! + endfunction + + + function FearUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_fear(target , duration , model , point , stack) + endfunction + + function IsUnitFeared takes unit target returns boolean + return sc__CrowdControl_feared(target) + endfunction + + + function TauntUnit takes unit source,unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_taunt(source , target , duration , model , point , stack) + endfunction + + function IsUnitTaunted takes unit target returns boolean + return sc__CrowdControl_taunted(target) + endfunction + + + function KnockbackUnit takes unit target,real angle,real distance,real duration,string model,string point,boolean onCliff,boolean onDestructable,boolean onUnit,boolean stack returns nothing + call sc__CrowdControl_knockback(target , angle , distance , duration , model , point , onCliff , onDestructable , onUnit , stack) + endfunction + + function IsUnitKnockedBack takes unit target returns boolean + return sc__CrowdControl_knockedback(target) + endfunction + + + function KnockupUnit takes unit target,real maxHeight,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_knockup(target , maxHeight , duration , model , point , stack) + endfunction + + function IsUnitKnockedUp takes unit target returns boolean + return sc__CrowdControl_knockedup(target) + endfunction + + + function SilenceUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_silence(target , duration , model , point , stack) + endfunction + + function IsUnitSilenced takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__SILENCE_BUFF) > 0) // INLINED!! + endfunction + + + function StunUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_stun(target , duration , model , point , stack) + endfunction + + function IsUnitStunned takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__STUN_BUFF) > 0) // INLINED!! + endfunction + + + function SlowUnit takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_slow(target , amount , duration , model , point , stack) + endfunction + + function IsUnitSlowed takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__MOVEMENT_SLOW_BUFF) > 0) // INLINED!! + endfunction + + + function SlowUnitAttack takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_slowAttack(target , amount , duration , model , point , stack) + endfunction + + function IsUnitAttackSlowed takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__ATTACK_SLOW_BUFF) > 0) // INLINED!! + endfunction + + + function BanishUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_banish(target , duration , model , point , stack) + endfunction + + function IsUnitBanished takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__BANISH_BUFF) > 0) // INLINED!! + endfunction + + + function EnsnareUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_ensnare(target , duration , model , point , stack) + endfunction + + function IsUnitEnsnared takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__ENSNARE_BUFF) > 0) // INLINED!! + endfunction + + + function PurgeUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_purge(target , duration , model , point , stack) + endfunction + + function IsUnitPurged takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__PURGE_BUFF) > 0) // INLINED!! + endfunction + + + function HexUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_hex(target , duration , model , point , stack) + endfunction + + function IsUnitHexed takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__HEX_BUFF) > 0) // INLINED!! + endfunction + + + function SleepUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_sleep(target , duration , model , point , stack) + endfunction + + function IsUnitSleeping takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__SLEEP_BUFF) > 0) // INLINED!! + endfunction + + + function CycloneUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_cyclone(target , duration , model , point , stack) + endfunction + + function IsUnitCycloned takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__CYCLONE_BUFF) > 0) // INLINED!! + endfunction + + + function EntangleUnit takes unit target,real duration,string model,string point,boolean stack returns nothing + call sc__CrowdControl_entangle(target , duration , model , point , stack) + endfunction + + function IsUnitEntangled takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__ENTANGLE_BUFF) > 0) // INLINED!! + endfunction + + + function UnitDispelCrowdControl takes unit target,integer id returns nothing + call sc__CrowdControl_dispel(target , id) + endfunction + + function UnitDispelAllCrowdControl takes unit target returns nothing + call sc__CrowdControl_dispelAll(target) + endfunction + + + function RegisterCrowdControlEvent takes integer id,code c returns nothing + call sc__CrowdControl_register(id , c) + endfunction + + function RegisterAnyCrowdControlEvent takes code c returns nothing + call sc__CrowdControl_register(- 1 , c) + endfunction + + function GetCrowdControlUnit takes nothing returns unit + return s__CrowdControl_unit[s__CrowdControl_key] + endfunction + + function GetCrowdControlType takes nothing returns integer + return s__CrowdControl_type[s__CrowdControl_key] + endfunction + + function GetCrowdControlDuration takes nothing returns real + return s__CrowdControl_duration[s__CrowdControl_key] + endfunction + + function GetCrowdControlAmount takes nothing returns real + return s__CrowdControl_amount[s__CrowdControl_key] + endfunction + + function GetCrowdControlModel takes nothing returns string + return s__CrowdControl_model[s__CrowdControl_key] + endfunction + + function GetCrowdControlBone takes nothing returns string + return s__CrowdControl_point[s__CrowdControl_key] + endfunction + + function GetCrowdControlStack takes nothing returns boolean + return s__CrowdControl_stack[s__CrowdControl_key] + endfunction + + function GetCrowdControlRemaining takes unit target,integer id returns real + return (TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId((target )), ( id)))) // INLINED!! + endfunction + + function GetTauntSource takes nothing returns unit + return s__CrowdControl_source[s__CrowdControl_key] + endfunction + + function GetKnockbackAngle takes nothing returns real + return s__CrowdControl_angle[s__CrowdControl_key] + endfunction + + function GetKnockbackDistance takes nothing returns real + return s__CrowdControl_distance[s__CrowdControl_key] + endfunction + + function GetKnockupHeight takes nothing returns real + return s__CrowdControl_height[s__CrowdControl_key] + endfunction + + function GetKnockbackOnCliff takes nothing returns boolean + return s__CrowdControl_cliff[s__CrowdControl_key] + endfunction + + function GetKnockbackOnDestructable takes nothing returns boolean + return s__CrowdControl_destructable[s__CrowdControl_key] + endfunction + + function GetKnockbackOnUnit takes nothing returns boolean + return s__CrowdControl_agent[s__CrowdControl_key] + endfunction + + function SetCrowdControlUnit takes unit u returns nothing + set s__CrowdControl_unit[s__CrowdControl_key]=u + endfunction + + function SetCrowdControlType takes integer id returns nothing + if id >= CROWD_CONTROL_SILENCE and id <= CROWD_CONTROL_KNOCKUP then + set s__CrowdControl_type[s__CrowdControl_key]=id + endif + endfunction + + function SetCrowdControlDuration takes real duration returns nothing + set s__CrowdControl_duration[s__CrowdControl_key]=duration + endfunction + + function SetCrowdControlAmount takes real amount returns nothing + set s__CrowdControl_amount[s__CrowdControl_key]=amount + endfunction + + function SetCrowdControlModel takes string model returns nothing + set s__CrowdControl_model[s__CrowdControl_key]=model + endfunction + + function SetCrowdControlBone takes string point returns nothing + set s__CrowdControl_point[s__CrowdControl_key]=point + endfunction + + function SetCrowdControlStack takes boolean stack returns nothing + set s__CrowdControl_stack[s__CrowdControl_key]=stack + endfunction + + function SetTauntSource takes unit u returns nothing + set s__CrowdControl_source[s__CrowdControl_key]=u + endfunction + + function SetKnockbackAngle takes real angle returns nothing + set s__CrowdControl_angle[s__CrowdControl_key]=angle + endfunction + + function SetKnockbackDistance takes real distance returns nothing + set s__CrowdControl_distance[s__CrowdControl_key]=distance + endfunction + + function SetKnockupHeight takes real height returns nothing + set s__CrowdControl_height[s__CrowdControl_key]=height + endfunction + + function SetKnockbackOnCliff takes boolean onCliff returns nothing + set s__CrowdControl_cliff[s__CrowdControl_key]=onCliff + endfunction + + function SetKnockbackOnDestructable takes boolean onDestructable returns nothing + set s__CrowdControl_destructable[s__CrowdControl_key]=onDestructable + endfunction + + function SetKnockbackOnUnit takes boolean onUnit returns nothing + set s__CrowdControl_agent[s__CrowdControl_key]=onUnit + endfunction + + + + + + + + function s__CrowdControl__Knockback_remove takes integer this,integer i returns integer + call DestroyGroup(s__CrowdControl__Knockback_group[this]) + call DestroyEffect(s__CrowdControl__Knockback_effect[this]) + call BlzPauseUnitEx(s__CrowdControl__Knockback_unit[this], false) + + set s__CrowdControl__Knockback_unit[this]=null + set s__CrowdControl__Knockback_group[this]=null + set s__CrowdControl__Knockback_effect[this]=null + set s__CrowdControl__Knockback_struct[s__CrowdControl__Knockback_id[this]]=0 + set s__CrowdControl__Knockback_array[i]=s__CrowdControl__Knockback_array[s__CrowdControl__Knockback_key] + set s__CrowdControl__Knockback_key=s__CrowdControl__Knockback_key - 1 + + call s__CrowdControl__Knockback_deallocate(this) + + if s__CrowdControl__Knockback_key == - 1 then + call PauseTimer(s__CrowdControl__Knockback_timer) + endif + + return i - 1 + endfunction + + function s__CrowdControl__Knockback_onDestructable takes nothing returns nothing + local integer this= s__CrowdControl__Knockback_temp + + if GetDestructableLife(GetEnumDestructable()) > 0 then + set s__CrowdControl__Knockback_duration[this]=0 + return + endif + endfunction + + function s__CrowdControl__Knockback_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + local real x + local real y + local unit u + + loop + exitwhen i > s__CrowdControl__Knockback_key + set this=s__CrowdControl__Knockback_array[i] + + if s__CrowdControl__Knockback_duration[this] > 0 and UnitAlive(s__CrowdControl__Knockback_unit[this]) then + set s__CrowdControl__Knockback_duration[this]=s__CrowdControl__Knockback_duration[this] - s__CrowdControl__Knockback_period + set x=GetUnitX(s__CrowdControl__Knockback_unit[this]) + s__CrowdControl__Knockback_offset[this] * Cos(s__CrowdControl__Knockback_angle[this]) + set y=GetUnitY(s__CrowdControl__Knockback_unit[this]) + s__CrowdControl__Knockback_offset[this] * Sin(s__CrowdControl__Knockback_angle[this]) + + if s__CrowdControl__Knockback_onUnit[this] and s__CrowdControl__Knockback_collision[this] > 0 then + call GroupEnumUnitsInRange(s__CrowdControl__Knockback_group[this], x, y, s__CrowdControl__Knockback_collision[this], null) + call GroupRemoveUnit(s__CrowdControl__Knockback_group[this], s__CrowdControl__Knockback_unit[this]) + + loop + set u=FirstOfGroup(s__CrowdControl__Knockback_group[this]) + exitwhen u == null + if UnitAlive(u) then + set s__CrowdControl__Knockback_duration[this]=0 + set u=null + exitwhen true + endif + call GroupRemoveUnit(s__CrowdControl__Knockback_group[this], u) + endloop + endif + + if s__CrowdControl__Knockback_onDest[this] and s__CrowdControl__Knockback_duration[this] > 0 and s__CrowdControl__Knockback_collision[this] > 0 then + set s__CrowdControl__Knockback_temp=this + call SetRect(s__CrowdControl__Knockback_rect, x - s__CrowdControl__Knockback_collision[this], y - s__CrowdControl__Knockback_collision[this], x + s__CrowdControl__Knockback_collision[this], y + s__CrowdControl__Knockback_collision[this]) + call EnumDestructablesInRect(s__CrowdControl__Knockback_rect, null, function s__CrowdControl__Knockback_onDestructable) + endif + + if s__CrowdControl__Knockback_onCliff[this] and s__CrowdControl__Knockback_duration[this] > 0 then + if GetTerrainCliffLevel(GetUnitX(s__CrowdControl__Knockback_unit[this]), GetUnitY(s__CrowdControl__Knockback_unit[this])) < GetTerrainCliffLevel(x, y) and GetUnitZ(s__CrowdControl__Knockback_unit[this]) < ( GetTerrainCliffLevel(x, y) - GetTerrainCliffLevel(s__WorldBounds_maxX, s__WorldBounds_maxY) ) * bj_CLIFFHEIGHT then + set s__CrowdControl__Knockback_duration[this]=0 + endif + endif + + if s__CrowdControl__Knockback_duration[this] > 0 then + call SetUnitX(s__CrowdControl__Knockback_unit[this], x) + call SetUnitY(s__CrowdControl__Knockback_unit[this], y) + endif + else + set i=s__CrowdControl__Knockback_remove(this,i) + endif + set i=i + 1 + endloop + endfunction + + function s__CrowdControl__Knockback_knocked takes unit u returns boolean + return s__CrowdControl__Knockback_struct[GetUnitUserData(u)] != 0 + endfunction + + function s__CrowdControl__Knockback_apply takes unit target,real angle,real distance,real duration,string model,string point,boolean onCliff,boolean onDestructable,boolean onUnit returns nothing + local integer id= GetUnitUserData(target) + local integer this + + if duration > 0 and UnitAlive(target) then + if s__CrowdControl__Knockback_struct[id] != 0 then + set this=s__CrowdControl__Knockback_struct[id] + else + set this=s__CrowdControl__Knockback__allocate() + set s__CrowdControl__Knockback_id[this]=id + set s__CrowdControl__Knockback_unit[this]=target + set s__CrowdControl__Knockback_collision[this]=2 * BlzGetUnitCollisionSize(target) + set s__CrowdControl__Knockback_group[this]=CreateGroup() + set s__CrowdControl__Knockback_key=s__CrowdControl__Knockback_key + 1 + set s__CrowdControl__Knockback_array[s__CrowdControl__Knockback_key]=this + set s__CrowdControl__Knockback_struct[id]=this + + call BlzPauseUnitEx(target, true) + + if model != null and point != null then + set s__CrowdControl__Knockback_effect[this]=AddSpecialEffectTarget(model, target, point) + endif + + if s__CrowdControl__Knockback_key == 0 then + call TimerStart(s__CrowdControl__Knockback_timer, s__CrowdControl__Knockback_period, true, function s__CrowdControl__Knockback_onPeriod) + endif + endif + + set s__CrowdControl__Knockback_angle[this]=angle + set s__CrowdControl__Knockback_distance[this]=distance + set s__CrowdControl__Knockback_duration[this]=duration + set s__CrowdControl__Knockback_onCliff[this]=onCliff + set s__CrowdControl__Knockback_onDest[this]=onDestructable + set s__CrowdControl__Knockback_onUnit[this]=onUnit + set s__CrowdControl__Knockback_offset[this]=RMaxBJ(0.00000001, distance * s__CrowdControl__Knockback_period / RMaxBJ(0.00000001, duration)) + endif + endfunction + + + + + function s__Knockup_isUnitKnocked takes unit u returns boolean + return s__Knockup_knocked[GetUnitUserData(u)] > 0 + endfunction + + function s__Knockup_onPeriod takes nothing returns nothing + local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + + if s__Knockup_up[this] then + set s__Knockup_up[this]=false + call SetUnitFlyHeight(s__Knockup_unit[this], GetUnitDefaultFlyHeight(s__Knockup_unit[this]), s__Knockup_rate[this]) + call TimerStart(s__Knockup_timer[this], s__Knockup_airTime[this] / 2, false, function s__Knockup_onPeriod) + else + call DestroyEffect(s__Knockup_effect[this]) + call ReleaseTimer(s__Knockup_timer[this]) + call s__Knockup_deallocate(this) + + set s__Knockup_knocked[s__Knockup_key[this]]=s__Knockup_knocked[s__Knockup_key[this]] - 1 + + if s__Knockup_knocked[s__Knockup_key[this]] == 0 then + call BlzPauseUnitEx(s__Knockup_unit[this], false) + endif + + set s__Knockup_timer[this]=null + set s__Knockup_unit[this]=null + set s__Knockup_effect[this]=null + endif + endfunction + + function s__Knockup_apply takes unit whichUnit,real airTime,real maxHeight,string model,string point returns nothing + local integer this + + if airTime > 0 then + set this=s__Knockup__allocate() + set s__Knockup_timer[this]=NewTimerEx(this) + set s__Knockup_unit[this]=whichUnit + set s__Knockup_rate[this]=maxHeight / airTime + set s__Knockup_airTime[this]=airTime + set s__Knockup_up[this]=true + set s__Knockup_key[this]=GetUnitUserData(s__Knockup_unit[this]) + set s__Knockup_knocked[s__Knockup_key[this]]=s__Knockup_knocked[s__Knockup_key[this]] + 1 + + if model != null and point != null then + set s__Knockup_effect[this]=AddSpecialEffectTarget(model, s__Knockup_unit[this], point) + endif + + if s__Knockup_knocked[s__Knockup_key[this]] == 1 then + call BlzPauseUnitEx(whichUnit, true) + endif + + call UnitAddAbility(s__Knockup_unit[this], 'Amrf') + call UnitRemoveAbility(s__Knockup_unit[this], 'Amrf') + call SetUnitFlyHeight(s__Knockup_unit[this], ( GetUnitDefaultFlyHeight(s__Knockup_unit[this]) + maxHeight ), s__Knockup_rate[this]) + call TimerStart(s__Knockup_timer[this], airTime / 2, false, function s__Knockup_onPeriod) + endif + endfunction + + + + + function s__Fear_feared takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__FEAR_BUFF) > 0 + endfunction + + function s__Fear_remove takes integer this,integer i returns integer + set s__Fear_flag[s__Fear_id[this]]=true + call IssueImmediateOrder(s__Fear_unit[this], "stop") + call DestroyEffect(s__Fear_effect[this]) + + set s__Fear_struct[s__Fear_id[this]]=0 + set s__Fear_unit[this]=null + set s__Fear_effect[this]=null + set s__Fear_array[i]=s__Fear_array[s__Fear_key] + set s__Fear_key=s__Fear_key - 1 + + call s__Fear_deallocate(this) + + if s__Fear_key == - 1 then + call PauseTimer(s__Fear_timer) + endif + + return i - 1 + endfunction + + function s__Fear_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__Fear_key + set this=s__Fear_array[i] + + if GetUnitAbilityLevel(s__Fear_unit[this], CrowdControl__FEAR_BUFF) > 0 then + set s__Fear_change[this]=s__Fear_change[this] + 1 + + if s__Fear_change[this] >= s__Fear_DIRECTION_CHANGE then + set s__Fear_change[this]=0 + set s__Fear_flag[s__Fear_id[this]]=true + set s__Fear_x[s__Fear_id[this]]=GetRandomReal(GetUnitX(s__Fear_unit[this]) - s__Fear_MAX_CHANGE, GetUnitX(s__Fear_unit[this]) + s__Fear_MAX_CHANGE) + set s__Fear_y[s__Fear_id[this]]=GetRandomReal(GetUnitY(s__Fear_unit[this]) - s__Fear_MAX_CHANGE, GetUnitY(s__Fear_unit[this]) + s__Fear_MAX_CHANGE) + call IssuePointOrder(s__Fear_unit[this], "move", s__Fear_x[s__Fear_id[this]], s__Fear_y[s__Fear_id[this]]) + endif + else + set i=s__Fear_remove(this,i) + endif + set i=i + 1 + endloop + endfunction + + function s__Fear_apply takes unit whichUnit,real duration,string model,string point returns nothing + local integer id= GetUnitUserData(whichUnit) + local integer this + + if duration > 0 then + call BlzSetAbilityRealLevelField(s__Fear_ability, ABILITY_RLF_DURATION_NORMAL, 0, duration) + call BlzSetAbilityRealLevelField(s__Fear_ability, ABILITY_RLF_DURATION_HERO, 0, duration) + call IncUnitAbilityLevel(s__Fear_dummy, CrowdControl__FEAR) + call DecUnitAbilityLevel(s__Fear_dummy, CrowdControl__FEAR) + + if IssueTargetOrder(s__Fear_dummy, "drunkenhaze", whichUnit) then + if s__Fear_struct[id] != 0 then + set this=s__Fear_struct[id] + else + set this=s__Fear__allocate() + set s__Fear_id[this]=id + set s__Fear_unit[this]=whichUnit + set s__Fear_change[this]=0 + set s__Fear_key=s__Fear_key + 1 + set s__Fear_array[s__Fear_key]=this + set s__Fear_struct[id]=this + + if model != null and point != null then + set s__Fear_effect[this]=AddSpecialEffectTarget(model, whichUnit, point) + endif + + if s__Fear_key == 0 then + call TimerStart(s__Fear_timer, s__Fear_PERIOD, true, function s__Fear_onPeriod) + endif + endif + + set s__Fear_flag[id]=true + set s__Fear_x[id]=GetRandomReal(GetUnitX(whichUnit) - s__Fear_MAX_CHANGE, GetUnitX(whichUnit) + s__Fear_MAX_CHANGE) + set s__Fear_y[id]=GetRandomReal(GetUnitY(whichUnit) - s__Fear_MAX_CHANGE, GetUnitY(whichUnit) + s__Fear_MAX_CHANGE) + call IssuePointOrder(whichUnit, "move", s__Fear_x[id], s__Fear_y[id]) + endif + endif + endfunction + + function s__Fear_onOrder takes nothing returns nothing + local unit source= GetOrderedUnit() + local integer id + + if (GetUnitAbilityLevel((source), CrowdControl__FEAR_BUFF) > 0) and GetIssuedOrderId() != 851973 then // INLINED!! + set id=GetUnitUserData(source) + + if not s__Fear_flag[id] then + set s__Fear_flag[id]=true + call IssuePointOrder(source, "move", s__Fear_x[id], s__Fear_y[id]) + else + set s__Fear_flag[id]=false + endif + endif + + set source=null + endfunction + + function s__Fear_onInit takes nothing returns nothing + set s__Fear_dummy=(sc__DummyPool_retrieve((Player(PLAYER_NEUTRAL_PASSIVE) ) , (( GetRectCenterX(GetWorldBounds()) )*1.0) , (( GetRectCenterY(GetWorldBounds()) )*1.0) , (( 0 )*1.0) , (( 0)*1.0))) // INLINED!! + + call UnitAddAbility(s__Fear_dummy, CrowdControl__TRUE_SIGHT) + call UnitAddAbility(s__Fear_dummy, CrowdControl__FEAR) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER , function s__Fear_onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER , function s__Fear_onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER , function s__Fear_onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER , function s__Fear_onOrder) + + set s__Fear_ability=BlzGetUnitAbility(s__Fear_dummy, CrowdControl__FEAR) + endfunction + + + + + + function s__Taunt_taunted takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__TAUNT_BUFF) > 0 + endfunction + + function s__Taunt_remove takes integer this,integer i returns integer + call sc__CrowdControl_dispel((s__Taunt_unit[this] ) , ( CROWD_CONTROL_TAUNT)) // INLINED!! + call IssueImmediateOrder(s__Taunt_unit[this], "stop") + call DestroyEffect(s__Taunt_effect[this]) + + if s__Taunt_selected[this] and UnitAlive(s__Taunt_unit[this]) then + call SelectUnitAddForPlayer(s__Taunt_unit[this], GetOwningPlayer(s__Taunt_unit[this])) + endif + + set s__Taunt_struct[s__Taunt_id[this]]=0 + set s__Taunt_source[s__Taunt_id[this]]=null + set s__Taunt_unit[this]=null + set s__Taunt_effect[this]=null + set s__Taunt_array[i]=s__Taunt_array[s__Taunt_key] + set s__Taunt_key=s__Taunt_key - 1 + + call s__Taunt_deallocate(this) + + if s__Taunt_key == - 1 then + call PauseTimer(s__Taunt_timer) + endif + + return i - 1 + endfunction + + function s__Taunt_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__Taunt_key + set this=s__Taunt_array[i] + + if GetUnitAbilityLevel(s__Taunt_unit[this], CrowdControl__TAUNT_BUFF) > 0 and UnitAlive(s__Taunt_source[s__Taunt_id[this]]) and UnitAlive(s__Taunt_unit[this]) then + if IsUnitVisible(s__Taunt_source[s__Taunt_id[this]], GetOwningPlayer(s__Taunt_unit[this])) then + call IssueTargetOrderById(s__Taunt_unit[this], 851983, s__Taunt_source[s__Taunt_id[this]]) + else + call IssuePointOrderById(s__Taunt_unit[this], 851986, GetUnitX(s__Taunt_source[s__Taunt_id[this]]), GetUnitY(s__Taunt_source[s__Taunt_id[this]])) + endif + else + set i=s__Taunt_remove(this,i) + endif + set i=i + 1 + endloop + endfunction + + function s__Taunt_apply takes unit source,unit target,real duration,string model,string point returns nothing + local integer id= GetUnitUserData(target) + local integer this + + if duration > 0 and UnitAlive(source) and UnitAlive(target) then + call BlzSetAbilityRealLevelField(s__Taunt_ability, ABILITY_RLF_DURATION_NORMAL, 0, duration) + call BlzSetAbilityRealLevelField(s__Taunt_ability, ABILITY_RLF_DURATION_HERO, 0, duration) + call IncUnitAbilityLevel(s__Taunt_dummy, CrowdControl__TAUNT) + call DecUnitAbilityLevel(s__Taunt_dummy, CrowdControl__TAUNT) + + if IssueTargetOrder(s__Taunt_dummy, "drunkenhaze", target) then + if s__Taunt_struct[id] != 0 then + set this=s__Taunt_struct[id] + else + set this=s__Taunt__allocate() + set s__Taunt_id[this]=id + set s__Taunt_unit[this]=target + set s__Taunt_selected[this]=IsUnitSelected(target, GetOwningPlayer(target)) + set s__Taunt_key=s__Taunt_key + 1 + set s__Taunt_array[s__Taunt_key]=this + set s__Taunt_struct[id]=this + + if s__Taunt_selected[this] then + call SelectUnit(target, false) + endif + + if model != null and point != null then + set s__Taunt_effect[this]=AddSpecialEffectTarget(model, target, point) + endif + + if s__Taunt_key == 0 then + call TimerStart(s__Taunt_timer, s__Taunt_PERIOD, true, function s__Taunt_onPeriod) + endif + endif + + set s__Taunt_source[id]=source + + if IsUnitVisible(source, GetOwningPlayer(target)) then + call IssueTargetOrderById(target, 851983, source) + else + call IssuePointOrderById(target, 851986, GetUnitX(source), GetUnitY(source)) + endif + endif + endif + endfunction + + function s__Taunt_onOrder takes nothing returns nothing + local unit target= GetOrderedUnit() + local integer order= GetIssuedOrderId() + local integer id + + if (GetUnitAbilityLevel((target), CrowdControl__TAUNT_BUFF) > 0) and order != 851973 then // INLINED!! + set id=GetUnitUserData(target) + + if order != 851983 and order != 851986 then + if IsUnitVisible(s__Taunt_source[id], GetOwningPlayer(target)) then + call IssueTargetOrderById(target, 851983, s__Taunt_source[id]) + else + call IssuePointOrderById(target, 851986, GetUnitX(s__Taunt_source[id]), GetUnitY(s__Taunt_source[id])) + endif + else + if GetOrderTargetUnit() != s__Taunt_source[id] and GetOrderTargetUnit() != null then + if IsUnitVisible(s__Taunt_source[id], GetOwningPlayer(target)) then + call IssueTargetOrderById(target, 851983, s__Taunt_source[id]) + else + call IssuePointOrderById(target, 851986, GetUnitX(s__Taunt_source[id]), GetUnitY(s__Taunt_source[id])) + endif + endif + endif + endif + + set target=null + endfunction + + function s__Taunt_onSelect takes nothing returns nothing + local unit target= GetTriggerUnit() + + if (GetUnitAbilityLevel((target), CrowdControl__TAUNT_BUFF) > 0) then // INLINED!! + if IsUnitSelected(target, GetOwningPlayer(target)) then + call SelectUnit(target, false) + endif + endif + + set target=null + endfunction + + function s__Taunt_onInit takes nothing returns nothing + set s__Taunt_dummy=(sc__DummyPool_retrieve((Player(PLAYER_NEUTRAL_PASSIVE) ) , (( GetRectCenterX(GetWorldBounds()) )*1.0) , (( GetRectCenterY(GetWorldBounds()) )*1.0) , (( 0 )*1.0) , (( 0)*1.0))) // INLINED!! + + call UnitAddAbility(s__Taunt_dummy, CrowdControl__TRUE_SIGHT) + call UnitAddAbility(s__Taunt_dummy, CrowdControl__TAUNT) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER , function s__Taunt_onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER , function s__Taunt_onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER , function s__Taunt_onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER , function s__Taunt_onOrder) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SELECTED , function s__Taunt_onSelect) + + set s__Taunt_ability=BlzGetUnitAbility(s__Taunt_dummy, CrowdControl__TAUNT) + endfunction + + + + + + function s__CrowdControl_onInit takes nothing returns nothing + set s__CrowdControl_dummy=(sc__DummyPool_retrieve((Player(PLAYER_NEUTRAL_PASSIVE) ) , (( GetRectCenterX(GetWorldBounds()) )*1.0) , (( GetRectCenterY(GetWorldBounds()) )*1.0) , (( 0 )*1.0) , (( 0)*1.0))) // INLINED!! + + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__SILENCE) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__STUN) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__ATTACK_SLOW) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__MOVEMENT_SLOW) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__BANISH) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__ENSNARE) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__PURGE) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__HEX) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__SLEEP) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__CYCLONE) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__ENTANGLE) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__DISARM) + call UnitAddAbility(s__CrowdControl_dummy, CrowdControl__TRUE_SIGHT) + + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__SILENCE, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__STUN, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__ATTACK_SLOW, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__MOVEMENT_SLOW, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__BANISH, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__ENSNARE, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__PURGE, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__HEX, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__SLEEP, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__CYCLONE, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__ENTANGLE, true, true) + call BlzUnitDisableAbility(s__CrowdControl_dummy, CrowdControl__DISARM, true, true) + + set s__CrowdControl_ability[CROWD_CONTROL_SILENCE]=CrowdControl__SILENCE + set s__CrowdControl_ability[CROWD_CONTROL_STUN]=CrowdControl__STUN + set s__CrowdControl_ability[CROWD_CONTROL_SLOW]=CrowdControl__MOVEMENT_SLOW + set s__CrowdControl_ability[CROWD_CONTROL_SLOW_ATTACK]=CrowdControl__ATTACK_SLOW + set s__CrowdControl_ability[CROWD_CONTROL_BANISH]=CrowdControl__BANISH + set s__CrowdControl_ability[CROWD_CONTROL_ENSNARE]=CrowdControl__ENSNARE + set s__CrowdControl_ability[CROWD_CONTROL_PURGE]=CrowdControl__PURGE + set s__CrowdControl_ability[CROWD_CONTROL_HEX]=CrowdControl__HEX + set s__CrowdControl_ability[CROWD_CONTROL_SLEEP]=CrowdControl__SLEEP + set s__CrowdControl_ability[CROWD_CONTROL_CYCLONE]=CrowdControl__CYCLONE + set s__CrowdControl_ability[CROWD_CONTROL_ENTANGLE]=CrowdControl__ENTANGLE + set s__CrowdControl_ability[CROWD_CONTROL_DISARM]=CrowdControl__DISARM + set s__CrowdControl_ability[CROWD_CONTROL_FEAR]=CrowdControl__FEAR + set s__CrowdControl_ability[CROWD_CONTROL_TAUNT]=CrowdControl__TAUNT + + set s__CrowdControl_buff[CROWD_CONTROL_SILENCE]=CrowdControl__SILENCE_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_STUN]=CrowdControl__STUN_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_SLOW]=CrowdControl__MOVEMENT_SLOW_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_SLOW_ATTACK]=CrowdControl__ATTACK_SLOW_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_BANISH]=CrowdControl__BANISH_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_ENSNARE]=CrowdControl__ENSNARE_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_PURGE]=CrowdControl__PURGE_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_HEX]=CrowdControl__HEX_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_SLEEP]=CrowdControl__SLEEP_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_CYCLONE]=CrowdControl__CYCLONE_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_ENTANGLE]=CrowdControl__ENTANGLE_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_DISARM]=CrowdControl__DISARM_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_FEAR]=CrowdControl__FEAR_BUFF + set s__CrowdControl_buff[CROWD_CONTROL_TAUNT]=CrowdControl__TAUNT_BUFF + + set s__CrowdControl_order[CROWD_CONTROL_SILENCE]="drunkenhaze" + set s__CrowdControl_order[CROWD_CONTROL_STUN]="thunderbolt" + set s__CrowdControl_order[CROWD_CONTROL_SLOW]="cripple" + set s__CrowdControl_order[CROWD_CONTROL_SLOW_ATTACK]="cripple" + set s__CrowdControl_order[CROWD_CONTROL_BANISH]="banish" + set s__CrowdControl_order[CROWD_CONTROL_ENSNARE]="ensnare" + set s__CrowdControl_order[CROWD_CONTROL_PURGE]="purge" + set s__CrowdControl_order[CROWD_CONTROL_HEX]="hex" + set s__CrowdControl_order[CROWD_CONTROL_SLEEP]="sleep" + set s__CrowdControl_order[CROWD_CONTROL_CYCLONE]="cyclone" + set s__CrowdControl_order[CROWD_CONTROL_ENTANGLE]="entanglingroots" + set s__CrowdControl_order[CROWD_CONTROL_DISARM]="drunkenhaze" + endfunction + + function s__CrowdControl_onExpire takes nothing returns nothing + local timer t= GetExpiredTimer() + + call RemoveSavedHandle(s__CrowdControl_timer, GetHandleId(LoadUnitHandle(s__CrowdControl_timer, GetHandleId(t), 0)), LoadInteger(s__CrowdControl_timer, GetHandleId(t), 1)) + call FlushChildHashtable(s__CrowdControl_timer, GetHandleId(t)) + call DestroyTimer(t) + + set t=null + endfunction + + function s__CrowdControl_onEvent takes integer key returns nothing + local integer i= 0 + local integer next= - 1 + local integer prev= - 2 + + set s__CrowdControl_count=s__CrowdControl_count + 1 + + if s__CrowdControl_count - CROWD_CONTROL_KNOCKUP < CrowdControl__RECURSION_LIMIT then + loop + exitwhen s__CrowdControl_type[key] == next or ( i - CROWD_CONTROL_KNOCKUP > CrowdControl__RECURSION_LIMIT ) + set next=s__CrowdControl_type[key] + + if s__CrowdControl_event[next] != null then + call TriggerEvaluate(s__CrowdControl_event[next]) + endif + + if s__CrowdControl_type[key] != next then + set i=i + 1 + else + if next != prev then + call TriggerEvaluate(s__CrowdControl_trigger) + + if s__CrowdControl_type[key] != next then + set i=i + 1 + set prev=next + endif + endif + endif + endloop + endif + + set s__CrowdControl_count=s__CrowdControl_count - 1 + set s__CrowdControl_key=key + endfunction + + function s__CrowdControl_cast takes unit source,unit target,real amount,real angle,real distance,real height,real duration,string model,string point,boolean stack,boolean onCliff,boolean onDestructable,boolean onUnit,integer id returns nothing + local ability spell + local timer t + + if not IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) and UnitAlive(target) and duration > 0 then + set s__CrowdControl_key=s__CrowdControl_key + 1 + set s__CrowdControl_unit[s__CrowdControl_key]=target + set s__CrowdControl_source[s__CrowdControl_key]=source + set s__CrowdControl_amount[s__CrowdControl_key]=amount + set s__CrowdControl_angle[s__CrowdControl_key]=angle + set s__CrowdControl_distance[s__CrowdControl_key]=distance + set s__CrowdControl_height[s__CrowdControl_key]=height + set s__CrowdControl_duration[s__CrowdControl_key]=duration + set s__CrowdControl_model[s__CrowdControl_key]=model + set s__CrowdControl_point[s__CrowdControl_key]=point + set s__CrowdControl_stack[s__CrowdControl_key]=stack + set s__CrowdControl_cliff[s__CrowdControl_key]=onCliff + set s__CrowdControl_destructable[s__CrowdControl_key]=onDestructable + set s__CrowdControl_agent[s__CrowdControl_key]=onUnit + set s__CrowdControl_type[s__CrowdControl_key]=id + + call s__CrowdControl_onEvent(s__CrowdControl_key) + + + set s__CrowdControl_duration[s__CrowdControl_key]=(sc__Tenacity_calculate((s__CrowdControl_unit[s__CrowdControl_key] ) , (( s__CrowdControl_duration[s__CrowdControl_key])*1.0))) // INLINED!! + + + if s__CrowdControl_duration[s__CrowdControl_key] > 0 and UnitAlive(s__CrowdControl_unit[s__CrowdControl_key]) then + if not HaveSavedHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]) then + set t=CreateTimer() + call SaveTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key], t) + call SaveUnitHandle(s__CrowdControl_timer, GetHandleId(t), 0, s__CrowdControl_unit[s__CrowdControl_key]) + call SaveInteger(s__CrowdControl_timer, GetHandleId(t), 1, s__CrowdControl_type[s__CrowdControl_key]) + endif + + if s__CrowdControl_stack[s__CrowdControl_key] then + if s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_TAUNT then + set s__CrowdControl_duration[s__CrowdControl_key]=s__CrowdControl_duration[s__CrowdControl_key] + TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key])) + else + if s__Taunt_source[GetUnitUserData(s__CrowdControl_unit[s__CrowdControl_key])] == s__CrowdControl_source[s__CrowdControl_key] then + set s__CrowdControl_duration[s__CrowdControl_key]=s__CrowdControl_duration[s__CrowdControl_key] + TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key])) + endif + endif + endif + + if s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_FEAR and s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_TAUNT and s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_KNOCKBACK and s__CrowdControl_type[s__CrowdControl_key] != CROWD_CONTROL_KNOCKUP then + set spell=BlzGetUnitAbility(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]]) + + call BlzUnitDisableAbility(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]], false, false) + call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_DURATION_NORMAL, 0, s__CrowdControl_duration[s__CrowdControl_key]) + call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_DURATION_HERO, 0, s__CrowdControl_duration[s__CrowdControl_key]) + + if s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_SLOW then + call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_MOVEMENT_SPEED_REDUCTION_PERCENT_CRI1, 0, s__CrowdControl_amount[s__CrowdControl_key]) + elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_SLOW_ATTACK then + call BlzSetAbilityRealLevelField(spell, ABILITY_RLF_ATTACK_SPEED_REDUCTION_PERCENT_CRI2, 0, s__CrowdControl_amount[s__CrowdControl_key]) + endif + + call IncUnitAbilityLevel(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]]) + call DecUnitAbilityLevel(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]]) + + if IssueTargetOrder(s__CrowdControl_dummy, s__CrowdControl_order[s__CrowdControl_type[s__CrowdControl_key]], s__CrowdControl_unit[s__CrowdControl_key]) then + call UnitRemoveAbility(s__CrowdControl_unit[s__CrowdControl_key], s__CrowdControl_buff[s__CrowdControl_type[s__CrowdControl_key]]) + call IssueTargetOrder(s__CrowdControl_dummy, s__CrowdControl_order[s__CrowdControl_type[s__CrowdControl_key]], s__CrowdControl_unit[s__CrowdControl_key]) + call TimerStart(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]), s__CrowdControl_duration[s__CrowdControl_key], false, function s__CrowdControl_onExpire) + + if s__CrowdControl_model[s__CrowdControl_key] != null and s__CrowdControl_model[s__CrowdControl_key] != "" then + if s__CrowdControl_point[s__CrowdControl_key] != null and s__CrowdControl_point[s__CrowdControl_key] != "" then + call sc__EffectLink_BuffLink((s__CrowdControl_unit[s__CrowdControl_key] ) , ( s__CrowdControl_buff[s__CrowdControl_type[s__CrowdControl_key]] ) , ( s__CrowdControl_model[s__CrowdControl_key] ) , ( s__CrowdControl_point[s__CrowdControl_key])) // INLINED!! + else + call DestroyEffect(AddSpecialEffect(s__CrowdControl_model[s__CrowdControl_key], GetUnitX(s__CrowdControl_unit[s__CrowdControl_key]), GetUnitY(s__CrowdControl_unit[s__CrowdControl_key]))) + endif + endif + else + call RemoveSavedHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]) + call FlushChildHashtable(s__CrowdControl_timer, GetHandleId(t)) + call DestroyTimer(t) + endif + + call BlzUnitDisableAbility(s__CrowdControl_dummy, s__CrowdControl_ability[s__CrowdControl_type[s__CrowdControl_key]], true, true) + else + if s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_FEAR then + call s__Fear_apply(s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key]) + elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_TAUNT then + call s__Taunt_apply(s__CrowdControl_source[s__CrowdControl_key] , s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key]) + elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_KNOCKBACK then + call s__CrowdControl__Knockback_apply(s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_angle[s__CrowdControl_key] , s__CrowdControl_distance[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key] , s__CrowdControl_cliff[s__CrowdControl_key] , s__CrowdControl_destructable[s__CrowdControl_key] , s__CrowdControl_agent[s__CrowdControl_key]) + elseif s__CrowdControl_type[s__CrowdControl_key] == CROWD_CONTROL_KNOCKUP then + call s__Knockup_apply(s__CrowdControl_unit[s__CrowdControl_key] , s__CrowdControl_duration[s__CrowdControl_key] , s__CrowdControl_height[s__CrowdControl_key] , s__CrowdControl_model[s__CrowdControl_key] , s__CrowdControl_point[s__CrowdControl_key]) + endif + + call TimerStart(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(s__CrowdControl_unit[s__CrowdControl_key]), s__CrowdControl_type[s__CrowdControl_key]), s__CrowdControl_duration[s__CrowdControl_key], false, function s__CrowdControl_onExpire) + endif + endif + + if s__CrowdControl_key > - 1 then + set s__CrowdControl_key=s__CrowdControl_key - 1 + endif + endif + + set t=null + set spell=null + endfunction + + function s__CrowdControl_silence takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SILENCE) + endfunction + + function s__CrowdControl_silenced takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__SILENCE_BUFF) > 0 + endfunction + + function s__CrowdControl_stun takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_STUN) + endfunction + + function s__CrowdControl_stunned takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__STUN_BUFF) > 0 + endfunction + + function s__CrowdControl_slow takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , amount , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SLOW) + endfunction + + function s__CrowdControl_slowed takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__MOVEMENT_SLOW_BUFF) > 0 + endfunction + + function s__CrowdControl_slowAttack takes unit target,real amount,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , amount , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SLOW_ATTACK) + endfunction + + function s__CrowdControl_attackSlowed takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__ATTACK_SLOW_BUFF) > 0 + endfunction + + function s__CrowdControl_banish takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_BANISH) + endfunction + + function s__CrowdControl_banished takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__BANISH_BUFF) > 0 + endfunction + + function s__CrowdControl_ensnare takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_ENSNARE) + endfunction + + function s__CrowdControl_ensnared takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__ENSNARE_BUFF) > 0 + endfunction + + function s__CrowdControl_purge takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_PURGE) + endfunction + + function s__CrowdControl_purged takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__PURGE_BUFF) > 0 + endfunction + + function s__CrowdControl_hex takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_HEX) + endfunction + + function s__CrowdControl_hexed takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__HEX_BUFF) > 0 + endfunction + + function s__CrowdControl_sleep takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_SLEEP) + endfunction + + function s__CrowdControl_sleeping takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__SLEEP_BUFF) > 0 + endfunction + + function s__CrowdControl_cyclone takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_CYCLONE) + endfunction + + function s__CrowdControl_cycloned takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__CYCLONE_BUFF) > 0 + endfunction + + function s__CrowdControl_entangle takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_ENTANGLE) + endfunction + + function s__CrowdControl_entangled takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__ENTANGLE_BUFF) > 0 + endfunction + + function s__CrowdControl_knockback takes unit target,real angle,real distance,real duration,string model,string point,boolean onCliff,boolean onDestructable,boolean onUnit,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , angle , distance , 0 , duration , model , point , stack , onCliff , onDestructable , onUnit , CROWD_CONTROL_KNOCKBACK) + endfunction + + function s__CrowdControl_knockedback takes unit target returns boolean + return (s__CrowdControl__Knockback_struct[GetUnitUserData((target))] != 0) // INLINED!! + endfunction + + function s__CrowdControl_knockup takes unit target,real maxHeight,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , maxHeight , duration , model , point , stack , false , false , false , CROWD_CONTROL_KNOCKUP) + endfunction + + function s__CrowdControl_knockedup takes unit target returns boolean + return (s__Knockup_knocked[GetUnitUserData((target))] > 0) // INLINED!! + endfunction + + function s__CrowdControl_fear takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_FEAR) + endfunction + + function s__CrowdControl_feared takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__FEAR_BUFF) > 0) // INLINED!! + endfunction + + function s__CrowdControl_disarm takes unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(null , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_DISARM) + endfunction + + function s__CrowdControl_disarmed takes unit target returns boolean + return GetUnitAbilityLevel(target, CrowdControl__DISARM_BUFF) > 0 + endfunction + + function s__CrowdControl_taunt takes unit source,unit target,real duration,string model,string point,boolean stack returns nothing + call s__CrowdControl_cast(source , target , 0 , 0 , 0 , 0 , duration , model , point , stack , false , false , false , CROWD_CONTROL_TAUNT) + endfunction + + function s__CrowdControl_taunted takes unit target returns boolean + return (GetUnitAbilityLevel((target), CrowdControl__TAUNT_BUFF) > 0) // INLINED!! + endfunction + + function s__CrowdControl_dispel takes unit target,integer id returns nothing + local timer t + + if s__CrowdControl_buff[id] != 0 then + call UnitRemoveAbility(target, s__CrowdControl_buff[id]) + + if HaveSavedHandle(s__CrowdControl_timer, GetHandleId(target), id) then + set t=LoadTimerHandle(s__CrowdControl_timer, GetHandleId(target), id) + call RemoveSavedHandle(s__CrowdControl_timer, GetHandleId(target), id) + call FlushChildHashtable(s__CrowdControl_timer, GetHandleId(t)) + call DestroyTimer(t) + endif + endif + + set t=null + endfunction + + function s__CrowdControl_dispelAll takes unit target returns nothing + call s__CrowdControl_dispel(target , CROWD_CONTROL_SILENCE) + call s__CrowdControl_dispel(target , CROWD_CONTROL_STUN) + call s__CrowdControl_dispel(target , CROWD_CONTROL_SLOW) + call s__CrowdControl_dispel(target , CROWD_CONTROL_SLOW_ATTACK) + call s__CrowdControl_dispel(target , CROWD_CONTROL_BANISH) + call s__CrowdControl_dispel(target , CROWD_CONTROL_ENSNARE) + call s__CrowdControl_dispel(target , CROWD_CONTROL_PURGE) + call s__CrowdControl_dispel(target , CROWD_CONTROL_HEX) + call s__CrowdControl_dispel(target , CROWD_CONTROL_SLEEP) + call s__CrowdControl_dispel(target , CROWD_CONTROL_CYCLONE) + call s__CrowdControl_dispel(target , CROWD_CONTROL_ENTANGLE) + call s__CrowdControl_dispel(target , CROWD_CONTROL_DISARM) + call s__CrowdControl_dispel(target , CROWD_CONTROL_FEAR) + call s__CrowdControl_dispel(target , CROWD_CONTROL_TAUNT) + endfunction + + function s__CrowdControl_remaining takes unit target,integer id returns real + return TimerGetRemaining(LoadTimerHandle(s__CrowdControl_timer, GetHandleId(target), id)) + endfunction + + function s__CrowdControl_register takes integer id,code c returns nothing + if id >= CROWD_CONTROL_SILENCE and id <= CROWD_CONTROL_KNOCKUP then + if s__CrowdControl_event[id] == null then + set s__CrowdControl_event[id]=CreateTrigger() + endif + call TriggerAddCondition(s__CrowdControl_event[id], Filter(c)) + else + call TriggerAddCondition(s__CrowdControl_trigger, Filter(c)) + endif + endfunction + +//library CrowdControl ends +//library KeyMovementSystem: + + +function KeyMovementSystem__PolarProjectionX takes real x,real angle,real distance returns real + return x + distance * Cos(angle * bj_DEGTORAD) +endfunction + +function KeyMovementSystem__PolarProjectionY takes real y,real angle,real distance returns real + return y + distance * Sin(angle * bj_DEGTORAD) +endfunction + +function MovementSystemSetPlayerUnit takes player whichPlayer,unit whichUnit returns nothing + set KeyMovementSystem__Unit[GetPlayerId(whichPlayer)]=whichUnit +endfunction + +function MovementSystemResetPlayerUnit takes player whichPlayer returns nothing + set KeyMovementSystem__Unit[GetPlayerId(whichPlayer)]=null +endfunction + +function MovementSystemGetPlayerUnit takes player whichPlayer returns unit + return KeyMovementSystem__Unit[GetPlayerId(whichPlayer)] +endfunction + +function KeyMovementSystem__GetActualUnit takes player whichPlayer returns unit + local unit cargo= (KeyMovementSystem__Unit[GetPlayerId((whichPlayer))]) // INLINED!! + local unit transporter= (UnitEventEx__Transporter[(GetUnitUserData(((cargo))))]) // INLINED!! + if ( transporter != null ) then + return transporter + endif + return cargo +endfunction + +function KeyMovementSystem__TriggerConditionCanMove takes nothing returns boolean + return (KeyMovementSystem__Unit[GetPlayerId((GetTriggerPlayer()))]) != null and KeyMovementSystem__GetActualUnit(GetTriggerPlayer()) != null and GetOwningPlayer(KeyMovementSystem__GetActualUnit(GetTriggerPlayer())) == GetOwningPlayer((KeyMovementSystem__Unit[GetPlayerId((GetTriggerPlayer()))])) // INLINED!! +endfunction + +function KeyMovementSystem__TriggerActionMoveForward takes nothing returns nothing + set KeyMovementSystem__MoveForward[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionMovementForwardStop takes nothing returns boolean + return KeyMovementSystem__MoveForward[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionMoveForwardStop takes nothing returns nothing + set KeyMovementSystem__MoveForward[GetPlayerId(GetTriggerPlayer())]=false + call ResetUnitAnimation(KeyMovementSystem__GetActualUnit(GetTriggerPlayer())) +endfunction + +function KeyMovementSystem__TriggerActionMoveBackward takes nothing returns nothing + set KeyMovementSystem__MoveBackward[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionMovementBackwardStop takes nothing returns boolean + return KeyMovementSystem__MoveBackward[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionMoveBackwardStop takes nothing returns nothing + set KeyMovementSystem__MoveBackward[GetPlayerId(GetTriggerPlayer())]=false + call ResetUnitAnimation(KeyMovementSystem__GetActualUnit(GetTriggerPlayer())) +endfunction + +function KeyMovementSystem__TriggerActionMoveUp takes nothing returns nothing + set KeyMovementSystem__MoveUp[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionMovementUpStop takes nothing returns boolean + return KeyMovementSystem__MoveUp[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionMoveUpStop takes nothing returns nothing + set KeyMovementSystem__MoveUp[GetPlayerId(GetTriggerPlayer())]=false +endfunction + +function KeyMovementSystem__TriggerActionMoveDown takes nothing returns nothing + set KeyMovementSystem__MoveDown[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionMovementDownStop takes nothing returns boolean + return KeyMovementSystem__MoveDown[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionMoveDownStop takes nothing returns nothing + set KeyMovementSystem__MoveDown[GetPlayerId(GetTriggerPlayer())]=false +endfunction + +function KeyMovementSystem__TriggerActionRotateRight takes nothing returns nothing + set KeyMovementSystem__RotateRight[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionRotateRightStop takes nothing returns boolean + return KeyMovementSystem__RotateRight[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionRotateRightStop takes nothing returns nothing + set KeyMovementSystem__RotateRight[GetPlayerId(GetTriggerPlayer())]=false +endfunction + +function KeyMovementSystem__TriggerActionRotateLeft takes nothing returns nothing + set KeyMovementSystem__RotateLeft[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionRotateLeftStop takes nothing returns boolean + return KeyMovementSystem__RotateLeft[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionRotateLeftStop takes nothing returns nothing + set KeyMovementSystem__RotateLeft[GetPlayerId(GetTriggerPlayer())]=false +endfunction + +function KeyMovementSystem__TriggerActionMoveRight takes nothing returns nothing + set KeyMovementSystem__MoveRight[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionMoveRightStop takes nothing returns boolean + return KeyMovementSystem__MoveRight[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionMoveRightStop takes nothing returns nothing + set KeyMovementSystem__MoveRight[GetPlayerId(GetTriggerPlayer())]=false +endfunction + +function KeyMovementSystem__TriggerActionMoveLeft takes nothing returns nothing + set KeyMovementSystem__MoveLeft[GetPlayerId(GetTriggerPlayer())]=true +endfunction + +function KeyMovementSystem__TriggerConditionMoveLeftStop takes nothing returns boolean + return KeyMovementSystem__MoveLeft[GetPlayerId(GetTriggerPlayer())] +endfunction + +function KeyMovementSystem__TriggerActionMoveLeftStop takes nothing returns nothing + set KeyMovementSystem__MoveLeft[GetPlayerId(GetTriggerPlayer())]=false +endfunction + +function KeyMovementSystem__TimerFunctionUpdate takes nothing returns nothing + local player slotPlayer= null + local unit whichUnit= null + local real facing= 0.0 + local real x= 0.0 + local real y= 0.0 + local real speed= 5.0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + set whichUnit=KeyMovementSystem__GetActualUnit(slotPlayer) + if ( whichUnit != null and IsUnitAliveBJ(whichUnit) ) then + //call BJDebugMsg("Unit " + GetUnitName(whichUnit)) + if ( KeyMovementSystem__RotateRight[i] ) then + set facing=ModuloReal(GetUnitFacing(whichUnit) - KeyMovementSystem_MOVEMENT_SYSTEM_ROTATION_PER_INTERVAL, 360.0) + elseif ( KeyMovementSystem__RotateLeft[i] ) then + set facing=ModuloReal(GetUnitFacing(whichUnit) + KeyMovementSystem_MOVEMENT_SYSTEM_ROTATION_PER_INTERVAL, 360.0) + elseif ( KeyMovementSystem__MoveForward[i] ) then + //call BJDebugMsg("Move forward") + set facing=GetUnitFacing(whichUnit) + elseif ( KeyMovementSystem__MoveBackward[i] ) then + set facing=ModuloReal(GetUnitFacing(whichUnit) - 180.0, 360.0) + elseif ( KeyMovementSystem__MoveRight[i] ) then + set facing=ModuloReal(GetUnitFacing(whichUnit) - 90.0, 360.0) + elseif ( KeyMovementSystem__MoveLeft[i] ) then + set facing=ModuloReal(GetUnitFacing(whichUnit) + 90.0, 360.0) + endif + + set x=GetUnitX(whichUnit) + set y=GetUnitY(whichUnit) + set speed=GetUnitMoveSpeed(whichUnit) * KeyMovementSystem_TIMER_INTERVAL + //call BJDebugMsg("Move speed: " + R2S(speed)) + + if ( KeyMovementSystem__MoveForward[i] or KeyMovementSystem__MoveBackward[i] or KeyMovementSystem__MoveRight[i] or KeyMovementSystem__MoveLeft[i] ) then + //call BJDebugMsg("Move forward 2") + if ( GetUnitCurrentOrder(whichUnit) == OrderId("idle") ) then + //call BJDebugMsg("Move") + set x=KeyMovementSystem__PolarProjectionX(x , facing , speed) + set y=KeyMovementSystem__PolarProjectionY(y , facing , speed) + call SetUnitPosition(whichUnit, x, y) + call SetUnitFacing(whichUnit, facing) + //call SetUnitAnimation(whichUnit, "stand") + call QueueUnitAnimation(whichUnit, "walk") + endif + elseif ( KeyMovementSystem__RotateRight[i] or KeyMovementSystem__RotateLeft[i] ) then + call SetUnitFacing(whichUnit, facing) + endif + + if ( IsUnitType(whichUnit, UNIT_TYPE_FLYING) ) then + if ( KeyMovementSystem__MoveUp[i] ) then + call SetUnitFlyHeight(whichUnit, RMinBJ(GetUnitFlyHeight(whichUnit) + speed, KeyMovementSystem_MAX_HEIGHT), 0.0) + elseif ( KeyMovementSystem__MoveDown[i] ) then + call SetUnitFlyHeight(whichUnit, RMaxBJ(GetUnitFlyHeight(whichUnit) - speed, KeyMovementSystem_MIN_HEIGHT), 0.0) + endif + endif + endif + set whichUnit=null + set slotPlayer=null + set i=i + 1 + endloop +endfunction + +function MovementSystemEnable takes nothing returns nothing + call TimerStart(KeyMovementSystem__UpdateTimer, KeyMovementSystem_TIMER_INTERVAL, true, function KeyMovementSystem__TimerFunctionUpdate) +endfunction + +function MovementSystemDisable takes nothing returns nothing + call PauseTimer(KeyMovementSystem__UpdateTimer) +endfunction + +function KeyMovementSystem__Init takes nothing returns nothing + local player slotPlayer= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__ForwardTrigger, slotPlayer, OSKEY_I, 0, true) + //call BlzTriggerRegisterPlayerKeyEvent(ForwardTrigger, slotPlayer, OSKEY_NUMPAD8, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__ForwardStopTrigger, slotPlayer, OSKEY_I, 0, false) + //call BlzTriggerRegisterPlayerKeyEvent(ForwardStopTrigger, slotPlayer, OSKEY_NUMPAD8, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpTrigger, slotPlayer, OSKEY_SPACE, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpTrigger, slotPlayer, OSKEY_OEM_PLUS, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpStopTrigger, slotPlayer, OSKEY_SPACE, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__UpStopTrigger, slotPlayer, OSKEY_OEM_PLUS, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownTrigger, slotPlayer, OSKEY_X, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownTrigger, slotPlayer, OSKEY_OEM_MINUS, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownStopTrigger, slotPlayer, OSKEY_X, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__DownStopTrigger, slotPlayer, OSKEY_OEM_MINUS, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__BackwardTrigger, slotPlayer, OSKEY_K, 0, true) + //call BlzTriggerRegisterPlayerKeyEvent(BackwardTrigger, slotPlayer, OSKEY_NUMPAD2, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__BackwardStopTrigger, slotPlayer, OSKEY_K, 0, false) + //call BlzTriggerRegisterPlayerKeyEvent(BackwardStopTrigger, slotPlayer, OSKEY_NUMPAD2, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightRotateTrigger, slotPlayer, OSKEY_L, 0, true) + //call BlzTriggerRegisterPlayerKeyEvent(RightRotateTrigger, slotPlayer, OSKEY_NUMPAD6, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightRotateStopTrigger, slotPlayer, OSKEY_L, 0, false) + //call BlzTriggerRegisterPlayerKeyEvent(RightRotateStopTrigger, slotPlayer, OSKEY_NUMPAD6, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftRotateTrigger, slotPlayer, OSKEY_J, 0, true) + //call BlzTriggerRegisterPlayerKeyEvent(LeftRotateTrigger, slotPlayer, OSKEY_NUMPAD4, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftRotateStopTrigger, slotPlayer, OSKEY_J, 0, false) + //call BlzTriggerRegisterPlayerKeyEvent(LeftRotateStopTrigger, slotPlayer, OSKEY_NUMPAD4, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightTrigger, slotPlayer, OSKEY_O, 0, true) + //call BlzTriggerRegisterPlayerKeyEvent(RightTrigger, slotPlayer, OSKEY_NUMPAD9, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__RightStopTrigger, slotPlayer, OSKEY_O, 0, false) + //call BlzTriggerRegisterPlayerKeyEvent(RightStopTrigger, slotPlayer, OSKEY_NUMPAD9, 0, false) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftTrigger, slotPlayer, OSKEY_U, 0, true) + //call BlzTriggerRegisterPlayerKeyEvent(LeftTrigger, slotPlayer, OSKEY_NUMPAD7, 0, true) + call BlzTriggerRegisterPlayerKeyEvent(KeyMovementSystem__LeftStopTrigger, slotPlayer, OSKEY_U, 0, false) + //call BlzTriggerRegisterPlayerKeyEvent(LeftStopTrigger, slotPlayer, OSKEY_NUMPAD7, 0, false) + set slotPlayer=null + set i=i + 1 + endloop + + call TriggerAddCondition(KeyMovementSystem__ForwardTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__ForwardTrigger, function KeyMovementSystem__TriggerActionMoveForward) + call TriggerAddCondition(KeyMovementSystem__ForwardStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementForwardStop)) + call TriggerAddAction(KeyMovementSystem__ForwardStopTrigger, function KeyMovementSystem__TriggerActionMoveForwardStop) + + call TriggerAddCondition(KeyMovementSystem__UpTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__UpTrigger, function KeyMovementSystem__TriggerActionMoveUp) + call TriggerAddCondition(KeyMovementSystem__UpStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementUpStop)) + call TriggerAddAction(KeyMovementSystem__UpStopTrigger, function KeyMovementSystem__TriggerActionMoveUpStop) + + call TriggerAddCondition(KeyMovementSystem__DownTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__DownTrigger, function KeyMovementSystem__TriggerActionMoveDown) + call TriggerAddCondition(KeyMovementSystem__DownStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementDownStop)) + call TriggerAddAction(KeyMovementSystem__DownStopTrigger, function KeyMovementSystem__TriggerActionMoveDownStop) + + call TriggerAddCondition(KeyMovementSystem__BackwardTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__BackwardTrigger, function KeyMovementSystem__TriggerActionMoveBackward) + call TriggerAddCondition(KeyMovementSystem__BackwardStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMovementBackwardStop)) + call TriggerAddAction(KeyMovementSystem__BackwardStopTrigger, function KeyMovementSystem__TriggerActionMoveBackwardStop) + + call TriggerAddCondition(KeyMovementSystem__RightRotateTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__RightRotateTrigger, function KeyMovementSystem__TriggerActionRotateRight) + call TriggerAddCondition(KeyMovementSystem__RightRotateStopTrigger, Condition(function KeyMovementSystem__TriggerConditionRotateRightStop)) + call TriggerAddAction(KeyMovementSystem__RightRotateStopTrigger, function KeyMovementSystem__TriggerActionRotateRightStop) + + call TriggerAddCondition(KeyMovementSystem__LeftRotateTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__LeftRotateTrigger, function KeyMovementSystem__TriggerActionRotateLeft) + call TriggerAddCondition(KeyMovementSystem__LeftRotateStopTrigger, Condition(function KeyMovementSystem__TriggerConditionRotateLeftStop)) + call TriggerAddAction(KeyMovementSystem__LeftRotateStopTrigger, function KeyMovementSystem__TriggerActionRotateLeftStop) + + call TriggerAddCondition(KeyMovementSystem__RightTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__RightTrigger, function KeyMovementSystem__TriggerActionMoveRight) + call TriggerAddCondition(KeyMovementSystem__RightStopTrigger, Condition(function KeyMovementSystem__TriggerConditionMoveRightStop)) + call TriggerAddAction(KeyMovementSystem__RightStopTrigger, function KeyMovementSystem__TriggerActionMoveRightStop) + + call TriggerAddCondition(KeyMovementSystem__LeftTrigger, Condition(function KeyMovementSystem__TriggerConditionCanMove)) + call TriggerAddAction(KeyMovementSystem__LeftTrigger, function KeyMovementSystem__TriggerActionMoveLeft) + call TriggerAddCondition(KeyMovementSystem__LeftTrigger, Condition(function KeyMovementSystem__TriggerConditionMoveLeftStop)) + call TriggerAddAction(KeyMovementSystem__LeftTrigger, function KeyMovementSystem__TriggerActionMoveLeftStop) +endfunction + + +//library KeyMovementSystem ends +//library LogUI: + + +function EnableLogUI takes nothing returns nothing + call EnableTrigger(LogUI___closeTrigger) + call EnableTrigger(LogUI___chatCommandTrigger) + call EnableTrigger(LogUI___logTrigger) +endfunction + +function DisableLogUI takes nothing returns nothing + call DisableTrigger(LogUI___closeTrigger) + call DisableTrigger(LogUI___chatCommandTrigger) + call DisableTrigger(LogUI___logTrigger) +endfunction + +function UpdateLogUIVisible takes nothing returns nothing + local integer max= (Log___logCounter[GetPlayerId((GetLocalPlayer()))]) // INLINED!! + local integer i= 0 + call BlzFrameSetText(LogUI___TextAreaFrame, "") + loop + exitwhen ( i == max ) + call BlzFrameAddText(LogUI___TextAreaFrame, (Log___log[Log___GetLogEntryIndex((GetLocalPlayer() ) , ( i))])) // INLINED!! + set i=i + 1 + endloop +endfunction + +function SetLogUIVisible takes boolean visible returns nothing + if ( visible ) then + call UpdateLogUIVisible() + endif + call BlzFrameSetVisible(LogUI___BackgroundFrame, visible) +endfunction + +function ShowLogUI takes nothing returns nothing + call SetLogUIVisible(true) +endfunction + +function HideLogUI takes nothing returns nothing + call SetLogUIVisible(false) +endfunction + +function SetLogUIVisibleForPlayer takes player whichPlayer,boolean visible returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call SetLogUIVisible(visible) + endif +endfunction + +function ShowLogUIForPlayer takes player whichPlayer returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call SetLogUIVisible(true) + endif +endfunction + +function HideLogUIForPlayer takes player whichPlayer returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call SetLogUIVisible(false) + endif +endfunction + +function LogUI___CloseFunction takes nothing returns nothing + call HideLogUIForPlayer(GetTriggerPlayer()) +endfunction + +function LogUI_CreateUI takes nothing returns nothing + local framehandle f= null + + set LogUI___BackgroundFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(LogUI___BackgroundFrame, FRAMEPOINT_TOPLEFT, LogUI_X, LogUI_Y) + call BlzFrameSetAbsPoint(LogUI___BackgroundFrame, FRAMEPOINT_BOTTOMRIGHT, LogUI_X + LogUI_WIDTH, LogUI_Y - LogUI_HEIGHT) + + set f=BlzCreateFrame("EscMenuTitleTextTemplate", LogUI___BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(f, FRAMEPOINT_TOPLEFT, LogUI_TITLE_X, LogUI_TITLE_Y) + call BlzFrameSetAbsPoint(f, FRAMEPOINT_BOTTOMRIGHT, LogUI_TITLE_X + LogUI_WIDTH, LogUI_TITLE_Y - LogUI_TITLE_HEIGHT) + call BlzFrameSetTextAlignment(f, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + call BlzFrameSetText(f, GetLocalizedString("MESSAGE_LOG")) + + set LogUI___TextAreaFrame=BlzCreateFrame("EscMenuTextAreaTemplate", LogUI___BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(LogUI___TextAreaFrame, FRAMEPOINT_TOPLEFT, LogUI_TEXT_AREA_X, LogUI_TEXT_AREA_Y) + call BlzFrameSetAbsPoint(LogUI___TextAreaFrame, FRAMEPOINT_BOTTOMRIGHT, LogUI_TEXT_AREA_X + LogUI_TEXT_AREA_WIDTH, LogUI_TEXT_AREA_Y - LogUI_TEXT_AREA_HEIGHT) + call BlzFrameSetFont(LogUI___TextAreaFrame, "MasterFont", 0.011, 0) + + set f=BlzCreateFrame("ScriptDialogButton", LogUI___BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(f, FRAMEPOINT_TOPLEFT, LogUI_CLOSE_BUTTON_X, LogUI_CLOSE_BUTTON_Y) + call BlzFrameSetAbsPoint(f, FRAMEPOINT_BOTTOMRIGHT, LogUI_CLOSE_BUTTON_X + LogUI_CLOSE_BUTTON_WIDTH, LogUI_CLOSE_BUTTON_Y - LogUI_CLOSE_BUTTON_HEIGHT) + call BlzFrameSetText(f, "|cffffcc00" + GetLocalizedString("OK") + "|r") + + if ( LogUI___closeTrigger != null ) then + call DestroyTrigger(LogUI___closeTrigger) + endif + set LogUI___closeTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(LogUI___closeTrigger, f, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(LogUI___closeTrigger, function LogUI___CloseFunction) + + call SetLogUIVisible(false) // INLINED!! +endfunction + +function LogUI___TriggerActionShowLogUI takes nothing returns nothing + call ShowLogUIForPlayer(GetTriggerPlayer()) +endfunction + +function LogUI___TriggerActionLog takes nothing returns nothing + if ( (Log___triggerLogPlayer) == GetLocalPlayer() ) then // INLINED!! + if ( BlzFrameIsVisible(LogUI___BackgroundFrame) ) then + call UpdateLogUIVisible() + endif + endif +endfunction + +function LogUI___TimerFunctionStart takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer i= 0 + local player slotPlayer= null + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( GetPlayerController(slotPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING ) then + if ( StringLength(LogUI_CHAT_COMMAND_SHORT) > 0 ) then + call TriggerRegisterPlayerChatEvent(LogUI___chatCommandTrigger, slotPlayer, LogUI_CHAT_COMMAND_SHORT, true) + endif + if ( StringLength(LogUI_CHAT_COMMAND) > 0 ) then + call TriggerRegisterPlayerChatEvent(LogUI___chatCommandTrigger, slotPlayer, LogUI_CHAT_COMMAND, true) + endif + endif + set slotPlayer=null + set i=i + 1 + endloop + call TriggerAddAction(LogUI___chatCommandTrigger, function LogUI___TriggerActionShowLogUI) + + call TriggerRegisterLogEvent(LogUI___logTrigger) + call TriggerAddAction(LogUI___logTrigger, function LogUI___TriggerActionLog) + + call BlzLoadTOCFile(LogUI_TOC_FILE) + + call LogUI_CreateUI() + + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function LogUI___Init takes nothing returns nothing + call TimerStart(CreateTimer(), 0.0, false, function LogUI___TimerFunctionStart) + // Prevents crashes on loading save games: + + call TriggerAddAction(FrameLoader___actionTrigger, (function LogUI_CreateUI)) // INLINED!! + +endfunction + + +//library LogUI ends +//library MathUtils: + +function Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer + return ( ( Value1 * MaxValue2 ) + Value2 ) +endfunction + +function Index3D takes integer Value1,integer Value2,integer Value3,integer MaxValue2,integer MaxValue3 returns integer + return ( ( Value1 * ( MaxValue2 * MaxValue3 ) ) + ( Value2 * MaxValue3 ) + Value3 ) +endfunction + +function PolarProjectionX takes real x,real angle,real distance returns real + return x + distance * Cos(angle * bj_DEGTORAD) +endfunction + +function PolarProjectionY takes real y,real angle,real distance returns real + return y + distance * Sin(angle * bj_DEGTORAD) +endfunction + +function AngleBetweenCoordinatesRad takes real x1,real y1,real x2,real y2 returns real + return Atan2(y2 - y1, x2 - x1) +endfunction + +function AngleBetweenCoordinatesDeg takes real x1,real y1,real x2,real y2 returns real + return bj_RADTODEG * Atan2(y2 - y1, x2 - x1) +endfunction + + + +function AngleBetweenUnitsDeg takes unit whichUnit0,unit whichUnit1 returns real + return AngleBetweenCoordinatesDeg(GetUnitX(whichUnit0) , GetUnitY(whichUnit0) , GetUnitX(whichUnit1) , GetUnitY(whichUnit1)) +endfunction + + + +function DistanceBetweenUnits takes unit whichUnit0,unit whichUnit1 returns real + return DistanceBetweenCoordinates(GetUnitX(whichUnit0) , GetUnitY(whichUnit0) , GetUnitX(whichUnit1) , GetUnitY(whichUnit1)) +endfunction + +function DistanceBetweenUnitAndItem takes unit whichUnit,item whichItem returns real + return DistanceBetweenCoordinates(GetUnitX(whichUnit) , GetUnitY(whichUnit) , GetItemX(whichItem) , GetItemY(whichItem)) +endfunction + +function DistanceBetweenUnitAndDestructable takes unit whichUnit,destructable whichDestructable returns real + return DistanceBetweenCoordinates(GetUnitX(whichUnit) , GetUnitY(whichUnit) , GetDestructableX(whichDestructable) , GetDestructableY(whichDestructable)) +endfunction + +function IntToPrecentage takes integer v,integer max returns real + return ( I2R(v) * 100.0 ) / I2R(max) +endfunction + +function GetRectFromCircle takes real centerX,real centerY,real radius returns rect + return Rect(centerX - radius, centerY - radius, centerX + radius, centerY + radius) +endfunction + + +//library MathUtils ends +//library MissileUtils: + + // This is a simple Utils library for the Relativistic Missiles system. + // Credits: + // Sevion for the Alloc module + // - www.hiveworkshop.com/threads/snippet-alloc.192348/ + + + + + + function CreateMissileGroup takes nothing returns integer + return sc__MissileGroup_create() + endfunction + + function DestroyMissileGroup takes integer missiles returns nothing + if missiles != 0 then + call sc__MissileGroup_clear(missiles) + call sc__MissileGroup_destroy(missiles) + endif + endfunction + + function MissileGroupGetSize takes integer missiles returns integer + if missiles != 0 then + return s__MissileGroup_size[missiles] + else + return 0 + endif + endfunction + + function GroupMissileAt takes integer missiles,integer position returns integer + if missiles != 0 then + return sc__MissileGroup_missileAt(missiles,position) + else + return 0 + endif + endfunction + + function ClearMissileGroup takes integer missiles returns nothing + if missiles != 0 then + call sc__MissileGroup_clear(missiles) + endif + endfunction + + function IsMissileInGroup takes integer missile,integer missiles returns boolean + if missiles != 0 and missile != 0 then + if s__MissileGroup_size[missiles] > 0 then + return sc__MissileGroup_contains(missiles,missile) + else + return false + endif + else + return false + endif + endfunction + + function GroupRemoveMissile takes integer missiles,integer missile returns nothing + if missiles != 0 and missile != 0 then + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_remove(missiles,missile) + endif + endif + endfunction + + function GroupAddMissile takes integer missiles,integer missile returns nothing + if missiles != 0 and missile != 0 then + if not sc__MissileGroup_contains(missiles,missile) then + call sc__MissileGroup_insert(missiles,missile) + endif + endif + endfunction + + function GroupPickRandomMissile takes integer missiles returns integer + if missiles != 0 then + if s__MissileGroup_size[missiles] > 0 then + return sc__MissileGroup_missileAt(missiles,GetRandomInt(0, s__MissileGroup_size[missiles] - 1)) + else + return 0 + endif + else + return 0 + endif + endfunction + + function FirstOfMissileGroup takes integer missiles returns integer + if missiles != 0 then + if s__MissileGroup_size[missiles] > 0 then + return s__MissileUtils__MGroup_missile[s__MissileUtils__MGroup_next[s__MissileGroup_group[missiles]]] + else + return 0 + endif + else + return 0 + endif + endfunction + + function GroupAddMissileGroup takes integer source,integer destiny returns nothing + if source != 0 and destiny != 0 then + if s__MissileGroup_size[source] > 0 and source != destiny then + call sc__MissileGroup_addGroup(destiny,source) + endif + endif + endfunction + + function GroupRemoveMissileGroup takes integer source,integer destiny returns nothing + if source != 0 and destiny != 0 then + if source == destiny then + call sc__MissileGroup_clear(source) + elseif s__MissileGroup_size[source] > 0 then + call sc__MissileGroup_removeGroup(destiny,source) + endif + endif + endfunction + + function GroupEnumMissilesOfType takes integer missiles,integer whichType returns nothing + local integer i + local integer missile + + if missiles != 0 then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count + set missile=s__Missiles_collection[i] + + if s__Missiles_type[missile] == whichType then + call sc__MissileGroup_insert(missiles,missile) + endif + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesOfTypeCounted takes integer missiles,integer whichType,integer amount returns nothing + local integer i + local integer j= amount + local integer missile + + if missiles != 0 then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count or j == 0 + set missile=s__Missiles_collection[i] + + if s__Missiles_type[missile] == whichType then + call sc__MissileGroup_insert(missiles,missile) + endif + set j=j - 1 + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesOfPlayer takes integer missiles,player p returns nothing + local integer i + local integer missile + + if missiles != 0 then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count + set missile=s__Missiles_collection[i] + + if s__Missiles_owner[missile] == p then + call sc__MissileGroup_insert(missiles,missile) + endif + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesOfPlayerCounted takes integer missiles,player p,integer amount returns nothing + local integer i + local integer j= amount + local integer missile + + if missiles != 0 then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count or j == 0 + set missile=s__Missiles_collection[i] + + if s__Missiles_owner[missile] == p then + call sc__MissileGroup_insert(missiles,missile) + endif + set j=j - 1 + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesInRect takes integer missiles,rect r returns nothing + local integer i + local integer missile + + if missiles != 0 and r != null then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count + set missile=s__Missiles_collection[i] + + if GetRectMinX(r) <= s__Missiles_x[missile] and s__Missiles_x[missile] <= GetRectMaxX(r) and GetRectMinY(r) <= s__Missiles_y[missile] and s__Missiles_y[missile] <= GetRectMaxY(r) then + call sc__MissileGroup_insert(missiles,missile) + endif + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesInRectCounted takes integer missiles,rect r,integer amount returns nothing + local integer i + local integer j= amount + local integer missile + + if missiles != 0 and r != null then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count or j == 0 + set missile=s__Missiles_collection[i] + + if GetRectMinX(r) <= s__Missiles_x[missile] and s__Missiles_x[missile] <= GetRectMaxX(r) and GetRectMinY(r) <= s__Missiles_y[missile] and s__Missiles_y[missile] <= GetRectMaxY(r) then + call sc__MissileGroup_insert(missiles,missile) + endif + set j=j - 1 + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesInRangeOfLoc takes integer missiles,location loc,real radius returns nothing + local real dx + local real dy + local integer i + local integer missile + + if missiles != 0 and radius > 0 and loc != null then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count + set missile=s__Missiles_collection[i] + set dx=s__Missiles_x[missile] - GetLocationX(loc) + set dy=s__Missiles_y[missile] - GetLocationY(loc) + + if SquareRoot(dx * dx + dy * dy) <= radius then + call sc__MissileGroup_insert(missiles,missile) + endif + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesInRangeOfLocCounted takes integer missiles,location loc,real radius,integer amount returns nothing + local real dx + local real dy + local integer i + local integer j= amount + local integer missile + + if missiles != 0 and radius > 0 and loc != null then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count or j == 0 + set missile=s__Missiles_collection[i] + set dx=s__Missiles_x[missile] - GetLocationX(loc) + set dy=s__Missiles_y[missile] - GetLocationY(loc) + + if SquareRoot(dx * dx + dy * dy) <= radius then + call sc__MissileGroup_insert(missiles,missile) + endif + set j=j - 1 + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesInRange takes integer missiles,real x,real y,real radius returns nothing + local real dx + local real dy + local integer i + local integer missile + + if missiles != 0 and radius > 0 then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count + set missile=s__Missiles_collection[i] + set dx=s__Missiles_x[missile] - x + set dy=s__Missiles_y[missile] - y + + if SquareRoot(dx * dx + dy * dy) <= radius then + call sc__MissileGroup_insert(missiles,missile) + endif + set i=i + 1 + endloop + endif + endif + endfunction + + function GroupEnumMissilesInRangeCounted takes integer missiles,real x,real y,real radius,integer amount returns nothing + local real dx + local real dy + local integer i + local integer j= amount + local integer missile + + if missiles != 0 and radius > 0 then + if s__Missiles_count > - 1 then + set i=0 + + if s__MissileGroup_size[missiles] > 0 then + call sc__MissileGroup_clear(missiles) + endif + + loop + exitwhen i > s__Missiles_count or j == 0 + set missile=s__Missiles_collection[i] + set dx=s__Missiles_x[missile] - x + set dy=s__Missiles_y[missile] - y + + if SquareRoot(dx * dx + dy * dy) <= radius then + call sc__MissileGroup_insert(missiles,missile) + endif + set j=j - 1 + set i=i + 1 + endloop + endif + endif + endfunction + + + + + +//Implemented from module MissileUtils__LinkedList: + + function s__MissileUtils__MGroup_init takes integer this returns integer + set s__MissileUtils__MGroup_next[this]=this + set s__MissileUtils__MGroup_prev[this]=this + + return this + endfunction + + function s__MissileUtils__MGroup_pushBack takes integer this,integer node returns integer + set s__MissileUtils__MGroup_prev[node]=s__MissileUtils__MGroup_prev[this] + set s__MissileUtils__MGroup_next[node]=this + set s__MissileUtils__MGroup_next[s__MissileUtils__MGroup_prev[this]]=node + set s__MissileUtils__MGroup_prev[this]=node + + return node + endfunction + + function s__MissileUtils__MGroup_pushFront takes integer this,integer node returns integer + set s__MissileUtils__MGroup_prev[node]=this + set s__MissileUtils__MGroup_next[node]=s__MissileUtils__MGroup_next[this] + set s__MissileUtils__MGroup_prev[s__MissileUtils__MGroup_next[this]]=node + set s__MissileUtils__MGroup_next[this]=node + + return node + endfunction + + function s__MissileUtils__MGroup_pop takes integer this returns nothing + set s__MissileUtils__MGroup_next[s__MissileUtils__MGroup_prev[this]]=s__MissileUtils__MGroup_next[this] + set s__MissileUtils__MGroup_prev[s__MissileUtils__MGroup_next[this]]=s__MissileUtils__MGroup_prev[this] + endfunction +//Implemented from module Alloc: + + function s__MissileUtils__MGroup_allocate takes nothing returns integer + local integer this + + if ( s__MissileUtils__MGroup_Alloc__recycle[(0)] == 0 ) then + set s__MissileUtils__MGroup_Alloc__instanceCount=s__MissileUtils__MGroup_Alloc__instanceCount + 1 + set this=s__MissileUtils__MGroup_Alloc__instanceCount + else + set this=s__MissileUtils__MGroup_Alloc__recycle[(0)] + set s__MissileUtils__MGroup_Alloc__recycle[(0)]=s__MissileUtils__MGroup_Alloc__recycle[s__MissileUtils__MGroup_Alloc__recycle[(0)]] + endif + + + return this + endfunction + + function s__MissileUtils__MGroup_deallocate takes integer this returns nothing + set s__MissileUtils__MGroup_Alloc__recycle[this]=s__MissileUtils__MGroup_Alloc__recycle[(0)] + set s__MissileUtils__MGroup_Alloc__recycle[(0)]=this + endfunction + + + function s__MissileUtils__MGroup_remove takes integer this returns nothing + call s__MissileUtils__MGroup_pop(this) + call s__MissileUtils__MGroup_deallocate(this) + endfunction + + function s__MissileUtils__MGroup_insert takes integer this,integer m returns integer + local integer node= s__MissileUtils__MGroup_pushBack(this,s__MissileUtils__MGroup_allocate()) + + set s__MissileUtils__MGroup_missile[node]=m + + return node + endfunction + + function s__MissileUtils__MGroup_create takes nothing returns integer + return s__MissileUtils__MGroup_init((s__MissileUtils__MGroup_allocate())) + endfunction + + + function s__MissileGroup_destroy takes integer this returns nothing + call s__MissileUtils__MGroup_deallocate(s__MissileGroup_group[this]) + call s__MissileGroup_deallocate(this) + endfunction + + function s__MissileGroup_missileAt takes integer this,integer i returns integer + local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + local integer j= 0 + + if s__MissileGroup_size[this] > 0 and i <= s__MissileGroup_size[this] - 1 then + loop + exitwhen j == i + set node=s__MissileUtils__MGroup_next[node] + set j=j + 1 + endloop + + return s__MissileUtils__MGroup_missile[node] + else + return 0 + endif + endfunction + + function s__MissileGroup_remove takes integer this,integer missile returns nothing + local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + + loop + exitwhen node == s__MissileGroup_group[this] + if s__MissileUtils__MGroup_missile[node] == missile then + set s__MissileGroup_size[this]=s__MissileGroup_size[this] - 1 + call s__MissileUtils__MGroup_remove(node) + exitwhen true + endif + set node=s__MissileUtils__MGroup_next[node] + endloop + endfunction + + function s__MissileGroup_insert takes integer this,integer missile returns nothing + set s__MissileGroup_size[this]=s__MissileGroup_size[this] + 1 + call s__MissileUtils__MGroup_insert(s__MissileGroup_group[this],missile) + endfunction + + function s__MissileGroup_clear takes integer this returns nothing + local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + + loop + exitwhen node == s__MissileGroup_group[this] + call s__MissileUtils__MGroup_remove(node) + set node=s__MissileUtils__MGroup_next[node] + endloop + + set s__MissileGroup_size[this]=0 + endfunction + + function s__MissileGroup_contains takes integer this,integer missile returns boolean + local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + local boolean found= false + + loop + exitwhen node == s__MissileGroup_group[this] + if s__MissileUtils__MGroup_missile[node] == missile then + set found=true + exitwhen true + endif + set node=s__MissileUtils__MGroup_next[node] + endloop + + return found + endfunction + + function s__MissileGroup_addGroup takes integer this,integer source returns nothing + local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[source]] + + loop + exitwhen node == s__MissileGroup_group[source] + if not s__MissileGroup_contains(this,s__MissileUtils__MGroup_missile[node]) then + call s__MissileGroup_insert(this,s__MissileUtils__MGroup_missile[node]) + endif + set node=s__MissileUtils__MGroup_next[node] + endloop + endfunction + + function s__MissileGroup_removeGroup takes integer this,integer source returns nothing + local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[source]] + + loop + exitwhen node == s__MissileGroup_group[source] + if s__MissileGroup_contains(this,s__MissileUtils__MGroup_missile[node]) then + call s__MissileGroup_remove(this,s__MissileUtils__MGroup_missile[node]) + endif + set node=s__MissileUtils__MGroup_next[node] + endloop + endfunction + + function s__MissileGroup_create takes nothing returns integer + local integer this= s__MissileGroup__allocate() + + set s__MissileGroup_group[this]=(s__MissileUtils__MGroup_init((s__MissileUtils__MGroup_allocate()))) // INLINED!! + set s__MissileGroup_size[this]=0 + + return this + endfunction + +//library MissileUtils ends +//library PagedButtonsUI: + + + + + + + + + + + + + + + + + + + + + + + + + + +function SetPagedButtonsUIEnabledForPlayer takes player whichPlayer,boolean enabled returns nothing + set PagedButtonsUI__enabledForPlayer[GetPlayerId(whichPlayer)]=enabled +endfunction + +function IsPagedButtonsUIEnabledForPlayer takes player whichPlayer returns boolean + return PagedButtonsUI__enabledForPlayer[GetPlayerId(whichPlayer)] +endfunction + +function PagedButtonsUI__GetButtonSlotIcon takes unit shop,integer index returns string + return BlzGetAbilityIcon(GetPagedButtonId(shop , index)) +endfunction + +function PagedButtonsUI__GetMaxPageIndex takes integer playerId returns integer + return GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI__UIShop[playerId]) / PagedButtonsUI_MAX_SLOTS +endfunction + +function PagedButtonsUI__SetSlotChargesVisible takes integer i,boolean visible returns nothing + call BlzFrameSetVisible(PagedButtonsUI__SlotChargesBackgroundFrame[i], visible) + call BlzFrameSetVisible(PagedButtonsUI__SlotChargesFrame[i], visible) +endfunction + +function PagedButtonsUI__SetTooltipVisible takes boolean visible returns nothing + call BlzFrameSetVisible(PagedButtonsUI__TooltipIcon, visible) + call BlzFrameSetVisible(PagedButtonsUI__PageNameText, visible) + call BlzFrameSetVisible(PagedButtonsUI__SummonFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__TooltipText, visible) + call BlzFrameSetVisible(PagedButtonsUI__ItemGoldFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__ItemGoldIconFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__ItemLumberFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__ItemLumberIconFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__ItemFoodFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__ItemFoodIconFrame, visible) + + + +endfunction + +function PagedButtonsUI__SetVisible takes boolean visible returns nothing + call BlzFrameSetVisible(PagedButtonsUI__BackgroundFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__TitleFrame, visible) + call BlzFrameSetVisible(PagedButtonsUI__Checkbox, visible) + + call PagedButtonsUI__SetTooltipVisible(visible) +endfunction + +function PagedButtonsUI__SetSlotVisible takes integer i,boolean visible returns nothing + call BlzFrameSetVisible(PagedButtonsUI__SlotFrame[i], visible) + call BlzFrameSetVisible(PagedButtonsUI__SlotBackdropFrame[i], visible) + call BlzFrameSetVisible(PagedButtonsUI__SlotPageBackgroundFrame[i], visible) + call BlzFrameSetVisible(PagedButtonsUI__SlotPageFrame[i], visible) + if ( visible ) then + set visible=PagedButtonsUI__checked // async + endif + call PagedButtonsUI__SetSlotChargesVisible(i , visible) +endfunction + +function PagedButtonsUI__SetAllSlotChargesVisibleForPlayer takes player whichPlayer,boolean visible returns nothing + local integer i= 0 + loop + exitwhen ( i >= PagedButtonsUI_MAX_SLOTS ) + if ( whichPlayer == GetLocalPlayer() ) then + if ( BlzFrameIsVisible(PagedButtonsUI__SlotFrame[i]) ) then + call PagedButtonsUI__SetSlotChargesVisible(i , visible) + endif + endif + set i=i + 1 + endloop +endfunction + +function PagedButtonsUI__UpdateItemsForUI takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer objectId= 0 + local integer i= 0 + local unit shop= PagedButtonsUI__UIShop[playerId] + local integer slot= 0 + local integer nonSpacerSlots= 0 + local integer startSlot= PagedButtonsUI__PagesIndex[playerId] * PagedButtonsUI_MAX_SLOTS + local integer maxSlots= GetPagedButtonsCount(shop) + local integer page= GetPagedButtonsPage(shop) + local string pageName= GetPagedButtonsPageName(shop , page) + local integer maxPageIndex= (GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI__UIShop[(playerId)]) / PagedButtonsUI_MAX_SLOTS) // INLINED!! + local integer handleId= 0 + if ( pageName == null or StringLength(pageName) == 0 ) then + set pageName=GetUnitName(shop) + endif + if ( maxPageIndex > 0 ) then + set pageName=pageName + " (" + I2S(PagedButtonsUI__PagesIndex[playerId] + 1) + "/" + I2S(maxPageIndex + 1) + ")" + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(PagedButtonsUI__NextPagesButton, true) + call BlzFrameSetVisible(PagedButtonsUI__PreviousPagesButton, true) + endif + else + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(PagedButtonsUI__NextPagesButton, false) + call BlzFrameSetVisible(PagedButtonsUI__PreviousPagesButton, false) + endif + endif + //call BJDebugMsg("max page index " + I2S(maxPageIndex)) + // set UIShop[playerId] = shop + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetText(PagedButtonsUI__TitleFrame, pageName) + endif + loop + exitwhen ( slot >= maxSlots or i >= PagedButtonsUI_MAX_SLOTS ) + if ( not (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_SPACER) ) then // INLINED!! + set nonSpacerSlots=nonSpacerSlots + 1 + if ( nonSpacerSlots > startSlot ) then + set objectId=GetPagedButtonId(shop , slot) + if ( PagedButtonsUI__UIVisible[playerId] ) then // and GetItemCharges(index) > 0 + if ( whichPlayer == GetLocalPlayer() ) then + //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) + call BlzFrameSetTexture(PagedButtonsUI__SlotBackdropFrame[i], BlzGetAbilityIcon(objectId), 0, true) + call BlzFrameSetText(PagedButtonsUI__SlotChargesFrame[i], "1") // I2S(GetItemCharges(index)) + call BlzFrameSetText(PagedButtonsUI__SlotPageFrame[i], I2S(GetPagedButtonsPageByIndex(shop , slot) + 1)) + call BlzFrameSetVisible(PagedButtonsUI__SlotChargesBackgroundFrame[i], PagedButtonsUI__checked) + call BlzFrameSetVisible(PagedButtonsUI__SlotChargesFrame[i], PagedButtonsUI__checked) + + + + + call BlzFrameSetVisible(PagedButtonsUI__SlotFrame[i], true) + call BlzFrameSetVisible(PagedButtonsUI__SlotBackdropFrame[i], true) + endif + endif + + set handleId=GetHandleId(PagedButtonsUI__SlotClickTrigger[i]) + call SaveInteger(PagedButtonsUI__h, handleId, 0, slot) + set handleId=GetHandleId(PagedButtonsUI__SlotTooltipOnTrigger[i]) + call SaveInteger(PagedButtonsUI__h, handleId, 0, slot) + set handleId=GetHandleId(PagedButtonsUI__SlotTooltipOffTrigger[i]) + call SaveInteger(PagedButtonsUI__h, handleId, 0, slot) + + set i=i + 1 + endif + endif + + set slot=slot + 1 + endloop + + loop + exitwhen ( i >= PagedButtonsUI_MAX_SLOTS ) + if ( whichPlayer == GetLocalPlayer() ) then + call PagedButtonsUI__SetSlotVisible(i , false) + endif + set i=i + 1 + endloop + +endfunction + +function PagedButtonsUI__UIExists takes nothing returns boolean + return PagedButtonsUI__BackgroundFrame != null +endfunction + +function PagedButtonsUI__GetPagesIndexFromPagedButtonsShopEx takes unit shop returns integer + local integer currentPage= GetPagedButtonsPage(shop) + local integer i= 0 + local integer max= GetPagedButtonsCount(shop) + local integer countNonSpacerButtons= 0 + loop + exitwhen ( i >= max ) + if ( GetPagedButtonsPageByIndex(shop , i) >= currentPage ) then + return countNonSpacerButtons / PagedButtonsUI_MAX_SLOTS + endif + + if ( not (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( i))) == PagedButtons_BUTTON_TYPE_SPACER) ) then // INLINED!! + set countNonSpacerButtons=countNonSpacerButtons + 1 + endif + set i=i + 1 + endloop + return 0 +endfunction + +function PagedButtonsUI__GetPagesIndexFromPagedButtonsShop takes unit shop returns integer + if ( (IsUnitInGroup((shop), PagedButtons__shops)) ) then // INLINED!! + return PagedButtonsUI__GetPagesIndexFromPagedButtonsShopEx(shop) + endif + return 0 +endfunction + +function ShowPagedButtonsUI takes player whichPlayer,unit shop returns nothing + local integer playerId= GetPlayerId(whichPlayer) + if ( not (PagedButtonsUI__BackgroundFrame != null) ) then // INLINED!! + return + endif + set PagedButtonsUI__UIVisible[playerId]=true + set PagedButtonsUI__UIShop[playerId]=shop + set PagedButtonsUI__PagesIndex[playerId]=PagedButtonsUI__GetPagesIndexFromPagedButtonsShop(shop) + call PagedButtonsUI__UpdateItemsForUI(whichPlayer) + if ( whichPlayer == GetLocalPlayer() ) then + call PagedButtonsUI__SetVisible(true) + call PagedButtonsUI__SetTooltipVisible(false) + endif +endfunction + +function PagedButtonsUI__HidePagedButtonsUISlots takes nothing returns nothing + local integer i= 0 + loop + exitwhen ( i == PagedButtonsUI_MAX_SLOTS ) + call PagedButtonsUI__SetSlotVisible(i , false) + set i=i + 1 + endloop +endfunction + +function HidePagedButtonsUI takes nothing returns nothing + call PagedButtonsUI__SetVisible(false) + call PagedButtonsUI__HidePagedButtonsUISlots() +endfunction + +function HidePagedButtonsUIForPlayer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer index= 0 + if ( not (PagedButtonsUI__BackgroundFrame != null) ) then // INLINED!! + return + endif + set PagedButtonsUI__UIVisible[playerId]=false + set PagedButtonsUI__UIShop[playerId]=null + set PagedButtonsUI__PagesIndex[playerId]=0 + + + + + + + if ( whichPlayer == GetLocalPlayer() ) then + call PagedButtonsUI__SetVisible(false) + endif + set i=0 + loop + exitwhen ( i == PagedButtonsUI_MAX_SLOTS ) + if ( whichPlayer == GetLocalPlayer() ) then + call PagedButtonsUI__SetSlotVisible(i , false) + endif + set i=i + 1 + endloop +endfunction + +function PagedButtonsUI__ClickItemFunction takes nothing returns nothing + local integer handleId= GetHandleId(GetTriggeringTrigger()) + local integer slot= LoadInteger(PagedButtonsUI__h, handleId, 0) + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzSendSyncData(PagedButtonsUI_PREFIX, I2S(slot)) + endif +endfunction + +function PagedButtonsUI__CompareReals takes real a,real b returns boolean + return a >= b and a <= b +endfunction + + +function PagedButtonsUI__StringSplit takes string source,integer index,string separator returns string + local string result= null + local integer currentIndex= 0 + local integer separatorLength= StringLength(separator) + local integer length= StringLength(source) + local integer i= 0 + loop + exitwhen ( i == length or currentIndex > index ) + if ( SubString(source, i, i + separatorLength) == separator ) then + if ( currentIndex == index and result == null ) then + set result="" + endif + set currentIndex=currentIndex + 1 + set i=i + separatorLength + else + if ( currentIndex == index ) then + if ( result == null ) then + set result="" + endif + set result=result + SubString(source, i, i + 1) + endif + set i=i + 1 + endif + endloop + + return result +endfunction + +function PagedButtonsUI__SetTextAreaText takes framehandle f,string text returns nothing + local string t= null + local integer i= 0 + call BlzFrameSetText(f, "") + loop + set t=PagedButtonsUI__StringSplit(text , i , "|n") + exitwhen ( t == null ) + if ( StringLength(t) == 0 ) then + set t=" " // empty line + endif + call BlzFrameAddText(f, t) + set i=i + 1 + endloop +endfunction + +function PagedButtonsUI__EnterItemFunction takes nothing returns nothing + local integer handleId= GetHandleId(GetTriggeringTrigger()) + local integer slot= LoadInteger(PagedButtonsUI__h, handleId, 0) + local integer playerId= GetPlayerId(GetTriggerPlayer()) + local unit shop= PagedButtonsUI__UIShop[playerId] + local integer id= GetPagedButtonId(shop , slot) + local integer page= GetPagedButtonsPageByIndex(shop , slot) + local string pageName= "" + local string tooltip= "" + local integer goldCost= 0 + local integer lumberCost= 0 + local integer foodCost= 0 + local string summonText= "" + local real modelX= 0.0 + local real modelY= 0.0 + local real modelScale= 0.0 + local string modelPath= "" + + local integer c= GetPagedButtonsConfig(id) + + if ( slot >= 0 and slot < GetPagedButtonsCount(shop) ) then + set pageName=GetPagedButtonsPageName(shop , page) + set summonText=BlzGetAbilityTooltip(id, 0) + if ( (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_UNIT) ) then // INLINED!! + if ( IsUnitIdType(id, UNIT_TYPE_HERO) ) then + //call BJDebugMsg("Hero code " + A2S(id)) + + set goldCost=s__PagedButtonsConfig_heroGoldCost[c] + set lumberCost=s__PagedButtonsConfig_heroLumberCost[c] + + + + + else + set goldCost=GetUnitGoldCost(id) + set lumberCost=GetUnitWoodCost(id) + endif + set foodCost=GetFoodUsed(id) + elseif ( (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_ITEM) ) then // INLINED!! + set goldCost=GetItemValueGold(id) + set lumberCost=GetItemValueLumber(id) + endif + + + + + + + + + if ( summonText != null and StringLength(summonText) > 0 ) then + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetText(PagedButtonsUI__SummonFrame, summonText) + call BlzFrameSetVisible(PagedButtonsUI__SummonFrame, true) + endif + endif + + if ( goldCost > 0 ) then + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetText(PagedButtonsUI__ItemGoldFrame, "|cffffcc00" + I2S(goldCost) + "|r") + call BlzFrameSetVisible(PagedButtonsUI__ItemGoldIconFrame, true) + call BlzFrameSetVisible(PagedButtonsUI__ItemGoldFrame, true) + endif + else + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetVisible(PagedButtonsUI__ItemGoldIconFrame, false) + call BlzFrameSetVisible(PagedButtonsUI__ItemGoldFrame, false) + endif + endif + + if ( lumberCost > 0 ) then + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetText(PagedButtonsUI__ItemLumberFrame, "|cffffcc00" + I2S(lumberCost) + "|r") + call BlzFrameSetVisible(PagedButtonsUI__ItemLumberIconFrame, true) + call BlzFrameSetVisible(PagedButtonsUI__ItemLumberFrame, true) + endif + else + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetVisible(PagedButtonsUI__ItemLumberIconFrame, false) + call BlzFrameSetVisible(PagedButtonsUI__ItemLumberFrame, false) + endif + endif + + if ( foodCost > 0 ) then + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetText(PagedButtonsUI__ItemFoodFrame, "|cffffcc00" + I2S(foodCost) + "|r") + call BlzFrameSetVisible(PagedButtonsUI__ItemFoodIconFrame, true) + call BlzFrameSetVisible(PagedButtonsUI__ItemFoodFrame, true) + endif + else + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetVisible(PagedButtonsUI__ItemFoodIconFrame, false) + call BlzFrameSetVisible(PagedButtonsUI__ItemFoodFrame, false) + endif + endif + //call BJDebugMsg("Entering item " + I2S(index)) + + if ( pageName != null ) then + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetText(PagedButtonsUI__PageNameText, pageName) + call BlzFrameSetVisible(PagedButtonsUI__PageNameText, true) + endif + else + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetVisible(PagedButtonsUI__PageNameText, false) + endif + endif + + if ( id != 0 ) then + set tooltip=tooltip + BlzGetAbilityExtendedTooltip(id, 0) + else + set tooltip=tooltip + "Empty slot " + I2S(slot + 1) + " at page " + I2S(page + 1) + "." + //call BlzFrameSetVisible(ItemGoldIconFrame[playerId], false) + endif + + if ( id != 0 ) then + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetTexture(PagedButtonsUI__TooltipIcon, (BlzGetAbilityIcon(GetPagedButtonId((shop ) , ( slot)))), 0, false) // INLINED!! + call BlzFrameSetVisible(PagedButtonsUI__TooltipIcon, true) + endif + set tooltip=tooltip + PagedButtonsUI_BUY_TEXT + else + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetVisible(PagedButtonsUI__TooltipIcon, false) + endif + set tooltip=tooltip + PagedButtonsUI_OPEN_TEXT + endif + + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call PagedButtonsUI__SetTextAreaText(PagedButtonsUI__TooltipText , tooltip) + //call BlzFrameSetText(TooltipText, tooltip) + call BlzFrameSetVisible(PagedButtonsUI__TooltipText, true) + endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + endif + + set shop=null +endfunction + +function PagedButtonsUI__LeaveItemFunction takes nothing returns nothing + +endfunction + +function PagedButtonsUI__PreviousPagesFunction takes nothing returns nothing + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzSendSyncData(PagedButtonsUI_PREFIX, "PreviousPage") + endif +endfunction + +function PagedButtonsUI__NextPagesFunction takes nothing returns nothing + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzSendSyncData(PagedButtonsUI_PREFIX, "NextPage") + endif +endfunction + +function PagedButtonsUI__CheckedFunction takes nothing returns nothing + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + set PagedButtonsUI__checked=true + endif + call PagedButtonsUI__SetAllSlotChargesVisibleForPlayer(GetTriggerPlayer() , true) +endfunction + +function PagedButtonsUI__UncheckedFunction takes nothing returns nothing + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + set PagedButtonsUI__checked=false + endif + call PagedButtonsUI__SetAllSlotChargesVisibleForPlayer(GetTriggerPlayer() , false) +endfunction + +function PagedButtonsUI__CloseFunction takes nothing returns nothing + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzSendSyncData(PagedButtonsUI_PREFIX, "Close") + endif +endfunction + +function PagedButtonsUI_CreateUI takes nothing returns nothing + local integer i= 0 + local integer handleId= 0 + local real x= 0.0 + local real y= 0.0 + + set PagedButtonsUI__BackgroundFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__BackgroundFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_X, PagedButtonsUI_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__BackgroundFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_SIZE_X, PagedButtonsUI_Y - PagedButtonsUI_SIZE_Y) + + set y=PagedButtonsUI_TITLE_Y + set PagedButtonsUI__TitleFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__TitleFrame, FRAMEPOINT_TOPLEFT, 0.0, y) + call BlzFrameSetAbsPoint(PagedButtonsUI__TitleFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_SIZE_X, y - PagedButtonsUI_TITLE_HEIGHT) + call BlzFrameSetTextAlignment(PagedButtonsUI__TitleFrame, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set x=PagedButtonsUI_BUTTON_X + set y=PagedButtonsUI_BUTTON_Y + set i=0 + loop + exitwhen ( i == PagedButtonsUI_MAX_SLOTS ) + set PagedButtonsUI__SlotFrame[i]=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__SlotFrame[i], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(PagedButtonsUI__SlotFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + PagedButtonsUI_BUTTON_SIZE, y - PagedButtonsUI_BUTTON_SIZE) + //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(0), 0, true) + //call BlzFrameSetText(SlotFrame[index], I2S(index)) + + set PagedButtonsUI__SlotBackdropFrame[i]=BlzCreateFrameByType("BACKDROP", "PagedButtonsUIBackdropFrame" + I2S(i), PagedButtonsUI__SlotFrame[i], "", 1) + call BlzFrameSetAllPoints(PagedButtonsUI__SlotBackdropFrame[i], PagedButtonsUI__SlotFrame[i]) +// call BlzFrameSetTexture(SlotBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) + + set PagedButtonsUI__SlotClickTrigger[i]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__SlotClickTrigger[i], PagedButtonsUI__SlotFrame[i], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(PagedButtonsUI__SlotClickTrigger[i], function PagedButtonsUI__ClickItemFunction) + set handleId=GetHandleId(PagedButtonsUI__SlotClickTrigger[i]) + call SaveInteger(PagedButtonsUI__h, handleId, 0, i) + + set PagedButtonsUI__SlotTooltipOnTrigger[i]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__SlotTooltipOnTrigger[i], PagedButtonsUI__SlotFrame[i], FRAMEEVENT_MOUSE_ENTER) + call TriggerAddAction(PagedButtonsUI__SlotTooltipOnTrigger[i], function PagedButtonsUI__EnterItemFunction) + set handleId=GetHandleId(PagedButtonsUI__SlotTooltipOnTrigger[i]) + call SaveInteger(PagedButtonsUI__h, handleId, 0, i) + + set PagedButtonsUI__SlotTooltipOffTrigger[i]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__SlotTooltipOffTrigger[i], PagedButtonsUI__SlotFrame[i], FRAMEEVENT_MOUSE_LEAVE) + call TriggerAddAction(PagedButtonsUI__SlotTooltipOffTrigger[i], function PagedButtonsUI__LeaveItemFunction) + call SaveInteger(PagedButtonsUI__h, handleId, 0, i) + + // TODO Mouse down and mouse up to drag & drop to another bag or switch or do it like Warcraft's inventory with right click and left click. Add the icon of the item to the mouse cursor. If you click on the map it is dropped, if you click on the inventory it is dropped there. + + set PagedButtonsUI__SlotPageBackgroundFrame[i]=BlzCreateFrameByType("BACKDROP", "ItemBagBackrgroundFrame" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__SlotPageBackgroundFrame[i], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(PagedButtonsUI__SlotPageBackgroundFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + PagedButtonsUI_CHARGES_BACKGROUND_SIZE, y - PagedButtonsUI_CHARGES_BACKGROUND_SIZE) + call BlzFrameSetTexture(PagedButtonsUI__SlotPageBackgroundFrame[i], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) + call BlzFrameSetLevel(PagedButtonsUI__SlotPageBackgroundFrame[i], 1) + + set PagedButtonsUI__SlotPageFrame[i]=BlzCreateFrameByType("TEXT", "PagedButtonsUIBag" + I2S(i), PagedButtonsUI__SlotPageBackgroundFrame[i], "", 0) + call BlzFrameSetAllPoints(PagedButtonsUI__SlotPageFrame[i], PagedButtonsUI__SlotPageBackgroundFrame[i]) + call BlzFrameSetText(PagedButtonsUI__SlotPageFrame[i], I2S(i + 1)) + call BlzFrameSetTextAlignment(PagedButtonsUI__SlotPageFrame[i], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) + call BlzFrameSetScale(PagedButtonsUI__SlotPageFrame[i], 0.7) + call BlzFrameSetEnable(PagedButtonsUI__SlotPageFrame[i], false) + call BlzFrameSetLevel(PagedButtonsUI__SlotPageFrame[i], 2) + + set PagedButtonsUI__SlotChargesBackgroundFrame[i]=BlzCreateFrameByType("BACKDROP", "PagedButtonsUIItemChargesBackrgroundFrame" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__SlotChargesBackgroundFrame[i], FRAMEPOINT_TOPLEFT, x + PagedButtonsUI_BUTTON_SIZE - PagedButtonsUI_CHARGES_BACKGROUND_SIZE, y - PagedButtonsUI_BUTTON_SIZE + PagedButtonsUI_CHARGES_BACKGROUND_SIZE) + call BlzFrameSetAbsPoint(PagedButtonsUI__SlotChargesBackgroundFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + PagedButtonsUI_BUTTON_SIZE, y - PagedButtonsUI_BUTTON_SIZE) + call BlzFrameSetTexture(PagedButtonsUI__SlotChargesBackgroundFrame[i], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) + call BlzFrameSetLevel(PagedButtonsUI__SlotChargesBackgroundFrame[i], 1) + + set PagedButtonsUI__SlotChargesFrame[i]=BlzCreateFrameByType("TEXT", "PagedButtonsUICharges" + I2S(i), PagedButtonsUI__SlotChargesBackgroundFrame[i], "", 0) + call BlzFrameSetAllPoints(PagedButtonsUI__SlotChargesFrame[i], PagedButtonsUI__SlotChargesBackgroundFrame[i]) + call BlzFrameSetText(PagedButtonsUI__SlotChargesFrame[i], "|cffFFFFFFCharges|r") + call BlzFrameSetTextAlignment(PagedButtonsUI__SlotChargesFrame[i], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) + call BlzFrameSetScale(PagedButtonsUI__SlotChargesFrame[i], 0.7) + call BlzFrameSetEnable(PagedButtonsUI__SlotChargesFrame[i], false) + call BlzFrameSetLevel(PagedButtonsUI__SlotChargesFrame[i], 2) + + set x=x + PagedButtonsUI_BUTTON_SIZE + PagedButtonsUI_BUTTON_SPACE + + set i=i + 1 + + // every 3 bags start another line + if ( ModuloInteger(i, PagedButtonsUI_MAX_SLOTS_PER_LINE) == 0 ) then + set x=PagedButtonsUI_BUTTON_X + set y=y - PagedButtonsUI_BUTTON_SIZE - PagedButtonsUI_BUTTON_SPACE + endif + endloop + + set PagedButtonsUI__TooltipFrame=BlzCreateFrame("EscMenuBackdrop", PagedButtonsUI__BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__TooltipFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_FRAME_X, PagedButtonsUI_TOOLTIP_FRAME_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__TooltipFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_FRAME_X + PagedButtonsUI_TOOLTIP_FRAME_WIDTH, PagedButtonsUI_TOOLTIP_FRAME_Y - PagedButtonsUI_TOOLTIP_FRAME_HEIGHT) + + set PagedButtonsUI__TooltipIcon=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipIconFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__TooltipIcon, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_ICON_X, PagedButtonsUI_TOOLTIP_ICON_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__TooltipIcon, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_ICON_X + PagedButtonsUI_TOOLTIP_ICON_SIZE, PagedButtonsUI_TOOLTIP_ICON_Y - PagedButtonsUI_TOOLTIP_ICON_SIZE) + call BlzFrameSetTexture(PagedButtonsUI__TooltipIcon, "ReplaceableTextures\\WorldEditUI\\Editor-Random-Item.blp", 0, true) + + set PagedButtonsUI__PageNameText=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipPageName", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__PageNameText, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_PAGE_NAME_X, PagedButtonsUI_TOOLTIP_PAGE_NAME_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__PageNameText, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_PAGE_NAME_X + PagedButtonsUI_TOOLTIP_PAGE_NAME_WIDTH, PagedButtonsUI_TOOLTIP_PAGE_NAME_Y - PagedButtonsUI_TOOLTIP_PAGE_NAME_HEIGHT) + + set PagedButtonsUI__SummonFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipSummon", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__SummonFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_SUMMON_X, PagedButtonsUI_SUMMON_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__SummonFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_SUMMON_X + PagedButtonsUI_TOOLTIP_WIDTH, PagedButtonsUI_SUMMON_Y - PagedButtonsUI_SUMMON_HEIGHT) + + set PagedButtonsUI__ItemGoldIconFrame=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipGoldFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemGoldIconFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_X, PagedButtonsUI_COST_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemGoldIconFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_X + PagedButtonsUI_COST_ICON_SIZE, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) + call BlzFrameSetTexture(PagedButtonsUI__ItemGoldIconFrame, "UI\\Feedback\\Resources\\ResourceGold.blp", 0, true) + + set PagedButtonsUI__ItemGoldFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipGold", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemGoldFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_GOLD_X, PagedButtonsUI_COST_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemGoldFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_GOLD_X + PagedButtonsUI_COST_WIDTH, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_HEIGHT) + + set PagedButtonsUI__ItemLumberIconFrame=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipLumberFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemLumberIconFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_ICON_LUMBER_X, PagedButtonsUI_COST_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemLumberIconFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_ICON_LUMBER_X + PagedButtonsUI_COST_ICON_SIZE, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) + call BlzFrameSetTexture(PagedButtonsUI__ItemLumberIconFrame, "UI\\Feedback\\Resources\\ResourceLumber.blp", 0, true) + + set PagedButtonsUI__ItemLumberFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipLumber", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemLumberFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_LUMBER_X, PagedButtonsUI_COST_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemLumberFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_LUMBER_X + PagedButtonsUI_COST_WIDTH, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) + + set PagedButtonsUI__ItemFoodIconFrame=BlzCreateFrameByType("BACKDROP", "PagedButtonsUITooltipFoodFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemFoodIconFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_ICON_FOOD_X, PagedButtonsUI_COST_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemFoodIconFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_ICON_FOOD_X + PagedButtonsUI_COST_ICON_SIZE, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) + call BlzFrameSetTexture(PagedButtonsUI__ItemFoodIconFrame, "UI\\Feedback\\Resources\\ResourceSupply.blp", 0, true) + + set PagedButtonsUI__ItemFoodFrame=BlzCreateFrameByType("TEXT", "PagedButtonsUITooltipFood", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemFoodFrame, FRAMEPOINT_TOPLEFT, PagedButtonsUI_COST_FOOD_X, PagedButtonsUI_COST_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__ItemFoodFrame, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_COST_FOOD_X + PagedButtonsUI_COST_WIDTH, PagedButtonsUI_COST_Y - PagedButtonsUI_COST_ICON_SIZE) + + set PagedButtonsUI__TooltipText=BlzCreateFrame("EscMenuTextAreaTemplate", PagedButtonsUI__BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__TooltipText, FRAMEPOINT_TOPLEFT, PagedButtonsUI_TOOLTIP_X, PagedButtonsUI_TOOLTIP_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__TooltipText, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_TOOLTIP_X + PagedButtonsUI_TOOLTIP_WIDTH, PagedButtonsUI_TOOLTIP_Y - PagedButtonsUI_TOOLTIP_HEIGHT) + call BlzFrameSetFont(PagedButtonsUI__TooltipText, "MasterFont", PagedButtonsUI_TOOLTIP_FONT_HEIGHT, 0) + call BlzFrameSetEnable(PagedButtonsUI__TooltipText, false) + call BlzFrameSetTextAlignment(PagedButtonsUI__TooltipText, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_LEFT) + call BlzFrameSetLevel(PagedButtonsUI__TooltipText, 1) + + //call BJDebugMsg("Icon " + GetIconByItemType(itemTypeId) + " for item type " + GetObjectName(itemTypeId)) + + + + + + set PagedButtonsUI__NextPagesButton=BlzCreateFrame("ScriptDialogButton", PagedButtonsUI__BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__NextPagesButton, FRAMEPOINT_TOPLEFT, PagedButtonsUI_NEXT_PAGE_BUTTON_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__NextPagesButton, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_NEXT_PAGE_BUTTON_X + PagedButtonsUI_PAGE_BUTTON_WIDTH, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CLOSE_BUTTON_HEIGHT) + call BlzFrameSetText(PagedButtonsUI__NextPagesButton, PagedButtonsUI_NEXT_PAGE_TEXT) + + set PagedButtonsUI__NextPagesTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__NextPagesTrigger, PagedButtonsUI__NextPagesButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(PagedButtonsUI__NextPagesTrigger, function PagedButtonsUI__NextPagesFunction) + + set PagedButtonsUI__PreviousPagesButton=BlzCreateFrame("ScriptDialogButton", PagedButtonsUI__BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__PreviousPagesButton, FRAMEPOINT_TOPLEFT, PagedButtonsUI_PREVIOUS_PAGE_BUTTON_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__PreviousPagesButton, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_PREVIOUS_PAGE_BUTTON_X + PagedButtonsUI_PAGE_BUTTON_WIDTH, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CLOSE_BUTTON_HEIGHT) + call BlzFrameSetText(PagedButtonsUI__PreviousPagesButton, PagedButtonsUI_PREVIOUS_PAGE_TEXT) + + set PagedButtonsUI__PreviousPagesTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__PreviousPagesTrigger, PagedButtonsUI__PreviousPagesButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(PagedButtonsUI__PreviousPagesTrigger, function PagedButtonsUI__PreviousPagesFunction) + + set PagedButtonsUI__Checkbox=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__Checkbox, FRAMEPOINT_TOPLEFT, PagedButtonsUI_CHECKBOX_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__Checkbox, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_CHECKBOX_X + PagedButtonsUI_CHECKBOX_SIZE, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CHECKBOX_SIZE) + call BlzFrameSetEnable(PagedButtonsUI__Checkbox, true) + call BlzFrameSetValue(PagedButtonsUI__Checkbox, 1.0) + + set PagedButtonsUI__CheckedTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__CheckedTrigger, PagedButtonsUI__Checkbox, FRAMEEVENT_CHECKBOX_CHECKED) + call TriggerAddAction(PagedButtonsUI__CheckedTrigger, function PagedButtonsUI__CheckedFunction) + + set PagedButtonsUI__UncheckedTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__UncheckedTrigger, PagedButtonsUI__Checkbox, FRAMEEVENT_CHECKBOX_UNCHECKED) + call TriggerAddAction(PagedButtonsUI__UncheckedTrigger, function PagedButtonsUI__UncheckedFunction) + + set PagedButtonsUI__CloseButton=BlzCreateFrame("ScriptDialogButton", PagedButtonsUI__BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(PagedButtonsUI__CloseButton, FRAMEPOINT_TOPLEFT, PagedButtonsUI_CLOSE_BUTTON_X, PagedButtonsUI_BOTTOM_BUTTONS_Y) + call BlzFrameSetAbsPoint(PagedButtonsUI__CloseButton, FRAMEPOINT_BOTTOMRIGHT, PagedButtonsUI_CLOSE_BUTTON_X + PagedButtonsUI_CLOSE_BUTTON_WIDTH, PagedButtonsUI_BOTTOM_BUTTONS_Y - PagedButtonsUI_CLOSE_BUTTON_HEIGHT) + call BlzFrameSetText(PagedButtonsUI__CloseButton, PagedButtonsUI_CLOSE_TEXT) + + set PagedButtonsUI__CloseTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(PagedButtonsUI__CloseTrigger, PagedButtonsUI__CloseButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(PagedButtonsUI__CloseTrigger, function PagedButtonsUI__CloseFunction) + + call HidePagedButtonsUI() +endfunction + +function PagedButtonsUI__TriggerActionSelected takes nothing returns nothing + if ( (IsUnitInGroup((GetTriggerUnit()), PagedButtons__shops)) and GetPagedButtonsCount(GetTriggerUnit()) > 0 and (PagedButtonsUI__enabledForPlayer[GetPlayerId((GetTriggerPlayer()))]) ) then // INLINED!! + call ShowPagedButtonsUI(GetTriggerPlayer() , GetTriggerUnit()) + endif +endfunction + +function PagedButtonsUI__TriggerConditionChangePage takes nothing returns boolean + local unit shop= (PagedButtons__triggerShop) // INLINED!! + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( shop == PagedButtonsUI__UIShop[i] ) then + call PagedButtonsUI__UpdateItemsForUI(Player(i)) + endif + set i=i + 1 + endloop + set shop=null + return false +endfunction + +function PagedButtonsUI__TriggerConditionDeath takes nothing returns boolean + local unit shop= GetTriggerUnit() + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( shop == PagedButtonsUI__UIShop[i] ) then + call HidePagedButtonsUIForPlayer(Player(i)) + endif + set i=i + 1 + endloop + set shop=null + return false +endfunction + + +function PagedButtonsUI__TriggerActionSyncData takes nothing returns nothing + local player whichPlayer= GetTriggerPlayer() + local integer playerId= GetPlayerId(whichPlayer) + local string data= BlzGetTriggerSyncData() + local integer slot= 0 + local unit shop= PagedButtonsUI__UIShop[playerId] + local integer id= 0 + local integer newPage= 0 + if ( data == "PreviousPage" ) then + if ( PagedButtonsUI__PagesIndex[playerId] == 0 ) then + set PagedButtonsUI__PagesIndex[playerId]=(GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI__UIShop[(playerId)]) / PagedButtonsUI_MAX_SLOTS) // INLINED!! + else + set PagedButtonsUI__PagesIndex[playerId]=PagedButtonsUI__PagesIndex[playerId] - 1 + endif + call PagedButtonsUI__UpdateItemsForUI(whichPlayer) + //call BJDebugMsg("Previous pages button with index " + I2S(PagesIndex[playerId])) + elseif ( data == "NextPage" ) then + if ( PagedButtonsUI__PagesIndex[playerId] < (GetPagedButtonsNonSpacerButtonsCount(PagedButtonsUI__UIShop[(playerId)]) / PagedButtonsUI_MAX_SLOTS) ) then // INLINED!! + set PagedButtonsUI__PagesIndex[playerId]=PagedButtonsUI__PagesIndex[playerId] + 1 + else + set PagedButtonsUI__PagesIndex[playerId]=0 + endif + call PagedButtonsUI__UpdateItemsForUI(whichPlayer) + //call BJDebugMsg("Next pages button with index " + I2S(PagesIndex[playerId])) + elseif ( data == "Close" ) then + call HidePagedButtonsUIForPlayer(whichPlayer) + else + set slot=S2I(data) + set id=GetPagedButtonId(shop , slot) + set newPage=GetPagedButtonsPageByIndex(shop , slot) + if ( newPage < GetPagedButtonsMaxPages(shop) and newPage >= 0 ) then + call SetPagedButtonsPage(shop , newPage) + if ( id != 0 and ( (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_UNIT) or (sg__PagedButtons_Type_get_whichType(GetPagedButton((shop ) , ( slot))) == PagedButtons_BUTTON_TYPE_ITEM) ) ) then // INLINED!! + call IssueNeutralImmediateOrderById(whichPlayer, shop, id) + endif + endif + endif + set whichPlayer=null + set shop=null +endfunction + +function PagedButtonsUI__TimerFunctionStart takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer i= 0 + local player slotPlayer= null + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER ) then + set PagedButtonsUI__enabledForPlayer[i]=true + call BlzTriggerRegisterPlayerSyncEvent(PagedButtonsUI__SyncTrigger, slotPlayer, PagedButtonsUI_PREFIX, false) + + + + + + + endif + set slotPlayer=null + set i=i + 1 + endloop + call TriggerAddAction(PagedButtonsUI__SyncTrigger, function PagedButtonsUI__TriggerActionSyncData) + + call BlzLoadTOCFile(PagedButtonsUI_TOC_FILE) + + call PagedButtonsUI_CreateUI() + + call TriggerRegisterAnyUnitEventBJ(PagedButtonsUI__selectionTrigger, EVENT_PLAYER_UNIT_SELECTED) + // Barade: Using trigger conditions with selection events led to weird behavior, so use a trigger action here. + call TriggerAddAction(PagedButtonsUI__selectionTrigger, function PagedButtonsUI__TriggerActionSelected) + + call TriggerRegisterChangePagedButtons(PagedButtonsUI__changePageButtonsTrigger) + call TriggerAddCondition(PagedButtonsUI__changePageButtonsTrigger, Condition(function PagedButtonsUI__TriggerConditionChangePage)) + + call TriggerRegisterAnyUnitEventBJ(PagedButtonsUI__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(PagedButtonsUI__deathTrigger, Condition(function PagedButtonsUI__TriggerConditionDeath)) + + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function PagedButtonsUI__Init takes nothing returns nothing + call TimerStart(CreateTimer(), 0.0, false, function PagedButtonsUI__TimerFunctionStart) + call TriggerAddAction(FrameLoader___actionTrigger, (function PagedButtonsUI_CreateUI)) // INLINED!! + call TriggerAddAction(FrameSaver___saveTrigger, (function HidePagedButtonsUI)) // INLINED!! + + + +endfunction + + +//library PagedButtonsUI ends +//library QueueUI: + + +function IsQueueUIEnabledForPlayer takes player whichPlayer returns boolean + return QueueUI__enabledForPlayer[GetPlayerId(whichPlayer)] +endfunction + +function QueueUI__SetSlotVisible takes integer i,boolean visible returns nothing + call BlzFrameSetVisible(QueueUI__SlotFrame[i], visible) + call BlzFrameSetVisible(QueueUI__SlotBackdropFrame[i], visible) + call BlzFrameSetVisible(QueueUI__SlotChargesBackdropFrame[i], visible) + call BlzFrameSetVisible(QueueUI__SlotChargesFrame[i], visible) + call BlzFrameSetEnable(QueueUI__SlotTooltip[i], visible) +endfunction + +function QueueUI__SetAllSlotChargesVisible takes boolean visible returns nothing + local integer i= 0 + loop + exitwhen ( i >= QueueUI_MAX_SLOTS ) + call QueueUI__SetSlotVisible(i , visible) + set i=i + 1 + endloop +endfunction + +function QueueUI__UpdateUIForPlayer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer current= (Queue__playerQueue[GetPlayerId((whichPlayer))]) // INLINED!! + local integer i= 0 + if ( (QueueUI__enabledForPlayer[GetPlayerId((whichPlayer))]) and not QueueUI__checked[playerId] ) then // INLINED!! + loop + exitwhen ( i >= QueueUI_MAX_SLOTS or current == 0 ) + if ( whichPlayer == GetLocalPlayer() ) then + //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) + + call BlzFrameSetTexture(QueueUI__SlotBackdropFrame[i], QueueUIConfig_GetIcon(s__Queue_id[current] , whichPlayer), 0, true) + call BlzFrameSetText(QueueUI__SlotTooltip[i], QueueUIConfig_GetName(s__Queue_id[current] , whichPlayer)) + + + + + call BlzFrameSetText(QueueUI__SlotChargesFrame[i], I2S(s__Queue_counter[current])) + call BlzFrameSetEnable(QueueUI__SlotTooltip[i], true) + call QueueUI__SetSlotVisible(i , true) + endif + + //call BJDebugMsg("Show slot " + I2S(i) + ": " + BlzGetAbilityIcon(current.id)) + //call BJDebugMsg("UI check " + I2S(current) + " with ID " + GetObjectName(current.id)) + + set current=s__Queue_next[current] + set i=i + 1 + endloop + endif + + loop + exitwhen ( i >= QueueUI_MAX_SLOTS ) + if ( whichPlayer == GetLocalPlayer() ) then + //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) + call BlzFrameSetTexture(QueueUI__SlotBackdropFrame[i], "", 0, true) + call BlzFrameSetEnable(QueueUI__SlotTooltip[i], false) + call QueueUI__SetSlotVisible(i , false) + endif + + set i=i + 1 + endloop +endfunction + +function QueueUI__ForForceUpdateUI takes nothing returns nothing + call QueueUI__UpdateUIForPlayer(GetEnumPlayer()) +endfunction + +function QueueUI__UpdateUI takes nothing returns nothing + call ForForce(GetPlayersAll(), function QueueUI__ForForceUpdateUI) +endfunction + +function QueueUI__GetNextUnitToSelect takes group g,player whichPlayer returns unit + local integer max= BlzGroupGetSize(g) + local integer i= 0 + local unit u= null + local unit result= null + local boolean found= false + if ( max > 0 ) then + loop + exitwhen ( i == max ) + set u=BlzGroupUnitAt(g, i) + if ( IsUnitSelected(u, whichPlayer) ) then + set found=true + elseif ( found ) then + set result=u + endif + set u=null + set i=i + 1 + endloop + + // this happens if none of them is selected or the last one + if ( result == null ) then + set result=BlzGroupUnitAt(g, 0) // start at first + endif + endif + + return result +endfunction + +function QueueUI__DistanceBetweenCoordinates takes real x1,real y1,real x2,real y2 returns real + local real dx= ( x2 - x1 ) + local real dy= ( y2 - y1 ) + + return SquareRoot(dx * dx + dy * dy) +endfunction + +function QueueUI__SmartCameraPanToUnit takes player whichPlayer,unit target,real duration returns nothing + local real dist + local location cameraLoc= GetCameraTargetPositionLoc() + local real x= GetUnitX(target) + local real y= GetUnitY(target) + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + + set dist=QueueUI__DistanceBetweenCoordinates(x , y , GetLocationX(cameraLoc) , GetLocationY(cameraLoc)) + if ( dist >= bj_SMARTPAN_TRESHOLD_SNAP ) then + // If the user is too far away, snap the camera. + call PanCameraToTimed(x, y, 0) + elseif ( dist >= bj_SMARTPAN_TRESHOLD_PAN ) then + // If the user is moderately close, pan the camera. + call PanCameraToTimed(x, y, duration) + else + // User is close enough, so don't touch the camera. + endif + endif + call RemoveLocation(cameraLoc) + set cameraLoc=null +endfunction + +function QueueUI__SelectNextSource takes player whichPlayer,integer slot returns nothing + local integer q= GetPlayerQueueByIndex(whichPlayer , slot) + local unit n= null + if ( q != 0 ) then + set n=QueueUI__GetNextUnitToSelect(s__Queue_sources[q] , whichPlayer) + + if ( n != null ) then + call SelectUnitForPlayerSingle(n, whichPlayer) + + call QueueUI__SmartCameraPanToUnit(whichPlayer , n , 0.0) + + endif + endif +endfunction + +function QueueUI__TriggerActionSyncData takes nothing returns nothing + local player whichPlayer= GetTriggerPlayer() + local integer playerId= GetPlayerId(whichPlayer) + local string data= BlzGetTriggerSyncData() + local integer slot= 0 + if ( data == "Checked" ) then + set QueueUI__checked[playerId]=true + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetText(QueueUI__CheckboxTooltip, QueueUI_CHECKBOX_TOOLTIP_SHOW) + endif + call QueueUI__UpdateUIForPlayer(whichPlayer) + elseif ( data == "Unchecked" ) then + set QueueUI__checked[playerId]=false + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetText(QueueUI__CheckboxTooltip, QueueUI_CHECKBOX_TOOLTIP_HIDE) + endif + call QueueUI__UpdateUIForPlayer(whichPlayer) + else + set slot=S2I(data) + call QueueUI__SelectNextSource(whichPlayer , slot) + endif + set whichPlayer=null +endfunction + +function ShowQueueUI takes nothing returns nothing + call BlzFrameSetVisible(QueueUI__Checkbox, true) + //call BlzFrameSetVisible(CheckboxTooltip, true) + call QueueUI__SetAllSlotChargesVisible(true) +endfunction + +function HideQueueUI takes nothing returns nothing + call BlzFrameSetVisible(QueueUI__Checkbox, false) + call BlzFrameSetVisible(QueueUI__CheckboxTooltip, false) + call QueueUI__SetAllSlotChargesVisible(false) +endfunction + +function SetQueueUIEnabledForPlayer takes player whichPlayer,boolean enabled returns nothing + set QueueUI__enabledForPlayer[GetPlayerId(whichPlayer)]=enabled + if ( enabled ) then + if ( whichPlayer == GetLocalPlayer() ) then + call ShowQueueUI() + endif + call QueueUI__UpdateUIForPlayer(whichPlayer) + else + if ( whichPlayer == GetLocalPlayer() ) then + call HideQueueUI() + endif + endif +endfunction + +function QueueUI__CheckedFunction takes nothing returns nothing + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzSendSyncData(QueueUI_PREFIX, "Checked") + endif +endfunction + +function QueueUI__UncheckedFunction takes nothing returns nothing + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzSendSyncData(QueueUI_PREFIX, "Unchecked") + endif +endfunction + +function QueueUI__ClickItemFunction takes nothing returns nothing + local integer handleId= GetHandleId(GetTriggeringTrigger()) + local integer slot= LoadInteger(QueueUI__h, handleId, 0) + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzSendSyncData(QueueUI_PREFIX, I2S(slot)) + endif +endfunction + +function QueueUI_CreateUI takes nothing returns nothing + local integer i= 0 + local integer handleId= 0 + local real x= 0.0 + local real y= 0.0 + + set x=QueueUI_CHECK_BOX_X + set y=QueueUI_CHECK_BOX_Y + + set QueueUI__Checkbox=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(QueueUI__Checkbox, FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(QueueUI__Checkbox, FRAMEPOINT_BOTTOMRIGHT, x + QueueUI_CHECK_BOX_SIZE, y - QueueUI_CHECK_BOX_SIZE) + + set QueueUI__CheckboxTooltip=BlzCreateFrameByType("TEXT", "QueueUICheckboxTooltip", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetTooltip(QueueUI__Checkbox, QueueUI__CheckboxTooltip) + call BlzFrameSetPoint(QueueUI__CheckboxTooltip, FRAMEPOINT_BOTTOM, QueueUI__Checkbox, FRAMEPOINT_TOP, 0, 0.01) + call BlzFrameSetFont(QueueUI__CheckboxTooltip, "fonts\\dfst-m3u.ttf", QueueUI_TOOLTIP_FONT_HEIGHT, 0) + call BlzFrameSetText(QueueUI__CheckboxTooltip, QueueUI_CHECKBOX_TOOLTIP_HIDE) + + set QueueUI__CheckboxCheckedTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(QueueUI__CheckboxCheckedTrigger, QueueUI__Checkbox, FRAMEEVENT_CHECKBOX_CHECKED) + call TriggerAddAction(QueueUI__CheckboxCheckedTrigger, function QueueUI__CheckedFunction) + + set QueueUI__CheckboxUncheckedTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(QueueUI__CheckboxUncheckedTrigger, QueueUI__Checkbox, FRAMEEVENT_CHECKBOX_UNCHECKED) + call TriggerAddAction(QueueUI__CheckboxUncheckedTrigger, function QueueUI__UncheckedFunction) + + set x=QueueUI_BUTTON_X + set y=QueueUI_BUTTON_Y + set i=0 + loop + exitwhen ( i == QueueUI_MAX_SLOTS ) + set QueueUI__SlotFrame[i]=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(QueueUI__SlotFrame[i], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(QueueUI__SlotFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + QueueUI_BUTTON_SIZE, y - QueueUI_BUTTON_SIZE) + //call BlzFrameSetTexture(SlotFrame[index], GetIconByItemType(0), 0, true) + //call BlzFrameSetText(SlotFrame[index], I2S(index)) + + set QueueUI__SlotBackdropFrame[i]=BlzCreateFrameByType("BACKDROP", "QueueUIBackdropFrame" + I2S(i), QueueUI__SlotFrame[i], "", 1) + call BlzFrameSetAllPoints(QueueUI__SlotBackdropFrame[i], QueueUI__SlotFrame[i]) +// call BlzFrameSetTexture(SlotBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) + + // TODO Set Tooltip frame for the object name + + set QueueUI__SlotChargesBackdropFrame[i]=BlzCreateFrameByType("BACKDROP", "QueueUIChargesBackdropFrame" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(QueueUI__SlotChargesBackdropFrame[i], FRAMEPOINT_TOPLEFT, x + QueueUI_BUTTON_SIZE - QueueUI_CHARGES_SIZE, y - QueueUI_BUTTON_SIZE + QueueUI_CHARGES_SIZE) + call BlzFrameSetAbsPoint(QueueUI__SlotChargesBackdropFrame[i], FRAMEPOINT_BOTTOMRIGHT, x + QueueUI_BUTTON_SIZE, y - QueueUI_BUTTON_SIZE) + call BlzFrameSetTexture(QueueUI__SlotChargesBackdropFrame[i], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) + call BlzFrameSetLevel(QueueUI__SlotChargesBackdropFrame[i], 1) + + set QueueUI__SlotChargesFrame[i]=BlzCreateFrameByType("TEXT", "QueueUIChargesFrame" + I2S(i), QueueUI__SlotChargesBackdropFrame[i], "", 0) + call BlzFrameSetAllPoints(QueueUI__SlotChargesFrame[i], QueueUI__SlotChargesBackdropFrame[i]) + call BlzFrameSetTextAlignment(QueueUI__SlotChargesFrame[i], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) + call BlzFrameSetScale(QueueUI__SlotChargesFrame[i], 0.7) + call BlzFrameSetEnable(QueueUI__SlotChargesFrame[i], false) + call BlzFrameSetLevel(QueueUI__SlotChargesFrame[i], 2) + + set QueueUI__SlotClickTrigger[i]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(QueueUI__SlotClickTrigger[i], QueueUI__SlotFrame[i], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(QueueUI__SlotClickTrigger[i], function QueueUI__ClickItemFunction) + set handleId=GetHandleId(QueueUI__SlotClickTrigger[i]) + call SaveInteger(QueueUI__h, handleId, 0, i) + + set QueueUI__SlotTooltip[i]=BlzCreateFrameByType("TEXT", "QueueUITooltip" + I2S(i), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetTooltip(QueueUI__SlotFrame[i], QueueUI__SlotTooltip[i]) + call BlzFrameSetPoint(QueueUI__SlotTooltip[i], FRAMEPOINT_BOTTOM, QueueUI__SlotFrame[i], FRAMEPOINT_TOP, 0, 0.01) + call BlzFrameSetFont(QueueUI__SlotTooltip[i], "fonts\\dfst-m3u.ttf", QueueUI_TOOLTIP_FONT_HEIGHT, 0) + call BlzFrameSetEnable(QueueUI__SlotTooltip[i], false) + + set x=x + QueueUI_BUTTON_SIZE + QueueUI_BUTTON_SPACE + + set i=i + 1 + endloop + + call ForForce(GetPlayersAll(), function QueueUI__ForForceUpdateUI) // INLINED!! +endfunction + +function QueueUI__TriggerActionUpdateQueue takes nothing returns nothing + //call BJDebugMsg("Queue update " + GetObjectName(GetTriggerQueueId())) + call QueueUI__UpdateUIForPlayer(GetOwningPlayer((Queue__triggerUnit))) // INLINED!! +endfunction + +function QueueUI__TimerFunctionStart takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer i= 0 + local player slotPlayer= null + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER ) then + set QueueUI__enabledForPlayer[i]=true + call BlzTriggerRegisterPlayerSyncEvent(QueueUI__syncTrigger, slotPlayer, QueueUI_PREFIX, false) + endif + set slotPlayer=null + set i=i + 1 + endloop + call TriggerAddAction(QueueUI__syncTrigger, function QueueUI__TriggerActionSyncData) + + call QueueUI_CreateUI() + + call TriggerRegisterQueueEvent(QueueUI__queueTrigger) + call TriggerAddAction(QueueUI__queueTrigger, function QueueUI__TriggerActionUpdateQueue) + + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function QueueUI__Init takes nothing returns nothing + call TimerStart(CreateTimer(), 0.0, false, function QueueUI__TimerFunctionStart) + + call TriggerAddAction(FrameLoader___actionTrigger, (function QueueUI_CreateUI)) // INLINED!! + +endfunction + + +//library QueueUI ends +//library ResourcesGui: + + +function ResourcesGui___SetResourcesUIVisibleAll takes boolean visible returns nothing + call BlzFrameSetVisible(ResourcesGui___IconFrame, visible) + call BlzFrameSetVisible(ResourcesGui___TextFrame, visible) +endfunction + +function ResourcesGui___SetResourcesUIGatheredVisibleAll takes boolean visible returns nothing + call BlzFrameSetVisible(ResourcesGui___IconFrameGathered, visible) + call BlzFrameSetVisible(ResourcesGui___TextFrameGathered, visible) + call BlzFrameSetVisible(ResourcesGui___IconFrameGathered2, visible) + call BlzFrameSetVisible(ResourcesGui___TextFrameGathered2, visible) +endfunction + +function ResourcesGui___SetResourcesUIGathered2VisibleAll takes boolean visible returns nothing + call BlzFrameSetVisible(ResourcesGui___IconFrameGathered2, visible) + call BlzFrameSetVisible(ResourcesGui___TextFrameGathered2, visible) +endfunction + +function ResourcesGui___SetResourcesUIVisible takes player whichPlayer,boolean visible returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call ResourcesGui___SetResourcesUIVisibleAll(visible) + endif +endfunction + +function ResourcesGui___SetResourcesUIGatheredVisible takes player whichPlayer,boolean visible returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call ResourcesGui___SetResourcesUIGatheredVisibleAll(visible) + endif +endfunction + +function ResourcesGui___ShowResourcesUI takes player whichPlayer returns nothing + call ResourcesGui___SetResourcesUIVisible(whichPlayer , true) +endfunction + +function ResourcesGui___HideResourcesUI takes player whichPlayer returns nothing + call ResourcesGui___SetResourcesUIVisible(whichPlayer , false) +endfunction + +function ResourcesGui___ShowResourcesGatheredUI takes player whichPlayer returns nothing + call ResourcesGui___SetResourcesUIGatheredVisible(whichPlayer , true) +endfunction + +function ResourcesGui___HideResourcesGatheredUI takes player whichPlayer returns nothing + call ResourcesGui___SetResourcesUIGatheredVisible(whichPlayer , false) +endfunction + +function ResourcesGui___CreateResourcesUI takes nothing returns nothing + set ResourcesGui___IconFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(ResourcesGui___IconFrame, FRAMEPOINT_TOPLEFT, ResourcesGui___X, ResourcesGui___Y) + call BlzFrameSetAbsPoint(ResourcesGui___IconFrame, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___X + ResourcesGui___WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) + call BlzFrameSetLevel(ResourcesGui___IconFrame, 1) + + set ResourcesGui___TextFrame=BlzCreateFrameByType("TEXT", "ResourceGuiText", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(ResourcesGui___TextFrame, FRAMEPOINT_TOPLEFT, ResourcesGui___TEXT_X, ResourcesGui___Y) + call BlzFrameSetAbsPoint(ResourcesGui___TextFrame, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___TEXT_X + ResourcesGui___TEXT_WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) + call BlzFrameSetText(ResourcesGui___TextFrame, "Resource") + call BlzFrameSetTextAlignment(ResourcesGui___TextFrame, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) + call BlzFrameSetScale(ResourcesGui___TextFrame, 1.0) + call BlzFrameSetLevel(ResourcesGui___TextFrame, 1) + + set ResourcesGui___IconFrameGathered=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered, FRAMEPOINT_TOPLEFT, ResourcesGui___X_GATHERED, ResourcesGui___Y_GATHERED) + call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___X_GATHERED + ResourcesGui___WIDTH, ResourcesGui___Y_GATHERED - ResourcesGui___HEIGHT) + call BlzFrameSetLevel(ResourcesGui___IconFrameGathered, 1) + + set ResourcesGui___TextFrameGathered=BlzCreateFrameByType("TEXT", "ResourceGuiTextGathered", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered, FRAMEPOINT_TOPLEFT, ResourcesGui___TEXT_X_GATHERED, ResourcesGui___Y_GATHERED) + call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___TEXT_X_GATHERED + ResourcesGui___TEXT_WIDTH, ResourcesGui___Y_GATHERED - ResourcesGui___HEIGHT) + call BlzFrameSetText(ResourcesGui___TextFrameGathered, "Resource") + call BlzFrameSetTextAlignment(ResourcesGui___TextFrameGathered, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) + call BlzFrameSetScale(ResourcesGui___TextFrameGathered, 1.0) + call BlzFrameSetLevel(ResourcesGui___TextFrameGathered, 1) + + set ResourcesGui___IconFrameGathered2=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered2, FRAMEPOINT_TOPLEFT, ResourcesGui___X_GATHERED, ResourcesGui___Y) + call BlzFrameSetAbsPoint(ResourcesGui___IconFrameGathered2, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___X_GATHERED + ResourcesGui___WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) + call BlzFrameSetLevel(ResourcesGui___IconFrameGathered2, 1) + + set ResourcesGui___TextFrameGathered2=BlzCreateFrameByType("TEXT", "ResourceGuiTextGathered2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered2, FRAMEPOINT_TOPLEFT, ResourcesGui___TEXT_X_GATHERED, ResourcesGui___Y) + call BlzFrameSetAbsPoint(ResourcesGui___TextFrameGathered2, FRAMEPOINT_BOTTOMRIGHT, ResourcesGui___TEXT_X_GATHERED + ResourcesGui___TEXT_WIDTH, ResourcesGui___Y - ResourcesGui___HEIGHT) + call BlzFrameSetText(ResourcesGui___TextFrameGathered2, "Resource") + call BlzFrameSetTextAlignment(ResourcesGui___TextFrameGathered2, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) + call BlzFrameSetScale(ResourcesGui___TextFrameGathered2, 1.0) + call BlzFrameSetLevel(ResourcesGui___TextFrameGathered2, 1) + + // hide for all players + call ResourcesGui___SetResourcesUIVisibleAll(false) + call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) + call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) +endfunction + +function ResourcesGui___GetPrimaryResourceEx takes unit mine,integer ignore returns integer + local integer resource= 0 + local integer result= 0 + local integer current= 0 + local integer currentMax= 0 + local integer v= 0 + local integer w= 0 + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + loop + exitwhen ( i == max ) + set resource=(s__Resource_resources[(i)]) // INLINED!! + if ( resource != ignore ) then + set v=(LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( resource) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) // INLINED!! + set w=(LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( resource) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) // INLINED!! + if ( v > current ) then + set result=resource + set current=v + elseif ( not IsStandardResource(resource) and current == 0 and w > currentMax ) then + set result=resource + set currentMax=w + endif + endif + set i=i + 1 + endloop + return result +endfunction + +function ResourcesGui___GetPrimaryResource takes unit mine returns integer + return ResourcesGui___GetPrimaryResourceEx(mine , 0) +endfunction + +function ResourcesGui___GetResourceGatheredText takes unit worker,integer resource returns string + local string text= "|cffffcc00" + (s__Resource_name[(resource)]) + ":|r|n " + I2S((LoadInteger(Resources___h, GetHandleId((worker )), Resources___Index2D(( resource) , Resources___KEY_RESOURCE , Resources___KEY_MAX)))) + "/" + I2S((LoadInteger(Resources___h, GetHandleId((worker )), Resources___Index2D(( resource) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX)))) // INLINED!! + if ( GetPlayerResourceBonus(GetOwningPlayer(worker) , resource) > 0 ) then + set text=text + "|n|c0000ff00+" + I2S(GetPlayerResourceBonus(GetOwningPlayer(worker) , resource)) + "|r" + elseif ( GetPlayerResourceBonus(GetOwningPlayer(worker) , resource) < 0 ) then + set text=text + "|n|c00ff0000-" + I2S(GetPlayerResourceBonus(GetOwningPlayer(worker) , resource)) + "|r" + endif + return text +endfunction + +function ResourcesGui___UpdateGathered takes player whichPlayer,unit worker returns nothing + local integer resource= (ResourcesGui___GetPrimaryResourceEx((worker) , 0)) // INLINED!! + local integer resource2= ResourcesGui___GetPrimaryResourceEx(worker , resource) + //call BJDebugMsg("resource " + I2S(resource)) + if ( GetLocalPlayer() == whichPlayer ) then + if ( resource != 0 ) then + call BlzFrameSetTexture(ResourcesGui___IconFrameGathered, (s__Resource_iconAtt[(resource)]), 0, true) // INLINED!! + call BlzFrameSetText(ResourcesGui___TextFrameGathered, ResourcesGui___GetResourceGatheredText(worker , resource)) + //call BJDebugMsg("Icon mine " + GetResourceIcon(resource)) + //call BJDebugMsg("Text mine " + BlzFrameGetText(TextFrame)) + call ResourcesGui___SetResourcesUIGatheredVisibleAll(true) + else + call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) + endif + + if ( resource2 != 0 ) then + call BlzFrameSetTexture(ResourcesGui___IconFrameGathered2, (s__Resource_iconAtt[(resource2)]), 0, true) // INLINED!! + call BlzFrameSetText(ResourcesGui___TextFrameGathered2, ResourcesGui___GetResourceGatheredText(worker , resource2)) + call ResourcesGui___SetResourcesUIGathered2VisibleAll(true) + else + call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) + endif + endif +endfunction + +function ResourcesGui___ForGroupPrint takes nothing returns nothing + call h__BJDebugMsg(GetUnitName(GetEnumUnit())) +endfunction + +function PrintResourcesGuiSelection takes player whichPlayer returns nothing + call h__BJDebugMsg("current selected unit from system " + GetUnitName(ResourcesGui___currentMine[GetPlayerId(whichPlayer)])) + call h__BJDebugMsg("current selected unit by player " + GetUnitName(GetSingleSelectedUnit(whichPlayer))) +endfunction + +function ResourcesGui___HasNonEmptyCargo takes unit mine returns boolean + + return (CountUnitsInGroup(UnitEventEx__CargoGroup[((GetUnitUserData(((mine)))))])) > 0 // INLINED!! + + + +endfunction + +function ResourcesGui___HasProgressBar takes unit mine returns boolean + return IsUnitInGroup(mine, ResourcesGui___progressBarUnits) +endfunction + +function UpdatePlayerResourceSelectionGui takes player whichPlayer returns nothing + local integer resource= 0 + local integer playerId= GetPlayerId(whichPlayer) + set ResourcesGui___currentMine[playerId]=GetSingleSelectedUnit(whichPlayer) + // heroes have no space for the icons + if ( IsUnitType(ResourcesGui___currentMine[playerId], UNIT_TYPE_HERO) ) then + set ResourcesGui___currentMine[playerId]=null + endif + + // with cargo there is no space for icons + + if ( ResourcesGui___currentMine[playerId] != null and ((CountUnitsInGroup(UnitEventEx__CargoGroup[((GetUnitUserData((((ResourcesGui___currentMine[playerId]))))))])) > 0) ) then // INLINED!! + set ResourcesGui___currentMine[playerId]=null + endif + + + if ( ResourcesGui___currentMine[playerId] != null and (IsUnitInGroup((ResourcesGui___currentMine[playerId]), ResourcesGui___progressBarUnits)) ) then // INLINED!! + set ResourcesGui___currentMine[playerId]=null + endif + + //call BJDebugMsg("XXXXXXXXXXXX") + if ( ResourcesGui___currentMine[playerId] != null ) then + set resource=(ResourcesGui___GetPrimaryResourceEx((ResourcesGui___currentMine[playerId]) , 0)) // INLINED!! + + //call PrintResourcesGuiSelection(whichPlayer) + //call BJDebugMsg("mine " + GetUnitName(currentMine[playerId]) + " with primary resource " + I2S(resource)) + if ( (IsUnitInGroup((ResourcesGui___currentMine[playerId]), Resources___mines)) and IsAlliedMine(ResourcesGui___currentMine[playerId] , whichPlayer) ) then // INLINED!! + // call BJDebugMsg("is mine") + if ( resource != 0 ) then + //call BJDebugMsg("Show mine " + GetUnitName(currentMine[playerId])) + if ( GetLocalPlayer() == whichPlayer ) then + call BlzFrameSetTexture(ResourcesGui___IconFrame, (s__Resource_iconAtt[(resource)]), 0, true) // INLINED!! + call BlzFrameSetText(ResourcesGui___TextFrame, "|cffffcc00" + (s__Resource_name[(resource)]) + ":|r|n " + I2S((LoadInteger(Resources___h, GetHandleId((ResourcesGui___currentMine[playerId] )), Resources___Index2D(( resource) , Resources___KEY_RESOURCE , Resources___KEY_MAX))))) // INLINED!! + //call BJDebugMsg("Icon mine " + GetResourceIcon(resource)) + //call BJDebugMsg("Text mine " + BlzFrameGetText(TextFrame)) + call ResourcesGui___SetResourcesUIVisibleAll(true) + call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) + call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) + endif + else + //call BJDebugMsg("selection counter is not 1 " + I2S(selectionCounter[playerId] )) + //call BJDebugMsg("Hide mine " + GetUnitName(selected)) + if ( GetLocalPlayer() == whichPlayer ) then + call ResourcesGui___SetResourcesUIVisibleAll(false) + call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) + call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) + endif + endif + elseif ( resource != 0 and IsAlliedMine(ResourcesGui___currentMine[playerId] , whichPlayer) ) then + //call BJDebugMsg("Update gathered resources UI for player " + GetPlayerName(whichPlayer)) + call ResourcesGui___SetResourcesUIVisibleAll(false) + call ResourcesGui___UpdateGathered(whichPlayer , ResourcesGui___currentMine[playerId]) + else + //call BJDebugMsg("Hide gathered resources UI for player " + GetPlayerName(whichPlayer)) + call ResourcesGui___SetResourcesUIVisibleAll(false) + call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) + call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) + endif + else + //call BJDebugMsg("Hide all resources UI for player " + GetPlayerName(whichPlayer)) + call ResourcesGui___SetResourcesUIVisibleAll(false) + call ResourcesGui___SetResourcesUIGatheredVisibleAll(false) + call ResourcesGui___SetResourcesUIGathered2VisibleAll(false) + endif +endfunction + +function ResourcesGui___TriggerActionTmp takes nothing returns nothing + call UpdatePlayerResourceSelectionGui(ResourcesGui___tmpPlayer) +endfunction + +function ResourcesGui___TimerFunctionUpdate takes nothing returns nothing + local integer playerId= LoadInteger(ResourcesGui___h, GetHandleId(GetExpiredTimer()), 0) + //call BJDebugMsg("Timer function with playerId " + I2S(playerId)) + // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. + set ResourcesGui___tmpPlayer=Player(playerId) + call TriggerExecute(ResourcesGui___tmpTrigger) + set ResourcesGui___updateTimerRunning[playerId]=false +endfunction + +function ResourcesGui___StartUpdateTimer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + if ( not ResourcesGui___updateTimerRunning[playerId] ) then + set ResourcesGui___updateTimerRunning[playerId]=true + call TimerStart(ResourcesGui___updateTimer[playerId], 0.0, false, function ResourcesGui___TimerFunctionUpdate) + endif +endfunction + +function ResourcesGui_StartUpdateTimerForUnits takes unit u0,unit u1 returns nothing + local player slotPlayer= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( GetPlayerController(slotPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and ( ( u0 != null and IsUnitSelected(u0, slotPlayer) ) or ( u1 != null and IsUnitSelected(u1, slotPlayer) ) ) ) then + call ResourcesGui___StartUpdateTimer(slotPlayer) + endif + set slotPlayer=null + set i=i + 1 + endloop +endfunction + +function ResourcesGui___TriggerConditionSelected takes nothing returns boolean + // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. + call ResourcesGui___StartUpdateTimer(GetTriggerPlayer()) + return false +endfunction + +function ResourcesGui___TriggerConditionDeselected takes nothing returns boolean + // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. + call ResourcesGui___StartUpdateTimer(GetTriggerPlayer()) + return false +endfunction + +function ResourcesGui___TriggerActionGather takes nothing returns nothing + // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. + call ResourcesGui_StartUpdateTimerForUnits((Resources___triggerWorker) , (Resources___triggerMine)) // INLINED!! +endfunction + +function ResourcesGui___TriggerActionReturn takes nothing returns nothing + // This has to be done to make GetSingleSelectedUnit work. SyncSelections might hang the current thread otherwise. + call ResourcesGui_StartUpdateTimerForUnits((Resources___triggerWorker) , (Resources___triggerReturnBuilding)) // INLINED!! +endfunction + +function ResourcesGui___TimerFunctionCreateUI takes nothing returns nothing + call ResourcesGui___CreateResourcesUI() + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function ResourcesGui___TriggerActionProgressBarStart takes nothing returns nothing + if ( not IsUnitInGroup(GetTriggerUnit(), ResourcesGui___progressBarUnits) ) then + call GroupAddUnit(ResourcesGui___progressBarUnits, GetTriggerUnit()) + call ResourcesGui_StartUpdateTimerForUnits(GetTriggerUnit() , null) + endif +endfunction + +function ResourcesGui___TriggerActionProgressBarFinish takes nothing returns nothing + if ( IsUnitInGroup(GetTriggerUnit(), ResourcesGui___progressBarUnits) ) then + call GroupRemoveUnit(ResourcesGui___progressBarUnits, GetTriggerUnit()) + call ResourcesGui_StartUpdateTimerForUnits(GetTriggerUnit() , null) + endif +endfunction + +function ResourcesGui___Init takes nothing returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set ResourcesGui___currentMine[i]=null + set ResourcesGui___updateTimer[i]=CreateTimer() + call SaveInteger(ResourcesGui___h, GetHandleId(ResourcesGui___updateTimer[i]), 0, i) + set i=i + 1 + endloop + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___selectionTrigger, EVENT_PLAYER_UNIT_SELECTED) + call TriggerAddCondition(ResourcesGui___selectionTrigger, Condition(function ResourcesGui___TriggerConditionSelected)) + + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___deselectionTrigger, EVENT_PLAYER_UNIT_DESELECTED) + call TriggerAddCondition(ResourcesGui___deselectionTrigger, Condition(function ResourcesGui___TriggerConditionDeselected)) + + call TriggerRegisterGatherEvent(ResourcesGui___gatherTrigger) + // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. + call TriggerAddAction(ResourcesGui___gatherTrigger, function ResourcesGui___TriggerActionGather) + + call TriggerRegisterReturnEvent(ResourcesGui___returnTrigger) + // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. + call TriggerAddAction(ResourcesGui___returnTrigger, function ResourcesGui___TriggerActionReturn) + + call TimerStart(CreateTimer(), 0.0, false, function ResourcesGui___TimerFunctionCreateUI) + + call TriggerAddAction(ResourcesGui___tmpTrigger, function ResourcesGui___TriggerActionTmp) + + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarStartTrigger, EVENT_PLAYER_UNIT_UPGRADE_START) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarStartTrigger, EVENT_PLAYER_UNIT_RESEARCH_START) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarStartTrigger, EVENT_PLAYER_UNIT_TRAIN_START) + // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. + call TriggerAddAction(ResourcesGui___progressBarStartTrigger, function ResourcesGui___TriggerActionProgressBarStart) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_UPGRADE_CANCEL) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_RESEARCH_CANCEL) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_TRAIN_CANCEL) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_TRAIN_FINISH) + call TriggerRegisterAnyUnitEventBJ(ResourcesGui___progressBarFinishTrigger, EVENT_PLAYER_UNIT_DEATH) + // Use a trigger action here since trigger conditions will lead to weird behavior when checking player selections. + call TriggerAddAction(ResourcesGui___progressBarFinishTrigger, function ResourcesGui___TriggerActionProgressBarFinish) + + + call TriggerAddAction(FrameLoader___actionTrigger, (function ResourcesGui___CreateResourcesUI)) // INLINED!! + +endfunction + +function ResourcesGui___RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, ResourcesGui___progressBarUnits) ) then + call GroupRemoveUnit(ResourcesGui___progressBarUnits, whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit ResourcesGui___RemoveUnitHook + + +//library ResourcesGui ends +//library ResourcesLoadedMines: + + + + +function GetResourcesLoadedMinesTimerHandleId takes nothing returns integer + return GetHandleId(ResourcesLoadedMines___harvestTimer) +endfunction + +function ResourcesLoadedMines___Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer + return ( ( Value1 * MaxValue2 ) + Value2 ) +endfunction + +function IsLoadedMine takes unit mine returns boolean + return IsUnitInGroup(mine, ResourcesLoadedMines___mines) +endfunction + +function SetLoadedMineHarvestBonusPerWorker takes unit mine,integer bonus returns nothing + call SaveInteger(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(0 , ResourcesLoadedMines___KEY_HARVEST_BONUS_PER_WORKER , ResourcesLoadedMines___MAX_KEYS), bonus) +endfunction + +function GetLoadedMineHarvestBonusPerWorker takes unit mine returns integer + return LoadInteger(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(0 , ResourcesLoadedMines___KEY_HARVEST_BONUS_PER_WORKER , ResourcesLoadedMines___MAX_KEYS)) +endfunction + +function SetLoadedMineAllowedWorkerUnitTypeId takes unit mine,integer unitTypeId,boolean allowed returns nothing + call SaveBoolean(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(unitTypeId , ResourcesLoadedMines___KEY_ALLOWED_WORKER_UNIT_TYPE_ID , ResourcesLoadedMines___MAX_KEYS), allowed) +endfunction + +function GetLoadedMineAllowedWorkerUnitTypeId takes unit mine,integer unitTypeId returns boolean + return LoadBoolean(ResourcesLoadedMines___h, GetHandleId(mine), ResourcesLoadedMines___Index2D(unitTypeId , ResourcesLoadedMines___KEY_ALLOWED_WORKER_UNIT_TYPE_ID , ResourcesLoadedMines___MAX_KEYS)) +endfunction + +function AddLoadedMineWorkerUnitTypeId takes unit mine,integer unitTypeId returns nothing + call SetLoadedMineAllowedWorkerUnitTypeId(mine , unitTypeId , true) +endfunction + +function AddLoadedMine takes unit mine,integer resource,integer max,integer harvestBonusPerWorker returns nothing + call AddMineEx(mine , resource , max) + call GroupAddUnit(ResourcesLoadedMines___mines, mine) + call SetLoadedMineHarvestBonusPerWorker(mine , harvestBonusPerWorker) + call SetUnitDisableStopMiningOnError(mine , true) +endfunction + +function RemoveLoadedMine takes unit mine returns nothing + call RemoveMine(mine) + call GroupRemoveUnit(ResourcesLoadedMines___mines, mine) + call FlushChildHashtable(ResourcesLoadedMines___h, GetHandleId(mine)) +endfunction + +function PauseHarvestTimer takes nothing returns nothing + call PauseTimer(ResourcesLoadedMines___harvestTimer) +endfunction + +function ResumeHarvestTimer takes nothing returns nothing + call ResumeTimer(ResourcesLoadedMines___harvestTimer) +endfunction + +function ResourcesLoadedMines___GetFirstWorkerInLoadedMine takes unit mine returns unit + local group cargo= (s__UnitEventEx__Cargo_copyGroup((GetUnitUserData(((mine)))))) // INLINED!! + local unit first= FirstOfGroup(cargo) + call GroupClear(cargo) + call DestroyGroup(cargo) + set cargo=null + return first +endfunction + +function ResourcesLoadedMines___HarvestMine takes unit mine,integer amount returns nothing + local unit firstWorker= ResourcesLoadedMines___GetFirstWorkerInLoadedMine(mine) + local integer r= 0 + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + local integer actualAmount= 0 + loop + exitwhen ( i == max ) + set r=(s__Resource_resources[(i)]) // INLINED!! + set actualAmount=(LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) // INLINED!! + if ( actualAmount > 0 ) then + set actualAmount=IMinBJ(actualAmount, amount + GetPlayerResourceBonus(GetOwningPlayer(mine) , r)) + call SetUnitResource(mine , r , (LoadInteger(Resources___h, GetHandleId((mine )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) - actualAmount) // INLINED!! + call CustomBountyEx(mine , GetOwningPlayer(firstWorker) , r , actualAmount) + call ExecuteGatherCallbacks(mine , firstWorker , r , actualAmount) + endif + set i=i + 1 + endloop + set firstWorker=null +endfunction + +function ResourcesLoadedMines___ForGroupHarvest takes nothing returns nothing + local unit mine= GetEnumUnit() + local integer cargoSize= 0 + local integer amount= 0 + if ( not IsUnitPaused(mine) ) then + set cargoSize=(CountUnitsInGroup(UnitEventEx__CargoGroup[((GetUnitUserData(((mine)))))])) // INLINED!! + if ( cargoSize > 0 ) then + set amount=cargoSize * (LoadInteger(ResourcesLoadedMines___h, GetHandleId((mine)), ResourcesLoadedMines___Index2D(0 , ResourcesLoadedMines___KEY_HARVEST_BONUS_PER_WORKER , ResourcesLoadedMines___MAX_KEYS))) // INLINED!! + if ( amount > 0 ) then + call QueueUnitAnimation(mine, "stand work") + + call ResourcesLoadedMines___HarvestMine(mine , amount) + + if ( IsMineEmpty(mine) ) then + if ( (LoadBoolean(Resources___h, GetHandleId((mine)), Resources___Index2D(0 , Resources___KEY_EXPLODE_ON_DEATH , Resources___KEY_MAX))) ) then // INLINED!! + call KillUnit(mine) + else + call RemoveLoadedMine(mine) + endif + endif + endif + endif + else + call ResetUnitAnimation(mine) + endif + set mine=null +endfunction + +function ResourcesLoadedMines___TimerFunctionHarvest takes nothing returns nothing + call ForGroup(ResourcesLoadedMines___mines, function ResourcesLoadedMines___ForGroupHarvest) +endfunction + +function ResourcesLoadedMines___TriggerConditionOrder takes nothing returns boolean + local integer orderId= GetIssuedOrderId() + local unit worker= GetOrderTargetUnit() + local unit mine= GetTriggerUnit() + if ( orderId == ResourcesLoadedMines_ORDER_ID_LOAD and mine != null and (IsUnitInGroup((mine), ResourcesLoadedMines___mines)) and not (LoadBoolean(ResourcesLoadedMines___h, GetHandleId((mine )), ResourcesLoadedMines___Index2D(( GetUnitTypeId(worker)) , ResourcesLoadedMines___KEY_ALLOWED_WORKER_UNIT_TYPE_ID , ResourcesLoadedMines___MAX_KEYS))) ) then // INLINED!! + call IssueImmediateOrder(worker, "stop") + call SimError(GetOwningPlayer(worker) , "Not allowed to harvest.") + endif + set worker=null + set mine=null + return false +endfunction + +function ResourcesLoadedMines___TriggerConditionDeath takes nothing returns boolean + if ( (IsUnitInGroup((GetTriggerUnit()), ResourcesLoadedMines___mines)) ) then // INLINED!! + call RemoveLoadedMine(GetTriggerUnit()) + endif + return false +endfunction + +function ResourcesLoadedMines___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(ResourcesLoadedMines___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) + call TriggerAddCondition(ResourcesLoadedMines___orderTrigger, Condition(function ResourcesLoadedMines___TriggerConditionOrder)) + + call TriggerRegisterAnyUnitEventBJ(ResourcesLoadedMines___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(ResourcesLoadedMines___deathTrigger, Condition(function ResourcesLoadedMines___TriggerConditionDeath)) + + call TimerStart(ResourcesLoadedMines___harvestTimer, ResourcesLoadedMines_HARVEST_INTERVAL, true, function ResourcesLoadedMines___TimerFunctionHarvest) +endfunction + + +//library ResourcesLoadedMines ends +//library Tunnel: + + + + +function Tunnel__IsLoaded takes unit whichUnit returns boolean + return IsUnitInGroup(whichUnit, Tunnel__loaded) +endfunction + +function Tunnel__IsCopy takes unit whichUnit returns boolean + return IsUnitInGroup(whichUnit, Tunnel__copies) +endfunction + +function Tunnel__IsCopyOf takes unit whichUnit,unit source returns boolean + return LoadUnitHandle(Tunnel__h, GetHandleId(whichUnit), Tunnel__KEY_SOURCE) == source +endfunction + +function Tunnel__GetCopySource takes unit whichUnit returns unit + return LoadUnitHandle(Tunnel__h, GetHandleId(whichUnit), Tunnel__KEY_SOURCE) +endfunction + +function Tunnel__GetTunnel takes unit whichUnit returns unit + return LoadUnitHandle(Tunnel__h, GetHandleId(whichUnit), Tunnel__KEY_TUNNEL) +endfunction + +function Tunnel__MoveToUnloadPosition takes unit whichUnit returns nothing + local integer handleId= GetHandleId(whichUnit) + if ( HaveSavedReal(Tunnel__h, handleId, Tunnel__KEY_X) ) then + call SetUnitX(whichUnit, LoadReal(Tunnel__h, handleId, Tunnel__KEY_X)) + call SetUnitY(whichUnit, LoadReal(Tunnel__h, handleId, Tunnel__KEY_Y)) + endif +endfunction + +function Tunnel__SetUnloadPosition takes unit whichUnit,real x,real y returns nothing + local integer handleId= GetHandleId(whichUnit) + call SaveReal(Tunnel__h, handleId, Tunnel__KEY_X, x) + call SaveReal(Tunnel__h, handleId, Tunnel__KEY_Y, y) +endfunction + +function Tunnel__CopyUnit takes unit whichUnit,real x,real y,real face returns unit + local unit copy= CreateUnit(GetOwningPlayer(whichUnit), GetUnitTypeId(whichUnit), x, y, face) + call SetUnitUseFood(copy, false) + call SetUnitInvulnerable(copy, true) + if ( IsUnitType(copy, UNIT_TYPE_HERO) ) then + call BlzSetUnitBooleanField(copy, UNIT_BF_HERO_HIDE_HERO_INTERFACE_ICON, true) + endif + call GroupAddUnit(Tunnel__copies, copy) + call SaveUnitHandle(Tunnel__h, GetHandleId(copy), Tunnel__KEY_SOURCE, whichUnit) + + return copy +endfunction + +function IsTunnel takes integer unitTypeId returns boolean + if ( unitTypeId == Tunnel_UNIT_TYPE_ID ) then + return true + elseif ( unitTypeId == Tunnel_UNIT_TYPE_ID_2 ) then + return true + endif + return false +endfunction + +function IsUnitTunnel takes unit whichUnit returns boolean + return IsTunnel(GetUnitTypeId(whichUnit)) +endfunction + +function Tunnel__FilterIsDifferentTunnel takes nothing returns boolean + return (IsTunnel(GetUnitTypeId((GetFilterUnit())))) and (LoadUnitHandle(Tunnel__h, GetHandleId((Tunnel__tmpUnit)), Tunnel__KEY_TUNNEL)) != GetFilterUnit() // INLINED!! +endfunction + +function Tunnel__CreateCopies takes unit whichUnit returns nothing + local player owner= GetOwningPlayer(whichUnit) + local group tunnels= CreateGroup() + local unit tunnel= null + local integer i= 0 + local integer max= 0 + local real x= 0.0 + local real y= 0.0 + local real face= 0.0 + set Tunnel__tmpUnit=whichUnit + call GroupEnumUnitsOfPlayer(tunnels, GetOwningPlayer(whichUnit), Filter(function Tunnel__FilterIsDifferentTunnel)) + set max=BlzGroupGetSize(tunnels) + set i=0 + loop + exitwhen ( i == max ) + set tunnel=BlzGroupUnitAt(tunnels, i) + if ( GetOwningPlayer(tunnel) == owner ) then + set x=GetUnitX(tunnel) + set y=GetUnitY(tunnel) + set face=GetUnitFacing(tunnel) + call BlzQueueTargetOrderById(tunnel, OrderId("load"), Tunnel__CopyUnit(whichUnit , x , y , face)) + //call IssueTargetOrder(tunnel, "load", CopyUnit(whichUnit, x, y, face)) + endif + set i=i + 1 + endloop + call GroupClear(tunnels) + call DestroyGroup(tunnels) + set tunnels=null + set owner=null +endfunction + +function Tunnel__CreateExistingCopies takes unit tunnel returns nothing + local player owner= GetOwningPlayer(tunnel) + local real x= GetUnitX(tunnel) + local real y= GetUnitY(tunnel) + local real face= GetUnitFacing(tunnel) + local unit u= null + local integer i= 0 + local integer max= BlzGroupGetSize(Tunnel__loaded) + loop + exitwhen ( i == max ) + set u=BlzGroupUnitAt(Tunnel__loaded, i) + if ( GetOwningPlayer(u) == owner ) then + call IssueTargetOrder(tunnel, "load", Tunnel__CopyUnit(u , x , y , face)) + endif + set u=null + set i=i + 1 + endloop + set owner=null +endfunction + +function Tunnel__ForGroupClearCopy takes nothing returns nothing + if ( (LoadUnitHandle(Tunnel__h, GetHandleId((GetEnumUnit() )), Tunnel__KEY_SOURCE) == ( Tunnel__tmpUnit)) ) then // INLINED!! + call GroupRemoveUnit(Tunnel__copies, GetEnumUnit()) + call FlushChildHashtable(Tunnel__h, GetHandleId(GetEnumUnit())) + call ShowUnit(GetEnumUnit(), false) + call h__RemoveUnit(GetEnumUnit()) + endif +endfunction + +function Tunnel__ClearCopies takes unit source returns nothing + set Tunnel__tmpUnit=source + call ForGroup(Tunnel__copies, function Tunnel__ForGroupClearCopy) +endfunction + +function Tunnel__FilterIsTunnel takes nothing returns boolean + return (IsTunnel(GetUnitTypeId((GetFilterUnit())))) // INLINED!! +endfunction + +function Tunnel__GetSelectedTunnel takes player whichPlayer returns unit + local group tunnels= CreateGroup() + local unit tunnel= null + call SyncSelections() + call GroupEnumUnitsSelected(tunnels, whichPlayer, Filter(function Tunnel__FilterIsTunnel)) + set tunnel=FirstOfGroup(tunnels) + call GroupClear(tunnels) + call DestroyGroup(tunnels) + set tunnels=null + return tunnel +endfunction + +function GetNextTunnel takes player whichPlayer returns unit + local group tunnels= CreateGroup() + local unit tunnel= null + local integer i= 0 + local integer max= 0 + local unit selectedTunnel= Tunnel__GetSelectedTunnel(whichPlayer) + local boolean foundSelectedTunnel= false + local boolean foundNewTunnel= false + call GroupEnumUnitsOfPlayer(tunnels, whichPlayer, Filter(function Tunnel__FilterIsTunnel)) + set max=BlzGroupGetSize(tunnels) + set i=0 + loop + exitwhen ( i == max or foundNewTunnel ) + set tunnel=BlzGroupUnitAt(tunnels, i) + if ( selectedTunnel == null or foundSelectedTunnel ) then + set selectedTunnel=tunnel + set foundNewTunnel=true + elseif ( tunnel == selectedTunnel ) then + set foundSelectedTunnel=true + endif + set i=i + 1 + endloop + + if ( not foundNewTunnel ) then + set selectedTunnel=FirstOfGroup(tunnels) + endif + + call GroupClear(tunnels) + call DestroyGroup(tunnels) + set tunnels=null + return selectedTunnel +endfunction + +function Tunnel__TriggerConditionLoad takes nothing returns boolean + local unit transportUnit= GetTransportUnit() + local unit loadedUnit= GetLoadedUnit() + if ( (IsUnitInGroup((loadedUnit), Tunnel__copies)) ) then // INLINED!! + call UnitAddAbility(loadedUnit, Tunnel_REGENERATION_ABILITY_ID) + call SaveUnitHandle(Tunnel__h, GetHandleId(loadedUnit), Tunnel__KEY_TUNNEL, transportUnit) + elseif ( (IsTunnel(GetUnitTypeId((transportUnit)))) ) then // INLINED!! + call UnitAddAbility(loadedUnit, Tunnel_REGENERATION_ABILITY_ID) + call SaveUnitHandle(Tunnel__h, GetHandleId(loadedUnit), Tunnel__KEY_TUNNEL, transportUnit) + call GroupAddUnit(Tunnel__loaded, loadedUnit) + call Tunnel__CreateCopies(loadedUnit) + endif + set transportUnit=null + set loadedUnit=null + return false +endfunction + +function Tunnel__TriggerFunctionUnload takes nothing returns nothing + local unit eventUnit= (UnitEventEx__eventUnit) // INLINED!! + local unit source= null + if ( (IsUnitInGroup((eventUnit), Tunnel__loaded)) ) then // INLINED!! + call UnitRemoveAbility(eventUnit, Tunnel_REGENERATION_ABILITY_ID) + call Tunnel__MoveToUnloadPosition(eventUnit) + call Tunnel__ClearCopies(eventUnit) + call GroupRemoveUnit(Tunnel__loaded, eventUnit) + call FlushChildHashtable(Tunnel__h, GetHandleId(eventUnit)) + elseif ( (IsUnitInGroup((eventUnit), Tunnel__copies)) ) then // INLINED!! + call UnitRemoveAbility(eventUnit, Tunnel_REGENERATION_ABILITY_ID) + set source=(LoadUnitHandle(Tunnel__h, GetHandleId((eventUnit)), Tunnel__KEY_SOURCE)) // INLINED!! + call Tunnel__SetUnloadPosition(source , GetUnitX(eventUnit) , GetUnitY(eventUnit)) + call IssueTargetOrder((LoadUnitHandle(Tunnel__h, GetHandleId((source)), Tunnel__KEY_TUNNEL)), "unload", source) // INLINED!! + call Tunnel__ClearCopies(eventUnit) + endif + set eventUnit=null +endfunction + +function Tunnel__TriggerConditionConstructed takes nothing returns boolean + local unit building= GetConstructedStructure() + if ( (IsTunnel(GetUnitTypeId((building)))) ) then // INLINED!! + call Tunnel__CreateExistingCopies(building) + endif + set building=null + return false +endfunction + +function Tunnel__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Tunnel__loadTrigger, EVENT_PLAYER_UNIT_LOADED) + call TriggerAddCondition(Tunnel__loadTrigger, Condition(function Tunnel__TriggerConditionLoad)) + +call RegisterIndexNativeEvent(bj_MAX_PLAYER_SLOTS , (EVENT_ON_CARGO_UNLOAD ) , ( function Tunnel__TriggerFunctionUnload)) // INLINED!! + + call TriggerRegisterAnyUnitEventBJ(Tunnel__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(Tunnel__constructionTrigger, Condition(function Tunnel__TriggerConditionConstructed)) +endfunction + +function Tunnel__RemoveUnitHook takes unit whichUnit returns nothing + call GroupRemoveUnit(Tunnel__loaded, whichUnit) + call GroupRemoveUnit(Tunnel__copies, whichUnit) + call FlushChildHashtable(Tunnel__h, GetHandleId(whichUnit)) +endfunction + +//processed hook: hook RemoveUnit Tunnel__RemoveUnitHook + + +//library Tunnel ends +//library WoWReforgedCrates: + +function IsCrate takes integer unitTypeId returns boolean + return unitTypeId == CRATES_0 or unitTypeId == CRATES_1 +endfunction + +function WoWReforgedCrates__FilterFunctionIsCrate takes nothing returns boolean + return IsCrate(GetUnitTypeId(GetFilterUnit())) +endfunction + +function WoWReforgedCrates__UnitAddRespawnUnitEnum takes nothing returns nothing + call AddRespawnUnit(GetEnumUnit()) +endfunction + +function WoWReforgedCrates__AddAllCrittersAsSingleUnitRespawns takes nothing returns nothing + local group crates= CreateGroup() + call GroupEnumUnitsInRect(crates, GetPlayableMapRect(), Filter(function WoWReforgedCrates__FilterFunctionIsCrate)) + call ForGroup(crates, function WoWReforgedCrates__UnitAddRespawnUnitEnum) + call GroupClear(crates) + call DestroyGroup(crates) + set crates=null +endfunction + +function WoWReforgedCrates__Init takes nothing returns nothing + call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedCrates__AddAllCrittersAsSingleUnitRespawns)) // INLINED!! +endfunction + + +//library WoWReforgedCrates ends +//library WoWReforgedCritters: + +function WoWReforgedCritters__FilterFunctionIsCritter takes nothing returns boolean + return IsCritter(GetUnitTypeId(GetFilterUnit())) +endfunction + +function WoWReforgedCritters__UnitAddRespawnUnitEnum takes nothing returns nothing + call AddRespawnUnit(GetEnumUnit()) +endfunction + +function WoWReforgedCritters__AddAllCrittersAsSingleUnitRespawns takes nothing returns nothing + local group critters= CreateGroup() + call GroupEnumUnitsInRect(critters, GetPlayableMapRect(), Filter(function WoWReforgedCritters__FilterFunctionIsCritter)) + call ForGroup(critters, function WoWReforgedCritters__UnitAddRespawnUnitEnum) + call GroupClear(critters) + call DestroyGroup(critters) + set critters=null +endfunction + +function WoWReforgedCritters__Init takes nothing returns nothing + call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedCritters__AddAllCrittersAsSingleUnitRespawns)) // INLINED!! +endfunction + + +//library WoWReforgedCritters ends +//library WoWReforgedEnslave: + + +function WoWReforgedEnslave___FilterIsTownHall takes nothing returns boolean + return IsUnitType(GetFilterUnit(), UNIT_TYPE_TOWNHALL) +endfunction + +function Enslave takes unit whichUnit,unit killer returns nothing + local group g= CreateGroup() + local unit townHall= null + local unit slave= null + call GroupEnumUnitsOfPlayer(g, GetOwningPlayer(killer), Filter(function WoWReforgedEnslave___FilterIsTownHall)) + set townHall=GetClosestUnitGroup(GetUnitX(whichUnit) , GetUnitY(whichUnit) , g) + if ( townHall != null ) then + set slave=CreateUnit(GetOwningPlayer(killer), UNIT_TYPE_ID, GetUnitX(townHall), GetUnitY(townHall), GetUnitFacing(whichUnit)) + call BlzSetUnitSkin(slave, BlzGetUnitSkin(whichUnit)) + call UnitAddType(slave, UNIT_TYPE_SUMMONED) + call h__RemoveUnit(whichUnit) + set whichUnit=null + endif + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + + +//library WoWReforgedEnslave ends +//library WoWReforgedRandomCorpse: + + +function IsRandomCorpse takes integer unitTypeId returns boolean + return unitTypeId == WoWReforgedRandomCorpse_UNIT_TYPE_ID +endfunction + +function IsUnitRandomCorpse takes unit whichUnit returns boolean + return ((GetUnitTypeId(whichUnit)) == WoWReforgedRandomCorpse_UNIT_TYPE_ID) // INLINED!! +endfunction + +function ReplaceRandomCorpse takes unit whichUnit returns unit + local real x= GetUnitX(whichUnit) + local real y= GetUnitY(whichUnit) + local location l= Location(x, y) + local real face= GetUnitFacing(whichUnit) + local integer index= (UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit)))) // INLINED!! + local unit u= null + + call SetUnitPathing(whichUnit, false) + + set u=CreatePermanentCorpseLocBJ(bj_CORPSETYPE_FLESH, ChooseRandomCreep(GetRandomInt(1, 10)), GetOwningPlayer(whichUnit), l, face) + call UnitDropItem(u, 'rren') + + if ( IsRespawnUnitValid(index) ) then + call SetRespawnUnit(index , u) + endif + + call h__RemoveUnit(whichUnit) + set whichUnit=null + call RemoveLocation(l) + set l=null + + return u +endfunction + +function WoWReforgedRandomCorpse___FilterIsRandomCorpse takes nothing returns boolean + return ((GetUnitTypeId((GetFilterUnit()))) == WoWReforgedRandomCorpse_UNIT_TYPE_ID) // INLINED!! +endfunction + +function WoWReforgedRandomCorpse___ReplaceRandomCorpseEnum takes nothing returns nothing + call ReplaceRandomCorpse(GetEnumUnit()) +endfunction + +function WoWReforgedRandomCorpse___ReplaceAllRandomCorpses takes nothing returns nothing + local group g= CreateGroup() + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedRandomCorpse___FilterIsRandomCorpse)) + call ForGroup(g, function WoWReforgedRandomCorpse___ReplaceRandomCorpseEnum) + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function WoWReforgedRandomCorpse___Init takes nothing returns nothing + call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedRandomCorpse___ReplaceAllRandomCorpses)) // INLINED!! +endfunction + + +//library WoWReforgedRandomCorpse ends +//library WoWReforgedTaunts: + +function AddTauntWoWReforged takes nothing returns nothing + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! +endfunction + + +//library WoWReforgedTaunts ends +//library WoWReforgedVotes: + +function AddWowReforgedVote takes nothing returns nothing + local integer vote= VoteCreate(udg_TmpString) +call VoteAddChoice((vote) , false , "yes" , "-yes") // INLINED!! + set VoteSystem__VoteStartChatCommand[(vote )]=( udg_TmpString2) // INLINED!! + set VoteSystem__VoteYesTrigger[(vote )]=( udg_TmpTrigger) // INLINED!! +endfunction + + +//library WoWReforgedVotes ends +//library DamageInterfaceUtils: + + + // JASS API: + // Evasion System: + // function UnitAddEvasionChanceTimed takes unit u, real amount, real duration returns nothing + // -> Add to a unit Evasion chance the specified amount for a given period + + // function UnitAddMissChanceTimed takes unit u, real amount, real duration returns nothing + // -> Add to a unit Miss chance the specified amount for a given period + + // Critical Strike System: + // function UnitAddCriticalStrikeTimed takes unit u, real chance, real multiplier, real duration returns nothing + // -> Adds the specified values of chance and multiplier to a unit for a given period + + // function UnitAddCriticalChanceTimed takes unit u, real chance, real duration returns nothing + // -> Adds the specified values of critical chance to a unit for a given period + + // function UnitAddCriticalMultiplierTimed takes unit u, real multiplier, real duration returns nothing + // -> Adds the specified values of critical multiplier to a unit for a given period + + // Spell Power System: + // function UnitAddSpellPowerFlatTimed takes unit u, real amount, real duration returns nothing + // -> Add to the Flat amount of Spell Power of a unit for a given period + + // function UnitAddSpellPowerPercentTimed takes unit u, real amount, real duration returns nothing + // -> Add to the Percent amount of Spell Power of a unit for a given period + + // function AbilitySpellDamage takes unit u, integer abilityId, abilityreallevelfield field returns string + // -> Given an ability field, will return a string that represents the damage that would be dealt + // taking into consideration the spell power bonusses of a unit. + + // function AbilitySpellDamageEx takes real amount, unit u returns string + // -> Similar to GetSpellDamage will return the damage that would be dealt but as a string + + // Life Steal System: + // function UnitAddLifeStealTimed takes unit u, real amount, real duration returns nothing + // -> Add to the Life Steal amount of a unit the given amount for a given period + + // Spell Vamp System: + // function UnitAddSpellVampTimed takes unit u, real amount, real duration returns nothing + // -> Add to the Spell Vamp amount of a unit the given amount for a given period + + + + + + + + function s__DamageInterfaceUtils__EvasionUtils_remove takes integer this,integer i returns integer + if s__DamageInterfaceUtils__EvasionUtils_type[this] then + set s__Evasion_evasion[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this] ))]=(( (s__Evasion_evasion[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this]))]) - s__DamageInterfaceUtils__EvasionUtils_amount[this])*1.0) // INLINED!! + else + set s__Evasion_miss[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this] ))]=(( (s__Evasion_miss[GetUnitUserData((s__DamageInterfaceUtils__EvasionUtils_unit[this]))]) - s__DamageInterfaceUtils__EvasionUtils_amount[this])*1.0) // INLINED!! + endif + + set s__DamageInterfaceUtils__EvasionUtils_data[i]=s__DamageInterfaceUtils__EvasionUtils_data[s__DamageInterfaceUtils__EvasionUtils_didx] + set s__DamageInterfaceUtils__EvasionUtils_didx=s__DamageInterfaceUtils__EvasionUtils_didx - 1 + set s__DamageInterfaceUtils__EvasionUtils_unit[this]=null + set s__DamageInterfaceUtils__EvasionUtils_ticks[this]=0 + + if s__DamageInterfaceUtils__EvasionUtils_didx == - 1 then + call PauseTimer(s__DamageInterfaceUtils__EvasionUtils_timer) + endif + + call sc__Evasion_deallocate(this) + + return i - 1 + endfunction + + function s__DamageInterfaceUtils__EvasionUtils_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__DamageInterfaceUtils__EvasionUtils_didx + set this=s__DamageInterfaceUtils__EvasionUtils_data[i] + + if s__DamageInterfaceUtils__EvasionUtils_ticks[this] <= 0 then + set i=s__DamageInterfaceUtils__EvasionUtils_remove(this,i) + endif + set s__DamageInterfaceUtils__EvasionUtils_ticks[this]=s__DamageInterfaceUtils__EvasionUtils_ticks[this] - 1 + set i=i + 1 + endloop + endfunction + + function s__DamageInterfaceUtils__EvasionUtils_addTimed takes unit u,real amount,real duration,boolean evasion returns nothing + local integer this= s__DamageInterfaceUtils__EvasionUtils__allocate() + + set s__DamageInterfaceUtils__EvasionUtils_unit[this]=u + set s__DamageInterfaceUtils__EvasionUtils_amount[this]=amount + set s__DamageInterfaceUtils__EvasionUtils_ticks[this]=duration / 0.03125000 + set s__DamageInterfaceUtils__EvasionUtils_type[this]=evasion + set s__DamageInterfaceUtils__EvasionUtils_didx=s__DamageInterfaceUtils__EvasionUtils_didx + 1 + set s__DamageInterfaceUtils__EvasionUtils_data[s__DamageInterfaceUtils__EvasionUtils_didx]=this + + if s__DamageInterfaceUtils__EvasionUtils_type[this] then + set s__Evasion_evasion[GetUnitUserData((u ))]=(( (s__Evasion_evasion[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! + else + set s__Evasion_miss[GetUnitUserData((u ))]=(( (s__Evasion_miss[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! + endif + + if s__DamageInterfaceUtils__EvasionUtils_didx == 0 then + call TimerStart(s__DamageInterfaceUtils__EvasionUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__EvasionUtils_onPeriod) + endif + endfunction + + + + + //region Critical Strike + + + function s__DamageInterfaceUtils__CriticalUtils_remove takes integer this,integer i returns integer + if s__DamageInterfaceUtils__CriticalUtils_type[this] == 0 then + call s__Critical_add(s__DamageInterfaceUtils__CriticalUtils_unit[this] , - s__DamageInterfaceUtils__CriticalUtils_crit[this] , - s__DamageInterfaceUtils__CriticalUtils_multi[this]) + elseif s__DamageInterfaceUtils__CriticalUtils_type[this] == 1 then + set s__Critical_chance[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this] ))]=(( (s__Critical_chance[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this]))]) - s__DamageInterfaceUtils__CriticalUtils_crit[this])*1.0) // INLINED!! + else + set s__Critical_multiplier[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this] ))]=(( (s__Critical_multiplier[GetUnitUserData((s__DamageInterfaceUtils__CriticalUtils_unit[this]))]) - s__DamageInterfaceUtils__CriticalUtils_multi[this])*1.0) // INLINED!! + endif + + set s__DamageInterfaceUtils__CriticalUtils_data[i]=s__DamageInterfaceUtils__CriticalUtils_data[s__DamageInterfaceUtils__CriticalUtils_didx] + set s__DamageInterfaceUtils__CriticalUtils_didx=s__DamageInterfaceUtils__CriticalUtils_didx - 1 + set s__DamageInterfaceUtils__CriticalUtils_unit[this]=null + set s__DamageInterfaceUtils__CriticalUtils_ticks[this]=0 + + if s__DamageInterfaceUtils__CriticalUtils_didx == - 1 then + call PauseTimer(s__DamageInterfaceUtils__CriticalUtils_timer) + endif + + call sc__Critical_deallocate(this) + + return i - 1 + endfunction + + function s__DamageInterfaceUtils__CriticalUtils_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__DamageInterfaceUtils__CriticalUtils_didx + set this=s__DamageInterfaceUtils__CriticalUtils_data[i] + + if s__DamageInterfaceUtils__CriticalUtils_ticks[this] <= 0 then + set i=s__DamageInterfaceUtils__CriticalUtils_remove(this,i) + endif + set s__DamageInterfaceUtils__CriticalUtils_ticks[this]=s__DamageInterfaceUtils__CriticalUtils_ticks[this] - 1 + set i=i + 1 + endloop + endfunction + + function s__DamageInterfaceUtils__CriticalUtils_addTimed takes unit u,real chance,real multiplier,real duration,integer types returns nothing + local integer this= s__DamageInterfaceUtils__CriticalUtils__allocate() + + set s__DamageInterfaceUtils__CriticalUtils_unit[this]=u + set s__DamageInterfaceUtils__CriticalUtils_crit[this]=chance + set s__DamageInterfaceUtils__CriticalUtils_multi[this]=multiplier + set s__DamageInterfaceUtils__CriticalUtils_ticks[this]=duration / 0.03125000 + set s__DamageInterfaceUtils__CriticalUtils_type[this]=types + set s__DamageInterfaceUtils__CriticalUtils_didx=s__DamageInterfaceUtils__CriticalUtils_didx + 1 + set s__DamageInterfaceUtils__CriticalUtils_data[s__DamageInterfaceUtils__CriticalUtils_didx]=this + + if types == 0 then + call s__Critical_add(u , s__DamageInterfaceUtils__CriticalUtils_crit[this] , s__DamageInterfaceUtils__CriticalUtils_multi[this]) + elseif types == 1 then + set s__Critical_chance[GetUnitUserData((u ))]=(( (s__Critical_chance[GetUnitUserData((u))]) + s__DamageInterfaceUtils__CriticalUtils_crit[this])*1.0) // INLINED!! + else + set s__Critical_multiplier[GetUnitUserData((u ))]=(( (s__Critical_multiplier[GetUnitUserData((u))]) + s__DamageInterfaceUtils__CriticalUtils_multi[this])*1.0) // INLINED!! + endif + + if s__DamageInterfaceUtils__CriticalUtils_didx == 0 then + call TimerStart(s__DamageInterfaceUtils__CriticalUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__CriticalUtils_onPeriod) + endif + endfunction + //endregion + + + + + //region Spell Power + + + function s__DamageInterfaceUtils__SpellPowerUtils_remove takes integer this,integer i returns integer + if s__DamageInterfaceUtils__SpellPowerUtils_isFlat[this] then + set s__SpellPower_flat[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this] ))]=(( (s__SpellPower_flat[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this]))]) - s__DamageInterfaceUtils__SpellPowerUtils_amount[this])*1.0) // INLINED!! + else + set s__SpellPower_percent[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this] ))]=(( (s__SpellPower_percent[GetUnitUserData((s__DamageInterfaceUtils__SpellPowerUtils_unit[this]))]) - s__DamageInterfaceUtils__SpellPowerUtils_amount[this])*1.0) // INLINED!! + endif + + set s__DamageInterfaceUtils__SpellPowerUtils_data[i]=s__DamageInterfaceUtils__SpellPowerUtils_data[s__DamageInterfaceUtils__SpellPowerUtils_didx] + set s__DamageInterfaceUtils__SpellPowerUtils_didx=s__DamageInterfaceUtils__SpellPowerUtils_didx - 1 + set s__DamageInterfaceUtils__SpellPowerUtils_unit[this]=null + set s__DamageInterfaceUtils__SpellPowerUtils_ticks[this]=0 + + if s__DamageInterfaceUtils__SpellPowerUtils_didx == - 1 then + call PauseTimer(s__DamageInterfaceUtils__SpellPowerUtils_timer) + endif + + call sc__SpellPower_deallocate(this) + + return i - 1 + endfunction + + function s__DamageInterfaceUtils__SpellPowerUtils_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__DamageInterfaceUtils__SpellPowerUtils_didx + set this=s__DamageInterfaceUtils__SpellPowerUtils_data[i] + + if s__DamageInterfaceUtils__SpellPowerUtils_ticks[this] <= 0 then + set i=s__DamageInterfaceUtils__SpellPowerUtils_remove(this,i) + endif + set s__DamageInterfaceUtils__SpellPowerUtils_ticks[this]=s__DamageInterfaceUtils__SpellPowerUtils_ticks[this] - 1 + set i=i + 1 + endloop + endfunction + + function s__DamageInterfaceUtils__SpellPowerUtils_addTimed takes unit u,real amount,real duration,boolean isFlat returns nothing + local integer this= s__DamageInterfaceUtils__SpellPowerUtils__allocate() + + set s__DamageInterfaceUtils__SpellPowerUtils_unit[this]=u + set s__DamageInterfaceUtils__SpellPowerUtils_amount[this]=amount + set s__DamageInterfaceUtils__SpellPowerUtils_ticks[this]=duration / 0.03125000 + set s__DamageInterfaceUtils__SpellPowerUtils_isFlat[this]=isFlat + set s__DamageInterfaceUtils__SpellPowerUtils_didx=s__DamageInterfaceUtils__SpellPowerUtils_didx + 1 + set s__DamageInterfaceUtils__SpellPowerUtils_data[s__DamageInterfaceUtils__SpellPowerUtils_didx]=this + + if isFlat then + set s__SpellPower_flat[GetUnitUserData((u ))]=(( (s__SpellPower_flat[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! + else + set s__SpellPower_percent[GetUnitUserData((u ))]=(( (s__SpellPower_percent[GetUnitUserData((u))]) + amount)*1.0) // INLINED!! + endif + + if s__DamageInterfaceUtils__SpellPowerUtils_didx == 0 then + call TimerStart(s__DamageInterfaceUtils__SpellPowerUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__SpellPowerUtils_onPeriod) + endif + endfunction + //endregion + + + + + //region Life Steal + + + function s__DamageInterfaceUtils__LifeStealUtils_remove takes integer this,integer i returns integer + set s__LifeSteal_amount[GetUnitUserData((s__DamageInterfaceUtils__LifeStealUtils_unit[this] ))]=(( (s__LifeSteal_amount[GetUnitUserData((s__DamageInterfaceUtils__LifeStealUtils_unit[this]))]) - s__DamageInterfaceUtils__LifeStealUtils_lifeSteal[this])*1.0) // INLINED!! + + set s__DamageInterfaceUtils__LifeStealUtils_data[i]=s__DamageInterfaceUtils__LifeStealUtils_data[s__DamageInterfaceUtils__LifeStealUtils_didx] + set s__DamageInterfaceUtils__LifeStealUtils_didx=s__DamageInterfaceUtils__LifeStealUtils_didx - 1 + set s__DamageInterfaceUtils__LifeStealUtils_unit[this]=null + set s__DamageInterfaceUtils__LifeStealUtils_ticks[this]=0 + + if s__DamageInterfaceUtils__LifeStealUtils_didx == - 1 then + call PauseTimer(s__DamageInterfaceUtils__LifeStealUtils_timer) + endif + + call sc__LifeSteal_deallocate(this) + + return i - 1 + endfunction + + function s__DamageInterfaceUtils__LifeStealUtils_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__DamageInterfaceUtils__LifeStealUtils_didx + set this=s__DamageInterfaceUtils__LifeStealUtils_data[i] + + if s__DamageInterfaceUtils__LifeStealUtils_ticks[this] <= 0 then + set i=s__DamageInterfaceUtils__LifeStealUtils_remove(this,i) + endif + set s__DamageInterfaceUtils__LifeStealUtils_ticks[this]=s__DamageInterfaceUtils__LifeStealUtils_ticks[this] - 1 + set i=i + 1 + endloop + endfunction + + function s__DamageInterfaceUtils__LifeStealUtils_addTimed takes unit u,real amount,real duration returns nothing + local integer this= s__DamageInterfaceUtils__LifeStealUtils__allocate() + + set s__DamageInterfaceUtils__LifeStealUtils_unit[this]=u + set s__DamageInterfaceUtils__LifeStealUtils_lifeSteal[this]=amount + set s__DamageInterfaceUtils__LifeStealUtils_ticks[this]=duration / 0.03125000 + set s__DamageInterfaceUtils__LifeStealUtils_didx=s__DamageInterfaceUtils__LifeStealUtils_didx + 1 + set s__DamageInterfaceUtils__LifeStealUtils_data[s__DamageInterfaceUtils__LifeStealUtils_didx]=this + + set s__LifeSteal_amount[GetUnitUserData((u ))]=(( (s__LifeSteal_amount[GetUnitUserData((u))]) + s__DamageInterfaceUtils__LifeStealUtils_lifeSteal[this])*1.0) // INLINED!! + + if s__DamageInterfaceUtils__LifeStealUtils_didx == 0 then + call TimerStart(s__DamageInterfaceUtils__LifeStealUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__LifeStealUtils_onPeriod) + endif + endfunction + //endregion + + + + + //region Spell Vamp + + + function s__DamageInterfaceUtils__SpellVampUtils_remove takes integer this,integer i returns integer + set s__SpellVamp_amount[GetUnitUserData((s__DamageInterfaceUtils__SpellVampUtils_unit[this] ))]=(( (s__SpellVamp_amount[GetUnitUserData((s__DamageInterfaceUtils__SpellVampUtils_unit[this]))]) - s__DamageInterfaceUtils__SpellVampUtils_spellVamp[this])*1.0) // INLINED!! + + set s__DamageInterfaceUtils__SpellVampUtils_data[i]=s__DamageInterfaceUtils__SpellVampUtils_data[s__DamageInterfaceUtils__SpellVampUtils_didx] + set s__DamageInterfaceUtils__SpellVampUtils_didx=s__DamageInterfaceUtils__SpellVampUtils_didx - 1 + set s__DamageInterfaceUtils__SpellVampUtils_unit[this]=null + set s__DamageInterfaceUtils__SpellVampUtils_ticks[this]=0 + + if s__DamageInterfaceUtils__SpellVampUtils_didx == - 1 then + call PauseTimer(s__DamageInterfaceUtils__SpellVampUtils_timer) + endif + + call sc__SpellVamp_deallocate(this) + + return i - 1 + endfunction + + function s__DamageInterfaceUtils__SpellVampUtils_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__DamageInterfaceUtils__SpellVampUtils_didx + set this=s__DamageInterfaceUtils__SpellVampUtils_data[i] + + if s__DamageInterfaceUtils__SpellVampUtils_ticks[this] <= 0 then + set i=s__DamageInterfaceUtils__SpellVampUtils_remove(this,i) + endif + set s__DamageInterfaceUtils__SpellVampUtils_ticks[this]=s__DamageInterfaceUtils__SpellVampUtils_ticks[this] - 1 + set i=i + 1 + endloop + endfunction + + function s__DamageInterfaceUtils__SpellVampUtils_addTimed takes unit u,real amount,real duration returns nothing + local integer this= s__DamageInterfaceUtils__SpellVampUtils__allocate() + + set s__DamageInterfaceUtils__SpellVampUtils_unit[this]=u + set s__DamageInterfaceUtils__SpellVampUtils_spellVamp[this]=amount + set s__DamageInterfaceUtils__SpellVampUtils_ticks[this]=duration / 0.03125000 + set s__DamageInterfaceUtils__SpellVampUtils_didx=s__DamageInterfaceUtils__SpellVampUtils_didx + 1 + set s__DamageInterfaceUtils__SpellVampUtils_data[s__DamageInterfaceUtils__SpellVampUtils_didx]=this + + set s__SpellVamp_amount[GetUnitUserData((u ))]=(( (s__SpellVamp_amount[GetUnitUserData((u))]) + s__DamageInterfaceUtils__SpellVampUtils_spellVamp[this])*1.0) // INLINED!! + + if s__DamageInterfaceUtils__SpellVampUtils_didx == 0 then + call TimerStart(s__DamageInterfaceUtils__SpellVampUtils_timer, 0.03125000, true, function s__DamageInterfaceUtils__SpellVampUtils_onPeriod) + endif + endfunction + + + + + function UnitAddEvasionChanceTimed takes unit u,real amount,real duration returns nothing + call s__DamageInterfaceUtils__EvasionUtils_addTimed(u , amount , duration , true) + endfunction + + function UnitAddMissChanceTimed takes unit u,real amount,real duration returns nothing + call s__DamageInterfaceUtils__EvasionUtils_addTimed(u , amount , duration , false) + endfunction + + function UnitAddCriticalStrikeTimed takes unit u,real chance,real multiplier,real duration returns nothing + call s__DamageInterfaceUtils__CriticalUtils_addTimed(u , chance , multiplier , duration , 0) + endfunction + + function UnitAddCriticalChanceTimed takes unit u,real chance,real duration returns nothing + call s__DamageInterfaceUtils__CriticalUtils_addTimed(u , chance , 0 , duration , 1) + endfunction + + function UnitAddCriticalMultiplierTimed takes unit u,real multiplier,real duration returns nothing + call s__DamageInterfaceUtils__CriticalUtils_addTimed(u , 0 , multiplier , duration , 2) + endfunction + + function UnitAddSpellPowerFlatTimed takes unit u,real amount,real duration returns nothing + call s__DamageInterfaceUtils__SpellPowerUtils_addTimed(u , amount , duration , true) + endfunction + + function UnitAddSpellPowerPercentTimed takes unit u,real amount,real duration returns nothing + call s__DamageInterfaceUtils__SpellPowerUtils_addTimed(u , amount , duration , false) + endfunction + + function AbilitySpellDamage takes unit u,integer abilityId,abilityreallevelfield field returns string + return I2S(R2I(( BlzGetAbilityRealLevelField(BlzGetUnitAbility(u, abilityId), field, GetUnitAbilityLevel(u, abilityId) - 1) + (s__SpellPower_flat[GetUnitUserData((u))]) ) * ( 1 + (s__SpellPower_percent[GetUnitUserData((u))]) ))) // INLINED!! + endfunction + + function AbilitySpellDamageEx takes real amount,unit u returns string + return I2S(R2I(( amount + (s__SpellPower_flat[GetUnitUserData((u))]) ) * ( 1 + (s__SpellPower_percent[GetUnitUserData((u))]) ))) // INLINED!! + endfunction + + function UnitAddLifeStealTimed takes unit u,real amount,real duration returns nothing + call s__DamageInterfaceUtils__LifeStealUtils_addTimed(u , amount , duration) + endfunction + + function UnitAddSpellVampTimed takes unit u,real amount,real duration returns nothing + call s__DamageInterfaceUtils__SpellVampUtils_addTimed(u , amount , duration) + endfunction + +//library DamageInterfaceUtils ends +//library Demoralize: + + +function Demoralize__FiterIsTarget takes nothing returns boolean + return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitAlly(GetFilterUnit(), Demoralize__tmpPlayer) +endfunction + +function Demoralize takes unit caster returns nothing + local group targets= CreateGroup() + local integer i= 0 + local integer max= 0 + local real distance= 600.0 + GetUnitAbilityLevel(caster, Demoralize_ABILITY_ID) * 200.0 + local unit target= null + local real casterX= GetUnitX(caster) + local real casterY= GetUnitY(caster) + local real x= 0.0 + local real y= 0.0 + local real facing= 0.0 + set Demoralize__tmpPlayer=GetOwningPlayer(caster) + call GroupEnumUnitsInRange(targets, GetUnitX(caster), GetUnitY(caster), 512.0, Filter(function Demoralize__FiterIsTarget)) + set max=BlzGroupGetSize(targets) + if ( max > 0 ) then + set i=0 + loop + exitwhen ( i == max ) + set target=BlzGroupUnitAt(targets, i) + set x=GetUnitX(target) + set y=GetUnitY(target) + set facing=AngleBetweenCoordinates(casterX , casterY , x , y) + call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(caster))] , "Flee!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) + call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(target))] , "Flee!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) + + set x=PolarProjectionX(casterX , facing , distance) + set y=PolarProjectionY(casterY , facing , distance) + call IssuePointOrder(target, "move", x, y) + + set target=null + set i=i + 1 + endloop + else + call SimError(Demoralize__tmpPlayer , "No targets.") + call IssueImmediateOrder(caster, "stop") + endif + set Demoralize__tmpPlayer=null + call GroupClear(targets) + call DestroyGroup(targets) + set targets=null +endfunction + +function Demoralize__TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == Demoralize_ABILITY_ID ) then + call Demoralize(GetTriggerUnit()) + endif + return false +endfunction + +function Demoralize__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Demoralize__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(Demoralize__castTrigger, Condition(function Demoralize__TriggerConditionCast)) +endfunction + + +//library Demoralize ends +//library HolyNova: + + +function HolyNova__FilterIsEnemyInRange takes nothing returns boolean + return IsUnitAliveBJ(GetFilterUnit()) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) and not IsUnitAlly(GetFilterUnit(), GetOwningPlayer(HolyNova__tmpCaster)) and GetOwningPlayer(GetFilterUnit()) != GetOwningPlayer(HolyNova__tmpCaster) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') == 0 ) or ( not IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) and ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(HolyNova__tmpCaster)) or GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(HolyNova__tmpCaster) ) and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) < GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_LIFE) ) +endfunction + +function HolyNova takes unit caster,integer abilityId returns nothing + local player owner= GetOwningPlayer(caster) + local real damage= I2R(GetUnitAbilityLevel(caster, abilityId)) * 50 + 150 + local group targets= CreateGroup() + local unit target= null + local effect array effects + local integer effectsCounter= 0 + local effect casterEffect + local integer max= 0 + local integer i= 0 + call GroupEnumUnitsInRange(targets, GetUnitX(caster), GetUnitY(caster), 900.0, Filter(function HolyNova__FilterIsEnemyInRange)) + set max=BlzGroupGetSize(targets) + if ( max > 0 ) then + set casterEffect=AddSpecialEffectTarget("war3mapImported\\Holy Nova.mdx", caster, "origin") + loop + exitwhen ( i >= max ) + set target=BlzGroupUnitAt(targets, i) + if ( IsUnitAlly(target, owner) or GetOwningPlayer(target) == owner ) then + call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_LIFE) + damage, GetUnitState(target, UNIT_STATE_MAX_LIFE))) + else + call UnitDamageTarget(caster, target, damage, false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) + endif + set effects[i]=AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", target, "origin") + set target=null + set i=i + 1 + endloop + call PolledWait(3.0) + set i=0 + set max=effectsCounter + loop + exitwhen ( i >= max ) + call DestroyEffect(effects[i]) + set effects[i]=null + set i=i + 1 + endloop + call DestroyEffect(casterEffect) + set casterEffect=null + else + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "No valid targets.") + endif + set owner=null +endfunction + +function HolyNova__TriggerConditionCast takes nothing returns boolean + local integer abilityId= GetSpellAbilityId() + return abilityId == HolyNova_ABILITY_ID or abilityId == HolyNova_ABILITY_ID_2 or abilityId == HolyNova_ABILITY_ID_3 +endfunction + +function HolyNova__TriggerActionCast takes nothing returns nothing + call HolyNova(GetTriggerUnit() , GetSpellAbilityId()) +endfunction + +function HolyNova__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(HolyNova__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(HolyNova__castTrigger, Condition(function HolyNova__TriggerConditionCast)) + call TriggerAddAction(HolyNova__castTrigger, function HolyNova__TriggerActionCast) +endfunction + + +//library HolyNova ends +//library MassDevour: + + +function MassDevour__MassDevourClearTarget takes unit target returns nothing + local integer handleId= GetHandleId(target) + call FlushChildHashtable(MassDevour__h, handleId) +endfunction + +function MassDevour__MassDevourClearCaster takes unit caster returns nothing + local integer handleId= GetHandleId(caster) + local group d= LoadGroupHandle(MassDevour__h, handleId, MassDevour__KEY_DUMMIES) + if ( d != null ) then + call GroupClear(d) + call DestroyGroup(d) + endif + call FlushChildHashtable(MassDevour__h, handleId) +endfunction + +function MassDevour__MassDevourFilter takes nothing returns boolean + local unit filterUnit= GetFilterUnit() + local integer level= GetUnitLevel(filterUnit) + local integer maxLevel= GetUnitAbilityLevel(MassDevour__c, MassDevour__ABILITY_ID) * 5 + local boolean result= level <= maxLevel and not IsUnitAlly(filterUnit, MassDevour__owner) and not IsUnitDeadBJ(filterUnit) and not IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and not IsUnitType(filterUnit, UNIT_TYPE_MAGIC_IMMUNE) + set filterUnit=null + return result +endfunction + +function MassDevour__ForGroupDevour takes nothing returns nothing + local unit target= GetEnumUnit() + local real x= GetUnitX(target) + local real y= GetUnitY(target) + local real facing= GetUnitFacing(target) + local real dummyX= PolarProjectionX(GetUnitX(target) , 60.0 , facing) + local real dummyY= PolarProjectionY(GetUnitY(target) , 60.0 , facing) + local real dummyFacing= AngleBetweenCoordinatesDeg(x , y , dummyX , dummyY) + local unit dummy= CreateUnit(MassDevour__owner, MassDevour__DUMMY_ID, dummyX, dummyY, dummyFacing) + local integer abilityLevel= GetUnitAbilityLevel(MassDevour__c, MassDevour__ABILITY_ID) + //call BJDebugMsg("Caster " + GetUnitName(c) + " with ability level " + I2S(abilityLevel) + " for dummy " + GetUnitName(dummy) + " to target " + GetUnitName(target)) + call UnitAddAbility(dummy, MassDevour__DUMMY_DEVOUR_ABILITY_ID) + call UnitAddAbility(dummy, MassDevour__DUMMY_DEVOUR_CARGO_ABILITY_ID) + //call BJDebugMsg("Dummy 1 " + GetUnitName(dummy)) + call UnitMakeAbilityPermanent(dummy, true, MassDevour__DUMMY_DEVOUR_ABILITY_ID) + call UnitMakeAbilityPermanent(dummy, true, MassDevour__DUMMY_DEVOUR_CARGO_ABILITY_ID) + //call BJDebugMsg("Dummy 2 " + GetUnitName(dummy)) + call SetUnitAbilityLevel(dummy, MassDevour__DUMMY_DEVOUR_ABILITY_ID, abilityLevel) + call SetUnitAbilityLevel(dummy, MassDevour__DUMMY_DEVOUR_CARGO_ABILITY_ID, abilityLevel) + //call BJDebugMsg("Dummy 3 " + GetUnitName(dummy)) + call SetUnitInvulnerable(dummy, true) + //call SelectUnit(dummy, true) + //call BJDebugMsg("After invulnerable") + call ShowUnit(dummy, false) + //call BJDebugMsg("Dummy 4 " + GetUnitName(dummy)) + call GroupAddUnit(MassDevour__dummies, dummy) + call SaveUnitHandle(MassDevour__h, GetHandleId(dummy), MassDevour__KEY_CASTER, MassDevour__c) + //call BJDebugMsg("Dummy 5 " + GetUnitName(dummy)) + //call BJDebugMsg("Before issuing") + call IssueTargetOrder(dummy, MassDevour__DUMMY_DEVOUR_ORDER, target) + //call BJDebugMsg("Dummy 6 " + GetUnitName(dummy)) + //call BJDebugMsg("After issuing") + set dummy=null + set target=null +endfunction + + +function MassDevour__ForGroupMassDevourCasterDies takes nothing returns nothing + local unit dummy= GetEnumUnit() + call SetUnitX(dummy, GetUnitX(MassDevour__tmpCaster)) + call SetUnitY(dummy, GetUnitY(MassDevour__tmpCaster)) + call SetUnitInvulnerable(dummy, false) + call KillUnit(dummy) + call h__RemoveUnit(dummy) + set dummy=null +endfunction + +function MassDevour__CastMassDevour takes unit caster,real x,real y returns nothing + local group d= LoadGroupHandle(MassDevour__h, GetHandleId(caster), MassDevour__KEY_DUMMIES) + local group l__MassDevour__targets= CreateGroup() + set MassDevour__owner=GetOwningPlayer(caster) + set MassDevour__c=caster + call GroupEnumUnitsInRange(l__MassDevour__targets, x, y, MassDevour__RANGE, Filter(function MassDevour__MassDevourFilter)) + + if ( BlzGroupGetSize(l__MassDevour__targets) > 0 ) then + if ( d == null ) then + set MassDevour__dummies=CreateGroup() + else + set MassDevour__dummies=d + endif + call ForGroup(l__MassDevour__targets, function MassDevour__ForGroupDevour) + call SaveGroupHandle(MassDevour__h, GetHandleId(caster), MassDevour__KEY_DUMMIES, MassDevour__dummies) + call GroupAddUnit(MassDevour__casters, caster) + else + call IssueImmediateOrder(caster, "stop") + call SimError(MassDevour__owner , "No targets.") + endif + call GroupClear(l__MassDevour__targets) + call DestroyGroup(l__MassDevour__targets) + set l__MassDevour__targets=null +endfunction + +function MassDevour__TriggerConditionCast takes nothing returns boolean + return GetSpellAbilityId() == MassDevour__ABILITY_ID +endfunction + +function MassDevour__TriggerActionCast takes nothing returns nothing + call MassDevour__CastMassDevour(GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY()) +endfunction + +function MassDevour__TriggerConditionDeathCaster takes nothing returns boolean + return IsUnitInGroup(GetTriggerUnit(), MassDevour__casters) +endfunction + +function MassDevour__TriggerActionDeathCaster takes nothing returns nothing + local group d= LoadGroupHandle(MassDevour__h, GetHandleId(GetTriggerUnit()), MassDevour__KEY_DUMMIES) + set MassDevour__tmpCaster=GetTriggerUnit() + call ForGroup(d, function MassDevour__ForGroupMassDevourCasterDies) + call GroupClear(d) + call DestroyGroup(d) + call GroupRemoveUnit(MassDevour__casters, GetTriggerUnit()) + call MassDevour__MassDevourClearCaster(GetTriggerUnit()) + set d=null +endfunction + +function MassDevour__TriggerConditionDeathTarget takes nothing returns boolean + return IsUnitInGroup(GetTriggerUnit(), MassDevour__targets) +endfunction + +function MassDevour__TriggerActionDeathTarget takes nothing returns nothing + local unit target= GetTriggerUnit() + local unit caster= LoadUnitHandle(MassDevour__h, GetHandleId(target), MassDevour__KEY_CASTER) + local unit dummy= LoadUnitHandle(MassDevour__h, GetHandleId(target), MassDevour__KEY_DUMMY) + local group d= LoadGroupHandle(MassDevour__h, GetHandleId(caster), MassDevour__KEY_DUMMIES) + call GroupRemoveUnit(d, dummy) + call SetUnitInvulnerable(dummy, false) + call KillUnit(dummy) + call h__RemoveUnit(dummy) + set dummy=null + call GroupRemoveUnit(MassDevour__targets, target) + call MassDevour__MassDevourClearTarget(target) + if ( BlzGroupGetSize(d) == 0 ) then + call GroupRemoveUnit(MassDevour__casters, target) + call MassDevour__MassDevourClearCaster(target) + endif + set target=null + set d=null +endfunction + +function MassDevour__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(MassDevour__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(MassDevour__castTrigger, Condition(function MassDevour__TriggerConditionCast)) + call TriggerAddAction(MassDevour__castTrigger, function MassDevour__TriggerActionCast) + + call TriggerRegisterAnyUnitEventBJ(MassDevour__deathTriggerCaster, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(MassDevour__deathTriggerCaster, Condition(function MassDevour__TriggerConditionDeathCaster)) + call TriggerAddAction(MassDevour__deathTriggerCaster, function MassDevour__TriggerActionDeathCaster) + + call TriggerRegisterAnyUnitEventBJ(MassDevour__deathTriggerTarget, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(MassDevour__deathTriggerTarget, Condition(function MassDevour__TriggerConditionDeathTarget)) + call TriggerAddAction(MassDevour__deathTriggerTarget, function MassDevour__TriggerActionDeathTarget) +endfunction + +function MassDevour__RemoveUnitMassDevour takes unit whichUnit returns nothing + call GroupRemoveUnit(MassDevour__targets, whichUnit) + call GroupRemoveUnit(MassDevour__casters, whichUnit) + call MassDevour__MassDevourClearTarget(whichUnit) + call MassDevour__MassDevourClearCaster(whichUnit) +endfunction + +//processed hook: hook RemoveUnit MassDevour__RemoveUnitMassDevour + + +//library MassDevour ends +//library NewBonus: + + // Since ObjectMerger is broken and we still have no means to edit + // bonus values (green values) i decided to create a light weight + // Bonus library that works in the same way that the original Bonus Mod + // by Earth Fury did. NewBonus requires patch 1.30+. + // Credits to Earth Fury for the original Bonus idea + + // How to Import? + // Importing bonus mod is really simple. Just copy the 9 abilities with the + // prefix "NewBonus" from the Object Editor into your map and match their new raw + // code to the bonus types in the global block below. Then create a trigger called + // NewBonus, convert it to custom text and paste this code there. You done! + + + + + + + + + + function GetUnitBonus takes unit source,integer bonus returns real + return sc__NewBonus_get(source , bonus) + endfunction + + function SetUnitBonus takes unit source,integer bonus,real amount returns real + return sc__NewBonus_Set(source , bonus , amount , false) + endfunction + + function RemoveUnitBonus takes unit source,integer bonus returns nothing + if bonus == BONUS_CRITICAL_DAMAGE then + call sc__NewBonus_Set(source , bonus , 1 , false) + else + call sc__NewBonus_Set(source , bonus , 0 , false) + endif + + if bonus == BONUS_LIFE_STEAL then + call UnitRemoveAbility(source, NewBonus__LIFE_STEAL_ABILITY) + endif + endfunction + + function AddUnitBonus takes unit source,integer bonus,real amount returns real + return sc__NewBonus_add(source , bonus , amount) + endfunction + + function RegisterBonusEvent takes code c returns nothing + call sc__NewBonus_register(c , 0) + endfunction + + function RegisterBonusTypeEvent takes integer bonus,code c returns nothing + call sc__NewBonus_register(c , bonus) + endfunction + + function GetBonusUnit takes nothing returns unit + return s__NewBonus_unit[s__NewBonus_key] + endfunction + + function GetBonusType takes nothing returns integer + return s__NewBonus_type[s__NewBonus_key] + endfunction + + function SetBonusType takes integer bonus returns nothing + if bonus >= BONUS_DAMAGE and bonus <= s__NewBonus_last then + set s__NewBonus_type[s__NewBonus_key]=bonus + endif + endfunction + + function GetBonusAmount takes nothing returns real + return s__NewBonus_amount[s__NewBonus_key] + endfunction + + function SetBonusAmount takes real amount returns nothing + set s__NewBonus_amount[s__NewBonus_key]=amount + endfunction + + + + + + function s__NewBonus_checkOverflow takes real current,real value returns real + if value > 0 and current > 2147483647 - value then + return 2147483647 - current + elseif value < 0 and current < - 2147483648 - value then + return - 2147483648 - current + else + return value + endif + endfunction + + function s__NewBonus_onEvent takes integer key returns nothing + local integer i= 0 + local integer next= - 1 + local integer prev= - 2 + + set s__NewBonus_count=s__NewBonus_count + 1 + + if s__NewBonus_amount[key] != 0 and ( s__NewBonus_count - s__NewBonus_last < NewBonus__RECURSION_LIMIT ) then + loop + exitwhen s__NewBonus_type[key] == next or ( i - s__NewBonus_last > NewBonus__RECURSION_LIMIT ) + set next=s__NewBonus_type[key] + + if s__NewBonus_event[next] != null then + call TriggerEvaluate(s__NewBonus_event[next]) + endif + + if s__NewBonus_type[key] != next then + set i=i + 1 + else + if next != prev then + call TriggerEvaluate(s__NewBonus_trigger) + + if s__NewBonus_type[key] != next then + set i=i + 1 + set prev=next + endif + endif + endif + endloop + endif + + set s__NewBonus_count=s__NewBonus_count - 1 + set s__NewBonus_key=key + endfunction + + function s__NewBonus_setAbilityI takes unit source,integer id,abilityintegerlevelfield field,real value,boolean adding returns real + if GetUnitAbilityLevel(source, id) == 0 then + call UnitAddAbility(source, id) + call UnitMakeAbilityPermanent(source, true, id) + endif + + if adding then + if BlzSetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0, BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0) + R2I(value)) then + call IncUnitAbilityLevel(source, id) + call DecUnitAbilityLevel(source, id) + endif + else + if BlzSetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0, R2I(value)) then + call IncUnitAbilityLevel(source, id) + call DecUnitAbilityLevel(source, id) + endif + endif + + set s__NewBonus_linkType=s__NewBonus_type[s__NewBonus_key] + + if s__NewBonus_key > - 1 then + set s__NewBonus_key=s__NewBonus_key - 1 + endif + + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, id), field, 0)) + endfunction + + function s__NewBonus_setAbilityR takes unit source,integer id,abilityreallevelfield field,real value returns real + if GetUnitAbilityLevel(source, id) == 0 then + call UnitAddAbility(source, id) + call UnitMakeAbilityPermanent(source, true, id) + endif + + if BlzSetAbilityRealLevelField(BlzGetUnitAbility(source, id), field, 0, value) then + call IncUnitAbilityLevel(source, id) + call DecUnitAbilityLevel(source, id) + endif + + set s__NewBonus_linkType=s__NewBonus_type[s__NewBonus_key] + + if s__NewBonus_key > - 1 then + set s__NewBonus_key=s__NewBonus_key - 1 + endif + + return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, id), field, 0) + endfunction + + function s__NewBonus_get takes unit source,integer bonus returns real + if bonus == BONUS_DAMAGE then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__DAMAGE_ABILITY), NewBonus__DAMAGE_FIELD, 0)) + elseif bonus == BONUS_ARMOR then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__ARMOR_ABILITY), NewBonus__ARMOR_FIELD, 0)) + elseif bonus == BONUS_HEALTH then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__HEALTH_ABILITY), NewBonus__HEALTH_FIELD, 0)) + elseif bonus == BONUS_MANA then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__MANA_ABILITY), NewBonus__MANA_FIELD, 0)) + elseif bonus == BONUS_AGILITY then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__STATS_ABILITY), NewBonus__AGILITY_FIELD, 0)) + elseif bonus == BONUS_STRENGTH then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__STATS_ABILITY), NewBonus__STRENGTH_FIELD, 0)) + elseif bonus == BONUS_INTELLIGENCE then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__STATS_ABILITY), NewBonus__INTELLIGENCE_FIELD, 0)) + elseif bonus == BONUS_MOVEMENT_SPEED then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__MOVEMENTSPEED_ABILITY), NewBonus__MOVEMENTSPEED_FIELD, 0)) + elseif bonus == BONUS_SIGHT_RANGE then + return I2R(BlzGetAbilityIntegerLevelField(BlzGetUnitAbility(source, NewBonus__SIGHT_RANGE_ABILITY), NewBonus__SIGHT_RANGE_FIELD, 0)) + elseif bonus == BONUS_HEALTH_REGEN then + return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__HEALTHREGEN_ABILITY), NewBonus__HEALTHREGEN_FIELD, 0) + elseif bonus == BONUS_MANA_REGEN then + return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__MANAREGEN_ABILITY), NewBonus__MANAREGEN_FIELD, 0) + elseif bonus == BONUS_ATTACK_SPEED then + return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__ATTACKSPEED_ABILITY), NewBonus__ATTACKSPEED_FIELD, 0) + elseif bonus == BONUS_MAGIC_RESISTANCE then + return BlzGetAbilityRealLevelField(BlzGetUnitAbility(source, NewBonus__MAGIC_RESISTANCE_ABILITY), NewBonus__MAGIC_RESISTANCE_FIELD, 0) + elseif bonus >= BONUS_EVASION_CHANCE and bonus <= s__NewBonus_last then + + if bonus == BONUS_EVASION_CHANCE then + return (s__Evasion_evasion[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_MISS_CHANCE then + return (s__Evasion_miss[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_CRITICAL_CHANCE then + return (s__Critical_chance[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_CRITICAL_DAMAGE then + return (s__Critical_multiplier[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_SPELL_POWER_FLAT then + return (s__SpellPower_flat[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_SPELL_POWER_PERCENT then + return (s__SpellPower_percent[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_LIFE_STEAL then + return (s__LifeSteal_amount[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_SPELL_VAMP then + return (s__SpellVamp_amount[GetUnitUserData(((source)))]) // INLINED!! + elseif bonus == BONUS_COOLDOWN_REDUCTION then + return (1 - s__CDR_get((source) , 0)) // INLINED!! + elseif bonus == BONUS_COOLDOWN_REDUCTION_FLAT then + return (s__CDR_get((source) , 1)) // INLINED!! + elseif bonus == BONUS_COOLDOWN_OFFSET then + return (s__CDR_get((source) , 2)) // INLINED!! + elseif bonus == BONUS_TENACITY then + return (sc__Tenacity_get((source) , 0)) // INLINED!! + elseif bonus == BONUS_TENACITY_FLAT then + return (sc__Tenacity_get((source) , 1)) // INLINED!! + elseif bonus == BONUS_TENACITY_OFFSET then + return (sc__Tenacity_get((source) , 2)) // INLINED!! + endif + + + + + + + + + + + + else + call h__DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type") + endif + + return - 1. + endfunction + + function s__NewBonus_Set takes unit source,integer bonus,real value,boolean adding returns real + local real p + + if not adding then + set s__NewBonus_key=s__NewBonus_key + 1 + set s__NewBonus_unit[s__NewBonus_key]=source + set s__NewBonus_type[s__NewBonus_key]=bonus + set s__NewBonus_amount[s__NewBonus_key]=value + + call s__NewBonus_onEvent(s__NewBonus_key) + + if s__NewBonus_amount[s__NewBonus_key] != value then + set value=s__NewBonus_amount[s__NewBonus_key] + endif + + if s__NewBonus_type[s__NewBonus_key] != bonus then + return s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_amount[s__NewBonus_key] , not adding) + endif + else + set s__NewBonus_unit[s__NewBonus_key]=source + set s__NewBonus_type[s__NewBonus_key]=bonus + set s__NewBonus_amount[s__NewBonus_key]=value + endif + + if bonus == BONUS_DAMAGE then + return s__NewBonus_setAbilityI(source , NewBonus__DAMAGE_ABILITY , NewBonus__DAMAGE_FIELD , value , adding) + elseif bonus == BONUS_ARMOR then + return s__NewBonus_setAbilityI(source , NewBonus__ARMOR_ABILITY , NewBonus__ARMOR_FIELD , value , adding) + elseif bonus == BONUS_HEALTH then + set p=GetUnitLifePercent(source) + + if value == 0 and not adding then + call BlzSetUnitMaxHP(source, R2I(BlzGetUnitMaxHP(source) - s__NewBonus_get(source , bonus))) + else + call BlzSetUnitMaxHP(source, R2I(BlzGetUnitMaxHP(source) + value)) + endif + + call s__NewBonus_setAbilityI(source , NewBonus__HEALTH_ABILITY , NewBonus__HEALTH_FIELD , value , adding) + call SetUnitLifePercentBJ(source, p) + + return value + elseif bonus == BONUS_MANA then + set p=GetUnitManaPercent(source) + + if value == 0 and not adding then + call BlzSetUnitMaxMana(source, R2I(BlzGetUnitMaxMana(source) - s__NewBonus_get(source , bonus))) + else + call BlzSetUnitMaxMana(source, R2I(BlzGetUnitMaxMana(source) + value)) + endif + + call s__NewBonus_setAbilityI(source , NewBonus__MANA_ABILITY , NewBonus__MANA_FIELD , value , adding) + call SetUnitManaPercentBJ(source, p) + + return value + elseif bonus == BONUS_AGILITY then + return s__NewBonus_setAbilityI(source , NewBonus__STATS_ABILITY , NewBonus__AGILITY_FIELD , value , adding) + elseif bonus == BONUS_STRENGTH then + return s__NewBonus_setAbilityI(source , NewBonus__STATS_ABILITY , NewBonus__STRENGTH_FIELD , value , adding) + elseif bonus == BONUS_INTELLIGENCE then + return s__NewBonus_setAbilityI(source , NewBonus__STATS_ABILITY , NewBonus__INTELLIGENCE_FIELD , value , adding) + elseif bonus == BONUS_MOVEMENT_SPEED then + return s__NewBonus_setAbilityI(source , NewBonus__MOVEMENTSPEED_ABILITY , NewBonus__MOVEMENTSPEED_FIELD , value , adding) + elseif bonus == BONUS_SIGHT_RANGE then + if value == 0 and not adding then + call BlzSetUnitRealField(source, UNIT_RF_SIGHT_RADIUS, ( BlzGetUnitRealField(source, UNIT_RF_SIGHT_RADIUS) - s__NewBonus_get(source , bonus) )) + else + call BlzSetUnitRealField(source, UNIT_RF_SIGHT_RADIUS, ( BlzGetUnitRealField(source, UNIT_RF_SIGHT_RADIUS) + value )) + endif + + call s__NewBonus_setAbilityI(source , NewBonus__SIGHT_RANGE_ABILITY , NewBonus__SIGHT_RANGE_FIELD , value , adding) + + return value + elseif bonus == BONUS_HEALTH_REGEN then + return s__NewBonus_setAbilityR(source , NewBonus__HEALTHREGEN_ABILITY , NewBonus__HEALTHREGEN_FIELD , value) + elseif bonus == BONUS_MANA_REGEN then + return s__NewBonus_setAbilityR(source , NewBonus__MANAREGEN_ABILITY , NewBonus__MANAREGEN_FIELD , value) + elseif bonus == BONUS_ATTACK_SPEED then + return s__NewBonus_setAbilityR(source , NewBonus__ATTACKSPEED_ABILITY , NewBonus__ATTACKSPEED_FIELD , value) + elseif bonus == BONUS_MAGIC_RESISTANCE then + return s__NewBonus_setAbilityR(source , NewBonus__MAGIC_RESISTANCE_ABILITY , NewBonus__MAGIC_RESISTANCE_FIELD , value) + elseif bonus >= BONUS_EVASION_CHANCE and bonus <= s__NewBonus_last then + + if bonus == BONUS_EVASION_CHANCE then + set s__Evasion_evasion[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_MISS_CHANCE then + set s__Evasion_miss[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_CRITICAL_CHANCE then + set s__Critical_chance[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_CRITICAL_DAMAGE then + set s__Critical_multiplier[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_SPELL_POWER_FLAT then + set s__SpellPower_flat[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_SPELL_POWER_PERCENT then + set s__SpellPower_percent[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_LIFE_STEAL then + set s__LifeSteal_amount[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_SPELL_VAMP then + set s__SpellVamp_amount[GetUnitUserData(((source ) ))]=(( (( value)*1.0))*1.0) // INLINED!! + elseif bonus == BONUS_COOLDOWN_REDUCTION then + if adding then + call s__CDR_add((source ) , (( value)*1.0)) // INLINED!! + else + call s__CDR_Set((source ) , (( value)*1.0) , 0) // INLINED!! + endif + elseif bonus == BONUS_COOLDOWN_REDUCTION_FLAT then + call s__CDR_Set((source ) , (( value)*1.0) , 1) // INLINED!! + elseif bonus == BONUS_COOLDOWN_OFFSET then + call s__CDR_Set((source ) , (( value)*1.0) , 2) // INLINED!! + elseif bonus == BONUS_TENACITY then + if adding then + call sc__Tenacity_add((source ) , (( value)*1.0) , 0) // INLINED!! + else + call sc__Tenacity_Set((source ) , (( value)*1.0) , 0) // INLINED!! + endif + elseif bonus == BONUS_TENACITY_FLAT then + call sc__Tenacity_Set((source ) , (( value)*1.0) , 1) // INLINED!! + elseif bonus == BONUS_TENACITY_OFFSET then + call sc__Tenacity_Set((source ) , (( value)*1.0) , 2) // INLINED!! + endif + + set s__NewBonus_linkType=bonus + + if s__NewBonus_key > - 1 then + set s__NewBonus_key=s__NewBonus_key - 1 + endif + + return value + + + + + + + + + + + + else + call h__DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Invalid Bonus Type: " + I2S(bonus) + " with last " + I2S(s__NewBonus_last)) + endif + + return - 1. + endfunction + + function s__NewBonus_add takes unit source,integer bonus,real value returns real + if value != 0 then + set s__NewBonus_key=s__NewBonus_key + 1 + set s__NewBonus_unit[s__NewBonus_key]=source + set s__NewBonus_type[s__NewBonus_key]=bonus + set s__NewBonus_amount[s__NewBonus_key]=value + + if bonus <= BONUS_SIGHT_RANGE then + set s__NewBonus_amount[s__NewBonus_key]=s__NewBonus_checkOverflow(s__NewBonus_get(source , bonus) , R2I(value)) + endif + + call s__NewBonus_onEvent(s__NewBonus_key) + set value=s__NewBonus_amount[s__NewBonus_key] + + if s__NewBonus_type[s__NewBonus_key] <= BONUS_SIGHT_RANGE then + call s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_checkOverflow(s__NewBonus_get(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key]) , R2I(s__NewBonus_amount[s__NewBonus_key])) , true) + else + + if s__NewBonus_type[s__NewBonus_key] == BONUS_COOLDOWN_REDUCTION or s__NewBonus_type[s__NewBonus_key] == BONUS_TENACITY then + call s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_amount[s__NewBonus_key] , true) + else + call s__NewBonus_Set(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key] , s__NewBonus_get(s__NewBonus_unit[s__NewBonus_key] , s__NewBonus_type[s__NewBonus_key]) + s__NewBonus_amount[s__NewBonus_key] , true) + endif + + + + endif + + return value + endif + + return 0. + endfunction + + function s__NewBonus_register takes code c,integer bonus returns nothing + if bonus >= BONUS_DAMAGE and bonus <= s__NewBonus_last then + if s__NewBonus_event[bonus] == null then + set s__NewBonus_event[bonus]=CreateTrigger() + endif + call TriggerAddCondition(s__NewBonus_event[bonus], Filter(c)) + else + call TriggerAddCondition(s__NewBonus_trigger, Filter(c)) + endif + endfunction + + function s__NewBonus_onInit takes nothing returns nothing + + set s__NewBonus_last=BONUS_TENACITY_OFFSET + + + + endfunction + +//library NewBonus ends +//library Parry: + + +function Parry__TimerFunctionExpires takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer handleId= GetHandleId(t) + local unit caster= LoadUnitHandle(Parry__h, handleId, 0) + + call GroupRemoveUnit(Parry__casters, caster) + call UnitRemoveAbility(caster, Parry_BUFF_ABILITY_ID) + + call FlushChildHashtable(Parry__h, handleId) + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function Parry takes unit caster returns nothing + local integer handleId= GetHandleId(caster) + local timer t= LoadTimerHandle(Parry__h, handleId, 0) + local real duration= 1.0 + I2R(GetUnitAbilityLevel(caster, Parry_ABILITY_ID)) * 0.5 + call GroupAddUnit(Parry__casters, caster) + call UnitAddAbility(caster, Parry_BUFF_ABILITY_ID) + if ( t == null ) then + set t=CreateTimer() + endif + call TimerStart(t, duration, false, function Parry__TimerFunctionExpires) + call SaveTimerHandle(Parry__h, handleId, 0, t) + set handleId=GetHandleId(t) + call SaveUnitHandle(Parry__h, handleId, 0, caster) + set t=null +endfunction + +function Parry__TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == Parry_ABILITY_ID ) then + call Parry(GetTriggerUnit()) + endif + return false +endfunction + +function Parry__TriggerConditionAttack takes nothing returns boolean + local real x= GetUnitX(GetTriggerUnit()) + local real y= GetUnitY(GetTriggerUnit()) + if ( IsUnitInGroup(GetTriggerUnit(), Parry__casters) ) then + call BlzUnitInterruptAttack(GetAttacker()) + call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] , "Parry!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) + call ShowFadingTextTagForForce(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(GetAttacker()))] , "Parry!" , 0.025 , x , y , 255 , 0 , 0 , 255 , 0.04 , 2.0 , 5.0) + endif + return false +endfunction + +function Parry__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Parry__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(Parry__castTrigger, Condition(function Parry__TriggerConditionCast)) + call TriggerRegisterAnyUnitEventBJ(Parry__attackTrigger, EVENT_PLAYER_UNIT_ATTACKED) + call TriggerAddCondition(Parry__attackTrigger, Condition(function Parry__TriggerConditionAttack)) +endfunction + +function Parry__StopEffect takes unit whichUnit returns nothing + local integer handleId= GetHandleId(whichUnit) + local timer t= LoadTimerHandle(Parry__h, handleId, 0) + call FlushChildHashtable(Parry__h, GetHandleId(t)) + call PauseTimer(t) + call DestroyTimer(t) + call FlushChildHashtable(Parry__h, handleId) + call GroupRemoveUnit(Parry__casters, whichUnit) +endfunction + +function Parry__RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, Parry__casters) ) then + call Parry__StopEffect(whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit Parry__RemoveUnitHook + + +//library Parry ends +//library PhoenixEgg: + + +function PhoenixEgg__TimerFunctionExpires takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer handleId= GetHandleId(t) + local unit egg= LoadUnitHandle(PhoenixEgg__h, handleId, 0) + local unit hero= LoadUnitHandle(PhoenixEgg__h, handleId, 1) + + call ReviveHero(hero, GetUnitX(egg), GetUnitY(egg), true) + + call KillUnit(egg) + + call GroupRemoveUnit(PhoenixEgg__eggs, egg) + + call FlushChildHashtable(PhoenixEgg__h, handleId) + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function PhoenixEgg__StopEffect takes unit egg returns nothing + local integer handleId= GetHandleId(egg) + local timer t= LoadTimerHandle(PhoenixEgg__h, handleId, 0) + call FlushChildHashtable(PhoenixEgg__h, GetHandleId(t)) + call PauseTimer(t) + call DestroyTimer(t) + call FlushChildHashtable(PhoenixEgg__h, handleId) + call GroupRemoveUnit(PhoenixEgg__eggs, egg) +endfunction + +function GetPhoenixEggAbilityId takes unit hero returns integer + local integer level1= GetUnitAbilityLevel(hero, PhoenixEgg_ABILITY_ID) + local integer level2= GetUnitAbilityLevel(hero, PhoenixEgg_ABILITY_ID_2) + if ( level1 > level2 ) then + return level1 + endif + + return level2 +endfunction + +function PhoenixEgg takes unit hero,unit egg returns nothing + local integer handleId= GetHandleId(egg) + local timer t= LoadTimerHandle(PhoenixEgg__h, handleId, 0) + local real duration= 20.0 - I2R(GetPhoenixEggAbilityId(hero)) * 1.0 + call GroupAddUnit(PhoenixEgg__eggs, egg) + if ( t == null ) then + set t=CreateTimer() + endif + call TimerStart(t, duration, false, function PhoenixEgg__TimerFunctionExpires) + call SaveTimerHandle(PhoenixEgg__h, handleId, 0, t) + set handleId=GetHandleId(t) + call SaveUnitHandle(PhoenixEgg__h, handleId, 0, egg) + call SaveUnitHandle(PhoenixEgg__h, handleId, 1, hero) + set t=null +endfunction + +function PhoenixEgg__TriggerConditionSummon takes nothing returns boolean + //call BJDebugMsg(GetUnitName(GetSummoningUnit()) + " summons " + GetUnitName(GetSummonedUnit())) + if ( GetUnitTypeId(GetSummonedUnit()) == PhoenixEgg_UNIT_TYPE_ID and IsUnitType(GetSummoningUnit(), UNIT_TYPE_HERO) ) then + //call BJDebugMsg(GetUnitName(GetSummoningUnit()) + " summons " + GetUnitName(GetSummonedUnit())) + call PhoenixEgg(GetSummoningUnit() , GetSummonedUnit()) + endif + return false +endfunction + +function PhoenixEgg__TriggerConditionDeath takes nothing returns boolean + if ( IsUnitInGroup(GetTriggerUnit(), PhoenixEgg__eggs) ) then + call PhoenixEgg__StopEffect(GetTriggerUnit()) + endif + return false +endfunction + +function PhoenixEgg__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(PhoenixEgg__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(PhoenixEgg__summonTrigger, Condition(function PhoenixEgg__TriggerConditionSummon)) + call TriggerRegisterAnyUnitEventBJ(PhoenixEgg__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(PhoenixEgg__deathTrigger, Condition(function PhoenixEgg__TriggerConditionDeath)) +endfunction + +function PhoenixEgg__RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, PhoenixEgg__eggs) ) then + call PhoenixEgg__StopEffect(whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit PhoenixEgg__RemoveUnitHook + + +//library PhoenixEgg ends +//library Railway: + + +function GetRailwayRectFromCurrentPosition takes unit whichUnit returns integer + local integer i= 0 + loop + exitwhen ( i == udg_RailwayRectsCounter ) + if ( RectContainsUnit(udg_RailwayRects[i], whichUnit) ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function UnitIsInRailwayStation takes unit whichUnit returns boolean + local integer index= LoadInteger(Railway___h, GetHandleId(udg_RailwayLocomotive), Railway___KEY_STATION) + return index != - 1 +endfunction + +function MoveUnitToRailwayStation takes unit whichUnit returns nothing + local integer index= LoadInteger(Railway___h, GetHandleId(udg_RailwayLocomotive), Railway___KEY_STATION) + if ( index != - 1 ) then + call SetUnitX(whichUnit, GetRectCenterX(udg_RailwayStationUnloadRects[index])) + call SetUnitY(whichUnit, GetRectCenterY(udg_RailwayStationUnloadRects[index])) + call BlzSetUnitFacingEx(whichUnit, udg_RailwayStationFaces[index]) + endif +endfunction + +function InitRailwayFromCurrentPositions takes nothing returns nothing + local integer index= - 1 + local unit slotUnit= null + local integer i= 0 + local integer max= BlzGroupGetSize(udg_Railway) + loop + exitwhen ( i == max ) + set slotUnit=BlzGroupUnitAt(udg_Railway, i) + set index=GetRailwayRectFromCurrentPosition(slotUnit) + if ( index != - 1 ) then + call SaveInteger(Railway___h, GetHandleId(slotUnit), Railway___KEY_POSITION, index) + call SaveInteger(Railway___h, GetHandleId(slotUnit), Railway___KEY_STATION, 0) // initial station + endif + set slotUnit=null + set i=i + 1 + endloop +endfunction + +function GetRailwayRect takes unit whichUnit returns integer + return LoadInteger(Railway___h, GetHandleId(whichUnit), Railway___KEY_POSITION) +endfunction + +function GetRailwayRectDirection takes integer index returns integer + return udg_RailwayRectsDirections[index] +endfunction + +function MoveRailwayFromCurrentPosition takes unit whichUnit returns integer + local integer index= (LoadInteger(Railway___h, GetHandleId((whichUnit)), Railway___KEY_POSITION)) // INLINED!! + local real distance= 30.0 + local integer direction= 0 + local real x= 0.0 + local real y= 0.0 + local real face= 0.0 + if ( index != - 1 ) then + if ( udg_RailwayForward ) then + set face=udg_RailwayRectsFaces[index] + else + set face=udg_RailwayRectsFacesReverse[index] + endif + + // align on the rect + set direction=(udg_RailwayRectsDirections[(index)]) // INLINED!! + + if ( direction == DIRECTION_NORTH or direction == DIRECTION_SOUTH ) then + set x=GetRectMaxX(udg_RailwayRects[index]) - GetRectWidthBJ(udg_RailwayRects[index]) / 2.0 + set y=GetUnitY(whichUnit) + elseif ( direction == DIRECTION_WEST or direction == DIRECTION_EAST ) then + set x=GetUnitX(whichUnit) + set y=GetRectMaxY(udg_RailwayRects[index]) - GetRectHeightBJ(udg_RailwayRects[index]) / 2.0 + + else + set x=GetUnitX(whichUnit) + set y=GetUnitY(whichUnit) + endif + + set x=PolarProjectionX(x , face , distance) + set y=PolarProjectionY(y , face , distance) + + call SetUnitX(whichUnit, x) + call SetUnitY(whichUnit, y) + //call SetUnitFacing(whichUnit, udg_RailwayRectsFaces[index]) + call BlzSetUnitFacingEx(whichUnit, udg_RailwayRectsFaces[index]) + + if ( whichUnit == udg_RailwayLocomotive ) then + set udg_RailwayDistance=udg_RailwayDistance + distance + endif + endif + + return index +endfunction + +function MoveRailwayCargo takes nothing returns nothing + local unit whichUnit= null + local real x= GetUnitX(udg_RailwayLocomotive) + local real y= GetUnitY(udg_RailwayLocomotive) + local integer max= BlzGroupGetSize(udg_RailwayCargo) + local integer i= 0 + loop + exitwhen ( i == max ) + set whichUnit=BlzGroupUnitAt(udg_RailwayCargo, i) + call SetUnitX(whichUnit, x) + call SetUnitY(whichUnit, y) + set whichUnit=null + set i=i + 1 + endloop +endfunction + +function AddRailwayRect takes nothing returns nothing + local region r= CreateRegion() + set udg_RailwayRects[udg_RailwayRectsCounter]=udg_TmpRect + set udg_RailwayRectsFaces[udg_RailwayRectsCounter]=udg_TmpReal + set udg_RailwayRectsFacesReverse[udg_RailwayRectsCounter]=ModuloReal(udg_TmpReal + 180.0, 360.0) + + if ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 90.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 90.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_NORTH + elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 270.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 270.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_SOUTH + elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 0.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 0.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_EAST + elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 180.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 180.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_WEST + elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 45.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 45.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_NORTH_EAST + elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 135.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 135.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_NORTH_WEST + elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 225.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 225.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_SOUTH_WEST + elseif ( udg_RailwayRectsFaces[udg_RailwayRectsCounter] >= 315.0 and udg_RailwayRectsFaces[udg_RailwayRectsCounter] <= 315.0 ) then + set udg_RailwayRectsDirections[udg_RailwayRectsCounter]=DIRECTION_SOUTH_EAST + endif + + call RegionAddRect(r, udg_TmpRect) + call SaveInteger(Railway___h, GetHandleId(r), Railway___KEY_POSITION, udg_RailwayRectsCounter) + call TriggerRegisterEnterRegion(Railway___enterTrigger, r, null) + + set udg_RailwayRectsCounter=udg_RailwayRectsCounter + 1 +endfunction + +function AddRailwayStation takes nothing returns nothing + local region r= CreateRegion() + set udg_RailwayStationRects[udg_RailwayStationsCounter]=udg_TmpRect + set udg_RailwayStationFaces[udg_RailwayStationsCounter]=udg_TmpReal + set udg_RailwayStationUnloadRects[udg_RailwayStationsCounter]=udg_TmpRect2 + + call RegionAddRect(r, udg_TmpRect) + call SaveInteger(Railway___h, GetHandleId(r), Railway___KEY_POSITION, udg_RailwayStationsCounter) + call TriggerRegisterEnterRegion(Railway___enterStationTrigger, r, null) + call TriggerRegisterLeaveRegion(Railway___leaveStationTrigger, r, null) + + set udg_RailwayStationsCounter=udg_RailwayStationsCounter + 1 +endfunction + +function Railway___TriggerConditionEnter takes nothing returns boolean + local integer index= LoadInteger(Railway___h, GetHandleId(GetTriggeringRegion()), Railway___KEY_POSITION) + if ( IsUnitInGroup(GetTriggerUnit(), udg_Railway) ) then + call SaveInteger(Railway___h, GetHandleId(GetTriggerUnit()), 0, index) + endif + return false +endfunction + +function Railway___TriggerConditionEnterStation takes nothing returns boolean + local integer index= LoadInteger(Railway___h, GetHandleId(GetTriggeringRegion()), Railway___KEY_POSITION) + if ( IsUnitInGroup(GetTriggerUnit(), udg_Railway) ) then + call SaveInteger(Railway___h, GetHandleId(GetTriggerUnit()), Railway___KEY_STATION, index) + endif + return false +endfunction + +function Railway___TriggerConditionLeaveStation takes nothing returns boolean + if ( IsUnitInGroup(GetTriggerUnit(), udg_Railway) ) then + call SaveInteger(Railway___h, GetHandleId(GetTriggerUnit()), Railway___KEY_STATION, - 1) + endif + return false +endfunction + +function Railway___Init takes nothing returns nothing + call TriggerAddCondition(Railway___enterTrigger, Condition(function Railway___TriggerConditionEnter)) + call TriggerAddCondition(Railway___enterStationTrigger, Condition(function Railway___TriggerConditionEnterStation)) + call TriggerAddCondition(Railway___leaveStationTrigger, Condition(function Railway___TriggerConditionLeaveStation)) +endfunction + +function Railway___RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, udg_RailwayCargo) ) then + call GroupRemoveUnit(udg_RailwayCargo, whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit Railway___RemoveUnitHook + + +//library Railway ends +//library RayConfig: + + + +function RayConfig___HasDummy takes unit target,integer abilityId returns boolean + return HaveSavedHandle(RayConfig___h, GetHandleId(target), abilityId) +endfunction + +function RayConfig___AttachDummy takes player owner,integer unitTypeId,unit target,integer abilityId returns unit + local real face= GetUnitFacing(target) + local real x= PolarProjectionX(GetUnitX(target) , 30.0 , face) + local real y= PolarProjectionY(GetUnitY(target) , 30.0 , face) + local real faceToTarget= AngleBetweenCoordinatesDeg(GetUnitX(target) , GetUnitY(target) , x , y) + local unit dummy= CreateUnit(owner, unitTypeId, x, y, faceToTarget) + call SaveUnitHandle(RayConfig___h, GetHandleId(target), abilityId, dummy) + call ShowUnit(dummy, false) + return dummy +endfunction + +function RayConfig___CleanDummy takes unit target,integer abilityId returns nothing + local integer handleId= GetHandleId(target) + local unit dummy= LoadUnitHandle(RayConfig___h, handleId, abilityId) + if ( dummy != null ) then + call RemoveSavedHandle(RayConfig___h, handleId, abilityId) + call h__RemoveUnit(dummy) + set dummy=null + endif +endfunction + +function RayConfig___TimerFunctionCleanDummy takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer handleId= GetHandleId(t) + local unit target= LoadUnitHandle(RayConfig___h, handleId, 0) + local integer abilityId= LoadInteger(RayConfig___h, handleId, 1) + call RayConfig___CleanDummy(target , abilityId) + call PauseTimer(t) + call DestroyTimer(t) + call FlushChildHashtable(RayConfig___h, handleId) +endfunction + +function RayConfig___CleanDummyDelayed takes unit target,integer abilityId,real delay returns nothing + local timer t= CreateTimer() + local integer handleId= GetHandleId(t) + call SaveUnitHandle(RayConfig___h, handleId, 0, target) + call SaveInteger(RayConfig___h, handleId, 1, abilityId) + call TimerStart(t, delay, false, function RayConfig___TimerFunctionCleanDummy) +endfunction + +function RayConfig___RemoveUnitHook takes unit whichUnit returns nothing + call FlushChildHashtable(RayConfig___h, GetHandleId(whichUnit)) +endfunction + +//processed hook: hook RemoveUnit RayConfig___RemoveUnitHook + +function RayConfig_IsValidAbility takes integer abilityId returns boolean + if ( abilityId == RayConfig_FROST_RAY ) then + return true + elseif ( abilityId == RayConfig_FIRE_RAY ) then + return true + elseif ( abilityId == RayConfig_HOLY_RAY ) then + return true + elseif ( abilityId == RayConfig_HARVEST_RAY ) then + return true + elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then + return true + elseif ( abilityId == RayConfig_WATER_RAY ) then + return true + elseif ( abilityId == RayConfig_WATER_RAY_SLOT_1 ) then + return true + elseif ( abilityId == RayConfig_DRAIN_RAY ) then + return true + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return true + elseif ( abilityId == RayConfig_CHAIN_RAY ) then + return true + elseif ( abilityId == RayConfig_MANA_RAY ) then + return true + elseif ( abilityId == RayConfig_RAISE_RAY ) then + return true + elseif ( abilityId == RayConfig_POISON_RAY ) then + return true + elseif ( abilityId == RayConfig_CHARM_RAY ) then + return true + elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY ) then + return true + elseif ( abilityId == RayConfig_HEX_RAY ) then + return true + elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then + return true + elseif ( abilityId == RayConfig_WIND_RAY ) then + return true + endif + return false +endfunction + +function RayConfig_CanTargetUnits takes integer abilityId returns boolean + return true +endfunction + +function RayConfig_CanTargetDestructables takes integer abilityId returns boolean + return true +endfunction + +function RayConfig_CanTargetItems takes integer abilityId returns boolean + return abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD +endfunction + +function RayConfig___IsNoAlly takes unit target,unit caster returns boolean + return GetOwningPlayer(caster) != GetOwningPlayer(target) and ( not IsUnitAlly(target, GetOwningPlayer(caster)) or GetOwningPlayer(target) == Player(PLAYER_NEUTRAL_PASSIVE) ) +endfunction + +function RayConfig___IsNotAValidWoWReforgedTarget takes unit target returns boolean + local integer unitTypeId= GetUnitTypeId(target) + return unitTypeId == BACKPACK or unitTypeId == EQUIPMENT_BAG +endfunction + +function RayConfig_IsUnitAllowed takes unit caster,unit target,integer abilityId returns boolean + if ( caster == target ) then + return false + elseif ( RayConfig___IsNotAValidWoWReforgedTarget(target) ) then + return false + // Locust is used by dummy units. + elseif ( GetUnitAbilityLevel(target, 'Aloc') > 0 ) then + return false + elseif ( abilityId == RayConfig_RAISE_RAY and IsUnitAliveBJ(target) ) then + return false + elseif ( abilityId == RayConfig_HARVEST_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_HOLY_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_LOOT_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_LOOT_RAY_STANDARD and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_WATER_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_WATER_RAY_SLOT_1 and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_POISON_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_CHARM_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_MANA_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_HEX_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY and IsUnitDeadBJ(target) ) then + return false + elseif ( abilityId == RayConfig_CHAIN_RAY and ( IsUnitDeadBJ(target) or DistanceBetweenCoordinates(GetUnitX(caster) , GetUnitY(caster) , GetUnitX(target) , GetUnitY(target)) <= 100.0 ) ) then + return false + elseif ( abilityId == RayConfig_RESURRECTION_RAY and ( IsUnitType(target, UNIT_TYPE_STRUCTURE) or IsUnitAliveBJ(target) or IsUnitEnemy(target, GetOwningPlayer(caster)) ) ) then + return false + elseif ( abilityId == RayConfig_WIND_RAY and ( not IsUnitType(target, UNIT_TYPE_GROUND) or IsUnitType(target, UNIT_TYPE_STRUCTURE) or IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) ) ) then + return false + elseif ( ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FIRE_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY or abilityId == RayConfig_WIND_RAY ) and IsUnitDeadBJ(target) ) then + return false + endif + + return true +endfunction + +function RayConfig_IsDestructableAllowed takes unit caster,destructable target,integer abilityId returns boolean + if ( abilityId == RayConfig_RESURRECTION_RAY ) then + return IsDestructableDeadBJ(target) + endif + return IsDestructableAliveBJ(target) +endfunction + +function RayConfig_IsItemAllowed takes unit caster,item target,integer abilityId returns boolean + return GetItemLifeBJ(target) > 0.0 and DistanceBetweenCoordinates(GetUnitX(caster) , GetUnitY(caster) , GetItemX(target) , GetItemY(target)) > 100.0 +endfunction + +function RayConfig___IsFrostRay takes integer index returns boolean + return ModuloInteger(index, 2) == 1 +endfunction + +function RayConfig_GetLightningOffsetWidthX takes unit caster,integer abilityId,integer index returns real + if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + if ( (ModuloInteger((index), 2) == 1) ) then // INLINED!! + return index * 10.0 + else + return index * - 10.0 + endif + endif + return 0.0 +endfunction + +function RayConfig_GetLightningOffsetWidthY takes unit caster,integer abilityId,integer index returns real + if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + if ( (ModuloInteger((index), 2) == 1) ) then // INLINED!! + return index * 10.0 + else + return index * - 10.0 + endif + endif + return 0.0 +endfunction + +function RayConfig_GetLightningOffsetLengthX takes unit caster,integer abilityId,integer index returns real + return 40.0 +endfunction + +function RayConfig_GetLightningOffsetLengthY takes unit caster,integer abilityId,integer index returns real + return 40.0 +endfunction + +function RayConfig_GetLightningOffsetZ takes unit caster,integer abilityId,integer index returns real + return 40.0 +endfunction + +function RayConfig___GetDamage takes unit caster,integer abilityId,real duration returns real + local real result= ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 9.0 + 7.0 ) * RayConfig_REFRESH_INTERVAL + + if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return result * 4.0 + endif + + return result +endfunction + +function RayConfig___GetSpeed takes unit caster,integer abilityId,real duration returns real + return ( GetUnitAbilityLevel(caster, abilityId) * 10.0 + 220.0 ) * RayConfig_REFRESH_INTERVAL +endfunction + +function RayConfig___GetHealingLife takes unit caster,integer abilityId,real duration returns real + return ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 9.0 + 7.0 ) * RayConfig_REFRESH_INTERVAL +endfunction + +function RayConfig___GetMana takes unit caster,integer abilityId,real duration returns real + return ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 10.0 + 10.0 ) * RayConfig_REFRESH_INTERVAL +endfunction + +function RayConfig___GetManaCost takes unit caster,integer abilityId,real duration returns real + return ( I2R(GetUnitAbilityLevel(caster, abilityId)) * 7.0 + 5.0 ) * RayConfig_REFRESH_INTERVAL +endfunction + +function RayConfig___WaitDuration takes real duration,real expected returns boolean + if ( duration >= expected ) then + return true + endif + return false +endfunction + +function RayConfig___EveryDuration takes real duration,real interval returns boolean + local real mod= ModuloReal(duration, interval) + return ( mod >= 0.0 and mod < RayConfig_REFRESH_INTERVAL ) +endfunction + +function RayConfig___GetGold takes unit caster,integer abilityId,real duration returns integer + if ( RayConfig___EveryDuration(duration , RayConfig_HARVEST_INTERVAL) ) then + return GetUnitAbilityLevel(caster, abilityId) + endif + return 0 +endfunction + +function RayConfig___GetLumber takes unit caster,integer abilityId,real duration returns integer + if ( RayConfig___EveryDuration(duration , RayConfig_HARVEST_INTERVAL) ) then + return GetUnitAbilityLevel(caster, abilityId) + endif + return 0 +endfunction + +function RayConfig___MoveUnit takes unit caster,unit target,real distance returns nothing + local real sourceX= GetUnitX(caster) + local real sourceY= GetUnitY(caster) + local real targetX= GetUnitX(target) + local real targetY= GetUnitY(target) + local real dist= DistanceBetweenCoordinates(sourceX , sourceY , targetX , targetY) + local real d= dist + distance + local real facing= GetUnitFacing(caster) + local real x= PolarProjectionX(sourceX , d , facing) + local real y= PolarProjectionY(sourceY , d , facing) + call SetUnitPosition(target, x, y) +endfunction + +function RayConfig___KnockBack takes unit caster,unit target,real distance returns nothing + call RayConfig___MoveUnit(caster , target , distance) +endfunction + +function RayConfig___PullUnit takes unit caster,unit target,real distance returns nothing + call RayConfig___MoveUnit(caster , target , - distance) +endfunction + +function RayConfig___PullItem takes unit caster,item target,real distance returns nothing + local real casterX= GetUnitX(caster) + local real casterY= GetUnitY(caster) + local real itemX= GetItemX(target) + local real itemY= GetItemY(target) + local real dist= DistanceBetweenCoordinates(casterX , casterY , itemX , itemY) + local real d= dist - distance + local real facing= GetUnitFacing(caster) + local real x= PolarProjectionX(casterX , d , facing) + local real y= PolarProjectionY(casterY , d , facing) + call SetItemPosition(target, x, y) + + if ( DistanceBetweenCoordinates(casterX , casterY , x , y) <= 100.0 ) then + call UnitAddItem(caster, target) + endif +endfunction + +function RayConfig___Drain takes unit caster,unit target,real amount,real manaAmount returns nothing + // damaging triggers the creep + call UnitDamageTarget(caster, target, amount, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) + call SetUnitState(target, UNIT_STATE_MANA, RMaxBJ(GetUnitState(target, UNIT_STATE_MANA) - manaAmount, 0.0)) + + call SetUnitState(caster, UNIT_STATE_LIFE, RMinBJ(GetUnitState(caster, UNIT_STATE_LIFE) + amount, GetUnitState(caster, UNIT_STATE_MAX_LIFE))) + call SetUnitState(caster, UNIT_STATE_MANA, RMinBJ(GetUnitState(caster, UNIT_STATE_MANA) + manaAmount, GetUnitState(caster, UNIT_STATE_MAX_MANA))) +endfunction + +function RayConfig___Restore takes unit caster,unit target,real amount,real manaAmount returns nothing + call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_LIFE) + amount, GetUnitState(target, UNIT_STATE_MAX_LIFE))) + call SetUnitState(target, UNIT_STATE_MANA, RMinBJ(GetUnitState(target, UNIT_STATE_MANA) + manaAmount, GetUnitState(target, UNIT_STATE_MAX_MANA))) +endfunction + +function RayConfig___DrainMana takes unit caster,unit target,real amount returns nothing + call SetUnitState(target, UNIT_STATE_MANA, RMaxBJ(GetUnitState(target, UNIT_STATE_MANA) - amount, 0.0)) + + call SetUnitState(caster, UNIT_STATE_MANA, RMinBJ(GetUnitState(caster, UNIT_STATE_MANA) + amount, GetUnitState(caster, UNIT_STATE_MAX_MANA))) +endfunction + +function RayConfig___RestoreMana takes unit caster,unit target,real amount returns nothing + call SetUnitState(target, UNIT_STATE_MANA, RMinBJ(GetUnitState(target, UNIT_STATE_MANA) + amount, GetUnitState(target, UNIT_STATE_MAX_MANA))) +endfunction + +function RayConfig___SummonSkeleton takes unit caster,unit target returns nothing + local unit s= CreateUnit(GetOwningPlayer(caster), 'nske', GetUnitX(target), GetUnitY(target), GetUnitFacing(target)) + call UnitApplyTimedLife(s, 'BTLF', 60) + call SetUnitAnimation(s, "Birth") + call h__RemoveUnit(target) + set s=null +endfunction + +function RayConfig___ResurrectNonHeroUnit takes unit target returns nothing + local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(target) , RayConfig_RESURRECT_DUMMY , target , RayConfig_RESURRECTION_RAY) + call IssueImmediateOrder(dummy, "resurrection") + call RayConfig___CleanDummyDelayed(target , RayConfig_RESURRECTION_RAY , 2.0) + //call BJDebugMsg("Remove dummy!") + set dummy=null +endfunction + +function RayConfig___FrostDamage takes unit caster,unit target returns nothing + local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_FROST_DUMMY , target , RayConfig_FROST_RAY) + call SetUnitAbilityLevel(dummy, RayConfig_FROST_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_FROST_RAY)) + call IssueTargetOrder(dummy, "attack", target) + call RayConfig___CleanDummyDelayed(target , RayConfig_FROST_DUMMY , 2.0) + set dummy=null +endfunction + +function RayConfig___FireDamage takes unit caster,unit target returns nothing + local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_FIRE_DUMMY , target , RayConfig_FIRE_RAY) + call SetUnitAbilityLevel(dummy, RayConfig_FIRE_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_FIRE_RAY)) + call IssueTargetOrder(dummy, "attack", target) + call RayConfig___CleanDummyDelayed(target , RayConfig_FIRE_DUMMY , 2.0) + //call BJDebugMsg("Remove dummy!") + set dummy=null +endfunction + +function RayConfig___PoisonDamage takes unit caster,unit target returns nothing + local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_POISON_DUMMY , target , RayConfig_POISON_RAY) + call SetUnitAbilityLevel(dummy, RayConfig_POISON_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_POISON_RAY)) + //call BJDebugMsg("Create poison dummy " + GetUnitName(dummy)) + call IssueTargetOrder(dummy, "attack", target) + call RayConfig___CleanDummyDelayed(target , RayConfig_POISON_DUMMY , 2.0) + //call BJDebugMsg("Remove dummy!") + set dummy=null +endfunction + +function RayConfig___Cyclone takes unit caster,unit target returns nothing + local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_WIND_DUMMY , target , RayConfig_WIND_RAY) + call SetUnitAbilityLevel(dummy, RayConfig_WIND_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_WIND_RAY)) + call IssueTargetOrder(dummy, "cyclone", target) + call RayConfig___CleanDummyDelayed(target , RayConfig_WIND_DUMMY , 2.0) + //call BJDebugMsg("Remove dummy cyclone!") + set dummy=null +endfunction + +function RayConfig___GetMaxCharmLevel takes unit caster,integer abilityId returns integer + return 5 + GetUnitAbilityLevel(caster, abilityId) +endfunction + +function RayConfig___Charm takes unit caster,unit target returns nothing + local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_CHARM_DUMMY , target , RayConfig_CHARM_RAY) + call SetUnitAbilityLevel(dummy, RayConfig_CHARM_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_CHARM_RAY)) + call IssueTargetOrder(dummy, "charm", target) + call RayConfig___CleanDummyDelayed(target , RayConfig_CHARM_DUMMY , 2.0) + //call BJDebugMsg("Remove dummy cyclone!") + set dummy=null +endfunction + +function RayConfig___Hex takes unit caster,unit target returns nothing + local unit dummy= RayConfig___AttachDummy(GetOwningPlayer(caster) , RayConfig_HEX_DUMMY , target , RayConfig_HEX_RAY) + call SetUnitAbilityLevel(dummy, RayConfig_HEX_DUMMY_ABILITY_ID, GetUnitAbilityLevel(caster, RayConfig_HEX_RAY)) + call IssueTargetOrder(dummy, "hex", target) + call RayConfig___CleanDummyDelayed(target , RayConfig_HEX_DUMMY , 2.0) + //call BJDebugMsg("Remove dummy cyclone!") + set dummy=null +endfunction + +function RayConfig___ResurrectUnit takes unit target returns nothing + if ( IsUnitType(target, UNIT_TYPE_HERO) ) then + //call BJDebugMsg("Revive hero " + GetUnitName(target)) + call ReviveHero(target, GetUnitX(target), GetUnitY(target), true) + else + //call BJDebugMsg("Mod " + R2S(ModuloReal(duration, 1.0))) + if ( not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_RESURRECTION_RAY))) ) then // INLINED!! + //call BJDebugMsg("Resurrect unit " + GetUnitName(target)) + call RayConfig___ResurrectNonHeroUnit(target) + endif + endif +endfunction + +function RayConfig_OnHitUnit takes unit caster,unit target,integer abilityId,real duration returns nothing + if ( abilityId == RayConfig_HOLY_RAY ) then + if ( IsUnitAlly(target, GetOwningPlayer(caster)) ) then + if ( not IsUnitType(target, UNIT_TYPE_UNDEAD) ) then + call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_MAX_LIFE), GetUnitState(target, UNIT_STATE_LIFE) + RayConfig___GetHealingLife(caster , abilityId , duration))) + endif + else + if ( IsUnitType(target, UNIT_TYPE_UNDEAD) ) then + call UnitDamageTarget(caster, target, RayConfig___GetDamage(caster , abilityId , duration), false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) + endif + endif + elseif ( abilityId == RayConfig_HARVEST_RAY ) then + if ( GetResourceAmount(target) > 0 ) then + call AdjustPlayerStateBJ(RayConfig___GetGold(caster , abilityId , duration), GetOwningPlayer(caster), PLAYER_STATE_RESOURCE_GOLD) + call SetResourceAmount(target, IMaxBJ(0, GetResourceAmount(target) - RayConfig___GetGold(caster , abilityId , duration))) + endif + elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then + if ( RayConfig___IsNoAlly(target , caster) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then + call RayConfig___MoveUnit((caster ) , ( target ) , (( RayConfig___GetSpeed(caster , abilityId , duration))*1.0)) // INLINED!! + endif + elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then + // nothing + elseif ( abilityId == RayConfig_CHAIN_RAY ) then + if ( RayConfig___IsNoAlly(target , caster) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then + call RayConfig___MoveUnit((caster ) , ( target ) , - (( RayConfig___GetSpeed(caster , abilityId , duration))*1.0)) // INLINED!! + endif + elseif ( abilityId == RayConfig_MANA_RAY ) then + if ( RayConfig___IsNoAlly(target , caster) ) then + call RayConfig___DrainMana(caster , target , RayConfig___GetMana(caster , abilityId , duration)) + else + call RayConfig___RestoreMana(caster , target , RayConfig___GetMana(caster , abilityId , duration)) + endif + elseif ( abilityId == RayConfig_DRAIN_RAY ) then + if ( RayConfig___IsNoAlly(target , caster) ) then + call RayConfig___Drain(caster , target , RayConfig___GetHealingLife(caster , abilityId , duration) , RayConfig___GetMana(caster , abilityId , duration)) + else + call RayConfig___Restore(caster , target , RayConfig___GetHealingLife(caster , abilityId , duration) , RayConfig___GetMana(caster , abilityId , duration)) + endif + elseif ( abilityId == RayConfig_RAISE_RAY ) then + if ( RayConfig___WaitDuration(duration , 1.0) ) then + if ( IsUnitDeadBJ(target) and not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then + call RayConfig___SummonSkeleton(caster , target) + endif + endif + elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then + if ( RayConfig___WaitDuration(duration , 1.0) ) then + if ( not RayConfig___IsNoAlly(target , caster) or GetOwningPlayer(target) == Player(PLAYER_NEUTRAL_PASSIVE) ) then + call RayConfig___ResurrectUnit(target) + endif + endif + elseif ( abilityId == RayConfig_WIND_RAY ) then + if ( RayConfig___WaitDuration(duration , 2.0) ) then + if ( not UnitHasBuffBJ(target, RayConfig_BUFF_ID_WIND) and RayConfig___IsNoAlly(target , caster) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_WIND_RAY))) ) then // INLINED!! + call RayConfig___Cyclone(caster , target) + endif + endif + elseif ( abilityId == RayConfig_CHARM_RAY ) then + if ( RayConfig___WaitDuration(duration , 6.0) ) then + if ( GetUnitLevel(target) <= (5 + GetUnitAbilityLevel((caster ), ( abilityId))) and not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and RayConfig___IsNoAlly(target , caster) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_CHARM_RAY))) ) then // INLINED!! + call RayConfig___Charm(caster , target) + endif + endif + elseif ( abilityId == RayConfig_HEX_RAY ) then + if ( RayConfig___WaitDuration(duration , 1.0) ) then + if ( not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and RayConfig___IsNoAlly(target , caster) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_HEX_RAY))) ) then // INLINED!! + call RayConfig___Hex(caster , target) + endif + endif + elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY ) then + if ( RayConfig___WaitDuration(duration , 1.0) ) then + if ( IsUnitType(target, UNIT_TYPE_SUMMONED) and RayConfig___IsNoAlly(target , caster) ) then + call UnitDamageTarget(caster, target, RayConfig___GetDamage(caster , abilityId , duration) * 2.0, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) + else + if ( RayConfig___IsNoAlly(target , caster) ) then + call UnitRemoveBuffs(target, true, false) + else + call UnitRemoveBuffs(target, false, true) + endif + endif + endif + elseif ( RayConfig___IsNoAlly(target , caster) ) then + if ( ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_FROST_RAY))) and not UnitHasBuffBJ(target, RayConfig_BUFF_ID_FROST) ) then // INLINED!! + call RayConfig___FrostDamage(caster , target) + endif + if ( ( abilityId == RayConfig_FIRE_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_FIRE_RAY))) and not UnitHasBuffBJ(target, RayConfig_BUFF_ID_FIRE) ) then // INLINED!! + call RayConfig___FireDamage(caster , target) + endif + if ( abilityId == RayConfig_POISON_RAY and not (HaveSavedHandle(RayConfig___h, GetHandleId((target )), ( RayConfig_POISON_RAY))) and not UnitHasBuffBJ(target, RayConfig_BUFF_ID_POISON) ) then // INLINED!! + call RayConfig___PoisonDamage(caster , target) + endif + call UnitDamageTarget(caster, target, RayConfig___GetDamage(caster , abilityId , duration), false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) + endif +endfunction + +function RayConfig_OnHitDestructable takes unit caster,destructable target,integer abilityId,real duration returns nothing + if ( abilityId == RayConfig_HARVEST_RAY ) then + if ( IsTree(GetDestructableTypeId(target)) ) then + call AdjustPlayerStateBJ(RayConfig___GetLumber(caster , abilityId , duration), GetOwningPlayer(caster), PLAYER_STATE_RESOURCE_LUMBER) + call SetDestructableLife(target, RMaxBJ(0.0, GetDestructableLife(target) - RayConfig___GetLumber(caster , abilityId , duration))) + endif + elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then + if ( RayConfig___WaitDuration(duration , 2.0) ) then + if ( IsDestructableDeadBJ(target) ) then + call DestructableRestoreLife(target, GetDestructableMaxLife(target), true) + endif + endif + else + call SetDestructableLife(target, RMaxBJ(0.0, GetDestructableLife(target) - RayConfig___GetDamage(caster , abilityId , duration))) + endif +endfunction + +function RayConfig_OnHitItem takes unit caster,item target,integer abilityId,real duration returns nothing + call RayConfig___PullItem(caster , target , RayConfig___GetSpeed(caster , abilityId , duration)) +endfunction + +function RayConfig_OnCastLoop takes unit caster,integer abilityId,real duration returns boolean + call SetUnitManaBJ(caster, RMaxBJ(0.0, GetUnitState(caster, UNIT_STATE_MANA) - RayConfig___GetManaCost(caster , abilityId , duration))) + + return GetUnitState(caster, UNIT_STATE_MANA) > 0.0 +endfunction + +function RayConfig_GetDuration takes unit caster,integer abilityId returns real + if ( abilityId == RayConfig_FROST_RAY ) then + return RayConfig_HOLD_KEY_DURATION + elseif ( abilityId == RayConfig_FIRE_RAY ) then + return RayConfig_HOLD_KEY_DURATION + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return RayConfig_HOLD_KEY_DURATION + endif + return 0.0 +endfunction + +function RayConfig_GetMaxDistance takes unit caster,integer abilityId returns real + return BlzGetUnitRealField(caster, UNIT_RF_SIGHT_RADIUS) +endfunction + +function RayConfig_GetRange takes unit caster,integer abilityId returns real + return 100.0 +endfunction + +function RayConfig_GetCooldown takes unit caster,integer abilityId returns real + return 0.0 +endfunction + +function RayConfig_GetMaxLightnings takes unit caster,integer abilityId returns integer + if ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return 1 + GetUnitAbilityLevel(caster, abilityId) + endif + return 1 +endfunction + +function RayConfig_GetLightningCode takes unit caster,integer abilityId,integer index returns string + if ( abilityId == RayConfig_FROST_RAY ) then + return "BLBM" + elseif ( abilityId == RayConfig_FIRE_RAY ) then + return "FIPA" + elseif ( abilityId == RayConfig_HOLY_RAY ) then + return "YEBM" + elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then + return "YEBM" + elseif ( abilityId == RayConfig_HARVEST_RAY ) then + return "MYSB" + elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then + return "WHBM" + elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then + return "BLBM" + elseif ( abilityId == RayConfig_DRAIN_RAY ) then + return "DRAB" + elseif ( abilityId == RayConfig_CHAIN_RAY ) then + return "WHCH" + elseif ( abilityId == RayConfig_MANA_RAY ) then + return "DRAM" + elseif ( abilityId == RayConfig_RAISE_RAY ) then + return "WHSB" + elseif ( abilityId == RayConfig_POISON_RAY ) then + return "GRSB" + elseif ( abilityId == RayConfig_WIND_RAY ) then + return "SPNL" + elseif ( abilityId == RayConfig_HEX_RAY ) then + return "GRBM" + elseif ( abilityId == RayConfig_CHARM_RAY ) then + return "BLBM" + elseif ( abilityId == RayConfig_NEUTRALIZATION_RAY ) then + return "MYNL" + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + if ( (ModuloInteger((index), 2) == 1) ) then // INLINED!! + return "BLBM" + else + return "FIPA" + endif + endif + return "CLPB" +endfunction + +function RayConfig_GetLoopSound takes unit caster,integer abilityId returns sound + if ( abilityId == RayConfig_FIRE_RAY ) then + return gg_snd_Incinerate1 + //return gg_snd_BlueFireBurstLoop + elseif ( abilityId == RayConfig_FROST_RAY ) then + return gg_snd_BreathOfFrost1 + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return gg_snd_BreathOfFrost1 + elseif ( abilityId == RayConfig_DRAIN_RAY ) then + return gg_snd_LifeDrain + elseif ( abilityId == RayConfig_POISON_RAY ) then + return gg_snd_LifeDrain + elseif ( abilityId == RayConfig_HOLY_RAY ) then + return gg_snd_HealTarget + elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then + return gg_snd_HealTarget + elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then + return gg_snd_WaterWaterFallLoop1 + elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then + return gg_snd_ShimmeringPortalLoop + elseif ( abilityId == RayConfig_HARVEST_RAY ) then + return gg_snd_MineDomeLoop1 + elseif ( abilityId == RayConfig_WIND_RAY ) then + return gg_snd_CycloneLoop1 + elseif ( abilityId == RayConfig_HEX_RAY ) then + return gg_snd_CharmTarget1 + endif + return null +endfunction + +function RayConfig_GetHitSound takes unit caster,integer abilityId returns sound + if ( abilityId == RayConfig_FIRE_RAY ) then + return gg_snd_ImmolationTarget1 + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return gg_snd_ImmolationTarget1 + elseif ( abilityId == RayConfig_FROST_RAY ) then + return gg_snd_FreezingBreathTarget1 + elseif ( abilityId == RayConfig_DRAIN_RAY ) then + return gg_snd_LifeDrain + elseif ( abilityId == RayConfig_POISON_RAY ) then + return gg_snd_LifeDrain + elseif ( abilityId == RayConfig_HOLY_RAY ) then + return gg_snd_HealTarget + elseif ( abilityId == RayConfig_RAISE_RAY ) then + return gg_snd_RaiseSkeleton + elseif ( abilityId == RayConfig_RESURRECTION_RAY ) then + return gg_snd_Tranquility + elseif ( abilityId == RayConfig_WATER_RAY or abilityId == RayConfig_WATER_RAY_SLOT_1 ) then + return gg_snd_WaterWaterFallLoop1 + elseif ( abilityId == RayConfig_LOOT_RAY or abilityId == RayConfig_LOOT_RAY_STANDARD ) then + return gg_snd_ShimmeringPortalLoop + elseif ( abilityId == RayConfig_HARVEST_RAY ) then + return gg_snd_MagicWallLoop1 + endif + return null +endfunction + +function RayConfig_GetCasterEffect takes unit caster,integer abilityId,real duration returns string + if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return "Abilities\\Spells\\Items\\AIob\\AIobTarget.mdl" + endif + return null +endfunction + +function RayConfig_GetCasterEffectAttachmentPoint takes unit caster,integer abilityId,real duration returns string + if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return "origin" + endif + return null +endfunction + +function RayConfig_GetTargetEffect takes unit caster,integer abilityId,real duration returns string + if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return "Abilities\\Spells\\Items\\AIob\\AIobSpecialArt.mdl" + endif + return null +endfunction + +function RayConfig_GetTargetEffectAttachmentPoint takes unit caster,integer abilityId,real duration returns string + if ( abilityId == RayConfig_FROST_RAY or abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return "origin" + endif + return null +endfunction + +function RayConfig_DisableAttack takes unit caster,integer abilityId returns boolean + if ( abilityId == RayConfig_FROST_RAY ) then + return true + elseif ( abilityId == RayConfig_FIRE_RAY ) then + return true + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return true + elseif ( abilityId == RayConfig_CHARM_RAY ) then + return true + endif + return false +endfunction + +function RayConfig_GetDisableMovement takes unit caster,integer abilityId returns boolean + if ( abilityId == RayConfig_FROST_RAY ) then + return true + elseif ( abilityId == RayConfig_FIRE_RAY ) then + return true + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return true + endif + return false +endfunction + +function RayConfig_GetHoldKey takes unit caster,integer abilityId returns boolean + if ( abilityId == RayConfig_FROST_RAY ) then + return true + elseif ( abilityId == RayConfig_FIRE_RAY ) then + return true + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return true + endif + return false +endfunction + +function RayConfig_GetMouseAiming takes unit caster,integer abilityId returns boolean + if ( abilityId == RayConfig_FROST_RAY ) then + return true + elseif ( abilityId == RayConfig_FIRE_RAY ) then + return true + elseif ( abilityId == RayConfig_FROST_AND_FIRE_RAY ) then + return true + endif + return false +endfunction + + +//library RayConfig ends +//library SummonWall: + + +function SummonWall takes unit caster,real targetX,real targetY returns nothing + local player owner= GetOwningPlayer(caster) + local integer max= GetUnitAbilityLevel(caster, SummonWall_ABILITY_ID) + 4 + local real duration= I2R(GetUnitAbilityLevel(caster, SummonWall_ABILITY_ID)) * 5.0 + 45.0 + local real damage= I2R(GetUnitAbilityLevel(caster, SummonWall_ABILITY_ID)) * 5.0 + 10.0 + local real face= AngleBetweenCoordinatesDeg(GetUnitX(caster) , GetUnitY(caster) , targetX , targetY) + local real distance= 0.0 + local real x= targetX + local real y= targetY + local unit wall= null + local integer counter= 0 + loop + exitwhen ( IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) or counter >= max ) + set counter=counter + 1 + call UnitDamagePoint(caster, 0.0, 128.0, x, y, damage, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS) + set wall=CreateUnit(owner, SummonWall_UNIT_TYPE_ID, x, y, face) + call UnitApplyTimedLife(wall, 'BTLF', duration) + set distance=distance + 90.0 + set x=PolarProjectionX(targetX , face , distance) + set y=PolarProjectionY(targetY , face , distance) + call TriggerSleepAction(0.1) + endloop + if ( counter == 0 ) then + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "No space.") + endif + set owner=null +endfunction + +function SummonWall__TriggerConditionCast takes nothing returns boolean + return GetSpellAbilityId() == SummonWall_ABILITY_ID +endfunction + +function SummonWall__TriggerActionCast takes nothing returns nothing + call SummonWall(GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY()) +endfunction + +function SummonWall__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(SummonWall__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(SummonWall__castTrigger, Condition(function SummonWall__TriggerConditionCast)) + call TriggerAddAction(SummonWall__castTrigger, function SummonWall__TriggerActionCast) +endfunction + + +//library SummonWall ends +//library TailSwipe: + + +function TailSwipe__onUnitHit takes integer kb,unit hit returns nothing + if ( not IsUnitAlly(hit, GetOwningPlayer(s__Knockback_caster[kb])) ) then + call UnitDamageTarget(s__Knockback_caster[kb], hit, GetUnitAbilityLevel(s__Knockback_caster[kb], TailSwipe_ABILITY_ID) * 100.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) + endif +endfunction + +function TailSwipe__onDestructableHit takes integer kb,destructable hit returns nothing + if ( (IsTree(GetDestructableTypeId((hit)))) ) then // INLINED!! + call KillDestructable(hit) + endif +endfunction + +function TailSwipe__filterFunction takes integer kb,unit enum returns boolean + return not IsUnitAlly(enum, GetOwningPlayer(s__Knockback_caster[kb])) +endfunction + +function TailSwipe__FiterIsTarget takes nothing returns boolean + return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitAlly(GetFilterUnit(), TailSwipe__tmpPlayer) +endfunction + +function TailSwipe takes unit caster returns nothing + local group targets= CreateGroup() + local integer i= 0 + local integer max= 0 + local real distance= 20.0 + GetUnitAbilityLevel(caster, TailSwipe_ABILITY_ID) * 20.0 + local unit target= null + set TailSwipe__tmpPlayer=GetOwningPlayer(caster) + call GroupEnumUnitsInRange(targets, GetUnitX(caster), GetUnitY(caster), 512.0, Filter(function TailSwipe__FiterIsTarget)) + set max=BlzGroupGetSize(targets) + if ( max > 0 ) then + set i=0 + loop + exitwhen ( i == max ) + set target=BlzGroupUnitAt(targets, i) + call s__Knockback_create(caster , target , distance , 2.0 , AngleBetweenUnitsDeg(caster , target) , TailSwipe_kbType) + set target=null + set i=i + 1 + endloop + else + call SimError(TailSwipe__tmpPlayer , "No targets.") + call IssueImmediateOrder(caster, "stop") + endif + set TailSwipe__tmpPlayer=null + call GroupClear(targets) + call DestroyGroup(targets) + set targets=null +endfunction + +function TailSwipe__TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == TailSwipe_ABILITY_ID ) then + call TailSwipe(GetTriggerUnit()) + endif + return false +endfunction + +function TailSwipe__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(TailSwipe__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(TailSwipe__castTrigger, Condition(function TailSwipe__TriggerConditionCast)) + + set TailSwipe_kbType=s__KnockbackType__allocate() + set s__KnockbackType_onUnitHitAction[TailSwipe_kbType]=(2) + set s__KnockbackType_onDestructableHitAction[TailSwipe_kbType]=(2) + set s__KnockbackType_filterFunc[TailSwipe_kbType]=(2) +endfunction + + +//library TailSwipe ends +//library Telekinesis: + + +function Telekinesis__GetMaxDistance takes unit caster returns real + if ( GetUnitAbilityLevel(caster, Telekinesis__ABILITY_ID) > 0 ) then + return Telekinesis__MAX_DISTANCE + GetUnitAbilityLevel(caster, Telekinesis__ABILITY_ID) * 100.0 + endif + + return 1200.0 +endfunction + +function Telekinesis__TelekinesisHasTarget takes unit caster returns boolean + return HaveSavedHandle(Telekinesis__h, GetHandleId(caster), Telekinesis__KEY_TARGET) +endfunction + +function Telekinesis__TelekinesisSaveUnitTarget takes unit caster,unit target returns nothing + local integer handleId= GetHandleId(caster) + call SaveUnitHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET, target) + call SaveInteger(Telekinesis__h, handleId, Telekinesis__KEY_TARGET_TYPE, Telekinesis__TARGET_TYPE_UNIT) + call UnitAddAbility(target, Telekinesis__BUFF_ABILITY_ID) + //call BJDebugMsg("Target is " + GetUnitName(target)) +endfunction + +function Telekinesis__TelekinesisSaveItemTarget takes unit caster,item target returns nothing + local integer handleId= GetHandleId(caster) + call SaveItemHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET, target) + call SaveInteger(Telekinesis__h, handleId, Telekinesis__KEY_TARGET_TYPE, Telekinesis__TARGET_TYPE_ITEM) +endfunction + +function Telekinesis__TelekinesisSaveDestructableTarget takes unit caster,destructable target returns nothing + local integer handleId= GetHandleId(caster) + call SaveDestructableHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET, target) + call SaveInteger(Telekinesis__h, handleId, Telekinesis__KEY_TARGET_TYPE, Telekinesis__TARGET_TYPE_DESTRUCTABLE) +endfunction + +function Telekinesis__TelekinesisClearTarget takes unit caster returns nothing + local integer handleId= GetHandleId(caster) + call FlushChildHashtable(Telekinesis__h, handleId) +endfunction + +function Telekinesis__IsTelekinesisTargetValid takes unit caster returns boolean + local integer handleId= GetHandleId(caster) + local integer targetType= LoadInteger(Telekinesis__h, handleId, Telekinesis__KEY_TARGET_TYPE) + local real maxDistance= Telekinesis__GetMaxDistance(caster) + local unit targetUnit= null + local item targetItem= null + local destructable targetDestructable= null + if ( targetType == Telekinesis__TARGET_TYPE_UNIT ) then + set targetUnit=LoadUnitHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET) + return DistanceBetweenUnits(caster , targetUnit) <= maxDistance + elseif ( targetType == Telekinesis__TARGET_TYPE_ITEM ) then + set targetItem=LoadItemHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET) + return DistanceBetweenUnitAndItem(caster , targetItem) <= maxDistance + elseif ( targetType == Telekinesis__TARGET_TYPE_DESTRUCTABLE ) then + set targetDestructable=LoadDestructableHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET) + return DistanceBetweenUnitAndDestructable(caster , targetDestructable) <= maxDistance + endif + + return false +endfunction + +function Telekinesis__MoveDestructable takes destructable d,real x,real y,real face,real scale,integer variation returns destructable + local integer typeId= GetDestructableTypeId(d) + local real life= GetDestructableLife(d) + local destructable t= null + call RemoveDestructable(d) + set t=CreateDestructable(typeId, x, y, face, scale, variation) + call SetDestructableLife(t, life) + return t +endfunction + +function Telekinesis__TelekinesisMoveTargetTo takes unit caster,real x,real y returns nothing + local integer handleId= GetHandleId(caster) + local integer targetType= LoadInteger(Telekinesis__h, handleId, Telekinesis__KEY_TARGET_TYPE) + local unit targetUnit= null + local item targetItem= null + local destructable targetDestructable= null + local integer targetDestructableTypeId= 0 + local real targetDestructableLife= 0.0 + if ( targetType == Telekinesis__TARGET_TYPE_UNIT ) then + set targetUnit=LoadUnitHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET) + call SetUnitX(targetUnit, x) + call SetUnitY(targetUnit, y) + call UnitRemoveAbility(targetUnit, Telekinesis__BUFF_ABILITY_ID) + //call BJDebugMsg("Move target: " + GetUnitName(targetUnit)) + set targetUnit=null + elseif ( targetType == Telekinesis__TARGET_TYPE_ITEM ) then + set targetItem=LoadItemHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET) + call SetItemPosition(targetItem, x, y) + set targetItem=null + elseif ( targetType == Telekinesis__TARGET_TYPE_DESTRUCTABLE ) then + set targetDestructable=LoadDestructableHandle(Telekinesis__h, handleId, Telekinesis__KEY_TARGET) + call Telekinesis__MoveDestructable(targetDestructable , x , y , GetRandomDirectionDeg() , 1.0 , 0) + set targetDestructable=null + endif +endfunction + +function Telekinesis__TimerFunctionResetAbilityCooldown takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer handleId= GetHandleId(t) + local unit caster= LoadUnitHandle(Telekinesis__h, handleId, 0) + if ( not IsUnitInGroup(caster, Telekinesis__casters) ) then + //call BJDebugMsg("Reset cooldown for " + GetUnitName(caster)) + call BlzEndUnitAbilityCooldown(caster, Telekinesis__ABILITY_ID) + call BlzEndUnitAbilityCooldown(caster, Telekinesis__ITEM_ABILITY_ID) + endif + call FlushChildHashtable(Telekinesis__h, handleId) + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function Telekinesis__ResetAbilityCooldown takes unit caster returns nothing + local timer t= CreateTimer() + call GroupRemoveUnit(Telekinesis__casters, caster) + call SaveUnitHandle(Telekinesis__h, GetHandleId(t), 0, caster) + call TimerStart(t, 1.0, false, function Telekinesis__TimerFunctionResetAbilityCooldown) +endfunction + +function Telekinesis__CastTelekinesisOnUnit takes unit caster,unit target returns nothing + if ( not IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) ) then + if ( GetUnitAbilityLevel(target, 'Avul') == 0 ) then + call Telekinesis__TelekinesisSaveUnitTarget(caster , target) + call Telekinesis__ResetAbilityCooldown(caster) + else + call IssueImmediateOrder(caster, "stop") + call SimError(GetOwningPlayer(caster) , "Target is spell invulnerable.") + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(GetOwningPlayer(caster) , "Target is spell immune.") + endif +endfunction + +function Telekinesis__CastTelekinesisOnItem takes unit caster,item target returns nothing + call Telekinesis__TelekinesisSaveItemTarget(caster , target) + call Telekinesis__ResetAbilityCooldown(caster) +endfunction + +function Telekinesis__CastTelekinesisOnDestructable takes unit caster,destructable target returns nothing + call Telekinesis__TelekinesisSaveDestructableTarget(caster , target) + call Telekinesis__ResetAbilityCooldown(caster) +endfunction + +function Telekinesis__CastTelekinesisOnPoint takes unit caster,real x,real y returns nothing + if ( (HaveSavedHandle(Telekinesis__h, GetHandleId((caster)), Telekinesis__KEY_TARGET)) ) then // INLINED!! + if ( Telekinesis__IsTelekinesisTargetValid(caster) ) then + call GroupRemoveUnit(Telekinesis__casters, caster) + call Telekinesis__TelekinesisMoveTargetTo(caster , x , y) + call Telekinesis__TelekinesisClearTarget(caster) + else + call Telekinesis__TelekinesisClearTarget(caster) + call IssueImmediateOrder(caster, "stop") + call SimError(GetOwningPlayer(caster) , "Invalid target.") + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(GetOwningPlayer(caster) , "No target.") + endif +endfunction + +function Telekinesis__CastTelekinesis takes nothing returns nothing + if ( GetSpellTargetUnit() != null ) then + call Telekinesis__CastTelekinesisOnUnit(GetTriggerUnit() , GetSpellTargetUnit()) + elseif ( GetSpellTargetItem() != null ) then + call Telekinesis__CastTelekinesisOnItem(GetTriggerUnit() , GetSpellTargetItem()) + elseif ( GetSpellTargetDestructable() != null ) then + call Telekinesis__CastTelekinesisOnDestructable(GetTriggerUnit() , GetSpellTargetDestructable()) + else + call Telekinesis__CastTelekinesisOnPoint(GetTriggerUnit() , GetSpellTargetX() , GetSpellTargetY()) + endif +endfunction + +function Telekinesis__TriggerConditionCast takes nothing returns boolean + local integer abilityId= GetSpellAbilityId() + + return abilityId == Telekinesis__ABILITY_ID or abilityId == Telekinesis__ITEM_ABILITY_ID +endfunction + +function Telekinesis__TriggerActionCast takes nothing returns nothing + call Telekinesis__CastTelekinesis() +endfunction + +function Telekinesis__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Telekinesis__castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(Telekinesis__castTrigger, Condition(function Telekinesis__TriggerConditionCast)) + call TriggerAddAction(Telekinesis__castTrigger, function Telekinesis__TriggerActionCast) +endfunction + +function Telekinesis__RemoveUnitTelekinesis takes unit whichUnit returns nothing + call GroupRemoveUnit(Telekinesis__casters, whichUnit) + call Telekinesis__TelekinesisClearTarget(whichUnit) +endfunction + +//processed hook: hook RemoveUnit Telekinesis__RemoveUnitTelekinesis + + +//library Telekinesis ends +//library WoWReforgedFelOrcPiggery: + + +function WoWReforgedFelOrcPiggery___TriggerConditionConstructFinish takes nothing returns boolean + if ( GetUnitTypeId(GetConstructedStructure()) == WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_PIG_FARM ) then + call AddLoadedMine(GetConstructedStructure() , udg_ResourceMeat , 200 , 20) + call SetLoadedMineAllowedWorkerUnitTypeId(GetConstructedStructure() , WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_FEL_BOAR , true) + call SetMineExplodesOnDeath(GetConstructedStructure() , false) + endif + return false +endfunction + +function WoWReforgedFelOrcPiggery___KillUnitEnum takes nothing returns nothing + call IssueTargetOrder((Resources___triggerMine), "unload", GetEnumUnit()) // INLINED!! + call KillUnit(GetEnumUnit()) +endfunction + +function WoWReforgedFelOrcPiggery___KillCargo takes unit mine returns nothing + local group cargo= (s__UnitEventEx__Cargo_copyGroup((GetUnitUserData(((mine)))))) // INLINED!! + //call BJDebugMsg("Cargo " + I2S(BlzGroupGetSize(cargo))) + call ForGroup(cargo, function WoWReforgedFelOrcPiggery___KillUnitEnum) + call GroupClear(cargo) + call DestroyGroup(cargo) + set cargo=null +endfunction + +function WoWReforgedFelOrcPiggery___TriggerConditionGather takes nothing returns boolean + //call BJDebugMsg("Gather: " + GetUnitName(GetTriggerWorker()) + " in mine " + GetUnitName(GetTriggerMine())) + if ( GetUnitTypeId((Resources___triggerWorker)) == WoWReforgedFelOrcPiggery_UNIT_TYPE_ID_FEL_BOAR ) then // INLINED!! + call WoWReforgedFelOrcPiggery___KillCargo((Resources___triggerMine)) // INLINED!! + call SetUnitResource((Resources___triggerMine) , udg_ResourceMeat , 200) // INLINED!! + endif + return false +endfunction + +function WoWReforgedFelOrcPiggery___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedFelOrcPiggery___constructedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedFelOrcPiggery___constructedTrigger, Condition(function WoWReforgedFelOrcPiggery___TriggerConditionConstructFinish)) + + call TriggerRegisterGatherEvent(WoWReforgedFelOrcPiggery___gatherTrigger) + call TriggerAddCondition(WoWReforgedFelOrcPiggery___gatherTrigger, Condition(function WoWReforgedFelOrcPiggery___TriggerConditionGather)) +endfunction + + +//library WoWReforgedFelOrcPiggery ends +//library WoWReforgedProfessions: + + +function GetRankName takes integer rank returns string + if ( rank == PROFESSION_RANK_DOCTOR ) then + return "Doctor" + elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return "Grand Master" + elseif ( rank == PROFESSION_RANK_MASTER ) then + return "Master" + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return "Adept" + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return "Advanced" + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return "Novice" + endif + + return "Unknown" +endfunction + + + +function GetProfessionsMax takes nothing returns integer + return WoWReforgedProfessions__professionsCounter +endfunction + +function GetProfession takes integer index returns integer + return WoWReforgedProfessions__professions[index] +endfunction + +function GetProfessionName takes integer index returns string + local integer p= (WoWReforgedProfessions__professions[(index)]) // INLINED!! + return GetObjectName(s__Profession_itemTypeId[p]) +endfunction + +function AddProfession takes nothing returns nothing + local integer p= s__Profession__allocate() + local integer index= (WoWReforgedProfessions__professionsCounter) // INLINED!! + local integer i= 0 + + set WoWReforgedProfessions__professions[index]=p + set s__Profession_itemTypeId[p]=udg_TmpItemTypeId + set s__Profession_bookItemTypeId[p]=udg_TmpItemTypeId2 + + loop + exitwhen ( i == PROFESSION_RANK_MAX ) + set s___Profession_ranks[s__Profession_ranks[p]+i]=s__Rank__allocate() + set i=i + 1 + endloop + + set udg_ProfessionName[index]=GetObjectName(udg_TmpItemTypeId) + set udg_ProfessionItemType[index]=udg_TmpItemTypeId2 + set udg_ProfessionItemTypeTavern[index]=udg_TmpItemTypeId + + set udg_LastAddedProfession=index + + set WoWReforgedProfessions__tmpRankCounter=PROFESSION_RANK_NOVICE + + set WoWReforgedProfessions__professionsCounter=WoWReforgedProfessions__professionsCounter + 1 + set udg_Max_Berufe=WoWReforgedProfessions__professionsCounter + + // for adding the items + set udg_TmpInteger=1 + set udg_TmpBoolean=true +endfunction + +function GetProfessionByTavernItemTypeId takes integer tavernItemTypeId returns integer + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i == max ) + if ( tavernItemTypeId == udg_ProfessionItemTypeTavern[i] ) then + return i + endif + set i=i + 1 + endloop + return - 1 // udg_ProfessionNone +endfunction + +function AddProfessionRank takes nothing returns nothing + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) +endfunction + +function AddProfessionCrafted takes integer itemTypeId,integer unitTypeId,integer charges,boolean onCast,integer abilityId returns nothing + local integer index= IMaxBJ(0, (WoWReforgedProfessions__professionsCounter) - 1) // INLINED!! + local integer p= (WoWReforgedProfessions__professions[(index)]) // INLINED!! + local integer rank= IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter) + local integer r= s___Profession_ranks[s__Profession_ranks[p]+rank] + local integer index2= s__Rank_craftedItemsCount[r] + + if ( rank == PROFESSION_RANK_NOVICE and index2 == 0 ) then + if ( itemTypeId != 0 ) then + set WoWReforgedIcons___professionIcons[(index )]=( BlzGetAbilityIcon(itemTypeId)) // INLINED!! + elseif ( unitTypeId != 0 ) then + set WoWReforgedIcons___professionIcons[(index )]=( BlzGetAbilityIcon(unitTypeId)) // INLINED!! + endif + endif + + //call BJDebugMsg(GetProfessionName(index) + " - " + GetRankName(rank) + " count " + I2S(r.craftedItemsCount) + " index2 " + I2S(index2)) + + set s___Rank_craftedItems[s__Rank_craftedItems[r]+index2]=itemTypeId + set s___Rank_craftedUnits[s__Rank_craftedUnits[r]+index2]=unitTypeId + set s___Rank_craftedCount[s__Rank_craftedCount[r]+index2]=charges + set s___Rank_craftedOnCast[s__Rank_craftedOnCast[r]+index2]=onCast + + set s__Rank_craftedItemAbilityId[r]=abilityId + set s__Rank_craftedItemsCount[r]=s__Rank_craftedItemsCount[r] + 1 + + set udg_TmpInteger=1 // charges + set udg_TmpBoolean=true // onCast +endfunction + +function AddProfessionCraftedItem takes nothing returns nothing + call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) +endfunction + +function AddProfessionCraftedUnit takes nothing returns nothing + call AddProfessionCrafted(0 , udg_TmpUnitType , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) +endfunction + +function GetProfessionItemTypeId takes integer index returns integer + local integer p= (WoWReforgedProfessions__professions[(index)]) // INLINED!! + return s__Profession_itemTypeId[p] +endfunction + +function GetProfessionBookItemTypeId takes integer index returns integer + local integer p= (WoWReforgedProfessions__professions[(index)]) // INLINED!! + return s__Profession_bookItemTypeId[p] +endfunction + +function GetProfessionCraftedItem takes integer i,integer rank,integer j returns integer + local integer p= (WoWReforgedProfessions__professions[(i)]) // INLINED!! + return s___Rank_craftedItems[s__Rank_craftedItems[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] +endfunction + +function GetProfessionCraftedUnit takes integer i,integer rank,integer j returns integer + local integer p= (WoWReforgedProfessions__professions[(i)]) // INLINED!! + return s___Rank_craftedUnits[s__Rank_craftedUnits[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] +endfunction + +function GetProfessionCraftedCount takes integer i,integer rank,integer j returns integer + local integer p= (WoWReforgedProfessions__professions[(i)]) // INLINED!! + return s___Rank_craftedCount[s__Rank_craftedCount[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] +endfunction + +function GetProfessionCraftedOnCast takes integer i,integer rank,integer j returns boolean + local integer p= (WoWReforgedProfessions__professions[(i)]) // INLINED!! + return s___Rank_craftedOnCast[s__Rank_craftedOnCast[s___Profession_ranks[s__Profession_ranks[p]+rank]]+j] +endfunction + +function GetProfessionCraftedItemsCount takes integer i,integer rank returns integer + local integer p= (WoWReforgedProfessions__professions[(i)]) // INLINED!! + return s__Rank_craftedItemsCount[s___Profession_ranks[s__Profession_ranks[p]+rank]] +endfunction + +function GetPlayerProfession1 takes player whichPlayer returns integer + return udg_PlayerProfession[GetConvertedPlayerId(whichPlayer)] +endfunction + +function GetPlayerProfession2 takes player whichPlayer returns integer + return udg_PlayerProfession2[GetConvertedPlayerId(whichPlayer)] +endfunction + +function GetPlayerProfession3 takes player whichPlayer returns integer + return udg_PlayerProfession3[GetConvertedPlayerId(whichPlayer)] +endfunction + +function PlayerHasProfession takes player whichPlayer,integer profession returns boolean + return (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) == profession or (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) == profession or (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) == profession // INLINED!! +endfunction + +// Used for Computer AI. +function GetRandomProfession takes nothing returns integer + local integer random= GetRandomInt(0, 11) + + if ( random == 0 ) then + return udg_ProfessionHerbalist + elseif ( random == 1 ) then + return udg_ProfessionAlchemist + elseif ( random == 2 ) then + return udg_ProfessionWeaponSmith + elseif ( random == 3 ) then + return udg_ProfessionArmourer + elseif ( random == 4 ) then + return udg_ProfessionEngineer + elseif ( random == 5 ) then + return udg_ProfessionDragonBreeder + elseif ( random == 6 ) then + return udg_ProfessionLoreMaster + elseif ( random == 7 ) then + return udg_ProfessionRuneforger + elseif ( random == 8 ) then + return udg_ProfessionSorcerer + elseif ( random == 9 ) then + return udg_ProfessionJewelcrafter + elseif ( random == 10 ) then + return udg_ProfessionArchaeologist + //elseif (random == 11) then + //return udg_ProfessionWitchDoctor + endif + + return udg_ProfessionWitchDoctor +endfunction + +// TODO Determine by registered stuff not manually except for archeology and rune master +function GetNextCraftedProfessionItemEx takes integer profession,integer rank returns integer + if ( profession == udg_ProfessionHerbalist ) then + if ( rank == PROFESSION_RANK_DOCTOR ) then + return ITEM_HERB_GARDEN + elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return ITEM_SCROLL_OF_HEALING + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_TALISMAN_OF_EVERLASTING + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_POTION_OF_INVULNERABILITY + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_HEALTH_STONE + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_POTION_OF_GREATER_HEALING + endif + elseif ( profession == udg_ProfessionAlchemist ) then + if ( rank == PROFESSION_RANK_DOCTOR ) then + return ITEM_CAULDRON + elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return ITEM_SCROLL_OF_MANA + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_TALISMAN_OF_SPELL_PROTECTION + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_WAND_OF_MANA_STEALING + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_MANA_STONE + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_POTION_OF_GREATER_MANA + endif + elseif ( profession == udg_ProfessionWeaponSmith ) then + if ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return ITEM_MYTHICAL_POISON_BLADE + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_BLESSED_DRAGON_LANCE + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_DEMON_SLAYER_AXE + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_MITHRIL_LONG_SWORD + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_BOW_OF_FIRE + endif + elseif ( profession == udg_ProfessionArmourer ) then + if ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return ITEM_MYTHICAL_GOLDEN_ARMOR + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_BLESSED_CHAMPION_ARMOR + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_HEAVY_PLATED_SHIELD + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_PLATED_HELMET + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_LIGHT_LEATHER_ARMOR + endif + elseif ( profession == udg_ProfessionEngineer ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_TINY_DEATH_TOWER +// elseif (rank == PROFESSION_RANK_ADEPT) then + //return 'I00M' // 2 gobline sappers + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_TINY_COLD_TOWER + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_TINY_FLAME_TOWER + endif + elseif ( profession == udg_ProfessionLoreMaster ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_ANKH_OF_REINCARNATION + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_SCROLL_OF_RESURRECTION + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_SCROLL_OF_RESTORATION + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_SCROLL_OF_PROTECTION + endif + elseif ( profession == udg_ProfessionSorcerer ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_WAND_OF_SORCERER_ILLUSION + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_WAND_OF_REANIMATION + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_WAND_OF_THE_WIND + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_WAND_OF_NEUTRALIZATION + endif + elseif ( profession == udg_ProfessionRuneforger ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_RUNE_OF_GREATER_RESURRECTION + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_RUNE_OF_LESSER_RESURRECTION_RUNEFORGER + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_RUNE_OF_REBIRTH_RUNEFORGER + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_RUNE_OF_RESTORATION_RUNEFORGER + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_RUNE_OF_DISPEL_MAGIC_RUNEFORGER + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_RUNE_OF_SPEED_RUNEFORGER + endif + elseif ( profession == udg_ProfessionDragonBreeder ) then + if ( rank == PROFESSION_RANK_DOCTOR ) then + return ITEM_DRAGON_BREEDER_ROOST + //elseif (rank == PROFESSION_RANK_GRAND_MASTER) then + //return ITEM_SCROLL_OF_HEALING + // grand master crafts dragon egg which then can be used to summon a dragon + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_GREEN_DRAGON_EGG + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_GREEN_DRAKE_EGG + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_THARIFAS_EGG + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_GREEN_DRAGON_WHELP_EGG + endif + elseif ( profession == udg_ProfessionJewelcrafter ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_GOLDEN_CROWN + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_BRACELET + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_JEWEL_AMULET + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_GREEN_GEMSTONE + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_ENCHANTED_GEMSTONE + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_RING_OF_SUPERIORITY + endif + elseif ( profession == udg_ProfessionArchaeologist ) then + if ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return ChooseRandomItemExBJ(8, ITEM_TYPE_ANY) + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ChooseRandomItemExBJ(7, ITEM_TYPE_ANY) + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ChooseRandomItemExBJ(5, ITEM_TYPE_ANY) + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ChooseRandomItemExBJ(3, ITEM_TYPE_ANY) + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ChooseRandomItemExBJ(1, ITEM_TYPE_ANY) + endif + elseif ( profession == udg_ProfessionWitchDoctor ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_HEALING_WARDS + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_MANA_WARDS + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_STASIS_TRAPS + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_SENTRY_WARDS + endif + elseif ( profession == udg_ProfessionTamer ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_MONSTER_LURE + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_ADVANCED_BAIT + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_BAIT + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_SMALL_BAIT + endif + elseif ( profession == udg_ProfessionNecromancer ) then + if ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return ITEM_SCROLL_OF_ANIMATE_DEAD + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_BOOK_OF_THE_DEAD + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_SACRIFICAL_SCULL + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_WAND_OF_CORPSES + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_ROD_OF_NECROMANCY + endif + elseif ( profession == udg_ProfessionGolemSculptor ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_TINY_FLESH_GOLEM + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_TINY_SIEGE_GOLEM + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_TINY_WAR_GOLEM + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_TINY_MUD_GOLEM + endif + elseif ( profession == udg_ProfessionWarlock ) then + if ( rank == PROFESSION_RANK_DOCTOR ) then + return ITEM_TINY_FEL_FOUNTAIN + elseif ( rank == PROFESSION_RANK_GRAND_MASTER ) then + return ITEM_DEMONIC_FIGURE // ITEM_SPIKED_COLLAR + elseif ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_TINY_DEMON_GATE + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_DEMON_BLOOD + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_INFERNO_STONE + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_WAND_OF_DRAIN + endif + elseif ( profession == udg_ProfessionAstromancer ) then + if ( rank == PROFESSION_RANK_MASTER ) then + return ITEM_TINY_ARCANE_OBSERVATORY_ASTROMANCER + elseif ( rank == PROFESSION_RANK_ADEPT ) then + return ITEM_METEOR_STONE + elseif ( rank == PROFESSION_RANK_ADVANCED ) then + return ITEM_FLARE_GUN + elseif ( rank == PROFESSION_RANK_NOVICE ) then + return ITEM_NAVIGATION_SCROLL + endif + endif + return 0 +endfunction + +function GetProfessionItemCharges takes integer itemTypeId returns integer + return 0 +endfunction + +function GetProfessionCraftRankByMana takes unit hero returns integer + local real mana= GetUnitState(hero, UNIT_STATE_MANA) + if ( mana >= DOCTOR_MANA_COST ) then + return PROFESSION_RANK_DOCTOR + elseif ( mana >= GRAND_MASTER_MANA_COST ) then + return PROFESSION_RANK_GRAND_MASTER + elseif ( mana >= MASTER_MANA_COST ) then + return PROFESSION_RANK_MASTER + elseif ( mana >= ADEPT_MANA_COST ) then + return PROFESSION_RANK_ADEPT + elseif ( mana >= ADVANCED_MANA_COST ) then + return PROFESSION_RANK_ADVANCED + elseif ( mana >= NOVICE_MANA_COST ) then + return PROFESSION_RANK_NOVICE + endif + return PROFESSION_RANK_NOVICE +endfunction + +function GetNextCraftedProfession1Item takes unit hero returns integer + local integer profession= (udg_PlayerProfession[GetConvertedPlayerId((GetOwningPlayer(hero)))]) // INLINED!! + local integer rank= GetProfessionCraftRankByMana(hero) + return GetNextCraftedProfessionItemEx(profession , rank) +endfunction + +function GetNextCraftedProfession2Item takes unit hero returns integer + local integer profession= (udg_PlayerProfession2[GetConvertedPlayerId((GetOwningPlayer(hero)))]) // INLINED!! + local integer rank= GetProfessionCraftRankByMana(hero) + return GetNextCraftedProfessionItemEx(profession , rank) +endfunction + +function GetNextCraftedProfession3Item takes unit hero returns integer + local integer profession= (udg_PlayerProfession3[GetConvertedPlayerId((GetOwningPlayer(hero)))]) // INLINED!! + local integer rank= GetProfessionCraftRankByMana(hero) + return GetNextCraftedProfessionItemEx(profession , rank) +endfunction + +function CraftProfessionItemAIEx takes unit hero,integer itemTypeId returns item + local item result= null + local item slotItem= null + local integer charges= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY or result != null ) + set slotItem=UnitItemInSlot(hero, i) + if ( slotItem == null ) then + call UnitAddItemToSlotById(hero, itemTypeId, i) + set result=UnitItemInSlot(hero, i) + set charges=GetProfessionItemCharges(itemTypeId) + if ( charges > 0 ) then + call SetItemCharges(result, charges) + endif + elseif ( GetItemTypeId(slotItem) == itemTypeId and GetItemCharges(slotItem) > 0 and GetItemCharges(slotItem) < GetMaxStacksByItemTypeId(itemTypeId) ) then + set charges=GetProfessionItemCharges(itemTypeId) + if ( charges == 0 ) then + set charges=1 + endif + call SetItemCharges(slotItem, GetItemCharges(slotItem) + charges) + endif + set slotItem=null + set i=i + 1 + endloop + return result +endfunction + +function CraftProfessionItemAI1 takes unit hero returns item + local integer itemTypeId= GetNextCraftedProfession1Item(hero) + if ( itemTypeId != 0 ) then + return CraftProfessionItemAIEx(hero , itemTypeId) + endif + + return null +endfunction + +function CraftProfessionItemAI2 takes unit hero returns item + local integer itemTypeId= GetNextCraftedProfession2Item(hero) + if ( itemTypeId != 0 ) then + return CraftProfessionItemAIEx(hero , itemTypeId) + endif + + return null +endfunction + +function CraftProfessionItemAI3 takes unit hero returns item + local integer itemTypeId= GetNextCraftedProfession3Item(hero) + if ( itemTypeId != 0 ) then + return CraftProfessionItemAIEx(hero , itemTypeId) + endif + + return null +endfunction + +function CraftProfessionItemsAI takes unit hero returns nothing + local item whichItem= null + if ( IsUnitAliveBJ(hero) ) then + set whichItem=CraftProfessionItemAI1(hero) + if ( whichItem != null ) then + call UnitAddItem(hero, whichItem) + endif + set whichItem=CraftProfessionItemAI2(hero) + if ( whichItem != null ) then + call UnitAddItem(hero, whichItem) + endif + set whichItem=CraftProfessionItemAI3(hero) + if ( whichItem != null ) then + call UnitAddItem(hero, whichItem) + endif + endif +endfunction + +function GetBookItemProfession takes integer itemTypeId returns integer + local integer i= 0 + loop + exitwhen ( i >= udg_Max_Berufe ) + if ( udg_ProfessionItemType[i] == itemTypeId ) then + return i + endif + set i=i + 1 + endloop + return udg_ProfessionNone +endfunction + +function GetObjectProfession takes integer objectId returns integer + local integer j= 0 + local integer i= 0 + local integer k= 0 + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + loop + exitwhen ( i >= max ) + if ( udg_ProfessionItemType[i] == objectId ) then + return i + endif + set j=0 + loop + exitwhen ( j == PROFESSION_RANK_MAX ) + set k=0 + loop + exitwhen ( k == PROFESSION_MAX_CRAFTED ) + if ( GetProfessionCraftedUnit(i , j , k) == objectId or GetProfessionCraftedItem(i , j , k) == objectId ) then + return i + endif + set k=k + 1 + endloop + set j=j + 1 + endloop + set i=i + 1 + endloop + return udg_ProfessionNone +endfunction + +function ProfessionBonusCharges takes unit hero returns integer + return GetHeroLevel(hero) / 15 +endfunction + +function WoWReforgedProfessions__CraftUnits takes unit hero,integer unitTypeId,integer charges returns nothing + local player owner= GetOwningPlayer(hero) + local real x= GetUnitX(hero) + local real y= GetUnitY(hero) + local real face= GetUnitFacing(hero) + local integer count= charges + (GetHeroLevel((hero)) / 15) // INLINED!! + loop + set count=count - 1 + exitwhen count < 0 + call CreateUnit(owner, unitTypeId, x, y, face) + endloop + set owner=null +endfunction + +function WoWReforgedProfessions__CraftItems takes unit hero,integer itemTypeId,integer charges returns nothing + local item whichItem= CreateItem(itemTypeId, GetUnitX(hero), GetUnitY(hero)) + // set charges before adding the item to the hero to avoid stacking before setting charges + if ( GetItemCharges(whichItem) > 0 or charges > 1 ) then + call SetItemCharges(whichItem, charges + (GetHeroLevel((hero)) / 15)) // INLINED!! + endif + call UnitAddItem(hero, whichItem) + set whichItem=null +endfunction + +function WoWReforgedProfessions__GetProfessionIndexByAbilityId takes integer abilityId returns integer + local integer j= 0 + local integer i= 0 + local integer profession= 0 + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + loop + exitwhen ( i >= max ) + set profession=(WoWReforgedProfessions__professions[(i)]) // INLINED!! + set j=0 + loop + exitwhen ( j == PROFESSION_RANK_MAX ) + if ( s__Rank_craftedItemAbilityId[s___Profession_ranks[s__Profession_ranks[profession]+j]] == abilityId ) then + return i + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + return - 1 +endfunction + +function WoWReforgedProfessions__GetProfessionRankByAbilityId takes integer abilityId returns integer + local integer j= 0 + local integer i= 0 + local integer profession= 0 + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + loop + exitwhen ( i >= max ) + set profession=(WoWReforgedProfessions__professions[(i)]) // INLINED!! + set j=0 + loop + exitwhen ( j == PROFESSION_RANK_MAX ) + if ( s__Rank_craftedItemAbilityId[s___Profession_ranks[s__Profession_ranks[profession]+j]] == abilityId ) then + return j + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + return - 1 +endfunction + +function ProfessionCraftUnits takes unit hero,integer abilityId,integer unitTypeId,integer count returns nothing + local real cooldown= RMaxBJ(5.0, BlzGetAbilityRealLevelField(BlzGetUnitAbility(hero, abilityId), ABILITY_RLF_COOLDOWN, 0) - I2R(GetHeroLevel(hero))) + local force allies= GetAlliesWithSharedControl(GetOwningPlayer(hero)) + call WoWReforgedProfessions__CraftUnits(hero , unitTypeId , count) + call ShowFadingTextTagForForce((allies ) , ( "+" + I2S((GetHeroLevel((hero)) / 15)) + "|nCooldown: " + I2S(R2I(cooldown)) + "s" ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 255 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! + // sleep is required since the shared spell book cooldown apparently triggers after some sleep + call TriggerSleepAction(0.1) + if ( GetUnitTypeId(hero) != 0 ) then + call BlzStartUnitAbilityCooldown(hero, 'Aspb', cooldown) + endif + call DestroyForce(allies) + set allies=null +endfunction + +function ProfessionCraftItems takes unit hero,integer abilityId,integer itemTypeId,integer count returns nothing + local real cooldown= RMaxBJ(5.0, BlzGetAbilityRealLevelField(BlzGetUnitAbility(hero, abilityId), ABILITY_RLF_COOLDOWN, 0) - I2R(GetHeroLevel(hero))) + local force allies= GetAlliesWithSharedControl(GetOwningPlayer(hero)) + call WoWReforgedProfessions__CraftItems(hero , itemTypeId , count) + call ShowFadingTextTagForForce((allies ) , ( "+" + I2S((GetHeroLevel((hero)) / 15)) + "|nCooldown: " + I2S(R2I(cooldown)) + "s" ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 255 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! + // sleep is required since the shared spell book cooldown apparently triggers after some sleep + call TriggerSleepAction(0.1) + if ( GetUnitTypeId(hero) != 0 ) then + call BlzStartUnitAbilityCooldown(hero, 'Aspb', cooldown) + endif + call DestroyForce(allies) + set allies=null +endfunction + +function WoWReforgedProfessions__CastCraft takes unit hero,integer abilityId,integer index returns nothing + local integer p= (WoWReforgedProfessions__professions[(index)]) // INLINED!! + local integer i= 0 + local integer index2= 0 + local integer rank= WoWReforgedProfessions__GetProfessionRankByAbilityId(abilityId) + local integer max= GetProfessionCraftedItemsCount(index , rank) + //call BJDebugMsg("Craft " + I2S(max) + " IDs.") + loop + exitwhen ( i >= max ) + if ( s___Rank_craftedOnCast[s__Rank_craftedOnCast[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] ) then + if ( s___Rank_craftedUnits[s__Rank_craftedUnits[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] != 0 ) then + call ProfessionCraftUnits(hero , abilityId , s___Rank_craftedUnits[s__Rank_craftedUnits[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] , s___Rank_craftedCount[s__Rank_craftedCount[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i]) + elseif ( s___Rank_craftedItems[s__Rank_craftedItems[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] != 0 ) then + call ProfessionCraftItems(hero , abilityId , s___Rank_craftedItems[s__Rank_craftedItems[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i] , s___Rank_craftedCount[s__Rank_craftedCount[s___Profession_ranks[s__Profession_ranks[p]+rank]]+i]) + endif + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedProfessions__TriggerActionCast takes nothing returns nothing + local integer abilityId= GetSpellAbilityId() + local integer index= WoWReforgedProfessions__GetProfessionIndexByAbilityId(abilityId) + if ( index != - 1 ) then + call WoWReforgedProfessions__CastCraft(GetTriggerUnit() , abilityId , index) + endif +endfunction + +function WoWReforgedProfessions__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedProfessions__castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddAction(WoWReforgedProfessions__castTrigger, function WoWReforgedProfessions__TriggerActionCast) +endfunction + + +//library WoWReforgedProfessions ends +//library WoWReforgedRailRoad: + +function WoWReforgedRailRoad___FilterFunctionIsRailroad takes nothing returns boolean + return IsUnitAliveBJ(GetFilterUnit()) and ( GetUnitTypeId(GetFilterUnit()) == 'o01N' or GetUnitTypeId(GetFilterUnit()) == 'o01K' or GetUnitTypeId(GetFilterUnit()) == 'o01H' ) +endfunction + +function GetRailroad takes unit train,real angle returns unit + local group whichGroup= CreateGroup() + local unit result= null + local unit first= null + call GroupEnumUnitsInRange(whichGroup, PolarProjectionX(GetUnitX(train) , angle , 40.0), PolarProjectionY(GetUnitY(train) , angle , 40.0), 200.0, Filter(function WoWReforgedRailRoad___FilterFunctionIsRailroad)) + loop + exitwhen ( result != null ) + set first=FirstOfGroup(whichGroup) + exitwhen ( first == null ) + if ( GetOwningPlayer(first) == GetOwningPlayer(train) or IsUnitAlly(first, GetOwningPlayer(train)) ) then + set result=first + endif + call GroupRemoveUnit(whichGroup, first) + endloop + + call GroupClear(whichGroup) + call DestroyGroup(whichGroup) + set whichGroup=null + + return result +endfunction + +function GetNextRailroad takes unit source returns unit + return GetRailroad(source , 90.0) +endfunction + +function GetPreviousRailroad takes unit source returns unit + return GetRailroad(source , 270.0) +endfunction + + +//library WoWReforgedRailRoad ends +//library WoWReforgedTradingPosts: + + +function GetUnitFurthestAway takes unit source,group possibleTargets returns unit + local player owner= GetOwningPlayer(source) + local unit result= null + local real distance0= 0.0 + local real distance1= 0.0 + local unit groupUnit= null + local integer i= 0 + loop + exitwhen ( i >= BlzGroupGetSize(possibleTargets) ) + set groupUnit=BlzGroupUnitAt(possibleTargets, i) + if ( IsUnitAlly(groupUnit, owner) ) then + set distance1=DistanceBetweenUnits(source , groupUnit) + if ( result == null or distance1 > distance0 ) then + set distance0=distance1 + set result=groupUnit + endif + endif + set groupUnit=null + set i=i + 1 + endloop + set owner=null + return result +endfunction + + + +function AddTradingPostResource takes integer resource,integer buyUnitTypeId,integer sellUnitTypeId returns nothing + local integer r= s__WoWReforgedTradingPosts___TradingPostResource__allocate() + set s__WoWReforgedTradingPosts___TradingPostResource_resource[r]=resource + set s__WoWReforgedTradingPosts___TradingPostResource_buyUnitTypeId[r]=buyUnitTypeId + set s__WoWReforgedTradingPosts___TradingPostResource_sellUnitTypeId[r]=sellUnitTypeId + set WoWReforgedTradingPosts___tradingPostResource[WoWReforgedTradingPosts___tradingPostResourceCount]=r + set WoWReforgedTradingPosts___tradingPostResourceCount=WoWReforgedTradingPosts___tradingPostResourceCount + 1 +endfunction + +function AddTradingPostResourceWoWReforged takes nothing returns nothing + call AddTradingPostResource(udg_TmpInteger , udg_TmpUnitType , udg_TmpUnitType2) +endfunction + +function AddResourcesShop takes unit shop returns nothing + local integer i= 0 + local integer r= 0 + call EnablePagedButtons(shop) + call SetPagedButtonsSlotsPerPage(shop , 4) // 12 - Cancel Button, 2 Page Buttons, Rally Point, Pack Horse and research + loop + exitwhen ( i == WoWReforgedTradingPosts___tradingPostResourceCount ) + set r=WoWReforgedTradingPosts___tradingPostResource[i] +call AddPagedButtonsId((shop ) , ( s__WoWReforgedTradingPosts___TradingPostResource_buyUnitTypeId[r]) , PagedButtons_BUTTON_TYPE_UNIT) // Buy 100 // INLINED!! +call AddPagedButtonsId((shop ) , ( s__WoWReforgedTradingPosts___TradingPostResource_sellUnitTypeId[r]) , PagedButtons_BUTTON_TYPE_UNIT) // Sell 100 // INLINED!! + set i=i + 1 + endloop +endfunction + +function TradingPostSellsUnit takes unit tradingPost,unit soldUnit returns nothing + local integer unitTypeId= GetUnitTypeId(soldUnit) + local player owner= GetOwningPlayer(soldUnit) + local integer r= 0 + local integer i= 0 + loop + exitwhen ( i == WoWReforgedTradingPosts___tradingPostResourceCount ) + set r=WoWReforgedTradingPosts___tradingPostResource[i] + if ( unitTypeId == s__WoWReforgedTradingPosts___TradingPostResource_buyUnitTypeId[r] ) then // Buy 100 + call AddPlayerResource(owner , s__WoWReforgedTradingPosts___TradingPostResource_resource[r] , 100) + call h__RemoveUnit(soldUnit) + exitwhen ( true ) + elseif ( unitTypeId == s__WoWReforgedTradingPosts___TradingPostResource_sellUnitTypeId[r] ) then // Sell 100 + if ( ExchangePlayerResource(owner , s__WoWReforgedTradingPosts___TradingPostResource_resource[r] , Resources_GOLD , 100) == 0 ) then + call SimError(owner , "No " + (s__Resource_name[(s__WoWReforgedTradingPosts___TradingPostResource_resource[r])]) + ".") // INLINED!! + endif + call h__RemoveUnit(soldUnit) + exitwhen ( true ) + endif + set i=i + 1 + endloop + set owner=null +endfunction + +function WoWReforgedTradingPosts___TriggerConditionGather takes nothing returns boolean + local integer playerId= GetPlayerId(GetOwningPlayer((Resources___triggerWorker))) // INLINED!! + if ( udg_TradingPostGoldExchange[playerId] ) then + call CustomBountyFadingText((Resources___triggerWorker) , Resources_GOLD , (Resources___triggerResourceAmount)) // INLINED!! + call ExchangePlayerResource(GetOwningPlayer((Resources___triggerWorker)) , (Resources___triggerResource) , Resources_GOLD , (Resources___triggerResourceAmount)) // INLINED!! + endif + return false +endfunction + +function WoWReforgedTradingPosts___Init takes nothing returns nothing + call TriggerRegisterGatherEvent(WoWReforgedTradingPosts___gatherTrigger) + call TriggerAddCondition(WoWReforgedTradingPosts___gatherTrigger, Condition(function WoWReforgedTradingPosts___TriggerConditionGather)) +endfunction + + +//library WoWReforgedTradingPosts ends +//library NewBonusUtils: + + // Required Library: RegisterPlayerUnitEvent -> www.hiveworkshop.com/threads/snippet-registerplayerunitevent.203338/ + + // API: + // function AddUnitBonusTimed takes unit u, integer bonus_type, real amount, real duration returns nothing + // -> Add the specified amount for the specified bonus type for unit for a duration + // -> Example: call AddUnitBonusTimed(GetTriggerUnit(), BONUS_ARMOR, 13, 10.5) + + // function LinkBonusToBuff takes unit u, integer bonus_type, real amount, integer buffId returns nothing + // -> Links the bonus amount specified to a buff or ability. As long as the unit has the buff or + // -> the ability represented by the parameter buffId the bonus is not removed. + // -> Example: call LinkBonusToBuff(GetTriggerUnit(), BONUS_ARMOR, 10, 'B000') + + // function LinkBonusToItem takes unit u, integer bonus_type, real amount, item i returns nothing + // -> Links the bonus amount specified to an item. As long as the unit has that item the bonus is not removed. + // -> Note that it will work for items with the same id, because it takes as parameter the item object. + // -> Example: call LinkBonusToItem(GetManipulatingUnit(), BONUS_ARMOR, 10, GetManipulatedItem()) + + // function UnitCopyBonuses takes unit source, unit target returns nothing + // -> Copy the source unit bonuses using the Add functionality to the target unit + // -> Example: call UnitCopyBonuses(GetTriggerUnit(), GetSummonedUnit()) + + // function UnitMirrorBonuses takes unit source, unit target returns nothing + // -> Copy the source unit bonuses using the Set functionality to the target unit + // -> Example: call UnitMirrorBonuses(GetTriggerUnit(), GetSummonedUnit()) + + + + + + function AddUnitBonusTimed takes unit source,integer bonus,real amount,real duration returns nothing + call sc__NewBonusUtils_linkTimed(source , bonus , amount , duration , true) + endfunction + + function LinkBonusToBuff takes unit source,integer bonus,real amount,integer id returns nothing + call sc__NewBonusUtils_linkBuff(source , bonus , amount , id , false) + endfunction + + function LinkBonusToItem takes unit source,integer bonus,real amount,item i returns nothing + call sc__NewBonusUtils_linkItem(source , bonus , amount , i) + endfunction + + function UnitCopyBonuses takes unit source,unit target returns nothing + call sc__NewBonusUtils_copy(source , target) + endfunction + + function UnitMirrorBonuses takes unit source,unit target returns nothing + call sc__NewBonusUtils_mirror(source , target) + endfunction + + + + + + + function s__NewBonusUtils_remove takes integer this,integer i,boolean isItem returns integer + + if s__NewBonusUtils_bonus_t[this] == BONUS_COOLDOWN_REDUCTION then + call s__CDR_remove((s__NewBonusUtils_source[this] ) , (( s__NewBonusUtils_value[this])*1.0)) // INLINED!! + elseif s__NewBonusUtils_bonus_t[this] == BONUS_TENACITY then + call sc__Tenacity_remove((s__NewBonusUtils_source[this] ) , (( s__NewBonusUtils_value[this])*1.0)) // INLINED!! + else +call sc__NewBonus_add((s__NewBonusUtils_source[this] ) , ( s__NewBonusUtils_bonus_t[this] ) , (( - s__NewBonusUtils_value[this])*1.0)) // INLINED!! + endif + + + + + if isItem then + set s__NewBonusUtils_items[i]=s__NewBonusUtils_items[s__NewBonusUtils_k] + set s__NewBonusUtils_k=s__NewBonusUtils_k - 1 + else + set s__NewBonusUtils_array[i]=s__NewBonusUtils_array[s__NewBonusUtils_index] + set s__NewBonusUtils_index=s__NewBonusUtils_index - 1 + + if s__NewBonusUtils_index == - 1 then + call PauseTimer(s__NewBonusUtils_timer) + endif + endif + + set s__NewBonusUtils_source[this]=null + set s__NewBonusUtils_item[this]=null + + call sc__NewBonus_deallocate(this) + + return i - 1 + endfunction + + function s__NewBonusUtils_onDrop takes nothing returns nothing + local item itm= GetManipulatedItem() + local integer i= 0 + local integer this + + loop + exitwhen i > s__NewBonusUtils_k + set this=s__NewBonusUtils_items[i] + + if s__NewBonusUtils_item[this] == itm then + set i=s__NewBonusUtils_remove(this,i , true) + endif + set i=i + 1 + endloop + endfunction + + function s__NewBonusUtils_onPeriod takes nothing returns nothing + local integer i= 0 + local integer this + + loop + exitwhen i > s__NewBonusUtils_index + set this=s__NewBonusUtils_array[i] + + if s__NewBonusUtils_link[this] then + if s__NewBonusUtils_duration[this] <= 0 then + set i=s__NewBonusUtils_remove(this,i , false) + endif + set s__NewBonusUtils_duration[this]=s__NewBonusUtils_duration[this] - s__NewBonusUtils_period + else + if GetUnitAbilityLevel(s__NewBonusUtils_source[this], s__NewBonusUtils_buff[this]) == 0 then + set i=s__NewBonusUtils_remove(this,i , false) + endif + endif + set i=i + 1 + endloop + endfunction + + function s__NewBonusUtils_linkTimed takes unit source,integer bonus,real amount,real duration,boolean link returns nothing + local integer this= s__NewBonusUtils__allocate() + + set s__NewBonusUtils_source[this]=source + set s__NewBonusUtils_duration[this]=duration + set s__NewBonusUtils_link[this]=link + set s__NewBonusUtils_value[this]=(sc__NewBonus_add((source ) , ( bonus ) , (( amount)*1.0))) // INLINED!! + set s__NewBonusUtils_bonus_t[this]=s__NewBonus_linkType + set s__NewBonusUtils_index=s__NewBonusUtils_index + 1 + set s__NewBonusUtils_array[s__NewBonusUtils_index]=this + + if s__NewBonusUtils_index == 0 then + call TimerStart(s__NewBonusUtils_timer, s__NewBonusUtils_period, true, function s__NewBonusUtils_onPeriod) + endif + endfunction + + function s__NewBonusUtils_linkBuff takes unit source,integer bonus,real amount,integer id,boolean link returns nothing + local integer this= s__NewBonusUtils__allocate() + + set s__NewBonusUtils_source[this]=source + set s__NewBonusUtils_buff[this]=id + set s__NewBonusUtils_link[this]=link + set s__NewBonusUtils_value[this]=(sc__NewBonus_add((source ) , ( bonus ) , (( amount)*1.0))) // INLINED!! + set s__NewBonusUtils_bonus_t[this]=s__NewBonus_linkType + set s__NewBonusUtils_index=s__NewBonusUtils_index + 1 + set s__NewBonusUtils_array[s__NewBonusUtils_index]=this + + if s__NewBonusUtils_index == 0 then + call TimerStart(s__NewBonusUtils_timer, s__NewBonusUtils_period, true, function s__NewBonusUtils_onPeriod) + endif + endfunction + + function s__NewBonusUtils_linkItem takes unit source,integer bonus,real amount,item i returns nothing + local integer this= s__NewBonusUtils__allocate() + + set s__NewBonusUtils_source[this]=source + set s__NewBonusUtils_item[this]=i + set s__NewBonusUtils_value[this]=(sc__NewBonus_add((source ) , ( bonus ) , (( amount)*1.0))) // INLINED!! + set s__NewBonusUtils_bonus_t[this]=s__NewBonus_linkType + set s__NewBonusUtils_k=s__NewBonusUtils_k + 1 + set s__NewBonusUtils_items[s__NewBonusUtils_k]=this + endfunction + + function s__NewBonusUtils_copy takes unit source,unit target returns nothing + local integer i= 1 + + loop + exitwhen i > s__NewBonus_last + if (sc__NewBonus_get((source ) , ( i))) != 0 then // INLINED!! +call sc__NewBonus_add((target ) , ( i ) , (( (sc__NewBonus_get((source ) , ( i))))*1.0)) // INLINED!! + endif + set i=i + 1 + endloop + endfunction + + function s__NewBonusUtils_mirror takes unit source,unit target returns nothing + local integer i= 1 + + loop + exitwhen i > s__NewBonus_last +call sc__NewBonus_Set((target ) , ( i ) , (( (sc__NewBonus_get((source ) , ( i))))*1.0) , false) // INLINED!! + set i=i + 1 + endloop + endfunction + + function s__NewBonusUtils_onInit takes nothing returns nothing + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_DROP_ITEM , function s__NewBonusUtils_onDrop) + endfunction + +//library NewBonusUtils ends +//library Ray: + + + + +function Ray___FilterIsClosestUnit takes nothing returns boolean + local unit u= GetFilterUnit() + local real distance= 0.0 + if ( RayConfig_IsUnitAllowed(s__Ray___T_caster[Ray___filterTarget] , u , s__Ray___T_abilityId[Ray___filterTarget]) ) then + set distance=DistanceBetweenCoordinates(GetUnitX(u) , GetUnitY(u) , GetUnitX(s__Ray___T_caster[Ray___filterTarget]) , GetUnitY(s__Ray___T_caster[Ray___filterTarget])) + if ( Ray___filterClosestUnit == null or distance < Ray___filterClosestDistance ) then + //call BJDebugMsg("Matched destructable " + GetDestructableName(d)) + set Ray___filterClosestDistance=distance + set Ray___filterClosestUnit=u + endif + endif + set u=null + return false +endfunction + +function Ray___FilterIsClosestDestructable takes nothing returns boolean + local destructable d= GetFilterDestructable() + local real distance= 0.0 + if ( RayConfig_IsDestructableAllowed(s__Ray___T_caster[Ray___filterTarget] , d , s__Ray___T_abilityId[Ray___filterTarget]) ) then + set distance=DistanceBetweenCoordinates(GetDestructableX(d) , GetDestructableY(d) , GetUnitX(s__Ray___T_caster[Ray___filterTarget]) , GetUnitY(s__Ray___T_caster[Ray___filterTarget])) + if ( Ray___filterClosestDestructable == null or distance < Ray___filterClosestDistance ) then + //call BJDebugMsg("Matched destructable " + GetDestructableName(d)) + set Ray___filterClosestDistance=distance + set Ray___filterClosestDestructable=d + endif + endif + set d=null + return false +endfunction + +function Ray___FilterIsClosestItem takes nothing returns boolean + local item i= GetFilterItem() + local real distance= 0.0 + if ( RayConfig_IsItemAllowed(s__Ray___T_caster[Ray___filterTarget] , i , s__Ray___T_abilityId[Ray___filterTarget]) ) then + set distance=DistanceBetweenCoordinates(GetItemX(i) , GetItemY(i) , GetUnitX(s__Ray___T_caster[Ray___filterTarget]) , GetUnitY(s__Ray___T_caster[Ray___filterTarget])) + if ( Ray___filterClosestItem == null or distance < Ray___filterClosestDistance ) then + set Ray___filterClosestDistance=distance + set Ray___filterClosestItem=i + endif + endif + set i=null + return false +endfunction + + +function GetRayRefreshTimerHandleId takes nothing returns integer + return GetHandleId(Ray___refreshTimer) +endfunction + +function Ray___GetTargetUnit takes integer target,real casterX,real casterY,real face,real x,real y returns unit + local group g= CreateGroup() + local unit result= null + set Ray___filterTarget=target + set Ray___filterClosestDistance=0.0 + set Ray___filterClosestUnit=null + call GroupEnumUnitsInRange(g, x, y, s__Ray___T_range[target], Ray___filterIsClosestUnit) + call GroupClear(g) + call DestroyGroup(g) + set g=null + return Ray___filterClosestUnit +endfunction + +function Ray___GetTargetDestructable takes integer target,real casterX,real casterY,real face,real x,real y returns destructable + local rect r= GetRectFromCircle(x , y , s__Ray___T_range[target]) + set Ray___filterTarget=target + set Ray___filterClosestDistance=0.0 + set Ray___filterClosestDestructable=null + call EnumDestructablesInRect(r, Ray___filterIsClosestDestructable, null) + call RemoveRect(r) + set r=null + return Ray___filterClosestDestructable +endfunction + +function Ray___GetTargetItem takes integer target,real casterX,real casterY,real face,real x,real y returns item + local rect r= GetRectFromCircle(x , y , s__Ray___T_range[target]) + set Ray___filterTarget=target + set Ray___filterClosestDistance=0.0 + set Ray___filterClosestItem=null + call EnumItemsInRect(r, Ray___filterIsClosestItem, null) + call RemoveRect(r) + set r=null + return Ray___filterClosestItem +endfunction + +function Ray___UpdateTarget takes integer target returns nothing + local real face= GetUnitFacing(s__Ray___T_caster[target]) + local real x= GetUnitX(s__Ray___T_caster[target]) + local real y= GetUnitY(s__Ray___T_caster[target]) + local real z= BlzGetUnitZ(s__Ray___T_caster[target]) + GetUnitFlyHeight(s__Ray___T_caster[target]) + local real targetX= x + local real targetY= y + local real targetWidth= 0.0 + local real centerX= PolarProjectionX(targetX , face , Ray_STEP_DISTANCE_HALF) + local real centerY= PolarProjectionY(targetY , face , Ray_STEP_DISTANCE_HALF) + local real tmpTargetX= x + local real tmpTargetY= y + local location tmpTarget= Location(tmpTargetX, tmpTargetY) + local real distanceUnit= 0.0 + local real distanceDestructable= 0.0 + local real distanceItem= 0.0 + local real maxDistance= s__Ray___T_maxDistance[target] + local real distance= 0.0 + local integer i= 0 + local real lightningX= 0.0 + local real lightningY= 0.0 + local real lightningZ= 0.0 + local unit oldTargetUnit= s__Ray___T_u[target] + local destructable oldTargetDestructable= s__Ray___T_d[target] + local item oldTargetItem= s__Ray___T_i[target] + local boolean oldTarget= false + set s__Ray___T_u[target]=null + set s__Ray___T_d[target]=null + set s__Ray___T_i[target]=null + //call BJDebugMsg("Face " + R2S(face)) + loop + if ( RayConfig_CanTargetUnits(s__Ray___T_abilityId[target]) ) then + set s__Ray___T_u[target]=Ray___GetTargetUnit(target , x , y , face , centerX , centerY) + endif + + if ( RayConfig_CanTargetDestructables(s__Ray___T_abilityId[target]) ) then + set s__Ray___T_d[target]=Ray___GetTargetDestructable(target , x , y , face , centerX , centerY) + endif + + if ( RayConfig_CanTargetItems(s__Ray___T_abilityId[target]) ) then + set s__Ray___T_i[target]=Ray___GetTargetItem(target , x , y , face , centerX , centerY) + endif + + if ( s__Ray___T_u[target] != null and s__Ray___T_d[target] != null ) then + set distanceUnit=DistanceBetweenCoordinates(x , y , GetUnitX(s__Ray___T_u[target]) , GetUnitY(s__Ray___T_u[target])) + set distanceDestructable=DistanceBetweenCoordinates(x , y , GetDestructableX(s__Ray___T_d[target]) , GetDestructableY(s__Ray___T_d[target])) + if ( distanceDestructable < distanceUnit ) then + set s__Ray___T_u[target]=null + else + set s__Ray___T_d[target]=null + endif + endif + + if ( s__Ray___T_u[target] != null and s__Ray___T_i[target] != null ) then + set distanceUnit=DistanceBetweenCoordinates(x , y , GetUnitX(s__Ray___T_u[target]) , GetUnitY(s__Ray___T_u[target])) + set distanceItem=DistanceBetweenCoordinates(x , y , GetItemX(s__Ray___T_i[target]) , GetItemY(s__Ray___T_i[target])) + if ( distanceItem < distanceUnit ) then + set s__Ray___T_u[target]=null + else + set s__Ray___T_i[target]=null + endif + endif + + if ( s__Ray___T_d[target] != null and s__Ray___T_i[target] != null ) then + set distanceDestructable=DistanceBetweenCoordinates(x , y , GetDestructableX(s__Ray___T_d[target]) , GetDestructableY(s__Ray___T_d[target])) + set distanceItem=DistanceBetweenCoordinates(x , y , GetItemX(s__Ray___T_i[target]) , GetItemY(s__Ray___T_i[target])) + if ( distanceItem < distanceDestructable ) then + set s__Ray___T_d[target]=null + else + set s__Ray___T_i[target]=null + endif + endif + + exitwhen ( s__Ray___T_u[target] != null or s__Ray___T_d[target] != null or s__Ray___T_i[target] != null ) + + //call BJDebugMsg("Updating target loop (" + R2S(targetX) + "|" + R2S(targetX) + ")") + + set tmpTargetX=PolarProjectionX(targetX , face , Ray_STEP_DISTANCE) + set tmpTargetY=PolarProjectionY(targetY , face , Ray_STEP_DISTANCE) + call MoveLocation(tmpTarget, tmpTargetX, tmpTargetY) + exitwhen ( IsTerrainPathable(tmpTargetX, tmpTargetY, PATHING_TYPE_FLYABILITY) ) + exitwhen ( IsTerrainPathable(tmpTargetX, tmpTargetY, PATHING_TYPE_WALKABILITY) and IsTerrainPathable(tmpTargetX, tmpTargetY, PATHING_TYPE_FLOATABILITY) ) + exitwhen ( tmpTargetX >= GetRectMaxX(GetPlayableMapRect()) ) + exitwhen ( tmpTargetX <= GetRectMinX(GetPlayableMapRect()) ) + exitwhen ( tmpTargetY >= GetRectMaxY(GetPlayableMapRect()) ) + exitwhen ( tmpTargetY <= GetRectMinY(GetPlayableMapRect()) ) + exitwhen ( GetLocationZ(tmpTarget) > z + Ray_Z_THRESHOLD ) + exitwhen ( DistanceBetweenCoordinates(x , y , tmpTargetX , tmpTargetY) > maxDistance ) + set targetX=tmpTargetX + set targetY=tmpTargetY + set centerX=PolarProjectionX(targetX , face , Ray_STEP_DISTANCE_HALF) + set centerY=PolarProjectionY(targetY , face , Ray_STEP_DISTANCE_HALF) + endloop + + if ( s__Ray___T_u[target] != null ) then + set s__Ray___T_x[target]=GetUnitX(s__Ray___T_u[target]) + set s__Ray___T_y[target]=GetUnitY(s__Ray___T_u[target]) + set s__Ray___T_z[target]=BlzGetUnitZ(s__Ray___T_u[target]) + GetUnitFlyHeight(s__Ray___T_u[target]) + + set targetWidth=BlzGetUnitCollisionSize(s__Ray___T_u[target]) + + + if ( oldTargetUnit == s__Ray___T_u[target] ) then + set oldTarget=true + endif + elseif ( s__Ray___T_d[target] != null ) then + set s__Ray___T_x[target]=GetDestructableX(s__Ray___T_d[target]) + set s__Ray___T_y[target]=GetDestructableY(s__Ray___T_d[target]) + set s__Ray___T_z[target]=z + + if ( oldTargetDestructable == s__Ray___T_d[target] ) then + set oldTarget=true + endif + elseif ( s__Ray___T_i[target] != null ) then + set s__Ray___T_x[target]=GetItemX(s__Ray___T_i[target]) + set s__Ray___T_y[target]=GetItemY(s__Ray___T_i[target]) + set s__Ray___T_z[target]=z + + if ( oldTargetItem == s__Ray___T_i[target] ) then + set oldTarget=true + endif + else + set s__Ray___T_x[target]=targetX + set s__Ray___T_y[target]=targetY + set s__Ray___T_z[target]=z + endif + + if ( oldTarget ) then + set s__Ray___T_duration[target]=s__Ray___T_duration[target] + RayConfig_REFRESH_INTERVAL + else + set s__Ray___T_duration[target]=0.0 + endif + + + set distance=DistanceBetweenCoordinates(x , y , s__Ray___T_x[target] , s__Ray___T_y[target]) - targetWidth + set s__Ray___T_x[target]=PolarProjectionX(x , face , distance) + set s__Ray___T_y[target]=PolarProjectionY(y , face , distance) + + + + + + + + set i=0 + loop + exitwhen ( i == s__Ray___T_maxLightnings[target] ) + set lightningX=PolarProjectionX(x , ModuloReal(face + 90.0, 360.0) , RayConfig_GetLightningOffsetWidthX(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) + set lightningY=PolarProjectionY(y , ModuloReal(face + 90.0, 360.0) , RayConfig_GetLightningOffsetWidthY(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) + set lightningX=PolarProjectionX(lightningX , face , RayConfig_GetLightningOffsetLengthX(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) + set lightningY=PolarProjectionY(lightningY , face , RayConfig_GetLightningOffsetLengthY(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i)) + set lightningZ=z + RayConfig_GetLightningOffsetZ(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , i) + + call MoveLightningEx(s___Ray___T_l[s__Ray___T_l[target]+i], false, lightningX, lightningY, lightningZ, s__Ray___T_x[target], s__Ray___T_y[target], s__Ray___T_z[target]) + set i=i + 1 + endloop + + call RemoveLocation(tmpTarget) + set tmpTarget=null +endfunction + +function Ray___EndRay takes unit caster returns nothing + local integer handleId= GetHandleId(caster) + local integer i= 0 + local integer target= LoadInteger(Ray___h, handleId, 0) + local real cooldown= RayConfig_GetCooldown(s__Ray___T_caster[target] , s__Ray___T_abilityId[target]) + + if ( s__Ray___T_loopSound[target] != null and GetSoundIsPlaying(s__Ray___T_loopSound[target]) ) then + call StopSound(s__Ray___T_loopSound[target], false, false) + endif + + if ( s__Ray___T_hitSound[target] != null and GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then + call StopSound(s__Ray___T_hitSound[target], false, false) + endif + + if ( s__Ray___T_casterEffect[target] != null ) then + call DestroyEffect(s__Ray___T_casterEffect[target]) + set s__Ray___T_casterEffect[target]=null + endif + + if ( s__Ray___T_targetEffect[target] != null ) then + call DestroyEffect(s__Ray___T_targetEffect[target]) + set s__Ray___T_targetEffect[target]=null + endif + + call GroupRemoveUnit(Ray___casters, s__Ray___T_caster[target]) + + if ( BlzGroupGetSize(Ray___casters) == 0 ) then + call PauseTimer(Ray___refreshTimer) + endif + + set i=0 + loop + exitwhen ( i == s__Ray___T_maxLightnings[target] ) + call DestroyLightning(s___Ray___T_l[s__Ray___T_l[target]+i]) + set i=i + 1 + endloop + + call BlzStartUnitAbilityCooldown(s__Ray___T_caster[target], s__Ray___T_abilityId[target], cooldown) + + call s__Ray___T_deallocate(target) + call FlushChildHashtable(Ray___h, handleId) +endfunction + +function Ray___GetUnitController takes unit caster returns player + local player slotPlayer= null + local player owner= GetOwningPlayer(caster) + local player result= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( ( owner == slotPlayer or GetPlayerAlliance(slotPlayer, owner, ALLIANCE_SHARED_ADVANCED_CONTROL) ) and IsUnitSelected(caster, slotPlayer) ) then + if ( result == null or owner == slotPlayer ) then + set result=slotPlayer + endif + endif + set slotPlayer=null + set i=i + 1 + endloop + set owner=null + return result +endfunction + +function Ray___MouseAiming takes unit caster returns nothing + local player controller= Ray___GetUnitController(caster) + call SetUnitFacing(caster, AngleBetweenCoordinatesDeg(GetUnitX(caster) , GetUnitY(caster) , (s__UserMouse_mouseX[s__UserMouse__staticgetindex((controller))]) , (s__UserMouse_mouseY[s__UserMouse__staticgetindex((controller))]))) // INLINED!! + set controller=null +endfunction + +function Ray___TriggerActionRefresh takes nothing returns nothing + local integer i= 0 + local integer max= BlzGroupGetSize(Ray___casters) + local integer target= 0 + loop + exitwhen ( i == max ) + set target=LoadInteger(Ray___h, GetHandleId(BlzGroupUnitAt(Ray___casters, i)), 0) + + if ( s__Ray___T_mouseAiming[target] ) then + call Ray___MouseAiming(s__Ray___T_caster[target]) + endif + + //call BJDebugMsg("Update target " + I2S(target)) + call Ray___UpdateTarget(target) + if ( s__Ray___T_loopSound[target] != null and not GetSoundIsPlaying(s__Ray___T_loopSound[target]) ) then + //call BJDebugMsg("Play sound.") + call PlaySoundOnUnitBJ(s__Ray___T_loopSound[target], 100.0, s__Ray___T_caster[target]) + endif + if ( s__Ray___T_u[target] != null ) then + call RayConfig_OnHitUnit(s__Ray___T_caster[target] , s__Ray___T_u[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) + + if ( s__Ray___T_hitSound[target] != null and not GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then + call PlaySoundOnUnitBJ(s__Ray___T_hitSound[target], 100.0, s__Ray___T_u[target]) + endif + + if ( RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) != null and s__Ray___T_targetEffect[target] == null ) then + set s__Ray___T_targetEffect[target]=AddSpecialEffectTarget(RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]), s__Ray___T_u[target], RayConfig_GetTargetEffectAttachmentPoint(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target])) + endif + + call BlzSetSpecialEffectX(s__Ray___T_targetEffect[target], GetUnitX(s__Ray___T_u[target])) + call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], GetUnitY(s__Ray___T_u[target])) + call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], BlzGetUnitZ(s__Ray___T_u[target]) + GetUnitFlyHeight(s__Ray___T_u[target])) + elseif ( s__Ray___T_d[target] != null ) then + call RayConfig_OnHitDestructable(s__Ray___T_caster[target] , s__Ray___T_d[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) + + if ( s__Ray___T_hitSound[target] != null ) then + if ( not GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then + call StartSound(s__Ray___T_hitSound[target]) + call SetSoundVolume(s__Ray___T_hitSound[target], 127) + endif + call SetSoundPosition(s__Ray___T_hitSound[target], s__Ray___T_x[target], s__Ray___T_y[target], s__Ray___T_z[target]) + endif + + if ( RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) != null and s__Ray___T_targetEffect[target] == null ) then + set s__Ray___T_targetEffect[target]=AddSpecialEffect(RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]), GetDestructableX(s__Ray___T_d[target]), GetDestructableY(s__Ray___T_d[target])) + endif + + call BlzSetSpecialEffectX(s__Ray___T_targetEffect[target], GetDestructableX(s__Ray___T_d[target])) + call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], GetDestructableY(s__Ray___T_d[target])) + //call BlzSetSpecialEffectY(target.targetEffect, BlzGetUnitZ(target.u) + GetUnitFlyHeight(target.u)) + elseif ( s__Ray___T_i[target] != null ) then + call RayConfig_OnHitItem(s__Ray___T_caster[target] , s__Ray___T_i[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) + + if ( s__Ray___T_hitSound[target] != null ) then + if ( not GetSoundIsPlaying(s__Ray___T_hitSound[target]) ) then + call StartSound(s__Ray___T_hitSound[target]) + call SetSoundVolume(s__Ray___T_hitSound[target], 127) + endif + call SetSoundPosition(s__Ray___T_hitSound[target], s__Ray___T_x[target], s__Ray___T_y[target], s__Ray___T_z[target]) + endif + + if ( RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) != null and s__Ray___T_targetEffect[target] == null ) then + set s__Ray___T_targetEffect[target]=AddSpecialEffect(RayConfig_GetTargetEffect(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]), GetItemX(s__Ray___T_i[target]), GetItemY(s__Ray___T_i[target])) + endif + + call BlzSetSpecialEffectX(s__Ray___T_targetEffect[target], GetItemX(s__Ray___T_i[target])) + call BlzSetSpecialEffectY(s__Ray___T_targetEffect[target], GetItemY(s__Ray___T_i[target])) + //call BlzSetSpecialEffectY(target.targetEffect, BlzGetUnitZ(target.u) + GetUnitFlyHeight(target.u)) + endif + + if ( not RayConfig_OnCastLoop(s__Ray___T_caster[target] , s__Ray___T_abilityId[target] , s__Ray___T_duration[target]) ) then + call Ray___EndRay(s__Ray___T_caster[target]) + endif + + set i=i + 1 + endloop +endfunction + +function Ray___TimerFunctionRefresh takes nothing returns nothing + // allows using trigger sleep actions + call TriggerExecute(Ray___refreshTrigger) +endfunction + +function Ray___TimerFunctionExpire takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer handleId= GetHandleId(t) + local integer target= LoadInteger(Ray___h, handleId, 0) + + call Ray___EndRay(s__Ray___T_caster[target]) + + call FlushChildHashtable(Ray___h, handleId) + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function Ray_GetCastingRayAbilityId takes unit caster returns integer + local integer handleId= GetHandleId(caster) + local integer target= LoadInteger(Ray___h, handleId, 0) + + if ( target == 0 ) then + return 0 + endif + + return s__Ray___T_abilityId[target] +endfunction + +function Ray_IsCastingRay takes unit caster,integer abilityId returns boolean + return Ray_GetCastingRayAbilityId(caster) == abilityId +endfunction + +function Ray_IsCastingAnyRay takes unit caster returns boolean + local integer handleId= GetHandleId(caster) + local integer target= LoadInteger(Ray___h, handleId, 0) + + return target != 0 +endfunction + +function Ray___Ray takes unit caster,integer abilityId returns nothing + local real x= GetUnitX(caster) + local real y= GetUnitY(caster) + local real face= GetUnitFacing(caster) + local integer handleId= GetHandleId(caster) + local integer target= LoadInteger(Ray___h, handleId, 0) + local real duration= RayConfig_GetDuration(caster , abilityId) + local integer i= 0 + if ( target == 0 ) then + set target=s__Ray___T__allocate() + set s__Ray___T_t[target]=CreateTimer() + set s__Ray___T_caster[target]=caster + call SaveInteger(Ray___h, handleId, 0, target) + set handleId=GetHandleId(s__Ray___T_t[target]) + call SaveInteger(Ray___h, handleId, 0, target) + endif + + set s__Ray___T_duration[target]=0.0 + set s__Ray___T_disableAttack[target]=RayConfig_DisableAttack(caster , abilityId) + set s__Ray___T_disableMovement[target]=RayConfig_GetDisableMovement(caster , abilityId) + set s__Ray___T_mouseAiming[target]=RayConfig_GetMouseAiming(caster , abilityId) + + set s__Ray___T_maxLightnings[target]=RayConfig_GetMaxLightnings(caster , abilityId) + set i=0 + loop + exitwhen ( i == s__Ray___T_maxLightnings[target] ) + set s___Ray___T_l[s__Ray___T_l[target]+i]=AddLightning(RayConfig_GetLightningCode(caster , abilityId , i), true, x, y, x, y) + set i=i + 1 + endloop + + if ( RayConfig_GetCasterEffect(caster , abilityId , s__Ray___T_duration[target]) != null ) then + set s__Ray___T_casterEffect[target]=AddSpecialEffectTarget(RayConfig_GetCasterEffect(caster , abilityId , s__Ray___T_duration[target]), caster, RayConfig_GetCasterEffectAttachmentPoint(caster , abilityId , s__Ray___T_duration[target])) + endif + + call Ray___UpdateTarget(target) + set s__Ray___T_abilityId[target]=abilityId + set s__Ray___T_loopSound[target]=RayConfig_GetLoopSound(caster , abilityId) + set s__Ray___T_hitSound[target]=RayConfig_GetHitSound(caster , abilityId) + set s__Ray___T_maxDistance[target]=RayConfig_GetMaxDistance(caster , abilityId) + set s__Ray___T_range[target]=RayConfig_GetRange(caster , abilityId) + + if ( not IsUnitInGroup(caster, Ray___casters) ) then + call GroupAddUnit(Ray___casters, caster) + + if ( BlzGroupGetSize(Ray___casters) == 1 ) then + call TimerStart(Ray___refreshTimer, RayConfig_REFRESH_INTERVAL, true, function Ray___TimerFunctionRefresh) + endif + endif + + if ( duration > 0.0 ) then + call TimerStart(s__Ray___T_t[target], duration, false, function Ray___TimerFunctionExpire) + endif +endfunction + +function Ray___TriggerConditionCast takes nothing returns boolean + local unit caster= GetTriggerUnit() + local integer abilityId= GetSpellAbilityId() + local integer target= 0 + if ( RayConfig_IsValidAbility(abilityId) ) then + if ( Ray_IsCastingRay(caster , abilityId) and RayConfig_GetHoldKey(caster , abilityId) ) then + set target=LoadInteger(Ray___h, GetHandleId(caster), 0) + //call BJDebugMsg("Renew " + GetObjectName(target.abilityId) + " with duration " + R2S(RayConfig_GetDuration(caster, target.abilityId))) + call TimerStart(s__Ray___T_t[target], RayConfig_GetDuration(caster , s__Ray___T_abilityId[target]), false, function Ray___TimerFunctionExpire) + call DisableTrigger(Ray___orderTrigger) + call IssueImmediateOrder(caster, "stop") + call EnableTrigger(Ray___orderTrigger) + return false + endif + + + if ( Ray_IsCastingRay(caster , abilityId) ) then + call Ray___EndRay(caster) + else + if ( Ray_IsCastingAnyRay(caster) ) then + call Ray___EndRay(caster) + endif + call Ray___Ray(caster , abilityId) + endif + + + + + + + endif + set caster=null + return false +endfunction + +function Ray___TriggerConditionDeath takes nothing returns boolean + local unit caster= GetTriggerUnit() + if ( Ray_IsCastingAnyRay(caster) ) then + call Ray___EndRay(caster) + endif + set caster=null + return false +endfunction + +function Ray___TriggerConditionOrder takes nothing returns boolean + local integer orderId= GetIssuedOrderId() + local unit caster= GetTriggerUnit() + //call BJDebugMsg("Order " + I2S(orderId)) + if ( Ray_IsCastingAnyRay(caster) ) then + //call BJDebugMsg("Check 1") + if ( orderId == Ray_ORDER_ID_STOP ) then + //call BJDebugMsg("Stop") + call Ray___EndRay(caster) + endif + endif + set caster=null + return true +endfunction + +function Ray___TimerFunctionChangeFacing takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer handleId= GetHandleId(t) + local unit caster= LoadUnitHandle(Ray___h, handleId, 0) + local integer abilityId= LoadInteger(Ray___h, handleId, 1) + local real x= LoadReal(Ray___h, handleId, 2) + local real y= LoadReal(Ray___h, handleId, 3) + if ( GetUnitTypeId(caster) != 0 and Ray_GetCastingRayAbilityId(caster) == abilityId ) then + call DisableTrigger(Ray___orderTrigger) + call IssueImmediateOrder(caster, "stop") + call EnableTrigger(Ray___orderTrigger) + call SetUnitFacing(caster, AngleBetweenCoordinatesDeg(GetUnitX(caster) , GetUnitY(caster) , x , y)) + endif + call FlushChildHashtable(Ray___h, handleId) + call PauseTimer(t) + call DestroyTimer(t) + set t=null + set caster=null +endfunction + +function Ray___TimedChangeFacing takes unit caster,integer abilityId,real x,real y returns nothing + local timer t= CreateTimer() + local integer handleId= GetHandleId(t) + call SaveUnitHandle(Ray___h, handleId, 0, caster) + call SaveInteger(Ray___h, handleId, 1, abilityId) + call SaveReal(Ray___h, handleId, 2, x) + call SaveReal(Ray___h, handleId, 3, y) + //call BJDebugMsg("Start time changed facing") + call TimerStart(t, 0.0, false, function Ray___TimerFunctionChangeFacing) +endfunction + +function Ray___TriggerActionOrder takes nothing returns nothing + local trigger whichTrigger= GetTriggeringTrigger() + local integer orderId= GetIssuedOrderId() + local unit caster= GetTriggerUnit() + //call BJDebugMsg("Order " + I2S(orderId)) + if ( Ray_IsCastingAnyRay(caster) ) then + //call BJDebugMsg("Check 2") + if ( ( orderId == Ray_ORDER_ID_MOVE or orderId == Ray_ORDER_ID_SMART ) and RayConfig_GetDisableMovement(caster , Ray_GetCastingRayAbilityId(caster)) ) then + call Ray___TimedChangeFacing(caster , Ray_GetCastingRayAbilityId(caster) , GetOrderPointX() , GetOrderPointY()) + //call BJDebugMsg("Change facing") + endif + endif + set caster=null + set whichTrigger=null +endfunction + +function Ray___TriggerConditionAttack takes nothing returns boolean + local integer handleId= GetHandleId(GetAttacker()) + local integer t= LoadInteger(Ray___h, handleId, 0) + if ( t != 0 and s__Ray___T_disableAttack[t] ) then + call BlzUnitInterruptAttack(GetAttacker()) + endif + return false +endfunction + +function Ray___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(Ray___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(Ray___castTrigger, Condition(function Ray___TriggerConditionCast)) + call TriggerRegisterAnyUnitEventBJ(Ray___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(Ray___deathTrigger, Condition(function Ray___TriggerConditionDeath)) + call TriggerRegisterAnyUnitEventBJ(Ray___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) + call TriggerRegisterAnyUnitEventBJ(Ray___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) + call TriggerAddCondition(Ray___orderTrigger, Condition(function Ray___TriggerConditionOrder)) + call TriggerAddAction(Ray___orderTrigger, function Ray___TriggerActionOrder) + call TriggerRegisterAnyUnitEventBJ(Ray___attackTrigger, EVENT_PLAYER_UNIT_ATTACKED) + call TriggerAddCondition(Ray___attackTrigger, Condition(function Ray___TriggerConditionAttack)) + call TriggerAddAction(Ray___refreshTrigger, function Ray___TriggerActionRefresh) + + set Ray___filterIsClosestUnit=Filter(function Ray___FilterIsClosestUnit) + set Ray___filterIsClosestDestructable=Filter(function Ray___FilterIsClosestDestructable) + set Ray___filterIsClosestItem=Filter(function Ray___FilterIsClosestItem) +endfunction + +function Ray___RemoveUnitHook takes unit whichUnit returns nothing + if ( Ray_IsCastingAnyRay(whichUnit) ) then + call Ray___EndRay(whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit Ray___RemoveUnitHook + + +//library Ray ends +//library WoWReforgedProfessionBooksShop: + + +function AddProfessionBooksShop takes unit shop returns nothing + local integer i= 0 + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + call EnablePagedButtons(shop) + loop + exitwhen ( i == max ) +call AddPagedButtonsId((shop ) , ( udg_ProfessionItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop +endfunction + +function WoWReforgedProfessionBooksShop___FilterIsProfessionBooksShop takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == PROFESSION_BOOKS_SHOP +endfunction + +function WoWReforgedProfessionBooksShop___ForGroupAddProfessionBooksShop takes nothing returns nothing + call AddProfessionBooksShop(GetEnumUnit()) +endfunction + +function AddAllProfessionBooksShops takes nothing returns nothing + local group shops= CreateGroup() + call GroupEnumUnitsInRect(shops, GetPlayableMapRect(), Filter(function WoWReforgedProfessionBooksShop___FilterIsProfessionBooksShop)) + call ForGroup(shops, function WoWReforgedProfessionBooksShop___ForGroupAddProfessionBooksShop) + call GroupClear(shops) + call DestroyGroup(shops) + set shops=null +endfunction + +function WoWReforgedProfessionBooksShop___TimerFunctionAddAllProfessionBooksShop takes nothing returns nothing + call AddAllProfessionBooksShops() + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function WoWReforgedProfessionBooksShop___Init takes nothing returns nothing + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedProfessionBooksShop___TimerFunctionAddAllProfessionBooksShop) +endfunction + + +//library WoWReforgedProfessionBooksShop ends +//library AuraSystem: + + +function GetAuraSystemTimerHandleId takes nothing returns integer + return GetHandleId(AuraSystem__h) +endfunction + +//processed: function interface AuraFilterFunction takes unit caster, unit target, integer abilityId returns boolean + +function AuraSystem__OrderGroupByPriority takes group l__AuraSystem__t returns group + local group r= CreateGroup() + local integer j= 0 + local unit memberJ + local unit memberI + local unit tmp + local integer i= 0 + local integer max= BlzGroupGetSize(l__AuraSystem__t) + local unit array g + local integer gCounter= 0 + + loop + exitwhen ( i >= max ) + set memberI=BlzGroupUnitAt(l__AuraSystem__t, i) + set g[gCounter]=memberI + set gCounter=gCounter + 1 + set memberI=null + set i=i + 1 + endloop + + //call BJDebugMsg("Count targets " + I2S(gCounter)) + + call GroupClear(l__AuraSystem__t) + call DestroyGroup(l__AuraSystem__t) + set l__AuraSystem__t=null + + loop + exitwhen ( i >= gCounter ) + set memberI=g[i] + set j=0 + loop + exitwhen ( j >= gCounter ) + set memberJ=g[j] + if ( memberJ != memberI and BlzGetUnitRealField(memberJ, UNIT_RF_PRIORITY) > BlzGetUnitRealField(memberI, UNIT_RF_PRIORITY) ) then + set tmp=g[i] + set g[i]=g[j] + set g[j]=tmp + set memberI=g[i] + set memberJ=g[j] + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + + loop + exitwhen ( i >= gCounter ) + call GroupAddUnit(r, g[i]) + set i=i + 1 + endloop + + return r +endfunction + + + + + function s__Aura_addCaster takes integer this,unit caster returns nothing + call GroupAddUnit(s__Aura_casters[this], caster) + endfunction + + function s__Aura_setCasterMaxTargets takes integer this,unit caster,integer maxTargets returns nothing + call SaveInteger(AuraSystem__h, s__Aura_abilityId[this], GetHandleId(caster), maxTargets) + endfunction + + function s__Aura_getCasterMaxTargets takes integer this,unit caster returns integer + return LoadInteger(AuraSystem__h, s__Aura_abilityId[this], GetHandleId(caster)) + endfunction + + function s__Aura_filter takes nothing returns boolean + local boolean result= sc___prototype387_evaluate(s__Aura_tmpFilter,s__Aura_tmpCaster , GetFilterUnit() , s__Aura_tmpAbilityId) + //call BJDebugMsg("Filter: " + GetUnitName(GetFilterUnit())) + if ( result ) then + //call BJDebugMsg("Result true") + else + //call BJDebugMsg("Result false") + endif + return result + endfunction + + function s__Aura_create takes integer abilityId,integer buffAbilityId,integer effectAbilityId,integer filterFunction,real radius,boolean has_bonus_type,integer bonus_type,real bonus_amount,integer bonus_type2,real bonus_amount2 returns integer + local integer this= s__Aura__allocate() + set s__Aura_abilityId[this]=abilityId + set s__Aura_buffAbilityId[this]=buffAbilityId + set s__Aura_effectAbilityId[this]=effectAbilityId + set s__Aura_filterFunction[this]=filterFunction + set s__Aura_radius[this]=radius + set s__Aura_has_bonus_type[this]=has_bonus_type + set s__Aura_bonus_type[this]=bonus_type + set s__Aura_bonus_amount[this]=bonus_amount + set s__Aura_bonus_type2[this]=bonus_type2 + set s__Aura_bonus_amount2[this]=bonus_amount2 + + set s__s__Aura_allAuras[s__Aura_allAurasCounter]= this + set s__Aura_allAurasCounter=s__Aura_allAurasCounter + 1 + + return this + endfunction + + function s__Aura_update takes integer this,unit caster,group newTargets returns nothing + local integer level= GetUnitAbilityLevel(caster, s__Aura_abilityId[this]) + local group l__AuraSystem__t= CreateGroup() + local integer i= 0 + local integer max= 0 + local integer maxTargets= (LoadInteger(AuraSystem__h, s__Aura_abilityId[(this)], GetHandleId((caster)))) // INLINED!! + local unit target= null + set s__Aura_tmpFilter=s__Aura_filterFunction[this] + set s__Aura_tmpCaster=caster + set s__Aura_tmpAbilityId=s__Aura_abilityId[this] + call GroupEnumUnitsInRange(l__AuraSystem__t, GetUnitX(caster), GetUnitY(caster), s__Aura_radius[this], Filter(function s__Aura_filter)) + // if the number of targets is limited make sure that heroes etc. are targetted first + if ( maxTargets > 0 ) then + //call BJDebugMsg("Max targets " + I2S(maxTargets)) + set l__AuraSystem__t=AuraSystem__OrderGroupByPriority(l__AuraSystem__t) + endif + set max=BlzGroupGetSize(l__AuraSystem__t) + loop + exitwhen ( i == max or ( maxTargets > 0 and i >= maxTargets ) ) + set target=BlzGroupUnitAt(l__AuraSystem__t, i) + if ( not IsUnitInGroup(target, s__Aura_targets[this]) ) then + call UnitAddAbility(target, s__Aura_buffAbilityId[this]) + if ( s__Aura_effectAbilityId[this] != 0 ) then + call UnitAddAbility(target, s__Aura_effectAbilityId[this]) + call BlzUnitHideAbility(target, s__Aura_effectAbilityId[this], true) + endif + endif + + if ( s__Aura_effectAbilityId[this] != 0 ) then + call SetUnitAbilityLevel(target, s__Aura_effectAbilityId[this], level) + endif + //call BJDebugMsg("Target " + GetUnitName(target) + " with ability " + GetObjectName(effectAbilityId) + " level " + I2S(level) + " resulting in level " + I2S(GetUnitAbilityLevel(target, effectAbilityId))) + + if ( s__Aura_has_bonus_type[this] ) then + //call BJDebugMsg("Bonus! " + R2S(bonus_amount)) + if ( s__Aura_bonus_type[this] != 0 ) then + call sc__NewBonusUtils_linkTimed((target ) , ( s__Aura_bonus_type[this] ) , (( level * s__Aura_bonus_amount[this] )*1.0) , (( AuraSystem_BUFF_DURATION)*1.0) , true) // INLINED!! + endif + if ( s__Aura_bonus_type2[this] != 0 ) then + call sc__NewBonusUtils_linkTimed((target ) , ( s__Aura_bonus_type2[this] ) , (( level * s__Aura_bonus_amount2[this] )*1.0) , (( AuraSystem_BUFF_DURATION)*1.0) , true) // INLINED!! + endif + + //call LinkBonusToBuff(target, bonus_type, level * bonus_amount, buffAbilityId) + //call LinkBonusToBuff(target, bonus_type, level * bonus_amount, buffAbilityId) + endif + + call GroupAddUnit(newTargets, target) + set target=null + set i=i + 1 + endloop + + call GroupClear(l__AuraSystem__t) + call DestroyGroup(l__AuraSystem__t) + set l__AuraSystem__t=null + endfunction + + function s__Aura_updateAllCasters takes integer this returns nothing + // find new targets + local group newTargets= CreateGroup() + local integer i= 0 + local integer max= BlzGroupGetSize(s__Aura_casters[this]) + local unit caster= null + local unit target= null + loop + exitwhen ( i == max ) + set caster=BlzGroupUnitAt(s__Aura_casters[this], i) + if ( IsUnitAliveBJ(caster) and not IsUnitPaused(caster) ) then + call s__Aura_update(this,caster , newTargets) + endif + set caster=null + set i=i + 1 + endloop + + // remove old targets which are not part of new targets + call GroupRemoveGroup(newTargets, s__Aura_targets[this]) + set i=0 + set max=BlzGroupGetSize(s__Aura_targets[this]) + loop + exitwhen ( i == max ) + set target=BlzGroupUnitAt(s__Aura_targets[this], i) + //call BJDebugMsg("Remove aura " + GetObjectName(abilityId) + " target: " + GetUnitName(target)) + call UnitRemoveAbility(target, s__Aura_buffAbilityId[this]) + if ( s__Aura_effectAbilityId[this] != 0 ) then + call UnitRemoveAbility(target, s__Aura_effectAbilityId[this]) + endif + set target=null + set i=i + 1 + endloop + + // swap + call GroupClear(s__Aura_targets[this]) + call DestroyGroup(s__Aura_targets[this]) + set s__Aura_targets[this]=newTargets + endfunction + + function s__Aura_onDestroy takes integer this returns nothing + call GroupClear(s__Aura_casters[this]) + call DestroyGroup(s__Aura_casters[this]) + set s__Aura_casters[this]=null + + call GroupClear(s__Aura_targets[this]) + call DestroyGroup(s__Aura_targets[this]) + set s__Aura_targets[this]=null + endfunction + +//Generated destructor of Aura +function s__Aura_deallocate takes integer this returns nothing + if this==null then + return + elseif (si__Aura_V[this]!=-1) then + return + endif + call s__Aura_onDestroy(this) + set si__Aura_V[this]=si__Aura_F + set si__Aura_F=this +endfunction + + function s__Aura_removeCasterFromAll takes unit caster returns nothing + local integer i= 0 + //call BJDebugMsg("Remove caster " + GetUnitName(caster)) + loop + exitwhen ( i == s__Aura_allAurasCounter ) + call GroupRemoveUnit(s__Aura_casters[s__s__Aura_allAuras[i]], caster) + set i=i + 1 + endloop + endfunction + + function s__Aura_getTotalCasters takes nothing returns integer + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i == s__Aura_allAurasCounter ) + set result=result + BlzGroupGetSize(s__Aura_casters[s__s__Aura_allAuras[i]]) + set i=i + 1 + endloop + return result + endfunction + + function s__Aura_updateAuraCasters takes nothing returns nothing + call s__Aura_updateAllCasters(AuraSystem__tmpAura) + endfunction + + function s__Aura_updateAllAuras takes nothing returns nothing + local integer i= 0 + loop + exitwhen ( i == s__Aura_allAurasCounter ) + set AuraSystem__tmpAura=s__s__Aura_allAuras[i] + call ForForce(bj_FORCE_PLAYER[0], (function s__Aura_updateAuraCasters)) // INLINED!! + set i=i + 1 + endloop + endfunction + + +function AuraSystem__SaveAura takes integer abilityId,integer a returns nothing + call SaveInteger(AuraSystem__h, abilityId, 0, a) +endfunction + +function AuraSystem__LoadAura takes integer abilityId returns integer + return LoadInteger(AuraSystem__h, abilityId, 0) +endfunction + +function AuraSystem__TimerFunctionUpdateAuras takes nothing returns nothing + call s__Aura_updateAllAuras() +endfunction + +function AddAura takes integer abilityId,integer buffAbilityId,integer effectAbilityId,integer filterFunction,real radius,boolean has_bonus_type,integer bonus_type,real bonus_amount,integer bonus_type2,real bonus_amount2 returns nothing + call SaveInteger(AuraSystem__h, (abilityId ), 0, ( s__Aura_create(abilityId , buffAbilityId , effectAbilityId , filterFunction , radius , has_bonus_type , bonus_type , bonus_amount , bonus_type2 , bonus_amount2))) // INLINED!! +endfunction + +function AddAuraCaster takes unit caster,integer abilityId returns nothing + local integer aura= (LoadInteger(AuraSystem__h, (abilityId), 0)) // INLINED!! + if ( aura != 0 ) then + if ( s__Aura_getTotalCasters() == 0 ) then + call TimerStart(AuraSystem__t, AuraSystem_TIMER_UPDATE_INTERVAL, true, function AuraSystem__TimerFunctionUpdateAuras) + endif + call GroupAddUnit(s__Aura_casters[(aura)], (caster)) // INLINED!! + endif +endfunction + +function RemoveAuraCaster takes unit caster returns nothing + call s__Aura_removeCasterFromAll(caster) + call s__Aura_updateAllAuras() // make sure we update one more time to remove effects + + if ( s__Aura_getTotalCasters() == 0 ) then + call PauseTimer(AuraSystem__t) + endif +endfunction + +//processed hook: hook RemoveUnit RemoveAuraCaster + +function SetAuraMaxTargets takes unit caster,integer abilityId,integer max returns nothing + local integer aura= (LoadInteger(AuraSystem__h, (abilityId), 0)) // INLINED!! + if ( aura != 0 ) then + call SaveInteger(AuraSystem__h, s__Aura_abilityId[(aura)], GetHandleId((caster )), ( max)) // INLINED!! + endif +endfunction + +function AuraSystem__TriggerActionLearnSkill takes nothing returns nothing + call AddAuraCaster(GetTriggerUnit() , GetLearnedSkill()) +endfunction + +function AuraSystem__TriggerActionUnlearn takes nothing returns nothing + //call BJDebugMsg("Remove hero caster for auras " + GetUnitName(GetTriggerUnskilledHero())) + call RemoveAuraCaster((HeroUtils__unskilledHero)) // INLINED!! +endfunction + +function AuraSystem__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(AuraSystem__learnTrigger, EVENT_PLAYER_HERO_SKILL) + call TriggerAddAction(AuraSystem__learnTrigger, function AuraSystem__TriggerActionLearnSkill) + + call TriggerRegisterHeroUnskillEvent(AuraSystem__unlearnTrigger) + call TriggerAddAction(AuraSystem__unlearnTrigger, function AuraSystem__TriggerActionUnlearn) +endfunction + + +//library AuraSystem ends +//library HighElfDiurnal: + +function EnableDiurnalEffect takes unit whichUnit returns nothing + if ( not IsUnitType(whichUnit, UNIT_TYPE_HERO) ) then + call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0D3', 1) + endif + call UnitAddAbility(whichUnit, 'A1IQ') + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH ) , (( 80.0 )*1.0) , ( 'B02L') , false) // INLINED!! + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH_REGEN ) , (( 0.4 )*1.0) , ( 'B02L') , false) // INLINED!! + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_ATTACK_SPEED ) , (( 0.1 )*1.0) , ( 'B02L') , false) // INLINED!! + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_MOVEMENT_SPEED ) , (( 80 )*1.0) , ( 'B02L') , false) // INLINED!! +endfunction + + +//library HighElfDiurnal ends +//library WoWReforgedOldHorde: + + +function RecreatOilPatchFromPlatform takes unit platform returns nothing + local unit mine= CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'u031', GetUnitX(platform), GetUnitY(platform), bj_UNIT_FACING) + call SetResourceAmount(mine, (LoadInteger(Resources___h, GetHandleId((platform )), Resources___Index2D(( udg_ResourceOil) , Resources___KEY_RESOURCE , Resources___KEY_MAX)))) // INLINED!! +endfunction + +// death event before resources are lost +function WoWReforgedOldHorde___TriggerConditionDeathResource takes nothing returns boolean + if ( GetUnitTypeId((Resources___triggerDyingResourceUnit)) == 'o07X' and (LoadInteger(Resources___h, GetHandleId(((Resources___triggerDyingResourceUnit) )), Resources___Index2D(( udg_ResourceOil) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! + call RecreatOilPatchFromPlatform((Resources___triggerDyingResourceUnit)) // INLINED!! + endif + return false +endfunction + +function InitResourcesOldHorde takes nothing returns nothing + //call SetCosts('obot', udg_ResourceOil, 700) + //call SetCosts('odes', udg_ResourceOil, 700) + //call SetCosts('ojgn', udg_ResourceOil, 1000) + + call SetObjectTypeResourcesCosts(('o089' ) , ( udg_ResourceOil ) , ( 200)) // Stronghold // INLINED!! + call SetObjectTypeResourcesCosts(('o08A' ) , ( udg_ResourceOil ) , ( 500)) // Fortress // INLINED!! + call SetObjectTypeResourcesCosts(('o088' ) , ( udg_ResourceOil ) , ( 200)) // Oil Refinery // INLINED!! + + call SetResearchCostsForLevel('R0FB' , 0 , udg_ResourceOil , 1000) // Upgrade Cannons + call SetResearchCostsForLevel('R0FB' , 1 , udg_ResourceOil , 3000) // Upgrade Cannons + + // callbacks + call TriggerRegisterDeathResourceEvent(WoWReforgedOldHorde___deathResourceTrigger) + call TriggerAddCondition(WoWReforgedOldHorde___deathResourceTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionDeathResource)) +endfunction + +function ForceUIBuildings takes unit worker returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + // we could also check if it is the only selected unit for the player who has shared control + if ( GetOwningPlayer(worker) == Player(i) or ( GetPlayerAlliance(GetOwningPlayer(worker), Player(i), ALLIANCE_SHARED_CONTROL) and IsUnitSelected(worker, Player(i)) ) ) then + call ForceUIKeyBJ(Player(i), "B") + endif + set i=i + 1 + endloop +endfunction + +function AddOilTankerOldHorde takes unit worker returns nothing + call AddWorker(worker) + call SetUnitHarvestDuration(worker , udg_ResourceOil , 2.0) + call AddResourceToWorker(worker , udg_ResourceOil , 'A1PL' , "harvest" , 'A1PN' , "roar" , 'A1PO' , "robogoblin" , 100 , 100 , "gold") +endfunction + +function AddShipyardOldHorde takes unit whichUnit returns nothing + call AddReturnBuildingEx(whichUnit , udg_ResourceOil) +endfunction + +function AddOilPlatformEx takes unit worker,unit mine,integer oil returns nothing + call UnitRemoveAbility(mine, 'Aegm') + call AddMineEx(mine , udg_ResourceOil , oil) + call SetMineTakeWorkerInside(mine , true) + call SetMineMaxWorkers(mine , 1) + + // TODO the worker seems to be the mine itself. + //call ConstructedMine(worker, mine) +endfunction + +function AddOilPlatform takes unit worker,unit mine returns nothing + call AddOilPlatformEx(worker , mine , 20000) +endfunction + +function StartConstructingOilPlatform takes unit worker,unit mine returns nothing + call UnitRemoveAbility(mine, 'Aegm') +endfunction + + +function AddOilRefinery takes unit whichUnit returns nothing + set playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))] + 1 + call SetPlayerResourceBonus(GetOwningPlayer(whichUnit) , udg_ResourceOil , 25) + call AddReturnBuildingEx(whichUnit , udg_ResourceOil) +endfunction + +function RemoveOilRefinery takes unit whichUnit returns nothing + set playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))] - 1 + if ( playerRefineryCounters[GetPlayerId(GetOwningPlayer(whichUnit))] <= 0 ) then + call SetPlayerResourceBonus(GetOwningPlayer(whichUnit) , udg_ResourceOil , 0) + endif +endfunction + + +function AddTrollLumberMill takes unit whichUnit returns nothing + set playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))] + 1 + call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0FD', 1) +endfunction + +function RemoveTrollLumberMill takes unit whichUnit returns nothing + set playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))]=playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))] - 1 + if ( playerTrollLumberMillCounters[GetPlayerId(GetOwningPlayer(whichUnit))] <= 0 ) then + call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0FD', 0) + endif +endfunction + + +function IsDeathCoilDummy takes unit dummy returns boolean + return IsUnitInGroup(dummy, WoWReforgedOldHorde___deathCoilDummies) +endfunction + +function GetDeathCoilCaster takes unit dummy returns unit + return LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId(dummy), 0) +endfunction + +function SaveDeathCoilCaster takes unit dummy,unit caster returns nothing + call SaveUnitHandle(WoWReforgedOldHorde___h, GetHandleId(dummy), 0, caster) + call GroupAddUnit(WoWReforgedOldHorde___deathCoilDummies, dummy) +endfunction + +function RemoveDeathCoilDummy takes unit dummy returns nothing + call FlushChildHashtable(WoWReforgedOldHorde___h, GetHandleId(dummy)) + call GroupRemoveUnit(WoWReforgedOldHorde___deathCoilDummies, dummy) +endfunction + +// restart existing timers +function WoWReforgedOldHorde___GetNewUnholyArmorTimer takes unit target returns timer + local timer t= LoadTimerHandle(WoWReforgedOldHorde___h, GetHandleId(target), 0) + + if ( t != null ) then + call PauseTimer(t) + return t + endif + + return CreateTimer() +endfunction + +function WoWReforgedOldHorde___TimerFunctionUnholyArmorEnd takes nothing returns nothing + local timer t= GetExpiredTimer() + local integer handleId= GetHandleId(t) + local unit target= LoadUnitHandle(WoWReforgedOldHorde___h, handleId, 0) + call UnitRemoveAbility(target, 'A1TS') + set target=null + call RemoveSavedHandle(WoWReforgedOldHorde___h, GetHandleId(target), 1) + call FlushChildHashtable(WoWReforgedOldHorde___h, handleId) + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function UnholyArmor takes unit target returns nothing + local timer t= WoWReforgedOldHorde___GetNewUnholyArmorTimer(target) + call UnitAddAbility(target, 'A1TS') + call SaveUnitHandle(WoWReforgedOldHorde___h, GetHandleId(t), 0, target) + call SaveTimerHandle(WoWReforgedOldHorde___h, GetHandleId(target), 1, t) + call TimerStart(t, 10.0, false, function WoWReforgedOldHorde___TimerFunctionUnholyArmorEnd) + + call sc__NewBonusUtils_linkBuff((target ) , ( BONUS_ARMOR ) , (( 30.0 )*1.0) , ( 'B03K') , false) // INLINED!! + call sc__NewBonusUtils_linkTimed((target ) , ( BONUS_ARMOR ) , (( 30.0 )*1.0) , (( 12.0)*1.0) , true) // INLINED!! +endfunction + +function WoWReforgedOldHorde___AddSummonedUnitToDeathKnight takes unit caster,unit summoned returns nothing + local integer handleId= GetHandleId(caster) + local group g= LoadGroupHandle(WoWReforgedOldHorde___h, handleId, 2) + local unit first= null + if ( g == null ) then + set g=CreateGroup() + endif + if ( BlzGroupGetSize(g) >= 5 ) then + set first=FirstOfGroup(g) + call KillUnit(first) + call GroupRemoveUnit(g, first) + set first=null + endif + call GroupAddUnit(g, summoned) + call SaveGroupHandle(WoWReforgedOldHorde___h, handleId, 2, g) + call SaveUnitHandle(WoWReforgedOldHorde___h, GetHandleId(summoned), 0, caster) +endfunction + +function WoWReforgedOldHorde___GetSummonedUnitDeathKnight takes unit summoned returns unit + return LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId(summoned), 0) +endfunction + +function WoWReforgedOldHorde___RemoveSummonedUnitFromDeathKnight takes unit caster,unit summoned returns nothing + local integer handleId= GetHandleId(caster) + local group g= LoadGroupHandle(WoWReforgedOldHorde___h, handleId, 2) + if ( g != null ) then + call GroupRemoveUnit(g, summoned) + endif + call FlushChildHashtable(WoWReforgedOldHorde___h, GetHandleId(summoned)) +endfunction + +function WoWReforgedOldHorde___RemoveDeathKnight takes unit caster returns nothing + local integer handleId= GetHandleId(caster) + local group g= LoadGroupHandle(WoWReforgedOldHorde___h, handleId, 2) + if ( g != null ) then + call GroupClear(g) + call DestroyGroup(g) + endif + call FlushChildHashtable(WoWReforgedOldHorde___h, handleId) +endfunction + +function WoWReforgedOldHorde___Heal takes unit target,real life returns nothing + call SetUnitState(target, UNIT_STATE_LIFE, RMinBJ(GetUnitState(target, UNIT_STATE_MAX_LIFE), GetUnitState(target, UNIT_STATE_LIFE) + life)) +endfunction + +function WoWReforgedOldHorde___TriggerConditionDamage takes nothing returns boolean + if ( (IsUnitInGroup((GetEventDamageSource()), WoWReforgedOldHorde___deathCoilDummies)) ) then // INLINED!! + call WoWReforgedOldHorde___Heal((LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId((GetEventDamageSource())), 0)) , GetEventDamage()) // INLINED!! + endif + + if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A1TS') > 0 ) then + call WoWReforgedOldHorde___Heal(GetTriggerUnit() , GetEventDamage()) + endif + + return false +endfunction + +function WoWReforgedOldHorde___TriggerConditionSummon takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == 'o07L' and GetUnitTypeId(GetSummonedUnit()) == 'uske' ) then + call WoWReforgedOldHorde___AddSummonedUnitToDeathKnight(GetTriggerUnit() , GetSummonedUnit()) + endif + + return false +endfunction + +function WoWReforgedOldHorde___TriggerConditionDeath takes nothing returns boolean + local unit deathKnight= (LoadUnitHandle(WoWReforgedOldHorde___h, GetHandleId((GetTriggerUnit())), 0)) // INLINED!! + if ( deathKnight != null ) then + call WoWReforgedOldHorde___RemoveSummonedUnitFromDeathKnight(deathKnight , GetTriggerUnit()) + elseif ( GetUnitTypeId(GetTriggerUnit()) == 'o07L' ) then + call WoWReforgedOldHorde___RemoveDeathKnight(GetTriggerUnit()) + endif + + return false +endfunction + +function WoWReforgedOldHorde___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedOldHorde___damageTrigger, EVENT_PLAYER_UNIT_DAMAGED) + call TriggerAddCondition(WoWReforgedOldHorde___damageTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionDamage)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedOldHorde___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedOldHorde___summonTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionSummon)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedOldHorde___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedOldHorde___deathTrigger, Condition(function WoWReforgedOldHorde___TriggerConditionDeath)) +endfunction + +function WoWReforgedOldHorde___RemoveDeathKnightHook takes unit whichUnit returns nothing + if ( GetUnitTypeId(whichUnit) == 'o07L' ) then + call WoWReforgedOldHorde___RemoveDeathKnight(whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit WoWReforgedOldHorde___RemoveDeathKnightHook + + +//library WoWReforgedOldHorde ends +//library WorgenNocturnal: + +function EnableNocturnalEffect takes unit whichUnit returns nothing + if ( not IsUnitType(whichUnit, UNIT_TYPE_HERO) ) then + call h__SetPlayerTechResearched(GetOwningPlayer(whichUnit), 'R0C1', 1) + endif + call UnitAddAbility(whichUnit, 'A1ER') + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH ) , (( 80.0 )*1.0) , ( 'B02L') , false) // INLINED!! + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_HEALTH_REGEN ) , (( 0.4 )*1.0) , ( 'B02L') , false) // INLINED!! + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_ATTACK_SPEED ) , (( 0.1 )*1.0) , ( 'B02L') , false) // INLINED!! + call sc__NewBonusUtils_linkBuff((whichUnit ) , ( BONUS_MOVEMENT_SPEED ) , (( 80 )*1.0) , ( 'B02L') , false) // INLINED!! +endfunction + + +//library WorgenNocturnal ends +//library WowReforgedCook: + + +function GetRandomFoodItemTypeId takes nothing returns integer + return WowReforgedCook___foodItemTypeIds[GetRandomInt(0, WowReforgedCook___foodItemTypeIdsCounter - 1)] +endfunction + +function IsFood takes integer itemTypeId returns boolean + local integer i= 0 + loop + exitwhen ( i == WowReforgedCook___foodItemTypeIdsCounter ) + if ( itemTypeId == WowReforgedCook___foodItemTypeIds[i] ) then + return true + endif + set i=i + 1 + endloop + return false +endfunction + +function AddFoodItemTypeId takes integer itemTypeId returns nothing + set WowReforgedCook___foodItemTypeIds[WowReforgedCook___foodItemTypeIdsCounter]=itemTypeId + set WowReforgedCook___foodItemTypeIdsCounter=WowReforgedCook___foodItemTypeIdsCounter + 1 +endfunction + +function AddCookFirePit takes unit whichUnit returns nothing + local integer i= 0 + local integer max= udg_RecipeCooking + call EnableItemCraftingUnit(whichUnit) + loop + exitwhen ( i >= max ) + call SetItemCraftingRecipeEnabled(whichUnit , i , false) + set i=i + 1 + endloop + //call SetItemCraftingRecipeEnabled(whichUnit, udg_RecipeHolyGrail, false) + + //call SetPagedButtonsPage(whichUnit, GetRecipePage(udg_RecipeCooking)) +endfunction + +function WarriorsMenu takes unit hero returns nothing + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_STRENGTH ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_DAMAGE ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_HEALTH ) , (( 100.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_HEALTH_REGEN ) , (( 0.3 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! +endfunction + +function RangersMenu takes unit hero returns nothing + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_AGILITY ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_ARMOR ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MOVEMENT_SPEED ) , (( 100.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_ATTACK_SPEED ) , (( 0.3 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! +endfunction + +function MagiciansMenu takes unit hero returns nothing + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_INTELLIGENCE ) , (( 5.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MAGIC_RESISTANCE ) , (( 30.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MANA ) , (( 100.0 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! + call sc__NewBonusUtils_linkTimed((hero ) , ( BONUS_MANA_REGEN ) , (( 0.3 )*1.0) , (( 60.0)*1.0) , true) // INLINED!! +endfunction + +function IsItemTypeIdCookingRecipe takes integer itemTypeId returns boolean + local integer i= 0 + local integer max= udg_RecipeCooking + loop + exitwhen ( i == max ) + if ( itemTypeId == (Crafting__recipesItemTypeIds[(i)]) ) then // INLINED!! + return true + endif + set i=i + 1 + endloop + return false +endfunction + +function WowReforgedCook___ShowRecipesFloatingText takes unit hero,item whichItem,integer recipes returns nothing + local force whichForce= CreateForce() + call ForceAddPlayer(whichForce, GetOwningPlayer(hero)) + call ShowFadingTextTagForForce((whichForce ) , ( "+" + I2S(recipes) + " " + GetItemName(whichItem) ) , 0.025 , (( GetUnitX(hero) )*1.0) , (( GetUnitY(hero) )*1.0) , ( 0 ) , ( 0 ) , ( 0 ) , ( 0) , 0.03 , 1.0 , 2.0) // INLINED!! + call ForceClear(whichForce) + call DestroyForce(whichForce) + set whichForce=null +endfunction + +function CraftItemCook takes unit crafter,item whichItem returns nothing + local integer recipes= CountItemsOfItemTypeId(crafter , ITEM_TYPE_ID_RECIPE) + //call BJDebugMsg("Recipes " + I2S(recipes)) + if ( recipes > 0 ) then + if ( IsItemTypeIdCookingRecipe(GetItemTypeId(whichItem)) ) then + //call BJDebugMsg("Is cooking recipe") + call SetItemCharges(whichItem, GetItemCharges(whichItem) + recipes) + call RemoveAllItemsOfTypeId(crafter , ITEM_TYPE_ID_RECIPE) + call WowReforgedCook___ShowRecipesFloatingText(crafter , whichItem , recipes) + else + //call BJDebugMsg("Is no cooking recipe") + endif + endif +endfunction + +function CookCutKitchenKnife takes unit hero,item whichItem returns nothing + if ( IsFood(GetItemTypeId(whichItem)) ) then + call SetItemCharges(whichItem, GetItemCharges(whichItem) + 1) + else + call IssueImmediateOrder(hero, "stop") + call SimError(GetOwningPlayer(hero) , "Target item must be food.") + endif +endfunction + +function WowReforgedCook___Init takes nothing returns nothing + call AddFoodItemTypeId(ITEM_TYPE_ID_GARLIC) + call AddFoodItemTypeId(ITEM_TYPE_ID_BANANA) + call AddFoodItemTypeId(ITEM_TYPE_ID_ORANGE) + call AddFoodItemTypeId(ITEM_TYPE_ID_LEMON) + call AddFoodItemTypeId(ITEM_TYPE_ID_MEAT) +endfunction + + +//library WowReforgedCook ends +//library WoWReforgedUtils: + + +function WoWReforgedUtils__IsTownHallFilter takes nothing returns boolean + return IsUnitType(GetFilterUnit(), UNIT_TYPE_TOWNHALL) and IsUnitAliveBJ(GetFilterUnit()) +endfunction + +function GetNextUnitToSelect takes group g,player whichPlayer returns unit + local integer max= BlzGroupGetSize(g) + local integer i= 0 + local unit u= null + local unit result= null + local boolean found= false + if ( max > 0 ) then + loop + exitwhen ( i == max ) + set u=BlzGroupUnitAt(g, i) + if ( IsUnitSelected(u, whichPlayer) ) then + set found=true + elseif ( found ) then + set result=u + endif + set u=null + set i=i + 1 + endloop + + // this happens if none of them is selected or the last one + if ( result == null ) then + set result=BlzGroupUnitAt(g, 0) // start at first + endif + endif + + return result +endfunction + +function SelectNextTownHall takes player whichPlayer returns unit + local group halls= CreateGroup() + local unit result= null + call GroupEnumUnitsOfPlayer(halls, whichPlayer, Filter(function WoWReforgedUtils__IsTownHallFilter)) + set result=GetNextUnitToSelect(halls , whichPlayer) + call GroupClear(halls) + call DestroyGroup(halls) + set halls=null + + if ( result != null ) then + call SelectUnitForPlayerSingle(result, whichPlayer) + call SmartCameraPanToUnit(whichPlayer , result , 0.0) + else + call SimError(whichPlayer , "No town halls.") + endif + + return result +endfunction + +function SetTechMaxAllowed takes integer id,integer maximum returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + call SetPlayerTechMaxAllowed(Player(i), id, maximum) + set i=i + 1 + endloop +endfunction + +function FilterPlayerFunctionUsedUser takes nothing returns boolean + return GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER and GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING +endfunction + + +function IsInSinglePlayer takes nothing returns boolean + // cache it to avoid too many calls since it won't change during the game + if ( not WoWReforgedUtils__initialized ) then + //return CountPlayersInForceBJ(GetPlayersMatching(Condition(function FilterPlayerFunctionUsedUser))) == 1 + // https://www.hiveworkshop.com/threads/how-to-detect-single-player.161490/ + // https://www.hiveworkshop.com/threads/how-to-detect-single-player.161490/#post-1512734 + // Even works when all players except one have left the game: + set WoWReforgedUtils__isInSinglePlayer=ReloadGameCachesFromDisk() + set WoWReforgedUtils__initialized=true + endif + + return WoWReforgedUtils__isInSinglePlayer +endfunction + +function GetUnitBaseLevel takes unit whichUnit returns integer + return GetUnitLevelByType(GetUnitTypeId(whichUnit) , GetOwningPlayer(whichUnit)) +endfunction + +function IsPlayerFreelancer takes player whichPlayer returns boolean + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + return not udg_PlayerIsWarlord[convertedPlayerId] +endfunction + +function IsPlayerWarlord takes player whichPlayer returns boolean + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + return udg_PlayerIsWarlord[convertedPlayerId] +endfunction + +function PlayerHasUnlockedRace takes player whichPlayer,integer whichRace returns boolean + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + return whichRace == udg_RaceNone or udg_PlayerUnlockedAllRaces[convertedPlayerId] or whichRace == udg_PlayerRace[convertedPlayerId] or whichRace == udg_PlayerRace2[convertedPlayerId] or udg_UnlockedAll +endfunction + +function SetPlayerHero1 takes player whichPlayer,unit hero returns nothing + set udg_Hero[GetPlayerId(whichPlayer)]=hero + set udg_Held[GetConvertedPlayerId(whichPlayer)]=hero +endfunction + +function GetPlayerHero1 takes player whichPlayer returns unit + return udg_Hero[GetPlayerId(whichPlayer)] +endfunction + +function SetPlayerHero2 takes player whichPlayer,unit hero returns nothing + set udg_Hero2[GetPlayerId(whichPlayer)]=hero + set udg_Held2[GetConvertedPlayerId(whichPlayer)]=hero +endfunction + +function GetPlayerHero2 takes player whichPlayer returns unit + return udg_Hero2[GetPlayerId(whichPlayer)] +endfunction + +function SetPlayerHero3 takes player whichPlayer,unit hero returns nothing + set udg_Hero3[GetPlayerId(whichPlayer)]=hero + set udg_Held3[GetConvertedPlayerId(whichPlayer)]=hero +endfunction + +function GetPlayerHero3 takes player whichPlayer returns unit + return udg_Hero3[GetPlayerId(whichPlayer)] +endfunction + +function GetLivingPlayerHero takes player whichPlayer returns unit + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null and IsUnitAliveBJ((udg_Hero[GetPlayerId((whichPlayer))])) ) then // INLINED!! + return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! + endif + + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null and IsUnitAliveBJ((udg_Hero2[GetPlayerId((whichPlayer))])) ) then // INLINED!! + return (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! + endif + + if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null and IsUnitAliveBJ((udg_Hero3[GetPlayerId((whichPlayer))])) ) then // INLINED!! + return (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! + endif + + return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! +endfunction + +function IsPlayerHero1 takes unit hero returns boolean + return (udg_Hero[GetPlayerId((GetOwningPlayer(hero)))]) == hero // INLINED!! +endfunction + +function IsPlayerHero takes unit hero returns boolean + local player owner= GetOwningPlayer(hero) + local boolean result= (udg_Hero[GetPlayerId((owner))]) == hero or (udg_Hero2[GetPlayerId((owner))]) == hero or (udg_Hero3[GetPlayerId((owner))]) == hero // INLINED!! + set owner=null + return result +endfunction + +function GetPlayerHeroes takes player whichPlayer returns group + local group heroes= CreateGroup() + + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call GroupAddUnit(heroes, (udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! + endif + + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call GroupAddUnit(heroes, (udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! + endif + + if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call GroupAddUnit(heroes, (udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! + endif + + return heroes +endfunction + +function GetPlayerHeroIndex takes player whichPlayer,unit hero returns integer + if ( (udg_Hero[GetPlayerId((whichPlayer))]) == hero ) then // INLINED!! + return 0 + elseif ( (udg_Hero2[GetPlayerId((whichPlayer))]) == hero ) then // INLINED!! + return 1 + elseif ( (udg_Hero3[GetPlayerId((whichPlayer))]) == hero ) then // INLINED!! + return 2 + endif + + return - 1 +endfunction + +function GetPlayerHeroByIndex takes player whichPlayer,integer index returns unit + if ( index == 0 ) then + return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! + elseif ( index == 1 ) then + return (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! + elseif ( index == 2 ) then + return (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! + endif + + return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! +endfunction + +function ReplaceHero takes unit hero,integer newUnitId,integer unitStateMethod,boolean keepAttributes,boolean keepAttributesPerLevel returns unit + local integer sourceHandleId= GetHandleId(hero) + local integer targetHandleId= 0 + local player owner= GetOwningPlayer(hero) + local boolean isHero1= (udg_Hero[GetPlayerId((owner))]) == hero // INLINED!! + local boolean isHero2= (udg_Hero2[GetPlayerId((owner))]) == hero // INLINED!! + local boolean isHero3= (udg_Hero3[GetPlayerId((owner))]) == hero // INLINED!! + local integer str= GetHeroStr(hero, false) + local integer agi= GetHeroAgi(hero, false) + local integer int= GetHeroInt(hero, false) + local real strPerLevel= BlzGetUnitRealField(hero, UNIT_RF_STRENGTH_PER_LEVEL) + local real agiPerLevel= BlzGetUnitRealField(hero, UNIT_RF_AGILITY_PER_LEVEL) + local real intPerLevel= BlzGetUnitRealField(hero, UNIT_RF_INTELLIGENCE_PER_LEVEL) + local unit result= null + + call CopyHeroLevelGainData(sourceHandleId , 0) + call CopyUnitAttributeData(udg_AttributeAttributePoints , sourceHandleId , 0) + + call DisableTrigger(gg_trg_Attributes_Skill_Points_Level_Up) + set result=ReplaceUnitBJ(hero, newUnitId, unitStateMethod) + call EnableTrigger(gg_trg_Attributes_Skill_Points_Level_Up) + + set targetHandleId=GetHandleId(result) + call CopyHeroLevelGainData(0 , targetHandleId) + call CopyUnitAttributeData(udg_AttributeAttributePoints , 0 , targetHandleId) + + if ( keepAttributes ) then + call SetHeroStr(result, str, true) + call SetHeroAgi(result, agi, true) + call SetHeroInt(result, int, true) + endif + + if ( keepAttributesPerLevel ) then + call BlzSetUnitRealField(result, UNIT_RF_STRENGTH_PER_LEVEL, strPerLevel) + call BlzSetUnitRealField(result, UNIT_RF_AGILITY_PER_LEVEL, agiPerLevel) + call BlzSetUnitRealField(result, UNIT_RF_INTELLIGENCE_PER_LEVEL, intPerLevel) + endif + + if ( isHero1 ) then + call SetPlayerHero1(owner , result) + endif + + if ( isHero2 ) then + call SetPlayerHero2(owner , result) + endif + + if ( isHero3 ) then + call SetPlayerHero3(owner , result) + endif + + return result +endfunction + +function GetSelectedForce takes unit hero returns force + local force whichForce= CreateForce() + local player slotPlayer= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( IsUnitSelected(hero, slotPlayer) ) then + call ForceAddPlayer(whichForce, slotPlayer) + endif + set slotPlayer=null + set i=i + 1 + endloop + return whichForce +endfunction + +function GetLivingHero takes player whichPlayer returns unit + if ( IsUnitAliveBJ((udg_Hero[GetPlayerId((whichPlayer))])) ) then // INLINED!! + return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! + elseif ( IsUnitAliveBJ((udg_Hero2[GetPlayerId((whichPlayer))])) ) then // INLINED!! + return (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! + elseif ( IsUnitAliveBJ((udg_Hero3[GetPlayerId((whichPlayer))])) ) then // INLINED!! + return (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! + endif + + return (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! +endfunction + +function GetPlayerEquipmentBags takes player whichPlayer returns group + return udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)] +endfunction + +function GetHeroLevelMaxXP takes integer heroLevel returns integer + local integer result= 0 + local integer i= 3 + loop + exitwhen ( i > heroLevel + 1 ) + set result=result + i * 1000 + set i=i + 1 + endloop + return result +endfunction + +function GetHeroLevelByXP takes integer xp returns integer + local integer heroLevel= 1 + local integer i= 3 + loop + set xp=xp - i * 1000 + exitwhen ( xp < 0 ) + set heroLevel=heroLevel + 1 + set i=i + 1 + endloop + return heroLevel +endfunction + +function GetHeroLevel1 takes player whichPlayer returns integer + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held[playerId] != null ) then + return GetHeroLevel(udg_Held[playerId]) + endif + + return GetHeroLevelByXP(udg_CharacterStartXP[playerId]) +endfunction + +function GetHeroXP1 takes player whichPlayer returns integer + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held[playerId] != null ) then + return GetHeroXP(udg_Held[playerId]) + endif + + return udg_CharacterStartXP[playerId] +endfunction + +function AddHeroXP1 takes player whichPlayer,integer xpToAdd,boolean showEyeCandy returns nothing + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held[playerId] != null ) then + call AddHeroXP(udg_Held[playerId], xpToAdd, showEyeCandy) + else + set udg_CharacterStartXP[playerId]=udg_CharacterStartXP[playerId] + xpToAdd + endif +endfunction + +function GetHeroLevel2 takes player whichPlayer returns integer + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held2[playerId] != null ) then + return GetHeroLevel(udg_Held2[playerId]) + endif + + return GetHeroLevelByXP(udg_Held2XP[playerId]) +endfunction + +function GetHeroXP2 takes player whichPlayer returns integer + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held2[playerId] != null ) then + return GetHeroXP(udg_Held2[playerId]) + endif + + return udg_Held2XP[playerId] +endfunction + +function AddHeroXP2 takes player whichPlayer,integer xpToAdd,boolean showEyeCandy returns nothing + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held2[playerId] != null ) then + call AddHeroXP(udg_Held2[playerId], xpToAdd, showEyeCandy) + else + set udg_Held2XP[playerId]=udg_Held2XP[playerId] + xpToAdd + endif +endfunction + +function GetHeroLevel3 takes player whichPlayer returns integer + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held3[playerId] != null ) then + return GetHeroLevel(udg_Held3[playerId]) + endif + + return GetHeroLevelByXP(udg_Held3XP[playerId]) +endfunction + +function GetHeroXP3 takes player whichPlayer returns integer + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held3[playerId] != null ) then + return GetHeroXP(udg_Held3[playerId]) + endif + + return udg_Held3XP[playerId] +endfunction + +function AddHeroXP3 takes player whichPlayer,integer xpToAdd,boolean showEyeCandy returns nothing + local integer playerId= GetConvertedPlayerId(whichPlayer) + + if ( udg_Held3[playerId] != null ) then + call AddHeroXP(udg_Held3[playerId], xpToAdd, showEyeCandy) + else + set udg_Held3XP[playerId]=udg_Held3XP[playerId] + xpToAdd + endif +endfunction + +function GetHighestHeroLevel takes player whichPlayer returns integer + local integer heroLevel1= GetHeroLevel1(whichPlayer) + local integer heroLevel2= GetHeroLevel2(whichPlayer) + local integer heroLevel3= GetHeroLevel3(whichPlayer) + + if ( heroLevel1 >= heroLevel2 and heroLevel1 >= heroLevel3 ) then + return heroLevel1 + elseif ( heroLevel2 >= heroLevel1 and heroLevel2 >= heroLevel3 ) then + return heroLevel2 + endif + + return heroLevel3 +endfunction + +function GetHighestHeroLevelFromAllPlayingUsers takes nothing returns integer + local player whichPlayer= null + local integer heroLevel= 0 + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set whichPlayer=Player(i) + if ( GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING ) then + set heroLevel=GetHighestHeroLevel(whichPlayer) + if ( heroLevel > result ) then + set result=heroLevel + endif + endif + set whichPlayer=null + set i=i + 1 + endloop + return result +endfunction + +function GetLowestHeroLevel takes player whichPlayer returns integer + local integer playerId= GetConvertedPlayerId(whichPlayer) + local integer heroLevel1= GetHeroLevel1(whichPlayer) + local integer heroLevel2= GetHeroLevel2(whichPlayer) + local integer heroLevel3= GetHeroLevel3(whichPlayer) + + if ( heroLevel1 < heroLevel2 and heroLevel1 < heroLevel3 ) then + return heroLevel1 + elseif ( heroLevel2 < heroLevel1 and heroLevel2 < heroLevel3 ) then + return heroLevel2 + endif + + return heroLevel3 +endfunction + +function GetLowestHeroLevelFromAllPlayingUsers takes nothing returns integer + local player whichPlayer= null + local integer heroLevel= 0 + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set whichPlayer=Player(i) + if ( GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING ) then + set heroLevel=GetLowestHeroLevel(whichPlayer) + if ( heroLevel < result ) then + set result=heroLevel + endif + endif + set whichPlayer=null + set i=i + 1 + endloop + return result +endfunction + +function GetLowestHeroLevel1FromAllPlayingUsers takes nothing returns integer + local player whichPlayer= null + local integer heroLevel= 0 + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set whichPlayer=Player(i) + if ( GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING ) then + set heroLevel=GetHeroLevel1(whichPlayer) + if ( result == 0 or heroLevel < result ) then + set result=heroLevel + endif + endif + set whichPlayer=null + set i=i + 1 + endloop + return result +endfunction + +function SaveTriggerParameterInteger takes handle Trigger,integer ParameterKey,integer Value returns nothing + call SaveInteger(udg_DB, GetHandleId(Trigger), ParameterKey, Value) +endfunction + +function LoadTriggerParameterInteger takes handle Trigger,integer ParameterKey returns integer + return LoadInteger(udg_DB, GetHandleId(Trigger), ParameterKey) +endfunction + +function TriggerParameterIntegerExists takes handle Trigger,integer ParameterKey returns boolean + return HaveSavedInteger(udg_DB, GetHandleId(Trigger), ParameterKey) +endfunction + +function DestroyParameterTrigger takes trigger Trigger returns nothing + call FlushChildHashtable(udg_DB, GetHandleId(Trigger)) + call DestroyTrigger(Trigger) +endfunction + +function SaveUnitParameterInteger takes unit whichUnit,integer ParameterKey,integer Value returns nothing + call SaveInteger(udg_DB, GetHandleId(whichUnit), ParameterKey, Value) +endfunction + +function LoadUnitParameterInteger takes unit whichUnit,integer ParameterKey returns integer + return LoadInteger(udg_DB, GetHandleId(whichUnit), ParameterKey) +endfunction + +function UnitParameterIntegerExists takes unit whichUnit,integer ParameterKey returns boolean + return HaveSavedInteger(udg_DB, GetHandleId(whichUnit), ParameterKey) +endfunction + +function SaveDestructableParameterInteger takes destructable whichDestructable,integer ParameterKey,integer Value returns nothing + call SaveInteger(udg_DB, GetHandleId(whichDestructable), ParameterKey, Value) +endfunction + +function LoadDestructableParameterInteger takes destructable whichDestructable,integer ParameterKey returns integer + return LoadInteger(udg_DB, GetHandleId(whichDestructable), ParameterKey) +endfunction + +function DestructableParameterIntegerExists takes destructable whichDestructable,integer ParameterKey returns boolean + return HaveSavedInteger(udg_DB, GetHandleId(whichDestructable), ParameterKey) +endfunction + +function FlushUnitParameters takes unit whichUnit returns nothing + call FlushChildHashtable(udg_DB, GetHandleId(whichUnit)) +endfunction + +function PlayerIsOnlineUser takes integer playerId returns boolean + local player whichPlayer= Player(playerId) + local boolean result= GetPlayerController(whichPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_PLAYING + set whichPlayer=null + return result +endfunction + +function DropAllItemsFromHero takes unit hero returns integer + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i >= bj_MAX_INVENTORY ) + if ( UnitItemInSlot(hero, i) != null ) then + call UnitRemoveItemFromSlot(hero, i) + set result=result + 1 + endif + set i=i + 1 + endloop + + return result +endfunction + +function DropAllItemsFromHero1 takes player whichPlayer returns integer + return DropAllItemsFromHero(udg_Hero[GetPlayerId(whichPlayer)]) +endfunction + +function DropAllItemsFromHero2 takes player whichPlayer returns integer + return DropAllItemsFromHero(udg_Hero2[GetPlayerId(whichPlayer)]) +endfunction + +function DropAllItemsFromHero3 takes player whichPlayer returns integer + return DropAllItemsFromHero(udg_Hero3[GetPlayerId(whichPlayer)]) +endfunction + +function IsHauntedGoldMine takes integer unitTypeId returns boolean + if ( unitTypeId == UNDEAD_MINE ) then + return true + elseif ( unitTypeId == ELF_MINE ) then + return true + elseif ( unitTypeId == DWARF_MINE ) then + return true + elseif ( unitTypeId == DWARF_MINE_2 ) then + return true + elseif ( unitTypeId == DWARF_MINE_3 ) then + return true + elseif ( unitTypeId == DALARAN_MINE ) then + return true + elseif ( unitTypeId == SATYR_MINE ) then + return true + endif + + return false +endfunction + +function WoWReforgedUtils__FilterFunctionIsHauntedGoldMine takes nothing returns boolean + return IsHauntedGoldMine(GetUnitTypeId(GetFilterUnit())) +endfunction + +function WoWReforgedUtils__ForFunctionKillUnit takes nothing returns nothing + call KillUnit(GetEnumUnit()) +endfunction + +function KillAllHauntedGoldMines takes player whichPlayer returns nothing + set bj_wantDestroyGroup=true + call ForGroupBJ(GetUnitsOfPlayerMatching(whichPlayer, Filter(function WoWReforgedUtils__FilterFunctionIsHauntedGoldMine)), function WoWReforgedUtils__ForFunctionKillUnit) +endfunction + +function EnumLivingTreeDestructablesInCircleFilter takes nothing returns boolean + local boolean result= IsDestructableAliveBJ(GetFilterDestructable()) and (IsTree(GetDestructableTypeId((GetFilterDestructable())))) // INLINED!! + local location destLoc= null + + if ( result ) then + set destLoc=GetDestructableLoc(GetFilterDestructable()) + set result=DistanceBetweenPoints(destLoc, bj_enumDestructableCenter) <= bj_enumDestructableRadius + call RemoveLocation(destLoc) + set destLoc=null + endif + + return result +endfunction + +function RandomLivingTreeDestructableInCircle takes real radius,location loc returns destructable + local boolexpr whichFilter= Filter(function EnumLivingTreeDestructablesInCircleFilter) + local rect r + + if ( radius >= 0 ) then + set bj_enumDestructableCenter=loc + set bj_enumDestructableRadius=radius + set bj_destRandomConsidered=0 + set bj_destRandomCurrentPick=null + set r=GetRectFromCircleBJ(loc, radius) + call EnumDestructablesInRect(r, whichFilter, function RandomDestructableInRectBJEnum) + call RemoveRect(r) + set r=null + endif + + call h__DestroyBoolExpr(whichFilter) + set whichFilter=null + + return bj_destRandomCurrentPick +endfunction + +function LoadTOCFiles takes nothing returns nothing + call BlzLoadTOCFile("war3mapImported\\wowrTOC.toc") +endfunction + +function AddRecipeWoWReforged takes nothing returns integer + set udg_TmpInteger=AddRecipe(udg_TmpItemTypeId , udg_TmpItemTypeId2) + set udg_TmpInteger2=1 + return udg_TmpInteger +endfunction + +function AddRecipeUnitWoWReforged takes nothing returns integer + set udg_TmpInteger=AddRecipe(udg_TmpUnitType , udg_TmpItemTypeId2) + set Crafting__recipesIsUnit[(udg_TmpInteger )]=( true) // INLINED!! + set udg_TmpInteger2=1 + return udg_TmpInteger +endfunction + +function AddRecipeRequirementWoWReforged takes nothing returns integer + local integer requirement= AddRecipeRequirementItem(udg_TmpInteger , udg_TmpItemTypeId , udg_TmpInteger2 , false) + set udg_TmpInteger2=1 + return requirement +endfunction + +function AddRecipeRequirementWoWReforgedNonConsuming takes nothing returns integer + local integer requirement= AddRecipeRequirementItem(udg_TmpInteger , udg_TmpItemTypeId , udg_TmpInteger2 , true) + set udg_TmpInteger2=1 + return requirement +endfunction + +function SetRecipeMinRequirementsWoWReforged takes nothing returns nothing + set Crafting__recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! +endfunction + +function IsWall takes integer buildingId returns boolean + return buildingId == WALL +endfunction + +function AddWoWReforgedTinyBuildingItem takes nothing returns nothing + call SaveInteger(TinyBuildingsLimits___h, (udg_TmpAbilityCode ), 0, ( udg_TmpUnitType)) // INLINED!! +endfunction + + +function WoWReforgedUtils__FilterIsGivableUnit takes nothing returns boolean + return GetOwningPlayer(GetFilterUnit()) == WoWReforgedUtils__tmpPlayer and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_PEON) and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') <= 0 +endfunction + +function UpdateGiveUnitsForPlayer takes player whichPlayer,real x,real y returns nothing + local integer playerId= GetConvertedPlayerId(whichPlayer) + set WoWReforgedUtils__tmpPlayer=whichPlayer + call GroupClear(udg_GivenUnitsToFreelancer[playerId]) + call GroupEnumUnitsInRange(udg_GivenUnitsToFreelancer[playerId], x, y, 512.0, Filter(function WoWReforgedUtils__FilterIsGivableUnit)) +endfunction + +function InitTmpLocations takes nothing returns nothing + if udg_TmpLocation == null then + set udg_TmpLocation=Location(0.0, 0.0) + endif + + if udg_TmpLocation2 == null then + set udg_TmpLocation2=Location(0.0, 0.0) + endif +endfunction + +function MoveTmpLocationToUnit takes unit whichUnit returns nothing + call InitTmpLocations() + call MoveLocationToUnit(udg_TmpLocation , whichUnit) +endfunction + +function MoveTmpLocation takes real x,real y returns nothing + call InitTmpLocations() + call MoveLocation(udg_TmpLocation, x, y) +endfunction + +function MoveTmpLocationToRect takes rect whichRect returns nothing + call InitTmpLocations() + call MoveLocation(udg_TmpLocation, GetRectCenterX(whichRect), GetRectCenterY(whichRect)) +endfunction + +function MoveTmpLocationToDestructable takes destructable d returns nothing + call InitTmpLocations() + call MoveLocation(udg_TmpLocation, GetDestructableX(d), GetDestructableY(d)) +endfunction + +function MoveTmpLocationToPolarProjectionOfUnit takes unit whichUnit,real face,real distance returns nothing + call InitTmpLocations() + call MoveLocation(udg_TmpLocation, PolarProjectionX(GetUnitX(whichUnit) , face , distance), PolarProjectionY(GetUnitY(whichUnit) , face , distance)) +endfunction + +function MoveTmpLocationToRandomPointInRect takes rect whichRect returns nothing + call InitTmpLocations() + call MoveLocation(udg_TmpLocation, GetRandomReal(GetRectMinX(whichRect), GetRectMaxX(whichRect)), GetRandomReal(GetRectMinY(whichRect), GetRectMaxY(whichRect))) +endfunction + + +function FilterIsNoInvulnerableInvalidTarget takes unit target returns boolean + return GetUnitTypeId(target) != BACK_PACK and GetUnitTypeId(target) != EQUIPMENT_BAG and GetUnitAbilityLevel(target, 'Avul') <= 0 +endfunction + +function FilterAlliedTargetsNonStructureMana takes unit caster,unit target,integer abilityId returns boolean + return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and GetUnitState(target, UNIT_STATE_MAX_MANA) > 0.0 and FilterIsNoInvulnerableInvalidTarget(target) +endfunction + +function SetAuraAlliedTargetsNonStructureMana takes nothing returns nothing + set auraFilterFunc=(1) +endfunction + +function FilterAlliedTargetsNonStructure takes unit caster,unit target,integer abilityId returns boolean + return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and FilterIsNoInvulnerableInvalidTarget(target) +endfunction + +function SetAuraAlliedTargetsNonStructure takes nothing returns nothing + set auraFilterFunc=(2) +endfunction + +function FilterAlliedTargetsNonStructureNoSummoned takes unit caster,unit target,integer abilityId returns boolean + return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and not IsUnitType(target, UNIT_TYPE_SUMMONED) and FilterIsNoInvulnerableInvalidTarget(target) +endfunction + +function SetAuraAlliedTargetsNonStructureNoSummoned takes nothing returns nothing + set auraFilterFunc=(3) +endfunction + +function FilterAlliedTargets takes unit caster,unit target,integer abilityId returns boolean + return IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and FilterIsNoInvulnerableInvalidTarget(target) +endfunction + +function SetAuraAlliedTargets takes nothing returns nothing + set auraFilterFunc=(4) +endfunction + +function FilterEnemyTargets takes unit caster,unit target,integer abilityId returns boolean + return not IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and FilterIsNoInvulnerableInvalidTarget(target) +endfunction + +function SetAuraEnemyTargets takes nothing returns nothing + set auraFilterFunc=(5) +endfunction + +function FilterEnemyTargetsNonStructure takes unit caster,unit target,integer abilityId returns boolean + return not IsUnitAlly(target, GetOwningPlayer(caster)) and IsUnitAliveBJ(target) and not IsUnitType(target, UNIT_TYPE_STRUCTURE) and FilterIsNoInvulnerableInvalidTarget(target) +endfunction + +function SetAuraEnemyTargetsNonStructure takes nothing returns nothing + set auraFilterFunc=(6) +endfunction + +function AddWoWReforgedAura takes nothing returns nothing + call AddAura(udg_TmpAbilityCode , udg_TmpAbilityCode2 , udg_TmpAbilityCode3 , auraFilterFunc , udg_TmpReal , udg_TmpBoolean , udg_TmpInteger , udg_TmpReal2 , udg_TmpInteger2 , udg_TmpReal3) +endfunction + +function WoWReforgedUtils__FilterFunctionMassSpell takes nothing returns boolean + local unit caster= (MassSpell__filterCaster) // INLINED!! + local integer abilityId= (MassSpell__filterAbilityId) // INLINED!! + local unit u= GetFilterUnit() + local boolean result= false + if ( abilityId == 'A1WL' or abilityId == 'A11A' ) then // Mass Inner Fire + set result=IsUnitAliveBJ(u) and not IsUnitType(u, UNIT_TYPE_STRUCTURE) and not IsUnitEnemy(u, GetOwningPlayer(caster)) + elseif ( abilityId == 'A14P' ) then // Mass Charm + set result=IsUnitAliveBJ(u) and not IsUnitType(u, UNIT_TYPE_STRUCTURE) and GetUnitAbilityLevel(u, 'Avul') > 0 and GetUnitLevel(u) <= GetUnitAbilityLevel(caster, abilityId) * 5 + endif + + set caster=null + set u=null + + return result +endfunction + +function AddWoWReforgedMassSpell takes nothing returns nothing + local integer s= AddMassSpell(udg_TmpAbilityCode , udg_TmpString , Filter(function WoWReforgedUtils__FilterFunctionMassSpell)) + if ( udg_TmpAbilityCode2 != 0 ) then + call SaveInteger(MassSpell__h, (udg_TmpAbilityCode2 ), 0, ( s)) // INLINED!! + endif + if ( udg_TmpAbilityCode3 != 0 ) then + call SaveInteger(MassSpell__h, (udg_TmpAbilityCode3 ), 0, ( s)) // INLINED!! + endif + + set udg_TmpAbilityCode2=0 + set udg_TmpAbilityCode3=0 +endfunction + +function DisplayNewBonusConfig takes nothing returns nothing + + call h__BJDebugMsg("NewBonus EXTENDED: on") + + + + + + call h__BJDebugMsg("DamageInterface: on") + + + + + + call h__BJDebugMsg("Evasion: on") + + + + + + call h__BJDebugMsg("CriticalStrike: on") + + + + + + call h__BJDebugMsg("SpellPower: on") + + + + + + call h__BJDebugMsg("LifeSteal: on") + + + + + + call h__BJDebugMsg("SpellVamp: on") + + + + + + call h__BJDebugMsg("Tenacity: on") + + + +endfunction + +function GetUcam takes integer unitTypeId returns integer + if ( (LoadBoolean(ObjectDataFields__h, (unitTypeId ), ( OBJECT_DATA_FIELD_UCAM))) ) then // INLINED!! + return 1 + endif + + return 0 +endfunction + +function DisplayUnitRespawnInfo takes unit whichUnit,player whichPlayer returns nothing + local integer unitIndex= (UnitGroupRespawnSystem__GetRespawnUnitIndexByHandleID(GetHandleId((whichUnit)))) // INLINED!! + local integer groupIndex= - 1 + if ( IsRespawnUnitValid(unitIndex) ) then + set groupIndex=(UnitGroupRespawnSystem__respawnUnitGroupIndex[(unitIndex)]) // INLINED!! + endif + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Unit respawn index: " + I2S(unitIndex) + "\nUnit group index: " + I2S(groupIndex)) +endfunction + +function WoWReforgedUtils__TriggerConditionLevel takes nothing returns boolean + if ( GetHeroLevel(GetTriggerUnit()) == MAX_HERO_LEVEL ) then + call AutoSkillHero(GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedUtils__Init takes nothing returns nothing + set udg_DB=InitHashtable() + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedUtils__levelTrigger, EVENT_PLAYER_HERO_LEVEL) + call TriggerAddCondition(WoWReforgedUtils__levelTrigger, Condition(function WoWReforgedUtils__TriggerConditionLevel)) +endfunction + + +//library WoWReforgedUtils ends +//library JumpSpellvJASSJangoFett: + + + + function s__JumpingStomp_DestructableFilter takes nothing returns boolean + if GetDestructableLife(GetFilterDestructable()) > 0 then + if (IsTree(GetDestructableTypeId((GetFilterDestructable())))) then // INLINED!! + call KillDestructable(GetFilterDestructable()) + endif + endif + return false + endfunction + + function s__JumpingStomp_TargetFilter takes nothing returns boolean + return IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitAlly(GetFilterUnit(), GetOwningPlayer(EVENT_JUMP_UNIT)) + endfunction + + function s__JumpingStomp_onFinish takes nothing returns boolean + local real x + local real y + local real damage= 0.0 + local integer i= 0 + local integer max= 0 + local group t= null + local integer level= GetUnitAbilityLevel(EVENT_JUMP_UNIT, JumpSpellvJASSJangoFett___AID3) + if not IsUnitType(EVENT_JUMP_UNIT, UNIT_TYPE_DEAD) then + set x=GetUnitX(EVENT_JUMP_UNIT) + set y=GetUnitY(EVENT_JUMP_UNIT) + call DestroyEffect(AddSpecialEffect(JumpSpellvJASSJangoFett___EFF, x, y)) + call SetRect(JumpSpellvJASSJangoFett___REC, x - JumpSpellvJASSJangoFett___AOE, y - JumpSpellvJASSJangoFett___AOE, x + JumpSpellvJASSJangoFett___AOE, y + JumpSpellvJASSJangoFett___AOE) + call EnumDestructablesInRect(JumpSpellvJASSJangoFett___REC, Condition(function s__JumpingStomp_DestructableFilter), null) + endif + + if ( level > 0 ) then + set damage=20.0 + I2R(level) * 25.0 + set t=CreateGroup() + call GroupEnumUnitsInRange(t, x, y, 256.0, Filter(function s__JumpingStomp_TargetFilter)) + set i=0 + set max=BlzGroupGetSize(t) + loop + exitwhen ( i == max ) + call UnitDamageTarget(EVENT_JUMP_UNIT, BlzGroupUnitAt(t, i), damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) + set i=i + 1 + endloop + call GroupClear(t) + call DestroyGroup(t) + set t=null + endif + //set ST = TAB[GetHandleId(EVENT_JUMP_UNIT)] + //call ST.remove() + return false + endfunction + + function s__JumpingStomp_canCast takes nothing returns boolean + local integer abilityId= GetSpellAbilityId() + return abilityId == JumpSpellvJASSJangoFett___AID or abilityId == JumpSpellvJASSJangoFett___AID2 or abilityId == JumpSpellvJASSJangoFett___AID3 + endfunction + + function s__JumpingStomp_startJump takes nothing returns nothing + local unit u= GetTriggerUnit() + local real x0= GetUnitX(u) + local real y0= GetUnitY(u) + local real x1= GetSpellTargetX() + local real y1= GetSpellTargetY() + // Here I make each jump take at least 0.5 seconds. The distance add to the jump time with 0.5 factor. + local real time= 0.5 + 0.5 * SquareRoot(( x1 - x0 ) * ( x1 - x0 ) + ( y1 - y0 ) * ( y1 - y0 )) / JumpSpellvJASSJangoFett___SPEED + call s__Jump_start(u , x1 , y1 , JumpSpellvJASSJangoFett___MAX_HEIGHT , time , JumpSpellvJASSJangoFett___GRAVITY) + set u=null + endfunction + + function s__JumpingStomp_onCast takes nothing returns boolean + local integer abilityId= GetSpellAbilityId() + if ( abilityId == JumpSpellvJASSJangoFett___AID or abilityId == JumpSpellvJASSJangoFett___AID2 or abilityId == JumpSpellvJASSJangoFett___AID3 ) then + call s__JumpingStomp_startJump() + endif + + return false + endfunction + + function s__JumpingStomp_onOrder takes nothing returns boolean + if GetIssuedOrderId() == JumpSpellvJASSJangoFett___OID and not IsPointJumpable(GetOrderPointX() , GetOrderPointY()) then + call PauseUnit(GetTriggerUnit(), true) + call IssueImmediateOrder(GetTriggerUnit(), "stop") + call PauseUnit(GetTriggerUnit(), false) + call SimError(GetTriggerPlayer() , "Can't jump there.") + endif + return false + endfunction + + function s__JumpingStomp_onInit takes nothing returns nothing + local trigger t= CreateTrigger() + call TriggerRegisterVariableEvent(t, "EVENT_JUMP_FINISH", EQUAL, 1) + call TriggerAddCondition(t, Condition(function s__JumpingStomp_onFinish)) + + set t=CreateTrigger() + call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) + call TriggerAddCondition(t, Condition(function s__JumpingStomp_onOrder)) + + set t=CreateTrigger() + call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(t, Condition(function s__JumpingStomp_canCast)) + call TriggerAddCondition(t, Condition(function s__JumpingStomp_onCast)) + endfunction + +//library JumpSpellvJASSJangoFett ends +//library SaveCodeSystem: + + +function CheckStringForDuplicatedCharacters takes string source returns nothing + local boolean foundDuplicated= false + local integer i= 0 + local integer j= 0 + loop + exitwhen ( i == StringLength(source) ) + set j=0 + loop + exitwhen ( j == StringLength(source) ) + if ( i != j and SubString(source, i, i + 1) == SubString(source, j, j + 1) ) then + set foundDuplicated=true + call h__BJDebugMsg("Duplicated digit at " + I2S(i) + " and " + I2S(j) + ": " + SubString(source, i, i + 1)) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + if ( not foundDuplicated ) then + call h__BJDebugMsg("No duplicates have been found!") + endif +endfunction + +function CheckStringForNonAsciiCharacters takes string source returns nothing + local integer i= 0 + loop + exitwhen ( i == StringLength(source) ) + call Char2Ascii(SubString(source, i, i + 1)) + set i=i + 1 + endloop +endfunction + +function CheckSaveCodeDigitsUnique takes nothing returns nothing + call CheckStringForDuplicatedCharacters(SAVE_CODE_DIGITS) +endfunction + +function CheckSaveCodeDigitsAscii takes nothing returns nothing + call CheckStringForNonAsciiCharacters(SAVE_CODE_DIGITS) +endfunction + +// Returns the base for the custom number system. +function GetMaxSaveCodeDigitsEx takes string alphabet returns integer + return StringLength(alphabet) +endfunction + +function GetMaxSaveCodeDigits takes nothing returns integer + return (StringLength((SAVE_CODE_DIGITS))) // INLINED!! +endfunction + +function ConvertDecimalDigitToSaveCodeDigit takes integer digit returns string + return SubString(SAVE_CODE_DIGITS, digit, digit + 1) +endfunction + +function IndexOfSaveCodeDigitEx takes string symbol,string alphabet returns integer + return (IndexOfStringEx((symbol ) , ( alphabet) , 0)) // INLINED!! +endfunction + +function IndexOfSaveCodeDigit takes string symbol returns integer + return (IndexOfStringEx(((symbol ) ) , ( ( SAVE_CODE_DIGITS)) , 0)) // INLINED!! +endfunction + +function GetObfuscationSaveCodeDigitsEx takes string alphabet returns string + // we want to have the separator in it so we can obfuscate the whole save code with separators. + return alphabet + SAVE_CODE_SEGMENT_SEPARATOR +endfunction + +function GetObfuscationSaveCodeDigits takes nothing returns string + return ((SAVE_CODE_DIGITS) + SAVE_CODE_SEGMENT_SEPARATOR) // INLINED!! +endfunction + +function GetMaxObfuscationSaveCodeDigitsEx takes string alphabet returns integer + return (StringLength((alphabet))) + 1 // INLINED!! +endfunction + +function GetMaxObfuscationSaveCodeDigits takes nothing returns integer + return ((StringLength(((SAVE_CODE_DIGITS)))) + 1) // INLINED!! +endfunction + + +function GetShiftedSaveCodeSplitPositionEx takes integer n,string alphabet returns integer + return ModuloInteger(n, ((StringLength(((alphabet)))) + 1)) // INLINED!! +endfunction + +function GetShiftedSaveCodeSplitPosition takes integer n returns integer + return (ModuloInteger((n ), ((StringLength(((( SAVE_CODE_DIGITS))))) + 1))) // INLINED!! +endfunction + +// Use a hash value (like the player name's hash) to move the symbol table. This might prevent reproducing savecodes too easily. +function GetShiftedSaveCodeDigitsEx takes integer n,string alphabet returns string + local integer max= ((StringLength(((alphabet)))) + 1) // INLINED!! + local string saveCodeDigits= ((alphabet) + SAVE_CODE_SEGMENT_SEPARATOR) // INLINED!! + local integer splitPosition= (ModuloInteger((n ), ((StringLength(((( alphabet))))) + 1))) // INLINED!! + return SubString(saveCodeDigits, splitPosition, ((StringLength(((alphabet)))) + 1)) + SubString(saveCodeDigits, 0, splitPosition) // INLINED!! +endfunction + +function GetShiftedSaveCodeDigits takes integer n returns string + return GetShiftedSaveCodeDigitsEx(n , SAVE_CODE_DIGITS) +endfunction + +// TODO Can be slow for big numbers. Maybe move into a separate trigger with a new OpLimit. +function ConvertDecimalNumberToSaveCodeSegment takes integer number returns string + local string result= "" + local integer start= number + local integer base= (StringLength((SAVE_CODE_DIGITS))) // INLINED!! + local integer mod= 0 + //call BJDebugMsg("Converting number " + I2S(start)) + loop + //call BJDebugMsg("Dividing number " + I2S(start) + " by " + I2S(base)) + set mod=ModuloInteger(start, base) + set start=start / base + set result=ConvertDecimalDigitToSaveCodeDigit(mod) + result + exitwhen ( start == 0 ) + //call BJDebugMsg("Result: " + result) + endloop + + return result + SAVE_CODE_SEGMENT_SEPARATOR +endfunction + +function ConvertSaveCodeToObfuscatedVersion takes string saveCode,integer hash returns string + local string shiftedSaveCodeDigits= (GetShiftedSaveCodeDigitsEx((hash) , SAVE_CODE_DIGITS)) // INLINED!! + local string saveCodeDigits= ((SAVE_CODE_DIGITS) + SAVE_CODE_SEGMENT_SEPARATOR) // INLINED!! + local integer index= - 1 + local string result= "" + local integer i= 0 + //call BJDebugMsg("Shifted digits: " + shiftedSaveCodeDigits) + loop + exitwhen ( i == StringLength(saveCode) ) + set index=(IndexOfStringEx((SubString(saveCode, i, i + 1) ) , ( saveCodeDigits) , 0)) // INLINED!! + if ( index != - 1 ) then + set result=result + SubString(shiftedSaveCodeDigits, index, index + 1) + else + set result=result + SAVE_CODE_SYMBOL_UNKNOWN + endif + set i=i + 1 + endloop + return result +endfunction + +function ConvertSaveCodeFromObfuscatedVersionEx takes string saveCode,integer hash,string alphabet returns string + local string shiftedSaveCodeDigits= GetShiftedSaveCodeDigitsEx(hash , alphabet) + local integer splitPosition= (ModuloInteger((hash ), ((StringLength(((( alphabet))))) + 1))) // INLINED!! + local integer shiftedIndex= - 1 + local integer originalIndex= - 1 + local string result= "" + local integer i= 0 + //call BJDebugMsg("Shifted digits: " + shiftedSaveCodeDigits) + loop + exitwhen ( i == StringLength(saveCode) ) + set shiftedIndex=(IndexOfStringEx((SubString(saveCode, i, i + 1) ) , ( shiftedSaveCodeDigits) , 0)) // INLINED!! + if ( shiftedIndex != - 1 ) then + set result=result + SubString(((alphabet) + SAVE_CODE_SEGMENT_SEPARATOR), shiftedIndex, shiftedIndex + 1) // INLINED!! + else + set result=result + SAVE_CODE_SYMBOL_UNKNOWN + endif + set i=i + 1 + endloop + return result +endfunction + +function ConvertSaveCodeFromObfuscatedVersion takes string saveCode,integer hash returns string + return ConvertSaveCodeFromObfuscatedVersionEx(saveCode , hash , SAVE_CODE_DIGITS) +endfunction + +function PowI takes integer x,integer y returns integer + local integer result= 1 + local integer i= 0 + loop + exitwhen ( i == y ) + set result=result * x + set i=i + 1 + endloop + + return result +endfunction + +// Convert our number system into the decimal system number. +function ConvertSaveCodeSegmentIntoDecimalNumberEx takes string symbol,integer n,string alphabet returns integer + local integer index= (IndexOfStringEx(((symbol ) ) , ( ( alphabet)) , 0)) // INLINED!! + if ( index != - 1 ) then + //call BJDebugMsg("Index " + I2S(index) + " for symbol " + symbol + " pow " + I2S(GetMaxSaveCodeDigits()) + ", " + I2S(n)) + return index * PowI((StringLength((alphabet))) , n) // INLINED!! + endif + //call BJDebugMsg("Cannot find symbol: " + symbol + " with n: " + I2S(n)) + return 0 +endfunction + +function ConvertSaveCodeSegmentIntoDecimalNumber takes string symbol,integer n returns integer + return ConvertSaveCodeSegmentIntoDecimalNumberEx(symbol , n , SAVE_CODE_DIGITS) +endfunction + +// the separator comes after a segment +function GetSaveCodeSegments takes string saveCode returns integer + local integer separatorCounter= 0 + local integer i= 0 + loop + exitwhen ( i == StringLength(saveCode) ) + if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then + set separatorCounter=separatorCounter + 1 + endif + set i=i + 1 + endloop + + return separatorCounter +endfunction + +// includes the separator character! +function GetSaveCodeUntil takes string saveCode,integer excludedIndex returns string + local integer separatorCounter= 0 + local integer index= StringLength(saveCode) + local integer i= 0 + loop + exitwhen ( separatorCounter >= excludedIndex or i == StringLength(saveCode) ) + if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then + set separatorCounter=separatorCounter + 1 + set index=i + 1 // include the separator character! + endif + set i=i + 1 + endloop + + return SubString(saveCode, 0, index) +endfunction + + + function ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx takes string saveCode,integer index,string alphabet returns integer + local string substr= "" + local integer result= 0 + local integer separatorCounter= 0 + local integer n= - 1 + local integer i= 0 + loop + exitwhen ( separatorCounter > index or i == StringLength(saveCode) ) + if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then + set separatorCounter=separatorCounter + 1 + elseif ( separatorCounter == index ) then + set substr=substr + SubString(saveCode, i, i + 1) + set n=n + 1 + endif + set i=i + 1 + endloop + // convert into decimal number + //call BJDebugMsg("Calculate number back " + substr) + set i=0 + loop + exitwhen ( i == StringLength(substr) ) + set result=result + ConvertSaveCodeSegmentIntoDecimalNumberEx(SubString(substr, i, i + 1) , n , alphabet) + //call BJDebugMsg("Result " + I2S(result)) + set n=n - 1 + set i=i + 1 + endloop + + return result +endfunction + +function ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCode takes string saveCode,integer index returns integer + return ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , index , SAVE_CODE_DIGITS) +endfunction + +// Strings are just obfuscated per character. +// Otherwise, we would need to store the length per character. +// The characters must be in the savecode alphabet. Otherwise, they will become a ? character. +function ConvertStringToSaveCodeSegment takes string whichString,integer hash returns string + local string result= "" + local string character= "" + local integer i= 0 + loop + exitwhen ( i == StringLength(whichString) ) + set character=SubString(whichString, i, i + 1) + // no space characters please + if ( character == " " ) then + set character="_" + endif + set result=result + ConvertSaveCodeToObfuscatedVersion(character , hash) + set i=i + 1 + endloop + return result + SAVE_CODE_SEGMENT_SEPARATOR +endfunction + +function ConvertSaveCodeSegmentIntoStringFromSaveCode takes string saveCode,integer index,integer hash returns string + local string substr= "" + local string character= "" + local string result= "" + local integer separatorCounter= 0 + local integer n= - 1 + local integer i= 0 + loop + exitwhen ( separatorCounter > index or i == StringLength(saveCode) ) + if ( SubString(saveCode, i, i + 1) == SAVE_CODE_SEGMENT_SEPARATOR ) then + set separatorCounter=separatorCounter + 1 + elseif ( separatorCounter == index ) then + set substr=substr + SubString(saveCode, i, i + 1) + set n=n + 1 + endif + set i=i + 1 + endloop + // convert into decimal number + //call BJDebugMsg("Calculate number back " + substr) + set i=0 + loop + exitwhen ( i == StringLength(substr) ) + set character=(ConvertSaveCodeFromObfuscatedVersionEx((SubString(substr, i, i + 1) ) , ( hash) , SAVE_CODE_DIGITS)) // INLINED!! + // underscores are space characters by default + if ( character == "_" ) then + set character=" " + endif + set result=result + character + //call BJDebugMsg("Result " + I2S(result)) + set n=n - 1 + set i=i + 1 + endloop + + return result +endfunction + +// We don't want to handle negative numbers. +function AbsStringHash takes string whichString returns integer + return IAbsBJ(StringHash(whichString)) +endfunction + +// If the string hash value is too big, the savecodes get too long. +function CompressedAbsStringHash takes string whichString returns integer + local integer absStringHash= (IAbsBJ(StringHash((whichString)))) // INLINED!! + if ( SAVE_CODE_COMPRESS_STRING_HASHS ) then + return ModuloInteger(absStringHash, (StringLength((SAVE_CODE_DIGITS))) * 3) // INLINED!! + endif + return absStringHash +endfunction + +function IsCharacterUpperCase takes string letter returns boolean + return letter == "A" or letter == "B" or letter == "C" or letter == "D" or letter == "E" or letter == "F" or letter == "G" or letter == "H" or letter == "I" or letter == "J" or letter == "K" or letter == "L" or letter == "M" or letter == "N" or letter == "O" or letter == "P" or letter == "Q" or letter == "R" or letter == "S" or letter == "T" or letter == "U" or letter == "V" or letter == "W" or letter == "X" or letter == "Y" or letter == "Z" +endfunction + +function ColoredSaveCode takes string saveCode returns string + local string result= "" + local string char= "" + local integer i= 0 + loop + exitwhen ( i == StringLength(saveCode) ) + set char=SubString(saveCode, i, i + 1) + if ( IsCharacterUpperCase(char) ) then + set result=result + "|cffffcc00" + char + "|r" + elseif ( char == "|" ) then + set result=result + "||" // escape to avoid invalid color codes + else + set result=result + char + endif + set i=i + 1 + endloop + + return result +endfunction + +function AppendFileContent takes string content returns string + return "\r\n" + content +endfunction + +function AppendFileContentLeft takes string content returns string + return "\r\n" + content +endfunction + +function CreateSaveCodeTextFile takes string playerName,string info,string fileName,string saveCode returns nothing + local string singleplayer= "no" + local string singlePlayerFileName= "Multiplayer" + local string gameMode= "Freelancer" + local string gameType= "Normal" + local string content= "" + + call PreloadGenClear() + call PreloadGenStart() + + set content=content + ("\r\n" + ("Code: -load " + saveCode)) // INLINED!! + set content=content + ("\r\n" + (info)) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + + call Preload(content) + + // The line below creates the file at the specified location + call PreloadGenEnd(fileName) +endfunction + + +//library SaveCodeSystem ends +//library SpellsMeteorKnockbackType: + + +function SpellsMeteorKnockbackType___onUnitHit takes integer kb,unit hit returns nothing + //if (not IsUnitAlly(hit, GetOwningPlayer(kb.caster))) then + //call UnitDamageTarget(kb.caster, hit, GetUnitAbilityLevel(kb.caster, 'A0W7') * 100.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) + //endif +endfunction + +function SpellsMeteorKnockbackType___onDestructableHit takes integer kb,destructable hit returns nothing + if ( (IsTree(GetDestructableTypeId((hit)))) ) then // INLINED!! + call KillDestructable(hit) + endif +endfunction + +function SpellsMeteorKnockbackType___filterFunction takes integer kb,unit enum returns boolean + return not IsUnitAlly(enum, GetOwningPlayer(s__Knockback_caster[kb])) +endfunction + +function SpellsMeteorKnockbackType___Init takes nothing returns nothing + set SpellsMeteorKnockbackType_kbType=s__KnockbackType__allocate() + set s__KnockbackType_onUnitHitAction[SpellsMeteorKnockbackType_kbType]=(3) + set s__KnockbackType_onDestructableHitAction[SpellsMeteorKnockbackType_kbType]=(3) + set s__KnockbackType_filterFunc[SpellsMeteorKnockbackType_kbType]=(3) +endfunction + + +//library SpellsMeteorKnockbackType ends +//library SpellsSlideKnockbackType: + + +function SpellsSlideKnockbackType___onUnitHit takes integer kb,unit hit returns nothing + if ( not IsUnitAlly(hit, GetOwningPlayer(s__Knockback_caster[kb])) ) then + call UnitDamageTarget(s__Knockback_caster[kb], hit, GetUnitAbilityLevel(s__Knockback_caster[kb], 'A0W7') * 100.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) + endif +endfunction + +function SpellsSlideKnockbackType___onDestructableHit takes integer kb,destructable hit returns nothing + if ( (IsTree(GetDestructableTypeId((hit)))) ) then // INLINED!! + call KillDestructable(hit) + endif +endfunction + +function SpellsSlideKnockbackType___filterFunction takes integer kb,unit enum returns boolean + return not IsUnitAlly(enum, GetOwningPlayer(s__Knockback_caster[kb])) +endfunction + +function SpellsSlideKnockbackType___Init takes nothing returns nothing + set SpellsSlideKnockbackType_kbType=s__KnockbackType__allocate() + set s__KnockbackType_onUnitHitAction[SpellsSlideKnockbackType_kbType]=(4) + set s__KnockbackType_onDestructableHitAction[SpellsSlideKnockbackType_kbType]=(4) + set s__KnockbackType_filterFunc[SpellsSlideKnockbackType_kbType]=(4) +endfunction + + +//library SpellsSlideKnockbackType ends +//library WoWReforgedBanners: + + +function GetMaxBanners takes nothing returns integer + return WoWReforgedBanners__skinCounter +endfunction + +function AddBanner takes integer itemTypeId,integer unitTypeId returns integer + local integer index= WoWReforgedBanners__skinCounter + set WoWReforgedBanners__skinItemTypeId[index]=itemTypeId + set WoWReforgedBanners__skinUnitTypeId[index]=unitTypeId + set WoWReforgedBanners__skinCounter=WoWReforgedBanners__skinCounter + 1 + return index +endfunction + +function GetBannerItemTypeId takes integer index returns integer + return WoWReforgedBanners__skinItemTypeId[index] +endfunction + +function GetBannerUnitTypeId takes integer index returns integer + return WoWReforgedBanners__skinUnitTypeId[index] +endfunction + +function GetBannerByUnitTypeId takes integer id returns integer + local integer i= 0 + local integer max= (WoWReforgedBanners__skinCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( (WoWReforgedBanners__skinUnitTypeId[(i)]) == id ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function IsBanner takes integer id returns boolean + return GetBannerByUnitTypeId(id) != - 1 +endfunction + +function MapBannerToItem takes integer id returns integer + local integer index= GetBannerByUnitTypeId(id) + if ( index != - 1 ) then + return (WoWReforgedBanners__skinItemTypeId[(index)]) // INLINED!! + endif + return 0 +endfunction + +function WoWReforgedBanners__AddBannersShop takes unit shop returns nothing + local integer i= 0 + //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + call EnablePagedButtons(shop) + loop + exitwhen ( i >= WoWReforgedBanners__skinCounter ) +call AddPagedButtonsId((shop ) , ( (WoWReforgedBanners__skinItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + //call BJDebugMsg("Skill " + I2S(i)) // Stops at 189 + set i=i + 1 + endloop + //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + + //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") +endfunction + +function WoWReforgedBanners__TriggerConditionConstructed takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == BANNER_SHOP ) then + call WoWReforgedBanners__AddBannersShop(GetConstructedStructure()) + endif + return false +endfunction + +function WoWReforgedBanners__TriggerConditionSummoned takes nothing returns boolean + if ( GetUnitTypeId(GetSummonedUnit()) == BANNER_SHOP ) then + call WoWReforgedBanners__AddBannersShop(GetSummonedUnit()) + endif + return false +endfunction + +function WoWReforgedBanners__TriggerConditionDeath takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == BANNER_SHOP ) then + // TODO Disable shop manually? + //call ClearSkillsShop(GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedBanners__ForGroupEnableShop takes nothing returns nothing + call WoWReforgedBanners__AddBannersShop(GetEnumUnit()) +endfunction + +function WoWReforgedBanners__FilterBuilding takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == BANNER_SHOP_NEUTRAL +endfunction + +function WoWReforgedBanners__UpdateAllShops takes nothing returns nothing + local timer t= GetExpiredTimer() + local group g= CreateGroup() + + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedBanners__FilterBuilding)) + call ForGroup(g, function WoWReforgedBanners__ForGroupEnableShop) + + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them + + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function WoWReforgedBanners__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBanners__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedBanners__constructionTrigger, Condition(function WoWReforgedBanners__TriggerConditionConstructed)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBanners__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedBanners__summonTrigger, Condition(function WoWReforgedBanners__TriggerConditionSummoned)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBanners__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedBanners__deathTrigger, Condition(function WoWReforgedBanners__TriggerConditionDeath)) + + call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedBanners__UpdateAllShops) + + // banners + call AddBanner(ITEM_TINY_BANNER_STORMWIND , BANNER_STORMWIND) + call AddBanner(ITEM_TINY_BANNER_KUL_TIRAS , BANNER_KUL_TIRAS) + call AddBanner(ITEM_TINY_BANNER_DALARAN , BANNER_DALARAN) + call AddBanner(ITEM_TINY_BANNER_ALTERAC , BANNER_ALTERAC) + call AddBanner(ITEM_TINY_BANNER_GILNEAS , BANNER_GILNEAS) + call AddBanner(ITEM_TINY_BANNER_THERAMORE , BANNER_THERAMORE) + call AddBanner(ITEM_TINY_BANNER_STROMGARDE , BANNER_STROMGARDE) + call AddBanner(ITEM_TINY_BANNER_LORDAERON , BANNER_LORDAERON) + call AddBanner(ITEM_TINY_BANNER_HIGH_ELF , BANNER_HIGH_ELF) + call AddBanner(ITEM_TINY_BANNER_BLOOD_ELF , BANNER_BLOOD_ELF) + call AddBanner(ITEM_TINY_BANNER_BRONZEBEARD , BANNER_BRONZEBEARD) + call AddBanner(ITEM_TINY_BANNER_IRONFORGE , BANNER_IRONFORGE) + call AddBanner(ITEM_TINY_BANNER_WILDHAMMER , BANNER_WILDHAMMER) + call AddBanner(ITEM_TINY_BANNER_STORMPIKE , BANNER_STORMPIKE) + call AddBanner(ITEM_TINY_BANNER_DARK_IRON , BANNER_DARK_IRON) + call AddBanner(ITEM_TINY_BANNER_EXPLORERS , BANNER_EXPLORERS) + call AddBanner(ITEM_TINY_BANNER_ORC , BANNER_ORC) + call AddBanner(ITEM_TINY_BANNER_UNDEAD , BANNER_UNDEAD) + call AddBanner(ITEM_TINY_BANNER_NIGHT_ELF , BANNER_NIGHT_ELF) + call AddBanner(ITEM_TINY_BANNER_PANDAREN , BANNER_PANDAREN) +endfunction + + +//library WoWReforgedBanners ends +//library WoWReforgedBosses: + +function IsBoss takes integer unitTypeId returns boolean + local boolean result= false + local unit boss= null + local integer i= 0 + loop + exitwhen ( i >= BlzGroupGetSize(udg_Bosses) or result ) + set boss=BlzGroupUnitAt(udg_Bosses, i) + if ( GetUnitTypeId(boss) == unitTypeId ) then + set result=true + endif + set boss=null + set i=i + 1 + endloop + return result +endfunction + +function UpdateBossPlayerHeroes takes nothing returns nothing + local unit boss= null + local unit boss1= null + local unit boss2= null + local unit boss3= null + local integer i= 0 + loop + exitwhen ( i >= BlzGroupGetSize(udg_Bosses) ) + set boss=BlzGroupUnitAt(udg_Bosses, i) + if ( boss1 == null or GetHeroLevel(boss) > GetHeroLevel(boss1) ) then + set boss1=boss + endif + set i=i + 1 + endloop + set i=0 + loop + exitwhen ( i >= BlzGroupGetSize(udg_Bosses) ) + set boss=BlzGroupUnitAt(udg_Bosses, i) + if ( boss != boss1 and ( boss2 == null or GetHeroLevel(boss) > GetHeroLevel(boss2) ) ) then + set boss2=boss + endif + set i=i + 1 + endloop + set i=0 + loop + exitwhen ( i >= BlzGroupGetSize(udg_Bosses) ) + set boss=BlzGroupUnitAt(udg_Bosses, i) + if ( boss != boss1 and boss != boss2 and ( boss3 == null or GetHeroLevel(boss) > GetHeroLevel(boss3) ) ) then + set boss3=boss + endif + set i=i + 1 + endloop + + call SetPlayerHero1(udg_BossesPlayer , boss1) + call SetPlayerHero2(udg_BossesPlayer , boss2) + call SetPlayerHero3(udg_BossesPlayer , boss3) +endfunction + + +function GetLegendaryItemsMax takes nothing returns integer + return WoWReforgedBosses__legendaryItemsCounter +endfunction + +function GetLegendaryItemTypeId takes integer index returns integer + return WoWReforgedBosses__legendaryItemTypeId[index] +endfunction + +function GetLegendaryItemBoss takes integer index returns unit + return WoWReforgedBosses__legendaryItemBoss[index] +endfunction + +function GetLegendaryItemBuilding takes integer index returns unit + return WoWReforgedBosses__legendaryItemBuilding[index] +endfunction + +function GetLegendaryItemRect takes integer index returns rect + return WoWReforgedBosses__legendaryItemRect[index] +endfunction + +function GetLegendaryItemByBoss takes unit boss returns integer + local integer i= 0 + local integer max= (WoWReforgedBosses__legendaryItemsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( (WoWReforgedBosses__legendaryItemBoss[(i)]) == boss ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetLegendaryItemByItemTypeId takes integer itemTypeId returns integer + local integer i= 0 + local integer max= (WoWReforgedBosses__legendaryItemsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( (WoWReforgedBosses__legendaryItemTypeId[(i)]) == itemTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetUnitLegendaryItemsCount takes unit hero returns integer + local item slotItem= null + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(hero, i) + if ( slotItem != null and GetLegendaryItemByItemTypeId(GetItemTypeId(slotItem)) != - 1 ) then + set result=result + 1 + endif + set slotItem=null + set i=i + 1 + endloop + return result +endfunction + +function AddLegendaryItem takes nothing returns nothing + set WoWReforgedBosses__legendaryItemTypeId[WoWReforgedBosses__legendaryItemsCounter]=udg_TmpItemTypeId + set WoWReforgedBosses__legendaryItemBoss[WoWReforgedBosses__legendaryItemsCounter]=udg_TmpUnit + set WoWReforgedBosses__legendaryItemBuilding[WoWReforgedBosses__legendaryItemsCounter]=udg_TmpUnit2 + set WoWReforgedBosses__legendaryItemRect[WoWReforgedBosses__legendaryItemsCounter]=udg_TmpRect + + set udg_LegendaryItemType[WoWReforgedBosses__legendaryItemsCounter]=udg_TmpItemTypeId + set udg_LegendaryItemDropRect[WoWReforgedBosses__legendaryItemsCounter]=udg_TmpRect + + set WoWReforgedBosses__legendaryItemsCounter=WoWReforgedBosses__legendaryItemsCounter + 1 + set udg_LegendaryItemTypeSize=udg_LegendaryItemTypeSize + 1 +endfunction + +function WoWReforgedBosses__TriggerConditionBossDeath takes nothing returns boolean + local unit dyingUnit= GetDyingUnit() + local integer index= - 1 + if ( IsUnitType(dyingUnit, UNIT_TYPE_HERO) and ( GetOwningPlayer(dyingUnit) == udg_BossesPlayer or IsUnitInGroup(dyingUnit, udg_Bosses) ) ) then + set index=GetLegendaryItemByBoss(dyingUnit) + if ( index != - 1 ) then + call SetUnitInvulnerable((WoWReforgedBosses__legendaryItemBuilding[(index)]), false) // INLINED!! + endif + endif + + set dyingUnit=null + + return false +endfunction + +function WoWReforgedBosses__Init takes nothing returns nothing + set WoWReforgedBosses__bossDeathTrigger=CreateTrigger() + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBosses__bossDeathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedBosses__bossDeathTrigger, Condition(function WoWReforgedBosses__TriggerConditionBossDeath)) +endfunction + + +//library WoWReforgedBosses ends +//library WoWReforgedCamera: + +function ToggleCameraLock takes player whichPlayer returns nothing + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + if ( not udg_CamLockPlayerEnabled[convertedPlayerId] ) then + set udg_CamLockPlayerEnabled[convertedPlayerId]=true + set udg_CamLockPlayerTarget[convertedPlayerId]=udg_Held[convertedPlayerId] + call SetCameraTargetControllerNoZForPlayer(whichPlayer, udg_CamLockPlayerTarget[convertedPlayerId], 0, 0, false) + else + set udg_CamLockPlayerEnabled[convertedPlayerId]=false + call ResetToGameCameraForPlayer(whichPlayer, 0) + endif +endfunction + +function ToggleCameraRpg takes player whichPlayer returns nothing + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + local integer playerId= GetPlayerId(whichPlayer) + if ( IsInSinglePlayer() ) then + if ( not udg_CamRPGPlayerEnabled[convertedPlayerId] ) then + set udg_CamRPGPlayerEnabled[convertedPlayerId]=true + if ( udg_Held[convertedPlayerId] != null ) then + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_ALWAYSHINT, "Use the arrow keys to move the camera, press Control and IJKL to move your hero, select another hero to change the camera.") + call s__AThirdPersonCamera_enable(s__AThirdPersonCamera_playerThirdPersonCamera(whichPlayer),udg_Hero[playerId] , 0.0) + set KeyMovementSystem__Unit[GetPlayerId((whichPlayer ))]=( udg_Hero[playerId]) // INLINED!! + call TimerStart(KeyMovementSystem__UpdateTimer, KeyMovementSystem_TIMER_INTERVAL, true, function KeyMovementSystem__TimerFunctionUpdate) // INLINED!! + call UnitAddTypeBJ(UNIT_TYPE_PEON, udg_Held[convertedPlayerId]) + call FogEnableOff() + call FogMaskEnableOff() + call ShowAllTextTagsForPlayer(whichPlayer , false) + endif + else + set udg_CamRPGPlayerEnabled[convertedPlayerId]=false + set udg_CamLockPlayerEnabled[convertedPlayerId]=false + call s__AThirdPersonCamera_disable(s__AThirdPersonCamera_playerThirdPersonCamera(whichPlayer)) + set KeyMovementSystem__Unit[GetPlayerId((whichPlayer))]=null // INLINED!! + call ResetToGameCameraForPlayer(whichPlayer, 0) + call UnitRemoveAbilityBJ('Abun', udg_Held[convertedPlayerId]) + call UnitRemoveTypeBJ(UNIT_TYPE_PEON, udg_Held[convertedPlayerId]) + call FogEnableOn() + call FogMaskEnableOn() + call ShowAllTextTagsForPlayer(whichPlayer , true) + endif + else + call SimError(whichPlayer , "Only available in singleplayer.") + endif +endfunction + + + +//library WoWReforgedCamera ends +//library WoWReforgedClanShop: + +function WoWReforgedClanShop__FilterIsClanShop takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == CLAN_SHOP +endfunction + + +function GetClanBannersCount takes nothing returns integer + return WoWReforgedClanShop__clanBannersCount +endfunction + +function GetClanBanner takes integer index returns integer + return WoWReforgedClanShop__clanBanners[index] +endfunction + +function GetClanBannerIndex takes integer itemTypeId returns integer + local integer max= (WoWReforgedClanShop__clanBannersCount) // INLINED!! + local integer i= 0 + loop + exitwhen ( i == max ) + if ( (WoWReforgedClanShop__clanBanners[(i)]) == itemTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function AddClanBanner takes integer itemTypeId returns integer + local integer index= WoWReforgedClanShop__clanBannersCount + set WoWReforgedClanShop__clanBanners[index]=itemTypeId + set WoWReforgedClanShop__clanBannersCount=WoWReforgedClanShop__clanBannersCount + 1 + return index +endfunction + +function GetClanSoundsCount takes nothing returns integer + return WoWReforgedClanShop__clanSoundsCount +endfunction + +function GetClanSoundItemTypeId takes integer index returns integer + return WoWReforgedClanShop__clanSoundsItemTypeIds[index] +endfunction + +function GetClanSoundSound takes integer index returns sound + return WoWReforgedClanShop__clanSoundsSounds[index] +endfunction + +function GetClanSoundName takes integer index returns string + return GetObjectName((WoWReforgedClanShop__clanSoundsItemTypeIds[(index)])) // INLINED!! +endfunction + +function GetClanSoundIndex takes sound whichSound returns integer + local integer max= (WoWReforgedClanShop__clanSoundsCount) // INLINED!! + local integer i= 0 + loop + exitwhen ( i == max ) + if ( (WoWReforgedClanShop__clanSoundsSounds[(i)]) == whichSound ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetClanSoundIndexByItemTypeId takes integer itemTypeId returns integer + local integer max= (WoWReforgedClanShop__clanSoundsCount) // INLINED!! + local integer i= 0 + loop + exitwhen ( i == max ) + if ( (WoWReforgedClanShop__clanSoundsItemTypeIds[(i)]) == itemTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function AddClanSound takes integer itemTypeId,sound whichSound returns integer + local integer index= WoWReforgedClanShop__clanSoundsCount + set WoWReforgedClanShop__clanSoundsItemTypeIds[index]=itemTypeId + set WoWReforgedClanShop__clanSoundsSounds[index]=whichSound + set WoWReforgedClanShop__clanSoundsCount=WoWReforgedClanShop__clanSoundsCount + 1 + return index +endfunction + +function WoWReforgedClanShop__AddClanShop takes unit shop returns nothing + local integer max= 0 + local integer i= 0 + + call EnablePagedButtons(shop) + call SetPagedButtonsSlotsPerPage(shop , 9) + + call NextPagedButtonsPage(shop , "Clan") +call AddPagedButtonsId((shop ) , ( CLAN_CREATE_CLAN) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! +call AddPagedButtonsId((shop ) , ( CLAN_TINY_CLAN_HALL) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + + call NextPagedButtonsPage(shop , "Clan Sounds") + set i=0 + set max=(WoWReforgedClanShop__clanSoundsCount) // INLINED!! + loop + exitwhen ( i == max ) +call AddPagedButtonsId((shop ) , ( (WoWReforgedClanShop__clanSoundsItemTypeIds[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop + + call NextPagedButtonsPage(shop , "Clan Banners") + set i=0 + set max=(WoWReforgedClanShop__clanBannersCount) // INLINED!! + loop + exitwhen ( i == max ) +call AddPagedButtonsId((shop ) , ( (WoWReforgedClanShop__clanBanners[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop + + call SetPagedButtonsPage(shop , 0) +endfunction + +function WoWReforgedClanShop__ForGroupAddClanShop takes nothing returns nothing + call WoWReforgedClanShop__AddClanShop(GetEnumUnit()) +endfunction + +function WoWReforgedClanShop__TimerFunctionAddClanShops takes nothing returns nothing + local timer t= GetExpiredTimer() + local group g= CreateGroup() + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), WoWReforgedClanShop__filterIsClanShop) + call ForGroup(g, function WoWReforgedClanShop__ForGroupAddClanShop) + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function WoWReforgedClanShop__TriggerConditionSellItem takes nothing returns boolean + local item i= GetSoldItem() + local integer itemTypeId= GetItemTypeId(i) + local integer soundIndex= GetClanSoundIndexByItemTypeId(itemTypeId) + local integer bannerIndex= GetClanBannerIndex(itemTypeId) + local player owner= GetOwningPlayer(GetBuyingUnit()) + local integer clan= udg_ClanPlayerClan[GetConvertedPlayerId(owner)] + if ( soundIndex != - 1 ) then + if ( clan != 0 ) then + if ( udg_ClanPlayerRank[GetConvertedPlayerId(owner)] == udg_ClanRankLeader ) then + set udg_ClanSound[clan]=(WoWReforgedClanShop__clanSoundsSounds[(soundIndex)]) // INLINED!! + call h__DisplayTimedTextToPlayer(owner, 0.0, 0.0, 4.0, "Changed clan sound to: " + GetItemName(i)) + else + call SimError(owner , "Your clan rank must be Leader.") + endif + else + call SimError(owner , "You need a clan.") + endif + call h__RemoveItem(i) + elseif ( bannerIndex != - 1 ) then + if ( clan != 0 ) then + if ( udg_ClanPlayerRank[GetConvertedPlayerId(owner)] == udg_ClanRankLeader ) then + set udg_ClanIcon[clan]=itemTypeId + call h__DisplayTimedTextToPlayer(owner, 0.0, 0.0, 4.0, "Changed clan banner to: " + GetItemName(i)) + else + call SimError(owner , "Your clan rank must be Leader.") + endif + else + call SimError(owner , "You need a clan.") + endif + call h__RemoveItem(i) + endif + set i=null + set owner=null + return false +endfunction + +function WoWReforgedClanShop__Init takes nothing returns nothing + set WoWReforgedClanShop__filterIsClanShop=Filter(function WoWReforgedClanShop__FilterIsClanShop) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedClanShop__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedClanShop__sellTrigger, Condition(function WoWReforgedClanShop__TriggerConditionSellItem)) + + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedClanShop__TimerFunctionAddClanShops) + + call AddClanSound(CLAN_HORN_SOUND , gg_snd_TheHornOfCenarius) + call AddClanSound(CLAN_LAUGH_SOUND , gg_snd_SargerasLaugh) + + call AddClanBanner(CLAN_BANNER_HUMAN) + call AddClanBanner(CLAN_BANNER_ORC) + call AddClanBanner(CLAN_BANNER_UNDEAD) + call AddClanBanner(CLAN_BANNER_NIGHT_ELF) + call AddClanBanner(CLAN_BANNER_PANDAREN) + call AddClanBanner(CLAN_BANNER_DWARF) + call AddClanBanner(CLAN_BANNER_GNOME) + +endfunction + + +//library WoWReforgedClanShop ends +//library WoWReforgedEquipmentBags: + + +function GetMaxEquipmentBags takes player whichPlayer returns integer + local integer heroLevel= GetHighestHeroLevel(whichPlayer) + if ( heroLevel >= HERO_JOURNEY_EQUIPMENT_BAG_1 ) then + if ( heroLevel >= HERO_JOURNEY_EQUIPMENT_BAG_2 ) then + if ( heroLevel >= HERO_JOURNEY_EQUIPMENT_BAG_3 ) then + return MAX_EQUIPMENT_BAGS + endif + + return 2 + endif + + return 1 + endif + + return 0 +endfunction + +function GetEquipmentBagsCount takes player whichPlayer returns integer + return BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) +endfunction + +function EquipmentBagListItemTypeIds takes nothing returns string + local string result= "" + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedEquipmentBags__registeredItemTypeIdsCounter ) + if ( i > 0 ) then + set result=result + ", " + endif + set result=result + GetObjectName(WoWReforgedEquipmentBags__registeredItemTypeIds[i]) + set i=i + 1 + endloop + return result +endfunction + +function EquipmentBagSetAbilityCount takes integer itemTypeId,integer count returns nothing + call SaveInteger(WoWReforgedEquipmentBags__h, itemTypeId, 0, count) +endfunction + +function EquipmentBagGetAbilityCount takes integer itemTypeId returns integer + return LoadInteger(WoWReforgedEquipmentBags__h, itemTypeId, 0) +endfunction + +function EquipmentBagGetAbilityId takes integer itemTypeId,integer index returns integer + return LoadInteger(WoWReforgedEquipmentBags__h, itemTypeId, index) +endfunction + +function EquipmentBagGetAbilityIdStacking takes integer itemTypeId,integer abilityId returns boolean + return LoadBoolean(WoWReforgedEquipmentBags__stackingHashTable, itemTypeId, abilityId) +endfunction + +function EquipmentBagRegisterAbilityEx takes integer itemTypeId,integer abilityId,boolean stacking returns nothing + local integer i= 0 + local boolean found= false + local integer count= (LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId), 0)) + 1 // INLINED!! + call SaveInteger(WoWReforgedEquipmentBags__h, itemTypeId, count, abilityId) + call SaveBoolean(WoWReforgedEquipmentBags__stackingHashTable, itemTypeId, abilityId, stacking) + call SaveInteger(WoWReforgedEquipmentBags__h, (itemTypeId ), 0, ( count)) // INLINED!! + // we store all item type IDs for player information + loop + exitwhen ( i >= WoWReforgedEquipmentBags__registeredItemTypeIdsCounter or found ) + if ( WoWReforgedEquipmentBags__registeredItemTypeIds[i] == itemTypeId ) then + set found=true + endif + set i=i + 1 + endloop + if ( not found ) then + set WoWReforgedEquipmentBags__registeredItemTypeIds[WoWReforgedEquipmentBags__registeredItemTypeIdsCounter]=itemTypeId + set WoWReforgedEquipmentBags__registeredItemTypeIdsCounter=WoWReforgedEquipmentBags__registeredItemTypeIdsCounter + 1 + endif +endfunction + +function EquipmentBagRegisterAbility takes nothing returns nothing + call EquipmentBagRegisterAbilityEx(udg_TmpItemTypeId , udg_TmpAbilityCode , udg_TmpBoolean) +endfunction + +function EquipmentBagAddAbilities takes unit bag,item whichItem returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(bag)) + local integer itemTypeId= GetItemTypeId(whichItem) + local integer count= (LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId), 0)) // INLINED!! + local integer abilityId= 0 + local boolean stacking= false + local unit hero= udg_Hero[playerId] + local integer i= 1 + if ( hero != null ) then + loop + exitwhen ( i > count ) + set abilityId=(LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId ), ( i))) // INLINED!! + set stacking=(LoadBoolean(WoWReforgedEquipmentBags__stackingHashTable, (itemTypeId ), ( abilityId))) // INLINED!! + + if ( stacking or GetUnitAbilityLevel(hero, abilityId) <= 0 ) then + call UnitAddAbility(hero, abilityId) + endif + set i=i + 1 + endloop + endif + set hero=null +endfunction + +function WoWReforgedEquipmentBags__CountItemsOfTypeFromHero takes unit hero,integer itemTypeId returns integer + local item whichItem= null + local integer count= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set whichItem=UnitItemInSlot(hero, i) + if ( whichItem != null and GetItemTypeId(whichItem) == itemTypeId ) then + set count=count + 1 + endif + set whichItem=null + set i=i + 1 + endloop + return count +endfunction + +function EquipmentBagRemoveAbilities takes unit bag,item whichItem returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(bag)) + local integer itemTypeId= GetItemTypeId(whichItem) + local integer count= (LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId), 0)) // INLINED!! + local integer abilityId= 0 + local boolean stacking= false + local unit hero= udg_Hero[playerId] + local integer i= 1 + if ( hero != null ) then + loop + exitwhen ( i > count ) + set abilityId=(LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId ), ( i))) // INLINED!! + set stacking=(LoadBoolean(WoWReforgedEquipmentBags__stackingHashTable, (itemTypeId ), ( abilityId))) // INLINED!! + + if ( stacking or WoWReforgedEquipmentBags__CountItemsOfTypeFromHero(hero , itemTypeId) == 0 ) then + call UnitRemoveAbility(hero, abilityId) + endif + set i=i + 1 + endloop + endif + set hero=null +endfunction + +function RemoveEquipmentBags takes player whichPlayer returns nothing + local integer max= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! + local unit equipmentBag= null + local integer i= 0 + loop + exitwhen ( i >= max ) + set equipmentBag=BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) + call DropAllItemsFromHero(equipmentBag) + call DisableItemCraftingUnit(equipmentBag) + call h__RemoveUnit(equipmentBag) + set equipmentBag=null + set i=i + 1 + endloop + call GroupClear(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) +endfunction + +function UpdateEquipmentBagHeroLevels takes player whichPlayer returns nothing + local integer highHeroLevel= GetHighestHeroLevel(whichPlayer) + local integer max= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! + local unit equipmentBag= null + local integer i= 0 + loop + exitwhen ( i >= max ) + set equipmentBag=BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) + call SuspendHeroXP(equipmentBag, false) + if ( GetHeroLevel(equipmentBag) < highHeroLevel ) then + call SetHeroLevel(equipmentBag, highHeroLevel, true) + endif + call SuspendHeroXP(equipmentBag, true) + set equipmentBag=null + set i=i + 1 + endloop + //call BJDebugMsg("Update equipment bag hero levels to highest hero level " + I2S(highHeroLevel)) +endfunction + +function WoWReforgedEquipmentBags__CreateSingleEquipmentBag takes player whichPlayer,integer index returns unit + local integer playerId= GetPlayerId(whichPlayer) + local unit equipmentBag= CreateUnit(whichPlayer, EQUIPMENT_BAG, GetUnitX(udg_Hero[playerId]), GetUnitY(udg_Hero[playerId]), bj_UNIT_FACING) + local string equipmentBagName= "Equipment Bag " + I2S(index) + call SuspendHeroXP(equipmentBag, true) + call GroupAddUnit(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], equipmentBag) + call UnitRemoveAbility(equipmentBag, 'A02N') + call UnitAddAbility(equipmentBag, 'AInv') + call BlzSetUnitName(equipmentBag, equipmentBagName) + call BlzSetHeroProperName(equipmentBag, equipmentBagName) + return equipmentBag +endfunction + +function CreateEquipmentBags takes player whichPlayer,integer equipmentBags returns nothing + local integer max= GetMaxEquipmentBags(whichPlayer) + local integer i= 0 + loop + exitwhen ( i >= max ) + call WoWReforgedEquipmentBags__CreateSingleEquipmentBag(whichPlayer , (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) + 1) // INLINED!! + set i=i + 1 + endloop + call UpdateEquipmentBagHeroLevels(whichPlayer) + call LinkItemCraftingGroupInventories(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) +endfunction + +function WoWReforgedEquipmentBags__ForGroupRemoveUnit takes nothing returns nothing + //call BJDebugMsg("Remove 1") + call DropAllItemsFromHero(GetEnumUnit()) + //call BJDebugMsg("Remove 2") + call DisableItemCraftingUnit(GetEnumUnit()) + //call BJDebugMsg("Remove 3") + call h__RemoveUnit(GetEnumUnit()) + //call BJDebugMsg("Remove 4") +endfunction + +function RecreateEquipmentBags takes player whichPlayer,integer equipmentBags returns nothing + local integer oldMax= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! + local integer max= IMaxBJ(oldMax, equipmentBags) + local unit equipmentBag= null + local integer sourceHandleId= 0 + local group oldBags= CopyGroup(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) + local group removingBags= CreateGroup() + local integer i= 0 + set max=IMinBJ(max, GetMaxEquipmentBags(whichPlayer)) + loop + exitwhen ( i >= max ) + //call BJDebugMsg("Equipment bags old max " + I2S(oldMax) + " and max " + I2S(max) + " and i " + I2S(i)) + if ( i < oldMax ) then + set equipmentBag=BlzGroupUnitAt(oldBags, i) + //call BJDebugMsg("Adding bag with ID " + I2S(GetHandleId(equipmentBag))) + call GroupAddUnit(removingBags, equipmentBag) + set sourceHandleId=GetHandleId(equipmentBag) + else + set sourceHandleId=0 + endif + set equipmentBag=WoWReforgedEquipmentBags__CreateSingleEquipmentBag(whichPlayer , i + 1) + if ( sourceHandleId > 0 ) then + call ApplyAllHeroLearnedSkills(equipmentBag , sourceHandleId) + endif + set equipmentBag=null + set i=i + 1 + endloop + //call BJDebugMsg("Remove 1 old equipment bags with count " + I2S(CountUnitsInGroup(removingBags))) + call GroupRemoveGroup(removingBags, udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) + //call BJDebugMsg("Remove 2 old equipment bags with count " + I2S(CountUnitsInGroup(removingBags))) + call ForGroup(removingBags, function WoWReforgedEquipmentBags__ForGroupRemoveUnit) + call GroupClear(removingBags) + call DestroyGroup(removingBags) + set removingBags=null + call GroupClear(oldBags) + call DestroyGroup(oldBags) + set oldBags=null + call UpdateEquipmentBagHeroLevels(whichPlayer) + call LinkItemCraftingGroupInventories(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) +endfunction + +function ResetEquipmentBags takes player whichPlayer returns nothing + //call BJDebugMsg("Equipment bags size " + I2S(GetEquipmentBagsCount(whichPlayer))) + call ForGroup(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], function WoWReforgedEquipmentBags__ForGroupRemoveUnit) + call GroupClear(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) +endfunction + +function AddEquipmentBag takes player whichPlayer returns nothing + local integer max= GetMaxEquipmentBags(whichPlayer) + if ( (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) < max ) then // INLINED!! + call WoWReforgedEquipmentBags__CreateSingleEquipmentBag(whichPlayer , (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) + 1) // INLINED!! + call UpdateEquipmentBagHeroLevels(whichPlayer) + call LinkItemCraftingGroupInventories(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) + else + call SimError(whichPlayer , "Maximum number of equipment bags: " + I2S(max)) + endif +endfunction + +function RecreateAllEquipmentBags takes player whichPlayer returns nothing + local integer count= (BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) // INLINED!! + call RecreateEquipmentBags(whichPlayer , count) +endfunction + + +//library WoWReforgedEquipmentBags ends +//library WoWReforgedEvolution: + +function WoWReforgedEvolution___FilterIsEvolutionAffected takes nothing returns boolean + local unit filterUnit= GetFilterUnit() + local boolean result= not IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and not IsUnitType(filterUnit, UNIT_TYPE_HERO) and not IsUnitIllusion(filterUnit) + set filterUnit=null + return result +endfunction + +function WoWReforgedEvolution___SetUnitEvolutionFields takes unit whichUnit,integer evolutionLevel,integer level,real armor returns nothing + //local integer lifeBonus = evolutionLevel * 50 + // devotion aura etc. + // do not kill summoned units with timed life buffs + call UnitRemoveBuffsEx(whichUnit, true, true, true, true, false, true, true) + call BlzSetUnitIntegerField(whichUnit, UNIT_IF_LEVEL, level) + call BlzSetUnitRealField(whichUnit, UNIT_RF_DEFENSE, armor) + // Using the research instead leads to an overflow and negative maximum life. + //call BlzSetUnitMaxHP(whichUnit, R2I(GetUnitState(whichUnit, UNIT_STATE_MAX_LIFE)) + lifeBonus) + //call SetUnitState(whichUnit, UNIT_STATE_LIFE, GetUnitState(whichUnit, UNIT_STATE_LIFE) + I2R(lifeBonus)) +endfunction + +function WoWReforgedEvolution___SetEvolutionLevelEx takes player whichPlayer,integer levels returns nothing + local integer bonus= levels / 10 + local group units= CreateGroup() + local unit member= null + local integer i= 0 + local integer max= 0 + call GroupEnumUnitsOfPlayer(units, whichPlayer, Filter(function WoWReforgedEvolution___FilterIsEvolutionAffected)) + set max=BlzGroupGetSize(units) + loop + exitwhen ( i == max ) + set member=BlzGroupUnitAt(units, i) + call WoWReforgedEvolution___SetUnitEvolutionFields(member , levels , BlzGetUnitIntegerField(member, UNIT_IF_LEVEL) + bonus , BlzGetUnitRealField(member, UNIT_RF_DEFENSE) + I2R(bonus)) + set member=null + set i=i + 1 + endloop + call GroupClear(units) + call DestroyGroup(units) + set units=null +endfunction + +function WoWReforgedEvolution___SetEvolutionLevel takes player whichPlayer,integer levels returns nothing + if ( levels != 0 ) then + call WoWReforgedEvolution___SetEvolutionLevelEx(whichPlayer , levels) + endif +endfunction + +function SetEvolutionLevelOfPlayer takes player whichPlayer,integer level returns nothing + call h__SetPlayerTechResearched(whichPlayer, UPG_EVOLUTION, level) +endfunction + +function GetEvolutionLevelOfPlayer takes player whichPlayer returns integer + return GetPlayerTechCountSimple(UPG_EVOLUTION, whichPlayer) +endfunction + +function SetEvolution takes unit whichUnit returns nothing + local player owner= GetOwningPlayer(whichUnit) + local integer evolutionLevel= (GetPlayerTechCountSimple(UPG_EVOLUTION, (owner))) // INLINED!! + local integer bonus= evolutionLevel / 10 + local integer unitTypeId= GetUnitTypeId(whichUnit) + if ( bonus != 0 ) then + call WoWReforgedEvolution___SetUnitEvolutionFields(whichUnit , evolutionLevel , GetUnitLevelByType(unitTypeId , owner) + bonus , GetUnitDefenseByType(unitTypeId , owner) + R2I(bonus)) + endif + set owner=null +endfunction + +function AddEvolution takes unit whichUnit returns nothing + local integer evolutionLevel= (GetPlayerTechCountSimple(UPG_EVOLUTION, (GetOwningPlayer(whichUnit)))) // INLINED!! + local integer bonus= evolutionLevel / 10 + if ( bonus != 0 ) then + call WoWReforgedEvolution___SetUnitEvolutionFields(whichUnit , evolutionLevel , BlzGetUnitIntegerField(whichUnit, UNIT_IF_LEVEL) + bonus , BlzGetUnitRealField(whichUnit, UNIT_RF_DEFENSE) + I2R(bonus)) + endif +endfunction + +function UpgradeEvolution takes player whichPlayer returns nothing + call WoWReforgedEvolution___SetEvolutionLevel(whichPlayer , 1) +endfunction + +function SetEvolutionLevelForCreeps takes integer level returns nothing + call h__SetPlayerTechResearched((Player(PLAYER_NEUTRAL_AGGRESSIVE) ), UPG_EVOLUTION, ( level)) // INLINED!! + call h__SetPlayerTechResearched((udg_BossesPlayer ), UPG_EVOLUTION, ( level)) // INLINED!! +endfunction + +function WoWReforgedEvolution___HookSetPlayerTechResearched takes player whichPlayer,integer techid,integer setToLevel returns nothing + if ( techid == UPG_EVOLUTION ) then + call WoWReforgedEvolution___SetEvolutionLevel(whichPlayer , setToLevel - (GetPlayerTechCountSimple(UPG_EVOLUTION, (whichPlayer)))) // INLINED!! + endif +endfunction + +function WoWReforgedEvolution___HookAddPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing + if ( techid == UPG_EVOLUTION ) then + call WoWReforgedEvolution___SetEvolutionLevel(whichPlayer , levels) + endif +endfunction + +function WoWReforgedEvolution___HookBlzDecPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing + if ( techid == UPG_EVOLUTION ) then + call WoWReforgedEvolution___SetEvolutionLevel(whichPlayer , - levels) + endif +endfunction + +//processed hook: hook SetPlayerTechResearched WoWReforgedEvolution___HookSetPlayerTechResearched +//processed hook: hook AddPlayerTechResearched WoWReforgedEvolution___HookAddPlayerTechResearched +//processed hook: hook BlzDecPlayerTechResearched WoWReforgedEvolution___HookBlzDecPlayerTechResearched + + +//library WoWReforgedEvolution ends +//library WoWReforgedHeroes: + +function WoWReforgedHeroes__AddHeroPagedButtonsConfig takes integer id,string modelPath returns nothing + call AddPagedButtonsConfigHero(id , 0 , 0 , 1 , 1 , 0 , 0 , modelPath) +endfunction + +function GetHeroesMax takes nothing returns integer + return udg_HeroUnitTypeIndex +endfunction + +function GetHeroRace takes integer index returns integer + return udg_HeroRace[index] +endfunction + +function GetHeroUnitType takes integer index returns integer + return udg_HeroUnitType[index] +endfunction + +function GetHeroIsBonus takes integer index returns boolean + return udg_HeroIsBonus[index] +endfunction + +function GetHeroIndexByUnitTypeId takes integer unitTypeId returns integer + local integer i= 0 + loop + exitwhen ( i >= udg_MaxHeroUnitTypes ) + if ( (udg_HeroUnitType[(i)]) == unitTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function PlayerCanBuyHeroEx takes player whichPlayer,integer unitTypeId returns boolean + local integer index= GetHeroIndexByUnitTypeId(unitTypeId) + if ( index > - 1 ) then + return PlayerHasUnlocked(whichPlayer , (udg_HeroUnitType[(index)])) and ( not (udg_HeroIsBonus[(index)]) or GetHeroLevel1(whichPlayer) >= HERO_JOURNEY_BONUS_HEROS or udg_UnlockedAll ) // INLINED!! + endif + return true +endfunction + +function PlayerCanBuyHero takes player whichPlayer,unit hero returns boolean + return PlayerCanBuyHeroEx(whichPlayer , GetUnitTypeId(hero)) +endfunction + +function PlayerCanBuyHeroErrorMessageEx takes player whichPlayer,integer unitTypeId returns string + local integer index= GetHeroIndexByUnitTypeId(unitTypeId) + if ( index > - 1 ) then + if ( not PlayerHasUnlocked(whichPlayer , (udg_HeroUnitType[(index)])) ) then // INLINED!! + return "Hero is restricted to accounts: " + GetAllUnlockedAccountNames((udg_HeroUnitType[(index)])) // INLINED!! + elseif ( (udg_HeroIsBonus[(index)]) and GetHeroLevel1(whichPlayer) < HERO_JOURNEY_BONUS_HEROS and not udg_UnlockedAll ) then // INLINED!! + return "Bonus hero requires hero level " + I2S(HERO_JOURNEY_BONUS_HEROS) + " or \"-unlock\"." + endif + endif + return "" +endfunction + +function PlayerCanBuyHeroErrorMessage takes player whichPlayer,unit hero returns string + return PlayerCanBuyHeroErrorMessageEx(whichPlayer , GetUnitTypeId(hero)) +endfunction + +function AddHeroWoWReforged takes nothing returns integer + local integer index= udg_HeroUnitTypeIndex + set udg_HeroUnitType[index]=udg_TmpUnitType + set udg_HeroRace[index]=udg_TmpInteger + set udg_HeroIsBonus[index]=udg_TmpBoolean + set udg_HeroCategory[index]=udg_TmpString + set udg_HeroAccountNames[index]=udg_TmpString2 + set udg_HeroUnitTypeIndex=udg_HeroUnitTypeIndex + 1 + set udg_MaxHeroUnitTypes=udg_HeroUnitTypeIndex + + call AddPagedButtonsConfigHero((udg_TmpUnitType ) , 0 , 0 , 1 , 1 , 0 , 0 , ( udg_TmpString3)) // INLINED!! + + if ( udg_TmpBoolean2 ) then + call SaveBoolean(ObjectDataFields__h, (udg_TmpUnitType ), ( OBJECT_DATA_FIELD_UCAM ), ( true)) // INLINED!! + endif + + + set udg_TmpBoolean=false + set udg_TmpBoolean2=false + set udg_TmpString2="" + set udg_TmpString3="" + + return index +endfunction + +function AddHeroAbilityWoWReforged takes nothing returns nothing + //call AddObjectIdIntegerListFieldValue(udg_TmpUnitType, OBJECT_DATA_FIELD_UHAB, udg_TmpAbilityCode) + call RegisterHeroAbilityEx(udg_TmpUnitType , udg_TmpAbilityCode , MAX_HERO_SPELL_LEVEL) +endfunction + +function GetHeroCategory takes integer index returns string + return udg_HeroCategory[index] +endfunction + +function ChooseRandomHeroFromRace takes integer whichRace returns integer + local integer array heroIndices + local integer heroIndicesCounter= 0 + local integer i= 0 + loop + exitwhen ( i >= udg_MaxHeroUnitTypes ) + if ( ( udg_HeroRace[i] == whichRace or whichRace == udg_RaceFreelancer ) ) then + //call BJDebugMsg("Adding index " + I2S(i) + " possible heroes for race " + GetObjectName(udg_RaceTavernItemType[whichRace]) + ": " + GetObjectName(udg_HeroUnitType[i])) + set heroIndices[heroIndicesCounter]=i + set heroIndicesCounter=heroIndicesCounter + 1 + endif + set i=i + 1 + endloop + + //call BJDebugMsg("Got " + I2S(heroIndicesCounter) + " possible heroes for race " + GetObjectName(udg_RaceTavernItemType[whichRace])) + + if ( heroIndicesCounter > 0 ) then + return heroIndices[GetRandomInt(0, heroIndicesCounter - 1)] + endif + + return 0 +endfunction + + +//library WoWReforgedHeroes ends +//library WoWReforgedKnockbackSimple: + +////////////////////Vexorian's Check Pathability//////////////////// + +function CheckPathabilityTrickGet takes nothing returns nothing + set bj_rescueChangeColorUnit=bj_rescueChangeColorUnit or ( GetEnumItem() != bj_itemRandomCurrentPick ) +endfunction + +function CheckPathabilityTrick takes real x,real y returns boolean + local integer i= 30 + local real X + local real Y + local rect r + call SetItemPosition(It, x, y) + set X=GetItemX(It) - x + set Y=GetItemY(It) - y + if X * X + Y * Y <= 100 then + return true + endif + set r=Rect(x - i, y - i, x + i, y + i) + set bj_rescueChangeColorUnit=false + call EnumItemsInRect(r, null, function CheckPathabilityTrickGet) + call RemoveRect(r) + set r=null + return bj_rescueChangeColorUnit +endfunction + +function CheckPathability takes real x,real y returns boolean + local boolean b= CheckPathabilityTrick(x , y) + call SetItemVisible(It, false) + return b +endfunction + +/////////////////////////////////////////////////////////////////// + + +function Knockback_TreeFilter takes nothing returns boolean + return (IsTree(GetDestructableTypeId((GetFilterDestructable())))) // INLINED!! +endfunction + +function Knockback_KillTree takes nothing returns nothing + call KillDestructable(GetEnumDestructable()) +endfunction + + +function WoWReforgedKnockbackSimple___Loop takes nothing returns nothing + local integer knock + local integer i= 0 + local real x + local real y + local rect r + loop + exitwhen i >= Total + set knock=ar[i] + set x=GetUnitX(s__WoWReforgedKnockbackSimple___KnockbackS_target[knock]) + s__WoWReforgedKnockbackSimple___KnockbackS_d1[knock] * s__WoWReforgedKnockbackSimple___KnockbackS_cos[knock] + set y=GetUnitY(s__WoWReforgedKnockbackSimple___KnockbackS_target[knock]) + s__WoWReforgedKnockbackSimple___KnockbackS_d1[knock] * s__WoWReforgedKnockbackSimple___KnockbackS_sin[knock] + if s__WoWReforgedKnockbackSimple___KnockbackS_r[knock] != 0 then + set r=Rect(x - s__WoWReforgedKnockbackSimple___KnockbackS_r[knock], y - s__WoWReforgedKnockbackSimple___KnockbackS_r[knock], x + s__WoWReforgedKnockbackSimple___KnockbackS_r[knock], y + s__WoWReforgedKnockbackSimple___KnockbackS_r[knock]) + call EnumDestructablesInRect(r, filter, function Knockback_KillTree) + call RemoveRect(r) + endif + if CheckPathability(x , y) then + call SetUnitX(s__WoWReforgedKnockbackSimple___KnockbackS_target[knock], x) + call SetUnitY(s__WoWReforgedKnockbackSimple___KnockbackS_target[knock], y) + call DestroyEffect(AddSpecialEffectTargetUnitBJ(s__WoWReforgedKnockbackSimple___KnockbackS_attachmentPoint[knock], s__WoWReforgedKnockbackSimple___KnockbackS_target[knock], s__WoWReforgedKnockbackSimple___KnockbackS_efect[knock])) + endif + set s__WoWReforgedKnockbackSimple___KnockbackS_d1[knock]=s__WoWReforgedKnockbackSimple___KnockbackS_d1[knock] - s__WoWReforgedKnockbackSimple___KnockbackS_d2[knock] + if s__WoWReforgedKnockbackSimple___KnockbackS_d1[knock] <= 0 or not CheckPathability(x , y) then + set ar[i]=ar[Total - 1] + set Total=Total - 1 + call PauseUnit(s__WoWReforgedKnockbackSimple___KnockbackS_target[knock], false) + call GroupRemoveUnit(knockbackTargets, s__WoWReforgedKnockbackSimple___KnockbackS_target[knock]) + call s__WoWReforgedKnockbackSimple___KnockbackS_deallocate(knock) + endif + set i=i + 1 + endloop + if Total == 0 then + call PauseTimer(Timer) + endif + +endfunction + +function KnockbackUnitSimple takes unit target,real distance,real angle,real duration,real radius,string efect,string attachmentPoint returns nothing + local integer kd= s__WoWReforgedKnockbackSimple___KnockbackS__allocate() + local integer q= R2I(duration / Interval) + set s__WoWReforgedKnockbackSimple___KnockbackS_target[kd]=target + set s__WoWReforgedKnockbackSimple___KnockbackS_d1[kd]=2 * distance / ( q + 1 ) + set s__WoWReforgedKnockbackSimple___KnockbackS_d2[kd]=s__WoWReforgedKnockbackSimple___KnockbackS_d1[kd] / q + set s__WoWReforgedKnockbackSimple___KnockbackS_cos[kd]=Cos(angle * bj_DEGTORAD) + set s__WoWReforgedKnockbackSimple___KnockbackS_sin[kd]=Sin(angle * bj_DEGTORAD) + set s__WoWReforgedKnockbackSimple___KnockbackS_r[kd]=radius + set s__WoWReforgedKnockbackSimple___KnockbackS_efect[kd]=efect + set s__WoWReforgedKnockbackSimple___KnockbackS_attachmentPoint[kd]=attachmentPoint + call PauseUnit(target, true) + if Total == 0 then + call TimerStart(Timer, Interval, true, function WoWReforgedKnockbackSimple___Loop) + endif + set ar[Total]=kd + set Total=Total + 1 + call GroupAddUnit(knockbackTargets, target) +endfunction + +function GetKnockbackTargets takes nothing returns group + return knockbackTargets +endfunction + +function IsUnitKnockbackTarget takes unit whichUnit returns boolean + return IsUnitInGroup(whichUnit, knockbackTargets) +endfunction + +function WoWReforgedKnockbackSimple___Init takes nothing returns nothing + set knockbackTargets=CreateGroup() + set It=CreateItem('ciri', 0, 0) + set filter=Filter(function Knockback_TreeFilter) +endfunction + + +//library WoWReforgedKnockbackSimple ends +//library WoWReforgedLearnableSkillsShop: + + +function GetSkillShopCooldownTimer takes player whichPlayer,integer slot returns timer + return WoWReforgedLearnableSkillsShop__cooldownTimer[Index2D(GetPlayerId(whichPlayer) , slot , RESKILL_MAX_SLOTS)] +endfunction + +function GetSkillSlotFromShopType takes integer unitTypeId returns integer + if ( unitTypeId == SPELL_BOOK ) then + return - 1 + elseif ( unitTypeId == HERO_SPELLS_SLOT_1 ) then + return 0 + elseif ( unitTypeId == HERO_SPELLS_SLOT_2 ) then + return 1 + elseif ( unitTypeId == HERO_SPELLS_SLOT_3 ) then + return 2 + elseif ( unitTypeId == HERO_SPELLS_SLOT_4 ) then + return 3 + elseif ( unitTypeId == HERO_SPELLS_SLOT_5 ) then + return 4 + endif + return - 1 +endfunction + +function WoWReforgedLearnableSkillsShop__AddLearnableSkillsToShop takes unit shop returns nothing + local integer slot= GetSkillSlotFromShopType(GetUnitTypeId(shop)) + local integer max= (WoWReforgedLearnableSkills__learnableSkillCounter) // INLINED!! + local integer currentSlot= - 1 + local integer i= 0 + //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + call EnablePagedButtons(shop) + call SetPagedButtonsSlotsPerPage(shop , 9) + loop + exitwhen ( i >= max ) + if ( slot == - 1 or (WoWReforgedLearnableSkills__learnableSkillSlot[(i)]) == slot ) then // INLINED!! + if ( slot == - 1 and ( currentSlot == - 1 or currentSlot != (WoWReforgedLearnableSkills__learnableSkillSlot[(i)]) ) ) then // INLINED!! + call NextPagedButtonsPage(shop , "Slot " + I2S(slot + 1)) + endif + set currentSlot=(WoWReforgedLearnableSkills__learnableSkillSlot[(i)]) // INLINED!! +call AddPagedButtonsId((shop ) , ( (WoWReforgedLearnableSkills__learnableSkillLearnItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + endif + //call BJDebugMsg("Skill " + I2S(i)) // Stops at 189 + set i=i + 1 + endloop + //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + + //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") +endfunction + +function IsEquipmentBag takes integer unitTypeId returns boolean + return unitTypeId == EQUIPMENT_BAG +endfunction + +function IsAllowedToReskillEquipmentBag takes player whichPlayer returns boolean + return GetHeroLevel1(whichPlayer) >= RESKILL_HERO_LEVEL or udg_VIPOnForPlayer[GetConvertedPlayerId(whichPlayer)] or udg_UnlockedAll +endfunction + +function WoWReforgedLearnableSkillsShop__TriggerAction1SellItem takes nothing returns nothing + local unit shop= GetSellingUnit() + local integer slot= GetSkillSlotFromShopType(GetUnitTypeId(shop)) + local unit hero= GetBuyingUnit() + local player owner= GetOwningPlayer(hero) + local integer unitTypeId= GetUnitTypeId(hero) + local integer itemTypeId= GetItemTypeId(GetSoldItem()) + local integer shopUnitTypeId= GetUnitTypeId(shop) + local integer index= GetLearnableSkillByLearnItemTypeId(itemTypeId) + if ( index != - 1 ) then + if ( ( ((unitTypeId) == EQUIPMENT_BAG) and IsAllowedToReskillEquipmentBag(owner) ) or ( not ((unitTypeId) == EQUIPMENT_BAG) and IsReskillableHero(unitTypeId) ) ) then // INLINED!! + if ( not ((GetUnitTypeId(hero)) == EQUIPMENT_BAG) or not (WoWReforgedLearnableSkills__learnableSkillForbidEquipmentBag[(index)]) ) then // INLINED!! + if ( RectContainsUnit(gg_rct_Player_Selection, hero) or TimerGetRemaining((WoWReforgedLearnableSkillsShop__cooldownTimer[Index2D(GetPlayerId((owner )) , ( (WoWReforgedLearnableSkills__learnableSkillSlot[(index)])) , RESKILL_MAX_SLOTS)])) <= 0.0 ) then // INLINED!! + call DisableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! + call UnskillHero(hero) + call ResetLearnableSkillsForHero(hero , (WoWReforgedLearnableSkills__learnableSkillSlot[(index)])) // INLINED!! + call AddLearnableSkillToHero(hero , index) + call EnableTrigger(WoWReforgedHeroSkills__unlearnTrigger) // INLINED!! + call ApplyAllHeroLearnedSkills(hero , GetHandleId(hero)) // TODO Get the ability IDs before learning. + call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Added ability " + GetObjectName((WoWReforgedLearnableSkills__learnableSkillAbilityId[(index)]))) // INLINED!! + // cooldown is annoying + //call TimerStart(GetSkillShopCooldownTimer(owner, GetLearnableSkillSlot(index)), 60.0, false, null) + else + call SimError(owner , "Wait " + FormatTime(TimerGetRemaining((WoWReforgedLearnableSkillsShop__cooldownTimer[Index2D(GetPlayerId((owner )) , ( (WoWReforgedLearnableSkills__learnableSkillSlot[(index)])) , RESKILL_MAX_SLOTS)]))) + " until you can learn another skill from slot " + I2S(slot + 1) + ".") // INLINED!! + endif + else + call SimError(owner , "This spell is not allowed for Equipment Backpacks.") + endif + else + call SimError(owner , "Only the Void Lord hero, Archangel hero, Sea Giant hero or Equipment Backpacks at hero level 75 can change their hero abilities.") + endif + //else + //call BJDebugMsg("No matching learnable skill for item " + GetItemName(GetSoldItem())) + endif + set shop=null + set hero=null + set owner=null +endfunction + +function WoWReforgedLearnableSkillsShop__TriggerConditionConstructed takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == SPELL_BOOK ) then + call WoWReforgedLearnableSkillsShop__AddLearnableSkillsToShop(GetConstructedStructure()) + endif + return false +endfunction + +function WoWReforgedLearnableSkillsShop__TriggerConditionSummoned takes nothing returns boolean + if ( GetUnitTypeId(GetSummonedUnit()) == SPELL_BOOK ) then + call WoWReforgedLearnableSkillsShop__AddLearnableSkillsToShop(GetSummonedUnit()) + endif + return false +endfunction + +function WoWReforgedLearnableSkillsShop__TriggerConditionDeath takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == SPELL_BOOK ) then + // TODO Disable shop manually? + //call ClearSkillsShop(GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedLearnableSkillsShop__ForGroupEnableShop takes nothing returns nothing + call WoWReforgedLearnableSkillsShop__AddLearnableSkillsToShop(GetEnumUnit()) +endfunction + +function WoWReforgedLearnableSkillsShop__FilterBuilding takes nothing returns boolean + local integer unitTypeId= GetUnitTypeId(GetFilterUnit()) + return unitTypeId == HERO_SPELLS_SLOT_1 or unitTypeId == HERO_SPELLS_SLOT_2 or unitTypeId == HERO_SPELLS_SLOT_3 or unitTypeId == HERO_SPELLS_SLOT_4 or unitTypeId == HERO_SPELLS_SLOT_5 +endfunction + +function WoWReforgedLearnableSkillsShop__UpdateAllShops takes nothing returns nothing + local group g= CreateGroup() + + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedLearnableSkillsShop__FilterBuilding)) + call ForGroup(g, function WoWReforgedLearnableSkillsShop__ForGroupEnableShop) + + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function WoWReforgedLearnableSkillsShop__Init takes nothing returns nothing + local integer j= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set j=0 + loop + exitwhen ( j >= 5 ) + set WoWReforgedLearnableSkillsShop__cooldownTimer[Index2D(i , j , 5)]=CreateTimer() + set j=j + 1 + endloop + set i=i + 1 + endloop + call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddAction(WoWReforgedLearnableSkillsShop__sellTrigger, function WoWReforgedLearnableSkillsShop__TriggerAction1SellItem) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedLearnableSkillsShop__constructionTrigger, Condition(function WoWReforgedLearnableSkillsShop__TriggerConditionConstructed)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedLearnableSkillsShop__summonTrigger, Condition(function WoWReforgedLearnableSkillsShop__TriggerConditionSummoned)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedLearnableSkillsShop__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedLearnableSkillsShop__deathTrigger, Condition(function WoWReforgedLearnableSkillsShop__TriggerConditionDeath)) + + call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedLearnableSkillsShop__UpdateAllShops) +endfunction + + +//library WoWReforgedLearnableSkillsShop ends +//library WoWReforgedProfessionsTavern: + + +function WoWReforgedProfessionsTavern__AddProfessionsTavern takes unit tavern returns nothing + local integer i= 0 + call EnablePagedButtons(tavern) + call SetPagedButtonsSlotsPerPage(tavern , 10) + +call AddPagedButtonsId((tavern ) , ( ITEM_TYPE_RANDOM_PROFESSION) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + + set i=0 + loop + exitwhen ( i >= (WoWReforgedProfessions__professionsCounter) ) // INLINED!! +call AddPagedButtonsId((tavern ) , ( GetProfessionItemTypeId(i)) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop + call SetPagedButtonsPage(tavern , 0) +endfunction + +function WoWReforgedProfessionsTavern__ForGroupAddProfessionsTavern takes nothing returns nothing + call WoWReforgedProfessionsTavern__AddProfessionsTavern(GetEnumUnit()) +endfunction + +function WoWReforgedProfessionsTavern__TimerFunctionAddProfessionsTaverns takes nothing returns nothing + call ForGroupBJ(GetUnitsOfTypeIdAll(PROFESSIONS_TAVERN), function WoWReforgedProfessionsTavern__ForGroupAddProfessionsTavern) + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function SelectRandomProfession takes unit buyingUnit,unit tavern returns nothing + local player owner= GetOwningPlayer(buyingUnit) + local integer array availableIds + local integer availableIdsCounter= 0 + local integer id= 0 + local integer random= 0 + local integer page= 0 + local integer index= 0 + local integer i= 1 + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + loop + exitwhen ( i >= max ) + set id=GetProfessionItemTypeId(i) + //if (PlayerCanPickRaceEx(owner, id)) then + set availableIds[availableIdsCounter]=id + set availableIdsCounter=availableIdsCounter + 1 + //endif + set i=i + 1 + endloop + + set random=GetRandomInt(0, availableIdsCounter - 1) + set id=availableIds[random] + //call BJDebugMsg("Selected random " + GetObjectName(id)) + set index=GetPagedButtonIndex(tavern , id) + //call BJDebugMsg("index " + I2S(index)) + set page=GetPagedButtonsPageByIndex(tavern , index) + //call BJDebugMsg("page " + I2S(page)) + call SetPagedButtonsPage(tavern , page) + call IssueNeutralImmediateOrderById(owner, tavern, id) + + set owner=null +endfunction + +function WoWReforgedProfessionsTavern__TriggerConditionSellItem takes nothing returns boolean + if ( GetItemTypeId(GetSoldItem()) == ITEM_TYPE_RANDOM_PROFESSION ) then + call SelectRandomProfession(GetBuyingUnit() , GetTriggerUnit()) + call h__RemoveItem(GetSoldItem()) + endif + return false +endfunction + +function WoWReforgedProfessionsTavern__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedProfessionsTavern__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedProfessionsTavern__sellTrigger, Condition(function WoWReforgedProfessionsTavern__TriggerConditionSellItem)) + + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedProfessionsTavern__TimerFunctionAddProfessionsTaverns) +endfunction + + +//library WoWReforgedProfessionsTavern ends +//library WoWReforgedResurrectionStone: + + + +function IsResurrectionStone takes integer unitTypeId returns boolean + return unitTypeId == RESURRECTION_STONE_0 or unitTypeId == RESURRECTION_STONE_1 +endfunction + +function IsUnitResurrectionStone takes unit whichUnit returns boolean + return IsResurrectionStone(GetUnitTypeId(whichUnit)) +endfunction + +function GetResurrectionStoneFromUnit takes unit whichUnit returns integer + return LoadInteger(WoWReforgedResurrectionStone___h, GetHandleId(whichUnit), 0) +endfunction + +function ResurrectionStoneHasHeroOfPlayer takes integer r,player whichPlayer returns boolean + local boolean result= false + local unit u= null + local integer i= 0 + local integer max= BlzGroupGetSize(s__ResurrectionStone_g[r]) + loop + exitwhen ( i == max or result ) + set u=BlzGroupUnitAt(s__ResurrectionStone_g[r], i) + if ( GetOwningPlayer(u) == whichPlayer ) then + set result=true + endif + set u=null + set i=i + 1 + endloop + return result +endfunction + +function DeactivateResurrectionStone takes player whichPlayer,integer heroIndex returns nothing + local integer r= 0 + local integer playerId= GetPlayerId(whichPlayer) + local integer index= Index2D(playerId , heroIndex , MAX_HEROES) + local unit hero= GetPlayerHeroByIndex(whichPlayer , heroIndex) + if ( WoWReforgedResurrectionStone___heroResurrectionStones[index] != 0 ) then + set r=WoWReforgedResurrectionStone___heroResurrectionStones[index] + call GroupRemoveUnit(s__ResurrectionStone_g[r], hero) + if ( not ResurrectionStoneHasHeroOfPlayer(r , whichPlayer) ) then + call UnitShareVision(s__ResurrectionStone_u[r], whichPlayer, false) + endif + if ( BlzGroupGetSize(s__ResurrectionStone_g[r]) == 0 ) then + call SetUnitAnimation(s__ResurrectionStone_u[r], "stand") + endif + endif + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, "Deactivated Resurrection Stone.") + set hero=null +endfunction + +function WoWReforgedResurrectionStone___TriggerConditionActivate takes nothing returns boolean + local integer r= LoadInteger(WoWReforgedResurrectionStone___h, GetHandleId(GetTriggeringTrigger()), 0) + + return s__ResurrectionStone_u[r] == GetSellingUnit() +endfunction + +function WoWReforgedResurrectionStone___GetHeroIndex takes unit hero returns integer + local integer index= GetPlayerHeroIndex(GetOwningPlayer(hero) , hero) + if ( index == - 1 ) then + return 0 + endif + return index +endfunction + +function WoWReforgedResurrectionStone___TriggerActionActivate takes nothing returns nothing + local integer r= LoadInteger(WoWReforgedResurrectionStone___h, GetHandleId(GetTriggeringTrigger()), 0) + local unit hero= GetBuyingUnit() + local player owner= GetOwningPlayer(hero) + local integer playerId= GetPlayerId(owner) + local integer index= 0 + local item whichItem= GetSoldItem() + local integer itemTypeId= GetItemTypeId(whichItem) + local effect e= null + if ( itemTypeId == ITEM_ACTIVATE_RESURRECTION_STONE ) then + if ( IsPlayerHero(hero) ) then + set index=Index2D(playerId , WoWReforgedResurrectionStone___GetHeroIndex(hero) , MAX_HEROES) + if ( WoWReforgedResurrectionStone___heroResurrectionStones[index] != 0 ) then + call GroupRemoveUnit(s__ResurrectionStone_g[r], hero) + if ( not ResurrectionStoneHasHeroOfPlayer(r , owner) ) then + call UnitShareVision(s__ResurrectionStone_u[r], owner, false) + endif + if ( BlzGroupGetSize(s__ResurrectionStone_g[r]) == 0 ) then + call SetUnitAnimation(s__ResurrectionStone_u[r], "stand") + endif + endif + call GroupAddUnit(s__ResurrectionStone_g[r], hero) + set WoWReforgedResurrectionStone___heroResurrectionStones[index]=r + call UnitShareVision(s__ResurrectionStone_u[r], owner, true) + call SetUnitAnimation(s__ResurrectionStone_u[r], "stand alternate") + set e=AddSpecialEffect("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl", GetUnitX(s__ResurrectionStone_u[r]), GetUnitY(s__ResurrectionStone_u[r])) + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, "Activated Resurrection Stone.") + call PolledWait(2.0) + call DestroyEffect(e) + set e=null + else + call SimError(owner , "Only one of your heroes can activate the Resurrection Stone.") + endif + + call h__RemoveItem(whichItem) + elseif ( itemTypeId == ITEM_DEACTIVATE_RESURRECTION_STONE ) then + if ( IsPlayerHero(hero) ) then + call DeactivateResurrectionStone(owner , WoWReforgedResurrectionStone___GetHeroIndex(hero)) + else + call SimError(owner , "Only one of your heroes can activate the Resurrection Stone.") + endif + + call h__RemoveItem(whichItem) + endif + set whichItem=null + set hero=null + set owner=null +endfunction + +function AddResurrectionStone takes unit u,rect revivalRect,real facing returns integer + local integer r= s__ResurrectionStone__allocate() + set s__ResurrectionStone_u[r]=u + set s__ResurrectionStone_revivalRect[r]=revivalRect + set s__ResurrectionStone_facing[r]=facing + call TriggerRegisterAnyUnitEventBJ(s__ResurrectionStone_activationTrigger[r], EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(s__ResurrectionStone_activationTrigger[r], Condition(function WoWReforgedResurrectionStone___TriggerConditionActivate)) + call TriggerAddAction(s__ResurrectionStone_activationTrigger[r], function WoWReforgedResurrectionStone___TriggerActionActivate) + call SaveInteger(WoWReforgedResurrectionStone___h, GetHandleId(s__ResurrectionStone_activationTrigger[r]), 0, r) + call SaveInteger(WoWReforgedResurrectionStone___h, GetHandleId(u), 0, r) + + return r +endfunction + +function AddResurrectionStoneWoWReforged takes nothing returns nothing + call AddResurrectionStone(udg_TmpUnit , udg_TmpRect , udg_TmpReal) +endfunction + +function WoWReforgedResurrectionStone___TimerFunctionResurrect takes nothing returns nothing + local integer index= LoadInteger(WoWReforgedResurrectionStone___h, GetHandleId(GetExpiredTimer()), 0) + local integer playerId= LoadInteger(WoWReforgedResurrectionStone___h, GetHandleId(GetExpiredTimer()), 1) + local integer i= LoadInteger(WoWReforgedResurrectionStone___h, GetHandleId(GetExpiredTimer()), 2) + local integer r= WoWReforgedResurrectionStone___heroResurrectionStones[index] + local real x= GetRectCenterX(s__ResurrectionStone_revivalRect[r]) + local real y= GetRectCenterY(s__ResurrectionStone_revivalRect[r]) + local unit hero= GetPlayerHeroByIndex(Player(playerId) , i) + call ReviveHero(hero, x, y, true) + call SetUnitFacing(hero, s__ResurrectionStone_facing[r]) + call PingMinimapForPlayer(Player(playerId), x, y, 6.0) + call SetUnitAnimation(s__ResurrectionStone_u[r], "stand alternate") +endfunction + +function WoWReforgedResurrectionStone___TriggerConditionDeath takes nothing returns boolean + local player owner= GetOwningPlayer(GetTriggerUnit()) + local integer r= 0 + local integer index= 0 + if ( IsPlayerHero(GetTriggerUnit()) ) then + set index=Index2D(GetPlayerId(owner) , WoWReforgedResurrectionStone___GetHeroIndex(GetTriggerUnit()) , MAX_HEROES) + set r=WoWReforgedResurrectionStone___heroResurrectionStones[index] + if ( r != 0 ) then + call TimerStart(WoWReforgedResurrectionStone___heroResurrectionTimers[index], RESURRECTION_TIME, false, function WoWReforgedResurrectionStone___TimerFunctionResurrect) + call SetUnitAnimation(s__ResurrectionStone_u[r], "stand work") + endif + endif + set owner=null + return false +endfunction + +function WoWReforgedResurrectionStone___TriggerConditionReviveStart takes nothing returns boolean + local integer r= 0 + local integer index= 0 + if ( IsPlayerHero(GetRevivingUnit()) ) then + set index=Index2D(GetPlayerId(GetOwningPlayer(GetRevivingUnit())) , WoWReforgedResurrectionStone___GetHeroIndex(GetRevivingUnit()) , MAX_HEROES) + call PauseTimer(WoWReforgedResurrectionStone___heroResurrectionTimers[index]) + set r=WoWReforgedResurrectionStone___heroResurrectionStones[index] + if ( r != 0 ) then + call SetUnitAnimation(s__ResurrectionStone_u[r], "stand alternate") + endif + endif + return false +endfunction + +function WoWReforgedResurrectionStone___TriggerConditionChat takes nothing returns boolean + local string msg= GetEventPlayerChatString() + if ( msg == "-noresurrect" ) then + if ( (udg_Hero[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! + call DeactivateResurrectionStone(GetTriggerPlayer() , 0) + endif + if ( (udg_Hero2[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! + call DeactivateResurrectionStone(GetTriggerPlayer() , 1) + endif + if ( (udg_Hero3[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! + call DeactivateResurrectionStone(GetTriggerPlayer() , 2) + endif + elseif ( msg == "-noresurrect1" ) then + if ( (udg_Hero[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! + call DeactivateResurrectionStone(GetTriggerPlayer() , 0) + else + call SimError(GetTriggerPlayer() , "No hero 1.") + endif + elseif ( msg == "-noresurrect2" ) then + if ( (udg_Hero2[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! + call DeactivateResurrectionStone(GetTriggerPlayer() , 1) + else + call SimError(GetTriggerPlayer() , "No hero 2.") + endif + elseif ( msg == "-noresurrect3" ) then + if ( (udg_Hero3[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! + call DeactivateResurrectionStone(GetTriggerPlayer() , 2) + else + call SimError(GetTriggerPlayer() , "No hero 3.") + endif + endif + return false +endfunction + +function WoWReforgedResurrectionStone___Init takes nothing returns nothing + local integer i= 0 + local integer j= 0 + local integer index= 0 + local player slotPlayer= null + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + set j=0 + loop + exitwhen ( j == MAX_HEROES ) + set index=Index2D(i , j , MAX_HEROES) + set WoWReforgedResurrectionStone___heroResurrectionTimers[index]=CreateTimer() + call SaveInteger(WoWReforgedResurrectionStone___h, GetHandleId(WoWReforgedResurrectionStone___heroResurrectionTimers[index]), 0, index) + call SaveInteger(WoWReforgedResurrectionStone___h, GetHandleId(WoWReforgedResurrectionStone___heroResurrectionTimers[index]), 1, i) + call SaveInteger(WoWReforgedResurrectionStone___h, GetHandleId(WoWReforgedResurrectionStone___heroResurrectionTimers[index]), 2, j) + set WoWReforgedResurrectionStone___heroResurrectionStones[index]=0 + set j=j + 1 + endloop + call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone___chatTrigger, slotPlayer, "-noresurrect", true) + call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone___chatTrigger, slotPlayer, "-noresurrect1", true) + call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone___chatTrigger, slotPlayer, "-noresurrect2", true) + call TriggerRegisterPlayerChatEvent(WoWReforgedResurrectionStone___chatTrigger, slotPlayer, "-noresurrect3", true) + set slotPlayer=null + set i=i + 1 + endloop + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedResurrectionStone___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedResurrectionStone___deathTrigger, Condition(function WoWReforgedResurrectionStone___TriggerConditionDeath)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedResurrectionStone___reviveTrigger, EVENT_PLAYER_HERO_REVIVE_START) + call TriggerAddCondition(WoWReforgedResurrectionStone___reviveTrigger, Condition(function WoWReforgedResurrectionStone___TriggerConditionReviveStart)) + + call TriggerAddCondition(WoWReforgedResurrectionStone___chatTrigger, Condition(function WoWReforgedResurrectionStone___TriggerConditionChat)) +endfunction + + +//library WoWReforgedResurrectionStone ends +//library WoWReforgedSkins: + + +function GetMaxSkins takes nothing returns integer + return WoWReforgedSkins__skinCounter +endfunction + +function AddSkin takes integer itemTypeId,integer unitTypeId returns integer + local integer index= WoWReforgedSkins__skinCounter + set WoWReforgedSkins__skinItemTypeId[index]=itemTypeId + set WoWReforgedSkins__skinUnitTypeId[index]=unitTypeId + set WoWReforgedSkins__skinCounter=WoWReforgedSkins__skinCounter + 1 + return index +endfunction + +function GetSkinItemTypeId takes integer index returns integer + return WoWReforgedSkins__skinItemTypeId[index] +endfunction + +function GetSkinUnitTypeId takes integer index returns integer + return WoWReforgedSkins__skinUnitTypeId[index] +endfunction + +function AddSkinWoWReforged takes nothing returns integer + return AddSkin(udg_TmpItemTypeId , udg_TmpUnitType) +endfunction + +function GetSkinByItemTypeId takes integer itemTypeId returns integer + local integer result= - 1 + local integer i= 0 + loop + exitwhen ( i == WoWReforgedSkins__skinCounter ) + if ( WoWReforgedSkins__skinItemTypeId[i] == itemTypeId ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function IsCustomizableHero takes integer unitTypeId returns boolean + return unitTypeId == VOID_LORD_RANGE_STRENGTH or unitTypeId == VOID_LORD_RANGE_AGILITY or unitTypeId == VOID_LORD_RANGE_INTELLIGENCE or unitTypeId == VOID_LORD_MELEE_STRENGTH or unitTypeId == VOID_LORD_MELEE_AGILITY or unitTypeId == VOID_LORD_MELEE_INTELLIGENCE or unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE or unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE or unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE or unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE or unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE or unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE +endfunction + +function WoWReforgedSkins__GetRandomSkinForPlayer takes player whichPlayer returns integer + local integer array availableSkins + local integer availableSkinsCounter= 0 + local integer i= 0 + loop + exitwhen ( i == WoWReforgedSkins__skinCounter ) + if ( PlayerHasUnlocked(whichPlayer , (WoWReforgedSkins__skinUnitTypeId[(i)])) ) then // INLINED!! + set availableSkins[availableSkinsCounter]=(WoWReforgedSkins__skinUnitTypeId[(i)]) // INLINED!! + set availableSkinsCounter=availableSkinsCounter + 1 + endif + set i=i + 1 + endloop + return availableSkins[GetRandomInt(0, availableSkinsCounter - 1)] +endfunction + +function RandomizeHeroSkin takes unit hero returns boolean + local integer unitTypeId= GetUnitTypeId(hero) + local player owner= GetOwningPlayer(hero) + if ( IsCustomizableHero(unitTypeId) ) then + call BlzSetUnitSkin(hero, WoWReforgedSkins__GetRandomSkinForPlayer(owner)) + + return true + else + call SimError(owner , "Only customizable heroes can change their skin.") + endif + + set owner=null + + return false +endfunction + +function WoWReforgedSkins__AddSkinsShop takes unit shop returns nothing + local integer i= 0 + //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + call EnablePagedButtons(shop) + loop + exitwhen ( i >= WoWReforgedSkins__skinCounter ) +call AddPagedButtonsId((shop ) , ( (WoWReforgedSkins__skinItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + //call BJDebugMsg("Skill " + I2S(i)) // Stops at 189 + set i=i + 1 + endloop + //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + + //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") +endfunction + +function WoWReforgedSkins__TriggerAction1SellItem takes nothing returns nothing + local unit shop= GetSellingUnit() + local unit hero= GetBuyingUnit() + local player owner= GetOwningPlayer(hero) + local integer unitTypeId= GetUnitTypeId(hero) + local item whichItem= GetSoldItem() + local integer itemTypeId= GetItemTypeId(whichItem) + local integer shopUnitTypeId= GetUnitTypeId(shop) + local integer index= GetSkinByItemTypeId(itemTypeId) + if ( index != - 1 ) then + if ( IsCustomizableHero(unitTypeId) ) then + if ( PlayerHasUnlocked(owner , (WoWReforgedSkins__skinUnitTypeId[(index)])) ) then // INLINED!! + call BlzSetUnitSkin(hero, (WoWReforgedSkins__skinUnitTypeId[(index)])) // INLINED!! + call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Chaned skin to " + GetObjectName((WoWReforgedSkins__skinUnitTypeId[(index)]))) // INLINED!! + else + call SimError(owner , "Skin is restricted to certain accounts: " + GetAllUnlockedAccountNames((WoWReforgedSkins__skinUnitTypeId[(index)]))) // INLINED!! + endif + else + call SimError(owner , "Only customizable heroes can change their skin.") + endif + call h__RemoveItem(whichItem) + endif + set whichItem=null + set shop=null + set hero=null + set owner=null +endfunction + +function WoWReforgedSkins__TriggerConditionConstructed takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == SKINS ) then + call WoWReforgedSkins__AddSkinsShop(GetConstructedStructure()) + endif + return false +endfunction + +function WoWReforgedSkins__TriggerConditionSummoned takes nothing returns boolean + if ( GetUnitTypeId(GetSummonedUnit()) == SKINS ) then + call WoWReforgedSkins__AddSkinsShop(GetSummonedUnit()) + endif + return false +endfunction + +function WoWReforgedSkins__TriggerConditionDeath takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == SKINS ) then + // TODO Disable shop manually? + //call ClearSkillsShop(GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedSkins__ForGroupEnableShop takes nothing returns nothing + call WoWReforgedSkins__AddSkinsShop(GetEnumUnit()) +endfunction + +function WoWReforgedSkins__FilterBuilding takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == SKINS_NEUTRAL +endfunction + +function WoWReforgedSkins__UpdateAllShops takes nothing returns nothing + local group g= CreateGroup() + + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedSkins__FilterBuilding)) + call ForGroup(g, function WoWReforgedSkins__ForGroupEnableShop) + + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function WoWReforgedSkins__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddAction(WoWReforgedSkins__sellTrigger, function WoWReforgedSkins__TriggerAction1SellItem) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedSkins__constructionTrigger, Condition(function WoWReforgedSkins__TriggerConditionConstructed)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedSkins__summonTrigger, Condition(function WoWReforgedSkins__TriggerConditionSummoned)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkins__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedSkins__deathTrigger, Condition(function WoWReforgedSkins__TriggerConditionDeath)) + + call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedSkins__UpdateAllShops) +endfunction + + +//library WoWReforgedSkins ends +//library WoWReforgedSummonedUnits: + + +function SelectNextSummonedUnit takes player whichPlayer returns unit + local unit result= GetNextUnitToSelect(WoWReforgedSummonedUnits___summonedUnits[GetPlayerId(whichPlayer)] , whichPlayer) + + if ( result != null ) then + call SelectUnitForPlayerSingle(result, whichPlayer) + call SmartCameraPanToUnit(whichPlayer , result , 0.0) + else + call SimError(whichPlayer , "No summoned unit.") + endif + + return result +endfunction + +function AddSummonedUnit takes unit whichUnit returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(whichUnit)) + call GroupAddUnit(WoWReforgedSummonedUnits___summonedUnits[playerId], whichUnit) +endfunction + +function WoWReforgedSummonedUnits___TriggerConditionSummon takes nothing returns boolean + local integer playerId= GetPlayerId(GetOwningPlayer(GetSummonedUnit())) + call GroupAddUnit(WoWReforgedSummonedUnits___summonedUnits[playerId], GetSummonedUnit()) + return false +endfunction + +function WoWReforgedSummonedUnits___TriggerConditionDeath takes nothing returns boolean + local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedSummonedUnits___summonedUnits[playerId]) ) then + call GroupRemoveUnit(WoWReforgedSummonedUnits___summonedUnits[playerId], GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedSummonedUnits___TriggerConditionChangeOwner takes nothing returns boolean + local integer sourcePlayerId= GetPlayerId(GetChangingUnitPrevOwner()) + local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedSummonedUnits___summonedUnits[sourcePlayerId]) ) then + call GroupRemoveUnit(WoWReforgedSummonedUnits___summonedUnits[sourcePlayerId], GetTriggerUnit()) + call GroupAddUnit(WoWReforgedSummonedUnits___summonedUnits[playerId], GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedSummonedUnits___Init takes nothing returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set WoWReforgedSummonedUnits___summonedUnits[i]=CreateGroup() + set i=i + 1 + endloop + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSummonedUnits___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedSummonedUnits___summonTrigger, Condition(function WoWReforgedSummonedUnits___TriggerConditionSummon)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSummonedUnits___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedSummonedUnits___deathTrigger, Condition(function WoWReforgedSummonedUnits___TriggerConditionDeath)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSummonedUnits___changeOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) + call TriggerAddCondition(WoWReforgedSummonedUnits___changeOwnerTrigger, Condition(function WoWReforgedSummonedUnits___TriggerConditionChangeOwner)) +endfunction + +function WoWReforgedSummonedUnits___RemoveUnitHook takes unit whichUnit returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(whichUnit)) + if ( IsUnitInGroup(whichUnit, WoWReforgedSummonedUnits___summonedUnits[playerId]) ) then + call GroupRemoveUnit(WoWReforgedSummonedUnits___summonedUnits[playerId], whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit WoWReforgedSummonedUnits___RemoveUnitHook + + + +//library WoWReforgedSummonedUnits ends +//library WoWReforgedVIPs: + + +function GetVIPPlayers takes nothing returns force + return WoWReforgedVIPs__vipPlayers +endfunction + +function GetNonVIPPlayers takes nothing returns force + local force result= CreateForce() + local integer i= 0 + loop + exitwhen ( i >= bj_MAX_PLAYERS ) + if ( not IsPlayerInForce(Player(i), WoWReforgedVIPs__vipPlayers) ) then + call ForceAddPlayer(result, Player(i)) + endif + set i=i + 1 + endloop + return result +endfunction + +function IsAccountVIP takes string account returns boolean + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedVIPs__vipCounter ) + if ( StringCase(WoWReforgedVIPs__vips[i], false) == StringCase(account, false) ) then + return true + endif + set i=i + 1 + endloop + return false +endfunction + +function IsPlayerVIP takes player whichPlayer returns boolean + return IsPlayerInForce(whichPlayer, WoWReforgedVIPs__vipPlayers) +endfunction + +function WelcomeVIP takes player whichPlayer returns nothing + call QuestMessageForPlayer(whichPlayer , bj_QUESTMESSAGE_ALWAYSHINT , "Welcome " + GetPlayerNameColored(whichPlayer) + "! You are an official VIP member of this map.") +endfunction + +function WelcomeVIPs takes nothing returns nothing + local force nonVipPlayers= GetNonVIPPlayers() + local string txt= null + local integer i= 0 + loop + exitwhen ( i >= bj_MAX_PLAYERS ) + if ( (IsPlayerInForce((Player(i)), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! + if ( txt != null ) then + set txt=txt + ", " + endif + set txt=txt + GetPlayerNameColored(Player(i)) + call WelcomeVIP(Player(i)) + endif + set i=i + 1 + endloop + if ( txt != null ) then + call h__QuestMessageBJ(nonVipPlayers, bj_QUESTMESSAGE_ALWAYSHINT, "Welcome the VIPS: " + txt + " !") + call PlaySoundBJ(gg_snd_UtherReturns) + endif + call ForceClear(nonVipPlayers) + call DestroyForce(nonVipPlayers) + set nonVipPlayers=null +endfunction + +function UpdateResearchesForVIP takes player whichPlayer returns nothing + call h__SetPlayerTechResearched(whichPlayer, 'R04Y', 1) + call h__SetPlayerTechResearched(whichPlayer, 'R06B', 1) + call h__SetPlayerTechResearched(whichPlayer, 'R06C', 1) +endfunction + +function GetVIPsInfoText takes nothing returns string + local string text= "VIPS:" + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedVIPs__vipCounter ) + set text=text + "\n- " + WoWReforgedVIPs__vips[i] + set i=i + 1 + endloop + return text +endfunction + +function DisplayVIPs takes player to returns nothing + local string text= GetVIPsInfoText() + call h__DisplayTimedTextToPlayer(to, 0.0, 0.0, 6.0, text) +endfunction + +function WoWReforgedVIPs__AddVIP takes string vip returns integer + local integer index= WoWReforgedVIPs__vipCounter + set WoWReforgedVIPs__vips[index]=vip + set WoWReforgedVIPs__vipCounter=WoWReforgedVIPs__vipCounter + 1 + + return index +endfunction + +// Shame on you for adding yourself here! +function WoWReforgedVIPs__InitVIPs takes nothing returns nothing + call WoWReforgedVIPs__AddVIP("Barade#2569") + call WoWReforgedVIPs__AddVIP("Barade") + call WoWReforgedVIPs__AddVIP("WorldEdit") + call WoWReforgedVIPs__AddVIP("Runeblade14") + call WoWReforgedVIPs__AddVIP("Runeblade14#2451") + call WoWReforgedVIPs__AddVIP("Antidenseman#1202") + call WoWReforgedVIPs__AddVIP("Chaoskrieger#21738") +endfunction + +function SyncVIPsFromPlayers takes nothing returns nothing + local boolean isVip= false + local integer i= 0 + loop + exitwhen ( i >= bj_MAX_PLAYERS ) + set isVip=IsAccountVIP(GetPlayerName(Player(i))) + set udg_VIPOnForPlayer[i + 1]=isVip + if ( isVip ) then + call ForceAddPlayer(WoWReforgedVIPs__vipPlayers, Player(i)) + call UpdateResearchesForVIP(Player(i)) + endif + set i=i + 1 + endloop + call WelcomeVIPs() +endfunction + +function WoWReforgedVIPs__Init takes nothing returns nothing + call WoWReforgedVIPs__InitVIPs() +endfunction + + +//library WoWReforgedVIPs ends +//library WowReforgedRespawnUtils: + +// Call after game time has elapsed and the preplaced groups have been created. +function InitUnitRespawns takes nothing returns nothing + local integer groupIndex= - 1 + local integer i= 0 + loop + exitwhen ( i >= (UnitGroupRespawnSystem__respawnUnitCounter) ) // INLINED!! + if ( IsRespawnUnitValid(i) and (UnitGroupRespawnSystem__respawnUnitOwner[(i)]) != null and (UnitGroupRespawnSystem__respawnUnitOwner[(i)]) == udg_Gaia ) then // INLINED!! + set UnitGroupRespawnSystem__respawnUnitTimeout[(i )]=(( 300.0)*1.0) // INLINED!! + set groupIndex=(UnitGroupRespawnSystem__respawnUnitGroupIndex[(i)]) // INLINED!! + if ( IsRespawnUnitGroupValid(groupIndex) ) then + set UnitGroupRespawnSystem__respawnUnitGroupItemDropEnabled[(groupIndex )]=( false) // INLINED!! + endif + endif + set i=i + 1 + endloop +endfunction + +function GetRespawnBuildingSize takes nothing returns real + return 1400.0 +endfunction + +function GetRespawnGroupOfDestructable takes destructable whichDestructable returns integer + if ( (HaveSavedInteger(udg_DB, GetHandleId((whichDestructable )), ( 0))) ) then // INLINED!! + return (LoadInteger(udg_DB, GetHandleId((whichDestructable )), ( 0))) // INLINED!! + endif + return - 1 +endfunction + +function FilterFunctionIsBuilding takes nothing returns boolean + local unit filterUnit= GetFilterUnit() + local player owner= GetOwningPlayer(filterUnit) + local boolean result= IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and owner != Player(PLAYER_NEUTRAL_AGGRESSIVE) and owner != Player(PLAYER_NEUTRAL_PASSIVE) and owner != udg_TheBurningLegion + set owner=null + set filterUnit=null + return result +endfunction + +function RespawnRectContainsNoBuilding takes location respawnCenter returns boolean + local group BuildingGroup= GetUnitsInRangeOfLocMatching((1400.0), respawnCenter, Filter(function FilterFunctionIsBuilding)) // INLINED!! + set bj_wantDestroyGroup=true + return IsUnitGroupEmptyBJ(BuildingGroup) +endfunction + +function RespawnAllGroupsInRange takes real x,real y,real range returns integer + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i == (UnitGroupRespawnSystem__respawnUnitCounter) ) // INLINED!! + if ( IsRespawnUnitValid(i) and DistanceBetweenCoordinates(x , y , (UnitGroupRespawnSystem__respawnUnitX[(i)]) , (UnitGroupRespawnSystem__respawnUnitY[(i)])) <= range ) then // INLINED!! + call RespawnUnit(i) + set result=result + 1 + endif + set i=i + 1 + endloop + return result +endfunction + +function RespawnAllItemsInRange takes real x,real y,real range returns integer + local integer result= 0 + local integer i= 0 + loop + exitwhen ( i == (ItemRespawnSystem__respawnItemCounter) ) // INLINED!! + if ( IsRespawnItemValid(i) and (ItemRespawnSystem__respawnItemItem[(i)]) == null and DistanceBetweenCoordinates(x , y , (ItemRespawnSystem__respawnItemX[(i)]) , (ItemRespawnSystem__respawnItemY[(i)])) <= range ) then // INLINED!! + call RespawnItem(i) + set result=result + 1 + endif + set i=i + 1 + endloop + return result +endfunction + +function HookAddUnitToGroup takes unit whichUnit,group whichGroup returns nothing + set udg_LastAddedUnitToGroup=whichUnit +endfunction + +//processed hook: hook GroupAddUnitSimple HookAddUnitToGroup + + +//library WowReforgedRespawnUtils ends +//library WoWReforgedAiPlayersUi: + + + +function WoWReforgedAiPlayersUi___UpdateComputerPlayersTitle takes nothing returns nothing + call BlzFrameSetText(WoWReforgedAiPlayersUi___TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi___Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi___MaxPages) + ")") +endfunction + +function GetAiPlayersWithConfig takes nothing returns force + local player aiPlayer= null + local force result= CreateForce() + local integer i= 0 + loop + exitwhen ( i >= bj_MAX_PLAYERS ) + set aiPlayer=Player(i) + if ( GetPlayerController(aiPlayer) == MAP_CONTROL_COMPUTER and GetPlayerSlotState(aiPlayer) == PLAYER_SLOT_STATE_PLAYING and GetMapAllowConfigureAIPlayer(aiPlayer) and aiPlayer != udg_BossesPlayer ) then + call ForceAddPlayer(result, aiPlayer) + endif + set aiPlayer=null + set i=i + 1 + endloop + return result +endfunction + +function CountAiPlayersWithConfig takes nothing returns integer + local force aiPlayers= GetAiPlayersWithConfig() + local integer result= CountPlayersInForceBJ(aiPlayers) + call ForceClear(aiPlayers) + call DestroyForce(aiPlayers) + set aiPlayers=null + return result +endfunction + +function WoWReforgedAiPlayersUi___SetVisible takes boolean visible returns nothing + local integer currentPage= WoWReforgedAiPlayersUi___Page + local integer counterStart= currentPage * AI_PLAYERS_UI_MAX_PLAYERS + local integer counterEnd= counterStart + AI_PLAYERS_UI_MAX_PLAYERS - 1 + local integer counter= 0 + local integer i= 0 + + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___BackgroundFrame, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___TitleFrame, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerName, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnColor, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnTeam, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHero, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevel, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocation, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnRace, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnProfession, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartGold, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumber, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimit, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolution, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayers, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroes, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnExpansions, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControl, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnDifficulty, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___ApplyButton, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___PreviousPageButton, visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___NextPageButton, visible) + + set i=0 + loop + exitwhen ( i >= bj_MAX_PLAYERS ) + if ( IsPlayerInForce(Player(i), WoWReforgedAiPlayersUi___Force) ) then + if ( ( visible and counter >= counterStart and counter <= counterEnd ) or not visible ) then + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUpFrame[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDownFrame[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUpFrame[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDownFrame[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUpFrame[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDownFrame[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox[counter], visible) + call BlzFrameSetVisible(WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit[counter], visible) + endif + + set counter=counter + 1 + endif + set i=i + 1 + endloop +endfunction + +function SetAiPlayersUiVisibleForPlayer takes player whichPlayer,boolean visible returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call WoWReforgedAiPlayersUi___SetVisible(visible) + endif +endfunction + +function ShowAiPlayersUiForPlayer takes player whichPlayer returns nothing + call SetAiPlayersUiVisibleForPlayer(whichPlayer , true) +endfunction + +function HideAiPlayersUiForPlayer takes player whichPlayer returns nothing + call SetAiPlayersUiVisibleForPlayer(whichPlayer , false) +endfunction + +function HideAiPlayersUi takes nothing returns nothing + call WoWReforgedAiPlayersUi___SetVisible(false) +endfunction + +function WoWReforgedAiPlayersUi___TriggerActionSyncData takes nothing returns nothing + local player triggerPlayer= GetTriggerPlayer() + local string prefix= BlzGetTriggerSyncPrefix() + local string data= BlzGetTriggerSyncData() + local integer playerId= GetPlayerId(triggerPlayer) + local string indexString= StringTokenEx(data , 1 , "_" , false) + local integer index= S2I(indexString) + local string actualData= StringTokenEx(data , 2 , "_" , false) + //call BJDebugMsg("Synced data " + data + " with prefix " + prefix + " leading to index " + I2S(index) + " and actual data: " + actualData + ".") + if ( data == "Done" ) then + set WoWReforgedAiPlayersUi___SyncDone[playerId]=true + //call BJDebugMsg("Synced done") + elseif ( StringStartsWith(data , "PlayerName") ) then + set WoWReforgedAiPlayersUi___PlayerNames[index]=actualData + elseif ( StringStartsWith(data , "Color") ) then + set WoWReforgedAiPlayersUi___Color[index]=S2I(actualData) + elseif ( StringStartsWith(data , "Team") ) then + set WoWReforgedAiPlayersUi___Teams[index]=S2I(actualData) + elseif ( StringStartsWith(data , "HeroStartLevel") ) then + set WoWReforgedAiPlayersUi___HeroStartLevels[index]=S2I(actualData) + elseif ( StringStartsWith(data , "StartHero") ) then + set WoWReforgedAiPlayersUi___Heroes[index]=S2I(actualData) + elseif ( StringStartsWith(data , "StartLocation") ) then + set WoWReforgedAiPlayersUi___StartLocations[index]=S2I(actualData) + elseif ( StringStartsWith(data , "Races") ) then + set WoWReforgedAiPlayersUi___Races[index]=S2I(actualData) + elseif ( StringStartsWith(data , "Profession") ) then + set WoWReforgedAiPlayersUi___Professions[index]=S2I(actualData) + elseif ( StringStartsWith(data , "StartGold") ) then + set WoWReforgedAiPlayersUi___StartGold[index]=S2I(actualData) + elseif ( StringStartsWith(data , "StartLumber") ) then + set WoWReforgedAiPlayersUi___StartLumber[index]=S2I(actualData) + elseif ( StringStartsWith(data , "FoodLimit") ) then + set WoWReforgedAiPlayersUi___FoodLimit[index]=S2I(actualData) + elseif ( StringStartsWith(data , "StartEvolution") ) then + set WoWReforgedAiPlayersUi___StartEvolution[index]=S2I(actualData) + elseif ( StringStartsWith(data , "AttackPlayers") ) then + set WoWReforgedAiPlayersUi___AttackPlayers[index]=S2I(actualData) + elseif ( StringStartsWith(data , "HeroesCount") ) then + set WoWReforgedAiPlayersUi___HeroesCount[index]=S2I(actualData) + elseif ( StringStartsWith(data , "Expansions") ) then + set WoWReforgedAiPlayersUi___Expansions[index]=S2I(actualData) + elseif ( StringStartsWith(data , "SharedControl") ) then + set WoWReforgedAiPlayersUi___SharedControl[index]=S2I(actualData) + elseif ( StringStartsWith(data , "Difficulty") ) then + set WoWReforgedAiPlayersUi___Difficulty[index]=S2I(actualData) + endif + set triggerPlayer=null +endfunction + +function WoWReforgedAiPlayersUi___SyncData takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer index= 0 + local integer counter= WoWReforgedAiPlayersUi___Counter + local integer i= 0 + loop + exitwhen ( i >= counter ) + set index=i + if ( GetLocalPlayer() == whichPlayer ) then + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "PlayerName_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "Color_" + I2S(index) + "_" + I2S(WoWReforgedAiPlayersUi___ColorLocal[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "Team_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit[index])))) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "StartHero_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index])))) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "HeroStartLevel_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "StartLocation_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit[index])))) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "Races_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index])))) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "Profession_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit[index])))) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "StartGold_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "StartLumber_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "FoodLimit_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "StartEvolution_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "AttackPlayers_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox[index])))) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "HeroesCount_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "Expansions_" + I2S(index) + "_" + BlzFrameGetText(WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "SharedControl_" + I2S(index) + "_" + I2S(WoWReforgedAiPlayersUi___SharedControlAsync[index])) + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "Difficulty_" + I2S(index) + "_" + I2S(R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit[index])))) + endif + set i=i + 1 + endloop + if ( GetLocalPlayer() == whichPlayer ) then + call BlzSendSyncData(WoWReforgedAiPlayersUi___PREFIX, "Done") + endif + // wait for sync is done + loop + exitwhen ( WoWReforgedAiPlayersUi___SyncDone[playerId] ) + call TriggerSleepAction(5.0) + //call BJDebugMsg("Polling") + endloop + set WoWReforgedAiPlayersUi___SyncDone[playerId]=false +endfunction + +function WoWReforgedAiPlayersUi___ApplyFunction takes nothing returns nothing + call SetAiPlayersUiVisibleForPlayer((GetTriggerPlayer()) , false) // INLINED!! + call WoWReforgedAiPlayersUi___SyncData(GetTriggerPlayer()) + set udg_TmpPlayer2=GetTriggerPlayer() + call ConditionalTriggerExecute(gg_trg_Computer_Start_Lobby_Settings) +endfunction + +function WoWReforgedAiPlayersUi___GetPlayerIndex takes player whichPlayer returns integer + local integer index= 0 + local integer i= 0 + loop + exitwhen ( i >= bj_MAX_PLAYERS ) + if ( IsPlayerInForce(Player(i), WoWReforgedAiPlayersUi___Force) ) then + if ( Player(i) == whichPlayer ) then + return index + else + set index=index + 1 + endif + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function AiPlayersUIGetPlayerName takes player whichPlayer returns string + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___PlayerNames[index] + endif + + return GetPlayerName(whichPlayer) +endfunction + +function AiPlayersUIGetColor takes player whichPlayer returns playercolor + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + + if ( index != - 1 ) then + return ConvertPlayerColor(WoWReforgedAiPlayersUi___Color[index]) + endif + + return GetPlayerColor(whichPlayer) +endfunction + +function AiPlayersUIGetTeam takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___Teams[index] + endif + + return GetPlayerTeam(whichPlayer) +endfunction + +function AiPlayersUIGetHero takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + local integer frameValue= 0 + + if ( index != - 1 ) then + set frameValue=WoWReforgedAiPlayersUi___Heroes[index] + + if ( frameValue == AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM_MATCHING_RACE ) then + return ChooseRandomHeroFromRace(udg_PlayerRace[GetConvertedPlayerId(whichPlayer)]) + elseif ( frameValue == AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM ) then + return GetRandomInt(0, udg_MaxHeroUnitTypes - 1) + endif + endif + + return frameValue - AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM - 1 +endfunction + +function AiPlayersUIGetHeroStartLevel takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___HeroStartLevels[index] + endif + + return 1 +endfunction + +function AiPlayersUIChooseComputerStartLocation takes integer startIndex returns integer + local integer i= startIndex + loop + exitwhen ( i >= udg_Max_TownHalls ) + if ( not udg_ComputerStartLocationTaken[i] ) then + return i + endif + set i=i + 1 + endloop + if ( startIndex > 0 ) then + return AiPlayersUIChooseComputerStartLocation(0) + endif + return - 1 +endfunction + +function AiPlayersUIGetPlayerWarlord takes player whichPlayer returns boolean + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + local integer random= GetRandomInt(0, 1) + local integer frameValue= 0 + if ( index != - 1 and udg_AIFreelancers and udg_AIWarlords ) then + set frameValue=WoWReforgedAiPlayersUi___Races[index] + if ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM ) then + return random == 0 + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_FREELANCER ) then + return false + endif + + return AiPlayersUIChooseComputerStartLocation(0) > - 1 + endif + + return ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM and random == 0 ) or ( not udg_AIFreelancers and udg_AIWarlords ) and AiPlayersUIChooseComputerStartLocation(0) > - 1 +endfunction + +function GetRandomRaceWithAISupport takes nothing returns integer + local integer array r + local integer c= 0 + set r[c]=udg_RaceAllianceOfLordaeron + set c=c + 1 + set r[c]=udg_RaceOldHorde + set c=c + 1 + set r[c]=udg_RaceHuman + set c=c + 1 + set r[c]=udg_RaceBloodElf + set c=c + 1 + set r[c]=udg_RaceDwarf + set c=c + 1 + set r[c]=udg_RaceHighElf + set c=c + 1 + set r[c]=udg_RaceGnome + set c=c + 1 + set r[c]=udg_RaceTroll + set c=c + 1 + set r[c]=udg_RaceDraenei + set c=c + 1 + set r[c]=udg_RaceNightElf + set c=c + 1 + set r[c]=udg_RaceFurbolg + set c=c + 1 + set r[c]=udg_RaceDalaran + set c=c + 1 + set r[c]=udg_RaceKulTiras + set c=c + 1 + set r[c]=udg_RaceOrc + set c=c + 1 + set r[c]=udg_RaceUndead + set c=c + 1 + set r[c]=udg_RaceDemon + set c=c + 1 + set r[c]=udg_RaceNaga + set c=c + 1 + set r[c]=udg_RacePandaren + set c=c + 1 + set r[c]=udg_RaceVrykul + set c=c + 1 + set r[c]=udg_RaceLordaeron + set c=c + 1 + set r[c]=udg_RaceStormwind + set c=c + 1 + set r[c]=udg_RaceWorgen + set c=c + 1 + set r[c]=udg_RaceNerubian + set c=c + 1 + set r[c]=udg_RaceTuskarr + set c=c + 1 + set r[c]=udg_RaceOgre + set c=c + 1 + set r[c]=udg_RaceSatyr + set c=c + 1 + set r[c]=udg_RaceCentaur + set c=c + 1 + set r[c]=udg_RaceEredar + set c=c + 1 + set r[c]=udg_RaceFelOrc + set c=c + 1 + set r[c]=udg_RaceFacelessOne + set c=c + 1 + set r[c]=udg_RaceGnoll + set c=c + 1 + set r[c]=udg_RaceKobold + set c=c + 1 + set r[c]=udg_RaceQuillboar + set c=c + 1 + set r[c]=udg_RaceBandit + set c=c + 1 + set r[c]=udg_RaceDragonkin + set c=c + 1 + + return r[GetRandomInt(0, c - 1)] +endfunction + +function GetRandomAllianceRaceWithAISupport takes nothing returns integer + local integer array r + local integer c= 0 + set r[c]=udg_RaceAllianceOfLordaeron + set c=c + 1 + set r[c]=udg_RaceHuman + set c=c + 1 + set r[c]=udg_RaceDwarf + set c=c + 1 + set r[c]=udg_RaceHighElf + set c=c + 1 + set r[c]=udg_RaceGnome + set c=c + 1 + set r[c]=udg_RaceDraenei + set c=c + 1 + set r[c]=udg_RaceNightElf + set c=c + 1 + set r[c]=udg_RaceFurbolg + set c=c + 1 + set r[c]=udg_RaceDalaran + set c=c + 1 + set r[c]=udg_RaceKulTiras + set c=c + 1 + set r[c]=udg_RacePandaren + set c=c + 1 + set r[c]=udg_RaceVrykul + set c=c + 1 + set r[c]=udg_RaceLordaeron + set c=c + 1 + set r[c]=udg_RaceStormwind + set c=c + 1 + set r[c]=udg_RaceWorgen + set c=c + 1 + set r[c]=udg_RaceTuskarr + set c=c + 1 + set r[c]=udg_RaceEredar + set c=c + 1 + set r[c]=udg_RaceGnoll + set c=c + 1 + set r[c]=udg_RaceKobold + set c=c + 1 + set r[c]=udg_RaceQuillboar + set c=c + 1 + set r[c]=udg_RaceBandit + set c=c + 1 + set r[c]=udg_RaceDragonkin + set c=c + 1 + + return r[GetRandomInt(0, c - 1)] +endfunction + +function GetRandomHordeRaceWithAISupport takes nothing returns integer + local integer array r + local integer c= 0 + set r[c]=udg_RaceBloodElf + set c=c + 1 + set r[c]=udg_RaceTroll + set c=c + 1 + set r[c]=udg_RaceFurbolg + set c=c + 1 + set r[c]=udg_RaceOldHorde + set c=c + 1 + set r[c]=udg_RaceOrc + set c=c + 1 + set r[c]=udg_RaceUndead + set c=c + 1 + set r[c]=udg_RaceDemon + set c=c + 1 + set r[c]=udg_RaceNaga + set c=c + 1 + set r[c]=udg_RacePandaren + set c=c + 1 + set r[c]=udg_RaceNerubian + set c=c + 1 + set r[c]=udg_RaceTuskarr + set c=c + 1 + set r[c]=udg_RaceOgre + set c=c + 1 + set r[c]=udg_RaceSatyr + set c=c + 1 + set r[c]=udg_RaceCentaur + set c=c + 1 + set r[c]=udg_RaceEredar + set c=c + 1 + set r[c]=udg_RaceFelOrc + set c=c + 1 + set r[c]=udg_RaceFacelessOne + set c=c + 1 + set r[c]=udg_RaceGnoll + set c=c + 1 + set r[c]=udg_RaceKobold + set c=c + 1 + set r[c]=udg_RaceQuillboar + set c=c + 1 + set r[c]=udg_RaceDragonkin + set c=c + 1 + + return r[GetRandomInt(0, c - 1)] +endfunction + +function AiPlayersUIGetPlayerRace takes player whichPlayer,integer startLocation returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + local integer frameValue= 0 + local integer random= 0 + local race whichRace= GetPlayerRace(whichPlayer) + + if ( index != - 1 ) then + set frameValue=WoWReforgedAiPlayersUi___Races[index] + //constant integer AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM = 1 + if ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_MATCHING_START_LOCATION ) then + return udg_TownHallRace[startLocation] + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_WARLORD ) then + return GetRandomRaceWithAISupport() + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_ALLIANCE ) then + return GetRandomAllianceRaceWithAISupport() + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_RANDOM_HORDE ) then + return GetRandomHordeRaceWithAISupport() + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_OLD_HORDE ) then + return udg_RaceOldHorde + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_ALLIANCE ) then + return udg_RaceAllianceOfLordaeron + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_HUMAN ) then + return udg_RaceHuman + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_ORC ) then + return udg_RaceOrc + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_UNDEAD ) then + return udg_RaceUndead + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_NIGHT_ELF ) then + return udg_RaceNightElf + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_BLOOD_ELF ) then + return udg_RaceBloodElf + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_NAGA ) then + return udg_RaceNaga + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DRAENEI ) then + return udg_RaceDraenei + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DEMON ) then + return udg_RaceDemon + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_FURBOLG ) then + return udg_RaceFurbolg + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DWARF ) then + return udg_RaceDwarf + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_GOBLIN ) then + return udg_RaceGoblin + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_HIGH_ELF ) then + return udg_RaceHighElf + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_GNOME ) then + return udg_RaceGnome + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DALARAN ) then + return udg_RaceDalaran + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_KUL_TIRAS ) then + return udg_RaceKulTiras + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_LORDAERON ) then + return udg_RaceLordaeron + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_STORMWIND ) then + return udg_RaceStormwind + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_PANDAREN ) then + return udg_RacePandaren + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_TROLL ) then + return udg_RaceTroll + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_TAUREN ) then + return udg_RaceTauren + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_VRYKUL ) then + return udg_RaceVrykul + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_TUSKARR ) then + return udg_RaceTuskarr + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_MURLOC ) then + return udg_RaceMurloc + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_OGRE ) then + return udg_RaceOgre + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_EREDAR ) then + return udg_RaceEredar + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_FEL_ORC ) then + return udg_RaceFelOrc + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_FACELESS_ONE ) then + return udg_RaceFacelessOne + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_SATYR ) then + return udg_RaceSatyr + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_CENTAUR ) then + return udg_RaceCentaur + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_GNOLL ) then + return udg_RaceGnoll + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_KOBOLD ) then + return udg_RaceKobold + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_QUILLBOAR ) then + return udg_RaceQuillboar + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_BANDIT ) then + return udg_RaceBandit + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DUNGEON ) then + return udg_RaceDungeon + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_DRAGONKIN ) then + return udg_RaceDragonkin + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_NERUBIAN ) then + return udg_RaceNerubian + elseif ( frameValue == AI_PLAYERS_UI_RACES_MENU_ITEM_WORGEN ) then + return udg_RaceWorgen + endif + endif + + // use player lobby settings instead + if ( whichRace == RACE_HUMAN ) then + set random=GetRandomInt(0, 6) + if ( random == 0 ) then + return udg_RaceAllianceOfLordaeron + elseif ( random == 1 ) then + return udg_RaceHuman + elseif ( random == 2 ) then + return udg_RaceBloodElf + elseif ( random == 3 ) then + return udg_RaceDwarf + elseif ( random == 4 ) then + return udg_RaceHighElf + elseif ( random == 5 ) then + return udg_RaceDalaran + else + return udg_RaceKulTiras + endif + elseif ( whichRace == RACE_ORC ) then + set random=GetRandomInt(0, 3) + if ( random == 0 ) then + return udg_RaceOldHorde + elseif ( random == 1 ) then + return udg_RaceOrc + elseif ( random == 2 ) then + return udg_RaceDraenei + else + return udg_RaceGoblin + endif + elseif ( whichRace == RACE_UNDEAD ) then + set random=GetRandomInt(0, 1) + if ( random == 0 ) then + return udg_RaceUndead + else + return udg_RaceDemon + endif + elseif ( whichRace == RACE_NIGHTELF ) then + set random=GetRandomInt(0, 2) + if ( random == 0 ) then + return udg_RaceNightElf + elseif ( random == 1 ) then + return udg_RaceNaga + else + return udg_RaceFurbolg + endif + endif + + return udg_RaceNone +endfunction + +function AiPlayersUIGetPlayerProfession takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + local integer frameValue= 0 + local race whichRace= GetPlayerRace(whichPlayer) + + if ( index != - 1 ) then + set frameValue=WoWReforgedAiPlayersUi___Professions[index] + if ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_HERBALIST ) then + return udg_ProfessionHerbalist + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ALCHEMIST ) then + return udg_ProfessionAlchemist + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_WEAPON_SMITH ) then + return udg_ProfessionWeaponSmith + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ARMORER ) then + return udg_ProfessionArmourer + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ENGINEER ) then + return udg_ProfessionEngineer + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_DRAGON_BREEDER ) then + return udg_ProfessionDragonBreeder + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_LORE_MASTER ) then + return udg_ProfessionLoreMaster + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_RUNE_FORGER ) then + return udg_ProfessionRuneforger + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_SORCERER ) then + return udg_ProfessionSorcerer + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_JEWELCRAFTER ) then + return udg_ProfessionJewelcrafter + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ARCHAEOLOGIST ) then + return udg_ProfessionArchaeologist + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_WITCH_DOCTOR ) then + return udg_ProfessionWitchDoctor + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_TAMER ) then + return udg_ProfessionTamer + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_NECROMANCER ) then + return udg_ProfessionNecromancer + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_GOLEM_SCULPTOR ) then + return udg_ProfessionGolemSculptor + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_WARLOCK ) then + return udg_ProfessionWarlock + elseif ( frameValue == AI_PLAYERS_UI_PROFESSIONS_MENU_ITEM_ASTROMANCER ) then + return udg_ProfessionAstromancer + endif + endif + + return GetRandomProfession() +endfunction + +function AiPlayersUIGetStartLocation takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + local integer frameValue= 0 + + if ( index != - 1 ) then + set frameValue=WoWReforgedAiPlayersUi___StartLocations[index] + if ( frameValue == AI_PLAYERS_UI_START_LOCATION_MENU_ITEM_RANDOM ) then + return AiPlayersUIChooseComputerStartLocation(GetRandomInt(0, udg_Max_TownHalls - 1)) + else + return AiPlayersUIChooseComputerStartLocation(frameValue - 1) + endif + endif + + return AiPlayersUIChooseComputerStartLocation(0) +endfunction + +function AiPlayersUIGetStartGold takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___StartGold[index] + endif + + return AI_PLAYERS_UI_START_GOLD +endfunction + +function AiPlayersUIGetStartLumber takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___StartLumber[index] + endif + + return AI_PLAYERS_UI_START_LUMBER +endfunction + +function AiPlayersUIGetFoodLimit takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___FoodLimit[index] + endif + + return 300 +endfunction + +function AiPlayersUIGetStartEvolution takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___StartEvolution[index] + endif + + return 1 +endfunction + +function AiPlayersUIGetAttackPlayers takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___AttackPlayers[index] + endif + + return 1 +endfunction + +function AiPlayersUIGetHeroesCount takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___HeroesCount[index] + endif + + return 1 +endfunction + +function AiPlayersUIGetExpansions takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___Expansions[index] + endif + + return 1 +endfunction + +function AiPlayersUIGetSharedControl takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___SharedControl[index] + endif + + return 1 +endfunction + +function AiPlayersUIGetDifficulty takes player whichPlayer returns integer + local integer index= WoWReforgedAiPlayersUi___GetPlayerIndex(whichPlayer) + if ( index != - 1 ) then + return WoWReforgedAiPlayersUi___Difficulty[index] + endif + + return 1 // normal +endfunction + +function WoWReforgedAiPlayersUi___ColorPopupMenuFunction takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + + //call BJDebugMsg("Texture: " + GetPlayerColorTexture(ConvertPlayerColor(ColorLocal[index]))) + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + set WoWReforgedAiPlayersUi___ColorLocal[index]=R2I(BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index])) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((ConvertPlayerColor(WoWReforgedAiPlayersUi___ColorLocal[index]))) , 2)), 0, true) // INLINED!! + endif +endfunction + +function WoWReforgedAiPlayersUi___ColorUpFunction takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + + //call BJDebugMsg("Texture: " + GetPlayerColorTexture(ConvertPlayerColor(ColorLocal[index]))) + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( WoWReforgedAiPlayersUi___ColorLocal[index] == 0 ) then + set WoWReforgedAiPlayersUi___ColorLocal[index]=23 + else + set WoWReforgedAiPlayersUi___ColorLocal[index]=WoWReforgedAiPlayersUi___ColorLocal[index] - 1 + endif + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index], WoWReforgedAiPlayersUi___ColorLocal[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((ConvertPlayerColor(WoWReforgedAiPlayersUi___ColorLocal[index]))) , 2)), 0, true) // INLINED!! + endif + call PlayClickSound(GetTriggerPlayer()) +endfunction + +function WoWReforgedAiPlayersUi___ColorDownFunction takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + + //call BJDebugMsg("Texture: " + GetPlayerColorTexture(ConvertPlayerColor(ColorLocal[index]))) + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( WoWReforgedAiPlayersUi___ColorLocal[index] == 23 ) then + set WoWReforgedAiPlayersUi___ColorLocal[index]=0 + else + set WoWReforgedAiPlayersUi___ColorLocal[index]=WoWReforgedAiPlayersUi___ColorLocal[index] + 1 + endif + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index], WoWReforgedAiPlayersUi___ColorLocal[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((ConvertPlayerColor(WoWReforgedAiPlayersUi___ColorLocal[index]))) , 2)), 0, true) // INLINED!! + endif + call PlayClickSound(GetTriggerPlayer()) +endfunction + +function WoWReforgedAiPlayersUi___HeroUpFunction takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index]) == 0 ) then + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], AI_PLAYERS_UI_HEROES_MENU_ITEM_FINAL) + else + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index]) - 1) + endif + endif + + call PlayClickSound(GetTriggerPlayer()) +endfunction + +function WoWReforgedAiPlayersUi___HeroDownFunction takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index]) == AI_PLAYERS_UI_HEROES_MENU_ITEM_FINAL ) then + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], 0) + else + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index]) + 1) + endif + endif + + call PlayClickSound(GetTriggerPlayer()) +endfunction + +function WoWReforgedAiPlayersUi___RaceUpFunction takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index]) == 0 ) then + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], AI_PLAYERS_UI_RACES_MENU_ITEM_DRAGONKIN) + else + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index]) - 1) + endif + endif + + call PlayClickSound(GetTriggerPlayer()) +endfunction + +function WoWReforgedAiPlayersUi___RaceDownFunction takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index]) == AI_PLAYERS_UI_RACES_MENU_ITEM_DRAGONKIN ) then + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], 0) + else + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], BlzFrameGetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index]) + 1) + endif + endif + + call PlayClickSound(GetTriggerPlayer()) +endfunction + +function WoWReforgedAiPlayersUi___PreviousPageFunction takes nothing returns nothing + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( WoWReforgedAiPlayersUi___Page == 0 ) then + set WoWReforgedAiPlayersUi___Page=WoWReforgedAiPlayersUi___MaxPages - 1 + else + set WoWReforgedAiPlayersUi___Page=WoWReforgedAiPlayersUi___Page - 1 + endif + + call BlzFrameSetText(WoWReforgedAiPlayersUi___TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi___Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi___MaxPages) + ")") // INLINED!! + endif + + call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , false) + call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , true) +endfunction + +function WoWReforgedAiPlayersUi___NextPageFunction takes nothing returns nothing + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( WoWReforgedAiPlayersUi___Page == WoWReforgedAiPlayersUi___MaxPages - 1 ) then + set WoWReforgedAiPlayersUi___Page=0 + else + set WoWReforgedAiPlayersUi___Page=WoWReforgedAiPlayersUi___Page + 1 + endif + + call BlzFrameSetText(WoWReforgedAiPlayersUi___TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi___Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi___MaxPages) + ")") // INLINED!! + endif + + call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , false) + call SetAiPlayersUiVisibleForPlayer(GetTriggerPlayer() , true) +endfunction + +function WoWReforgedAiPlayersUi___TriggerConditionCheckSharedControl takes nothing returns boolean + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + set WoWReforgedAiPlayersUi___SharedControlAsync[index]=1 + return false +endfunction + +function WoWReforgedAiPlayersUi___TriggerConditionUncheckSharedControl takes nothing returns boolean + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 0))) // INLINED!! + set WoWReforgedAiPlayersUi___SharedControlAsync[index]=0 + return false +endfunction + +function CreateAiPlayersUiEx takes force aiPlayers returns nothing + local integer i= 0 + local integer counter= 0 + local player aiPlayer= null + local integer index= 0 + local real x + local real y + local integer playerColor= 0 + local integer team= 0 + + set WoWReforgedAiPlayersUi___BackgroundFrame=BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___BackgroundFrame, FRAMEPOINT_TOPLEFT, UI_FULLSCREEN_X, UI_FULLSCREEN_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___BackgroundFrame, FRAMEPOINT_BOTTOMRIGHT, UI_FULLSCREEN_X + UI_FULLSCREEN_WIDTH, UI_FULLSCREEN_Y - UI_FULLSCREEN_HEIGHT) + + set WoWReforgedAiPlayersUi___TitleFrame=BlzCreateFrameByType("TEXT", "AiPlayersGuiTitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___TitleFrame, FRAMEPOINT_TOPLEFT, UI_FULLSCREEN_X, UI_FULLSCREEN_TITLE_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___TitleFrame, FRAMEPOINT_BOTTOMRIGHT, UI_FULLSCREEN_X + UI_FULLSCREEN_WIDTH, UI_FULLSCREEN_TITLE_Y - UI_FULLSCREEN_TITLE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___TitleFrame, "Computer Players (" + I2S(WoWReforgedAiPlayersUi___Page + 1) + "/" + I2S(WoWReforgedAiPlayersUi___MaxPages) + ")") // INLINED!! + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___TitleFrame, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + // header line + set WoWReforgedAiPlayersUi___LabelFrameColumnPlayerName=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLinePlayerName", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerName, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerName, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X + AI_PLAYERS_UI_COLUMN_PLAYER_NAME_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerName, "Name") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerName, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnColor=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineColor", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColor, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColor, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + AI_PLAYERS_UI_COLUMN_COLOR_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnColor, "Color") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnColor, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnTeam=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineTeam", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnTeam, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_TEAM_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnTeam, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_TEAM_X + AI_PLAYERS_UI_COLUMN_TEAM_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnTeam, "Team") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnTeam, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnHero=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineHero", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHero, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHero, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + AI_PLAYERS_UI_COLUMN_HERO_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnHero, "Hero") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnHero, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevel=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineHeroStartLevel", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevel, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevel, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X + AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevel, "Level") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevel, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartLocation=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartLocation", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocation, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocation, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X + AI_PLAYERS_UI_COLUMN_START_LOCATION_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocation, "Location (Warlord only)") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocation, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnRace=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineRace", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRace, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRace, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + AI_PLAYERS_UI_COLUMN_RACE_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnRace, "Race") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnRace, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnProfession=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineProfession", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnProfession, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PROFESSION_X, AI_PLAYERS_UI_LINE_HEADERS_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnProfession, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PROFESSION_X + AI_PLAYERS_UI_COLUMN_PROFESSION_WIDTH, AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnProfession, "Profession") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnProfession, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + // new line + set y=AI_PLAYERS_UI_LINE_HEADERS_Y - AI_PLAYERS_UI_LINE_HEIGHT - AI_PLAYERS_UI_LINE_HEIGHT_SPACING + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartGold=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartGold", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartGold, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_GOLD_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartGold, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_GOLD_X + AI_PLAYERS_UI_COLUMN_START_GOLD_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartGold, "Gold") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnStartGold, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartLumber=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartLumber", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumber, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumber, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X + AI_PLAYERS_UI_COLUMN_START_LUMBER_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumber, "Lumber") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumber, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimit=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineFoodLimit", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimit, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimit, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X + AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimit, "Max. Food") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimit, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolution=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineStartEvolution", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolution, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolution, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X + AI_PLAYERS_UI_COLUMN_START_EVOLUTION_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolution, "Evolution") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolution, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayers=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineAttackPlayers", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayers, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayers, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X + AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayers, "Attacks") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayers, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroes=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineHeroes", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroes, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HEROES_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroes, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HEROES_X + AI_PLAYERS_UI_COLUMN_HEROES_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnHeroes, "Heroes") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnHeroes, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnExpansions=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineExpansions", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnExpansions, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnExpansions, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X + AI_PLAYERS_UI_COLUMN_EXPANSIONS_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnExpansions, "Expansions") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnExpansions, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnSharedControl=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineSharedControl", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControl, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControl, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X + AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControl, "Shared") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControl, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set WoWReforgedAiPlayersUi___LabelFrameColumnDifficulty=BlzCreateFrameByType("TEXT", "AiPlayersGuiHeaderLineDifficulty", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnDifficulty, FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnDifficulty, FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X + AI_PLAYERS_UI_COLUMN_DIFFICULTY_WIDTH, y - AI_PLAYERS_UI_LINE_HEADERS_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnDifficulty, "Difficulty") + call BlzFrameSetTextAlignment(WoWReforgedAiPlayersUi___LabelFrameColumnDifficulty, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_CENTER) + + set y=AI_PLAYERS_UI_LINE_HEADERS_Y - 2 * ( AI_PLAYERS_UI_LINE_HEADERS_HEIGHT + AI_PLAYERS_UI_LINE_SPACING_Y ) + + if ( WoWReforgedAiPlayersUi___Force != null ) then + call ForceClear(WoWReforgedAiPlayersUi___Force) + call DestroyForce(WoWReforgedAiPlayersUi___Force) + set WoWReforgedAiPlayersUi___Force=null + endif + + set WoWReforgedAiPlayersUi___Force=CreateForce() + + // players + set i=0 + loop + exitwhen ( i >= bj_MAX_PLAYERS ) + set aiPlayer=Player(i) + if ( IsPlayerInForce(aiPlayer, aiPlayers) ) then + call ForceAddPlayer(WoWReforgedAiPlayersUi___Force, aiPlayer) + + set index=counter + + set WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PLAYER_NAME_X + AI_PLAYERS_UI_COLUMN_PLAYER_NAME_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit[index], GetPlayerName(aiPlayer)) + set WoWReforgedAiPlayersUi___PlayerNames[index]=GetPlayerName(aiPlayer) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnPlayerNameEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index]=BlzCreateFrame("PlayerColorsPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + AI_PLAYERS_UI_COLUMN_COLOR_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + set playerColor=IMinBJ(23, GetHandleId(GetPlayerColor(aiPlayer))) + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index], playerColor) + set WoWReforgedAiPlayersUi___ColorLocal[index]=playerColor + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index], true) + + set WoWReforgedAiPlayersUi___ColorPopupMenuTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___ColorPopupMenuTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnColorPopup[index], FRAMEEVENT_POPUPMENU_ITEM_CHANGED) + call TriggerAddAction(WoWReforgedAiPlayersUi___ColorPopupMenuTrigger[index], function WoWReforgedAiPlayersUi___ColorPopupMenuFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___ColorPopupMenuTrigger[index] )), ( 0 ), ( index)) // INLINED!! + + set WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index]=BlzCreateFrameByType("BACKDROP", "ColorFrame" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_EDIT_X, y - 0.04) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_EDIT_X + AI_PLAYERS_UI_COLUMN_COLOR_EDIT_WIDTH, y - 0.04 - AI_PLAYERS_UI_COLUMN_COLOR_EDIT_HEIGHT) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index], ("ReplaceableTextures\\TeamColor\\TeamColor" + I2SW(GetHandleId((GetPlayerColor(aiPlayer))) , 2)), 0, true) // INLINED!! + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnColorEdit[index], true) + set WoWReforgedAiPlayersUi___ColorLocal[index]=playerColor + + //call BJDebugMsg("Texture: " + GetPlayerColorTexture(GetPlayerColor(aiPlayer))) + + set WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[index]=BlzCreateFrameByType("BUTTON", "ColorUpButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, y - 0.04) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + 0.02, y - 0.02 - 0.04) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUpFrame[index]=BlzCreateFrameByType("BACKDROP", "ColorUpFrame" + I2S(index), WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUpFrame[index], WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUpFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUpFrame[index], true) + + set WoWReforgedAiPlayersUi___ColorUpTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___ColorUpTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowUp[index], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___ColorUpTrigger[index], function WoWReforgedAiPlayersUi___ColorUpFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___ColorUpTrigger[index] )), ( 0 ), ( index)) // INLINED!! + + set WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[index]=BlzCreateFrameByType("BUTTON", "ColorDownButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_COLOR_X, y - 0.07) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_COLOR_X + 0.02, y - 0.02 - 0.07) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDownFrame[index]=BlzCreateFrameByType("BACKDROP", "ColoreDownFrame" + I2S(index), WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDownFrame[index], WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDownFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDownFrame[index], true) + + set WoWReforgedAiPlayersUi___ColorDownTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___ColorDownTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnColorArrowDown[index], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___ColorDownTrigger[index], function WoWReforgedAiPlayersUi___ColorDownFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___ColorDownTrigger[index] )), ( 0 ), ( index)) // INLINED!! + + set WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit[index]=BlzCreateFrame("TeamPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_TEAM_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_TEAM_X + AI_PLAYERS_UI_COLUMN_TEAM_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + set team=IMinBJ(3, GetPlayerTeam(aiPlayer)) + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit[index], team) + set WoWReforgedAiPlayersUi___Teams[index]=team + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnTeamEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index]=BlzCreateFrame("HeroesPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + AI_PLAYERS_UI_COLUMN_HERO_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM_MATCHING_RACE) + set WoWReforgedAiPlayersUi___Heroes[index]=AI_PLAYERS_UI_HEROES_MENU_ITEM_RANDOM_MATCHING_RACE + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[index]=BlzCreateFrameByType("BUTTON", "HeroUpButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, y - 0.04) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + 0.02, y - 0.02 - 0.04) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUpFrame[index]=BlzCreateFrameByType("BACKDROP", "HeroUpFrame" + I2S(index), WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUpFrame[index], WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUpFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUpFrame[index], true) + + set WoWReforgedAiPlayersUi___HeroUpTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___HeroUpTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowUp[index], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___HeroUpTrigger[index], function WoWReforgedAiPlayersUi___HeroUpFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___HeroUpTrigger[index] )), ( 0 ), ( index)) // INLINED!! + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[index]=BlzCreateFrameByType("BUTTON", "HeroDownButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_X, y - 0.07) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_X + 0.02, y - 0.02 - 0.07) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDownFrame[index]=BlzCreateFrameByType("BACKDROP", "HeroeDownFrame" + I2S(index), WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDownFrame[index], WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDownFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDownFrame[index], true) + + set WoWReforgedAiPlayersUi___HeroDownTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___HeroDownTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnHeroEditArrowDown[index], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___HeroDownTrigger[index], function WoWReforgedAiPlayersUi___HeroDownFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___HeroDownTrigger[index] )), ( 0 ), ( index)) // INLINED!! + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_X + AI_PLAYERS_UI_COLUMN_HERO_START_LEVEL_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit[index], "1") + set WoWReforgedAiPlayersUi___HeroStartLevels[index]=1 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnHeroStartLevelEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit[index]=BlzCreateFrame("StartLocationsPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LOCATION_X + AI_PLAYERS_UI_COLUMN_START_LOCATION_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit[index], 0) + set WoWReforgedAiPlayersUi___StartLocations[index]=0 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnStartLocationEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index]=BlzCreateFrame("RacesPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + AI_PLAYERS_UI_COLUMN_RACE_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], AI_PLAYERS_UI_RACES_MENU_ITEM_MATCHING_START_LOCATION) + set WoWReforgedAiPlayersUi___Races[index]=AI_PLAYERS_UI_RACES_MENU_ITEM_MATCHING_START_LOCATION + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[index]=BlzCreateFrameByType("BUTTON", "RaceUpButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, y - 0.04) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + 0.02, y - 0.02 - 0.04) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUpFrame[index]=BlzCreateFrameByType("BACKDROP", "RaceUpFrame" + I2S(index), WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUpFrame[index], WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUpFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedUp.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUpFrame[index], true) + + set WoWReforgedAiPlayersUi___RaceUpTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___RaceUpTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowUp[index], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___RaceUpTrigger[index], function WoWReforgedAiPlayersUi___RaceUpFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___RaceUpTrigger[index] )), ( 0 ), ( index)) // INLINED!! + + set WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[index]=BlzCreateFrameByType("BUTTON", "RaceDownButton" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_RACE_X, y - 0.07) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_RACE_X + 0.02, y - 0.02 - 0.07) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDownFrame[index]=BlzCreateFrameByType("BACKDROP", "RaceDownFrame" + I2S(index), WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDownFrame[index], WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[index]) + call BlzFrameSetTexture(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDownFrame[index], "ReplaceableTextures\\CommandButtons\\BTNReplay-SpeedDown.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDownFrame[index], true) + + set WoWReforgedAiPlayersUi___RaceDownTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___RaceDownTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnRaceEditArrowDown[index], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___RaceDownTrigger[index], function WoWReforgedAiPlayersUi___RaceDownFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___RaceDownTrigger[index] )), ( 0 ), ( index)) // INLINED!! + + set WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit[index]=BlzCreateFrame("ProfessionsPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_PROFESSION_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_PROFESSION_X + AI_PLAYERS_UI_COLUMN_PROFESSION_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit[index], 0) + set WoWReforgedAiPlayersUi___Professions[index]=0 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnProfessionEdit[index], true) + + // new line + set y=y - AI_PLAYERS_UI_LINE_HEIGHT - AI_PLAYERS_UI_LINE_HEIGHT_SPACING + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_GOLD_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_GOLD_X + AI_PLAYERS_UI_COLUMN_START_GOLD_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit[index], I2S(AI_PLAYERS_UI_START_GOLD)) + set WoWReforgedAiPlayersUi___StartGold[index]=AI_PLAYERS_UI_START_GOLD + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnStartGoldEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_LUMBER_X + AI_PLAYERS_UI_COLUMN_START_LUMBER_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit[index], I2S(AI_PLAYERS_UI_START_LUMBER)) + set WoWReforgedAiPlayersUi___StartLumber[index]=AI_PLAYERS_UI_START_LUMBER + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnStartLumberEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_X + AI_PLAYERS_UI_COLUMN_FOOD_LIMIT_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit[index], "600") + set WoWReforgedAiPlayersUi___FoodLimit[index]=600 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnFoodLimitEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_START_EVOLUTION_X + AI_PLAYERS_UI_COLUMN_START_EVOLUTION_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit[index], "1") + set WoWReforgedAiPlayersUi___StartEvolution[index]=1 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnStartEvolutionEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox[index]=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_X + AI_PLAYERS_UI_COLUMN_ATTACK_PLAYERS_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + set WoWReforgedAiPlayersUi___AttackPlayers[index]=0 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox[index], true) + if ( GetAIDifficulty(aiPlayer) == AI_DIFFICULTY_INSANE ) then + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnAttackPlayerCheckbox[index], 1.0) + endif + + set WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_HEROES_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_HEROES_X + AI_PLAYERS_UI_COLUMN_HEROES_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit[index], "1") + set WoWReforgedAiPlayersUi___HeroesCount[index]=1 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnHeroesEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit[index]=BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_EXPANSIONS_X + AI_PLAYERS_UI_COLUMN_EXPANSIONS_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit[index], "0") + set WoWReforgedAiPlayersUi___Expansions[index]=0 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnExpansionsEdit[index], true) + + set WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox[index]=BlzCreateFrame("QuestCheckBox2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_X + AI_PLAYERS_UI_COLUMN_SHARED_CONTROL_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + set WoWReforgedAiPlayersUi___SharedControl[index]=0 + set WoWReforgedAiPlayersUi___SharedControlAsync[index]=0 + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox[index], true) + set WoWReforgedAiPlayersUi___checkSharedControlTrigger[index]=CreateTrigger() + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___checkSharedControlTrigger[index] )), ( 0 ), ( index)) // INLINED!! + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___checkSharedControlTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox[index], FRAMEEVENT_CHECKBOX_CHECKED) + call TriggerAddCondition(WoWReforgedAiPlayersUi___checkSharedControlTrigger[index], Condition(function WoWReforgedAiPlayersUi___TriggerConditionCheckSharedControl)) + set WoWReforgedAiPlayersUi___uncheckSharedControlTrigger[index]=CreateTrigger() + call SaveInteger(udg_DB, GetHandleId((WoWReforgedAiPlayersUi___uncheckSharedControlTrigger[index] )), ( 0 ), ( index)) // INLINED!! + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___uncheckSharedControlTrigger[index], WoWReforgedAiPlayersUi___LabelFrameColumnSharedControlCheckbox[index], FRAMEEVENT_CHECKBOX_UNCHECKED) + call TriggerAddCondition(WoWReforgedAiPlayersUi___uncheckSharedControlTrigger[index], Condition(function WoWReforgedAiPlayersUi___TriggerConditionUncheckSharedControl)) + + set WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit[index]=BlzCreateFrame("DifficultyPopup", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit[index], FRAMEPOINT_TOPLEFT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X, y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit[index], FRAMEPOINT_BOTTOMRIGHT, AI_PLAYERS_UI_COLUMN_DIFFICULTY_X + AI_PLAYERS_UI_COLUMN_DIFFICULTY_WIDTH, y - AI_PLAYERS_UI_LINE_HEIGHT) + call BlzFrameSetValue(WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit[index], 1) // normal + set WoWReforgedAiPlayersUi___Difficulty[index]=1 // normal + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___LabelFrameColumnDifficultyEdit[index], true) + + set y=y - AI_PLAYERS_UI_LINE_HEIGHT - AI_PLAYERS_UI_LINE_SPACING_Y + set counter=counter + 1 + + if ( ModuloInteger(counter, AI_PLAYERS_UI_MAX_PLAYERS) == 0 ) then + set y=AI_PLAYERS_UI_LINE_HEADERS_Y - 2 * ( AI_PLAYERS_UI_LINE_HEADERS_HEIGHT + AI_PLAYERS_UI_LINE_SPACING_Y ) + endif + endif + set aiPlayer=null + set i=i + 1 + endloop + + set WoWReforgedAiPlayersUi___Counter=counter + set WoWReforgedAiPlayersUi___MaxPages=counter / AI_PLAYERS_UI_MAX_PLAYERS + + if ( ModuloInteger(counter, AI_PLAYERS_UI_MAX_PLAYERS) > 0 ) then + set WoWReforgedAiPlayersUi___MaxPages=WoWReforgedAiPlayersUi___MaxPages + 1 + endif + + // apply button + + set WoWReforgedAiPlayersUi___ApplyButton=BlzCreateFrame("ScriptDialogButton", WoWReforgedAiPlayersUi___BackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___ApplyButton, FRAMEPOINT_TOPLEFT, UI_FULLSCREEN_CLOSE_BUTTON_X, UI_FULLSCREEN_BOTTOM_BUTTON_Y) + call BlzFrameSetAbsPoint(WoWReforgedAiPlayersUi___ApplyButton, FRAMEPOINT_BOTTOMRIGHT, UI_FULLSCREEN_CLOSE_BUTTON_X + UI_FULLSCREEN_BOTTOM_BUTTON_WIDTH, UI_FULLSCREEN_BOTTOM_BUTTON_Y - UI_FULLSCREEN_BOTTOM_BUTTON_HEIGHT) + call BlzFrameSetText(WoWReforgedAiPlayersUi___ApplyButton, "|cffFCD20DApply|r") + + set WoWReforgedAiPlayersUi___ApplyTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___ApplyTrigger, WoWReforgedAiPlayersUi___ApplyButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___ApplyTrigger, function WoWReforgedAiPlayersUi___ApplyFunction) + + // previous page button + + set WoWReforgedAiPlayersUi___PreviousPageButton=CreateFullScreenPreviousPageButton(WoWReforgedAiPlayersUi___BackgroundFrame , "|cffFCD20DPrevious Player|r") + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___PreviousPageButton, counter > AI_PLAYERS_UI_MAX_PLAYERS) + + set WoWReforgedAiPlayersUi___PreviousPageTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___PreviousPageTrigger, WoWReforgedAiPlayersUi___PreviousPageButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___PreviousPageTrigger, function WoWReforgedAiPlayersUi___PreviousPageFunction) + + // next page button + + set WoWReforgedAiPlayersUi___NextPageButton=CreateFullScreenNextPageButton(WoWReforgedAiPlayersUi___BackgroundFrame , "|cffFCD20DNext Player|r") + call BlzFrameSetEnable(WoWReforgedAiPlayersUi___NextPageButton, counter > AI_PLAYERS_UI_MAX_PLAYERS) + + set WoWReforgedAiPlayersUi___NextPageTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedAiPlayersUi___NextPageTrigger, WoWReforgedAiPlayersUi___NextPageButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedAiPlayersUi___NextPageTrigger, function WoWReforgedAiPlayersUi___NextPageFunction) + + // hide + call WoWReforgedAiPlayersUi___SetVisible(false) // INLINED!! +endfunction + +function CreateAiPlayersUI takes nothing returns nothing + local force aiPlayers= GetAiPlayersWithConfig() + call CreateAiPlayersUiEx(aiPlayers) + call ForceClear(aiPlayers) + call DestroyForce(aiPlayers) + set aiPlayers=null +endfunction + +function WoWReforgedAiPlayersUi___Init takes nothing returns nothing + // sync trigger + set WoWReforgedAiPlayersUi___SyncTrigger=CreateTrigger() + call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedAiPlayersUi___SyncTrigger , WoWReforgedAiPlayersUi___PREFIX , false) + call TriggerAddAction(WoWReforgedAiPlayersUi___SyncTrigger, function WoWReforgedAiPlayersUi___TriggerActionSyncData) + + //call FrameSaverAdd(function HideAiPlayersUi) +endfunction + + +//library WoWReforgedAiPlayersUi ends +//library WoWReforgedArmorer: + + +function WoWReforgedArmorer___ForgingHammer takes unit hero,item whichItem,integer defenseBonus returns integer + local integer itemTypeId= GetItemTypeId(whichItem) + local integer count= (LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId), 0)) // INLINED!! + local integer abilityId= 0 + local ability whichAbility= null + local integer result= 0 + local integer i= 1 + loop + exitwhen ( i > count ) + set abilityId=(LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId ), ( i))) // INLINED!! + set whichAbility=BlzGetItemAbility(whichItem, abilityId) + call AddAbilityFieldBonuses(abilityId , whichAbility , 0 , defenseBonus , 0 , 0.0 , 0 , 0 , 0 , 0 , 0.0 , 0 , 0 , 0 , 0) + // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 + call IncUnitAbilityLevel(hero, abilityId) + call DecUnitAbilityLevel(hero, abilityId) + set result=result + 1 + set i=i + 1 + endloop + if ( result > 0 ) then + call h__DisplayTimedTextToPlayer(GetOwningPlayer(hero), 0.0, 0.0, 4.0, "Increased armor bonus of item.") + endif + return result +endfunction + +function WoWReforgedArmorer___TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == WoWReforgedArmorer___ABILITY_ID ) then + if ( WoWReforgedArmorer___ForgingHammer(GetTriggerUnit() , GetSpellTargetItem() , 2) <= 0 ) then + call SimError(GetOwningPlayer(GetTriggerUnit()) , "Item has no known armor bonus abilities.") + call IssueImmediateOrder(GetTriggerUnit(), "stop") + endif + endif + return false +endfunction + +function WoWReforgedArmorer___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmorer___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(WoWReforgedArmorer___castTrigger, Condition(function WoWReforgedArmorer___TriggerConditionCast)) +endfunction + + +//library WoWReforgedArmorer ends +//library WoWReforgedCraftingStash: + +function AddCraftingStash takes unit whichUnit returns nothing + local integer i= udg_RecipeCooking + local integer max= (Crafting__recipesCounter) // INLINED!! + call EnableItemCraftingUnit(whichUnit) + loop + exitwhen ( i >= max ) + call SetItemCraftingRecipeEnabled(whichUnit , i , false) + set i=i + 1 + endloop +endfunction + +function AddRequirementsLegendaryItems takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedBosses__legendaryItemsCounter) // INLINED!! + loop + exitwhen ( i == max ) + call AddRecipeRequirementItem(udg_TmpInteger , (WoWReforgedBosses__legendaryItemTypeId[(i)]) , udg_TmpInteger2 , true) // INLINED!! + set i=i + 1 + endloop + set udg_TmpInteger2=1 +endfunction + + +//library WoWReforgedCraftingStash ends +//library WoWReforgedEnchanter: + + +function EnchanterSystemSaveBonus takes unit hero,integer bonusType,integer bonus returns nothing + call SaveInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType, bonus) +endfunction + +function EnchanterSystemLoadBonus takes unit hero,integer bonusType returns integer + return LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType) +endfunction + +function EnchanterSystemSaveBonusReal takes unit hero,integer bonusType,real bonus returns nothing + call SaveReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType, bonus) +endfunction + +function EnchanterSystemLoadBonusReal takes unit hero,integer bonusType returns real + return LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(hero), bonusType) +endfunction + +function EnchanterAddItemBonusesEx takes unit hero,item whichItem,integer bonusHeroStatsAndDefense,real bonusDamage,real bonusHitPoints returns nothing + local integer itemTypeId= GetItemTypeId(whichItem) + local integer count= (LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId), 0)) // INLINED!! + local integer abilityId= 0 + local ability whichAbility= null + local integer i= 1 + loop + exitwhen ( i > count ) + set abilityId=(LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId ), ( i))) // INLINED!! + set whichAbility=BlzGetItemAbility(whichItem, abilityId) + //call BJDebugMsg("Adding bonus to ability " + GetObjectName(abilityId) + " of item " + GetItemName(whichItem)) + call AddAbilityFieldBonuses(abilityId , whichAbility , 0 , bonusHeroStatsAndDefense , bonusHeroStatsAndDefense , 0.0 , bonusDamage , bonusHitPoints , bonusHitPoints , 0 , 0.0 , I2R(bonusHeroStatsAndDefense) , bonusHeroStatsAndDefense , R2I(bonusHitPoints) , R2I(bonusHitPoints)) + // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 + call IncUnitAbilityLevel(hero, abilityId) + call DecUnitAbilityLevel(hero, abilityId) + set i=i + 1 + endloop +endfunction + +function IsHeroEnchanted takes unit hero returns boolean + return IsUnitInGroup(hero, WoWReforgedEnchanter__EnchantedUnits) +endfunction + +function WoWReforgedEnchanter__EnchanterSystemRemoveUnit takes unit whichUnit returns nothing + call FlushChildHashtable(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId(whichUnit)) +endfunction + +//processed hook: hook RemoveUnit WoWReforgedEnchanter__EnchanterSystemRemoveUnit + +function EnchanterSetHeroBonus takes unit hero returns integer + local item whichItem= null + local integer oldEnchantingBonusHeroStatAndDefense= (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! + local real oldEnchantingBonusDamage= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! + local real oldEnchantingBonusHitPoints= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! + local integer enchantingItemsCounter= 0 + local integer heroStatsAndDefenseBonus= 0 + local real damageBonus= 0 + local real hitPointsBonus= 0 + local integer heroStatsAndDefenseBonusDiff= 0 + local real damageBonusDiff= 0 + local real hitPointsBonusDiff= 0 + local integer itemTypeId= 0 + local integer factor= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set whichItem=UnitItemInSlot(hero, i) + if ( whichItem != null ) then + set itemTypeId=GetItemTypeId(whichItem) + set factor=GetItemCharges(whichItem) + if ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_NOVICE ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_NOVICE * factor + set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_NOVICE * factor + set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_NOVICE * factor + set enchantingItemsCounter=enchantingItemsCounter + 1 + elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_ADVANCED ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_ADVANCED * factor + set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_ADVANCED * factor + set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_ADVANCED * factor + set enchantingItemsCounter=enchantingItemsCounter + 1 + elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_ADEPT ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_ADEPT * factor + set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_ADEPT * factor + set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_ADEPT * factor + set enchantingItemsCounter=enchantingItemsCounter + 1 + elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_MASTER ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_MASTER * factor + set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_MASTER * factor + set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_MASTER * factor + set enchantingItemsCounter=enchantingItemsCounter + 1 + elseif ( itemTypeId == ENCHANTER_ITEM_TYPE_ID_GRAND_MASTER ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_GRAND_MASTER * factor + set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_GRAND_MASTER * factor + set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_GRAND_MASTER * factor + set enchantingItemsCounter=enchantingItemsCounter + 1 + elseif ( itemTypeId == ENCHANTER_HIT_POINTS_BONUS_DOCTOR ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + ENCHANTER_STAT_BONUS_DOCTOR * factor + set damageBonus=damageBonus + ENCHANTER_DAMAGE_BONUS_DOCTOR * factor + set hitPointsBonus=hitPointsBonus + ENCHANTER_HIT_POINTS_BONUS_DOCTOR * factor + set enchantingItemsCounter=enchantingItemsCounter + 1 + endif + endif + set whichItem=null + set i=i + 1 + endloop + + //call BJDebugMsg("Old Hero stats and defense bonus " + I2S(oldEnchantingBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldEnchantingBonusDamage) + " and hit points bonus " + R2S(oldEnchantingBonusHitPoints)) + + set heroStatsAndDefenseBonusDiff=heroStatsAndDefenseBonus - oldEnchantingBonusHeroStatAndDefense + set damageBonusDiff=damageBonus - oldEnchantingBonusDamage + set hitPointsBonusDiff=hitPointsBonus - oldEnchantingBonusHitPoints + + //call BJDebugMsg("Hero stats and defense bonus " + I2S(heroStatsAndDefenseBonusDiff) + " and damage bonus " + R2S(damageBonusDiff) + " and hit points bonus " + R2S(hitPointsBonusDiff)) + + set i=0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set whichItem=UnitItemInSlot(hero, i) + if ( whichItem != null ) then + call EnchanterAddItemBonusesEx(hero , whichItem , heroStatsAndDefenseBonusDiff , damageBonusDiff , hitPointsBonusDiff) + endif + set whichItem=null + set i=i + 1 + endloop + + if ( enchantingItemsCounter > 0 ) then + call SaveInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS ), ( heroStatsAndDefenseBonus)) // INLINED!! + call SaveReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS ), (( damageBonus)*1.0)) // INLINED!! + call SaveReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS ), (( hitPointsBonus)*1.0)) // INLINED!! + if ( not IsUnitInGroup(hero, WoWReforgedEnchanter__EnchantedUnits) ) then + call GroupAddUnit(WoWReforgedEnchanter__EnchantedUnits, hero) + endif + elseif ( IsUnitInGroup(hero, WoWReforgedEnchanter__EnchantedUnits) ) then + call FlushChildHashtable(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero))) // INLINED!! + call GroupRemoveUnit(WoWReforgedEnchanter__EnchantedUnits, hero) + endif + + return enchantingItemsCounter +endfunction + +function EnchanterAddItemBonus takes unit hero,item whichItem returns nothing + local integer oldEnchantingBonusHeroStatAndDefense= (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! + local real oldEnchantingBonusDamage= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! + local real oldEnchantingBonusHitPoints= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! + + //call BJDebugMsg("Add old Hero stats and defense bonus " + I2S(oldEnchantingBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldEnchantingBonusDamage) + " and hit points bonus " + R2S(oldEnchantingBonusHitPoints) + " to picked up item " + GetItemName(whichItem)) + + call EnchanterAddItemBonusesEx(hero , whichItem , oldEnchantingBonusHeroStatAndDefense , oldEnchantingBonusDamage , oldEnchantingBonusHitPoints) +endfunction + + +function EnchanterRemoveItemBonus takes unit hero,item whichItem returns nothing + local integer oldEnchantingBonusHeroStatAndDefense= - (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! + local real oldEnchantingBonusDamage= - (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! + local real oldEnchantingBonusHitPoints= - (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! + + //call BJDebugMsg("Remove old Hero stats and defense bonus " + I2S(oldEnchantingBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldEnchantingBonusDamage) + " and hit points bonus " + R2S(oldEnchantingBonusHitPoints) + " from dropped item " + GetItemName(whichItem)) + + call EnchanterAddItemBonusesEx(hero , whichItem , oldEnchantingBonusHeroStatAndDefense , oldEnchantingBonusDamage , oldEnchantingBonusHitPoints) +endfunction + +function EnchanterHeroInfo takes unit hero returns string + local integer oldEnchantingBonusHeroStatAndDefense= (LoadInteger(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! + local real oldEnchantingBonusDamage= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! + local real oldEnchantingBonusHitPoints= (LoadReal(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((hero )), ( ENCHANTER_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! + + if ( oldEnchantingBonusHeroStatAndDefense > 0 ) then + return GetUnitName(hero) + " hero stats/defense/summoned units " + I2S(oldEnchantingBonusHeroStatAndDefense) + ", damage " + I2S(R2I(oldEnchantingBonusDamage)) + ", hp/mana " + I2S(R2I(oldEnchantingBonusHitPoints)) + endif + + return null +endfunction + +function EnchanterInfo takes player whichPlayer returns string + local string text= "Enchantable items: " + EquipmentBagListItemTypeIds() + //local group heroes = GetUnitsSelectedAll(whichPlayer) // TODO Desync. + local group heroes= GetPlayerHeroes(whichPlayer) + local unit hero= null + local string heroTxt= "" + local string txt= null + local integer i= 0 + loop + exitwhen ( i >= BlzGroupGetSize(heroes) ) + set hero=BlzGroupUnitAt(heroes, i) + if ( IsUnitType(hero, UNIT_TYPE_HERO) ) then + set txt=EnchanterHeroInfo(hero) + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, txt) + if ( txt != null ) then + if ( heroTxt != "" ) then + set heroTxt=heroTxt + ", " + endif + + set heroTxt=heroTxt + txt + endif + endif + set hero=null + set i=i + 1 + endloop + call GroupClear(heroes) + call DestroyGroup(heroes) + set heroes=null + + if ( heroTxt != "" ) then + return heroTxt + ", " + text + endif + + return text +endfunction + +function WoWReforgedEnchanter__TriggerConditionPickupItem takes nothing returns boolean + if ( (IsUnitInGroup((GetTriggerUnit()), WoWReforgedEnchanter__EnchantedUnits)) ) then // INLINED!! + return true + endif + + return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetUnitTypeId(GetTriggerUnit()) != BACK_PACK and GetUnitTypeId(GetTriggerUnit()) != EQUIPMENT_BAG and ( GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_NOVICE or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADEPT or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_MASTER ) +endfunction + +function WoWReforgedEnchanter__TriggerActionSetHeroBonus takes nothing returns nothing + if ( GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_NOVICE or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_ADEPT or GetItemTypeId(GetManipulatedItem()) == ENCHANTER_ITEM_TYPE_ID_MASTER ) then + call EnchanterSetHeroBonus(GetTriggerUnit()) + //call DisplayEnchanterHeroInfo(GetOwningPlayer(GetTriggerUnit()), GetTriggerUnit()) + endif + call EnchanterAddItemBonus(GetTriggerUnit() , GetManipulatedItem()) +endfunction + +function WoWReforgedEnchanter__TriggerConditionDropItem takes nothing returns boolean + return (IsUnitInGroup((GetTriggerUnit()), WoWReforgedEnchanter__EnchantedUnits)) // INLINED!! +endfunction + +function WoWReforgedEnchanter__TriggerActionSetHeroBonusDrop takes nothing returns nothing + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(GetTriggerUnit()) + local item droppedItem= GetManipulatedItem() + call EnchanterRemoveItemBonus(triggerUnit , GetManipulatedItem()) + call TriggerSleepAction(0.0) + if ( GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_NOVICE or GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_ADEPT or GetItemTypeId(droppedItem) == ENCHANTER_ITEM_TYPE_ID_MASTER ) then + call EnchanterSetHeroBonus(triggerUnit) + //call DisplayEnchanterHeroInfo(owner, triggerUnit) + endif + set droppedItem=null + set triggerUnit=null + set owner=null +endfunction + +function WoWReforgedEnchanter__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedEnchanter__pickupItemTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) + call TriggerAddCondition(WoWReforgedEnchanter__pickupItemTrigger, Condition(function WoWReforgedEnchanter__TriggerConditionPickupItem)) + call TriggerAddAction(WoWReforgedEnchanter__pickupItemTrigger, function WoWReforgedEnchanter__TriggerActionSetHeroBonus) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedEnchanter__dropItemTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) + call TriggerAddCondition(WoWReforgedEnchanter__dropItemTrigger, Condition(function WoWReforgedEnchanter__TriggerConditionDropItem)) + call TriggerAddAction(WoWReforgedEnchanter__dropItemTrigger, function WoWReforgedEnchanter__TriggerActionSetHeroBonusDrop) +endfunction + + +//library WoWReforgedEnchanter ends +//library WoWReforgedHeroUtils: + +// field 'ucam' +function IsCampaign takes integer objectTypeId returns boolean + if ( (LoadBoolean(ObjectDataFields__h, (objectTypeId ), ( OBJECT_DATA_FIELD_UCAM))) ) then // INLINED!! + call h__BJDebugMsg(GetObjectName(objectTypeId) + " is campaign.") + endif + return (LoadBoolean(ObjectDataFields__h, (objectTypeId ), ( OBJECT_DATA_FIELD_UCAM))) // INLINED!! +endfunction + +function GetNpcName takes unit hero returns string + if ( IsUnitType(hero, UNIT_TYPE_HERO) and ( IsCampaign(GetUnitTypeId(hero)) or IsBoss(GetUnitTypeId(hero)) ) ) then + return GetHeroProperName(hero) + endif + + return GetUnitName(hero) +endfunction + + +//library WoWReforgedHeroUtils ends +//library WoWReforgedHeroesTavern: + + +function WoWReforgedHeroesTavern__AddHeroToTavern takes nothing returns nothing + local unit tavern= WoWReforgedHeroesTavern__tmpUnit + local integer i= WoWReforgedHeroesTavern__index + local string pageName= WoWReforgedHeroesTavern__tmpString + if ( (udg_HeroCategory[(i)]) != "" and (udg_HeroCategory[(i)]) != null and (udg_HeroCategory[(i)]) != pageName ) then // INLINED!! + set pageName=(udg_HeroCategory[(i)]) // INLINED!! + call NextPagedButtonsPage(tavern , pageName) + set WoWReforgedHeroesTavern__tmpString=pageName + endif +call AddPagedButtonsId((tavern ) , ( (udg_HeroUnitType[(i)])) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! +endfunction + +function WoWReforgedHeroesTavern__AddHeroesTavern takes unit tavern returns nothing + local integer i= 0 + local integer max= (udg_HeroUnitTypeIndex) // INLINED!! + local string pageName= "" + call EnablePagedButtons(tavern) + call SetPagedButtonsSlotsPerPage(tavern , 9) + +call AddPagedButtonsId((tavern ) , ( ITEM_TYPE_RANDOM_HERO) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + + set i=0 + loop + exitwhen ( i >= max ) + set WoWReforgedHeroesTavern__index=i + set WoWReforgedHeroesTavern__tmpUnit=tavern + set WoWReforgedHeroesTavern__tmpString=pageName + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedHeroesTavern__AddHeroToTavern)) // INLINED!! + set pageName=WoWReforgedHeroesTavern__tmpString + set i=i + 1 + endloop + + call NextPagedButtonsPage(tavern , "Bosses") + set i=0 + set max=BlzGroupGetSize(udg_Bosses) + loop + exitwhen ( i >= max ) +call AddPagedButtonsId((tavern ) , ( GetUnitTypeId(BlzGroupUnitAt(udg_Bosses, i))) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! + set i=i + 1 + endloop + + call SetPagedButtonsPage(tavern , 0) +endfunction + +function WoWReforgedHeroesTavern__ForGroupAddHeroesTavern takes nothing returns nothing + call WoWReforgedHeroesTavern__AddHeroesTavern(GetEnumUnit()) +endfunction + +function WoWReforgedHeroesTavern__TimerFunctionAddHeroesTaverns takes nothing returns nothing + call ForGroupBJ(GetUnitsOfTypeIdAll(HEROES_TAVERN), function WoWReforgedHeroesTavern__ForGroupAddHeroesTavern) + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function SelectRandomHero takes unit buyingUnit,unit tavern returns nothing + local player owner= GetOwningPlayer(buyingUnit) + local integer array availableIds + local integer availableIdsCounter= 0 + local integer id= 0 + local integer random= 0 + local integer page= 0 + local integer i= 0 + local integer max= (udg_HeroUnitTypeIndex) // INLINED!! + loop + exitwhen ( i >= max ) + set id=(udg_HeroUnitType[(i)]) // INLINED!! + if ( PlayerCanBuyHeroEx(owner , id) ) then + set availableIds[availableIdsCounter]=id + set availableIdsCounter=availableIdsCounter + 1 + endif + set i=i + 1 + endloop + if ( GetHeroLevel1(owner) >= 50 ) then + set i=0 + set max=BlzGroupGetSize(udg_Bosses) + loop + exitwhen ( i >= max ) + set id=GetUnitTypeId(BlzGroupUnitAt(udg_Bosses, i)) + if ( PlayerCanBuyHeroEx(owner , id) ) then + set availableIds[availableIdsCounter]=id + set availableIdsCounter=availableIdsCounter + 1 + endif + set i=i + 1 + endloop + endif + + set random=GetRandomInt(0, availableIdsCounter - 1) + set id=availableIds[random] + //call BJDebugMsg("Selected random " + GetObjectName(id)) + set WoWReforgedHeroesTavern__index=GetPagedButtonIndex(tavern , id) + //call BJDebugMsg("index " + I2S(index)) + set page=GetPagedButtonsPageByIndex(tavern , WoWReforgedHeroesTavern__index) + //call BJDebugMsg("page " + I2S(page)) + call SetPagedButtonsPage(tavern , page) + call IssueNeutralImmediateOrderById(owner, tavern, id) + + set owner=null +endfunction + +function WoWReforgedHeroesTavern__TriggerConditionSellItem takes nothing returns boolean + if ( GetItemTypeId(GetSoldItem()) == ITEM_TYPE_RANDOM_HERO ) then + call SelectRandomHero(GetBuyingUnit() , GetTriggerUnit()) + call h__RemoveItem(GetSoldItem()) + endif + return false +endfunction + +function WoWReforgedHeroesTavern__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroesTavern__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedHeroesTavern__sellTrigger, Condition(function WoWReforgedHeroesTavern__TriggerConditionSellItem)) + + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedHeroesTavern__TimerFunctionAddHeroesTaverns) +endfunction + + +//library WoWReforgedHeroesTavern ends +//library WoWReforgedInscriptor: + + +function InscriptorSystemSaveBonus takes unit hero,integer bonusType,integer bonus returns nothing + call SaveInteger(WoWReforgedInscriptor___h, GetHandleId(hero), bonusType, bonus) +endfunction + +function InscriptorSystemLoadBonus takes unit hero,integer bonusType returns integer + return LoadInteger(WoWReforgedInscriptor___h, GetHandleId(hero), bonusType) +endfunction + +function InscriptorSystemSaveBonusReal takes unit hero,integer bonusType,real bonus returns nothing + call SaveReal(WoWReforgedInscriptor___h, GetHandleId(hero), bonusType, bonus) +endfunction + +function InscriptorSystemLoadBonusReal takes unit hero,integer bonusType returns real + return LoadReal(WoWReforgedInscriptor___h, GetHandleId(hero), bonusType) +endfunction + +function InscriptorAddAbilityBonusesEx takes unit hero,ability whichAbility,integer bonusHeroStatsAndDefense,real bonusDamage,real bonusHitPoints returns nothing + local integer abilityId= BlzGetAbilityId(whichAbility) + local integer i= 0 + local integer max= 15 + //call BJDebugMsg("Adding bonus to ability " + GetObjectName(abilityId)) + loop + exitwhen ( i == max ) + call AddAbilityFieldBonuses(abilityId , whichAbility , i , bonusHeroStatsAndDefense , bonusHeroStatsAndDefense , 0.0 , bonusDamage , bonusHitPoints , bonusHitPoints , 0 , 0.0 , I2R(bonusHeroStatsAndDefense) , bonusHeroStatsAndDefense , R2I(bonusHitPoints) , R2I(bonusHitPoints)) + set i=i + 1 + endloop + // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 + //call IncUnitAbilityLevel(hero, abilityId) + //call DecUnitAbilityLevel(hero, abilityId) +endfunction + +function IsHeroInscripted takes unit hero returns boolean + return IsUnitInGroup(hero, WoWReforgedInscriptor___targets) +endfunction + +function WoWReforgedInscriptor___InscriptorSystemRemoveUnit takes unit whichUnit returns nothing + call FlushChildHashtable(WoWReforgedInscriptor___h, GetHandleId(whichUnit)) +endfunction + +//processed hook: hook RemoveUnit WoWReforgedInscriptor___InscriptorSystemRemoveUnit + +function InscriptorSetHeroBonus takes unit hero returns integer + local item whichItem= null + local ability whichAbility= null + local integer oldInscriptionBonusHeroStatAndDefense= (LoadInteger(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! + local real oldInscriptionBonusDamage= (LoadReal(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! + local real oldInscriptionBonusHitPoints= (LoadReal(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! + local integer inscriptionItemsCounter= 0 + local integer heroStatsAndDefenseBonus= 0 + local real damageBonus= 0 + local real hitPointsBonus= 0 + local integer heroStatsAndDefenseBonusDiff= 0 + local real damageBonusDiff= 0 + local real hitPointsBonusDiff= 0 + local integer itemTypeId= 0 + local integer factor= 0 + local integer heroSpellLevel= GetUnitAbilityLevel(hero, INSCRIPTION_HERO_SPELL) + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set whichItem=UnitItemInSlot(hero, i) + if ( whichItem != null ) then + set itemTypeId=GetItemTypeId(whichItem) + set factor=GetItemCharges(whichItem) + if ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_NOVICE ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_NOVICE * factor + set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_NOVICE * factor + set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_NOVICE * factor + set inscriptionItemsCounter=inscriptionItemsCounter + 1 + elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_ADVANCED * factor + set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_ADVANCED * factor + set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_ADVANCED * factor + set inscriptionItemsCounter=inscriptionItemsCounter + 1 + elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_ADEPT ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_ADEPT * factor + set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_ADEPT * factor + set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_ADEPT * factor + set inscriptionItemsCounter=inscriptionItemsCounter + 1 + elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_MASTER * factor + set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_MASTER * factor + set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_MASTER * factor + set inscriptionItemsCounter=inscriptionItemsCounter + 1 + elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_GRAND_MASTER ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_GRAND_MASTER * factor + set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_GRAND_MASTER * factor + set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_GRAND_MASTER * factor + set inscriptionItemsCounter=inscriptionItemsCounter + 1 + elseif ( itemTypeId == INSCRIPTOR_ITEM_TYPE_ID_DOCTOR ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_DOCTOR * factor + set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_DOCTOR * factor + set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_DOCTOR * factor + set inscriptionItemsCounter=inscriptionItemsCounter + 1 + endif + endif + set whichItem=null + set i=i + 1 + endloop + + if ( heroSpellLevel > 0 ) then + set heroStatsAndDefenseBonus=heroStatsAndDefenseBonus + INSCRIPTOR_STAT_BONUS_MASTER * heroSpellLevel + set damageBonus=damageBonus + INSCRIPTOR_DAMAGE_BONUS_MASTER * heroSpellLevel + set hitPointsBonus=hitPointsBonus + INSCRIPTOR_HIT_POINTS_BONUS_MASTER * heroSpellLevel + set inscriptionItemsCounter=inscriptionItemsCounter + 1 + endif + + //call BJDebugMsg("Old Hero stats and defense bonus " + I2S(oldInscriptionBonusHeroStatAndDefense) + " and damage bonus " + R2S(oldInscriptionBonusDamage) + " and hit points bonus " + R2S(oldInscriptionBonusHitPoints)) + + set heroStatsAndDefenseBonusDiff=heroStatsAndDefenseBonus - oldInscriptionBonusHeroStatAndDefense + set damageBonusDiff=damageBonus - oldInscriptionBonusDamage + set hitPointsBonusDiff=hitPointsBonus - oldInscriptionBonusHitPoints + + //call BJDebugMsg("Hero stats and defense bonus " + I2S(heroStatsAndDefenseBonusDiff) + " and damage bonus " + R2S(damageBonusDiff) + " and hit points bonus " + R2S(hitPointsBonusDiff)) + + set i=0 + loop + exitwhen ( i == 20 ) + set whichAbility=BlzGetUnitAbilityByIndex(hero, i) + if ( whichAbility != null and (LoadInteger(WoWReforgedAbilityFields__AbilityFieldCountersHashTable, (BlzGetAbilityId(whichAbility)), 0)) > 0 ) then // INLINED!! + call InscriptorAddAbilityBonusesEx(hero , whichAbility , heroStatsAndDefenseBonusDiff , damageBonusDiff , hitPointsBonusDiff) + endif + set whichAbility=null + set i=i + 1 + endloop + + if ( inscriptionItemsCounter > 0 ) then + call SaveInteger(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS ), ( heroStatsAndDefenseBonus)) // INLINED!! + call SaveReal(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_DAMAGE_BONUS ), (( damageBonus)*1.0)) // INLINED!! + call SaveReal(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS ), (( hitPointsBonus)*1.0)) // INLINED!! + if ( not IsUnitInGroup(hero, WoWReforgedInscriptor___targets) ) then + call GroupAddUnit(WoWReforgedInscriptor___targets, hero) + endif + elseif ( IsUnitInGroup(hero, WoWReforgedInscriptor___targets) ) then + call FlushChildHashtable(WoWReforgedInscriptor___h, GetHandleId((hero))) // INLINED!! + call GroupRemoveUnit(WoWReforgedInscriptor___targets, hero) + endif + + return inscriptionItemsCounter +endfunction + +function InscriptorHeroInfo takes unit hero returns string + local integer oldInscriptionBonusHeroStatAndDefense= (LoadInteger(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HERO_STATS_AND_DEFENSE_BONUS))) // INLINED!! + local real oldInscriptionBonusDamage= (LoadReal(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_DAMAGE_BONUS))) // INLINED!! + local real oldInscriptionBonusHitPoints= (LoadReal(WoWReforgedInscriptor___h, GetHandleId((hero )), ( INSCRIPTOR_SYSTEM_KEY_HIT_POINTS_AND_MANA_BONUS))) // INLINED!! + + if ( oldInscriptionBonusHeroStatAndDefense > 0 ) then + return GetUnitName(hero) + " hero stats/defense/summoned units " + I2S(oldInscriptionBonusHeroStatAndDefense) + ", damage " + I2S(R2I(oldInscriptionBonusDamage)) + ", hp/mana " + I2S(R2I(oldInscriptionBonusHitPoints)) + endif + + return null +endfunction + +function InscriptorInfo takes player whichPlayer returns string + local string text= "Inscriptable spells: " + AbilityFieldsListNonItemAbilities() + //local group heroes = GetUnitsSelectedAll(whichPlayer) // TODO Desync. + local group heroes= GetPlayerHeroes(whichPlayer) + local unit hero= null + local string heroTxt= "" + local string txt= null + local integer i= 0 + loop + exitwhen ( i >= BlzGroupGetSize(heroes) ) + set hero=BlzGroupUnitAt(heroes, i) + if ( IsUnitType(hero, UNIT_TYPE_HERO) ) then + set txt=InscriptorHeroInfo(hero) + if ( txt != null ) then + if ( heroTxt != "" ) then + set heroTxt=heroTxt + ", " + endif + + set heroTxt=heroTxt + txt + endif + endif + set hero=null + set i=i + 1 + endloop + call GroupClear(heroes) + call DestroyGroup(heroes) + set heroes=null + + if ( heroTxt != "" ) then + return heroTxt + ", " + text + endif + + return text +endfunction + +function DisplayInscriptorHeroInfo takes player whichPlayer,unit hero returns nothing + local string txt= InscriptorHeroInfo(hero) + if ( txt != null ) then + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, txt) + endif +endfunction + +function WoWReforgedInscriptor___TriggerConditionPickupItem takes nothing returns boolean + if ( (IsUnitInGroup((GetTriggerUnit()), WoWReforgedInscriptor___targets)) ) then // INLINED!! + return true + endif + + return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetUnitTypeId(GetTriggerUnit()) != BACK_PACK and GetUnitTypeId(GetTriggerUnit()) != EQUIPMENT_BAG and ( GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_NOVICE or GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_ADEPT or GetItemTypeId(GetManipulatedItem()) == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) +endfunction + +function WoWReforgedInscriptor___TriggerActionSetHeroBonus takes nothing returns nothing + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + local item manipulatedItem= GetManipulatedItem() + if ( GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_NOVICE or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADEPT or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) then + call InscriptorSetHeroBonus(triggerUnit) + //call DisplayInscriptorHeroInfo(owner, triggerUnit) + endif + set manipulatedItem=null + set triggerUnit=null + set owner=null +endfunction + +function WoWReforgedInscriptor___TriggerConditionDropItem takes nothing returns boolean + return (IsUnitInGroup((GetTriggerUnit()), WoWReforgedInscriptor___targets)) // INLINED!! +endfunction + +function WoWReforgedInscriptor___TriggerActionSetHeroBonusDrop takes nothing returns nothing + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + local item manipulatedItem= GetManipulatedItem() + call TriggerSleepAction(0.0) + if ( GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_NOVICE or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADVANCED or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_ADEPT or GetItemTypeId(manipulatedItem) == INSCRIPTOR_ITEM_TYPE_ID_MASTER ) then + call InscriptorSetHeroBonus(triggerUnit) + //call DisplayInscriptorHeroInfo(owner, triggerUnit) + endif + set manipulatedItem=null + set triggerUnit=null + set owner=null +endfunction + +function WoWReforgedInscriptor___TriggerConditionLearn takes nothing returns boolean + return (IsUnitInGroup((GetTriggerUnit()), WoWReforgedInscriptor___targets)) or GetLearnedSkill() == INSCRIPTION_HERO_SPELL // INLINED!! +endfunction + +function WoWReforgedInscriptor___TriggerActionLearn takes nothing returns nothing + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + call InscriptorSetHeroBonus(triggerUnit) + //call DisplayInscriptorHeroInfo(owner, triggerUnit) + set triggerUnit=null + set owner=null +endfunction + +function WoWReforgedInscriptor___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedInscriptor___pickupItemTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) + call TriggerAddCondition(WoWReforgedInscriptor___pickupItemTrigger, Condition(function WoWReforgedInscriptor___TriggerConditionPickupItem)) + call TriggerAddAction(WoWReforgedInscriptor___pickupItemTrigger, function WoWReforgedInscriptor___TriggerActionSetHeroBonus) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedInscriptor___dropItemTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) + call TriggerAddCondition(WoWReforgedInscriptor___dropItemTrigger, Condition(function WoWReforgedInscriptor___TriggerConditionDropItem)) + call TriggerAddAction(WoWReforgedInscriptor___dropItemTrigger, function WoWReforgedInscriptor___TriggerActionSetHeroBonusDrop) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedInscriptor___learnTrigger, EVENT_PLAYER_HERO_SKILL) + call TriggerAddCondition(WoWReforgedInscriptor___learnTrigger, Condition(function WoWReforgedInscriptor___TriggerConditionLearn)) + call TriggerAddAction(WoWReforgedInscriptor___learnTrigger, function WoWReforgedInscriptor___TriggerActionLearn) +endfunction + + +//library WoWReforgedInscriptor ends +//library WoWReforgedMounts: + + + + +function IsUnitMount takes unit mount returns boolean + return HaveSavedHandle(WoWReforgedMounts___h, GetHandleId(mount), WoWReforgedMounts___KEY_HERO) +endfunction + +function MountGet takes unit hero returns unit + if ( HaveSavedHandle(WoWReforgedMounts___h, GetHandleId(hero), WoWReforgedMounts___KEY_MOUNT) ) then + return LoadUnitHandle(WoWReforgedMounts___h, GetHandleId(hero), WoWReforgedMounts___KEY_MOUNT) + endif + + return null +endfunction + +function MountClear takes unit hero returns nothing + local unit mount= LoadUnitHandle(WoWReforgedMounts___h, GetHandleId(hero), WoWReforgedMounts___KEY_MOUNT) + if ( mount != null ) then + call FlushChildHashtable(WoWReforgedMounts___h, GetHandleId(mount)) + set mount=null + endif + call FlushChildHashtable(WoWReforgedMounts___h, GetHandleId(hero)) +endfunction + +function GetMount1 takes player whichPlayer returns unit + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null and MountGet((udg_Hero[GetPlayerId((whichPlayer))])) != null ) then // INLINED!! + return MountGet((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! + endif + return null +endfunction + +function GetMount2 takes player whichPlayer returns unit + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null and MountGet((udg_Hero2[GetPlayerId((whichPlayer))])) != null ) then // INLINED!! + return MountGet((udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! + endif + return null +endfunction + +function GetMount3 takes player whichPlayer returns unit + if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null and MountGet((udg_Hero3[GetPlayerId((whichPlayer))])) != null ) then // INLINED!! + return MountGet((udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! + endif + return null +endfunction + +function WoWReforgedMounts___GetMountData takes unit mount returns integer + local player owner= GetOwningPlayer(mount) + local integer playerId= GetPlayerId(owner) + if ( GetMount2(owner) == mount ) then + return WoWReforgedMounts___mountData2[playerId] + elseif ( GetMount3(owner) == mount ) then + return WoWReforgedMounts___mountData3[playerId] + endif + return WoWReforgedMounts___mountData1[playerId] +endfunction + +function AddMountAbility takes unit mount,integer abilityId returns nothing + local integer mountData= WoWReforgedMounts___GetMountData(mount) + if ( mountData != 0 ) then + if ( s__MountData_abilityIdsCount[mountData] < WoWReforgedMounts___MAX_ABILITIES ) then + set s___MountData_abilityIds[s__MountData_abilityIds[mountData]+s__MountData_abilityIdsCount[mountData]]=abilityId + set s__MountData_abilityIdsCount[mountData]=s__MountData_abilityIdsCount[mountData] + 1 + else + call SimError(GetOwningPlayer(mount) , "Reached maximum of mount abilities.") + endif + endif +endfunction + +function ClearMountAbilities takes unit mount returns nothing + local integer mountData= WoWReforgedMounts___GetMountData(mount) + if ( mountData != 0 ) then + set s__MountData_abilityIdsCount[mountData]=0 + endif +endfunction + +function WoWReforgedMounts___RestoreMountAbilities takes unit mount returns nothing + local integer mountData= WoWReforgedMounts___GetMountData(mount) + local integer count= 0 + local integer i= 0 + if ( mountData != 0 ) then + set count=s__MountData_abilityIdsCount[mountData] + loop + exitwhen ( i == count ) + call UnitAddAbility(mount, s___MountData_abilityIds[s__MountData_abilityIds[mountData]+i]) + set i=i + 1 + endloop + endif +endfunction + +function SetMountName1 takes player whichPlayer,string name returns nothing + set s__MountData_name[WoWReforgedMounts___mountData1[GetPlayerId(whichPlayer)]]=name + if ( GetMount1(whichPlayer) != null ) then + if ( StringLength(name) == 0 ) then + call BlzSetUnitName(GetMount1(whichPlayer), GetObjectName(GetUnitTypeId(GetMount1(whichPlayer)))) + else + call BlzSetUnitName(GetMount1(whichPlayer), name) + endif + endif +endfunction + +function GetMountName1 takes player whichPlayer returns string + return s__MountData_name[WoWReforgedMounts___mountData1[GetPlayerId(whichPlayer)]] +endfunction + +function SetMountName2 takes player whichPlayer,string name returns nothing + set s__MountData_name[WoWReforgedMounts___mountData2[GetPlayerId(whichPlayer)]]=name + if ( GetMount2(whichPlayer) != null ) then + if ( StringLength(name) == 0 ) then + call BlzSetUnitName(GetMount2(whichPlayer), GetObjectName(GetUnitTypeId(GetMount2(whichPlayer)))) + else + call BlzSetUnitName(GetMount2(whichPlayer), name) + endif + endif +endfunction + +function GetMountName2 takes player whichPlayer returns string + return s__MountData_name[WoWReforgedMounts___mountData2[GetPlayerId(whichPlayer)]] +endfunction + +function SetMountName3 takes player whichPlayer,string name returns nothing + set s__MountData_name[WoWReforgedMounts___mountData3[GetPlayerId(whichPlayer)]]=name + if ( GetMount3(whichPlayer) != null ) then + if ( StringLength(name) == 0 ) then + call BlzSetUnitName(GetMount3(whichPlayer), GetObjectName(GetUnitTypeId(GetMount3(whichPlayer)))) + else + call BlzSetUnitName(GetMount3(whichPlayer), name) + endif + endif +endfunction + +function GetMountName3 takes player whichPlayer returns string + return s__MountData_name[WoWReforgedMounts___mountData3[GetPlayerId(whichPlayer)]] +endfunction + +function MountKill takes unit hero returns nothing + local unit mount= MountGet(hero) + if ( mount != null ) then + call KillUnit(mount) // in case there are transported units + endif + set mount=null + call MountClear(hero) +endfunction + +function MountKill1 takes player whichPlayer returns nothing + call MountKill(udg_Hero[GetPlayerId(whichPlayer)]) +endfunction + +function MountKill2 takes player whichPlayer returns nothing + call MountKill(udg_Hero2[GetPlayerId(whichPlayer)]) +endfunction + +function MountKill3 takes player whichPlayer returns nothing + call MountKill(udg_Hero3[GetPlayerId(whichPlayer)]) +endfunction + +function MountReplace takes unit hero,unit mount returns nothing + local player owner= GetOwningPlayer(hero) + call MountKill(hero) + call SaveUnitHandle(WoWReforgedMounts___h, GetHandleId(hero), WoWReforgedMounts___KEY_MOUNT, mount) + call SaveUnitHandle(WoWReforgedMounts___h, GetHandleId(mount), WoWReforgedMounts___KEY_HERO, hero) + if ( hero == (udg_Hero[GetPlayerId((owner))]) and StringLength((s__MountData_name[WoWReforgedMounts___mountData1[GetPlayerId((owner))]])) > 0 ) then // INLINED!! + call BlzSetUnitName(mount, (s__MountData_name[WoWReforgedMounts___mountData1[GetPlayerId((owner))]])) // INLINED!! + call WoWReforgedMounts___RestoreMountAbilities(mount) + elseif ( hero == (udg_Hero2[GetPlayerId((owner))]) and StringLength((s__MountData_name[WoWReforgedMounts___mountData2[GetPlayerId((owner))]])) > 0 ) then // INLINED!! + call BlzSetUnitName(mount, (s__MountData_name[WoWReforgedMounts___mountData2[GetPlayerId((owner))]])) // INLINED!! + call WoWReforgedMounts___RestoreMountAbilities(mount) + elseif ( hero == (udg_Hero3[GetPlayerId((owner))]) and StringLength((s__MountData_name[WoWReforgedMounts___mountData3[GetPlayerId((owner))]])) > 0 ) then // INLINED!! + call BlzSetUnitName(mount, (s__MountData_name[WoWReforgedMounts___mountData3[GetPlayerId((owner))]])) // INLINED!! + call WoWReforgedMounts___RestoreMountAbilities(mount) + endif + set owner=null +endfunction + +function MountGetAll takes player whichPlayer returns group + local group result= CreateGroup() + local integer playerId= GetPlayerId(whichPlayer) + + if ( udg_Hero[playerId] != null and MountGet(udg_Hero[playerId]) != null ) then + call GroupAddUnit(result, MountGet(udg_Hero[playerId])) + endif + + if ( udg_Hero2[playerId] != null and MountGet(udg_Hero2[playerId]) != null ) then + call GroupAddUnit(result, MountGet(udg_Hero2[playerId])) + endif + + if ( udg_Hero3[playerId] != null and MountGet(udg_Hero3[playerId]) != null ) then + call GroupAddUnit(result, MountGet(udg_Hero3[playerId])) + endif + + return result +endfunction + +function MountKillAll takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + + if ( udg_Hero[playerId] != null and MountGet(udg_Hero[playerId]) != null ) then + call MountKill(udg_Hero[playerId]) + endif + + if ( udg_Hero2[playerId] != null and MountGet(udg_Hero2[playerId]) != null ) then + call MountKill(udg_Hero2[playerId]) + endif + + if ( udg_Hero3[playerId] != null and MountGet(udg_Hero3[playerId]) != null ) then + call MountKill(udg_Hero[playerId]) + endif +endfunction + +function MountClearAll takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + + if ( udg_Hero[playerId] != null ) then + call MountClear(udg_Hero[playerId]) + endif + + if ( udg_Hero2[playerId] != null ) then + call MountClear(udg_Hero2[playerId]) + endif + + if ( udg_Hero3[playerId] != null ) then + call MountClear(udg_Hero[playerId]) + endif +endfunction + +function SelectNextMount takes player whichPlayer returns unit + local group mounts= MountGetAll(whichPlayer) + local unit result= GetNextUnitToSelect(mounts , whichPlayer) + call GroupClear(mounts) + call DestroyGroup(mounts) + set mounts=null + + if ( result != null ) then + call SelectUnitForPlayerSingle(result, whichPlayer) + call SmartCameraPanToUnit(whichPlayer , result , 0.0) + else + call SimError(whichPlayer , "No mounts.") + endif + + return result +endfunction + + + function s__WoWReforgedMounts___M_create takes integer unitTypeId,integer abilityId,integer itemTypeId,boolean bonus returns integer + local integer this= s__WoWReforgedMounts___M__allocate() + set s__WoWReforgedMounts___M_unitTypeId[this]=unitTypeId + set s__WoWReforgedMounts___M_abilityId[this]=abilityId + set s__WoWReforgedMounts___M_itemTypeId[this]=itemTypeId + set s__WoWReforgedMounts___M_bonus[this]=bonus + return this + endfunction + + +function GetMountTypesMax takes nothing returns integer + return WoWReforgedMounts___mountTypesCounter +endfunction + +function GetPlayerHasMounts takes player whichPlayer returns boolean + return WoWReforgedMounts___playerHasMounts[GetPlayerId(whichPlayer)] +endfunction + +function GetMountType takes integer index returns integer + return WoWReforgedMounts___mountTypes[index] +endfunction + +function WoWReforgedMounts___MakeMountTypesAvailable takes player whichPlayer,boolean available returns nothing + local integer max= (WoWReforgedMounts___mountTypesCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i >= max ) + call SetPlayerAbilityAvailable(whichPlayer, s__WoWReforgedMounts___M_abilityId[(WoWReforgedMounts___mountTypes[(i)])], available) // INLINED!! + set i=i + 1 + endloop +endfunction + +function WoWReforgedMounts___SetPlayerHasMounts takes player whichPlayer,boolean flag returns nothing + set WoWReforgedMounts___playerHasMounts[GetPlayerId(whichPlayer)]=flag + call WoWReforgedMounts___MakeMountTypesAvailable(whichPlayer , flag) +endfunction + +function GetMountTypeByItemTypeId takes integer itemTypeId returns integer + local integer max= (WoWReforgedMounts___mountTypesCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i >= max ) + if ( s__WoWReforgedMounts___M_itemTypeId[(WoWReforgedMounts___mountTypes[(i)])] == itemTypeId ) then // INLINED!! + return (WoWReforgedMounts___mountTypes[(i)]) // INLINED!! + endif + set i=i + 1 + endloop + return 0 +endfunction + +function WoWReforgedMounts___GetMountTypeByUnitTypeId takes integer unitTypeId returns integer + local integer max= (WoWReforgedMounts___mountTypesCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i >= max ) + if ( s__WoWReforgedMounts___M_unitTypeId[(WoWReforgedMounts___mountTypes[(i)])] == unitTypeId ) then // INLINED!! + return (WoWReforgedMounts___mountTypes[(i)]) // INLINED!! + endif + set i=i + 1 + endloop + return 0 +endfunction + +function WoWReforgedMounts___GetMountTypeByAbilityId takes integer abilityId returns integer + local integer max= (WoWReforgedMounts___mountTypesCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i >= max ) + if ( s__WoWReforgedMounts___M_abilityId[(WoWReforgedMounts___mountTypes[(i)])] == abilityId ) then // INLINED!! + return (WoWReforgedMounts___mountTypes[(i)]) // INLINED!! + endif + set i=i + 1 + endloop + return 0 +endfunction + +function GetHeroMountUnitTypeId takes unit hero returns integer + local integer mount= 0 + local integer abilityId= 0 + local integer max= 10 + local integer i= 0 + loop + exitwhen ( i >= max ) + if ( BlzGetUnitAbilityByIndex(hero, i) != null ) then + set abilityId=BlzGetAbilityId(BlzGetUnitAbilityByIndex(hero, i)) + if ( abilityId != 0 ) then + set mount=WoWReforgedMounts___GetMountTypeByAbilityId(abilityId) + if ( mount != 0 ) then + return s__WoWReforgedMounts___M_unitTypeId[mount] + endif + endif + endif + set i=i + 1 + endloop + return 0 +endfunction + +function IsMount takes integer unitTypeId returns boolean + return WoWReforgedMounts___GetMountTypeByUnitTypeId(unitTypeId) != 0 +endfunction + + +function WoWReforgedMounts___ForForceMakeNotAvailable takes nothing returns nothing + call SetPlayerAbilityAvailable(GetEnumPlayer(), WoWReforgedMounts___tmpAbilityId, false) +endfunction + +function WoWReforgedMounts___MakeMountTypesNotAvailable takes integer abilityId returns nothing + set WoWReforgedMounts___tmpAbilityId=abilityId + call ForForce(GetPlayersAll(), function WoWReforgedMounts___ForForceMakeNotAvailable) +endfunction + +function AddMountType takes nothing returns integer + local integer index= WoWReforgedMounts___mountTypesCounter + local integer m= s__WoWReforgedMounts___M_create(udg_TmpUnitType , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpBoolean) + set WoWReforgedMounts___mountTypes[index]=m + set WoWReforgedMounts___mountTypesCounter=WoWReforgedMounts___mountTypesCounter + 1 + call WoWReforgedMounts___MakeMountTypesNotAvailable(udg_TmpAbilityCode) + set udg_TmpBoolean=false + return m +endfunction + + +function RemoveRunningWildAbilities takes unit hero returns nothing + call UnitRemoveAbility(hero, WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATH_KNIGHT) + call UnitRemoveAbility(hero, WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATHCLAW) + call UnitRemoveAbility(hero, WoWReforgedMounts_RUNNING_WILD_GREYMANE) +endfunction + +function WoWReforgedMounts___GetRunningWildAbilityId takes integer unitTypeId returns integer + if ( unitTypeId == WoWReforgedMounts_WORGEN_DEATH_KNIGHT ) then + return WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATH_KNIGHT + elseif ( unitTypeId == WoWReforgedMounts_WORGEN_DEATHCLAW ) then + return WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATHCLAW + elseif ( unitTypeId == WoWReforgedMounts_WORGEN_GREYMANE ) then + return WoWReforgedMounts_RUNNING_WILD_GREYMANE + endif + return - 1 +endfunction + +function WoWReforgedMounts___IsWorgenHero takes integer unitTypeId returns boolean + return unitTypeId == WoWReforgedMounts_WORGEN_DEATH_KNIGHT or unitTypeId == WoWReforgedMounts_WORGEN_DEATHCLAW +endfunction + +function WoWReforgedMounts___IsEvokerHero takes integer unitTypeId returns boolean + return unitTypeId == WoWReforgedMounts_EVOKER +endfunction + +function WoWReforgedMounts___RemoveMountTypeAbilities takes unit hero returns nothing + local integer max= (WoWReforgedMounts___mountTypesCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i >= max ) + call UnitRemoveAbility(hero, s__WoWReforgedMounts___M_abilityId[(WoWReforgedMounts___mountTypes[(i)])]) // INLINED!! + set i=i + 1 + endloop + call RemoveRunningWildAbilities(hero) +endfunction + +function WoWReforgedMounts___ReplaceMountType takes unit hero,integer m returns nothing + local integer abilityId= s__WoWReforgedMounts___M_abilityId[m] + local boolean isRunningWild= s__WoWReforgedMounts___M_itemTypeId[m] == WoWReforgedMounts_RUNNING_WILD_ITEM_TYPE_ID + call WoWReforgedMounts___RemoveMountTypeAbilities(hero) + if ( isRunningWild ) then + set abilityId=WoWReforgedMounts___GetRunningWildAbilityId(GetUnitTypeId(hero)) + endif + if ( abilityId != - 1 ) then + call UnitAddAbility(hero, s__WoWReforgedMounts___M_abilityId[m]) + call UnitMakeAbilityPermanent(hero, true, s__WoWReforgedMounts___M_abilityId[m]) + else + call SimError(GetOwningPlayer(hero) , "Unable to add mount ability.") + endif +endfunction + +function WoWReforgedMounts___TriggerConditionSellMount takes nothing returns boolean + local unit hero= GetBuyingUnit() + local player owner= GetOwningPlayer(hero) + local integer unitTypeId= GetUnitTypeId(hero) + local integer itemTypeId= GetItemTypeId(GetSoldItem()) + local integer m= GetMountTypeByItemTypeId(itemTypeId) + if ( m != 0 ) then + if ( not s__WoWReforgedMounts___M_bonus[m] or udg_UnlockedAll or GetHeroLevel1(owner) >= HERO_JOURNEY_BONUS_MOUNTS or (IsPlayerInForce((owner), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! + if ( PlayerHasUnlocked(owner , s__WoWReforgedMounts___M_unitTypeId[m]) ) then + if ( unitTypeId != BACK_PACK and unitTypeId != EQUIPMENT_BAG ) then + if ( (WoWReforgedMounts___playerHasMounts[GetPlayerId((owner))]) or udg_UnlockedAll ) then // INLINED!! + if ( itemTypeId != WoWReforgedMounts_RUNNING_WILD_ITEM_TYPE_ID or WoWReforgedMounts___IsWorgenHero(unitTypeId) ) then + if ( itemTypeId != WoWReforgedMounts_DRAGON_FORM_ITEM_TYPE_ID or ((unitTypeId) == WoWReforgedMounts_EVOKER) ) then // INLINED!! + call WoWReforgedMounts___ReplaceMountType(hero , m) + call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Adding mount " + GetObjectName(s__WoWReforgedMounts___M_unitTypeId[m])) + else + call SimError(owner , "Only Dracthyr heroes can learn this.") + endif + else + call SimError(owner , "Only Worgen heroes can learn this.") + endif + else + call SimError(owner , "Your hero must be level " + I2S(HERO_JOURNEY_MOUNTS) + " or higher.") + endif + else + call SimError(owner , "Only your heroes can change their mounts.") + endif + else + call SimError(owner , "The mount is restricted to account names: " + GetAllUnlockedAccountNames(s__WoWReforgedMounts___M_unitTypeId[m])) + endif + else + call SimError(owner , "Bonus mounts require VIPs, hero level " + I2S(HERO_JOURNEY_BONUS_MOUNTS) + " or -unlock.") + endif + endif + set hero=null + set owner=null + return false +endfunction + +function WoWReforgedMounts___TriggerConditionLevel takes nothing returns boolean + local unit hero= GetLevelingUnit() + local player owner= GetOwningPlayer(hero) + if ( (udg_Hero[GetPlayerId((owner))]) == hero and GetHeroLevel(hero) >= WoWReforgedMounts_MOUNTS_HERO_LEVEL and not (WoWReforgedMounts___playerHasMounts[GetPlayerId((owner))]) ) then // INLINED!! + call WoWReforgedMounts___SetPlayerHasMounts(owner , true) + endif + set hero=null + set owner=null + + return false +endfunction + +function WoWReforgedMounts___TriggerConditionSummonMount takes nothing returns boolean + local unit hero= GetSummoningUnit() + local unit mount= GetSummonedUnit() + if ( WoWReforgedMounts___GetMountTypeByUnitTypeId(GetUnitTypeId(mount)) != 0 ) then + call MountReplace(hero , mount) + endif + set hero=null + set mount=null + + return false +endfunction + +function WoWReforgedMounts___AddMountTypesToShop takes unit shop returns nothing + local integer max= (WoWReforgedMounts___mountTypesCounter) // INLINED!! + local integer i= 0 + call EnablePagedButtons(shop) + loop + exitwhen ( i >= max ) +call AddPagedButtonsId((shop ) , ( s__WoWReforgedMounts___M_itemTypeId[(WoWReforgedMounts___mountTypes[(i)])]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop +endfunction + +function WoWReforgedMounts___TriggerConditionConstructionFinish takes nothing returns boolean + local unit shop= GetConstructedStructure() + if ( GetUnitTypeId(shop) == WoWReforgedMounts_MOUNTS_CAGE ) then + call WoWReforgedMounts___AddMountTypesToShop(shop) + endif + set shop=null + return false +endfunction + +function WoWReforgedMounts___ForGroupAddShop takes nothing returns nothing + call WoWReforgedMounts___AddMountTypesToShop(GetEnumUnit()) +endfunction + +function AddMountShops takes nothing returns nothing + local group shops= GetUnitsOfTypeIdAll(MOUNTS_SHOP) + call ForGroup(shops, function WoWReforgedMounts___ForGroupAddShop) + call GroupClear(shops) + call DestroyGroup(shops) + set shops=null +endfunction + +function WoWReforgedMounts___Init takes nothing returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set WoWReforgedMounts___mountData1[i]=s__MountData__allocate() + set WoWReforgedMounts___mountData2[i]=s__MountData__allocate() + set WoWReforgedMounts___mountData3[i]=s__MountData__allocate() + set i=i + 1 + endloop + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedMounts___sellTrigger, Condition(function WoWReforgedMounts___TriggerConditionSellMount)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts___levelTrigger, EVENT_PLAYER_HERO_LEVEL) + call TriggerAddCondition(WoWReforgedMounts___levelTrigger, Condition(function WoWReforgedMounts___TriggerConditionLevel)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedMounts___summonTrigger, Condition(function WoWReforgedMounts___TriggerConditionSummonMount)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedMounts___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedMounts___constructionTrigger, Condition(function WoWReforgedMounts___TriggerConditionConstructionFinish)) +endfunction + + +//library WoWReforgedMounts ends +//library WoWReforgedRaces: + + + +function GetPlayerRace1 takes player whichPlayer returns integer + return udg_PlayerRace[GetConvertedPlayerId(whichPlayer)] +endfunction + +function GetPlayerRace2 takes player whichPlayer returns integer + return udg_PlayerRace2[GetConvertedPlayerId(whichPlayer)] +endfunction + +function GetPlayerRace3 takes player whichPlayer returns integer + return udg_PlayerRace3[GetConvertedPlayerId(whichPlayer)] +endfunction + +function PlayerHasRace takes player whichPlayer,integer whichRace returns boolean + return (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) == whichRace or (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) == whichRace or (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) == whichRace // INLINED!! +endfunction + +function IsRaceUnit takes integer t returns boolean + if ( t == RACE_OBJECT_TYPE_WORKER ) then + return true + elseif ( t == RACE_OBJECT_TYPE_MALE_CITIZEN ) then + return true + elseif ( t == RACE_OBJECT_TYPE_FEMALE_CITIZEN ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TOWN_HALL_4 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_PET ) then + return true + elseif ( t == RACE_OBJECT_TYPE_FOOTMAN ) then + return true + elseif ( t == RACE_OBJECT_TYPE_RIFLEMAN ) then + return true + elseif ( t == RACE_OBJECT_TYPE_KNIGHT ) then + return true + elseif ( t == RACE_OBJECT_TYPE_PRIEST ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SORCERESS ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SPELLBREAKER ) then + return true + elseif ( t == RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SIEGE_ENGINE ) then + return true + elseif ( t == RACE_OBJECT_TYPE_MORTAR ) then + return true + elseif ( t == RACE_OBJECT_TYPE_GRYPHON ) then + return true + elseif ( t == RACE_OBJECT_TYPE_DRAGONHAWK ) then + return true + elseif ( t == RACE_OBJECT_TYPE_AVIARY_3 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_AVIARY_4 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TAUREN ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHADE ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TRANSPORT_SHIP ) then + return true + elseif ( t == RACE_OBJECT_TYPE_FRIGATE ) then + return true + elseif ( t == RACE_OBJECT_TYPE_BATTLESHIP ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_1 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_2 ) then + return true + endif + return false +endfunction + +function IsRaceItem takes integer t returns boolean + if ( t == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TIER_1_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TIER_2_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TIER_3_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_FARM_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_ALTAR_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_MILL_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_BLACK_SMITH_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_BARRACKS_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHOP_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_GUARD_TOWER_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_CANNON_TOWER_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_WORKSHOP_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_HOUSING_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHIPYARD_ITEM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM ) then + return true + endif + return false +endfunction + +function IsRaceBuilding takes integer t returns boolean + if ( t == RACE_OBJECT_TYPE_FARM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_ALTAR ) then + return true + elseif ( t == RACE_OBJECT_TYPE_MILL ) then + return true + elseif ( t == RACE_OBJECT_TYPE_BLACK_SMITH ) then + return true + elseif ( t == RACE_OBJECT_TYPE_BARRACKS ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHOP ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SCOUT_TOWER ) then + return true + elseif ( t == RACE_OBJECT_TYPE_GUARD_TOWER ) then + return true + elseif ( t == RACE_OBJECT_TYPE_CANNON_TOWER ) then + return true + elseif ( t == RACE_OBJECT_TYPE_ARCANE_TOWER ) then + return true + elseif ( t == RACE_OBJECT_TYPE_ARCANE_SANCTUM ) then + return true + elseif ( t == RACE_OBJECT_TYPE_WORKSHOP ) then + return true + elseif ( t == RACE_OBJECT_TYPE_GRYPHON_AVIARY ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SACRIFICAL_PIT ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TIER_1 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TIER_2 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_TIER_3 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_HOUSING ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHIPYARD ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SPECIAL_BUILDING ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 ) then + return true + endif + return false +endfunction + +function IsWaterRaceUnit takes integer t returns boolean + if ( t == RACE_OBJECT_TYPE_TRANSPORT_SHIP ) then + return true + elseif ( t == RACE_OBJECT_TYPE_FRIGATE ) then + return true + elseif ( t == RACE_OBJECT_TYPE_BATTLESHIP ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_1 ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SHIP_SPECIAL_2 ) then + return true + endif + return false +endfunction + +function SetRaceObjectType takes integer whichRace,integer objectType,integer objectTypeId returns nothing + call SaveInteger(WoWReforgedRaces__objectTypeHashTable, objectTypeId, whichRace, objectType) + call SaveInteger(WoWReforgedRaces__objectTypeIdHashTable, objectType, whichRace, objectTypeId) +endfunction + +function GetRaceObjectType takes integer whichRace,integer objectTypeId returns integer + return LoadInteger(WoWReforgedRaces__objectTypeHashTable, objectTypeId, whichRace) +endfunction + +function GetRaceObjectTypeIncludingDependencyEquivalents takes integer whichRace,integer objectTypeId returns integer + return GetRaceObjectType(whichRace , GetPrimaryDependencyEquivalent(objectTypeId)) +endfunction + +function GetRaceObjectTypeId takes integer whichRace,integer objectType returns integer + return LoadInteger(WoWReforgedRaces__objectTypeIdHashTable, objectType, whichRace) +endfunction + +function GetObjectRace takes integer objectTypeId returns integer + local integer id= GetPrimaryDependencyEquivalent(objectTypeId) + local integer i= 0 + loop + exitwhen ( i == udg_MaxRaces ) + if ( GetRaceObjectType(i , id) != RACE_OBJECT_TYPE_NONE ) then + return i + endif + set i=i + 1 + endloop + + return udg_RaceNone +endfunction + +function IsWater takes integer unitTypeId returns boolean + if ( IsWaterRaceUnit(GetObjectRace(unitTypeId)) ) then + return true + endif + + if ( unitTypeId == GNOMISH_SUBMARINE ) then + return true + elseif ( unitTypeId == ENGINEER_SHIP ) then + return true + endif + + return false +endfunction + +function IsWaterUnit takes unit whichUnit returns boolean + return ConvertMoveType(BlzGetUnitIntegerField(whichUnit, UNIT_IF_MOVE_TYPE)) == MOVE_TYPE_FLOAT +endfunction + +function GetObjectRaceType takes integer objectTypeId returns integer + local integer i= 0 + local integer tmpType= 0 + local integer result= RACE_OBJECT_TYPE_NONE + loop + exitwhen ( i >= udg_MaxRaces or result != RACE_OBJECT_TYPE_NONE ) + set tmpType=(GetRaceObjectType((i ) , GetPrimaryDependencyEquivalent(( objectTypeId)))) // INLINED!! + if ( tmpType != RACE_OBJECT_TYPE_NONE ) then + set result=tmpType + endif + set i=i + 1 + endloop + + return result +endfunction + +function IsShip takes integer id returns boolean + return IsWaterRaceUnit(GetObjectRaceType(id)) +endfunction + +function IsUnitShip takes unit whichUnit returns boolean + return (IsWaterRaceUnit(GetObjectRaceType((GetUnitTypeId(whichUnit))))) // INLINED!! +endfunction + +function MapRaceObjectType takes integer objectTypeId,integer targetRace returns integer + local integer i= 0 + local integer tmpType= 0 + loop + exitwhen ( i == udg_MaxRaces ) + set tmpType=(GetRaceObjectType((i ) , GetPrimaryDependencyEquivalent(( objectTypeId)))) // INLINED!! + if ( tmpType != RACE_OBJECT_TYPE_NONE ) then + return GetRaceObjectTypeId(targetRace , tmpType) + endif + set i=i + 1 + endloop + + return 0 +endfunction + +function GetBuildingRace takes integer buildingID returns integer + return GetObjectRace(buildingID) +endfunction + +function IsUnitAllRaces takes integer unitTypeId returns boolean + if ( unitTypeId == SAPPER ) then + return true + elseif ( unitTypeId == SHREDDER ) then + return true + elseif ( unitTypeId == DRILLBOT ) then + return true + elseif ( unitTypeId == HARVEST_CART ) then + return true + elseif ( unitTypeId == ZEPPELIN ) then + return true + elseif ( unitTypeId == GNOMISH_SUBMARINE ) then + return true + elseif ( unitTypeId == ENGINEER_SHIP ) then + return true + elseif ( unitTypeId == PACK_HORSE_PACKED ) then + return true + elseif ( unitTypeId == PACK_HORSE ) then + return true + endif + return false +endfunction + +// exclude certain buildings since every race can build them +function IsBuildingAllRaces takes integer buildingID returns boolean + if ( buildingID == POWER_GENERATOR ) then + return true + elseif ( buildingID == PORTAL ) then + return true + elseif ( buildingID == RESEARCH_TENT ) then + return true + elseif ( buildingID == EVENT_HOUSE ) then + return true + elseif ( buildingID == CRAFTING_STASH ) then + return true + elseif ( buildingID == MARKETPLACE ) then + return true + elseif ( buildingID == TRADING_POST ) then + return true + elseif ( buildingID == ANTIMAGIC_WARD ) then + return true + elseif ( buildingID == ARMORY ) then + return true + elseif ( buildingID == BANNER_SHOP ) then + return true + elseif ( buildingID == THIEVES_GUILD ) then + return true + elseif ( buildingID == SPELL_BOOK ) then + return true + elseif ( buildingID == MOUNTS_CAGE ) then + return true + elseif ( buildingID == ALCHEMIST_LAB ) then + return true + elseif ( buildingID == WITCH_HUT ) then + return true + elseif ( buildingID == HERO_ABILITIES ) then + return true + elseif ( buildingID == SKINS ) then + return true + elseif ( buildingID == TEMPLE_OF_DARKNESS ) then + return true + elseif ( buildingID == TEMPLE_OF_LIGHT ) then // Temple of Light + return true + elseif ( buildingID == CLAN_HALL ) then // Clan Hall + return true + elseif ( buildingID == CLAN_TOWER ) then // Clan Tower + return true + elseif ( buildingID == ADVANCED_CLAN_TOWER ) then // Advanced Clan Tower + return true + elseif ( buildingID == WATER_TOWER ) then + return true + elseif ( buildingID == ADVANCED_WATER_TOWER ) then + return true + // Engineer + elseif ( buildingID == CHEST ) then + return true + elseif ( buildingID == 'h020' ) then // Gate horizontal closed + return true + elseif ( buildingID == 'h021' ) then // Gate horizontal open + return true + elseif ( buildingID == 'nft1' ) then // Flame Tower + return true + elseif ( buildingID == 'nft2' ) then // Advanced Flame Tower + return true + elseif ( buildingID == 'ndt1' ) then // Cold Tower + return true + elseif ( buildingID == 'ndt2' ) then // Advanced Cold Tower + return true + elseif ( buildingID == 'ntt1' ) then // Death Tower + return true + elseif ( buildingID == 'ntx2' ) then // Advanced Death Tower + return true + // Profession Warlock + elseif ( buildingID == FEL_FOUNTAIN_WARLOCK ) then + return true + // Archaeologist + elseif ( buildingID == EXCAVATION_SITE ) then + return true + // Ground Wall + // Main piece and cross + elseif ( buildingID == 'h04Q' ) then + return true + // + // Wall Ends + // North End + elseif ( buildingID == 'h094' ) then + return true + // West End + elseif ( buildingID == 'h04S' ) then + return true + // East End + elseif ( buildingID == 'h093' ) then + return true + // South End + elseif ( buildingID == 'h095' ) then + return true + // + // Wall T-Cross + // North End + elseif ( buildingID == 'h0DP' ) then + return true + // South End + elseif ( buildingID == 'h0DQ' ) then + return true + // West End + elseif ( buildingID == 'h0DR' ) then + return true + // East End + elseif ( buildingID == 'h0DS' ) then + return true + // Wall Straight + // Horizontal + elseif ( buildingID == 'h04R' ) then + return true + // Vertical + elseif ( buildingID == 'h096' ) then + return true + // Wall Corner + // South West + elseif ( buildingID == 'h0DT' ) then + return true + // South East + elseif ( buildingID == 'h0DU' ) then + return true + // North East + elseif ( buildingID == 'h0DV' ) then + return true + // North West + elseif ( buildingID == 'h0DW' ) then + return true + // Air Wall + // Main piece and cross + elseif ( buildingID == 'h0DM' ) then + return true + // + // Wall Ends + // North End + elseif ( buildingID == 'h0EO' ) then + return true + // West End + elseif ( buildingID == 'h04S' ) then + return true + // East End + elseif ( buildingID == 'h0EN' ) then + return true + // South End + elseif ( buildingID == 'h095' ) then + return true + // + // Wall T-Cross + // North End + elseif ( buildingID == 'h0EX' ) then + return true + // South End + elseif ( buildingID == 'h0EQ' ) then + return true + // West End + elseif ( buildingID == 'h0EW' ) then + return true + // East End + elseif ( buildingID == 'h0EM' ) then + return true + // Wall Straight + // Horizontal + elseif ( buildingID == 'h0ET' ) then + return true + // Vertical + elseif ( buildingID == 'h0EU' ) then + return true + // Wall Corner + // South West + elseif ( buildingID == 'h0ES' ) then + return true + // South East + elseif ( buildingID == 'h0EY' ) then + return true + // North East + elseif ( buildingID == 'h0EZ' ) then + return true + // North West + elseif ( buildingID == 'h0EP' ) then + return true + // Banners + elseif ( (GetBannerByUnitTypeId((buildingID)) != - 1) ) then // INLINED!! + return true + endif + + return false +endfunction + +function MapAllRacesBuildingIDToItemID takes integer buildingID returns integer + if ( ((buildingID) == WALL) ) then // INLINED!! + return ITEM_TINY_WALL + elseif ( (GetBannerByUnitTypeId((buildingID)) != - 1) ) then // INLINED!! + return MapBannerToItem(buildingID) + endif + + return (LoadInteger(WoWReforgedObjectMappings__h, (buildingID), 0)) // INLINED!! +endfunction + +function GetItemRace takes integer itemID returns integer + return GetObjectRace(itemID) +endfunction + +function GetUnitIDRace takes integer unitID returns integer + return GetObjectRace(unitID) +endfunction + +function MapBuildingID takes integer buildingID,integer targetRace returns integer + return MapRaceObjectType(buildingID , targetRace) +endfunction + +// TODO does depend on the food produced, some farms might be converted into more farms. +function MapBuildingNumber takes integer buildingID,integer targetRace returns integer + return 1 +endfunction + +function MapBuildingIDToItemID takes integer buildingID,integer targetRace returns integer + local integer raceType= GetObjectRaceType(buildingID) + + if ( IsBuildingAllRaces(buildingID) ) then + return MapAllRacesBuildingIDToItemID(buildingID) + elseif ( raceType == RACE_OBJECT_TYPE_TIER_1 ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_TIER_1_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_TIER_2 ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_TIER_2_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_TIER_3 ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_TIER_3_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_FARM ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_FARM_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_ALTAR ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_ALTAR_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_MILL ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_MILL_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_BLACK_SMITH ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_SHOP ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SHOP_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_BARRACKS ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_BARRACKS_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_SCOUT_TOWER ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_GUARD_TOWER ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_CANNON_TOWER ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_ARCANE_TOWER ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_ARCANE_SANCTUM ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_WORKSHOP ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_WORKSHOP_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_GRYPHON_AVIARY ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_SACRIFICAL_PIT ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_HOUSING ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_HOUSING_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_SHIPYARD ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SHIPYARD_ITEM) + elseif ( raceType == RACE_OBJECT_TYPE_SPECIAL_BUILDING ) then + return GetRaceObjectTypeId(targetRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM) + endif + + return 0 +endfunction + +function MapUnitID takes integer unitID,integer targetRace,boolean includingWorkers returns integer + local integer raceType= - 1 + if ( not includingWorkers ) then + set raceType=GetObjectRaceType(unitID) + + if ( raceType == RACE_OBJECT_TYPE_WORKER or raceType == RACE_OBJECT_TYPE_MALE_CITIZEN ) then + return 0 + endif + endif + + return MapRaceObjectType(unitID , targetRace) +endfunction + +// TODO does depend on the food produced, some farms might be converted into more farms. +function MapUnitNumber takes integer unitID,integer targetRace returns integer + return 1 +endfunction + +function MapItemID takes integer unitID,integer targetRace returns integer + return MapRaceObjectType(unitID , targetRace) +endfunction + +function GetRaceName takes integer whichRace returns string + return GetObjectName(udg_RaceTavernItemType[whichRace]) +endfunction + +function AddRaceObjectTypeWoWReforged takes nothing returns nothing + call SetRaceObjectType(udg_TmpInteger , udg_TmpInteger2 , udg_TmpUnitType) +endfunction + +function AddRaceItemTypeWoWReforged takes nothing returns nothing + call SetRaceObjectType(udg_TmpInteger , udg_TmpInteger2 , udg_TmpItemTypeId) +endfunction + +function IsCitizen takes integer objectTypeId returns boolean + local integer t= GetObjectRaceType(objectTypeId) + return t == RACE_OBJECT_TYPE_MALE_CITIZEN or t == RACE_OBJECT_TYPE_FEMALE_CITIZEN or t == RACE_OBJECT_TYPE_CHILD +endfunction + +function AddCreep takes integer objectTypeId returns integer + local integer index= WoWReforgedRaces__objectTypeCreepsCounter + set WoWReforgedRaces__objectTypeCreeps[index]=objectTypeId + set WoWReforgedRaces__objectTypeCreepsCounter=WoWReforgedRaces__objectTypeCreepsCounter + 1 + return index +endfunction + +function AddCreepWoWReforged takes nothing returns integer + return AddCreep(udg_TmpUnitType) +endfunction + +function GetCreepsMax takes nothing returns integer + return WoWReforgedRaces__objectTypeCreepsCounter +endfunction + +function GetCreep takes integer index returns integer + return WoWReforgedRaces__objectTypeCreeps[index] +endfunction + +function AddNeutralUnit takes integer objectTypeId returns integer + local integer index= WoWReforgedRaces__objectTypeNeutralUnitsCounter + set WoWReforgedRaces__objectTypeNeutralUnits[index]=objectTypeId + set WoWReforgedRaces__objectTypeNeutralUnitsCounter=WoWReforgedRaces__objectTypeNeutralUnitsCounter + 1 + return index +endfunction + +function AddNeutralUnitWoWReforged takes nothing returns integer + return AddNeutralUnit(udg_TmpUnitType) +endfunction + +function GetNeutralUnitsMax takes nothing returns integer + return WoWReforgedRaces__objectTypeNeutralUnitsCounter +endfunction + +function GetNeutralUnit takes integer index returns integer + return WoWReforgedRaces__objectTypeNeutralUnits[index] +endfunction + +function AddNeutralBuilding takes integer objectTypeId returns integer + local integer index= WoWReforgedRaces__objectTypeNeutralBuildingsCounter + set WoWReforgedRaces__objectTypeNeutralBuildings[index]=objectTypeId + set WoWReforgedRaces__objectTypeNeutralBuildingsCounter=WoWReforgedRaces__objectTypeNeutralBuildingsCounter + 1 + return index +endfunction + +function AddNeutralBuildingWoWReforged takes nothing returns integer + return AddNeutralBuilding(udg_TmpUnitType) +endfunction + +function GetNeutralBuildingsMax takes nothing returns integer + return WoWReforgedRaces__objectTypeNeutralBuildingsCounter +endfunction + +function GetNeutralBuilding takes integer index returns integer + return WoWReforgedRaces__objectTypeNeutralBuildings[index] +endfunction + +function IsNeutralBuilding takes integer unitTypeId returns boolean + local integer i= 0 + local integer max= (WoWReforgedRaces__objectTypeNeutralBuildingsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( unitTypeId == (WoWReforgedRaces__objectTypeNeutralBuildings[(i)]) ) then // INLINED!! + return true + endif + set i=i + 1 + endloop + return false +endfunction + +function IsUnitNeutralBuilding takes unit whichUnit returns boolean + return IsNeutralBuilding(GetUnitTypeId(whichUnit)) +endfunction + +function AddNeutralBuildingMercenaryCamps takes nothing returns nothing + call AddNeutralBuilding(MERCENARY_CAMP_ASHENVALE) + call AddNeutralBuilding(MERCENARY_CAMP_BARRENS) + call AddNeutralBuilding(MERCENARY_CAMP_BLACK_CITADEL) + call AddNeutralBuilding(MERCENARY_CAMP_CITYSCAPE) + call AddNeutralBuilding(MERCENARY_CAMP_DALARAN) + call AddNeutralBuilding(MERCENARY_CAMP_DUNGEON) + call AddNeutralBuilding(MERCENARY_CAMP_FELWOOD) + call AddNeutralBuilding(MERCENARY_CAMP_ICECROWN_GLACIER) + call AddNeutralBuilding(MERCENARY_CAMP_LORDAERON_FALL) + call AddNeutralBuilding(MERCENARY_CAMP_LORDAERON_SUMMER) + call AddNeutralBuilding(MERCENARY_CAMP_LORDAERON_WINTER) + call AddNeutralBuilding(MERCENARY_CAMP_NORHTREND) + call AddNeutralBuilding(MERCENARY_CAMP_SUNKEN_RUINS) + call AddNeutralBuilding(MERCENARY_CAMP_UNDERGROUND) + call AddNeutralBuilding(MERCENARY_CAMP_VILLAGE) + call AddNeutralBuilding(MERCENARY_CAMP_EMERALD_DREAM) + call AddNeutralBuilding(MERCENARY_CAMP_PANDARIA) + call AddNeutralBuilding(MERCENARY_CAMP_SEA) + call AddNeutralBuilding(MERCENARY_CAMP_SUNSTRIDER_ISLE) + call AddNeutralBuilding(MERCENARY_CAMP_NEW_CITADEL) + call AddNeutralBuilding(MERCENARY_CAMP_SKYWALL) + call AddNeutralBuilding(MERCENARY_CAMP_FIRELANDS) + call AddNeutralBuilding(MERCENARY_CAMP_ABYSSAL_MAW) + call AddNeutralBuilding(MERCENARY_CAMP_DEEPHOLM) + call AddNeutralBuilding(MERCENARY_CAMP_SHADOWLANDS) + call AddNeutralBuilding(MERCENARY_CAMP_NYALOTHA) +endfunction + +function AddAbility takes integer objectTypeId,integer levels,integer whichRace returns integer + local integer index= WoWReforgedRaces__objectTypeAbilitiesCounter + set WoWReforgedRaces__objectTypeAbilities[index]=objectTypeId + set WoWReforgedRaces__objectTypeAbilitiesLevels[index]=levels + set WoWReforgedRaces__objectTypeAbilitiesRace[index]=whichRace + set WoWReforgedRaces__objectTypeAbilitiesCounter=WoWReforgedRaces__objectTypeAbilitiesCounter + 1 + return index +endfunction + +function AddAbilityWoWReforged takes nothing returns integer + return AddAbility(udg_TmpAbilityCode , udg_TmpInteger , udg_TmpInteger2) +endfunction + +function GetAbilitiesMax takes nothing returns integer + return WoWReforgedRaces__objectTypeAbilitiesCounter +endfunction + +function GetAbility takes integer index returns integer + return WoWReforgedRaces__objectTypeAbilities[index] +endfunction + +function GetAbilityLevels takes integer index returns integer + return WoWReforgedRaces__objectTypeAbilitiesLevels[index] +endfunction + +function GetAbilityRace takes integer index returns integer + return WoWReforgedRaces__objectTypeAbilitiesRace[index] +endfunction + +function IsRaceBonus takes integer r returns boolean + return udg_RaceIsBonus[r] +endfunction + +function GetRaceHasFootmanWorker takes integer r returns boolean + return udg_RaceHasFootmanWorker[r] +endfunction + +function GetRaceHasBlight takes integer r returns boolean + return udg_RaceHasBlight[r] +endfunction + +function GetRaceAIScript takes integer r returns string + return udg_RaceAIScript[r] +endfunction + +function GetRaceItemTypeId takes integer r returns integer + return udg_RaceItemType[r] +endfunction + +function AddRace takes nothing returns integer + local integer index= udg_MaxRaces + set udg_MaxRaces=udg_MaxRaces + 1 + return index +endfunction + +function AddWoWReforgedRace takes nothing returns integer + local integer r= AddRace() + set udg_RaceName[r]=GetObjectName(udg_TmpItemTypeId) + set udg_RaceTavernItemType[r]=udg_TmpItemTypeId + set udg_RaceItemType[r]=udg_TmpItemTypeId2 + set udg_RaceItemTypeTinyCastle[r]=udg_TmpItemTypeId3 + set udg_RaceIsBonus[r]=udg_TmpBoolean + set udg_RaceAIScript[r]=udg_TmpString + set udg_RaceHasFootmanWorker[r]=udg_TmpBoolean2 + set udg_RaceHasBlight[r]=udg_TmpBoolean3 + set udg_TmpInteger=r + + call SetRaceObjectType(r , RACE_OBJECT_TYPE_SCEPTER_ITEM , udg_TmpItemTypeId2) + call SetRaceObjectType(r , RACE_OBJECT_TYPE_TIER_1_ITEM , udg_TmpItemTypeId3) + + set WoWReforgedIcons___raceIcons[(r )]=( GetIconByItemType(udg_TmpItemTypeId)) // INLINED!! + + set udg_TmpBoolean=false + set udg_TmpBoolean2=false + set udg_TmpBoolean3=false + set udg_TmpString="" + + return r +endfunction + + + +function AddUnitTypeCampaign takes nothing returns nothing + call SaveBoolean(ObjectDataFields__h, (udg_TmpUnitType ), ( OBJECT_DATA_FIELD_UCAM ), ( true)) // INLINED!! +endfunction + +function GetRacesMax takes nothing returns integer + return udg_MaxRaces +endfunction + +function GetRaceByTavernItemTypeId takes integer tavernItemTypeId returns integer + local integer max= (udg_MaxRaces) // INLINED!! + local integer i= 0 + loop + exitwhen ( i == max ) + if ( tavernItemTypeId == udg_RaceTavernItemType[i] ) then + return i + endif + set i=i + 1 + endloop + return udg_RaceNone +endfunction + +function PlayerCanPickRaceEx takes player whichPlayer,integer tavernItemTypeId returns boolean + local integer index= GetRaceByTavernItemTypeId(tavernItemTypeId) + if ( index > 0 ) then + return not (udg_RaceIsBonus[(index)]) or udg_UnlockedAll or (IsPlayerInForce((whichPlayer), WoWReforgedVIPs__vipPlayers)) or GetHeroLevel1(whichPlayer) >= 30 // INLINED!! + endif + return false +endfunction + +function IsGoldmine takes integer unitTypeId returns boolean + if ( unitTypeId == GOLD_MINE ) then + return true + endif + return GetObjectRaceType(unitTypeId) == RACE_OBJECT_TYPE_MINE +endfunction + +function IsUnitGoldmine takes unit whichUnit returns boolean + return IsGoldmine(GetUnitTypeId(whichUnit)) +endfunction + +function IsHousing takes integer unitTypeId returns boolean + return GetObjectRaceType(unitTypeId) == RACE_OBJECT_TYPE_HOUSING +endfunction + +function IsUnitHousing takes unit whichUnit returns boolean + return (GetObjectRaceType((GetUnitTypeId(whichUnit))) == RACE_OBJECT_TYPE_HOUSING) // INLINED!! +endfunction + +function SetRaceTier1 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_1 , id) +endfunction + +function SetRaceTier1Item takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_1_ITEM , id) +endfunction + +function SetRaceTier2 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_2 , id) +endfunction + +function SetRaceTier2Item takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_2_ITEM , id) +endfunction + +function SetRaceTier3 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_3 , id) +endfunction + +function SetRaceTier3Item takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TIER_3_ITEM , id) +endfunction + +function SetRaceFarm takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FARM , id) +endfunction + +function SetRaceFarmItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FARM_ITEM , id) +endfunction + +function SetRaceBarracks takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BARRACKS , id) +endfunction + +function SetRaceBarracksItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BARRACKS_ITEM , id) +endfunction + +function SetRaceBlacksmith takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BLACK_SMITH , id) +endfunction + +function SetRaceBlacksmithItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , id) +endfunction + +function SetRaceMill takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MILL , id) +endfunction + +function SetRaceMillItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MILL_ITEM , id) +endfunction + +function SetRaceAltar takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ALTAR , id) +endfunction + +function SetRaceAltarItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ALTAR_ITEM , id) +endfunction + +function SetRaceArcaneSanctum takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM , id) +endfunction + +function SetRaceArcaneSanctumItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , id) +endfunction + +function SetRaceShop takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHOP , id) +endfunction + +function SetRaceShopItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHOP_ITEM , id) +endfunction + +function SetRaceScoutTower takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SCOUT_TOWER , id) +endfunction + +function SetRaceScoutTowerItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , id) +endfunction + +function SetRaceGuardTower takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GUARD_TOWER , id) +endfunction + +function SetRaceGuardTowerItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , id) +endfunction + +function SetRaceCannonTower takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_CANNON_TOWER , id) +endfunction + +function SetRaceCannonTowerItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , id) +endfunction + +function SetRaceArcaneTower takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_TOWER , id) +endfunction + +function SetRaceArcaneTowerItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , id) +endfunction + +function SetRaceWorkshop takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKSHOP , id) +endfunction + +function SetRaceWorkshopItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKSHOP_ITEM , id) +endfunction + +function SetRaceAviary takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GRYPHON_AVIARY , id) +endfunction + +function SetRaceAviaryItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , id) +endfunction + +function SetRaceSacrificialPit takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT , id) +endfunction + +function SetRaceSacrificalPitItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM , id) +endfunction + +function GetRaceHousing takes integer whichRace returns integer + return GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_HOUSING) +endfunction + +function SetRaceHousing takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_HOUSING , id) +endfunction + +function SetRaceHousingItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_HOUSING_ITEM , id) +endfunction + +function GetRaceMine takes integer whichRace returns integer + return GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MINE) +endfunction + +function SetRaceMine takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MINE , id) +endfunction + +function GetRaceShipyard takes integer r returns integer + return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_SHIPYARD) +endfunction + +function SetRaceShipyard takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIPYARD , id) +endfunction + +function SetRaceShipyardItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIPYARD_ITEM , id) +endfunction + +function SetRaceSpecialBuilding takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING , id) +endfunction + +function SetRaceSpecialBuildingItem takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , id) +endfunction + +function SetRaceSpecialBuilding2 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , id) +endfunction + +function SetRaceSpecialBuilding2Item takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2_ITEM , id) +endfunction + +function GetRaceWorker takes integer whichRace returns integer + return GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_WORKER) +endfunction + +function SetRaceWorker takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKER , id) +endfunction + +function SetRaceTownHall3 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TOWN_HALL_3 , id) +endfunction + +function SetRaceTownHall4 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TOWN_HALL_4 , id) +endfunction + +function SetRaceFootman takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FOOTMAN , id) +endfunction + +function SetRaceRifleman takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_RIFLEMAN , id) +endfunction + +function SetRaceKnight takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_KNIGHT , id) +endfunction + +function SetRaceBarracks4 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BARRACKS_4 , id) +endfunction + +function SetRacePriest takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_PRIEST , id) +endfunction + +function SetRaceSorceress takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SORCERESS , id) +endfunction + +function SetRaceSpellBreaker takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SPELLBREAKER , id) +endfunction + +function SetRaceArcaneSanctum4 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 , id) +endfunction + +function SetRaceFlyingMachine takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FLYING_MACHINE , id) +endfunction + +function SetRaceSiegeEngine takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SIEGE_ENGINE , id) +endfunction + +function SetRaceMortar takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MORTAR , id) +endfunction + +function SetRaceWorkshop4 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_WORKSHOP_4 , id) +endfunction + +function SetRaceTauren takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TAUREN , id) +endfunction + +function SetRaceGryphon takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_GRYPHON , id) +endfunction + +function SetRaceDragonHawk takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_DRAGONHAWK , id) +endfunction + +function SetRaceAviary3 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_AVIARY_3 , id) +endfunction + +function SetRaceAviary4 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_AVIARY_4 , id) +endfunction + +function SetRaceShade takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHADE , id) +endfunction + +function SetRaceCitizenMale takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_MALE_CITIZEN , id) +endfunction + +function SetRaceCitizenFemale takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FEMALE_CITIZEN , id) +endfunction + +function SetRaceChild takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_CHILD , id) +endfunction + +function SetRacePet takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_PET , id) +endfunction + +function SetRaceTransportShip takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_TRANSPORT_SHIP , id) +endfunction + +function GetRaceTransportShip takes integer r returns integer + return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_TRANSPORT_SHIP) +endfunction + +function SetRaceFrigate takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_FRIGATE , id) +endfunction + +function GetRaceFrigate takes integer r returns integer + return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_FRIGATE) +endfunction + +function SetRaceBattleship takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_BATTLESHIP , id) +endfunction + +function GetRaceBattleship takes integer r returns integer + return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_BATTLESHIP) +endfunction + +function SetRaceShipSpecial1 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , id) +endfunction + +function GetRaceShipSpecial1 takes integer r returns integer + return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_SHIP_SPECIAL_1) +endfunction + +function SetRaceShipSpecial2 takes integer whichRace,integer id returns nothing + call SetRaceObjectType(whichRace , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , id) +endfunction + +function GetRaceShipSpecial2 takes integer r returns integer + return GetRaceObjectTypeId(r , RACE_OBJECT_TYPE_SHIP_SPECIAL_2) +endfunction + + +//library WoWReforgedRaces ends +//library WoWReforgedStandardHeroAbilities: + + + function s__WoWReforgedStandardHeroAbilities__A_create takes integer itemTypeId,integer abilityId,integer maxLevel,boolean requiresVIP,boolean requiresReskillable,boolean requiresAncientStructure,boolean notAvailable returns integer + local integer this= s__WoWReforgedStandardHeroAbilities__A__allocate() + set s__WoWReforgedStandardHeroAbilities__A_itemTypeId[this]=itemTypeId + set s__WoWReforgedStandardHeroAbilities__A_abilityId[this]=abilityId + set s__WoWReforgedStandardHeroAbilities__A_maxLevel[this]=maxLevel + set s__WoWReforgedStandardHeroAbilities__A_requiresVIP[this]=requiresVIP + set s__WoWReforgedStandardHeroAbilities__A_requiresReskillable[this]=requiresReskillable + set s__WoWReforgedStandardHeroAbilities__A_requiresAncientStructure[this]=requiresAncientStructure + set s__WoWReforgedStandardHeroAbilities__A_notAvailable[this]=notAvailable + return this + endfunction + + + +function GetStandardHeroAbilitiesMax takes nothing returns integer + return WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter +endfunction + +function GetStandardHeroAbilityItemTypeId takes integer index returns integer + return s__WoWReforgedStandardHeroAbilities__A_itemTypeId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[index]] +endfunction + +function GetStandardHeroAbilityAbilityId takes integer index returns integer + return s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[index]] +endfunction + +function GetStandardHeroAbilityMaxLevel takes integer index returns integer + return s__WoWReforgedStandardHeroAbilities__A_maxLevel[WoWReforgedStandardHeroAbilities__standardHeroAbilities[index]] +endfunction + +function GetStandardHeroAbilityRequiresVIP takes integer index returns boolean + return s__WoWReforgedStandardHeroAbilities__A_requiresVIP[WoWReforgedStandardHeroAbilities__standardHeroAbilities[index]] +endfunction + +function GetStandardHeroAbilityRequiresReskillable takes integer index returns boolean + return s__WoWReforgedStandardHeroAbilities__A_requiresReskillable[WoWReforgedStandardHeroAbilities__standardHeroAbilities[index]] +endfunction + +function GetStandardHeroAbilityRequiresAncientStructure takes integer index returns boolean + return s__WoWReforgedStandardHeroAbilities__A_requiresAncientStructure[WoWReforgedStandardHeroAbilities__standardHeroAbilities[index]] +endfunction + +function GetStandardHeroAbilityNotAvailable takes integer index returns boolean + return s__WoWReforgedStandardHeroAbilities__A_notAvailable[WoWReforgedStandardHeroAbilities__standardHeroAbilities[index]] +endfunction + +function AddStandardHeroAbility takes integer itemTypeId,integer abilityId,integer maxLevel,boolean requiresVIP,boolean requiresReskillable,boolean requiresAncientStructure,boolean notAvailable returns integer + local integer a= s__WoWReforgedStandardHeroAbilities__A_create(itemTypeId , abilityId , maxLevel , requiresVIP , requiresReskillable , requiresAncientStructure , notAvailable) + set WoWReforgedStandardHeroAbilities__standardHeroAbilities[WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter]=a + set WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter=WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter + 1 + return a +endfunction + +function AddStandardHeroAbilityWoWReforged takes nothing returns nothing + call AddStandardHeroAbility(udg_TmpItemTypeId , udg_TmpAbilityCode , udg_TmpInteger , udg_TmpBoolean , udg_TmpBoolean2 , udg_TmpBoolean3 , udg_TmpBoolean4) + set udg_TmpBoolean=false + set udg_TmpBoolean2=false + set udg_TmpBoolean3=false + set udg_TmpBoolean4=false + set udg_TmpInteger=1 +endfunction + +function GetStandardHeroAbilityByItemTypeId takes integer itemTypeId returns integer + local integer i= 0 + loop + exitwhen ( i == WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter ) + if ( (s__WoWReforgedStandardHeroAbilities__A_itemTypeId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(i)]]) == itemTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetStandardHeroAbility takes unit hero returns integer + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter ) + if ( GetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(i)]])) > 0 ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetAvailableStandardHeroAbility takes unit hero returns integer + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter ) + if ( GetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(i)]])) > 0 and (s__WoWReforgedStandardHeroAbilities__A_notAvailable[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(i)]]) ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function SetStandardHeroAbilityEnabled takes unit hero,boolean enabled returns nothing + local integer index= GetAvailableStandardHeroAbility(hero) + if ( index != - 1 ) then + //call BJDebugMsg("Enable/disable standard hero ability " + GetObjectName( GetStandardHeroAbilityAbilityId(index))) + call BlzUnitDisableAbility(hero, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]), not enabled, not enabled) // INLINED!! + endif +endfunction + +function EnableStandardHeroAbility takes unit hero returns nothing + call SetStandardHeroAbilityEnabled(hero , true) +endfunction + +function DisableStandardHeroAbility takes unit hero returns nothing + call SetStandardHeroAbilityEnabled(hero , false) +endfunction + +function RemoveStandardHeroAbilitiesForHero takes unit hero returns nothing + local integer i= 0 + loop + exitwhen ( i == WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter ) + call UnitRemoveAbility(hero, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(i)]])) // INLINED!! + set i=i + 1 + endloop +endfunction + +function WoWReforgedStandardHeroAbilities__AddStandardHeroAbilitiesToShop takes unit shop returns nothing + local integer max= (WoWReforgedStandardHeroAbilities__standardHeroAbilitiesCounter) // INLINED!! + local integer i= 0 + //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + call EnablePagedButtons(shop) + loop + exitwhen ( i >= max ) +call AddPagedButtonsId((shop ) , ( (s__WoWReforgedStandardHeroAbilities__A_itemTypeId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(i)]])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop + //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + + //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") +endfunction + +function IsUnitTypeNavyHero takes integer unitTypeId returns boolean + if ( unitTypeId == GNOMISH_SUBMARINE_HERO ) then + return true + elseif ( unitTypeId == GNOMISH_SUBMARINE_HERO_PILOT ) then + return true + elseif ( unitTypeId == GOBLIN_SUBMARINE_HERO ) then + return true + elseif ( unitTypeId == GOBLIN_SUBMARINE_HERO_SUBMERGED ) then + return true + elseif ( unitTypeId == DWARF_SUBMARINE_HERO ) then + return true + elseif ( unitTypeId == DWARF_SUBMARINE_HERO_SUBMERGED ) then + return true + elseif ( unitTypeId == HUMAN_BATTLESHIP_HERO ) then + return true + elseif ( unitTypeId == CAPTAIN_HERO ) then + return true + endif + return false +endfunction + +function IsAncientStructureHero takes integer unitTypeId returns boolean + if ( unitTypeId == ANCIENT_OF_LORE_HERO ) then + return true + endif + return false +endfunction + +function WoWReforgedStandardHeroAbilities__TriggerConditionSellItem takes nothing returns boolean + local unit hero= GetBuyingUnit() + local player owner= GetOwningPlayer(hero) + local integer unitTypeId= GetUnitTypeId(hero) + local item soldItem= GetSoldItem() + local integer index= GetStandardHeroAbilityByItemTypeId(GetItemTypeId(soldItem)) + if ( index != - 1 ) then + if ( IsUnitType(hero, UNIT_TYPE_HERO) and unitTypeId != EQUIPMENT_BAG and unitTypeId != BACK_PACK and unitTypeId != HERO_SELECTOR and not IsUnitTypeNavyHero(unitTypeId) ) then + if ( not (s__WoWReforgedStandardHeroAbilities__A_notAvailable[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]) ) then // INLINED!! + if ( GetHighestHeroLevel(owner) >= udg_HeroJourneyLevelHeroAbilities or udg_UnlockedAll or (IsPlayerInForce((owner), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! + if ( not (s__WoWReforgedStandardHeroAbilities__A_requiresVIP[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]) or udg_UnlockedAll or (IsPlayerInForce((owner), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! + if ( not (s__WoWReforgedStandardHeroAbilities__A_requiresReskillable[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]) or IsReskillableHero(unitTypeId) ) then // INLINED!! + if ( not (s__WoWReforgedStandardHeroAbilities__A_requiresAncientStructure[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]) or IsAncientStructureHero(unitTypeId) ) then // INLINED!! + call RemoveStandardHeroAbilitiesForHero(hero) + call UnitAddAbility(hero, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]])) // INLINED!! + call UnitMakeAbilityPermanent(hero, true, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]])) // INLINED!! + call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Adding ability " + GetAbilityName((s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]])) + ".") // INLINED!! + else + call SimError(owner , "Only available for Ancient structure heroes.") + endif + else + call SimError(owner , "Only available for reskillable heroes.") + endif + else + call SimError(owner , "Only available for VIP players.") + endif + else + call SimError(owner , "Requires hero level " + I2S(udg_HeroJourneyLevelHeroAbilities) + " or VIP or everything unlocked.") + endif + else + call SimError(owner , "Not available.") + endif + else + call SimError(owner , "Only heroes can change their standard ability.") + endif + call h__RemoveItem(soldItem) + endif + set hero=null + set soldItem=null + set owner=null + return false +endfunction + +function WoWReforgedStandardHeroAbilities__IsUnitTypeStandardHeroAbilitiesShop takes integer unitTypeId returns boolean + return unitTypeId == HERO_ABILITIES or unitTypeId == HERO_ABILITIES_NEUTRAL +endfunction + +function WoWReforgedStandardHeroAbilities__IsUnitStandardHeroAbilitiesShop takes unit whichUnit returns boolean + return WoWReforgedStandardHeroAbilities__IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId(whichUnit)) +endfunction + +function WoWReforgedStandardHeroAbilities__TriggerConditionConstructed takes nothing returns boolean + if ( (WoWReforgedStandardHeroAbilities__IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetTriggerUnit())))) ) then // INLINED!! + call WoWReforgedStandardHeroAbilities__AddStandardHeroAbilitiesToShop(GetConstructedStructure()) + endif + return false +endfunction + +function WoWReforgedStandardHeroAbilities__TriggerConditionSummoned takes nothing returns boolean + if ( (WoWReforgedStandardHeroAbilities__IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetSummonedUnit())))) ) then // INLINED!! + call WoWReforgedStandardHeroAbilities__AddStandardHeroAbilitiesToShop(GetSummonedUnit()) + endif + return false +endfunction + +function WoWReforgedStandardHeroAbilities__TriggerConditionDeath takes nothing returns boolean + if ( (WoWReforgedStandardHeroAbilities__IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetTriggerUnit())))) ) then // INLINED!! + // TODO Disable shop manually? + //call ClearSkillsShop(GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedStandardHeroAbilities__ForGroupEnableShop takes nothing returns nothing + call WoWReforgedStandardHeroAbilities__AddStandardHeroAbilitiesToShop(GetEnumUnit()) +endfunction + +function WoWReforgedStandardHeroAbilities__FilterBuilding takes nothing returns boolean + return (WoWReforgedStandardHeroAbilities__IsUnitTypeStandardHeroAbilitiesShop(GetUnitTypeId((GetFilterUnit())))) // INLINED!! +endfunction + +function WoWReforgedStandardHeroAbilities__UpdateAllShops takes nothing returns nothing + local group g= CreateGroup() + + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedStandardHeroAbilities__FilterBuilding)) + call ForGroup(g, function WoWReforgedStandardHeroAbilities__ForGroupEnableShop) + + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call DisableTrigger(bj_stockItemPurchased) // do not remove items on selling them + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function WoWReforgedStandardHeroAbilities__TriggerConditionLevel takes nothing returns nothing + local unit hero= GetTriggerUnit() + local integer index= GetStandardHeroAbility(hero) + if ( GetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]])) < (s__WoWReforgedStandardHeroAbilities__A_maxLevel[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]) ) then // INLINED!! + call SetUnitAbilityLevel(hero, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]), IMinBJ(GetHeroLevel(hero), (s__WoWReforgedStandardHeroAbilities__A_maxLevel[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(index)]]))) // INLINED!! + endif + set hero=null +endfunction + +function WoWReforgedStandardHeroAbilities__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedStandardHeroAbilities__sellTrigger, Condition(function WoWReforgedStandardHeroAbilities__TriggerConditionSellItem)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedStandardHeroAbilities__constructionTrigger, Condition(function WoWReforgedStandardHeroAbilities__TriggerConditionConstructed)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedStandardHeroAbilities__summonTrigger, Condition(function WoWReforgedStandardHeroAbilities__TriggerConditionSummoned)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedStandardHeroAbilities__deathTrigger, Condition(function WoWReforgedStandardHeroAbilities__TriggerConditionDeath)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedStandardHeroAbilities__levelTrigger, EVENT_PLAYER_HERO_LEVEL) + call TriggerAddCondition(WoWReforgedStandardHeroAbilities__levelTrigger, Condition(function WoWReforgedStandardHeroAbilities__TriggerConditionLevel)) + + call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedStandardHeroAbilities__UpdateAllShops) +endfunction + + +//library WoWReforgedStandardHeroAbilities ends +//library WoWReforgedStats: + + +function SetStatsMultiboardVisible takes player whichPlayer,boolean show returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call MultiboardDisplay(udg_StatsMultiboard, show) + endif +endfunction + +function ShowStatsMultiboard takes player whichPlayer returns nothing + call SetStatsMultiboardVisible(whichPlayer , true) +endfunction + +function HideStatsMultiboard takes player whichPlayer returns nothing + call SetStatsMultiboardVisible(whichPlayer , false) +endfunction + + +function WoWReforgedStats___ForFunctionUpdateStats takes nothing returns nothing + local multiboarditem mbitem= null + local player whichPlayer= GetEnumPlayer() + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + local boolean isUser= GetPlayerController(whichPlayer) == MAP_CONTROL_USER + local boolean isWarlord= udg_PlayerIsWarlord[convertedPlayerId] + local boolean isBosses= whichPlayer == udg_BossesPlayer + local integer goldUpkeepRate= GetPlayerState(whichPlayer, PLAYER_STATE_GOLD_UPKEEP_RATE) + local integer itemTypeId= 0 + local integer column= 0 + // Player name plus color and number + local string text= GetPlayerNameColored(whichPlayer) + local integer value= 0 + if ( isUser and GetPlayerSlotState(whichPlayer) == PLAYER_SLOT_STATE_LEFT ) then + set text=text + " (left)" + elseif ( GetPlayerState(whichPlayer, PLAYER_STATE_GAME_RESULT) == 1 ) then + set text=text + " (defeated)" + endif + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemValue(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Team + set column=column + 1 + set text=I2S(GetPlayerTeam(whichPlayer) + 1) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemValue(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Clan + set column=column + 1 + if ( isUser ) then + set itemTypeId=udg_ClanIcon[udg_ClanPlayerClan[convertedPlayerId]] + set text=GetIconByItemType(itemTypeId) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + endif + // Game Mode/Race 1 + set column=column + 1 + if ( whichPlayer != udg_BossesPlayer ) then + if ( isWarlord ) then + set value=udg_PlayerRace[convertedPlayerId] + set text=GetIconByRace(value) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + else + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNMercenaryCamp.blp") + call MultiboardReleaseItem(mbitem) + endif + endif + // Race 2 + set column=column + 1 + if ( isUser ) then + if ( isWarlord ) then + set value=udg_PlayerRace2[convertedPlayerId] + set text=GetIconByRace(value) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + else + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNMercenaryCamp.blp") + call MultiboardReleaseItem(mbitem) + endif + endif + // Race 3 + set column=column + 1 + if ( isUser ) then + if ( isWarlord ) then + set value=udg_PlayerRace3[convertedPlayerId] + set text=GetIconByRace(value) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + else + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNMercenaryCamp.blp") + call MultiboardReleaseItem(mbitem) + endif + endif + // Profession 1 + set column=column + 1 + if ( not isBosses ) then + set value=udg_PlayerProfession[convertedPlayerId] + set text=GetIconByProfession(value) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + endif + // Profession 2 + set column=column + 1 + if ( not isBosses ) then + set value=udg_PlayerProfession2[convertedPlayerId] + set text=GetIconByProfession(value) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + endif + // Profession 3 + set column=column + 1 + if ( not isBosses ) then + set value=udg_PlayerProfession3[convertedPlayerId] + set text=GetIconByProfession(value) + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + endif + // Hero Icon/Level 1 + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemStyle(mbitem, true, true) + set text=I2S(GetHeroLevel(udg_Held[convertedPlayerId])) + call MultiboardSetItemValue(mbitem, text) + set value=GetUnitTypeId(udg_Held[convertedPlayerId]) + set text=GetIconByUnitType(value) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Hero Icon/Level 2 + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemStyle(mbitem, true, true) + set text=I2S(GetHeroLevel(udg_Held2[convertedPlayerId])) + call MultiboardSetItemValue(mbitem, text) + set value=GetUnitTypeId(udg_Held2[convertedPlayerId]) + set text=GetIconByUnitType(value) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Hero Icon/Level 3 + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + call MultiboardSetItemStyle(mbitem, true, true) + set text=I2S(GetHeroLevel(udg_Held3[convertedPlayerId])) + call MultiboardSetItemValue(mbitem, text) + set value=GetUnitTypeId(udg_Held3[convertedPlayerId]) + set text=GetIconByUnitType(value) + call MultiboardSetItemIcon(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Hero Kills + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + set text=I2S(udg_HeroKills[convertedPlayerId]) + call MultiboardSetItemValue(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Unit Kills + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + set text=I2S(udg_UnitKills[convertedPlayerId]) + call MultiboardSetItemValue(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Gold + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + set text=I2S(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_GOLD)) + call MultiboardSetItemValue(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Lumber + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + set text=I2S(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER)) + call MultiboardSetItemValue(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Food + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + set text=I2S(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_FOOD_USED)) + "/" + I2S(IMinBJ(GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_FOOD_CAP), GetPlayerState(whichPlayer, PLAYER_STATE_FOOD_CAP_CEILING))) + call MultiboardSetItemValue(mbitem, text) + if ( goldUpkeepRate == 0 ) then + call MultiboardSetItemValueColor(mbitem, PercentTo255(0.0), PercentTo255(100.00), PercentTo255(0.0), 255) + else + if ( goldUpkeepRate >= 60 ) then + call MultiboardSetItemValueColor(mbitem, PercentTo255(100.0), PercentTo255(0.00), PercentTo255(0.0), 255) + else + call MultiboardSetItemValueColor(mbitem, PercentTo255(100.0), PercentTo255(80.00), PercentTo255(20.0), 255) + endif + endif + call MultiboardReleaseItem(mbitem) + // Evolution + set column=column + 1 + set mbitem=MultiboardGetItem(udg_StatsMultiboard, WoWReforgedStats___currentRow, column) + set text=I2S((GetPlayerTechCountSimple(UPG_EVOLUTION, (whichPlayer)))) // INLINED!! + call MultiboardSetItemValue(mbitem, text) + call MultiboardReleaseItem(mbitem) + // Increase counter + set WoWReforgedStats___currentRow=WoWReforgedStats___currentRow + 1 + set whichPlayer=null +endfunction + +function UpdateStats takes nothing returns nothing + local string header= "Stats (" + I2S(udg_PlayingUsers) + "/" + I2S(udg_TotalUsers) + ") " + FormatTimeString(udg_GameTime) + if ( IsInSinglePlayer() ) then + set header=header + " - Singleplayer" + else + set header=header + " - Multiplayer" + endif + set header=header + " " + MAP_VERSION + call MultiboardSetTitleText(udg_StatsMultiboard, header) + // Player Columns + set WoWReforgedStats___currentRow=1 + call ForForce(udg_StatsPlayers, function WoWReforgedStats___ForFunctionUpdateStats) +endfunction + + +//library WoWReforgedStats ends +//library WoWReforgedWeaponSmith: + + +function WoWReforgedWeaponSmith___ForgingHammer takes unit hero,item whichItem,real damageBonus returns integer + local integer itemTypeId= GetItemTypeId(whichItem) + local integer count= (LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId), 0)) // INLINED!! + local integer abilityId= 0 + local ability whichAbility= null + local integer result= 0 + local integer i= 1 + loop + exitwhen ( i > count ) + set abilityId=(LoadInteger(WoWReforgedEquipmentBags__h, (itemTypeId ), ( i))) // INLINED!! + set whichAbility=BlzGetItemAbility(whichItem, abilityId) + call AddAbilityFieldBonuses(abilityId , whichAbility , 0 , 0 , 0 , 0.0 , damageBonus , 0 , 0 , 0 , 0.0 , 0 , 0 , 0 , 0) + // Required for all entries where "Set works by set level" is 1 but "Set works directly" is 0: https://www.hiveworkshop.com/pastebin/b2769ab71109c3634b3115937deaa34a.24187 + call IncUnitAbilityLevel(hero, abilityId) + call DecUnitAbilityLevel(hero, abilityId) + set result=result + 1 + set i=i + 1 + endloop + if ( result > 0 ) then + call h__DisplayTimedTextToPlayer(GetOwningPlayer(hero), 0.0, 0.0, 4.0, "Increased damage bonus of item.") + endif + return result +endfunction + +function WoWReforgedWeaponSmith___TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == WoWReforgedWeaponSmith___ABILITY_ID ) then + if ( WoWReforgedWeaponSmith___ForgingHammer(GetTriggerUnit() , GetSpellTargetItem() , 2) <= 0 ) then + call SimError(GetOwningPlayer(GetTriggerUnit()) , "Item has no known damage bonus abilities.") + call IssueImmediateOrder(GetTriggerUnit(), "stop") + endif + endif + return false +endfunction + +function WoWReforgedWeaponSmith___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedWeaponSmith___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(WoWReforgedWeaponSmith___castTrigger, Condition(function WoWReforgedWeaponSmith___TriggerConditionCast)) +endfunction + + +//library WoWReforgedWeaponSmith ends +//library CinematicsRaces: + + +function CinematicsRaces___CreateRaceUnit takes integer whichRace,player whichPlayer,group g,integer t,rect whichRect returns nothing + local integer id= GetRaceObjectTypeId(whichRace , t) + local unit u= null + if ( t != 0 and GenerateId(id) ) then + set u=CreateUnit(whichPlayer, id, GetRectCenterX(whichRect), GetRectCenterY(whichRect), 270.0) + call SetUnitInvulnerable(u, true) + call PauseUnit(u, true) + call SetUnitLifePercentBJ(u, 100.0) + call SetUnitManaPercentBJ(u, 100.0) + call SetUnitAnimation(u, "Stand Victory") + call GroupAddUnit(g, u) + endif +endfunction + +function PlayRaceMusic takes integer whichRace returns nothing + //call PlayThematicMusicBJ( "war3mapImported\\trollolol.swf.mp3" ) + //call StopMusic(false) + if ( whichRace == udg_RaceOldHorde ) then + call PlayThematicMusic("Music\\War2IntroMusic.flac") + elseif ( whichRace == udg_RaceHuman ) then + call PlayThematicMusic("Music\\HumanVictory.flac") + elseif ( whichRace == udg_RaceOrc ) then + call PlayThematicMusic("Music\\OrcVictory.flac") + elseif ( whichRace == udg_RaceUndead ) then + call PlayThematicMusic("Music\\UndeadVictory.flac") + elseif ( whichRace == udg_RaceNightElf ) then + call PlayThematicMusic("Music\\UndeadNightElf.flac") + elseif ( whichRace == udg_RaceBloodElf ) then + call PlayThematicMusic("Music\\BloodElfTheme.flac") + elseif ( whichRace == udg_RaceNaga ) then + call PlayThematicMusic("Music\\NagaTheme.flac") + endif +endfunction + +function CreateRacesCinematicGroup takes integer whichRace,player whichPlayer returns nothing + set GenerateIds___generatedIdsCounter=0 // INLINED!! + if ( whichRace > udg_RaceNone and whichRace < (udg_MaxRaces) ) then // INLINED!! + set CinematicsRaces___currentRace=whichRace + set CinematicsRaces___owner=whichPlayer + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FARM , gg_rct_race_farm) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SCOUT_TOWER , gg_rct_race_scout_tower) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_GUARD_TOWER , gg_rct_race_guard_tower) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_CANNON_TOWER , gg_rct_race_cannon_tower) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ARCANE_TOWER , gg_rct_race_arcane_tower) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TIER_1 , gg_rct_race_tier_1) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TIER_2 , gg_rct_race_tier_2) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TIER_3 , gg_rct_race_tier_3) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ALTAR , gg_rct_race_altar) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BARRACKS , gg_rct_race_barracks) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BLACK_SMITH , gg_rct_race_black_smith) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_MILL , gg_rct_race_mill) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_WORKSHOP , gg_rct_race_workshop) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ARCANE_SANCTUM , gg_rct_race_arcane_sanctum) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_GRYPHON_AVIARY , gg_rct_race_gryphon_aviary) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SACRIFICAL_PIT , gg_rct_race_sacrificial_pit) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHOP , gg_rct_race_shop) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_HOUSING , gg_rct_race_housing) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHIPYARD , gg_rct_race_shipyard) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SPECIAL_BUILDING , gg_rct_race_special_1) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , gg_rct_race_special_2) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_MALE_CITIZEN , gg_rct_race_citizen_male) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FEMALE_CITIZEN , gg_rct_race_citizen_female) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_CHILD , gg_rct_race_child) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_PET , gg_rct_race_pet) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_WORKER , gg_rct_race_worker) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TOWN_HALL_3 , gg_rct_race_town_hall_3) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TOWN_HALL_4 , gg_rct_race_town_hall_4) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FOOTMAN , gg_rct_race_footman) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_RIFLEMAN , gg_rct_race_rifleman) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_KNIGHT , gg_rct_race_knight) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BARRACKS_4 , gg_rct_race_barracks_4) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_PRIEST , gg_rct_race_priest) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SORCERESS , gg_rct_race_sorceress) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SPELLBREAKER , gg_rct_race_spell_breaker) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 , gg_rct_race_arcane_sanctum_4) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FLYING_MACHINE , gg_rct_race_flying_machine) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SIEGE_ENGINE , gg_rct_race_siege_engine) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_MORTAR , gg_rct_race_mortar) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_WORKSHOP_4 , gg_rct_race_workshop_4) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_GRYPHON , gg_rct_race_gryphon) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_DRAGONHAWK , gg_rct_race_dragonhawk) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_AVIARY_3 , gg_rct_race_aviary_3) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_AVIARY_4 , gg_rct_race_aviary_4) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TAUREN , gg_rct_race_tauren) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_TRANSPORT_SHIP , gg_rct_race_transport_ship) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_FRIGATE , gg_rct_race_frigate) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_BATTLESHIP , gg_rct_race_battleship) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , gg_rct_race_ship_special_1) + call CinematicsRaces___CreateRaceUnit(whichRace , whichPlayer , CinematicsRaces___whichGroup , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , gg_rct_race_ship_special_2) + endif +endfunction + +function CinematicsRaces___ForGroupRemoveUnit takes nothing returns nothing + call h__RemoveUnit(GetEnumUnit()) +endfunction + +function CleanupCinematicRace takes nothing returns nothing + call ForGroup(CinematicsRaces___whichGroup, function CinematicsRaces___ForGroupRemoveUnit) + call GroupClear(CinematicsRaces___whichGroup) +endfunction + +function NextCinematicRace takes nothing returns nothing + call CleanupCinematicRace() + if ( CinematicsRaces___currentRace >= (udg_MaxRaces) - 1 ) then // INLINED!! + set CinematicsRaces___currentRace=udg_RaceFreelancer + else + set CinematicsRaces___currentRace=CinematicsRaces___currentRace + 1 + endif + call PlayRaceMusic(CinematicsRaces___currentRace) + call CreateRacesCinematicGroup(CinematicsRaces___currentRace , CinematicsRaces___owner) +endfunction + +function GetCinematicRaceText takes nothing returns string + return (GetObjectName(udg_RaceTavernItemType[(CinematicsRaces___currentRace)])) + " (" + I2S(CinematicsRaces___currentRace) + "/" + I2S((udg_MaxRaces)) + ")\nUse the left and right arrow keys to change the previewed race. Use the escape key to skip." // INLINED!! +endfunction + +function PreviousCinematicRace takes nothing returns nothing + call CleanupCinematicRace() + if ( CinematicsRaces___currentRace == 0 ) then + set CinematicsRaces___currentRace=(udg_MaxRaces) - 1 // INLINED!! + else + set CinematicsRaces___currentRace=CinematicsRaces___currentRace - 1 + endif + call CreateRacesCinematicGroup(CinematicsRaces___currentRace , CinematicsRaces___owner) +endfunction + + +//library CinematicsRaces ends +//library MaxResearchConfig: + + +function UnitHasMaxHpResearch takes unit whichUnit,integer id returns boolean + if ( id == UPG_EVOLUTION ) then + return not IsUnitType(whichUnit, UNIT_TYPE_HERO) and not IsUnitType(whichUnit, UNIT_TYPE_STRUCTURE) + elseif ( id == UPG_IMPROVED_MASONRY ) then + //return GetPrimaryDependencyEquivalent(GetUnitTypeId(whichUnit)) == HIDEOUT + return not IsUnitType(whichUnit, UNIT_TYPE_HERO) and IsUnitType(whichUnit, UNIT_TYPE_STRUCTURE) + elseif ( id == UPG_IMPROVED_MOUNT ) then + return (WoWReforgedMounts___GetMountTypeByUnitTypeId((GetUnitTypeId(whichUnit))) != 0) // INLINED!! + elseif ( id == UPG_IMPROVED_HAND_OF_GOD ) then + return GetUnitTypeId(whichUnit) == DIVINE_GOLEM + elseif ( id == UPG_IMPROVED_CLAN ) then + return GetPrimaryDependencyEquivalent(GetUnitTypeId(whichUnit)) == CLAN_EMISSARY + elseif ( id == UPG_IMPROVED_CLAN_HALL ) then + return GetPrimaryDependencyEquivalent(GetUnitTypeId(whichUnit)) == CLAN_HALL + elseif ( id == UPG_OGRE_STRENGTH ) then + return GetUnitAbilityLevel(whichUnit, MaxResearchConfig_OGRE_STRENGTH_ABILITY_ID) > 0 + endif + + return false +endfunction + + +//library MaxResearchConfig ends +//library SaveCodeObjectSystem: + + +function GetSaveObjectUnitMax takes nothing returns integer + return SaveObjectUnitCounter +endfunction + +function GetSaveObjectBuildingMax takes nothing returns integer + return SaveObjectBuildingCounter +endfunction + +function GetSaveObjectResearchMax takes nothing returns integer + return SaveObjectResearchCounter +endfunction + +function DisplaySaveObjectCounters takes nothing returns nothing + call h__BJDebugMsg("Save Object Unit Counter: " + I2S(SaveObjectUnitCounter)) + call h__BJDebugMsg("Save Object Building Counter: " + I2S(SaveObjectBuildingCounter)) + call h__BJDebugMsg("Save Object Item Counter: " + I2S(SaveObjectItemCounter)) + call h__BJDebugMsg("Save Object Research Counter: " + I2S(SaveObjectResearchCounter)) +endfunction + +function DisplayDuplicateSaveObjects takes nothing returns nothing + local integer j + local integer i= 0 + call h__BJDebugMsg("Save Object Duplicates:") + loop + exitwhen ( i == SaveObjectUnitCounter ) + set j=0 + loop + exitwhen ( j == SaveObjectUnitCounter ) + if ( i != j and SaveObjectIdUnit[i] == SaveObjectIdUnit[j] ) then + call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdUnit[i]) + " with indices " + I2S(i) + " and " + I2S(j)) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + set i=0 + loop + exitwhen ( i == SaveObjectBuildingCounter ) + set j=0 + loop + exitwhen ( j == SaveObjectBuildingCounter ) + if ( i != j and SaveObjectIdBuilding[i] == SaveObjectIdBuilding[j] ) then + call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdBuilding[i]) + " with indices " + I2S(i) + " and " + I2S(j)) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + set i=0 + loop + exitwhen ( i == SaveObjectItemCounter ) + set j=0 + loop + exitwhen ( j == SaveObjectItemCounter ) + if ( i != j and SaveObjectIdItem[i] == SaveObjectIdItem[j] ) then + call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdItem[i]) + " with indices " + I2S(i) + " and " + I2S(j)) + endif + set j=j + 1 + endloop + + set j=0 + loop + exitwhen ( j == (WoWReforgedQuests__questsMax) ) // INLINED!! + if ( SaveObjectIdItem[i] == (WoWReforgedQuests__questReward[(j)]) ) then // INLINED!! + call h__BJDebugMsg("Quest reward item save object " + GetObjectName(SaveObjectIdItem[i]) + " with indices " + I2S(i) + " and " + I2S(j)) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + set i=0 + loop + exitwhen ( i == SaveObjectResearchCounter ) + set j=0 + loop + exitwhen ( j == SaveObjectResearchCounter ) + if ( i != j and SaveObjectIdResearch[i] == SaveObjectIdResearch[j] ) then + call h__BJDebugMsg("Duplicated save object " + GetObjectName(SaveObjectIdResearch[i]) + " with indices " + I2S(i) + " and " + I2S(j)) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function AddSaveObjectUnitTypeEx takes string name,integer id returns integer + local integer index= SaveObjectUnitCounter + set SaveObjectNameUnit[index]=name + set SaveObjectIdUnit[index]=id + set SaveObjectUnitCounter=SaveObjectUnitCounter + 1 + return index +endfunction + +function AddSaveObjectBuildingTypeEx takes string name,integer id returns integer + local integer index= SaveObjectBuildingCounter + set SaveObjectNameBuilding[index]=name + set SaveObjectIdBuilding[index]=id + set SaveObjectBuildingCounter=SaveObjectBuildingCounter + 1 + return index +endfunction + +function AddSaveObjectUnitType takes nothing returns integer + if ( IsUnitIdType(udg_TmpUnitType, UNIT_TYPE_STRUCTURE) ) then + return AddSaveObjectBuildingTypeEx(GetObjectName(udg_TmpUnitType) , udg_TmpUnitType) + else + return AddSaveObjectUnitTypeEx(GetObjectName(udg_TmpUnitType) , udg_TmpUnitType) + endif +endfunction + +function GetSaveObjectUnitType takes integer id returns integer + local integer i= 0 + loop + exitwhen ( i == SaveObjectUnitCounter ) + if ( SaveObjectIdUnit[i] == id ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetSaveObjectUnitId takes integer number returns integer + return SaveObjectIdUnit[number] +endfunction + +function GetSaveObjectBuildingType takes integer id returns integer + local integer i= 0 + loop + exitwhen ( i == SaveObjectBuildingCounter ) + if ( SaveObjectIdBuilding[i] == id ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetSaveObjectBuildingId takes integer number returns integer + return SaveObjectIdBuilding[number] +endfunction + +function AddSaveObjectItemTypeEx takes string name,integer id returns integer + local integer index= SaveObjectItemCounter + set SaveObjectNameItem[index]=name + set SaveObjectIdItem[index]=id + set SaveObjectItemCounter=SaveObjectItemCounter + 1 + return index +endfunction + +function AddSaveObjectItemType takes nothing returns integer + return AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) +endfunction + +function GetSaveObjectItemType takes integer id returns integer + local integer i= 0 + loop + exitwhen ( i == SaveObjectItemCounter ) + if ( SaveObjectIdItem[i] == id ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetSaveObjectItemId takes integer number returns integer + return SaveObjectIdItem[number] +endfunction + +function GetSaveObjectItemMax takes nothing returns integer + return SaveObjectItemCounter +endfunction + +function AddSaveObjectResearchTypeEx takes string name,integer id,integer whichRace returns integer + local integer index= SaveObjectResearchCounter + set SaveObjectNameResearch[index]=name + set SaveObjectIdResearch[index]=id + set SaveObjectRaceResearch[index]=whichRace + set SaveObjectResearchCounter=SaveObjectResearchCounter + 1 + return index +endfunction + +function AddSaveObjectResearch takes nothing returns integer + return AddSaveObjectResearchTypeEx(GetObjectName(udg_TmpTechType) , udg_TmpTechType , udg_TmpInteger) +endfunction + +function GetSaveObjectResearchType takes integer id returns integer + local integer i= 0 + loop + exitwhen ( i == SaveObjectResearchCounter ) + if ( SaveObjectIdResearch[i] == id ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetSaveObjectResearchId takes integer index returns integer + return SaveObjectIdResearch[index] +endfunction + +function GetSaveObjectResearchRace takes integer index returns integer + return SaveObjectRaceResearch[index] +endfunction + +function AddRaceItemsSaveObjects takes nothing returns nothing + local integer i= 1 + local integer max= udg_MaxRaces + local integer j= 0 + local integer max2= 0 + local integer array addedObjectTypeIds + local integer addedObjectTypeIdsCounter= 0 + loop + exitwhen ( i == max ) + set j=0 + set max2=RACE_MAX_OBJECT_TYPES + loop + exitwhen ( j == max2 ) + if ( IsRaceItem(j) and GetRaceObjectTypeId(i , j) != 0 ) then + set udg_TmpItemTypeId=GetRaceObjectTypeId(i , j) +call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function AddCreepsSaveObjects takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedRaces__objectTypeCreepsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( (WoWReforgedRaces__objectTypeCreeps[(i)]) != 0 ) then // INLINED!! + set udg_TmpUnitType=(WoWReforgedRaces__objectTypeCreeps[(i)]) // INLINED!! + call AddSaveObjectUnitType() + endif + set i=i + 1 + endloop +endfunction + +function AddRaceUnitsSaveObjects takes nothing returns nothing + local integer i= udg_RaceFreelancer + local integer max= udg_MaxRaces + local integer j= 0 + local integer max2= 0 + loop + exitwhen ( i == max ) + set j=0 + set max2=RACE_MAX_OBJECT_TYPES + loop + exitwhen ( j == max2 ) + if ( IsRaceUnit(j) and GetRaceObjectTypeId(i , j) != 0 ) then + set udg_TmpUnitType=GetRaceObjectTypeId(i , j) + call AddSaveObjectUnitType() + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function AddRaceBuildingsSaveObjects takes nothing returns nothing + local integer i= 1 + local integer max= udg_MaxRaces + local integer j= 0 + local integer max2= 0 + local integer array addedObjectTypeIds + local integer addedObjectTypeIdsCounter= 0 + loop + exitwhen ( i == max ) + set j=0 + set max2=RACE_MAX_OBJECT_TYPES + loop + exitwhen ( j == max2 ) + if ( IsRaceBuilding(j) and GetRaceObjectTypeId(i , j) != 0 ) then + set udg_TmpUnitType=GetRaceObjectTypeId(i , j) + call AddSaveObjectUnitType() + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function AddProfessionItemsSaveObjects takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + local integer j= 0 + local integer max2= 0 + local integer k= 0 + local integer max3= 0 + loop + exitwhen ( i == max ) + set udg_TmpItemTypeId=s__Profession_bookItemTypeId[(WoWReforgedProfessions__professions[(i)])] // INLINED!! +call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! + set j=0 + set max2=PROFESSION_RANK_MAX + loop + exitwhen ( j == max2 ) + set k=0 + set max3=GetProfessionCraftedItemsCount(i , j) + loop + exitwhen ( k == max3 ) + if ( GetProfessionCraftedItem(i , j , k) != 0 ) then + set udg_TmpItemTypeId=GetProfessionCraftedItem(i , j , k) +call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! + endif + set k=k + 1 + endloop + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function AddSaveObjectItemTypesFromRecipes takes nothing returns nothing + local integer i= 0 + local integer max= (Crafting__recipesCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( not (Crafting__recipesIsUnit[(i)]) and (Crafting__recipesItemTypeIds[(i)]) != 0 ) then // INLINED!! + set udg_TmpItemTypeId=(Crafting__recipesItemTypeIds[(i)]) // INLINED!! +call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! + endif + set i=i + 1 + endloop +endfunction + +function AddSaveObjectItemTypesFromBanners takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedBanners__skinCounter) // INLINED!! + loop + exitwhen ( i == max ) + set udg_TmpItemTypeId=(WoWReforgedBanners__skinItemTypeId[(i)]) // INLINED!! +call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! + set i=i + 1 + endloop +endfunction + +function AddSaveObjectBuildingTypesFromBanners takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedBanners__skinCounter) // INLINED!! + loop + exitwhen ( i == max ) + set udg_TmpUnitType=(WoWReforgedBanners__skinUnitTypeId[(i)]) // INLINED!! + call AddSaveObjectUnitType() + set i=i + 1 + endloop +endfunction + + +//library SaveCodeObjectSystem ends +//library WoWReforgedAchievements: + + + + function s__Achievement_complete takes integer this,player whichPlayer returns nothing + set s___Achievement_playerCompleted[s__Achievement_playerCompleted[this]+GetPlayerId(whichPlayer)]=true + endfunction + + function s__Achievement_isCompleted takes integer this,player whichPlayer returns boolean + return s___Achievement_playerCompleted[s__Achievement_playerCompleted[this]+GetPlayerId(whichPlayer)] + endfunction + + + function s__Achievement_create takes string name,string description,string icon returns integer + local integer this= s__Achievement__allocate() + set s__Achievement_name[this]=name + set s__Achievement_description[this]=description + set s__Achievement_icon[this]=icon + return this + endfunction + +function GetAchievementIsCompletedForPlayer takes integer index,player whichPlayer returns boolean + return (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements___achievements[index])]+GetPlayerId((whichPlayer))]) // INLINED!! +endfunction + +function GetMaxAchievements takes nothing returns integer + return WoWReforgedAchievements___achievementsCounter +endfunction + +function CountKilledBossesForPlayer takes player whichPlayer returns integer + local integer playerId= GetPlayerId(whichPlayer) + local integer result= 0 + local integer i= 0 + local integer max= BlzGroupGetSize(udg_Bosses) + loop + exitwhen ( i == max ) + if ( LoadBoolean(WoWReforgedAchievements___bossKillsHashTable, GetHandleId(BlzGroupUnitAt(udg_Bosses, i)), playerId) ) then + set result=result + 1 + endif + set i=i + 1 + endloop + return result +endfunction + +function CountKilledCreepForPlayer takes player whichPlayer,integer unitTypeId returns integer + local integer playerId= GetPlayerId(whichPlayer) + return LoadInteger(WoWReforgedAchievements___unitTypeKillsHashTable, unitTypeId, playerId) +endfunction + +function CountKilledCreepTypesForPlayer takes player whichPlayer returns integer + local integer count= 0 + local integer i= 0 + local integer max= (WoWReforgedRaces__objectTypeCreepsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( CountKilledCreepForPlayer(whichPlayer , (WoWReforgedRaces__objectTypeCreeps[(i)])) > 0 ) then // INLINED!! + set count=count + 1 + endif + set i=i + 1 + endloop + return count +endfunction + +function PlayerCountCompletedAchievements takes player whichPlayer returns integer + local integer result= 0 + local integer i= 0 + local integer max= (WoWReforgedAchievements___achievementsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements___achievements[(i )])]+GetPlayerId((( whichPlayer)))]) ) then // INLINED!! + set result=result + 1 + endif + set i=i + 1 + endloop + return result +endfunction + +function WoWReforgedAchievements___GetAchievementDescriptionIntern takes integer a,player whichPlayer returns string + local integer playerId= GetPlayerId(whichPlayer) + if ( a == udg_AchievementConqueror ) then + return I2S(BlzGroupGetSize(WoWReforgedAchievements___conquerorTownHalls[playerId])) + "/" + I2S((udg_Max_StartLocations)) // INLINED!! + elseif ( a == udg_AchievementQuestSolver ) then + return I2S(WoWReforgedAchievements___questsCompleted) + "/" + I2S((WoWReforgedQuests__questsMax)) // INLINED!! + elseif ( a == udg_AchievementMasterQuestSolver ) then + return I2S(WoWReforgedAchievements___questsCompleted) + "/" + I2S((WoWReforgedQuests__questsMax)) // INLINED!! + elseif ( a == udg_AchievementBossSlayer ) then + return I2S(CountKilledBossesForPlayer(whichPlayer)) + elseif ( a == udg_AchievementMasterBossSlayer ) then + return I2S(CountKilledBossesForPlayer(whichPlayer)) + "/" + I2S(BlzGroupGetSize(udg_Bosses)) + elseif ( a == udg_AchievementMasterCreepSlayer ) then + return I2S(CountKilledCreepTypesForPlayer(whichPlayer)) + "/" + I2S((WoWReforgedRaces__objectTypeCreepsCounter)) // INLINED!! + elseif ( a == udg_AchievementHeroSlayer ) then + return I2S(WoWReforgedAchievements___playerHeroKills[playerId]) + elseif ( a == udg_AchievementPlayerSlayer ) then + return I2S(WoWReforgedAchievements___playersDefeated) + elseif ( a == udg_AchievementDeforestation ) then + return I2S(WoWReforgedAchievements___treesKilled) + "/10000" + elseif ( a == udg_AchievementWithoutFriends ) then + return I2S(udg_GameTime / 3600) + elseif ( a == udg_AchievementDestroyer ) then + return I2S(R2I(WoWReforgedAchievements___playerDamageCaused[playerId])) + "/50000" + elseif ( a == udg_AchievementTank ) then + return I2S(R2I(WoWReforgedAchievements___playerDamageTaken[playerId])) + "/50000" + elseif ( a == udg_AchievementMasterLocksmith ) then + return I2S(WoWReforgedAchievements___playerLockPicks[playerId]) + elseif ( a == udg_AchievementMasterThief ) then + return I2S(WoWReforgedAchievements___playerPickPockets[playerId]) + elseif ( a == udg_AchievementHolyWarrior ) then + return I2S(WoWReforgedAchievements___playerUndeadKills[playerId]) + elseif ( a == udg_AchievementUnholyWarrior ) then + return I2S(WoWReforgedAchievements___playerNonUndeadKills[playerId]) + elseif ( a == udg_AchievementWarCriminal ) then + return I2S(WoWReforgedAchievements___playerCitizenKills[playerId]) + elseif ( a == udg_AchievementAchievementMaster ) then + return I2S(PlayerCountCompletedAchievements(whichPlayer)) + elseif ( a == udg_AchievementOilTycoon ) then + return I2S(R2I(WoWReforgedAchievements___playerOil[playerId])) + "/50000" + elseif ( a == udg_AchievementPropertyShark ) then + return I2S(WoWReforgedAchievements___playerPropertyCounter[playerId]) + "/6" + elseif ( a == udg_AchievementExplorer ) then + return I2S(WoWReforgedAchievements___playerZonesCounter[playerId]) + "/20" + elseif ( a == udg_AchievementMasterExplorer ) then + return I2S(WoWReforgedAchievements___playerZonesCounter[playerId]) + "/all zones" + elseif ( a == udg_AchievementRacer ) then + return I2S(WoWReforgedAchievements___playerRacingTracks[playerId]) + "/all races" + endif + return "" +endfunction + +function AddAchievement takes string name,string description,string icon returns integer + local integer a= s__Achievement_create(name , description , icon) + set WoWReforgedAchievements___achievements[WoWReforgedAchievements___achievementsCounter]=a + set WoWReforgedAchievements___achievementsCounter=WoWReforgedAchievements___achievementsCounter + 1 + return a +endfunction + +function AddAchievementWoWReforged takes nothing returns integer + return AddAchievement(udg_TmpString , udg_TmpString2 , udg_TmpString3) +endfunction + +function GetAchievementName takes integer index returns string + return s__Achievement_name[WoWReforgedAchievements___achievements[index]] +endfunction + +function GetAchievementDescription takes integer index returns string + return s__Achievement_description[WoWReforgedAchievements___achievements[index]] +endfunction + +function GetAchievementIcon takes integer index returns string + return s__Achievement_icon[WoWReforgedAchievements___achievements[index]] +endfunction + +function GetAchievementCounterDescription takes integer index,player whichPlayer returns string + return WoWReforgedAchievements___GetAchievementDescriptionIntern(WoWReforgedAchievements___achievements[index] , whichPlayer) +endfunction + +function GetActualAchievementXP takes player whichPlayer,integer xpToAdd returns integer + if ( IsPlayerFreelancer(whichPlayer) ) then + return R2I(I2R(xpToAdd) * 1.5) + endif + + return xpToAdd +endfunction + +function PlayerCompletedAllAchievements takes player whichPlayer returns boolean + local integer i= 0 + local integer max= (WoWReforgedAchievements___achievementsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( not (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements___achievements[(i )])]+GetPlayerId((( whichPlayer)))]) ) then // INLINED!! + return false + endif + set i=i + 1 + endloop + return true +endfunction + +function AchievementXPBonusForPlayer takes player whichPlayer,integer xpToAdd,integer a,string msg returns nothing + local integer playerXp= GetActualAchievementXP(whichPlayer , xpToAdd) + call AddHeroXP1(whichPlayer , playerXp , true) + call AddHeroXP2(whichPlayer , playerXp , true) + call AddHeroXP3(whichPlayer , playerXp , true) + set s___Achievement_playerCompleted[s__Achievement_playerCompleted[(a)]+GetPlayerId((whichPlayer))]=true // INLINED!! + call AdjustPlayerStateBJ(playerXp, whichPlayer, PLAYER_STATE_GOLD_GATHERED) + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_UNITAVAILABLE, "|cff0000ff" + StringCase(s__Achievement_name[a], true) + " +" + I2S(playerXp) + " XP and gold:|r " + msg) + + if ( PlayerCompletedAllAchievements(whichPlayer) and not WoWReforgedAchievements___playerCompletedAllAchievements[GetPlayerId(whichPlayer)] ) then + set WoWReforgedAchievements___playerCompletedAllAchievements[GetPlayerId(whichPlayer)]=true + call AchievementXPBonusForPlayer(whichPlayer , 10000 , udg_AchievementAchievementMaster , "Completed all achievements.") + endif +endfunction + +function AchievementHintForPlayer takes player whichPlayer,integer a,string msg returns nothing + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff0000ff" + StringCase(s__Achievement_name[a], true) + ":|r " + msg) +endfunction + +function AchievementXPBonus takes force whichForce,integer xpToAdd,integer a,string msg returns nothing + local integer i= 0 + local player slotPlayer= null + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( IsPlayerInForce(slotPlayer, whichForce) ) then + call AchievementXPBonusForPlayer(slotPlayer , xpToAdd , a , msg) + endif + set slotPlayer=null + set i=i + 1 + endloop +endfunction + +function AchievementCompleteQuest takes nothing returns nothing + set WoWReforgedAchievements___questsCompleted=WoWReforgedAchievements___questsCompleted + 1 + if ( ModuloInteger(WoWReforgedAchievements___questsCompleted, 4) == 0 ) then + call AchievementXPBonus(GetPlayersAll() , WoWReforgedAchievements___questsCompleted * 100 , udg_AchievementQuestSolver , "Completed 4 more quests.") + if ( WoWReforgedAchievements___questsCompleted == (WoWReforgedQuests__questsMax) ) then // INLINED!! + call AchievementXPBonus(GetPlayersAll() , 6000 , udg_AchievementMasterQuestSolver , "Completed all quests.") + endif + endif +endfunction + +function AchievementKillBoss takes unit killer,unit boss returns nothing + local player whichPlayer= GetOwningPlayer(killer) + local integer playerId= GetPlayerId(whichPlayer) + local integer count= 0 + call SaveBoolean(WoWReforgedAchievements___bossKillsHashTable, GetHandleId(boss), playerId, true) + set count=CountKilledBossesForPlayer(whichPlayer) + if ( ModuloInteger(count, 5) == 0 and not WoWReforgedAchievements___playerBossKillAchievements[Index2D(count , playerId , bj_MAX_PLAYERS)] ) then + set WoWReforgedAchievements___playerBossKillAchievements[Index2D(count , playerId , bj_MAX_PLAYERS)]=true + call AchievementXPBonusForPlayer(whichPlayer , count * 100 , udg_AchievementBossSlayer , "Killed 5 bosses.") + if ( count == BlzGroupGetSize(udg_Bosses) ) then + call AchievementXPBonusForPlayer(whichPlayer , 5000 , udg_AchievementMasterBossSlayer , "Killed all bosses.") + endif + endif + set whichPlayer=null +endfunction + +function AchievementKillCreep takes unit killer,unit creep returns nothing + local player whichPlayer= GetOwningPlayer(killer) + local integer playerId= GetPlayerId(whichPlayer) + local integer unitTypeId= GetUnitTypeId(creep) + local integer count= CountKilledCreepForPlayer(whichPlayer , unitTypeId) + 1 + call SaveInteger(WoWReforgedAchievements___unitTypeKillsHashTable, unitTypeId, playerId, count) + if ( ModuloInteger(count, 50) == 0 ) then + call AchievementXPBonusForPlayer(whichPlayer , count * 2 , udg_AchievementCreepSlayer , "Killed 50 " + GetUnitName(creep) + " creeps.") + endif + if ( not WoWReforgedAchievements___playerHasEveryCreepTypeAchievement[playerId] and CountKilledCreepTypesForPlayer(whichPlayer) == (WoWReforgedRaces__objectTypeCreepsCounter) ) then // INLINED!! + set WoWReforgedAchievements___playerHasEveryCreepTypeAchievement[playerId]=true + call AchievementXPBonusForPlayer(whichPlayer , 5000 , udg_AchievementMasterCreepSlayer , "Killed every creep type.") + endif + set whichPlayer=null +endfunction + +function AchievementKillHero takes unit killer returns nothing + local player whichPlayer= GetOwningPlayer(killer) + local integer playerId= GetPlayerId(whichPlayer) + local integer count= WoWReforgedAchievements___playerHeroKills[playerId] + 1 + set WoWReforgedAchievements___playerHeroKills[playerId]=count + if ( ModuloInteger(count, 5) == 0 ) then + call AchievementXPBonusForPlayer(whichPlayer , count * 10 , udg_AchievementHeroSlayer , "Killed 5 enemy heroes.") + endif + set whichPlayer=null +endfunction + +function AchievementPlayerDefeat takes player whichPlayer returns nothing + local force enemies= GetPlayersEnemies(whichPlayer) + set WoWReforgedAchievements___playersDefeated=WoWReforgedAchievements___playersDefeated + 1 + call AchievementXPBonus(enemies , 200 , udg_AchievementPlayerSlayer , "Defeated player " + GetPlayerName(whichPlayer) + ".") + call ForceClear(enemies) + call DestroyForce(enemies) + set enemies=null +endfunction + +function AchievementTreesKilled takes destructable whichDestructable returns nothing + if ( (IsTree(GetDestructableTypeId((whichDestructable)))) ) then // INLINED!! + set WoWReforgedAchievements___treesKilled=WoWReforgedAchievements___treesKilled + 1 + if ( ModuloInteger(WoWReforgedAchievements___treesKilled, 10000) == 0 ) then + call AchievementXPBonus(GetPlayersAll() , 5000 , udg_AchievementDeforestation , "Killed " + I2S(WoWReforgedAchievements___treesKilled) + " trees.") + endif + endif +endfunction + +function Achievement2Hours takes nothing returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( WoWReforgedAchievements___playerHeroDeaths[i] == 0 ) then + call AchievementXPBonusForPlayer(Player(i) , 2000 , udg_AchievementSurvivor , " hours without your hero dying.") + endif + set i=i + 1 + endloop + call AchievementXPBonus(GetPlayersAll() , 1000 , udg_AchievementWithoutFriends , "2 hours played.") +endfunction + +function Achievement4Hours takes nothing returns nothing + call AchievementXPBonus(GetPlayersAll() , 2000 , udg_AchievementWithoutFriends , "4 hours played.") +endfunction + +function Achievement6Hours takes nothing returns nothing + call AchievementXPBonus(GetPlayersAll() , 3000 , udg_AchievementWithoutFriends , "6 hours played.") +endfunction + +function Achievement8Hours takes nothing returns nothing + call AchievementXPBonus(GetPlayersAll() , 4000 , udg_AchievementWithoutFriends , "8 hours played.") +endfunction + +function Achievement10Hours takes nothing returns nothing + call AchievementXPBonus(GetPlayersAll() , 5000 , udg_AchievementWithoutFriends , "10 hours played.") +endfunction + +function AchievementDemonHunter takes nothing returns nothing + call AchievementXPBonus(GetPlayersAll() , 10000 , udg_AchievementDemonHunter , "Killed Archimonde within 30 minutes.") +endfunction + +function GetAchievements takes player whichPlayer returns string + local string msg= "Achievements:" + local integer i= 0 + local integer max= (WoWReforgedAchievements___achievementsCounter) // INLINED!! + loop + exitwhen ( i == max ) + set msg=msg + "\n- " + (s__Achievement_name[WoWReforgedAchievements___achievements[(i)]]) + ": " + (s__Achievement_description[WoWReforgedAchievements___achievements[(i)]]) // INLINED!! + if ( (WoWReforgedAchievements___GetAchievementDescriptionIntern(WoWReforgedAchievements___achievements[(i )] , ( whichPlayer))) != "" ) then // INLINED!! + set msg=msg + " (" + (WoWReforgedAchievements___GetAchievementDescriptionIntern(WoWReforgedAchievements___achievements[(i )] , ( whichPlayer))) + ")" // INLINED!! + endif + set i=i + 1 + endloop + return msg +endfunction + +// quest whichQuest +function AddAchievementsToQuest takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedAchievements___achievementsCounter) // INLINED!! + loop + exitwhen ( i == max ) +call CreateQuestItem(bj_lastCreatedQuest , ((s__Achievement_name[WoWReforgedAchievements___achievements[(i)]]) + ": " + (s__Achievement_description[WoWReforgedAchievements___achievements[(i)]]))) // INLINED!! + //call CreateQuestItemBJ(whichQuest, GetAchievementName(i) + ": " + GetAchievementDescription(i)) + set i=i + 1 + endloop +endfunction + +function AchievementOverpopulation takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + if ( not WoWReforgedAchievements___playerOverpopulation[playerId] ) then + set WoWReforgedAchievements___playerOverpopulation[playerId]=true + call AchievementXPBonusForPlayer(whichPlayer , 1500 , udg_AchievementOverpopulation , "Using 600 food.") + endif +endfunction + +function AchievementLockPick takes unit hero returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(hero)) + set WoWReforgedAchievements___playerLockPicks[playerId]=WoWReforgedAchievements___playerLockPicks[playerId] + 1 + if ( ModuloInteger(WoWReforgedAchievements___playerLockPicks[playerId], 50) == 0 ) then + call AchievementXPBonusForPlayer(GetOwningPlayer(hero) , 1000 , udg_AchievementMasterLocksmith , "Unlocked 50 chests.") + endif +endfunction + +function AchievementPickpocket takes unit hero,unit target,item stolenItem returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(hero)) + set WoWReforgedAchievements___playerPickPockets[playerId]=WoWReforgedAchievements___playerPickPockets[playerId] + 1 + if ( ModuloInteger(WoWReforgedAchievements___playerPickPockets[playerId], 50) == 0 ) then + call AchievementXPBonusForPlayer(GetOwningPlayer(hero) , 1000 , udg_AchievementMasterThief , "Stolen 50 items.") + endif +endfunction + +function AchievementHolyWarrior takes unit killer returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(killer)) + set WoWReforgedAchievements___playerUndeadKills[playerId]=WoWReforgedAchievements___playerUndeadKills[playerId] + 1 + if ( ModuloInteger(WoWReforgedAchievements___playerUndeadKills[playerId], 100) == 0 ) then + call AchievementXPBonusForPlayer(GetOwningPlayer(killer) , 1000 , udg_AchievementHolyWarrior , "Killed 100 Undead.") + endif +endfunction + +function AchievementUnholyWarrior takes unit killer returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(killer)) + set WoWReforgedAchievements___playerNonUndeadKills[playerId]=WoWReforgedAchievements___playerNonUndeadKills[playerId] + 1 + if ( ModuloInteger(WoWReforgedAchievements___playerNonUndeadKills[playerId], 100) == 0 ) then + call AchievementXPBonusForPlayer(GetOwningPlayer(killer) , 1000 , udg_AchievementUnholyWarrior , "Killed 100 non-Undead.") + endif +endfunction + +function AchievementWarCriminal takes unit killer returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(killer)) + set WoWReforgedAchievements___playerCitizenKills[playerId]=WoWReforgedAchievements___playerCitizenKills[playerId] + 1 + if ( ModuloInteger(WoWReforgedAchievements___playerCitizenKills[playerId], 100) == 0 ) then + call AchievementXPBonusForPlayer(GetOwningPlayer(killer) , 1000 , udg_AchievementWarCriminal , "Killed 100 citizens.") + endif +endfunction + +function AchievementPropertyShark takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + set WoWReforgedAchievements___playerPropertyCounter[playerId]=WoWReforgedAchievements___playerPropertyCounter[playerId] + 1 + + if ( ModuloInteger(WoWReforgedAchievements___playerPropertyCounter[playerId], 6) == 0 ) then + call AchievementXPBonusForPlayer(whichPlayer , 5000 , udg_AchievementPropertyShark , "Purchased 6 properties.") + endif +endfunction + +function AchievementPropertyLandowner takes player whichPlayer,integer maxProperties returns nothing + local integer playerId= GetPlayerId(whichPlayer) + //set playerPropertyCounter[playerId] = playerPropertyCounter[playerId] + 1 // AchievementPropertyShark + + if ( WoWReforgedAchievements___playerPropertyCounter[playerId] == maxProperties ) then + call AchievementXPBonusForPlayer(whichPlayer , 10000 , udg_AchievementLandowner , "Purchased all properties.") + endif +endfunction + +function AchievementExplorer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + set WoWReforgedAchievements___playerZonesCounter[playerId]=WoWReforgedAchievements___playerZonesCounter[playerId] + 1 + + if ( ModuloInteger(WoWReforgedAchievements___playerZonesCounter[playerId], 20) == 0 ) then + call AchievementXPBonusForPlayer(whichPlayer , 1000 , udg_AchievementExplorer , "Newly discovered 20 zones.") + endif +endfunction + +function AchievementMasterExplorer takes player whichPlayer,integer maxZones returns nothing + local integer playerId= GetPlayerId(whichPlayer) + set WoWReforgedAchievements___playerZonesCounter[playerId]=WoWReforgedAchievements___playerZonesCounter[playerId] + 1 + + if ( WoWReforgedAchievements___playerZonesCounter[playerId] == maxZones ) then + call AchievementXPBonusForPlayer(whichPlayer , 10000 , udg_AchievementMasterExplorer , "Newly discovered all existing zones.") + endif +endfunction + +function AchievementRacer takes player whichPlayer,integer maxRacingTracks returns nothing + local integer playerId= GetPlayerId(whichPlayer) + set WoWReforgedAchievements___playerRacingTracks[playerId]=WoWReforgedAchievements___playerRacingTracks[playerId] + 1 + + if ( WoWReforgedAchievements___playerRacingTracks[playerId] == maxRacingTracks ) then + call AchievementXPBonusForPlayer(whichPlayer , 2000 , udg_AchievementRacer , "Finished all races.") + endif +endfunction + +function WoWReforgedAchievements___QuestSetCompletedBJHook takes quest whichQuest,boolean completed returns nothing + if ( not IsQuestRequired(whichQuest) ) then + call AchievementCompleteQuest() + endif +endfunction + +//processed hook: hook QuestSetCompletedBJ WoWReforgedAchievements___QuestSetCompletedBJHook + +function WoWReforgedAchievements___TriggerConditionDamage takes nothing returns boolean + local unit source= GetEventDamageSource() + local player sourceOwner= GetOwningPlayer(source) + local integer playerIdSource= GetPlayerId(sourceOwner) + local unit target= BlzGetEventDamageTarget() + local player targetOwner= GetOwningPlayer(target) + local integer playerIdTarget= GetPlayerId(targetOwner) + if ( IsPlayerHero(source) and IsUnitEnemy(source, targetOwner) ) then + set WoWReforgedAchievements___playerDamageCaused[playerIdSource]=WoWReforgedAchievements___playerDamageCaused[playerIdSource] + GetEventDamage() + if ( WoWReforgedAchievements___playerDamageCaused[playerIdSource] > 0.0 and ModuloReal(WoWReforgedAchievements___playerDamageCaused[playerIdSource], 50000.0) == 0 ) then + call AchievementXPBonusForPlayer(sourceOwner , 2000 , udg_AchievementDestroyer , "50000 damage caused.") + endif + endif + if ( IsPlayerHero(target) and IsUnitEnemy(target, sourceOwner) ) then + set WoWReforgedAchievements___playerDamageTaken[playerIdTarget]=WoWReforgedAchievements___playerDamageTaken[playerIdTarget] + GetEventDamage() + if ( WoWReforgedAchievements___playerDamageTaken[playerIdTarget] > 0.0 and ModuloReal(WoWReforgedAchievements___playerDamageTaken[playerIdTarget], 50000.0) == 0 ) then + call AchievementXPBonusForPlayer(targetOwner , 2000 , udg_AchievementTank , "50000 damage received.") + endif + endif + set source=null + set sourceOwner=null + set target=null + set targetOwner=null + return false +endfunction + +function WoWReforgedAchievements___TriggerConditionDeath takes nothing returns boolean + local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + + if ( IsPlayerHero(GetTriggerUnit()) ) then + set WoWReforgedAchievements___playerHeroDeaths[playerId]=WoWReforgedAchievements___playerHeroDeaths[playerId] + 1 + endif + + if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) and GetKillingUnit() != null and not IsUnitAlly(GetKillingUnit(), GetOwningPlayer(GetTriggerUnit())) and not IsUnitType(GetKillingUnit(), UNIT_TYPE_UNDEAD) ) then + call AchievementHolyWarrior(GetKillingUnit()) + endif + + if ( not IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) and GetKillingUnit() != null and not IsUnitAlly(GetKillingUnit(), GetOwningPlayer(GetTriggerUnit())) and IsUnitType(GetKillingUnit(), UNIT_TYPE_UNDEAD) ) then + call AchievementUnholyWarrior(GetKillingUnit()) + endif + + if ( GetKillingUnit() != null and not IsUnitAlly(GetKillingUnit(), GetOwningPlayer(GetTriggerUnit())) and IsCitizen(GetUnitTypeId(GetTriggerUnit())) ) then + call AchievementWarCriminal(GetKillingUnit()) + endif + + if ( IsUnitInGroup(GetTriggerUnit(), WoWReforgedAchievements___conquerorTownHalls[playerId]) ) then + call GroupRemoveUnit(WoWReforgedAchievements___conquerorTownHalls[playerId], GetTriggerUnit()) + endif + + return false +endfunction + +function WoWReforgedAchievements___TriggerConditionGather takes nothing returns boolean + local player owner= GetOwningPlayer((Resources___triggerWorker)) // INLINED!! + local integer playerId= GetPlayerId(owner) + if ( (Resources___triggerResource) == udg_ResourceOil ) then // INLINED!! + set WoWReforgedAchievements___playerOil[playerId]=WoWReforgedAchievements___playerOil[playerId] + (Resources___triggerResourceAmount) // INLINED!! + + if ( WoWReforgedAchievements___playerOil[playerId] >= 50000 and not (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements___achievements[(udg_AchievementOilTycoon )])]+GetPlayerId((( owner)))]) ) then // INLINED!! + call AchievementXPBonusForPlayer(owner , 1000 , udg_AchievementOilTycoon , "Gathered 50 000 Oil.") + endif + endif + + return false +endfunction + +function WoWReforgedAchievements___HasUnitForStartLocation takes player whichPlayer,integer index returns boolean + local integer playerId= GetPlayerId(whichPlayer) + local boolean result= false + local unit u= null + local integer i= 0 + local integer max= BlzGroupGetSize(WoWReforgedAchievements___conquerorTownHalls[playerId]) + loop + exitwhen ( i == max or result ) + set u=BlzGroupUnitAt(WoWReforgedAchievements___conquerorTownHalls[playerId], i) + if ( GetStartLocationRectByCoordinates(GetUnitX(u) , GetUnitY(u)) == index ) then + set result=true + endif + set u=null + set i=i + 1 + endloop + return result +endfunction + +function WoWReforgedAchievements___TriggerConditionConstructionFinished takes nothing returns boolean + local unit b= GetConstructedStructure() + local player owner= GetOwningPlayer(b) + local integer playerId= GetPlayerId(owner) + local integer index= - 1 + if ( IsUnitType(b, UNIT_TYPE_TOWNHALL) and not (s___Achievement_playerCompleted[s__Achievement_playerCompleted[(WoWReforgedAchievements___achievements[(udg_AchievementConqueror )])]+GetPlayerId((( owner)))]) ) then // INLINED!! + set index=GetStartLocationRectByCoordinates(GetUnitX(b) , GetUnitY(b)) + if ( index != - 1 and not WoWReforgedAchievements___HasUnitForStartLocation(owner , index) ) then + call GroupAddUnit(WoWReforgedAchievements___conquerorTownHalls[playerId], b) + + if ( BlzGroupGetSize(WoWReforgedAchievements___conquerorTownHalls[playerId]) == (udg_Max_StartLocations) ) then // INLINED!! + call AchievementXPBonusForPlayer(owner , 7000 , udg_AchievementConqueror , "Constructed town halls in " + I2S((udg_Max_StartLocations)) + " start locations.") // INLINED!! + else + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId((owner ))], bj_QUESTMESSAGE_HINT, "|cff0000ff" + StringCase(s__Achievement_name[( udg_AchievementConqueror )], true) + ":|r " + ( "Constructed another town hall in a start location (" + I2S(BlzGroupGetSize(WoWReforgedAchievements___conquerorTownHalls[playerId])) + "/" + I2S((udg_Max_StartLocations)) + ").")) // INLINED!! + endif + endif + endif + + set b=null + set owner=null + + return false +endfunction + +function WoWReforgedAchievements___Init takes nothing returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set WoWReforgedAchievements___conquerorTownHalls[i]=CreateGroup() + set i=i + 1 + endloop + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedAchievements___constructionFinishedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedAchievements___constructionFinishedTrigger, Condition(function WoWReforgedAchievements___TriggerConditionConstructionFinished)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedAchievements___damageTrigger, EVENT_PLAYER_UNIT_DAMAGED) + call TriggerAddCondition(WoWReforgedAchievements___damageTrigger, Condition(function WoWReforgedAchievements___TriggerConditionDamage)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedAchievements___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedAchievements___deathTrigger, Condition(function WoWReforgedAchievements___TriggerConditionDeath)) + + call TriggerRegisterGatherEvent(WoWReforgedAchievements___gatherTrigger) + call TriggerAddCondition(WoWReforgedAchievements___gatherTrigger, Condition(function WoWReforgedAchievements___TriggerConditionGather)) +endfunction + + +//library WoWReforgedAchievements ends +//library WoWReforgedAlchemistLab: + + +function WoWReforgedAlchemistLab___SetShopRace takes unit shop,integer whichRace returns nothing + call SetUnitUserData(shop, whichRace) + call BlzSetUnitName(shop, "Alchemist Lab " + GetObjectName(udg_RaceTavernItemType[whichRace])) + //call BJDebugMsg("Change shop race to " + GetObjectName(udg_RaceTavernItemType[whichRace])) +endfunction + +function WoWReforgedAlchemistLab___AddRaceTypesToShop takes unit shop returns nothing + local integer max= udg_MaxRaces + local integer i= 1 + call WoWReforgedAlchemistLab___SetShopRace(shop , udg_RaceHuman) + call EnablePagedButtons(shop) + call SetPagedButtonsSlotsPerPage(shop , 8) + loop + exitwhen ( i >= max ) +call AddPagedButtonsId((shop ) , ( udg_RaceTavernItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop +endfunction + +function WoWReforgedAlchemistLab___TriggerConditionConstructionFinish takes nothing returns boolean + local unit shop= GetConstructedStructure() + if ( GetUnitTypeId(shop) == ALCHEMIST_LAB ) then + call WoWReforgedAlchemistLab___AddRaceTypesToShop(shop) + endif + set shop=null + return false +endfunction + +function WoWReforgedAlchemistLab___TriggerConditionSell takes nothing returns boolean + local unit shop= GetSellingUnit() + local item soldItem= GetSoldItem() + local integer itemTypeId= GetItemTypeId(soldItem) + local integer max= udg_MaxRaces + local integer i= 1 + //call BJDebugMsg("Shop " + GetUnitName(shop) + " sells item " + GetItemName(soldItem)) + if ( GetUnitTypeId(shop) == ALCHEMIST_LAB ) then + loop + exitwhen ( i >= max ) + if ( itemTypeId == udg_RaceTavernItemType[i] ) then + call WoWReforgedAlchemistLab___SetShopRace(shop , i) + + exitwhen ( true ) + endif + set i=i + 1 + endloop + call h__RemoveItem(soldItem) + endif + set soldItem=null + set shop=null + return false +endfunction + +function WoWReforgedAlchemistLab___IsRaceTypeAllowed takes player whichPlayer,integer t,integer targetRace returns boolean + if ( not PlayerHasUnlockedRace(whichPlayer , targetRace) ) then + if ( t == RACE_OBJECT_TYPE_TIER_1 ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_2 ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_3 ) then + return false + elseif ( t == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_1_ITEM ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_2_ITEM ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_3_ITEM ) then + return false + endif + endif + return true +endfunction + + +function TriggerRegisterConvertEvent takes trigger whichTrigger returns nothing + set WoWReforgedAlchemistLab___convertTriggers[WoWReforgedAlchemistLab___convertTriggersCounter]=whichTrigger + set WoWReforgedAlchemistLab___convertTriggersCounter=WoWReforgedAlchemistLab___convertTriggersCounter + 1 +endfunction + +function GetTriggerConverter takes nothing returns unit + return WoWReforgedAlchemistLab___triggerConverter +endfunction + +function GetTriggerReplacingUnit takes nothing returns unit + return WoWReforgedAlchemistLab___triggerReplacingUnit +endfunction + +function GetTriggerReplacingItem takes nothing returns item + return WoWReforgedAlchemistLab___triggerReplacingItem +endfunction + +function WoWReforgedAlchemistLab___ExecuteCallbacks takes unit converter,unit replacingUnit,item replacingItem returns nothing + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedAlchemistLab___convertTriggersCounter ) + if ( IsTriggerEnabled(WoWReforgedAlchemistLab___convertTriggers[i]) ) then + set WoWReforgedAlchemistLab___triggerConverter=converter + set WoWReforgedAlchemistLab___triggerReplacingUnit=replacingUnit + set WoWReforgedAlchemistLab___triggerReplacingItem=replacingItem + call ConditionalTriggerExecute(WoWReforgedAlchemistLab___convertTriggers[i]) + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedAlchemistLab___ConvertUnit takes unit caster,unit target,integer targetRace returns nothing + local player owner= GetOwningPlayer(caster) + local integer targetUnitTypeId= MapUnitID(GetUnitTypeId(target) , targetRace , false) + if ( targetUnitTypeId != 0 ) then + if ( WoWReforgedAlchemistLab___IsRaceTypeAllowed(owner , GetRaceObjectType(targetRace , targetUnitTypeId) , targetRace) ) then + if ( targetUnitTypeId != GetUnitTypeId(target) ) then + call ReplaceUnitBJ(target, targetUnitTypeId, bj_UNIT_STATE_METHOD_RELATIVE) + call WoWReforgedAlchemistLab___ExecuteCallbacks(caster , GetLastReplacedUnitBJ() , null) + else + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "Could not convert the target unit.") + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "Conversion is not allowed.") + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "Could not convert the target unit.") + endif + set owner=null +endfunction + +function WoWReforgedAlchemistLab___ConvertItem takes unit caster,item target,integer targetRace returns nothing + local player owner= GetOwningPlayer(caster) + local integer targetItemTypeId= MapRaceObjectType(GetItemTypeId(target) , targetRace) + local item whichItem= null + if ( targetItemTypeId != 0 ) then + if ( WoWReforgedAlchemistLab___IsRaceTypeAllowed(owner , GetRaceObjectType(targetRace , targetItemTypeId) , targetRace) ) then + if ( targetItemTypeId != GetItemTypeId(target) ) then + set whichItem=ReplaceItem(target , targetItemTypeId) + call WoWReforgedAlchemistLab___ExecuteCallbacks(caster , null , whichItem) + else + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "Could not convert the target item.") + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "Conversion is not allowed.") + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(owner , "Could not convert the target item.") + endif + set owner=null +endfunction + +function WoWReforgedAlchemistLab___TriggerConditionCast takes nothing returns boolean + local unit shop= GetTriggerUnit() + local integer abilityId= GetSpellAbilityId() + local integer targetRace= GetUnitUserData(shop) + local unit targetUnit= GetSpellTargetUnit() + local item targetItem= GetSpellTargetItem() + + if ( abilityId == ABILITY_ID_CONVERT_UNIT or abilityId == ABILITY_ID_CONVERT_ITEM ) then + if ( targetUnit != null ) then + call WoWReforgedAlchemistLab___ConvertUnit(shop , targetUnit , targetRace) + elseif ( targetItem != null ) then + call WoWReforgedAlchemistLab___ConvertItem(shop , targetItem , targetRace) + endif + endif + + set shop=null + set targetUnit=null + set targetItem=null + + return false +endfunction + +function WoWReforgedAlchemistLab___ForGroupAddShop takes nothing returns nothing + call WoWReforgedAlchemistLab___AddRaceTypesToShop(GetEnumUnit()) +endfunction + +function AddAlchemistLabShops takes nothing returns nothing + local group shops= GetUnitsOfTypeIdAll(ALCHEMIST_LAB) + call ForGroup(shops, function WoWReforgedAlchemistLab___ForGroupAddShop) + call GroupClear(shops) + call DestroyGroup(shops) + set shops=null +endfunction + +function WoWReforgedAlchemistLab___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedAlchemistLab___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedAlchemistLab___constructionTrigger, Condition(function WoWReforgedAlchemistLab___TriggerConditionConstructionFinish)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedAlchemistLab___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedAlchemistLab___sellTrigger, Condition(function WoWReforgedAlchemistLab___TriggerConditionSell)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedAlchemistLab___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(WoWReforgedAlchemistLab___castTrigger, Condition(function WoWReforgedAlchemistLab___TriggerConditionCast)) +endfunction + + +//library WoWReforgedAlchemistLab ends +//library WoWReforgedAltars: + +function IsAltar takes integer unitTypeId returns boolean + if ( unitTypeId == FOUNTAIN_OF_LIFE ) then + return true + endif + + return GetObjectRaceType(unitTypeId) == RACE_OBJECT_TYPE_ALTAR +endfunction + +function IsAltarFilter takes nothing returns boolean + return IsAltar(GetUnitTypeId(GetFilterUnit())) +endfunction + + +function WoWReforgedAltars___IsResurrectionStoneFilter takes nothing returns boolean + return (IsResurrectionStone(GetUnitTypeId((GetFilterUnit())))) and ResurrectionStoneHasHeroOfPlayer((LoadInteger(WoWReforgedResurrectionStone___h, GetHandleId((GetFilterUnit())), 0)) , WoWReforgedAltars___filterPlayer) // INLINED!! +endfunction + +function SelectNextAltar takes player whichPlayer returns unit + local group altars= CreateGroup() + local group resurrectionStones= CreateGroup() + local unit result= null + call GroupEnumUnitsOfPlayer(altars, whichPlayer, Filter(function IsAltarFilter)) + set WoWReforgedAltars___filterPlayer=whichPlayer + call GroupEnumUnitsInRect(resurrectionStones, GetPlayableMapRect(), Filter(function WoWReforgedAltars___IsResurrectionStoneFilter)) + call GroupAddGroup(resurrectionStones, altars) + set result=GetNextUnitToSelect(altars , whichPlayer) + call GroupClear(altars) + call DestroyGroup(altars) + set altars=null + call GroupClear(resurrectionStones) + call DestroyGroup(resurrectionStones) + set resurrectionStones=null + + if ( result != null ) then + call SelectUnitForPlayerSingle(result, whichPlayer) + call SmartCameraPanToUnit(whichPlayer , result , 0.0) + else + call SimError(whichPlayer , "No altars.") + endif + + return result +endfunction + + +//library WoWReforgedAltars ends +//library WoWReforgedBuilder: + + +function EnableBuilder takes unit whichUnit returns nothing + local integer max= 0 + local integer i= 0 + local integer max2= 0 + local integer j= 0 + call EnablePagedButtons(whichUnit) + + call SetPagedButtonsCurrentPageName(whichUnit , "Players") +call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_PLAYER_RED) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! +call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_NEUTRAL_HOSTILE) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! +call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_NEUTRAL_PASSIVE) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + + call AddPagedButtonsSpacersRemaining(whichUnit) + + call SetPagedButtonsCurrentPageName(whichUnit , "Colors") +call AddPagedButtonsId((whichUnit ) , ( ITEM_TYPE_ID_COLOR_RED) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + call AddPagedButtonsSpacersRemaining(whichUnit) + + call SetPagedButtonsCurrentPageName(whichUnit , "Creeps") + set i=0 + set max=(WoWReforgedRaces__objectTypeCreepsCounter) // INLINED!! + loop + exitwhen ( i >= max ) + if ( (WoWReforgedRaces__objectTypeCreeps[(i)]) != 0 ) then // INLINED!! +call AddPagedButtonsId((whichUnit ) , ( (WoWReforgedRaces__objectTypeCreeps[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + endif + set i=i + 1 + endloop + + call SetPagedButtonsCurrentPageName(whichUnit , "Units") + set max=(udg_MaxRaces) // INLINED!! + loop + exitwhen ( i >= max ) + set max2=RACE_MAX_OBJECT_TYPES + set j=0 + loop + exitwhen ( j >= max2 ) + if ( GetRaceObjectTypeId(i , j) != 0 ) then +call AddPagedButtonsId((whichUnit ) , ( GetRaceObjectTypeId(i , j)) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function WoWReforgedBuilder__GetTargetPlayer takes player whichPlayer returns player + return Player(WoWReforgedBuilder__targetPlayerIndex[GetPlayerId(whichPlayer)]) +endfunction + +function WoWReforgedBuilder__TriggerConditionSell takes nothing returns boolean + local unit b= GetSellingUnit() + local integer itemTypeId= GetItemTypeId(GetSoldItem()) + local player owner= GetOwningPlayer(b) + local integer playerId= GetPlayerId(owner) + if ( GetUnitTypeId(b) == BUILDER ) then + if ( itemTypeId == ITEM_TYPE_ID_PLAYER_RED ) then + set WoWReforgedBuilder__targetPlayerIndex[playerId]=0 + elseif ( itemTypeId == ITEM_TYPE_ID_NEUTRAL_HOSTILE ) then + set WoWReforgedBuilder__targetPlayerIndex[playerId]=PLAYER_NEUTRAL_AGGRESSIVE + elseif ( itemTypeId == ITEM_TYPE_ID_NEUTRAL_PASSIVE ) then + set WoWReforgedBuilder__targetPlayerIndex[playerId]=PLAYER_NEUTRAL_PASSIVE + elseif ( itemTypeId == ITEM_TYPE_ID_COLOR_RED ) then + call SetPlayerColor((Player(WoWReforgedBuilder__targetPlayerIndex[GetPlayerId((owner))])), PLAYER_COLOR_RED) // INLINED!! + else + call CreateUnit((Player(WoWReforgedBuilder__targetPlayerIndex[GetPlayerId((owner))])), itemTypeId, GetUnitX(b), GetUnitY(b), GetUnitFacing(b)) // INLINED!! + endif + call h__RemoveItem(GetSoldItem()) + endif + set b=null + set owner=null + return false +endfunction + +function WoWReforgedBuilder__TriggerConditionOrder takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == BUILDER ) then + if ( GetIssuedOrderId() == OrderId("smart") or GetIssuedOrderId() == OrderId("move") ) then + call IssuePointOrder(GetTriggerUnit(), "blink", GetOrderPointX(), GetOrderPointY()) + endif + endif + return false +endfunction + +function WoWReforgedBuilder__TriggerConditionOrderTarget takes nothing returns boolean + if ( GetUnitTypeId(GetTriggerUnit()) == BUILDER ) then + if ( GetIssuedOrderId() == OrderId("smart") or GetIssuedOrderId() == OrderId("move") ) then + call IssuePointOrder(GetTriggerUnit(), "blink", GetWidgetX(GetOrderTarget()), GetWidgetY(GetOrderTarget())) + endif + endif + return false +endfunction + +function WoWReforgedBuilder__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBuilder__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedBuilder__sellTrigger, Condition(function WoWReforgedBuilder__TriggerConditionSell)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBuilder__orderTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) + call TriggerAddCondition(WoWReforgedBuilder__orderTrigger, Condition(function WoWReforgedBuilder__TriggerConditionOrder)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedBuilder__orderTargetTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) + call TriggerAddCondition(WoWReforgedBuilder__orderTargetTrigger, Condition(function WoWReforgedBuilder__TriggerConditionOrderTarget)) +endfunction + + +//library WoWReforgedBuilder ends +//library WoWReforgedClans: + + +function GetPlayerClan takes player whichPlayer returns integer + return udg_ClanPlayerClan[GetConvertedPlayerId(whichPlayer)] +endfunction + +function PlayerHasClan takes player whichPlayer returns boolean + return (udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))]) != 0 // INLINED!! +endfunction + +function GetClanName takes integer clan returns string + return udg_ClanName[clan] +endfunction + +function GetClanIcon takes integer clan returns integer + return udg_ClanIcon[clan] +endfunction + +function GetClanIconPath takes integer clan returns string + return GetItemTypeIcon((udg_ClanIcon[(clan)])) // INLINED!! +endfunction + +function GetClanSound takes integer clan returns sound + return udg_ClanSound[clan] +endfunction + +function GetClanRankName takes integer rank returns string + if ( rank == udg_ClanRankLeader ) then + return "Leader" + elseif ( rank == udg_ClanRankCaptain ) then + return "Captain" + else + return "Member" + endif +endfunction + + +function WoWReforgedClans__TimerFunctionClanResources takes nothing returns nothing + local integer i= 0 + local integer j= 0 + local integer gold= 0 + local integer lumber= 0 + loop + exitwhen ( i == udg_ClanCounter ) + if ( udg_ClanAIPlayer[i] != null ) then + set gold=IMinBJ(100, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_GOLD)) + set lumber=IMinBJ(100, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_LUMBER)) + + set j=0 + loop + exitwhen ( j == bj_MAX_PLAYERS ) + if ( IsPlayerInForce(Player(j), udg_ClanPlayers[i]) ) then + if ( gold > 0 ) then + call SetPlayerStateBJ(Player(j), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(j), PLAYER_STATE_RESOURCE_GOLD) + gold / CountPlayersInForceBJ(udg_ClanPlayers[i])) + endif + if ( lumber > 0 ) then + call SetPlayerStateBJ(Player(j), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(Player(j), PLAYER_STATE_RESOURCE_LUMBER) + lumber / CountPlayersInForceBJ(udg_ClanPlayers[i])) + endif + if ( udg_ClanShowAIResourcesMessage[GetConvertedPlayerId(Player(j))] and gold > 0 or lumber > 0 ) then + call h__DisplayTextToPlayer(Player(j), 0, 0, GetPlayerNameColored(udg_ClanAIPlayer[i]) + " gave your clan " + I2S(gold) + " gold and " + I2S(lumber) + " lumber which has been split amongst all online clan players. Enter \"-clanaioff\" to hide these messages.") + endif + endif + set j=j + 1 + endloop + + // do not remove the resources to limit the player + //if (gold > 0) then + //call SetPlayerStateBJ(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_GOLD) - gold) + //endif + //if (lumber > 0) then + //call SetPlayerStateBJ(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(udg_ClanAIPlayer[i], PLAYER_STATE_RESOURCE_LUMBER) - lumber) + //endif + endif + set i=i + 1 + endloop +endfunction + +// Chooses one AI player to share gold and lumber with all clan players every X seconds. +function PickClanAIPlayer takes integer clan returns player + local player result= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( Player(i) != udg_BossesPlayer and Player(i) != udg_TheBurningLegion and Player(i) != udg_Gaia and GetPlayerController(Player(i)) == MAP_CONTROL_COMPUTER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then + if ( result == null ) then + set result=Player(i) + // prefer warlords due to more gold and lumber + elseif ( result != null and udg_PlayerIsWarlord[GetConvertedPlayerId(Player(i))] and not udg_PlayerIsWarlord[GetConvertedPlayerId(result)] ) then + set result=Player(i) + endif + endif + set i=i + 1 + endloop + + if ( result != null ) then + set udg_ClanAIPlayer[clan]=result + call TimerStart(WoWReforgedClans__clanResourceTimer, 300.0, true, function WoWReforgedClans__TimerFunctionClanResources) + set i=0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then + set udg_ClanShowAIResourcesMessage[GetConvertedPlayerId(Player(i))]=true + endif + set i=i + 1 + endloop + endif + + return result +endfunction + +function GetClanPlayerNames takes integer clan returns string + local string result= "" + local integer counter= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then + if ( counter > 0 ) then + set result=result + ", " + endif + set result=result + GetPlayerNameColored(Player(i)) + set counter=counter + 1 + endif + set i=i + 1 + endloop + return result +endfunction + +function GetClansInfo takes nothing returns string + local string result= "Clans:\n" + local integer i= 1 + loop + exitwhen ( i >= udg_ClanCounter ) + set result=result + "- " + udg_ClanName[i] + " (" + I2S(CountPlayersInForceBJ(udg_ClanPlayers[i])) + " player(s): " + GetClanPlayerNames(i) + ")\n" + set i=i + 1 + endloop + return result +endfunction + + +//library WoWReforgedClans ends +//library WoWReforgedCreeps: + +function CompareCreeps takes nothing returns nothing + local group g= CreateGroup() + local unit u= null + local integer max= (WoWReforgedRaces__objectTypeCreepsCounter) // INLINED!! + local integer i= 0 + local integer j= 0 + local integer max2= 0 + local boolean found= false + call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_AGGRESSIVE), null) + loop + exitwhen ( i >= max ) + if ( not IsCritter((WoWReforgedRaces__objectTypeCreeps[(i)])) ) then // INLINED!! + set found=false + set j=0 + set max2=BlzGroupGetSize(g) + loop + exitwhen ( j >= max2 or found ) + set u=BlzGroupUnitAt(g, j) + if ( (WoWReforgedRaces__objectTypeCreeps[(i)]) == GetUnitTypeId(u) ) then // INLINED!! + set found=true + endif + set u=null + set j=j + 1 + endloop + if ( not found ) then + call h__BJDebugMsg("Missing creep type " + GetObjectName((WoWReforgedRaces__objectTypeCreeps[(i)]))) // INLINED!! + endif + endif + set i=i + 1 + endloop + + // critters + call GroupClear(g) + call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), null) + set i=0 + loop + exitwhen ( i >= max ) + if ( IsCritter((WoWReforgedRaces__objectTypeCreeps[(i)])) ) then // INLINED!! + set found=false + set j=0 + set max2=BlzGroupGetSize(g) + loop + exitwhen ( j >= max2 or found ) + set u=BlzGroupUnitAt(g, j) + if ( (WoWReforgedRaces__objectTypeCreeps[(i)]) == GetUnitTypeId(u) ) then // INLINED!! + set found=true + endif + set u=null + set j=j + 1 + endloop + if ( not found ) then + call h__BJDebugMsg("Missing critter type " + GetObjectName((WoWReforgedRaces__objectTypeCreeps[(i)]))) // INLINED!! + endif + endif + set i=i + 1 + endloop + call GroupClear(g) + + call DestroyGroup(g) + set g=null +endfunction + + +//library WoWReforgedCreeps ends +//library WoWReforgedRacesLimits: + +function SetRacesLimits takes integer housingLimit,integer towerLimit returns nothing + local integer max= (udg_MaxRaces) // INLINED!! + local integer i= 1 + loop + exitwhen ( i == max ) + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_HOUSING) != 0 ) then + call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_HOUSING) , housingLimit) + endif + + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SCOUT_TOWER) != 0 ) then + call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SCOUT_TOWER) , towerLimit) + endif + + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_GUARD_TOWER) != 0 ) then + call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_GUARD_TOWER) , towerLimit) + endif + + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CANNON_TOWER) != 0 ) then + call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CANNON_TOWER) , towerLimit) + endif + + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_ARCANE_TOWER) != 0 ) then + call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_ARCANE_TOWER) , towerLimit) + endif + + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING) != 0 ) then + call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING) , 1) + endif + + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2) != 0 ) then + call SetTechMaxAllowed(GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2) , 1) + endif + set i=i + 1 + endloop +endfunction + +function AddRacesLimits takes nothing returns nothing + call SetRacesLimits(udg_HousingLimit , udg_TowerLimit) +endfunction + +function ResetRacesLimits takes nothing returns nothing + call SetRacesLimits(- 1 , - 1) +endfunction + + +//library WoWReforgedRacesLimits ends +//library WoWReforgedRacesTavern: + + +function WoWReforgedRacesTavern__AddRacesTavern takes unit tavern returns nothing + local integer i= 1 + call EnablePagedButtons(tavern) + call SetPagedButtonsSlotsPerPage(tavern , 10) + +call AddPagedButtonsId((tavern ) , ( ITEM_TYPE_RANDOM_RACE) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + + set i=1 // skip udg_RaceNone + loop + exitwhen ( i >= (udg_MaxRaces) ) // INLINED!! +call AddPagedButtonsId((tavern ) , ( udg_RaceTavernItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop + call SetPagedButtonsPage(tavern , 0) +endfunction + +function WoWReforgedRacesTavern__ForGroupAddRacesTavern takes nothing returns nothing + call WoWReforgedRacesTavern__AddRacesTavern(GetEnumUnit()) +endfunction + +function WoWReforgedRacesTavern__TimerFunctionAddRacesTaverns takes nothing returns nothing + call ForGroupBJ(GetUnitsOfTypeIdAll(RACES_TAVERN), function WoWReforgedRacesTavern__ForGroupAddRacesTavern) + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function SelectRandomRace takes unit buyingUnit,unit tavern returns nothing + local player owner= GetOwningPlayer(buyingUnit) + local integer array availableIds + local integer availableIdsCounter= 0 + local integer id= 0 + local integer random= 0 + local integer page= 0 + local integer index= 0 + local integer i= 1 + local integer max= (udg_MaxRaces) // INLINED!! + loop + exitwhen ( i >= max ) + set id=udg_RaceTavernItemType[i] + if ( PlayerCanPickRaceEx(owner , id) ) then + set availableIds[availableIdsCounter]=id + set availableIdsCounter=availableIdsCounter + 1 + endif + set i=i + 1 + endloop + + set random=GetRandomInt(0, availableIdsCounter - 1) + set id=availableIds[random] + //call BJDebugMsg("Selected random " + GetObjectName(id)) + set index=GetPagedButtonIndex(tavern , id) + //call BJDebugMsg("index " + I2S(index)) + set page=GetPagedButtonsPageByIndex(tavern , index) + //call BJDebugMsg("page " + I2S(page)) + call SetPagedButtonsPage(tavern , page) + call IssueNeutralImmediateOrderById(owner, tavern, id) + + set owner=null +endfunction + +function WoWReforgedRacesTavern__TriggerConditionSellItem takes nothing returns boolean + if ( GetItemTypeId(GetSoldItem()) == ITEM_TYPE_RANDOM_RACE ) then + call SelectRandomRace(GetBuyingUnit() , GetTriggerUnit()) + call h__RemoveItem(GetSoldItem()) + endif + return false +endfunction + +function WoWReforgedRacesTavern__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedRacesTavern__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedRacesTavern__sellTrigger, Condition(function WoWReforgedRacesTavern__TriggerConditionSellItem)) + + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedRacesTavern__TimerFunctionAddRacesTaverns) +endfunction + + +//library WoWReforgedRacesTavern ends +//library WoWReforgedRecreateHeroItems: + +function WoWReforgedRecreateHeroItems__UnitAddItemByIdIfNotInInventory takes unit hero,integer itemTypeId returns item + if ( not UnitHasItemOfTypeBJ(hero, itemTypeId) ) then + return UnitAddItemById(hero, itemTypeId) + endif + return null +endfunction + +function RecreateHeroItems takes player whichPlayer returns nothing + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + if ( (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) != udg_ProfessionNone ) then // INLINED!! + call WoWReforgedRecreateHeroItems__UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetProfessionBookItemTypeId((udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]))) // INLINED!! + endif + if ( (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) != udg_ProfessionNone and (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! + call WoWReforgedRecreateHeroItems__UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetProfessionBookItemTypeId((udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]))) // INLINED!! + endif + if ( (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) != udg_ProfessionNone and (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerProfession2[GetConvertedPlayerId((whichPlayer))]) and (udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerProfession[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! + call WoWReforgedRecreateHeroItems__UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetProfessionBookItemTypeId((udg_PlayerProfession3[GetConvertedPlayerId((whichPlayer))]))) // INLINED!! + endif + if ( (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) != udg_RaceNone ) then // INLINED!! + call WoWReforgedRecreateHeroItems__UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetRaceObjectTypeId((udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) , RACE_OBJECT_TYPE_SCEPTER_ITEM)) // INLINED!! + endif + if ( (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) != udg_RaceNone and (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! + call WoWReforgedRecreateHeroItems__UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetRaceObjectTypeId((udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) , RACE_OBJECT_TYPE_SCEPTER_ITEM)) // INLINED!! + endif + if ( (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) != udg_RaceNone and (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerRace2[GetConvertedPlayerId((whichPlayer))]) and (udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) != (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) ) then // INLINED!! + call WoWReforgedRecreateHeroItems__UnitAddItemByIdIfNotInInventory((udg_Hero[GetPlayerId((whichPlayer))]) , GetRaceObjectTypeId((udg_PlayerRace3[GetConvertedPlayerId((whichPlayer))]) , RACE_OBJECT_TYPE_SCEPTER_ITEM)) // INLINED!! + endif + call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Recreated profession and race items.") + else + call SimError(whichPlayer , "Hero 1 must be picked before.") + endif +endfunction + + +//library WoWReforgedRecreateHeroItems ends +//library WoWReforgedResources: + + +function GetMineTypeIndex takes integer unitTypeId returns integer + local integer i= 0 + loop + exitwhen ( i == WoWReforgedResources__maxMines ) + if ( WoWReforgedResources__mineTypes[i] == unitTypeId ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function AddWoWReforgedReturnBuilding takes unit whichUnit returns nothing + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + call GroupAddUnit(Resources___returnBuildings, (whichUnit)) // INLINED!! + loop + exitwhen ( i == max ) + call SetUnitReturnResource(whichUnit , (s__Resource_resources[(i)]) , true) // INLINED!! + set i=i + 1 + endloop +endfunction + +function AddWoWReforgedOilShip takes unit producer,unit worker returns nothing + call AddWorker(worker) + call AddResourceToWorker(worker , udg_ResourceOil , 'A1PL' , "harvest" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 200 , 20 , "gold") + if ( producer != null ) then + call ReorderWorkerToMineRally(producer , worker) + endif +endfunction + +function AddWoWReforgedWorker takes unit producer,unit worker returns nothing + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + call AddWorker(worker) + loop + exitwhen ( i == max ) + if ( not IsStandardResource((s__Resource_resources[(i)])) ) then // INLINED!! + call AddResourceToWorker(worker , (s__Resource_resources[(i)]) , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 10 , 20 , "gold") // INLINED!! + endif + set i=i + 1 + endloop + if ( producer != null ) then + call ReorderWorkerToMineRally(producer , worker) + endif +endfunction + +function AddWoWReforgedFaithWorker takes unit producer,unit worker returns nothing + call AddWorker(worker) + call AddResourceToWorker(worker , udg_ResourceFavor , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") + if ( producer != null ) then + call ReorderWorkerToMineRally(producer , worker) + endif +endfunction + +function AddWoWReforgedFaithMine takes unit mine returns nothing + call AddMineEx(mine , udg_ResourceFavor , 200) +endfunction + +function AddRandomMine takes integer buildingTypeId,integer resource,integer startAmount returns integer + local integer index= WoWReforgedResources__maxMines + set WoWReforgedResources__maxMines=WoWReforgedResources__maxMines + 1 + set WoWReforgedResources__mineTypes[index]=buildingTypeId + set WoWReforgedResources__mineResource[index]=resource + set WoWReforgedResources__mineStartAmount[index]=startAmount + return index +endfunction + +function AddRandomWaterMine takes integer buildingTypeId,integer resource,integer startAmount returns integer + local integer index= WoWReforgedResources__maxWaterMines + set WoWReforgedResources__maxWaterMines=WoWReforgedResources__maxWaterMines + 1 + set WoWReforgedResources__waterMineTypes[index]=buildingTypeId + set WoWReforgedResources__waterMineResource[index]=resource + set WoWReforgedResources__waterMineStartAmount[index]=startAmount + return index +endfunction + +function WoWReforgedResources__FilterIsFishSchool takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == FISH_SCHOOL +endfunction + +function WoWReforgedResources__ForGroupAddFishSchool takes nothing returns nothing + call AddMineEx(GetEnumUnit() , udg_ResourceMeat , 50000) +endfunction + +function InitFishSchools takes nothing returns nothing + local group fishSchools= CreateGroup() + call GroupEnumUnitsInRect(fishSchools, GetPlayableMapRect(), Filter(function WoWReforgedResources__FilterIsFishSchool)) + call ForGroup(fishSchools, function WoWReforgedResources__ForGroupAddFishSchool) + call GroupClear(fishSchools) + call DestroyGroup(fishSchools) + set fishSchools=null +endfunction + +function WoWReforgedResources__FilterIsBerryBushes takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == BERRY_BUSHES +endfunction + +function WoWReforgedResources__ForGroupAddBerryBushes takes nothing returns nothing + call AddMineEx(GetEnumUnit() , udg_ResourceFruits , 500) +endfunction + +function InitBerryBushes takes nothing returns nothing + local group berryBushes= CreateGroup() + call GroupEnumUnitsInRect(berryBushes, GetPlayableMapRect(), Filter(function WoWReforgedResources__FilterIsBerryBushes)) + call ForGroup(berryBushes, function WoWReforgedResources__ForGroupAddBerryBushes) + call GroupClear(berryBushes) + call DestroyGroup(berryBushes) + set berryBushes=null +endfunction + +// Call after initializing the global variables. +function InitRandomMines takes nothing returns nothing + call AddRandomMine(GEMSTONES_MINE , udg_ResourceGemstones , 500) + call AddRandomMine(ORE_MINE , udg_ResourceIron , 5000) + call AddRandomMine(WELL , udg_ResourceWater , 5000) + call AddRandomMine(OIL_PLATFORM , udg_ResourceOil , 1000) + call AddRandomMine(FOOD_FARM , udg_ResourceGrain , 5000) + call AddRandomMine(POWER_CRYSTAL_MINE , udg_ResourceElectricity , 2000) + call AddRandomMine(MONUMENT , udg_ResourceFavor , 2000) + call AddRandomMine(FRUIT_STAND , udg_ResourceFruits , 5000) + call AddRandomMine(ROCKS_MINE , udg_ResourceRock , 2000) + call AddRandomMine(ARGUNITE_MINE , udg_ResourceArgunite , 2000) + call AddRandomMine(FEL_MINE , udg_ResourceFel , 2000) + + call AddRandomWaterMine(WATER_OIL_PLATFORM , udg_ResourceOil , 20000) +endfunction + +function WoWReforgedResources__FilterIsRandomMine takes nothing returns boolean + return GetMineTypeIndex(GetUnitTypeId(GetFilterUnit())) != - 1 +endfunction + +function WoWReforgedResources__ForGroupRemoveUnit takes nothing returns nothing + call h__RemoveUnit(GetEnumUnit()) +endfunction + +function RemoveRandomMinesAtAIStartLocation takes integer computerStartLocation returns nothing + local real x= GetRectCenterX(udg_TownHallLocation[computerStartLocation]) + local real y= GetRectCenterY(udg_TownHallLocation[computerStartLocation]) + local group mines= CreateGroup() + call GroupEnumUnitsInRange(mines, x, y, 4096.0, Filter(function WoWReforgedResources__FilterIsRandomMine)) + call ForGroup(mines, function WoWReforgedResources__ForGroupRemoveUnit) + call GroupClear(mines) + call DestroyGroup(mines) + set mines=null +endfunction + +function CreateMine takes unit source,integer index returns unit + local real x= GetUnitX(source) + local real y= GetUnitY(source) + local unit result= ReplaceUnitBJ(source, WoWReforgedResources__mineTypes[index], bj_UNIT_STATE_METHOD_MAXIMUM) + call SetUnitOwner(result, Player(PLAYER_NEUTRAL_PASSIVE), true) + call SetUnitX(result, x) + call SetUnitY(result, y) + + call AddMineEx(result , WoWReforgedResources__mineResource[index] , WoWReforgedResources__mineStartAmount[index]) + + return result +endfunction + +function FillMine takes unit source returns nothing + local integer index= GetMineTypeIndex(GetUnitTypeId(source)) + if ( index != - 1 ) then + call CreateMine(source , index) + endif +endfunction + +function WoWReforgedResources__ReplaceMineEnumUnit takes nothing returns nothing + call FillMine(GetEnumUnit()) +endfunction + +function FillAllMines takes nothing returns nothing + local group g= CreateGroup() + call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), Filter(function WoWReforgedResources__FilterIsRandomMine)) + call ForGroup(g, function WoWReforgedResources__ReplaceMineEnumUnit) + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function CreateRandomMine takes unit source returns unit + local integer random= GetRandomInt(0, WoWReforgedResources__maxMines - 1) + local real x= GetUnitX(source) + local real y= GetUnitY(source) + local unit result= ReplaceUnitBJ(source, WoWReforgedResources__mineTypes[random], bj_UNIT_STATE_METHOD_MAXIMUM) + call SetUnitOwner(result, Player(PLAYER_NEUTRAL_PASSIVE), true) + call SetUnitX(result, x) + call SetUnitY(result, y) + + call AddMineEx(result , WoWReforgedResources__mineResource[random] , WoWReforgedResources__mineStartAmount[random]) + + return result +endfunction + +function CreateRandomWaterMine takes unit source returns unit + local integer random= GetRandomInt(0, WoWReforgedResources__maxWaterMines - 1) + local real x= GetUnitX(source) + local real y= GetUnitY(source) + local unit result= ReplaceUnitBJ(source, WoWReforgedResources__waterMineTypes[random], bj_UNIT_STATE_METHOD_MAXIMUM) + call SetUnitOwner(result, Player(PLAYER_NEUTRAL_PASSIVE), true) + call SetUnitX(result, x) + call SetUnitY(result, y) + + call AddMineEx(result , WoWReforgedResources__waterMineResource[random] , WoWReforgedResources__waterMineStartAmount[random]) + + return result +endfunction + +function GetRandomResourceExceptFood takes nothing returns integer + local integer r + local integer counter= 0 + local integer array resources + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + loop + exitwhen ( i == max ) + set r=(s__Resource_resources[(i)]) // INLINED!! + if ( r != Resources_FOOD and r != Resources_FOOD_MAX ) then + set resources[counter]=r + set counter=counter + 1 + endif + set i=i + 1 + endloop + + return resources[GetRandomInt(0, counter - 1)] +endfunction + +function CreateRandomResources takes unit hero returns nothing + if ( GetRandomInt(0, 1) == 0 ) then + call CustomBounty(hero , GetRandomResourceExceptFood() , GetRandomInt(0, 50)) + endif +endfunction + +function RewardFlotsam takes unit flotsam,unit killer returns nothing + if ( GetRandomInt(0, 1) == 0 ) then + call CustomBounty(flotsam , GetRandomResourceExceptFood() , GetRandomInt(5, 50)) + endif +endfunction + +function UseMeatItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceMeat , 30) +endfunction + +function UseFishItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceMeat , 30) +endfunction + +function UseBananaItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceFruits , 30) +endfunction + +function UseLemonItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceFruits , 30) +endfunction + +function UseOrangeItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceFruits , 30) +endfunction + +function UseGarlicItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceFruits , 30) +endfunction + +function UsePumpkinItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceFruits , 30) +endfunction + +function UseAppleItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceFruits , 30) +endfunction + +function UseBundleOfWheatItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceGrain , 30) +endfunction + +function UseBlackPowderItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceBlackPowder , 12) +endfunction + +function UseRockItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceRock , 25) +endfunction + +function UseMilkItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceMilk , 30) +endfunction + +function UseWoolItem takes unit hero returns nothing + call CustomBounty(hero , udg_ResourceWool , 30) +endfunction + +function AddFishingBoat takes unit producer,unit worker returns nothing + call AddWorker(worker) + call AddResourceToWorker(worker , udg_ResourceMeat , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 200 , 20 , "gold") + if ( producer != null ) then + call ReorderWorkerToMineRally(producer , worker) + endif +endfunction + +function AddFarmhand takes unit producer,unit worker returns nothing + call AddWorker(worker) + call AddResourceToWorker(worker , udg_ResourceMeat , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") + call AddResourceToWorker(worker , udg_ResourceGrain , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") + call AddResourceToWorker(worker , udg_ResourceWater , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 20 , 5 , "gold") + if ( producer != null ) then + call ReorderWorkerToMineRally(producer , worker) + endif +endfunction + +function AddFarmerSheep takes unit farm,unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceMeat , 30) +endfunction + +function AddFarmerChicken takes unit farm,unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceMeat , 10) +endfunction + +function AddFarmerCow takes unit farm,unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceMeat , 100) +endfunction + +function AddFarmerPig takes unit farm,unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceMeat , 60) +endfunction + +function AddFarm takes unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceGrain , 200) + call SetMineExplodesOnDeath(whichUnit , false) +endfunction + +function AddWheatField takes unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceGrain , 300) +endfunction + +function AddCowshed takes unit whichUnit returns nothing + call AddLoadedMine(whichUnit , udg_ResourceMilk , 800 , 5) + call SetLoadedMineAllowedWorkerUnitTypeId(whichUnit , COW , true) + call SetMineExplodesOnDeath(whichUnit , true) +endfunction + +function AddSheepfold takes unit whichUnit returns nothing + call AddLoadedMine(whichUnit , udg_ResourceWool , 800 , 5) + call SetLoadedMineAllowedWorkerUnitTypeId(whichUnit , SHEEP , true) + call SetMineExplodesOnDeath(whichUnit , true) +endfunction + +function AddWaterSupply takes unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceWater , 500) + call SetMineExplodesOnDeath(whichUnit , false) +endfunction + +function AddGranary takes unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceGrain , 400) + call SetMineExplodesOnDeath(whichUnit , false) +endfunction + +function AddWindMill takes unit whichUnit returns nothing + call AddMineEx(whichUnit , udg_ResourceGrain , 600) + call SetMineExplodesOnDeath(whichUnit , false) +endfunction + +function AddOilBoat takes unit producer,unit worker returns nothing + call AddWorker(worker) + call AddResourceToWorker(worker , udg_ResourceOil , 'A1PM' , "heal" , 'A1PN' , "spies" , 'A1PO' , "robogoblin" , 100 , 100 , "gold") + if ( producer != null ) then + call ReorderWorkerToMineRally(producer , worker) + endif +endfunction + +function AddWoWReforgedResource takes nothing returns integer + set udg_TmpInteger=(s__Resource_create((udg_TmpString))) // INLINED!! + set s__Resource_goldExchangeRate[(udg_TmpInteger )]=(( udg_TmpReal)*1.0) // INLINED!! + set s__Resource_icon[(udg_TmpInteger )]=( udg_TmpIcon) // INLINED!! + set s__Resource_iconAtt[(udg_TmpInteger )]=( udg_TmpIcon2) // INLINED!! + set s__Resource_description[(udg_TmpInteger )]=( udg_TmpString2) // INLINED!! + set s__Resource_red[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! + set s__Resource_green[(udg_TmpInteger )]=( udg_TmpInteger3) // INLINED!! + set s__Resource_blue[(udg_TmpInteger )]=( udg_TmpInteger4) // INLINED!! + + return udg_TmpInteger +endfunction + +function IsSellableResource takes integer index returns boolean + return index >= 0 and index < (s__Resource_resourcesCount) and (s__Resource_resources[(index)]) != Resources_FOOD and (s__Resource_resources[(index)]) != Resources_FOOD_MAX // INLINED!! +endfunction + +function ShowResourceInfo takes player whichPlayer returns nothing + local string msg= "" + local group selected= GetUnitsSelectedAll(whichPlayer) + local unit first= null + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + local integer r= 0 + set first=FirstOfGroup(selected) + if ( first != null ) then + loop + exitwhen ( i == max ) + set r=(s__Resource_resources[(i)]) // INLINED!! + if ( (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) > 0 or (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! + if ( (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! + if ( not (IsUnitInGroup((first), Resources___mines)) ) then // INLINED!! + if ( msg != "" ) then + set msg=msg + ", " + endif + set msg=msg + "Max " + (s__Resource_name[(r)]) + ": " + I2S((LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX)))) // INLINED!! + endif + endif + if ( (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) > 0 ) then // INLINED!! + if ( msg != "" ) then + set msg=msg + ", " + endif + set msg=msg + "Carried " + (s__Resource_name[(r)]) + ": " + I2S((LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE , Resources___KEY_MAX)))) // INLINED!! + endif + if ( not (IsUnitInGroup((first), Resources___mines)) and (LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE_PER_HIT , Resources___KEY_MAX))) > 0 ) then // INLINED!! + if ( msg != "" ) then + set msg=msg + ", " + endif + + set msg=msg + "Per Hit " + (s__Resource_name[(r)]) + ": " + I2S((LoadInteger(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RESOURCE_PER_HIT , Resources___KEY_MAX)))) // INLINED!! + endif + endif + if ( (LoadBoolean(Resources___h, GetHandleId((first )), Resources___Index2D(( r) , Resources___KEY_RETURN_RESOURCE , Resources___KEY_MAX))) ) then // INLINED!! + if ( msg != "" ) then + set msg=msg + ", " + endif + + set msg=msg + "Allows returning " + (s__Resource_name[(r)]) // INLINED!! + endif + set i=i + 1 + endloop + if ( msg == "" ) then + set msg="No resources." + endif + call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, msg) + set first=null + else + call SimError(whichPlayer , "Empty selection.") + endif + call GroupClear(selected) + call DestroyGroup(selected) + set selected=null +endfunction + +function SellAllResources takes player whichPlayer returns nothing + local integer r= 0 + local integer gold= 0 + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + loop + exitwhen ( i == max ) + set r=(s__Resource_resources[(i)]) // INLINED!! + if ( r != Resources_GOLD and r != Resources_LUMBER and r != Resources_FOOD and r != Resources_FOOD_MAX and (s__Resource_goldExchangeRate[(r)]) > 0.0 and GetPlayerResource(whichPlayer , r) > 0 ) then // INLINED!! + set gold=gold + ExchangePlayerResource(whichPlayer , r , Resources_GOLD , GetPlayerResource(whichPlayer , r)) + endif + set i=i + 1 + endloop + call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Sold all resources for " + I2S(gold) + " gold.") +endfunction + +function SellAllLumber takes player whichPlayer returns nothing + local integer gold= 0 + if ( (s__Resource_goldExchangeRate[(Resources_LUMBER)]) > 0.0 and GetPlayerResource(whichPlayer , Resources_LUMBER) > 0 ) then // INLINED!! + set gold=ExchangePlayerResource(whichPlayer , Resources_LUMBER , Resources_GOLD , GetPlayerResource(whichPlayer , Resources_LUMBER)) + endif + call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Sold all lumber for " + I2S(gold) + " gold.") +endfunction + +function AddNeutralBuildingMines takes nothing returns nothing + local integer i= 0 + local integer max= WoWReforgedResources__maxMines + loop + exitwhen ( i == max ) + call AddNeutralUnit(WoWReforgedResources__mineTypes[i]) + set i=i + 1 + endloop + set i=0 + set max=WoWReforgedResources__maxWaterMines + loop + exitwhen ( i == max ) + call AddNeutralUnit(WoWReforgedResources__waterMineTypes[i]) + set i=i + 1 + endloop +endfunction + + +//library WoWReforgedResources ends +//library WoWReforgedSaddle: + + +function Saddle takes unit mount returns boolean + local boolean result= false + local group cargo= (s__UnitEventEx__Cargo_copyGroup((GetUnitUserData(((mount)))))) // INLINED!! + local integer i= 0 + local integer max= BlzGroupGetSize(cargo) + loop + exitwhen ( i == max or result ) + if ( UnitHasItemOfTypeBJ(BlzGroupUnitAt(cargo, i), WoWReforgedSaddle_ITEM_TYPE_ID) ) then + set result=true + endif + set i=i + 1 + endloop + + if ( result ) then + if ( GetUnitAbilityLevel(mount, WoWReforgedSaddle_ABILITY_ID) == 0 ) then + call UnitAddAbility(mount, WoWReforgedSaddle_ABILITY_ID) + call sc__NewBonusUtils_linkBuff((mount ) , ( BONUS_ATTACK_SPEED ) , (( 0.3 )*1.0) , ( WoWReforgedSaddle_BUFF_ID) , false) // INLINED!! + call sc__NewBonusUtils_linkBuff((mount ) , ( BONUS_MOVEMENT_SPEED ) , (( 150.0 )*1.0) , ( WoWReforgedSaddle_BUFF_ID) , false) // INLINED!! + endif + else + call UnitRemoveAbility(mount, WoWReforgedSaddle_ABILITY_ID) + endif + + call GroupClear(cargo) + call DestroyGroup(cargo) + set cargo=null + + return result +endfunction + +function WoWReforgedSaddle___Load takes nothing returns nothing + if ( (WoWReforgedMounts___GetMountTypeByUnitTypeId((GetUnitTypeId((UnitEventEx__eventOther)))) != 0) ) then // INLINED!! + call Saddle((UnitEventEx__eventOther)) // INLINED!! + endif +endfunction + +function WoWReforgedSaddle___Unload takes nothing returns nothing + if ( (WoWReforgedMounts___GetMountTypeByUnitTypeId((GetUnitTypeId((UnitEventEx__eventOther)))) != 0) ) then // INLINED!! + call Saddle((UnitEventEx__eventOther)) // INLINED!! + endif +endfunction + +function WoWReforgedSaddle___Init takes nothing returns nothing +call RegisterIndexNativeEvent(bj_MAX_PLAYER_SLOTS , (EVENT_ON_CARGO_LOAD ) , ( function WoWReforgedSaddle___Load)) // INLINED!! +call RegisterIndexNativeEvent(bj_MAX_PLAYER_SLOTS , (EVENT_ON_CARGO_UNLOAD ) , ( function WoWReforgedSaddle___Unload)) // INLINED!! +endfunction + + +//library WoWReforgedSaddle ends +//library WoWReforgedSceptersShop: + + +function AddSceptersShop takes unit shop returns nothing + local integer i= 0 + local integer max= (udg_MaxRaces) // INLINED!! + call EnablePagedButtons(shop) + loop + exitwhen ( i == max ) +call AddPagedButtonsId((shop ) , ( udg_RaceItemType[i]) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop +endfunction + +function WoWReforgedSceptersShop___FilterIsSceptersShop takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == SCEPTERS_SHOP +endfunction + +function WoWReforgedSceptersShop___ForGroupAddSceptersShop takes nothing returns nothing + call AddSceptersShop(GetEnumUnit()) +endfunction + +function AddAllSceptersShops takes nothing returns nothing + local group shops= CreateGroup() + call GroupEnumUnitsInRect(shops, GetPlayableMapRect(), Filter(function WoWReforgedSceptersShop___FilterIsSceptersShop)) + call ForGroup(shops, function WoWReforgedSceptersShop___ForGroupAddSceptersShop) + call GroupClear(shops) + call DestroyGroup(shops) + set shops=null +endfunction + +function WoWReforgedSceptersShop___TimerFunctionAddAllSceptersShop takes nothing returns nothing + call AddAllSceptersShops() + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function WoWReforgedSceptersShop___Init takes nothing returns nothing + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedSceptersShop___TimerFunctionAddAllSceptersShop) +endfunction + + +//library WoWReforgedSceptersShop ends +//library WoWReforgedThievesGuild: + + +function GetThiefStockUpdateTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedThievesGuild___stockUpdateTimer) +endfunction + +//=========================================================================== +// Find a sellable item of the given type and level, and then add it. +// +function WoWReforgedThievesGuild___UpdateEachStockBuildingEnum takes nothing returns nothing + local integer iteration= 0 + local integer pickedItemId + + loop + set pickedItemId=ChooseRandomItemEx(bj_stockPickedItemType, bj_stockPickedItemLevel) + exitwhen IsItemIdSellable(pickedItemId) + + // If we get hung up on an entire class/level combo of unsellable + // items, or a very unlucky series of random numbers, give up. + set iteration=iteration + 1 + if ( iteration > bj_STOCK_MAX_ITERATIONS ) then + return + endif + endloop + call AddItemToStock(GetEnumUnit(), pickedItemId, 1, 1) +endfunction + +//=========================================================================== +function WoWReforgedThievesGuild___UpdateEachStockBuilding takes itemtype iType,integer iLevel returns nothing + set bj_stockPickedItemType=iType + set bj_stockPickedItemLevel=iLevel + + call ForGroup(WoWReforgedThievesGuild___thievesGuilds, function WoWReforgedThievesGuild___UpdateEachStockBuildingEnum) +endfunction + +//=========================================================================== +// Update stock inventory. +// +function WoWReforgedThievesGuild___PerformStockUpdates takes nothing returns nothing + local integer pickedItemId + local itemtype pickedItemType + local integer pickedItemLevel= 0 + local integer allowedCombinations= 0 + local integer iLevel + + // Give each type/level combination a chance of being picked. + set iLevel=1 + loop + if ( bj_stockAllowedPermanent[iLevel] ) then + set allowedCombinations=allowedCombinations + 1 + if ( GetRandomInt(1, allowedCombinations) == 1 ) then + set pickedItemType=ITEM_TYPE_PERMANENT + set pickedItemLevel=iLevel + endif + endif + if ( bj_stockAllowedCharged[iLevel] ) then + set allowedCombinations=allowedCombinations + 1 + if ( GetRandomInt(1, allowedCombinations) == 1 ) then + set pickedItemType=ITEM_TYPE_CHARGED + set pickedItemLevel=iLevel + endif + endif + if ( bj_stockAllowedArtifact[iLevel] ) then + set allowedCombinations=allowedCombinations + 1 + if ( GetRandomInt(1, allowedCombinations) == 1 ) then + set pickedItemType=ITEM_TYPE_ARTIFACT + set pickedItemLevel=iLevel + endif + endif + + set iLevel=iLevel + 1 + exitwhen iLevel > bj_MAX_ITEM_LEVEL + endloop + + // Make sure we found a valid item type to add. + if ( allowedCombinations == 0 ) then + return + endif + + call WoWReforgedThievesGuild___UpdateEachStockBuilding(pickedItemType , pickedItemLevel) +endfunction + +//=========================================================================== +// Perform the first update, and then arrange future updates. +// +function WoWReforgedThievesGuild___StartStockUpdates takes nothing returns nothing + call WoWReforgedThievesGuild___PerformStockUpdates() + call TimerStart(WoWReforgedThievesGuild___stockUpdateTimer, bj_STOCK_RESTOCK_INTERVAL, true, function WoWReforgedThievesGuild___PerformStockUpdates) +endfunction + +function IsThievesGuild takes integer unitTypeId returns boolean + return unitTypeId == THIEVES_GUILD_THIEF or unitTypeId == THIEVES_GUILD or unitTypeId == BANDIT_THIEVES_GUILD +endfunction + +function IsUnitThievesGuild takes unit whichUnit returns boolean + return IsThievesGuild(GetUnitTypeId(whichUnit)) +endfunction + +function WoWReforgedThievesGuild___IsValidUnit takes player previousOwner,unit whichUnit returns boolean + local integer unitTypeId= GetUnitTypeId(whichUnit) + if ( previousOwner != Player(PLAYER_NEUTRAL_AGGRESSIVE) ) then + return false + elseif ( IsUnitType(whichUnit, UNIT_TYPE_HERO) ) then + return false + elseif ( IsUnitType(whichUnit, UNIT_TYPE_PEON) ) then + return false + elseif ( IsUnitType(whichUnit, UNIT_TYPE_STRUCTURE) ) then + return false + elseif ( IsUnitType(whichUnit, UNIT_TYPE_SUMMONED) ) then + return false + elseif ( IsCitizen(unitTypeId) ) then + return false + endif + return true +endfunction + +function WoWReforgedThievesGuild___ForGroupAddUnitToThievesGuild takes nothing returns nothing + local integer unitTypeId= GetUnitTypeId(WoWReforgedThievesGuild___tmpUnit) + local integer whichRace= GetObjectRace(unitTypeId) + local unit u= GetEnumUnit() + local player owner= GetOwningPlayer(u) + //call BJDebugMsg("Checking thieves guild " + GetUnitName(u) + " with enemy " + GetUnitName(tmpUnit)) + if ( IsPlayerEnemy(WoWReforgedThievesGuild___tmpPreviousOwner, owner) and ( whichRace == udg_RaceNone or PlayerHasRace(owner , whichRace) ) ) then + call AddUnitToStock(u, GetUnitTypeId(WoWReforgedThievesGuild___tmpUnit), 1, 1) + endif + set u=null + set owner=null +endfunction + +function WoWReforgedThievesGuild___AddUnitToThievesGuild takes player previousOwner,unit whichUnit returns nothing + set WoWReforgedThievesGuild___tmpUnit=whichUnit + set WoWReforgedThievesGuild___tmpPreviousOwner=previousOwner + call ForGroup(WoWReforgedThievesGuild___thievesGuilds, function WoWReforgedThievesGuild___ForGroupAddUnitToThievesGuild) +endfunction + +function WoWReforgedThievesGuild___TriggerConditionDeath takes nothing returns boolean + local unit u= GetTriggerUnit() + local player owner= GetOwningPlayer(u) + if ( IsUnitInGroup(u, WoWReforgedThievesGuild___thievesGuilds) ) then + call GroupRemoveUnit(WoWReforgedThievesGuild___thievesGuilds, u) + elseif ( WoWReforgedThievesGuild___IsValidUnit(owner , u) ) then + call WoWReforgedThievesGuild___AddUnitToThievesGuild(owner , u) + endif + set u=null + set owner=null + + return false +endfunction + +function WoWReforgedThievesGuild___TriggerConditionChangesOwner takes nothing returns boolean + local unit u= GetTriggerUnit() + if ( WoWReforgedThievesGuild___IsValidUnit(GetChangingUnitPrevOwner() , u) ) then + call WoWReforgedThievesGuild___AddUnitToThievesGuild(GetChangingUnitPrevOwner() , u) + endif + set u=null + + return false +endfunction + +function WoWReforgedThievesGuild___TriggerConditionConstructFinish takes nothing returns boolean + local unit b= GetConstructedStructure() + local integer unitTypeId= GetUnitTypeId(b) + if ( IsThievesGuild(unitTypeId) ) then + call GroupAddUnit(WoWReforgedThievesGuild___thievesGuilds, b) + + if ( unitTypeId == THIEVES_GUILD_THIEF or unitTypeId == BANDIT_THIEVES_GUILD ) then + call SetItemTypeSlots(b, 6) + call SetUnitTypeSlots(b, 6) + else + call SetItemTypeSlots(b, 0) + call SetUnitTypeSlots(b, 12) + endif + endif + set b=null + + return false +endfunction + +function WoWReforgedThievesGuild___RemovePurchasedUnit takes nothing returns nothing + call RemoveUnitFromStock(GetSellingUnit(), GetUnitTypeId(GetSoldUnit())) +endfunction + +function WoWReforgedThievesGuild___TriggerConditionSell takes nothing returns boolean + if ( (IsThievesGuild(GetUnitTypeId((GetSellingUnit())))) ) then // INLINED!! + call RemoveUnitFromStock(GetSellingUnit(), GetUnitTypeId(GetSoldUnit())) // INLINED!! + endif + + return false +endfunction + +function WoWReforgedThievesGuild___TriggerConditionSellItem takes nothing returns boolean + if ( (IsThievesGuild(GetUnitTypeId((GetSellingUnit())))) ) then // INLINED!! + call RemovePurchasedItem() + endif + + return false +endfunction + +function WoWReforgedThievesGuild___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedThievesGuild___deathTrigger, Condition(function WoWReforgedThievesGuild___TriggerConditionDeath)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild___changesOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) + call TriggerAddCondition(WoWReforgedThievesGuild___changesOwnerTrigger, Condition(function WoWReforgedThievesGuild___TriggerConditionChangesOwner)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild___constructFinishTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedThievesGuild___constructFinishTrigger, Condition(function WoWReforgedThievesGuild___TriggerConditionConstructFinish)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild___sellUnitTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(WoWReforgedThievesGuild___sellUnitTrigger, Condition(function WoWReforgedThievesGuild___TriggerConditionSell)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedThievesGuild___sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedThievesGuild___sellItemTrigger, Condition(function WoWReforgedThievesGuild___TriggerConditionSellItem)) + + // Arrange the first update. + call TimerStart(WoWReforgedThievesGuild___stockUpdateTimer, bj_STOCK_RESTOCK_INITIAL_DELAY, false, function WoWReforgedThievesGuild___StartStockUpdates) +endfunction + +function WoWReforgedThievesGuild___RemoveUnitHook takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, WoWReforgedThievesGuild___thievesGuilds) ) then + call GroupRemoveUnit(WoWReforgedThievesGuild___thievesGuilds, whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit WoWReforgedThievesGuild___RemoveUnitHook + + +//library WoWReforgedThievesGuild ends +//library WoWReforgedWitchHut: + + +function RemoveAllWitchHutAbilities takes unit whichUnit returns nothing + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedWitchHut___unitTypeIdsCounter ) + call UnitRemoveAbility(whichUnit, WoWReforgedWitchHut___abilityIds[i]) + set i=i + 1 + endloop + if ( (HaveSavedHandle(WoWReforgedMounts___h, GetHandleId((whichUnit)), WoWReforgedMounts___KEY_HERO)) ) then // INLINED!! + call ClearMountAbilities(whichUnit) + endif +endfunction + +function EnableWitchHut takes unit whichUnit returns nothing + local integer i= 0 + call GroupAddUnit(WoWReforgedWitchHut___witchHuts, whichUnit) + call EnablePagedButtons(whichUnit) +call AddPagedButtonsId((whichUnit ) , ( WoWReforgedWitchHut_UNIT_TYPE_REMOVE_ABILITIES) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! + loop + exitwhen ( i >= WoWReforgedWitchHut___unitTypeIdsCounter ) +call AddPagedButtonsId((whichUnit ) , ( WoWReforgedWitchHut___unitTypeIds[i]) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! + set i=i + 1 + endloop +endfunction + +function IsWitchHut takes unit whichUnit returns boolean + return IsUnitInGroup(whichUnit, WoWReforgedWitchHut___witchHuts) +endfunction + +function DisableWitchHut takes unit whichUnit returns nothing + call GroupRemoveUnit(WoWReforgedWitchHut___witchHuts, whichUnit) + call DisablePagedButtons(whichUnit) +endfunction + +function AddWitchHutAbility takes integer abilityId,integer unitTypeId returns integer + local integer index= WoWReforgedWitchHut___unitTypeIdsCounter + call SaveInteger(WoWReforgedWitchHut___h, unitTypeId, 0, abilityId) + set WoWReforgedWitchHut___abilityIds[index]=abilityId + set WoWReforgedWitchHut___unitTypeIds[index]=unitTypeId + set WoWReforgedWitchHut___unitTypeIdsCounter=index + 1 + + return index +endfunction + +function AddWoWReforgedWitchHutAbility takes nothing returns nothing + call AddWitchHutAbility(udg_TmpAbilityCode , udg_TmpUnitType) +endfunction + +function WoWReforgedWitchHut___TriggerConditionConstructFinish takes nothing returns boolean + if ( GetUnitTypeId(GetConstructedStructure()) == WoWReforgedWitchHut_UNIT_TYPE ) then + call EnableWitchHut(GetConstructedStructure()) + endif + return false +endfunction + +function WoWReforgedWitchHut___TriggerConditionConstructDeath takes nothing returns boolean + if ( (IsUnitInGroup((GetTriggerUnit()), WoWReforgedWitchHut___witchHuts)) ) then // INLINED!! + call DisableWitchHut(GetTriggerUnit()) + endif + return false +endfunction + +function WoWReforgedWitchHut___TriggerConditionSell takes nothing returns boolean + local unit soldUnit= GetSoldUnit() + local unit buyingUnit= GetBuyingUnit() + local unit sellingUnit= GetSellingUnit() + local integer soldUnitTypeId= GetUnitTypeId(soldUnit) + local integer abilityId= 0 + if ( (IsUnitInGroup((sellingUnit), WoWReforgedWitchHut___witchHuts)) ) then // INLINED!! + set abilityId=LoadInteger(WoWReforgedWitchHut___h, soldUnitTypeId, 0) + if ( soldUnitTypeId == WoWReforgedWitchHut_UNIT_TYPE_REMOVE_ABILITIES ) then + call RemoveAllWitchHutAbilities(buyingUnit) + call h__DisplayTimedTextToPlayer(GetOwningPlayer(buyingUnit), 0.0, 0.0, 4.0, "Removed all added abilities from " + GetUnitName(buyingUnit) + ".") + elseif ( abilityId != 0 ) then + call UnitAddAbility(buyingUnit, abilityId) + if ( (HaveSavedHandle(WoWReforgedMounts___h, GetHandleId((buyingUnit)), WoWReforgedMounts___KEY_HERO)) ) then // INLINED!! + call AddMountAbility(buyingUnit , abilityId) + endif + call h__DisplayTimedTextToPlayer(GetOwningPlayer(buyingUnit), 0.0, 0.0, 4.0, "Added ability to " + GetUnitName(buyingUnit) + ": " + GetObjectName(abilityId)) + endif + call h__RemoveUnit(soldUnit) + endif + set soldUnit=null + set buyingUnit=null + set sellingUnit=null + return false +endfunction + +function WoWReforgedWitchHut___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedWitchHut___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedWitchHut___constructionTrigger, Condition(function WoWReforgedWitchHut___TriggerConditionConstructFinish)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedWitchHut___deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedWitchHut___deathTrigger, Condition(function WoWReforgedWitchHut___TriggerConditionConstructDeath)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedWitchHut___sellTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(WoWReforgedWitchHut___sellTrigger, Condition(function WoWReforgedWitchHut___TriggerConditionSell)) +endfunction + +function WoWReforgedWitchHut___HookRemoveUnit takes unit whichUnit returns nothing + if ( (IsUnitInGroup((whichUnit), WoWReforgedWitchHut___witchHuts)) ) then // INLINED!! + call DisableWitchHut(whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit WoWReforgedWitchHut___HookRemoveUnit + + +//library WoWReforgedWitchHut ends +//library WoWReforgedWrapUp: + + +function GetBuildingItemId takes integer unitTypeId returns integer + local integer targetRace= (GetObjectRace((unitTypeId))) // INLINED!! + if ( targetRace != udg_RaceNone or IsBuildingAllRaces(unitTypeId) ) then + return MapBuildingIDToItemID(unitTypeId , targetRace) + endif + + return 0 +endfunction + +function FilterIsWrapableBuilding takes nothing returns boolean + local unit filterUnit= GetFilterUnit() + local boolean result= IsUnitType(filterUnit, UNIT_TYPE_STRUCTURE) and GetBuildingItemId(GetUnitTypeId(filterUnit)) != 0 and IsUnitInGroup(filterUnit, WoWReforgedWrapUp__constructedBuildings) + set filterUnit=null + return result +endfunction + +function CancelAllOrdersInBuilding takes unit whichBuilding returns nothing + local integer i= 0 + loop + exitwhen ( i == 8 ) // all slots + call IssueImmediateOrderById(whichBuilding, 851976) + set i=i + 1 + endloop +endfunction + +function WrapUpBuilding takes real x,real y,unit source returns item + local integer unitTypeId= GetUnitTypeId(source) + local integer itemTypeId= GetBuildingItemId(unitTypeId) + local item whichItem= null + if ( itemTypeId != 0 ) then + set whichItem=CreateItem(itemTypeId, x, y) + call SetItemCharges(whichItem, 1) + call IssueImmediateOrder(source, "stop") + call DropItemsFromHero(source) + call CancelAllOrdersInBuilding(source) + call UnitRemoveAbility(source, 'A0NY') // Spawn Fire Elementals + call KillUnit(source) // kill to unload units etc. + endif + + return whichItem +endfunction + +function WrapUpAllBuildings takes unit caster,real x,real y returns integer + local player whichPlayer= GetOwningPlayer(caster) + local group allBuildings= CreateGroup() + local integer counter= 0 + local integer i= 0 + local integer max= 0 + local integer j= 0 + local item whichItem= null + local item array allItems + local integer allItemsCounter= 0 + set WoWReforgedWrapUp__tmpPlayer=whichPlayer + call GroupEnumUnitsInRange(allBuildings, x, y, 1024.0, Filter(function FilterIsWrapableBuilding)) + set max=BlzGroupGetSize(allBuildings) + loop + exitwhen ( i == max ) + set whichItem=WrapUpBuilding(GetUnitX(caster) , GetUnitY(caster) , BlzGroupUnitAt(allBuildings, i)) + if ( whichItem != null ) then + set counter=counter + 1 + call UnitAddItem(caster, whichItem) + set allItems[allItemsCounter]=whichItem + set allItemsCounter=allItemsCounter + 1 + endif + set whichItem=null + set i=i + 1 + endloop + call GroupClear(allBuildings) + call DestroyGroup(allBuildings) + set allBuildings=null + set whichPlayer=null + + // group all items of the same type + set i=0 + set max=allItemsCounter + loop + exitwhen ( i == allItemsCounter ) + if ( allItems[i] != null ) then + set j=i + 1 + loop + exitwhen ( j >= allItemsCounter ) + if ( allItems[j] != null and GetItemCharges(allItems[i]) < 100 and GetItemTypeId(allItems[i]) == GetItemTypeId(allItems[j]) ) then + call SetItemCharges(allItems[i], IMaxBJ(GetItemCharges(allItems[i]), 1) + IMaxBJ(GetItemCharges(allItems[j]), 1)) + call h__RemoveItem(allItems[j]) + set allItems[j]=null + endif + set j=j + 1 + endloop + endif + set i=i + 1 + endloop + + return counter +endfunction + +function WoWReforgedWrapUp__TriggerActionConstructed takes nothing returns nothing + call GroupAddUnit(WoWReforgedWrapUp__constructedBuildings, GetConstructedStructure()) +endfunction + +function WoWReforgedWrapUp__TriggerConditionIsConstructed takes nothing returns boolean + return IsUnitInGroup(GetTriggerUnit(), WoWReforgedWrapUp__constructedBuildings) +endfunction + +function WoWReforgedWrapUp__TriggerActionDeath takes nothing returns nothing + call GroupRemoveUnit(WoWReforgedWrapUp__constructedBuildings, GetTriggerUnit()) +endfunction + +function WoWReforgedWrapUp__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedWrapUp__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddAction(WoWReforgedWrapUp__constructionTrigger, function WoWReforgedWrapUp__TriggerActionConstructed) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedWrapUp__deathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(WoWReforgedWrapUp__deathTrigger, Condition(function WoWReforgedWrapUp__TriggerConditionIsConstructed)) + call TriggerAddAction(WoWReforgedWrapUp__deathTrigger, function WoWReforgedWrapUp__TriggerActionDeath) +endfunction + +function WoWReforgedWrapUp__HookRemoveConstructedBuilding takes unit whichUnit returns nothing + if ( IsUnitInGroup(whichUnit, WoWReforgedWrapUp__constructedBuildings) ) then + call GroupRemoveUnit(WoWReforgedWrapUp__constructedBuildings, whichUnit) + endif +endfunction + +//processed hook: hook RemoveUnit WoWReforgedWrapUp__HookRemoveConstructedBuilding + + +//library WoWReforgedWrapUp ends +//library WowReforgedMultiply: + + +function MultiplyUnit takes unit caster,unit target returns nothing + local integer i= 0 + local unit copy= null + local item copyItem= null + local integer factor= GetUnitAbilityLevel(caster, WowReforgedMultiply_ABILITY_ID) + if ( IsUnitAlly(target, GetOwningPlayer(caster)) and not IsUnitType(target, UNIT_TYPE_HERO) and not IsUnitType(target, UNIT_TYPE_PEON) and not IsUnitType(target, UNIT_TYPE_TOWNHALL) ) then + if ( IsUnitType(target, UNIT_TYPE_STRUCTURE) ) then + set copyItem=WrapUpBuilding(GetUnitX(target) , GetUnitY(target) , target) + if ( copyItem != null ) then + call SetItemCharges(copyItem, factor) + else + call IssueImmediateOrder(caster, "stop") + call SimError(GetOwningPlayer(caster) , "Invalid building.") + endif + else + set i=0 + loop + exitwhen ( i == factor ) + set copy=CreateUnit(GetOwningPlayer(caster), GetUnitTypeId(target), GetUnitX(target), GetUnitY(target), GetUnitFacing(target)) + call SetUnitLifeBJ(copy, GetUnitState(target, UNIT_STATE_LIFE)) + call SetUnitManaBJ(copy, GetUnitState(target, UNIT_STATE_MANA)) + call UnitApplyTimedLife(copy, WowReforgedMultiply_BUFF_ID, WowReforgedMultiply_DURATION) + set i=i + 1 + endloop + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(GetOwningPlayer(caster) , "Invalid target.") + endif +endfunction + +function MultiplyItem takes unit caster,item target returns item + local item copy= null + local integer factor= GetUnitAbilityLevel(caster, WowReforgedMultiply_ABILITY_ID) + if ( not IsItemInvulnerable(target) ) then + set copy=CreateItem(GetItemTypeId(target), GetItemX(target), GetItemY(target)) + if ( GetItemCharges(target) > 1 ) then + call SetItemCharges(copy, factor) + endif + else + call IssueImmediateOrder(caster, "stop") + call SimError(GetOwningPlayer(caster) , "Invalid target.") + endif + return copy +endfunction + +function WowReforgedMultiply___TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == WowReforgedMultiply_ABILITY_ID ) then + if ( GetSpellTargetUnit() != null ) then + call MultiplyUnit(GetTriggerUnit() , GetSpellTargetUnit()) + elseif ( GetSpellTargetItem() != null ) then + call MultiplyItem(GetTriggerUnit() , GetSpellTargetItem()) + else + call IssueImmediateOrder(GetTriggerUnit(), "stop") + call SimError(GetOwningPlayer(GetTriggerUnit()) , "Invalid target.") + endif + endif + return false +endfunction + +function WowReforgedMultiply___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WowReforgedMultiply___castTrigger, EVENT_PLAYER_UNIT_SPELL_CHANNEL) + call TriggerAddCondition(WowReforgedMultiply___castTrigger, Condition(function WowReforgedMultiply___TriggerConditionCast)) +endfunction + + +//library WowReforgedMultiply ends +//library MaxHpResearch: + + + + + +function AddMaxHpResearchAbsolute takes integer id,integer maxHpBase,integer maxHpLevel returns integer + local integer this= s__R__allocate() + local integer index= MaxHpResearch__researchesCounter + + set s__R_id[this]=id + set s__R_maxHpBase[this]=maxHpBase + set s__R_maxHpLevel[this]=maxHpLevel + set s__R_isPercentage[this]=false + + set MaxHpResearch__researches[index]=this + set MaxHpResearch__researchesCounter=MaxHpResearch__researchesCounter + 1 + + return this +endfunction + +function AddMaxHpResearchPercentage takes integer id,real percentageBase,real percentageLevel returns integer + local integer this= s__R__allocate() + local integer index= MaxHpResearch__researchesCounter + + set s__R_id[this]=id + set s__R_percentageBase[this]=percentageBase + set s__R_percentageLevel[this]=percentageLevel + set s__R_isPercentage[this]=true + + set MaxHpResearch__researches[index]=this + set MaxHpResearch__researchesCounter=MaxHpResearch__researchesCounter + 1 + + return this +endfunction + +function ApplyMaxHpResearchEffect takes unit whichUnit,integer level,integer research returns nothing + local integer maxHp= BlzGetUnitMaxHP(whichUnit) + local integer lifeBonus= 0 + if ( s__R_isPercentage[research] ) then + set lifeBonus=R2I(I2R(maxHp) * ( s__R_percentageBase[research] + s__R_percentageLevel[research] * I2R(level) )) + else + set lifeBonus=s__R_maxHpBase[research] + level * s__R_maxHpLevel[research] + endif + call BlzSetUnitMaxHP(whichUnit, maxHp + lifeBonus) + call SetUnitState(whichUnit, UNIT_STATE_LIFE, GetUnitState(whichUnit, UNIT_STATE_LIFE) + I2R(lifeBonus)) +endfunction + +function ApplyMaxHpResearch takes unit whichUnit,integer r,integer level returns nothing + if ( level > 0 and UnitHasMaxHpResearch(whichUnit , s__R_id[r]) ) then + call ApplyMaxHpResearchEffect(whichUnit , level , r) + endif +endfunction + +function ApplyAllMaxHpResearches takes unit whichUnit,player previousOwner returns nothing + local integer level= 0 + local integer i= 0 + loop + exitwhen ( i == MaxHpResearch__researchesCounter ) + set level=GetPlayerTechCount(GetOwningPlayer(whichUnit), s__R_id[MaxHpResearch__researches[i]], false) + if ( previousOwner != null ) then + set level=level - GetPlayerTechCount(previousOwner, s__R_id[MaxHpResearch__researches[i]], false) + endif + call ApplyMaxHpResearch(whichUnit , MaxHpResearch__researches[i] , level) + set i=i + 1 + endloop +endfunction + +function GetMaxHpResearch takes integer id returns integer + local integer i= 0 + loop + exitwhen ( i == MaxHpResearch__researchesCounter ) + if ( s__R_id[MaxHpResearch__researches[i]] == id ) then + return MaxHpResearch__researches[i] + endif + set i=i + 1 + endloop + return 0 +endfunction + +function MaxHpResearch__FilterIsAffectedUnit takes nothing returns boolean + return UnitHasMaxHpResearch(GetFilterUnit() , s__R_id[MaxHpResearch__filterResearch]) +endfunction + +function ApplyMaxHpResearchToAllUnitsEx takes player whichPlayer,integer research,integer levels returns nothing + local group g= CreateGroup() + local integer i= 0 + local integer max= 0 + set MaxHpResearch__filterResearch=research + call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function MaxHpResearch__FilterIsAffectedUnit)) + set max=BlzGroupGetSize(g) + loop + exitwhen ( i == max ) + call ApplyMaxHpResearch(BlzGroupUnitAt(g, i) , research , levels) + set i=i + 1 + endloop + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function ApplyMaxHpResearchToAllUnits takes player whichPlayer,integer id,integer levels returns nothing + local integer r= GetMaxHpResearch(id) + if ( r != 0 ) then + call ApplyMaxHpResearchToAllUnitsEx(whichPlayer , r , levels) + endif +endfunction + +function MaxHpResearch__TriggerConditionTrain takes nothing returns boolean + call ApplyAllMaxHpResearches(GetTrainedUnit() , null) + return false +endfunction + +function MaxHpResearch__TriggerConditionSummon takes nothing returns boolean + call ApplyAllMaxHpResearches(GetSummonedUnit() , null) + return false +endfunction + +function MaxHpResearch__TriggerConditionSell takes nothing returns boolean + call ApplyAllMaxHpResearches(GetSoldUnit() , null) + return false +endfunction + +function MaxHpResearch__TriggerConditionChangeOwner takes nothing returns boolean + call ApplyAllMaxHpResearches(GetTriggerUnit() , GetChangingUnitPrevOwner()) + return false +endfunction + +function MaxHpResearch__TriggerConditionResearch takes nothing returns boolean + call ApplyMaxHpResearchToAllUnits(GetOwningPlayer(GetTriggerUnit()) , GetResearched() , 1) + return false +endfunction + +function MaxHpResearch__TriggerConditionUpgrade takes nothing returns boolean + call ApplyAllMaxHpResearches(GetTriggerUnit() , null) + return false +endfunction + +function MaxHpResearch__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(MaxHpResearch__trainTrigger, EVENT_PLAYER_UNIT_TRAIN_FINISH) + call TriggerAddCondition(MaxHpResearch__trainTrigger, Condition(function MaxHpResearch__TriggerConditionTrain)) + + call TriggerRegisterAnyUnitEventBJ(MaxHpResearch__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(MaxHpResearch__summonTrigger, Condition(function MaxHpResearch__TriggerConditionSummon)) + + call TriggerRegisterAnyUnitEventBJ(MaxHpResearch__sellTrigger, EVENT_PLAYER_UNIT_SELL) + call TriggerAddCondition(MaxHpResearch__sellTrigger, Condition(function MaxHpResearch__TriggerConditionSell)) + + call TriggerRegisterAnyUnitEventBJ(MaxHpResearch__changeOwnerTrigger, EVENT_PLAYER_UNIT_CHANGE_OWNER) + call TriggerAddCondition(MaxHpResearch__changeOwnerTrigger, Condition(function MaxHpResearch__TriggerConditionChangeOwner)) + + call TriggerRegisterAnyUnitEventBJ(MaxHpResearch__researchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) + call TriggerAddCondition(MaxHpResearch__researchTrigger, Condition(function MaxHpResearch__TriggerConditionResearch)) + + call TriggerRegisterAnyUnitEventBJ(MaxHpResearch__upgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) + call TriggerAddCondition(MaxHpResearch__upgradeTrigger, Condition(function MaxHpResearch__TriggerConditionUpgrade)) +endfunction + +function MaxHpResearch__HookSetPlayerTechResearched takes player whichPlayer,integer techid,integer setToLevel returns nothing + call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , setToLevel - GetPlayerTechCountSimple(techid, whichPlayer)) +endfunction + +function MaxHpResearch__HookAddPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing + call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , levels) +endfunction + +function MaxHpResearch__HookBlzDecPlayerTechResearched takes player whichPlayer,integer techid,integer levels returns nothing + call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , - levels) +endfunction + +//processed hook: hook SetPlayerTechResearched MaxHpResearch__HookSetPlayerTechResearched +//processed hook: hook AddPlayerTechResearched MaxHpResearch__HookAddPlayerTechResearched +//processed hook: hook BlzDecPlayerTechResearched MaxHpResearch__HookBlzDecPlayerTechResearched + + +//library MaxHpResearch ends +//library WoWReforgedArena: + + + +function GetArenaTicketsMax takes nothing returns integer + return WoWReforgedArena___ticketsCounter +endfunction + +function GetArenaTicket takes integer index returns integer + return WoWReforgedArena___tickets[index] +endfunction + +function GetArenaTicketByTicket takes integer itemTypeId returns integer + local integer i= 0 + local integer max= (WoWReforgedArena___ticketsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( s__ArenaTicket_itemTypeId[(WoWReforgedArena___tickets[(i)])] == itemTypeId ) then // INLINED!! + return (WoWReforgedArena___tickets[(i)]) // INLINED!! + endif + set i=i + 1 + endloop + return 0 +endfunction + +function GetArenaTicketByReward takes integer itemTypeId returns integer + local integer i= 0 + local integer max= (WoWReforgedArena___ticketsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena___tickets[(i)])] == itemTypeId ) then // INLINED!! + return (WoWReforgedArena___tickets[(i)]) // INLINED!! + endif + set i=i + 1 + endloop + return 0 +endfunction + +function GetArenaTicketByOpponent takes integer unitTypeId returns integer + local integer i= 0 + local integer max= (WoWReforgedArena___ticketsCounter) // INLINED!! + local integer j= 0 + local integer max2= 0 + loop + exitwhen ( i == max ) + set j=0 + set max2=s__ArenaTicket_unitTypeIdsCounter[(WoWReforgedArena___tickets[(i)])] // INLINED!! + loop + exitwhen ( j == max2 ) + if ( s___ArenaTicket_unitTypeIds[s__ArenaTicket_unitTypeIds[(WoWReforgedArena___tickets[(i)])]+j] == unitTypeId ) then // INLINED!! + return (WoWReforgedArena___tickets[(i)]) // INLINED!! + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + return 0 +endfunction + +function IsArenaReward takes integer itemTypeId returns boolean + return GetArenaTicketByReward(itemTypeId) != 0 +endfunction + +function IsArenaOpponent takes integer unitTypeId returns boolean + return GetArenaTicketByOpponent(unitTypeId) != 0 +endfunction + +function AddArenaTicket takes integer itemTypeId,integer rewardItemTypeId returns integer + local integer this= s__ArenaTicket__allocate() + set s__ArenaTicket_itemTypeId[this]=itemTypeId + set s__ArenaTicket_rewardItemTypeId[this]=rewardItemTypeId + + set WoWReforgedArena___tickets[WoWReforgedArena___ticketsCounter]=this + set WoWReforgedArena___ticketsCounter=WoWReforgedArena___ticketsCounter + 1 + + return this +endfunction + +function AddArenaTicketUnitType takes integer unitTypeId,integer count returns nothing + local integer t= WoWReforgedArena___tickets[WoWReforgedArena___ticketsCounter - 1] + set s___ArenaTicket_unitTypeIds[s__ArenaTicket_unitTypeIds[t]+s__ArenaTicket_unitTypeIdsCounter[t]]=unitTypeId + set s___ArenaTicket_unitTypeIdsCounts[s__ArenaTicket_unitTypeIdsCounts[t]+s__ArenaTicket_unitTypeIdsCounter[t]]=count + set s__ArenaTicket_unitTypeIdsCounter[t]=s__ArenaTicket_unitTypeIdsCounter[t] + 1 +endfunction + +function AddSaveObjectItemTypesFromArena takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedArena___ticketsCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena___tickets[(i)])] != 0 ) then // INLINED!! + call AddSaveObjectItemTypeEx(GetObjectName(s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena___tickets[(i)])]) , s__ArenaTicket_rewardItemTypeId[(WoWReforgedArena___tickets[(i)])]) // INLINED!! + endif + set i=i + 1 + endloop +endfunction + +function SpawnArenaEnemies takes integer t,rect whichRect,rect targetRect returns nothing + local real x= 0.0 + local real y= 0.0 + local real targetX= GetRectCenterX(targetRect) + local real targetY= GetRectCenterY(targetRect) + local location l= null + local integer i= 0 + local integer max= s__ArenaTicket_unitTypeIdsCounter[t] + local integer j= 0 + local integer max2= 0 + local unit u= null + loop + exitwhen ( i == max ) + set j=0 + set max2=s___ArenaTicket_unitTypeIdsCounts[s__ArenaTicket_unitTypeIdsCounts[t]+i] + loop + exitwhen ( j == max2 ) + set l=GetRandomLocInRect(whichRect) + set x=GetLocationX(l) + set y=GetLocationY(l) + set u=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), s___ArenaTicket_unitTypeIds[s__ArenaTicket_unitTypeIds[t]+i], x, y, AngleBetweenCoordinatesDeg(x , y , targetX , targetY)) + call UnitAddSleepPerm(u, false) + call IssuePointOrder(u, "patrol", targetX, targetY) + call RemoveLocation(l) + set l=null + set u=null + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function EnterArena takes unit hero,rect whichRect,rect targetRect,string enterMessage,sound enterSound returns boolean + local location l= null + local player owner= GetOwningPlayer(hero) + local integer playerId= GetPlayerId(owner) + local boolean found= false + local item whichItem= null + local integer t= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set whichItem=UnitItemInSlot(hero, i) + if ( whichItem != null ) then + set t=GetArenaTicketByTicket(GetItemTypeId(whichItem)) + if ( t != 0 ) then + set found=true + call h__RemoveItem(whichItem) + set whichItem=null + call SpawnArenaEnemies(t , whichRect , targetRect) + endif + endif + set i=i + 1 + endloop + if ( found ) then + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_WARNING, enterMessage) + set l=GetRectCenter(targetRect) + call PanCameraToTimedLocForPlayer(owner, l, 0) + call RemoveLocation(l) + set l=null + set l=GetRectCenter(whichRect) + call PlaySoundAtPointBJ(enterSound, 100, l, 0) + call RemoveLocation(l) + set l=null + endif + set owner=null + return found +endfunction + +function WoWReforgedArena___Init takes nothing returns nothing + call AddArenaTicket(ITEM_TYPE_TICKET_1 , ITEM_TYPE_STONE_TOKEN) + call AddArenaTicketUnitType('nogr' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_2 , ITEM_TYPE_TALISMAN_OF_THE_WILD) + call AddArenaTicketUnitType('nowb' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_3 , ITEM_TYPE_ICE_SHARD) + call AddArenaTicketUnitType('nmgw' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_4 , ITEM_TYPE_GLOVES_OF_SPELL_MASTERY) + call AddArenaTicketUnitType('nbzk' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_5 , ITEM_TYPE_SHAMAN_CLAWS) + call AddArenaTicketUnitType('nogn' , 2) + call AddArenaTicketUnitType('nogo' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_6 , ITEM_TYPE_THUNDERLIZARD_DIAMOND) + call AddArenaTicketUnitType('nehy' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_7 , ITEM_TYPE_SHIELD_OF_HONOR) + call AddArenaTicketUnitType('nwna' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_8 , ITEM_TYPE_SERATHIL) + call AddArenaTicketUnitType('nsqa' , 1) + call AddArenaTicketUnitType('nsqo' , 2) + call AddArenaTicket(ITEM_TYPE_TICKET_9 , ITEM_TYPE_STONEMAUL_ARENA_MASTER_BELT) + call AddArenaTicketUnitType('nsqa' , 1) + call AddArenaTicketUnitType('nsqo' , 2) + call AddArenaTicketUnitType('n00B' , 1) +endfunction + + +//library WoWReforgedArena ends +//library WoWReforgedCheats: + +function GetHelpTextCheats takes nothing returns string + return "-cheats, -nocheats, -creeps, -cinoutro, -cinlichking, -cinoldgods, -cininvasion, -boots, -terrain, -heroskills, -bonus, -quests, -fields, -read, -write, -maxresources, -respawngroupcounter, -respawnall, -maxlevel, -levelX, -col, -medivh, -revive, -resetrepick, -demigodlight, -demigoddark, -trydemigod, -orderon, -orderoff, -kill, -fill, -share, -unitinfo, -checksave, -generatesave, -savecounters, -savecodeduplicates, -savecodemissing, -combination, -foldername, -autoskill, -orbs, -herolevels, -deathwing, -claws, -clawsbonus, -regennight, -craft, -legendary, -professions, -achievementscheat, -aigui, -aicraft, -aiharveston/off, -day, -night, -jaina, -arena, -evolution, -evolutioncreeps, -nagaquest4, -website" +endfunction + +function CheatItems takes player whichPlayer returns nothing + local unit hero= (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! + local item whichItem= null + local integer i= 0 + local integer max= (SaveObjectItemCounter) // INLINED!! + + // contain race and profession items + set i=1 + loop + exitwhen ( i == max ) + if ( (SaveObjectIdItem[(i)]) != 0 ) then // INLINED!! + set whichItem=UnitAddItemById(hero, (SaveObjectIdItem[(i)])) // INLINED!! + if ( GetItemCharges(whichItem) > 0 ) then + call SetItemCharges(whichItem, 100) + endif + else + call h__BJDebugMsg("Warning: Item save object with index " + I2S(i) + " is 0.") + endif + set i=i + 1 + endloop + + set i=0 + set max=udg_LegendaryItemTypeSize + loop + exitwhen ( i == max ) + if ( udg_LegendaryItemType[i] != 0 ) then + set whichItem=UnitAddItemById(hero, udg_LegendaryItemType[i]) + else + call h__BJDebugMsg("Warning: Legendary item with index " + I2S(i) + " is 0.") + endif + set i=i + 1 + endloop + + set i=0 + set max=(WoWReforgedQuests__questsMax) // INLINED!! + loop + exitwhen ( i == max ) + if ( (WoWReforgedQuests__questReward[(i)]) != 0 ) then // INLINED!! + set whichItem=UnitAddItemById(hero, (WoWReforgedQuests__questReward[(i)])) // INLINED!! + else + call h__BJDebugMsg("Warning: Quest reward item with index " + I2S(i) + " is 0.") + endif + set i=i + 1 + endloop +endfunction + +function CheatMaxResources takes player whichPlayer returns nothing + local integer i= 0 + local integer max= (s__Resource_resourcesCount) // INLINED!! + loop + exitwhen ( i == max ) + call SetPlayerResource(whichPlayer , (s__Resource_resources[(i)]) , 9999999) // INLINED!! + set i=i + 1 + endloop +endfunction + +function CheatHeroSkills takes player whichPlayer returns nothing + local unit hero= null + local integer i= 0 + local integer max= (udg_HeroUnitTypeIndex) // INLINED!! + loop + exitwhen ( i == max ) + set hero=CreateUnit(whichPlayer, (udg_HeroUnitType[(i)]), 0.0, 0.0, 0.0) // INLINED!! + call SetHeroLevel(hero, MAX_HERO_LEVEL, false) + call AutoSkillHero(hero) + call h__RemoveUnit(hero) + set hero=null + set i=i + 1 + endloop + set i=0 + set max=BlzGroupGetSize(udg_Bosses) + loop + exitwhen ( i == max ) + set hero=CreateUnit(whichPlayer, GetUnitTypeId(BlzGroupUnitAt(udg_Bosses, i)), 0.0, 0.0, 0.0) + call SetHeroLevel(hero, MAX_HERO_LEVEL, false) + call AutoSkillHero(hero) + call h__RemoveUnit(hero) + set hero=null + set i=i + 1 + endloop +endfunction + +function WoWReforgedCheats___ForGroupCheckSaveCodeMissing takes nothing returns nothing + local integer unitTypeId= GetUnitTypeId(GetEnumUnit()) + local integer index= GetSaveObjectUnitType(unitTypeId) + + if ( index == - 1 ) then + set index=GetSaveObjectBuildingType(unitTypeId) + endif + + if ( index == - 1 ) then + call h__BJDebugMsg("Missing save code for unit type " + GetObjectName(unitTypeId)) + endif +endfunction + +function WoWReforgedCheats___ForItemGroupCheckSaveCodeMissing takes nothing returns nothing + local integer unitTypeId= GetItemTypeId(GetEnumItem()) + local integer index= GetSaveObjectItemType(unitTypeId) + + if ( index == - 1 ) then + call h__BJDebugMsg("Missing save code for item type " + GetObjectName(unitTypeId)) + endif +endfunction + +function CheatSaveCodeMissing takes nothing returns nothing + local group g= CreateGroup() + call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_AGGRESSIVE), null) + call ForGroup(g, function WoWReforgedCheats___ForGroupCheckSaveCodeMissing) + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call EnumItemsInRect(GetPlayableMapRect(), null, function WoWReforgedCheats___ForItemGroupCheckSaveCodeMissing) +endfunction + +function WoWReforgedCheats___PrintProfession takes integer p returns nothing + local integer i= 0 + local integer max= PROFESSION_RANK_MAX + local integer j= 0 + local integer max2= 0 + call h__BJDebugMsg("- " + GetProfessionName(p)) + loop + exitwhen ( i >= max ) + set j=0 + set max2=GetProfessionCraftedItemsCount(p , i) + call h__BJDebugMsg(GetProfessionName(p) + " Rank " + GetRankName(i) + " with count " + I2S(max2)) + loop + exitwhen ( j >= max2 ) + if ( GetProfessionCraftedUnit(p , i , j) != 0 ) then + call h__BJDebugMsg(GetProfessionName(p) + " " + GetObjectName(GetProfessionCraftedUnit(p , i , j)) + " with count " + I2S(GetProfessionCraftedCount(p , i , j))) + elseif ( GetProfessionCraftedItem(p , i , j) != 0 ) then + call h__BJDebugMsg(GetProfessionName(p) + " " + GetObjectName(GetProfessionCraftedItem(p , i , j)) + " with count " + I2S(GetProfessionCraftedCount(p , i , j))) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function CheatProfessions takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedProfessions__professionsCounter) // INLINED!! + loop + exitwhen ( i == max ) + call WoWReforgedCheats___PrintProfession(i) + set i=i + 1 + endloop +endfunction + +function CheatBoots takes player whichPlayer returns nothing + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Created Boots of Teleportation for your first hero.") + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call UnitAddItemById((udg_Hero[GetPlayerId((whichPlayer))]), ITEM_BOOTS_OF_TELEPORTATION) // INLINED!! + endif +endfunction + +function CheatTerrain takes player whichPlayer returns nothing + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Tile: " + A2S(GetTerrainType(GetCameraTargetPositionX(), GetCameraTargetPositionY()))) +endfunction + +function CheatOrderOn takes nothing returns nothing + + + +endfunction + +function CheatOrderOff takes nothing returns nothing + + + +endfunction + + +//library WoWReforgedCheats ends +//library WoWReforgedHunterSaveCodes: + +function AddSaveCodeItemsTrophies takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedHunter___trophyCounter) // INLINED!! + loop + exitwhen ( i == max ) + call AddSaveObjectItemTypeEx(GetObjectName((WoWReforgedHunter___trophyItemTypeIds[(i)])) , (WoWReforgedHunter___trophyItemTypeIds[(i)])) // INLINED!! + set i=i + 1 + endloop +endfunction + + +//library WoWReforgedHunterSaveCodes ends +//library WoWReforgedItemSets: + +//processed: function interface OnItemSetFunction takes unit hero, ItemSet s returns nothing + + + +function UnitHasItemSet takes unit whichUnit returns boolean + return LoadBoolean(WoWReforgedItemSets___h, GetHandleId(whichUnit), 0) +endfunction + +function WoWReforgedItemSets___SetUnitHasItemSet takes unit whichUnit,boolean flag returns nothing + call SaveBoolean(WoWReforgedItemSets___h, GetHandleId(whichUnit), 0, flag) +endfunction + +function WoWReforgedItemSets___ClearUnitHasItemSet takes unit whichUnit returns nothing + call FlushChildHashtable(WoWReforgedItemSets___h, GetHandleId(whichUnit)) +endfunction + +//processed hook: hook RemoveUnit WoWReforgedItemSets___ClearUnitHasItemSet + +function WoWReforgedItemSets___CheckAllItemSets takes unit whichUnit returns nothing + local integer s= 0 + local integer j= 0 + local integer counter= 0 + local integer i= 0 + loop + exitwhen ( i == WoWReforgedItemSets___itemSetsCounter ) + set s=WoWReforgedItemSets___itemSets[i] + set counter=0 + set j=0 + loop + exitwhen ( j == s__ItemSet_componentsCounter[s] ) + if ( UnitHasItemOfTypeBJ(whichUnit, s___ItemSet_components[s__ItemSet_components[s]+j]) ) then + set counter=counter + 1 + endif + set j=j + 1 + endloop + if ( counter == s__ItemSet_componentsCounter[s] ) then + if ( not (LoadBoolean(WoWReforgedItemSets___h, GetHandleId((whichUnit)), 0)) ) then // INLINED!! + call SaveBoolean(WoWReforgedItemSets___h, GetHandleId((whichUnit )), 0, ( true)) // INLINED!! + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(GetOwningPlayer(whichUnit))], bj_QUESTMESSAGE_HINT, "Completed item set " + s__ItemSet_name[s] + ".") + call sc___prototype145_execute(s__ItemSet_onComplete[s],whichUnit , s) + endif + else + if ( (LoadBoolean(WoWReforgedItemSets___h, GetHandleId((whichUnit)), 0)) ) then // INLINED!! + call FlushChildHashtable(WoWReforgedItemSets___h, GetHandleId((whichUnit))) // INLINED!! + call sc___prototype145_execute(s__ItemSet_onUncomplete[s],whichUnit , s) + endif + endif + set i=i + 1 + endloop +endfunction + +function AddItemSetComponentsToSaveCodes takes nothing returns nothing + local integer s= 0 + local integer j= 0 + local integer counter= 0 + local integer i= 0 + loop + exitwhen ( i == WoWReforgedItemSets___itemSetsCounter ) + set s=WoWReforgedItemSets___itemSets[i] + set counter=0 + set j=0 + loop + exitwhen ( j == s__ItemSet_componentsCounter[s] ) + call AddSaveObjectItemTypeEx(GetObjectName(s___ItemSet_components[s__ItemSet_components[s]+j]) , s___ItemSet_components[s__ItemSet_components[s]+j]) + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function AddItemSet takes string name,integer onComplete,integer onUncomplete returns integer + local integer this= s__ItemSet__allocate() + set s__ItemSet_name[this]=name + set s__ItemSet_onComplete[this]=onComplete + set s__ItemSet_onUncomplete[this]=onUncomplete + set WoWReforgedItemSets___itemSets[WoWReforgedItemSets___itemSetsCounter]=this + set WoWReforgedItemSets___itemSetsCounter=WoWReforgedItemSets___itemSetsCounter + 1 + return this +endfunction + +function AddItemSetComponent takes integer s,integer id returns integer + local integer index= s__ItemSet_componentsCounter[s] + set s___ItemSet_components[s__ItemSet_components[s]+index]=id + set s__ItemSet_componentsCounter[s]=s__ItemSet_componentsCounter[s] + 1 + return index +endfunction + +function WoWReforgedItemSets___TriggerActionPickup takes nothing returns nothing + call WoWReforgedItemSets___CheckAllItemSets(GetTriggerUnit()) +endfunction + +function WoWReforgedItemSets___TriggerActionDrop takes nothing returns nothing + call TriggerSleepAction(0.5) // wait for the item to be dropped + call WoWReforgedItemSets___CheckAllItemSets(GetTriggerUnit()) +endfunction + +function WoWReforgedItemSets___OnCompleteHolySet takes unit hero,integer s returns nothing +call sc__NewBonus_add((hero ) , ( BONUS_ARMOR ) , (( 10.0)*1.0)) // INLINED!! +endfunction + +function WoWReforgedItemSets___OnUncompleteHolySet takes unit hero,integer s returns nothing +call sc__NewBonus_add((hero ) , ( BONUS_ARMOR ) , (( - 10.0)*1.0)) // INLINED!! +endfunction + +function WoWReforgedItemSets___Init takes nothing returns nothing + local integer s= 0 + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedItemSets___pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) + call TriggerAddAction(WoWReforgedItemSets___pickupTrigger, function WoWReforgedItemSets___TriggerActionPickup) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedItemSets___dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) + call TriggerAddAction(WoWReforgedItemSets___dropTrigger, function WoWReforgedItemSets___TriggerActionDrop) + + // All sets + set s=AddItemSet("Holy Set" , (1) , (2)) + call AddItemSetComponent(s , ITEM_HOLY_CREST) + call AddItemSetComponent(s , ITEM_HOLY_BOOTS) + call AddItemSetComponent(s , ITEM_HOLY_GAUNTLET) + call AddItemSetComponent(s , ITEM_HOLY_ARMOR) + call AddItemSetComponent(s , ITEM_HOLY_SHIELD) + call AddItemSetComponent(s , ITEM_HOLY_SWORD) +endfunction + + +//library WoWReforgedItemSets ends +//library WoWReforgedRacing: + + +function GetRacingTracksCount takes nothing returns integer + return WoWReforgedRacing___racingTracksCounter +endfunction + +function GetRacingTrack takes integer index returns integer + return WoWReforgedRacing___racingTracks[index] +endfunction + + +function RacingTrackWasFinished takes integer racingTrack,player whichPlayer returns boolean + return s___RacingTrack_finished[s__RacingTrack_finished[racingTrack]+GetPlayerId(whichPlayer)] +endfunction + +function WoWReforgedRacing___RefreshRacingTrackCheckpointEffect takes integer racingTrack,integer playerId returns nothing + local player whichPlayer= Player(playerId) + local integer index= s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[racingTrack]+playerId] + if ( s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId] != null ) then + if ( index > 0 ) then + call UnitShareVision(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index - 1], whichPlayer, false) + endif + call DestroyEffect(s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId]) + set s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId]=null + endif + set s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId]=AddSpecialEffectTarget(WoWReforgedRacing_CHECKPOINT_TARGET_EFFECT, s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index], "overhead") + call BlzSetSpecialEffectColorByPlayer(s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+playerId], whichPlayer) + call UnitShareVision(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index], whichPlayer, true) + call PingMinimapForPlayer(whichPlayer, GetUnitX(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index]), GetUnitY(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+index]), 6.0) + set whichPlayer=null +endfunction + +function WoWReforgedRacing___SetCheckPointsVisible takes integer racingTrack,boolean visible returns nothing + local integer max= s__RacingTrack_checkpointsCounter[racingTrack] + local integer i= 0 + loop + exitwhen ( i == max ) + call ShowUnit(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+i], visible) + set i=i + 1 + endloop +endfunction + +function WoWReforgedRacing___SetAllCheckPointsVisible takes boolean visible returns nothing + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedRacing___racingTracksCounter ) + call WoWReforgedRacing___SetCheckPointsVisible(WoWReforgedRacing___racingTracks[i] , visible) + set i=i + 1 + endloop +endfunction + +function WoWReforgedRacing___HideCheckPointsVisible takes nothing returns nothing + call WoWReforgedRacing___SetAllCheckPointsVisible(false) +endfunction + +function WoWReforgedRacing___SetCheckPointsDone takes integer racingTrack,integer done returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[racingTrack]+i]=done + set i=i + 1 + endloop +endfunction + +function WoWReforgedRacing___RefreshAllCheckPointEffects takes integer racingTrack returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + call WoWReforgedRacing___RefreshRacingTrackCheckpointEffect(racingTrack , i) + set i=i + 1 + endloop +endfunction + +function GetPlayerRacingTrackNextCheckPoint takes player whichPlayer returns unit + if ( WoWReforgedRacing___currentRacingTrack == 0 ) then + return null + endif + return s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[WoWReforgedRacing___currentRacingTrack]+s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[WoWReforgedRacing___currentRacingTrack]+GetPlayerId(whichPlayer)]] +endfunction + +function WoWReforgedRacing___DestoyAllCheckPointEffects takes integer racingTrack returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+i] != null ) then + call DestroyEffect(s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+i]) + set s___RacingTrack_checkpointEffects[s__RacingTrack_checkpointEffects[racingTrack]+i]=null + call UnitShareVision(GetPlayerRacingTrackNextCheckPoint(Player(i)), Player(i), false) + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedRacing___FinishRacingTrack takes integer racingTrack returns nothing + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[racingTrack]+i] >= s__RacingTrack_checkpointsCounter[racingTrack] and not s___RacingTrack_finished[s__RacingTrack_finished[racingTrack]+i] ) then + set s___RacingTrack_finished[s__RacingTrack_finished[racingTrack]+i]=true + call AchievementRacer(Player(i) , (WoWReforgedRacing___racingTracksCounter)) // INLINED!! + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedRacing___ResetRaceWinners takes nothing returns nothing + set WoWReforgedRacing___firstPlace=null + set WoWReforgedRacing___secondPlace=null + set WoWReforgedRacing___thirdPlace=null +endfunction + +function GetRacingWinners takes nothing returns string + local string msg= "1st: " + if ( WoWReforgedRacing___firstPlace != null ) then + set msg=msg + GetPlayerNameColored(WoWReforgedRacing___firstPlace) + else + set msg=msg + "-" + endif + set msg=msg + ", 2nd: " + if ( WoWReforgedRacing___secondPlace != null ) then + set msg=msg + GetPlayerNameColored(WoWReforgedRacing___secondPlace) + else + set msg=msg + "-" + endif + set msg=msg + ", 3rd: " + if ( WoWReforgedRacing___thirdPlace != null ) then + set msg=msg + GetPlayerNameColored(WoWReforgedRacing___thirdPlace) + else + set msg=msg + "-" + endif + return msg +endfunction + +function GiveRaceRewards takes nothing returns nothing + if ( WoWReforgedRacing___firstPlace != null ) then + call UnitAddItemById((udg_Hero[GetPlayerId((WoWReforgedRacing___firstPlace))]), s__RacingTrack_firstPlaceTrophyItemTypeId[WoWReforgedRacing___currentRacingTrack]) // INLINED!! + endif + if ( WoWReforgedRacing___secondPlace != null ) then + call UnitAddItemById((udg_Hero[GetPlayerId((WoWReforgedRacing___firstPlace))]), s__RacingTrack_secondPlaceTrophyItemTypeId[WoWReforgedRacing___currentRacingTrack]) // INLINED!! + endif + if ( WoWReforgedRacing___thirdPlace != null ) then + call UnitAddItemById((udg_Hero[GetPlayerId((WoWReforgedRacing___firstPlace))]), s__RacingTrack_thirdPlaceTrophyItemTypeId[WoWReforgedRacing___currentRacingTrack]) // INLINED!! + endif +endfunction + +function EndRace takes integer racingTrack returns boolean + if ( WoWReforgedRacing___currentRacingTrack == racingTrack ) then + call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_SECRET, "Race " + s__RacingTrack_name[WoWReforgedRacing___currentRacingTrack] + " has ended and the winners are: " + GetRacingWinners()) + call GiveRaceRewards() + + set WoWReforgedRacing___currentRacingTrack=0 + call TimerDialogDisplay(WoWReforgedRacing___currentRacingTrackTimerDialog, false) + call WoWReforgedRacing___SetCheckPointsVisible(racingTrack , false) + call WoWReforgedRacing___DestoyAllCheckPointEffects(racingTrack) + call WoWReforgedRacing___FinishRacingTrack(racingTrack) + call WoWReforgedRacing___ResetRaceWinners() + + return true + endif + + return false +endfunction + +function WoWReforgedRacing___TimerFunctionEndRace takes nothing returns nothing + if ( WoWReforgedRacing___currentRacingTrack != 0 ) then + call EndRace(WoWReforgedRacing___currentRacingTrack) + endif +endfunction + +function GetRacingTrackDistance takes integer racingTrack returns real + local real distance= 0.0 + local integer max= s__RacingTrack_checkpointsCounter[racingTrack] + local integer i= 0 + loop + exitwhen ( i + 1 >= max ) + set distance=distance + DistanceBetweenUnits(s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+i] , s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[racingTrack]+i + 1]) + set i=i + 1 + endloop + return distance +endfunction + +function GetRacingTrackDuration takes integer racingTrack returns real + return GetRacingTrackDistance(racingTrack) / 100.0 +endfunction + +function StartRace takes integer racingTrack returns boolean + if ( WoWReforgedRacing___currentRacingTrack == 0 ) then + set WoWReforgedRacing___currentRacingTrack=racingTrack + call WoWReforgedRacing___SetCheckPointsVisible(racingTrack , true) + call WoWReforgedRacing___SetCheckPointsDone(racingTrack , 0) + call WoWReforgedRacing___ResetRaceWinners() + call WoWReforgedRacing___RefreshAllCheckPointEffects(racingTrack) + + call TimerStart(WoWReforgedRacing___currentRacingTrackTimer, (GetRacingTrackDistance((racingTrack)) / 100.0), false, function WoWReforgedRacing___TimerFunctionEndRace) // INLINED!! + if ( WoWReforgedRacing___currentRacingTrackTimerDialog == null ) then + set WoWReforgedRacing___currentRacingTrackTimerDialog=CreateTimerDialog(WoWReforgedRacing___currentRacingTrackTimer) + endif + call TimerDialogSetTitle(WoWReforgedRacing___currentRacingTrackTimerDialog, s__RacingTrack_name[racingTrack]) + call TimerDialogDisplay(WoWReforgedRacing___currentRacingTrackTimerDialog, true) + + return true + endif + + return false +endfunction + +function WoWReforgedRacing___CheckAllPlayersForRaceEnd takes nothing returns boolean + local player slotPlayer= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_USER and s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[WoWReforgedRacing___currentRacingTrack]+i] < s__RacingTrack_checkpointsCounter[WoWReforgedRacing___currentRacingTrack] ) then + return false + endif + set i=i + 1 + endloop + return true +endfunction + +function WoWReforgedRacing___CheckForRaceEnd takes nothing returns nothing + if ( WoWReforgedRacing___currentRacingTrack != 0 ) then + if ( WoWReforgedRacing___CheckAllPlayersForRaceEnd() ) then + call EndRace(WoWReforgedRacing___currentRacingTrack) + endif + endif +endfunction + +function WoWReforgedRacing___PlaceRaceWinner takes player whichPlayer returns nothing + if ( WoWReforgedRacing___firstPlace == null ) then + set WoWReforgedRacing___firstPlace=whichPlayer + elseif ( WoWReforgedRacing___secondPlace == null and WoWReforgedRacing___firstPlace != whichPlayer ) then + set WoWReforgedRacing___secondPlace=whichPlayer + elseif ( WoWReforgedRacing___thirdPlace == null and WoWReforgedRacing___firstPlace != whichPlayer and WoWReforgedRacing___secondPlace != whichPlayer ) then + set WoWReforgedRacing___thirdPlace=whichPlayer + endif + call WoWReforgedRacing___CheckForRaceEnd() +endfunction + +function GetRacingTrackByItemTypeId takes integer itemTypeId returns integer + local integer i= 0 + loop + exitwhen ( i == WoWReforgedRacing___racingTracksCounter ) + if ( itemTypeId == s__RacingTrack_itemTypeId[WoWReforgedRacing___racingTracks[i]] ) then + return WoWReforgedRacing___racingTracks[i] + endif + set i=i + 1 + endloop + return 0 +endfunction + +function AddRacingTrack takes string name,integer itemTypeId,integer firstPlaceTrophyItemTypeId,integer secondPlaceTrophyItemTypeId,integer thirdPlaceTrophyItemTypeId returns integer + local integer this= s__RacingTrack__allocate() + set s__RacingTrack_name[this]=name + set s__RacingTrack_itemTypeId[this]=itemTypeId + set s__RacingTrack_firstPlaceTrophyItemTypeId[this]=firstPlaceTrophyItemTypeId + set s__RacingTrack_secondPlaceTrophyItemTypeId[this]=secondPlaceTrophyItemTypeId + set s__RacingTrack_thirdPlaceTrophyItemTypeId[this]=thirdPlaceTrophyItemTypeId + + set WoWReforgedRacing___racingTracks[WoWReforgedRacing___racingTracksCounter]=this + set WoWReforgedRacing___racingTracksCounter=WoWReforgedRacing___racingTracksCounter + 1 + + return this +endfunction + +function AddRacingTrackCheckpoint takes integer t,unit whichUnit returns nothing + local integer index= s__RacingTrack_checkpointsCounter[t] + local location l= GetUnitLoc(whichUnit) + local region r= CreateRegion() + local integer handleId= GetHandleId(r) + call RegionAddRect(r, GetRectFromCircleBJ(l, WoWReforgedRacing_CHECKPOINT_RADIUS)) + call RemoveLocation(l) + set l=null + call SaveInteger(WoWReforgedRacing___h, handleId, 0, t) + call SaveInteger(WoWReforgedRacing___h, handleId, 1, index) + set s___RacingTrack_checkpoints[s__RacingTrack_checkpoints[t]+index]=whichUnit + set s__RacingTrack_checkpointsCounter[t]=index + 1 + call TriggerRegisterEnterRegion(WoWReforgedRacing___enterCheckpointTrigger, r, null) +endfunction + +function AddRacingTrackWoWReforged takes nothing returns nothing + set udg_TmpInteger=AddRacingTrack(udg_TmpString , udg_TmpItemTypeId , udg_TmpItemTypeId2 , udg_TmpItemTypeId3 , udg_TmpItemTypeId4) +endfunction + +function AddRacingTrackCheckpointWoWReforged takes nothing returns nothing + call AddRacingTrackCheckpoint(udg_TmpInteger , udg_TmpUnit) +endfunction + +function WoWReforgedRacing___TriggerConditionSellItem takes nothing returns boolean + local integer t= GetRacingTrackByItemTypeId(GetItemTypeId(GetSoldItem())) + local player owner= GetOwningPlayer(GetBuyingUnit()) + if ( t != 0 ) then + if ( StartRace(t) ) then + call h__RemoveItem(GetSoldItem()) + else + call SimError(owner , "Race is already running: " + s__RacingTrack_name[WoWReforgedRacing___currentRacingTrack]) + call RefundItem(GetSoldItem() , owner) + endif + endif + set owner=null + return false +endfunction + +function WoWReforgedRacing___TriggerConditionEnterCheckpoint takes nothing returns boolean + local integer handleId= GetHandleId(GetTriggeringRegion()) + local integer t= LoadInteger(WoWReforgedRacing___h, handleId, 0) + local integer index= LoadInteger(WoWReforgedRacing___h, handleId, 1) + local unit hero= GetTriggerUnit() + local player owner= GetOwningPlayer(hero) + local integer playerId= GetPlayerId(owner) + if ( t != 0 and WoWReforgedRacing___currentRacingTrack == t and IsPlayerHero1(hero) and s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId] == index ) then + set s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId]=s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId] + 1 + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_SECRET, "Checkpoints: " + I2S(s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId]) + "/" + I2S(s__RacingTrack_checkpointsCounter[t])) + if ( s___RacingTrack_checkpointsDone[s__RacingTrack_checkpointsDone[t]+playerId] >= s__RacingTrack_checkpointsCounter[t] ) then + call WoWReforgedRacing___PlaceRaceWinner(owner) + else + call WoWReforgedRacing___RefreshRacingTrackCheckpointEffect(t , playerId) + endif + endif + set owner=null + set hero=null + return false +endfunction + +function WoWReforgedRacing___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedRacing___sellItemTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedRacing___sellItemTrigger, Condition(function WoWReforgedRacing___TriggerConditionSellItem)) + + call TriggerAddCondition(WoWReforgedRacing___enterCheckpointTrigger, Condition(function WoWReforgedRacing___TriggerConditionEnterCheckpoint)) + + call TriggerAddAction(OnStartGame___startGameTrigger, (function WoWReforgedRacing___HideCheckPointsVisible)) // INLINED!! +endfunction + + +//library WoWReforgedRacing ends +//library WoWReforgedResearches: + + + + +function GetResearch takes integer index returns integer + return WoWReforgedResearches___researches[index] +endfunction + +function AddResearch takes integer researchId,integer whichRace returns integer + local integer r= s__Research__allocate() + set s__Research_researchId[r]=researchId + set s__Research_whichRace[r]=whichRace + set s__Research_levels[r]=GetPlayerTechMaxAllowed(Player(0), researchId) + + set WoWReforgedResearches___lastCreatedResearch=r + + set WoWReforgedResearches___researches[WoWReforgedResearches___researchesCounter]=r + set WoWReforgedResearches___researchesCounter=WoWReforgedResearches___researchesCounter + 1 + + return r +endfunction + +//, integer goldCostBase, integer lumberCostBase, integer timeBase + //set r.goldCostBase = goldCostBase + //set r.lumberCostBase = lumberCostBase + //set r.timeBase = whichRace + +function AddResearchLevelData takes integer goldIncrement,integer lumberIncrement,integer timeIncrement returns nothing + set s__Research_goldIncrement[WoWReforgedResearches___lastCreatedResearch]=goldIncrement + set s__Research_lumberIncrement[WoWReforgedResearches___lastCreatedResearch]=lumberIncrement + set s__Research_timeIncrement[WoWReforgedResearches___lastCreatedResearch]=timeIncrement +endfunction + +//function AddResearchUnitType takes integer unitTypeId returns nothing +//function AddResearchAbility takes integer abilityId returns nothing + +function AddResearchWoWReforged takes nothing returns integer + return AddResearch(udg_TmpTechType , udg_TmpInteger) +endfunction + +function GetResearchesMax takes nothing returns integer + return WoWReforgedResearches___researchesCounter +endfunction + +function GetResearchId takes integer r returns integer + return s__Research_researchId[r] +endfunction + +function GetResearchRace takes integer r returns integer + return s__Research_whichRace[r] +endfunction + +function GetResearchLevels takes integer r returns integer + return s__Research_levels[r] +endfunction + +function GetResearchGoldCostBase takes integer r returns integer + return s__Research_goldCostBase[r] +endfunction + +function GetResearchLumberCostBase takes integer r returns integer + return s__Research_lumberCostBase[r] +endfunction + +function GetResearchTimeBase takes integer r returns integer + return s__Research_timeBase[r] +endfunction + +//function GetResearchUnitTypeCount takes Research r returns integer +//function GetResearchUnitTypeByIndex takes integer researchId, integer index returns integer + +//function GetResearchAbilityCount takes integer researchId returns integer +//function GetResearchAbilityByIndex takes integer researchId, integer index returns integer + +function ExcludeResearchFromSaveObjects takes integer researchId returns boolean + if ( researchId == UPG_EVOLUTION ) then + return true + elseif ( researchId == UPG_CHEAP_EVOLUTION ) then + return true + elseif ( researchId == UPG_IMPROVED_POWER_GENERATOR ) then + return true + elseif ( researchId == UPG_IMPROVED_MOUNT ) then + return true + elseif ( researchId == UPG_IMPROVED_HAND_OF_GOD ) then + return true + elseif ( researchId == UPG_IMPROVED_MASONRY ) then + return true + elseif ( researchId == UPG_IMPROVED_NAVY ) then + return true + elseif ( researchId == UPG_IMPROVED_CREEP_HUNTER ) then + return true + // clan researches are part of the clan savecode + elseif ( researchId == UPG_IMPROVED_CLAN_HALL ) then + return true + elseif ( researchId == UPG_IMPROVED_CLAN ) then + return true + endif + return false +endfunction + +function AddResearchSaveObjects takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedResearches___researchesCounter) // INLINED!! + local integer r= 0 + loop + exitwhen ( i == max ) + set r=(WoWReforgedResearches___researches[(i)]) // INLINED!! + if ( not ExcludeResearchFromSaveObjects(s__Research_researchId[r]) and s__Research_researchId[r] != 0 ) then + set udg_TmpTechType=s__Research_researchId[r] +call AddSaveObjectResearchTypeEx(GetObjectName(udg_TmpTechType) , udg_TmpTechType , udg_TmpInteger) // INLINED!! + endif + set i=i + 1 + endloop +endfunction + +function GetResearchesTotalForRace takes integer whichRace returns integer + local integer i= 0 + local integer max= (WoWReforgedResearches___researchesCounter) // INLINED!! + local integer counter= 0 + local integer r= 0 + loop + exitwhen ( i == max ) + set r=(WoWReforgedResearches___researches[(i)]) // INLINED!! + if ( s__Research_whichRace[r] == whichRace ) then + set counter=counter + s__Research_levels[r] + endif + set i=i + 1 + endloop + return counter +endfunction + +function GetResearchesResearchedForRace takes integer whichRace,player whichPlayer returns integer + local integer i= 0 + local integer max= (WoWReforgedResearches___researchesCounter) // INLINED!! + local integer counter= 0 + local integer r= 0 + loop + exitwhen ( i == max ) + set r=(WoWReforgedResearches___researches[(i)]) // INLINED!! + if ( s__Research_whichRace[r] == whichRace ) then + set counter=counter + GetPlayerTechCountSimple(s__Research_researchId[r], whichPlayer) + endif + set i=i + 1 + endloop + return counter +endfunction + +function GetResearchesPercentageForRace takes integer whichRace,player whichPlayer returns real + return I2R(GetResearchesResearchedForRace(whichRace , whichPlayer)) / I2R(GetResearchesTotalForRace(whichRace)) * 100.0 +endfunction + +function ResearchAllForPlayer takes player whichPlayer,integer whichRace returns nothing + local integer r= 0 + local integer i= 0 + local integer max= (WoWReforgedResearches___researchesCounter) // INLINED!! + loop + exitwhen ( i == max ) + set r=(WoWReforgedResearches___researches[(i)]) // INLINED!! + if ( (s__Research_whichRace[(r)]) == whichRace and GetPlayerTechCount(whichPlayer, (s__Research_researchId[(r)]), false) < (s__Research_levels[(r)]) ) then // INLINED!! + call h__SetPlayerTechResearched(whichPlayer, (s__Research_researchId[(r)]), (s__Research_levels[(r)])) // INLINED!! + endif + set i=i + 1 + endloop +endfunction + + +//library WoWReforgedResearches ends +//library WoWReforgedZones: + + + + + // seasons + + function s__Zone_create takes nothing returns integer + local integer this= s__Zone__allocate() + set s__Zone_r[this]=CreateRegion() + return this + endfunction + + +function GetZonesMax takes nothing returns integer + return WoWReforgedZones___zonesCounter +endfunction + +function WoWReforgedZones___AddZoneRectEx takes integer z,rect whichRect returns nothing + call RegionAddRect(s__Zone_r[z], whichRect) + set s___Zone_rects[s__Zone_rects[z]+s__Zone_rectsCounter[z]]=whichRect + set s__Zone_rectsCounter[z]=s__Zone_rectsCounter[z] + 1 +endfunction + +function AddZoneEx takes string name,rect whichRect,string icon,string description,playercolor color,string id,integer treeTypeId returns integer + local integer z= s__Zone_create() + set s__AbstractZone_name[z]=name + call WoWReforgedZones___AddZoneRectEx(z , whichRect) + call TriggerRegisterEnterRegion(WoWReforgedZones___enterTrigger, s__Zone_r[z], null) + set s__AbstractZone_icon[z]=icon + set s__AbstractZone_description[z]=description + set s__Zone_color[z]=color + set s__AbstractZone_id[z]=id + set s__Zone_treeTypeId[z]=treeTypeId + set s__AbstractZone_zoneType[z]=ZONE_TYPE_ZONE + + if ( WoWReforgedZones___currentContinent != 0 ) then + set s__AbstractZone_parent[z]=WoWReforgedZones___currentContinent + elseif ( WoWReforgedZones___currentWorld != 0 ) then + set s__AbstractZone_parent[z]=WoWReforgedZones___currentWorld + endif + + set WoWReforgedZones___zones[WoWReforgedZones___zonesCounter]=z + set WoWReforgedZones___zonesCounter=WoWReforgedZones___zonesCounter + 1 + + set WoWReforgedZones___currentZone=z + + return z +endfunction + +function AddZone takes nothing returns integer + return AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) +endfunction + +function AddZoneWorldEx takes string name,string icon,string description,string id returns integer + local integer z= s__AbstractZone__allocate() + set s__AbstractZone_name[z]=name + set s__AbstractZone_icon[z]=icon + set s__AbstractZone_description[z]=description + set s__AbstractZone_zoneType[z]=ZONE_TYPE_WORLD + set s__AbstractZone_parent[z]=0 + + set WoWReforgedZones___zones[WoWReforgedZones___zonesCounter]=z + set WoWReforgedZones___zonesCounter=WoWReforgedZones___zonesCounter + 1 + + set WoWReforgedZones___currentWorld=z + + return z +endfunction + +function AddZoneWorld takes nothing returns integer + return AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) +endfunction + +function AddZoneContinentEx takes string name,string icon,string description,string id returns integer + local integer z= s__AbstractZone__allocate() + set s__AbstractZone_name[z]=name + set s__AbstractZone_icon[z]=icon + set s__AbstractZone_description[z]=description + set s__AbstractZone_zoneType[z]=ZONE_TYPE_CONTINENT + + set WoWReforgedZones___currentContinent=z + + if ( WoWReforgedZones___currentWorld != 0 ) then + set s__AbstractZone_parent[z]=WoWReforgedZones___currentWorld + endif + + set WoWReforgedZones___zones[WoWReforgedZones___zonesCounter]=z + set WoWReforgedZones___zonesCounter=WoWReforgedZones___zonesCounter + 1 + + return z +endfunction + +function AddZoneContinent takes nothing returns integer + return AddZoneContinentEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) +endfunction + +function ResetZoneCurrentWorld takes nothing returns nothing + set WoWReforgedZones___currentWorld=0 +endfunction + +function ResetZoneCurrentContinent takes nothing returns nothing + set WoWReforgedZones___currentContinent=0 +endfunction + +function AddZoneRect takes nothing returns nothing + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) +endfunction + +function SetZoneTerrainTypeLordaeron takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON +endfunction + +function SetZoneTerrainTypeAshenvale takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE +endfunction + +function SetZoneTerrainTypeNorthrend takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND +endfunction + +function SetZoneTerrainTypeBarrens takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS +endfunction + +function SetZoneTerrainTypeOutland takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND +endfunction + +function SetZoneTerrainTypeSunkenRuins takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS +endfunction + +function SetZoneTerrainTypeSea takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA +endfunction + +function SetZoneTerrainTypeDungeon takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON +endfunction + +function SetZoneTerrainTypeUnderground takes nothing returns nothing + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON +endfunction + +function GetZone takes integer index returns integer + return WoWReforgedZones___zones[index] +endfunction + +function GetZoneName takes integer z returns string + return s__AbstractZone_name[z] +endfunction + +function GetZoneRectsCounter takes integer z returns integer + return s__Zone_rectsCounter[z] +endfunction + +function GetZoneRect takes integer z,integer index returns rect + return s___Zone_rects[s__Zone_rects[z]+index] +endfunction + +function GetZoneArea takes integer z returns real + local real result= 0.0 + local integer i= 0 + local integer max= (s__Zone_rectsCounter[(z)]) // INLINED!! + loop + exitwhen ( i == max ) + set result=result + GetRectWidthBJ((s___Zone_rects[s__Zone_rects[(z )]+( i)])) * GetRectHeightBJ((s___Zone_rects[s__Zone_rects[(z )]+( i)])) // INLINED!! + set i=i + 1 + endloop + return result +endfunction + +function GetZoneAreaOfChildren takes integer zone returns real + local integer z= 0 + local real result= 0.0 + local integer i= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + loop + exitwhen ( i == max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + if ( s__AbstractZone_parent[z] == zone and s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE ) then + set result=result + GetZoneArea((z)) + endif + set i=i + 1 + endloop + return result +endfunction + +function GetZoneAreaOfGrandChildren takes integer zone returns real + local integer z= 0 + local real result= 0.0 + local integer i= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + loop + exitwhen ( i == max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + if ( s__AbstractZone_parent[z] == zone ) then + if ( s__AbstractZone_zoneType[z] == ZONE_TYPE_CONTINENT ) then + set result=result + GetZoneAreaOfChildren(z) + elseif ( s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE ) then + set result=result + GetZoneArea((z)) + endif + endif + set i=i + 1 + endloop + return result +endfunction + +function GetZoneTotalArea takes integer zone returns real + if ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_WORLD ) then + return GetZoneAreaOfGrandChildren(zone) + elseif ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_CONTINENT ) then + return GetZoneAreaOfChildren(zone) + elseif ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_ZONE ) then + return GetZoneArea((zone)) + endif + return 0.0 +endfunction + +function GetZoneIcon takes integer z returns string + return s__AbstractZone_icon[z] +endfunction + +function GetZoneDescription takes integer z returns string + return s__AbstractZone_description[z] +endfunction + +function GetZoneColor takes integer z returns playercolor + return s__Zone_color[z] +endfunction + +function GetZoneId takes integer z returns string + return s__AbstractZone_id[z] +endfunction + +function GetZoneTreeTypeId takes integer z returns integer + return s__Zone_treeTypeId[z] +endfunction + +function GetZoneTerrainType takes integer z returns integer + return s__Zone_terrainType[z] +endfunction + +function GetZoneDiscoveringMessage takes integer z returns string + return "Discovered: |cff00ff00" + s__AbstractZone_name[z] + "|r" +endfunction + +function GetZoneEnteringMessage takes integer z returns string + return "Entering now: |cff00ff00" + s__AbstractZone_name[z] + "|r" +endfunction + +function GetZoneIndexByCoordinates takes real x,real y returns integer + local integer i= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer result= - 1 + local integer z= 0 + loop + exitwhen ( i == max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + if ( s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE and IsPointInRegion(s__Zone_r[(z)], x, y) ) then + set result=i + endif + set i=i + 1 + endloop + return result +endfunction + +function GetZoneByCoordinates takes real x,real y returns integer + local integer i= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer z= 0 + loop + exitwhen ( i == max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + if ( s__AbstractZone_zoneType[z] == ZONE_TYPE_ZONE and IsPointInRegion(s__Zone_r[(z)], x, y) ) then + return (z) + endif + set i=i + 1 + endloop + return 0 +endfunction + +function GetZoneRectByCoordinates takes integer z,real x,real y returns integer + local integer i= 0 + local integer max= (s__Zone_rectsCounter[(z)]) // INLINED!! + loop + exitwhen ( i == max ) + if ( RectContainsCoords((s___Zone_rects[s__Zone_rects[(z )]+( i)]), x, y) ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function GetZoneNameByCoordinates takes real x,real y returns string + local integer z= GetZoneByCoordinates(x , y) + if ( z != 0 ) then + return s__AbstractZone_name[z] + endif + return "" +endfunction + +function GetPlayerShowZoneHints takes player whichPlayer returns boolean + return udg_PlayerShowZonesHints[GetConvertedPlayerId(whichPlayer)] +endfunction + +function SetPlayerShowZoneHints takes player whichPlayer,boolean show returns nothing + set udg_PlayerShowZonesHints[GetConvertedPlayerId(whichPlayer)]=show +endfunction + +function ShowCurrentZoneEx takes player whichPlayer,unit first returns nothing + local real x= GetUnitX(first) + local real y= GetUnitY(first) + local integer z= GetZoneByCoordinates(x , y) + if ( z != 0 ) then + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff00ff00" + s__AbstractZone_name[z] + "|r") + else + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff00ff00Unknown|r") + endif +endfunction + +function GetZoneFullHint takes integer zone returns string + local string msg= "|cff00ff00" + s__AbstractZone_name[zone] + "|r" + if ( s__AbstractZone_parent[zone] != 0 ) then + set msg=msg + " - |cff00ff00" + s__AbstractZone_name[s__AbstractZone_parent[zone]] + "|r" + + if ( s__AbstractZone_parent[s__AbstractZone_parent[zone]] != 0 ) then + set msg=msg + " - |cff00ff00" + s__AbstractZone_name[s__AbstractZone_parent[s__AbstractZone_parent[zone]]] + "|r" + endif + endif + + set msg=msg + "\n" + s__AbstractZone_description[zone] + + return msg +endfunction + +function ShowCurrentZoneFullEx takes player whichPlayer,unit first returns nothing + local real x= GetUnitX(first) + local real y= GetUnitY(first) + local integer z= GetZoneByCoordinates(x , y) + if ( z != 0 ) then + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, GetZoneFullHint(z)) + else + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "|cff00ff00Unknown|r") + endif +endfunction + + +function WoWReforgedZones___GetFirstSelected takes player whichPlayer returns unit + local group g= GetUnitsSelectedAll(whichPlayer) + local unit first= FirstOfGroup(g) + call GroupClear(g) + call DestroyGroup(g) + set g=null + return first +endfunction + + +function WoWReforgedZones___GetMainUnit takes player whichPlayer returns unit + + + + return WoWReforgedZones___GetFirstSelected(whichPlayer) + +endfunction + +function ShowCurrentZone takes player whichPlayer returns nothing + local unit first= (WoWReforgedZones___GetFirstSelected((whichPlayer))) // INLINED!! + if ( first != null ) then + call ShowCurrentZoneEx(whichPlayer , first) + set first=null + else + call SimError(whichPlayer , "No unit selected.") + endif +endfunction + +function ShowCurrentZoneFull takes player whichPlayer returns nothing + local unit first= (WoWReforgedZones___GetFirstSelected((whichPlayer))) // INLINED!! + if ( first != null ) then + call ShowCurrentZoneFullEx(whichPlayer , first) + set first=null + else + call SimError(whichPlayer , "No unit selected.") + endif +endfunction + +function WoWReforgedZones___TriggerConditionEnter takes nothing returns boolean + local unit enteringUnit= GetEnteringUnit() + local player owner= GetOwningPlayer(enteringUnit) + local integer playerId= GetPlayerId(owner) + local integer z= 0 + if ( IsPlayerHero(enteringUnit) ) then + set z=GetZoneByCoordinates(GetUnitX(enteringUnit) , GetUnitY(enteringUnit)) + if ( z != 0 ) then + if ( s___Zone_discovered[s__Zone_discovered[z]+playerId] ) then + if ( (udg_PlayerShowZonesHints[GetConvertedPlayerId((owner))]) ) then // INLINED!! + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, ("Entering now: |cff00ff00" + s__AbstractZone_name[(z)] + "|r")) // INLINED!! + endif + else + set s___Zone_discovered[s__Zone_discovered[z]+playerId]=true + if ( (udg_PlayerShowZonesHints[GetConvertedPlayerId((owner))]) ) then // INLINED!! + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_HINT, ("Discovered: |cff00ff00" + s__AbstractZone_name[(z)] + "|r")) // INLINED!! + endif + call AchievementExplorer(owner) + call AchievementMasterExplorer(owner , (WoWReforgedZones___zonesCounter)) // INLINED!! + endif + endif + endif + set enteringUnit=null + set owner=null + return false +endfunction + +function WoWReforgedZones___Init takes nothing returns nothing + call TriggerAddCondition(WoWReforgedZones___enterTrigger, Condition(function WoWReforgedZones___TriggerConditionEnter)) +endfunction + + +//library WoWReforgedZones ends +//library WoWReforgedAllRaces: + +function InitRaceFreelancer takes nothing returns nothing + local integer r= udg_RaceFreelancer + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( FREELANCER_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_FREELANCER_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( FREELANCER_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_FREELANCER_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( FREELANCER_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_FREELANCER_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( FREELANCER_MERCENARY_CAMP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_FREELANCER_MERCENARY_CAMP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( FREELANCER_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_FREELANCER_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( FREELANCER_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_FREELANCER_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( FREELANCER_ADVANCED_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_FREELANCER_ADVANCED_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( FREELANCER_ADVANCED_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_FREELANCER_ADVANCED_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( FREELANCER_ADVANCED_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_FREELANCER_ADVANCED_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_FREELANCER_LABORATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( FREELANCER_MERCENARY_CAMP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_FREELANCER_MERCENARY_CAMP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( FREELANCER_HOUSING)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_FREELANCER_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + //call SetRaceSpecialBuilding(r, HUMAN_ARCANE_OBSERVATORY) + //call SetRaceSpecialBuildingItem(r, ITEM_HUMAN_SPECIAL_BUILDING) + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( FREELANCER_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_FREELANCER_SHIPYARD)) // INLINED!! + + // researches + call AddResearch(UPG_FREELANCER_MAGIC_SENTRY , r) + call AddResearch(UPG_FREELANCER_MASONRY , r) + call AddResearch(UPG_FREELANCER_CHEAP_EVOLUTION , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( FREELANCER_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( CREEP_UNBROKEN_DARK_WEAVER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( CREEP_EREDAR_WARLOCK)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( CREEP_BANDIT_LORD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( CREEP_DARK_TROLL_PRIEST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( CREEP_WRAITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( CREEP_DARK_WIZARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( CREEP_SEA_GIANT_BEHEMOTH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( CREEP_SEA_GIANT_BEHEMOTH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( CREEP_HARPY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( CREEP_DOOM_GUARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( CREEP_GREEN_DRAKE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( CREEP_HARPY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( FREELANCER_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( FREELANCER_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( FREELANCER_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( FREELANCER_PET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( ORC_TRANSPORT_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( ORC_FRIGATE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( ORC_JUGGERNAUGHT)) // INLINED!! +endfunction + +function InitRaceOldHorde takes nothing returns nothing + local integer r= udg_RaceOldHorde + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( OLD_HORDE_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( OLD_HORDE_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( OLD_HORDE_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( OLD_HORDE_FARM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( OLD_HORDE_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( OLD_HORDE_BLACKSMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( OLD_HORDE_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( OLD_HORDE_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( OLD_HORDE_TEMPLE_OF_THE_DAMNED)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( OLD_HORDE_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( OLD_HORDE_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( OLD_HORDE_GUARD_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( OLD_HORDE_CANNON_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( OLD_HORDE_CANNON_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( OLD_HORDE_GOBLIN_ALCHEMIST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( OLD_HORDE_DRAGON_ROOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SACRIFICAL_PIT , ( OLD_HORDE_OGRE_MOUND)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( OLD_HORDE_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + //constant integer OLD_HORDE_FOUNDRY = 'o07V' + //constant integer OLD_HORDE_OIL_PLATFORM = 'o07X' + //constant integer OLD_HORDE_OIL_REFINERY = 'o088' + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( OLD_HORDE_FOUNDRY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , ( OLD_HORDE_OIL_REFINERY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( OLD_HORDE_SHIPYARD)) // INLINED!! + + // researches + call AddResearch(UPG_HORDE_BACKPACK , r) + call AddResearch(UPG_HORDE_BERSERKER_REGENERATION , r) + call AddResearch(UPG_HORDE_BERSERKER_SCOUTING , r) + call AddResearch(UPG_HORDE_DEATH_AND_DECAY , r) + call AddResearch(UPG_HORDE_HASTE , r) + call AddResearch(UPG_HORDE_OGRE_MAGES , r) + call AddResearch(UPG_HORDE_RAISE_DEAD , r) + call AddResearch(UPG_HORDE_LIGHTER_AXES , r) + call AddResearch(UPG_HORDE_TROLL_BERSERKER_TRAINING , r) + call AddResearch(UPG_HORDE_UNHOLY_ARMOR , r) + call AddResearch(UPG_HORDE_UPGRADE_CANNONS , r) + call AddResearch(UPG_HORDE_UPGRADE_CATAPULT , r) + call AddResearch(UPG_HORDE_UPGRADE_SHIELDS , r) + call AddResearch(UPG_HORDE_UPGRADE_SHIP_ARMOR , r) + call AddResearch(UPG_HORDE_UPGRADE_THROWING_AXES , r) + call AddResearch(UPG_HORDE_UPGRADE_WEAPONS , r) + call AddResearch(UPG_HORDE_UPGRADE_WHIRLWIND , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( OLD_HORDE_WORKER_BASE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( OLD_HORDE_GRUNT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( OLD_HORDE_TROLL_AXETHROWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( OLD_HORDE_OGRE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( OLD_HORDE_DEATH_KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( OLD_HORDE_DEATH_KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( OLD_HORDE_DEATH_KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( OLD_HORDE_CATPULT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( OLD_HORDE_GOBLIN_SAPPERS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( OLD_HORDE_GOBLIN_ZEPPELIN)) // INLINED!! + //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( OLD_HORDE_DRAGON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( OLD_HORDE_GOBLIN_ZEPPELIN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( OLD_HORDE_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( OLD_HORDE_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( OLD_HORDE_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( OLD_HORDE_PET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( ORC_TRANSPORT_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( ORC_FRIGATE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( ORC_JUGGERNAUGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , ( OLD_HORDE_GREAT_SEE_TURTLE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , ( OLD_HORDE_OIL_TANKER)) // INLINED!! +endfunction + +function InitRaceAllianceOfLordaeron takes nothing returns nothing + local integer r= udg_RaceAllianceOfLordaeron + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( ALLIANCE_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( ALLIANCE_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( ALLIANCE_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( ALLIANCE_FARM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( ALLIANCE_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( ALLIANCE_BLACKSMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( ALLIANCE_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( ALLIANCE_CHURCH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( ALLIANCE_MAGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( ALLIANCE_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( ALLIANCE_SCOUT_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( ALLIANCE_GUARD_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( ALLIANCE_CANNON_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( ALLIANCE_CANNON_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( ALLIANCE_GNOMISH_INVENTOR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( ALLIANCE_AVIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SACRIFICAL_PIT , ( ALLIANCE_STABLES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( ALLIANCE_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + //ALLIANCE_OIL_PLATFORM + //call SetRaceSpecialBuilding(r, OLD_HORDE_FOUNDRY) + //call SetRaceSpecialBuilding2(r, OLD_HORDE_OIL_REFINERY) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( ALLIANCE_SHIPYARD)) // INLINED!! + + // researches + call AddResearch(UPG_ALLIANCE_BACKPACK , r) + call AddResearch(UPG_ALLIANCE_BLIZZARD , r) + call AddResearch(UPG_ALLIANCE_ELVEN_RANGER_TRAINING , r) + call AddResearch(UPG_ALLIANCE_HEALING , r) + call AddResearch(UPG_ALLIANCE_INVISIBILITY , r) + call AddResearch(UPG_ALLIANCE_PALADINS , r) + call AddResearch(UPG_ALLIANCE_POLYMORPH , r) + call AddResearch(UPG_ALLIANCE_SLOW , r) + call AddResearch(UPG_ALLIANCE_UPGRADE_ARROWS , r) + call AddResearch(UPG_ALLIANCE_UPGRADE_BALLISTAS , r) + call AddResearch(UPG_ALLIANCE_UPGRADE_SHIELDS , r) + call AddResearch(UPG_ALLIANCE_UPGRADE_SWORDS , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( ALLIANCE_WORKER_BASE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( ALLIANCE_FOOTMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( ALLIANCE_ELVEN_ARCHER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( ALLIANCE_KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( ALLIANCE_MAGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( ALLIANCE_MAGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( ALLIANCE_MAGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( ALLIANCE_BALLISTA)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( ALLIANCE_DEMOLITION_SQUAD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( ALLIANCE_FLYING_MACHINE)) // INLINED!! + //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( ALLIANCE_GRYPHON_RIDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( ALLIANCE_FLYING_MACHINE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( ALLIANCE_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( ALLIANCE_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( ALLIANCE_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( ALLIANCE_PET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! + //call SetRaceShipSpecial1(r, OLD_HORDE_GREAT_SEE_TURTLE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , ( ALLIANCE_OIL_TANKER)) // INLINED!! +endfunction + +function InitRaceHuman takes nothing returns nothing + local integer r= udg_RaceHuman + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( TOWN_HALL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_HUMAN_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( KEEP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_HUMAN_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( CASTLE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_HUMAN_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( HOUSE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_HUMAN_FARM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_HUMAN_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( BLACKSMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_HUMAN_BLACK_SMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( LUMBER_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_HUMAN_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( HUMAN_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_HUMAN_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( ARCANE_SANCTUM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_HUMAN_ARCANE_SANCTUM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( ARCANE_VAULT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_HUMAN_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_HUMAN_SCOUT_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( GUARD_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_HUMAN_GUARD_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( CANNON_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_HUMAN_CANNON_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( ARCANE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_HUMAN_ARCANE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( WORKSHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_HUMAN_WORKSHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( AVIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_HUMAN_GRYPHON_AVIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( HUMAN_HOUSING)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_HUMAN_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( HUMAN_ARCANE_OBSERVATORY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_HUMAN_SPECIAL_BUILDING)) // INLINED!! + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( HUMAN_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_HUMAN_SHIPYARD)) // INLINED!! + + // researches + call AddResearch(UPG_HUMAN_BACKPACK , r) + call AddResearch(UPG_MASONRY , r) + call AddResearch(UPG_SIGHT , r) + call AddResearch(UPG_DEFEND , r) + call AddResearch(UPG_BREEDING , r) + call AddResearch(UPG_PRAYING , r) + call AddResearch(UPG_SORCERY , r) + call AddResearch(UPG_LEATHER , r) + call AddResearch(UPG_ARMOR , r) + call AddResearch(UPG_MELEE , r) + call AddResearch(UPG_RANGED , r) + call AddResearch(UPG_BANDIT_WOOD , r) + call AddResearch(UPG_GUN_RANGE , r) + call AddResearch(UPG_WOOD , r) + call AddResearch(UPG_SENTINEL , r) + call AddResearch(UPG_BOMBS , r) + call AddResearch(UPG_HAMMERS , r) + call AddResearch(UPG_CONT_MAGIC , r) + call AddResearch(UPG_FRAGS , r) + call AddResearch(UPG_TANK , r) + call AddResearch(UPG_FLAK , r) + call AddResearch(UPG_CLOUD , r) + call AddResearch(UPG_HUMAN_SUNDERING_BLADES , r) + call AddResearch(UPG_HUMAN_FLARE , r) + call AddResearch(UPG_HUMAN_ARCANE_OBSERVATORY , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( PEASANT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( FOOTMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( RIFLEMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( PRIEST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( SORCERESS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( SPELL_BREAKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( TANK)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( MORTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( GYRO)) // INLINED!! + //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( GRYPHON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( HUMAN_DRAGON_HAWK)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( HUMAN_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( HUMAN_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( HUMAN_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( HUMAN_PET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! +endfunction + +function InitRaceOrc takes nothing returns nothing + local integer r= udg_RaceOrc + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( GREAT_HALL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_ORC_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( STRONGHOLD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_ORC_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( FORTRESS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_ORC_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( BURROW)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_ORC_BURROW)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( ORC_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_ORC_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( FORGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_ORC_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( FORGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_ORC_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( ORC_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_ORC_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( LODGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_ORC_LODGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( VOODOO_LOUNGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_ORC_VOODOO_LOUNGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_ORC_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( BESTIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_ORC_BEASTIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( TOTEM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_ORC_TOTEM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( ORC_HOUSING)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_ORC_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( FOUNTAIN_OF_BLOOD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_ORC_SPECIAL_BUILDING)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , ( FEL_DRAGON_ROOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( ORC_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_ORC_SHIPYARD)) // INLINED!! + + // researches + call AddResearch(UPG_ORC_BACKPACK , r) + call AddResearch(UPG_ORC_MELEE , r) + call AddResearch(UPG_ORC_RANGED , r) + call AddResearch(UPG_ORC_ARMOR , r) + call AddResearch(UPG_ORC_WAR_DRUMS , r) + call AddResearch(UPG_ORC_PILLAGE , r) + call AddResearch(UPG_ORC_BERSERK , r) + call AddResearch(UPG_ORC_PULVERIZE , r) + call AddResearch(UPG_ORC_ENSNARE , r) + call AddResearch(UPG_ORC_VENOM , r) + call AddResearch(UPG_ORC_DOCS , r) + call AddResearch(UPG_ORC_SHAMAN , r) + call AddResearch(UPG_ORC_SPIKES , r) + call AddResearch(UPG_ORC_BURROWS , r) + call AddResearch(UPG_ORC_REGEN , r) + call AddResearch(UPG_ORC_FIRE , r) + call AddResearch(UPG_ORC_SWALKER , r) + call AddResearch(UPG_ORC_BERSERKER , r) + call AddResearch(UPG_ORC_NAPTHA , r) + call AddResearch(UPG_FEL , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( PEON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( GRUNT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( HEAD_HUNTER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( RAIDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( WITCH_DOCTOR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( SHAMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( SPIRIT_WALKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( KODO_BEAST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( CATAPULT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( BATRIDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( TAUREN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( WYVERN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( BATRIDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( ORC_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( ORC_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( ORC_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( ORC_PET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( ORC_TRANSPORT_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( ORC_FRIGATE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( ORC_JUGGERNAUGHT)) // INLINED!! +endfunction + +function InitRaceUndead takes nothing returns nothing + local integer r= udg_RaceUndead + +endfunction + +function InitRaceNightElf takes nothing returns nothing + local integer r= udg_RaceNightElf + +endfunction + +function InitRaceStormwind takes nothing returns nothing + local integer r= udg_RaceStormwind + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( STORMWIND_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_STORMWIND_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( STORMWIND_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_STORMWIND_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( STORMWIND_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_STORMWIND_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( STORMWIND_FARM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_STORMWIND_FARM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( STORMWIND_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_STORMWIND_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( STORMWIND_BLACKSMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_STORMWIND_BLACKSMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( STORMWIND_LUMBER_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_STORMWIND_LUMBER_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( STORMWIND_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_STORMWIND_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( STORMWIND_MAGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_STORMWIND_MAGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( STORMWIND_ARCANE_VAULT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_STORMWIND_ARCANE_VAULT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( STORMWIND_SCOUT_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_STORMWIND_SCOUT_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( STORMWIND_GUARD_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_STORMWIND_GUARD_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( STORMWIND_CANNON_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_STORMWIND_CANNON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( STORMWIND_ARCANE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_STORMWIND_ARCANE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( STORMWIND_WORKSHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_STORMWIND_WORKSHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( STORMWIND_AVIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_STORMWIND_AVIARY)) // INLINED!! + //call SetRaceSacrificialPit(r, DALARAN_ELEMENTAL_SANCTUARY_1) + //call SetRaceMine(r, DALARAN_MINE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( STORMWIND_HOUSING)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_STORMWIND_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( STORMWIND_CATHEDRAL_OF_LIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_STORMWIND_CATHEDRAL_OF_LIGHT)) // INLINED!! + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( STORMWIND_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_STORMWIND_SHIPYARD)) // INLINED!! + + call AddResearch(UPG_STORMWIND_LUMBER , r) + call AddResearch(UPG_STORMWIND_MASONRY , r) + call AddResearch(UPG_STORMWIND_MELEE , r) + call AddResearch(UPG_STORMWIND_ARMOR , r) + call AddResearch(UPG_STORMWIND_RANGED , r) + call AddResearch(UPG_STORMWIND_LEATHER , r) + call AddResearch(UPG_STORMWIND_DEFEND , r) + call AddResearch(UPG_STORMWIND_BOWS , r) + call AddResearch(UPG_STORMWIND_MARKSMANSHIP , r) + call AddResearch(UPG_STORMWIND_SUNDERING_BLADES , r) + call AddResearch(UPG_STORMWIND_BACKPACK , r) + call AddResearch(UPG_STORMWIND_SORCERY , r) + call AddResearch(UPG_STORMWIND_MAGE , r) + call AddResearch(UPG_STORMWIND_PRIEST , r) + call AddResearch(UPG_STORMWIND_ANIMAL , r) + call AddResearch(UPG_STORMWIND_UNMOUNT , r) + call AddResearch(UPG_STORMWIND_MAGIC_SENTRY , r) + call AddResearch(UPG_STORMWIND_REINFORCED_DEFENSES , r) + call AddResearch(UPG_STORMWIND_CATHEDRAL_OF_LIGHT , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( STORMWIND_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( STORMWIND_FOOTMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( STORMWIND_RANGER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( STORMWIND_KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( STORMWIND_PRIEST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( STORMWIND_SORCERESS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( STORMWIND_MAGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( STORMWIND_ALLIANCE_SIEGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( STORMWIND_CANNON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( STORMWIND_AIR_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_4 , ( STORMWIND_BANNER_CARRIER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( STORMWIND_BISHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( STORMWIND_GRYPHON_RIDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( STORMWIND_EAGLE_KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_3 , ( STORMWIND_GRYPHON_KNIGHT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_4 , ( STORMWIND_LION_RIDER)) // INLINED!! + //call SetRaceShade(r, DALARAN_MUTANT) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( STORMWIND_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( STORMWIND_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( STORMWIND_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( STORMWIND_PET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! +endfunction + +function InitRaceDalaran takes nothing returns nothing + local integer r= udg_RaceDalaran + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( DALARAN_TIER_1)) // INLINED!! + //call SetRaceTier1Item(r, ITEM_HUMAN_TIER_1) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( DALARAN_TIER_2)) // INLINED!! + //call SetRaceTier2Item(r, ITEM_HUMAN_TIER_2) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DALARAN_TIER_3)) // INLINED!! + //call SetRaceTier3Item(r, ITEM_HUMAN_TIER_3) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( DALARAN_POWER_GENERATOR)) // INLINED!! + //call SetRaceFarmItem(r, ITEM_HUMAN_FARM) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( DALARAN_BARRACKS)) // INLINED!! + //call SetRaceBarracksItem(r, ITEM_HUMAN_BARRACKS) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( DALARAN_BLACKSMITH)) // INLINED!! + //call SetRaceBlacksmithItem(r, ITEM_HUMAN_BLACK_SMITH) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( DALARAN_BLACKSMITH)) // INLINED!! + //call SetRaceMillItem(r, ITEM_HUMAN_MILL) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( DALARAN_ALTAR)) // INLINED!! + //call SetRaceAltarItem(r, ITEM_HUMAN_ALTAR) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( DALARAN_ARCANE_SANCTUM)) // INLINED!! + //call SetRaceArcaneSanctumItem(r, ITEM_HUMAN_ARCANE_SANCTUM) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( DALARAN_SHOP)) // INLINED!! + //call SetRaceShopItem(r, ITEM_HUMAN_SHOP) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( DALARAN_GUARD_TOWER_1)) // INLINED!! + //call SetRaceScoutTowerItem(r, ITEM_HUMAN_SCOUT_TOWER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( DALARAN_GUARD_TOWER_2)) // INLINED!! + //call SetRaceGuardTowerItem(r, ITEM_HUMAN_GUARD_TOWER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( DALARAN_GUARD_TOWER_2)) // INLINED!! + //call SetRaceCannonTowerItem(r, ITEM_HUMAN_CANNON_TOWER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( DALARAN_GUARD_TOWER_2)) // INLINED!! + //call SetRaceArcaneTowerItem(r, ITEM_HUMAN_ARCANE_TOWER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( DALARAN_ZOO)) // INLINED!! + //call SetRaceWorkshopItem(r, ITEM_HUMAN_WORKSHOP) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( DALARAN_AVIARY)) // INLINED!! + //call SetRaceAviaryItem(r, ITEM_HUMAN_GRYPHON_AVIARY) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SACRIFICAL_PIT , ( DALARAN_ELEMENTAL_SANCTUARY_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MINE , ( DALARAN_MINE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DALARAN_HOUSING)) // INLINED!! + //call SetRaceHousingItem(r, ITEM_HUMAN_HOUSING) + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( DALARAN_VIOLET_CITADEL)) // INLINED!! + //call SetRaceSpecialBuildingItem(r, ITEM_HUMAN_SPECIAL_BUILDING) + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DALARAN_SHIPYARD)) // INLINED!! + //call SetRaceShipyardItem(r, ITEM_HUMAN_SHIPYARD) + + call AddResearch(UPG_DALARAN_GOLD , r) + call AddResearch(UPG_DALARAN_MELEE , r) + call AddResearch(UPG_DALARAN_ARMOR , r) + call AddResearch(UPG_DALARAN_CR_ATTACK , r) + call AddResearch(UPG_DALARAN_CR_ARMOR , r) + call AddResearch(UPG_DALARAN_DEFEND , r) + call AddResearch(UPG_DALARAN_SORCERESS , r) + call AddResearch(UPG_DALARAN_WIZARD , r) + call AddResearch(UPG_DALARAN_FIRE_MAGE , r) + call AddResearch(UPG_DALARAN_GOLEM , r) + call AddResearch(UPG_DALARAN_ANIMAL , r) + call AddResearch(UPG_DALARAN_CLOUD , r) + call AddResearch(UPG_DALARAN_BACKPACK , r) + call AddResearch(UPG_DALARAN_MAGIC_SENTRY , r) + call AddResearch(UPG_DALARAN_BLINK , r) + call AddResearch(UPG_DALARAN_MANA_SHIELD , r) + call AddResearch(UPG_DALARAN_SPAWN_FIRE_ELEMENTALS , r) + call AddResearch(UPG_DALARAN_SHIELD , r) + call AddResearch(UPG_DALARAN_ELEMENTAL , r) + call AddResearch(UPG_DALARAN_FEEDBACK , r) + call AddResearch(UPG_DALARAN_FLYING_CITY , r) + call AddResearch(UPG_DALARAN_VIOLET_CITADEL , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( DALARAN_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TOWN_HALL_3 , ( DALARAN_SAND_ELEMENTAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DALARAN_PIKEMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DALARAN_APPRENTICE_WIZARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DALARAN_SUPPLY_CART)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_4 , ( DALARAN_REJECT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DALARAN_WIZARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( DALARAN_SORCERESS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( DALARAN_FIRE_MAGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_4 , ( DALARAN_FROST_ELEMENTAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( DALARAN_GUARDIAN_GOLEM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( DALARAN_FLESH_GOLEM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( DALARAN_FIRE_ELEMENTAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_4 , ( DALARAN_VOID_ELEMENTAL)) // INLINED!! + //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DALARAN_AIR_ELEMENTAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( DALARAN_DRAGON_HAWK)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_3 , ( DALARAN_LIGHTNING_ELEMENTAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_4 , ( DALARAN_POISON_ELEMENTAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHADE , ( DALARAN_MUTANT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DALARAN_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DALARAN_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DALARAN_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DALARAN_PET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TRANSPORT_SHIP , ( HUMAN_TRANSPORT_SHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FRIGATE , ( HUMAN_FRIGATE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BATTLESHIP , ( HUMAN_BATTLESHIP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_1 , ( DALARAN_WATER_ELEMENTAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIP_SPECIAL_2 , ( DALARAN_SEA_ELEMENTAL)) // INLINED!! +endfunction + +function InitRaceCentaur takes nothing returns nothing + local integer r= udg_RaceCentaur + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( CENTAUR_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( CENTAUR_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( CENTAUR_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( CENTAUR_TENT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( CENTAUR_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( CENTAUR_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( CENTAUR_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( CENTAUR_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( CENTAUR_LODGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( CENTAUR_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( CENTAUR_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( CENTAUR_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( CENTAUR_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( CENTAUR_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( CENTAUR_ROOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( CENTAUR_KHAN_TENT)) // INLINED!! + //call SetRaceSacrificialPit(r, KOBOLD_TUNNEL) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( CENTAUR_HOUSING)) // INLINED!! + //call SetRaceMine(r, KOBOLD_BOULDER_TOWER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( ORC_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( CENTAUR_SPECIAL_BUILDING)) // INLINED!! + //call SetRaceSpecialBuilding2(r, KOBOLD_BOULDER_TOWER) + + // researches + call AddResearch(UPG_CENTAUR_BACKPACK , r) + call AddResearch(UPG_CENTAUR_DIVINER , r) + call AddResearch(UPG_CENTAUR_HORSE_SHOES , r) + call AddResearch(UPG_CENTAUR_REINCARNATION , r) + call AddResearch(UPG_CENTAUR_SPECIAL_BUILDING , r) + call AddResearch(UPG_CENTAUR_SORCERER , r) + call AddResearch(UPG_CENTAUR_SEARING_ARROWS , r) + call AddResearch(UPG_CENTAUR_MELEE , r) + call AddResearch(UPG_CENTAUR_RANGED , r) + call AddResearch(UPG_CENTAUR_ARMOR , r) + call AddResearch(UPG_CENTAUR_RIDE_DOWN , r) + call AddResearch(UPG_CENTAUR_TRUE_SIGHT , r) + call AddResearch(UPG_CENTAUR_SLEEP , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( CENTAUR_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( CENTAUR_DRUDGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( CENTAUR_ARCHER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( CENTAUR_OUTRUNNER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( CENTAUR_DIVINER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( CENTAUR_SORCERER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( CENTAUR_SORCERER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( CENTAUR_OUTRUNNER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( CENTAUR_KHAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( CENTAUR_EAGLE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( CENTAUR_HARPY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( CENTAUR_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( CENTAUR_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( CENTAUR_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( CENTAUR_PET)) // INLINED!! +endfunction + +function InitRaceGnoll takes nothing returns nothing + local integer r= udg_RaceGnoll + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( GNOLL_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( GNOLL_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( GNOLL_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( GNOLL_HUT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( GNOLL_KENNEL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( GNOLL_LUMBERYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( GNOLL_LUMBERYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( GNOLL_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( GNOLL_ELEMENTAL_GROVE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( GNOLL_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( GNOLL_SAVAGE_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( GNOLL_BATTLE_ARENA)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( GNOLL_BATTLE_ARENA)) // INLINED!! + //call SetRaceSacrificialPit(r, KOBOLD_TUNNEL) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( GNOLL_HOUSING)) // INLINED!! + //call SetRaceMine(r, KOBOLD_BOULDER_TOWER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( KOBOLD_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( KOBOLD_MINES)) // INLINED!! + //call SetRaceSpecialBuilding2(r, KOBOLD_BOULDER_TOWER) + + // researches + call AddResearch(UPG_GNOLL_BACKPACK , r) + call AddResearch(UPG_GNOLL_ENVENOMED_WEAPONS , r) + call AddResearch(UPG_GNOLL_ENSLAVEMENT , r) + call AddResearch(UPG_GNOLL_BARREL_FORM , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( GNOLL_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( GNOLL_BRUTE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( GNOLL_ASSASSIN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( GNOLL_OVERSEER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( GNOLL_MYSTWEAVER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( GNOLL_TREASURE_HUNTER)) // INLINED!! + //call SetRaceSpellBreaker(r, QUILLBOAR_NECROMANCER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( GNOLL_ROCKBREAKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( GNOLL_WARLORD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( GNOLL_WARHAWK)) // INLINED!! + //call SetRaceDragonHawk(r, QUILLBOAR_HARPY_WINDWITCH) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( GNOLL_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( GNOLL_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( GNOLL_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( GNOLL_PET)) // INLINED!! +endfunction + +function InitRaceKobold takes nothing returns nothing + local integer r= udg_RaceKobold + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( KOBOLD_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( KOBOLD_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( KOBOLD_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( KOBOLD_CAVERN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( KOBOLD_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( KOBOLD_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( KOBOLD_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( KOBOLD_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( KOBOLD_LODGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( KOBOLD_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( KOBOLD_BOULDER_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( KOBOLD_ADVANCED_BOULDER_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( KOBOLD_ADVANCED_BOULDER_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( KOBOLD_ADVANCED_BOULDER_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( KOBOLD_BEASTIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( KOBOLD_TUNNEL)) // INLINED!! + //call SetRaceSacrificialPit(r, KOBOLD_TUNNEL) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( KOBOLD_HOUSING)) // INLINED!! + //call SetRaceMine(r, KOBOLD_BOULDER_TOWER) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( KOBOLD_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( KOBOLD_MINES)) // INLINED!! + //call SetRaceSpecialBuilding2(r, KOBOLD_BOULDER_TOWER) + + // researches + call AddResearch(UPG_KOBOLD_BACKPACK , r) + call AddResearch(UPG_KOBOLD_BURROW , r) + call AddResearch(UPG_KOBOLD_CANDLES , r) + call AddResearch(UPG_KOBOLD_MELEE , r) + call AddResearch(UPG_KOBOLD_ARMOR , r) + call AddResearch(UPG_KOBOLD_GEOMANCER , r) + call AddResearch(UPG_KOBOLD_MINING , r) + call AddResearch(UPG_KOBOLD_GOLD_COINS , r) + call AddResearch(UPG_KOBOLD_MINES , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( KOBOLD_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( KOBOLD_WARRIOR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( KOBOLD_HUNTER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( KOBOLD_TUNNELER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( KOBOLD_GEOMANCER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( KOBOLD_MUSHROOM_CASTER)) // INLINED!! + //call SetRaceSpellBreaker(r, QUILLBOAR_NECROMANCER) + //call SetRaceSiegeEngine(r, QUILLBOAR_QUILBEAST) + //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) + //call SetRaceGryphon(r, QUILLBOAR_HARPY_ROGUE) + //call SetRaceDragonHawk(r, QUILLBOAR_HARPY_WINDWITCH) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( KOBOLD_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( KOBOLD_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( KOBOLD_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( KOBOLD_PET)) // INLINED!! +endfunction + +function InitRaceQuillboar takes nothing returns nothing + local integer r= udg_RaceQuillboar + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( QUILLBOAR_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( QUILLBOAR_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( QUILLBOAR_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( QUILLBOAR_HUT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( QUILLBOAR_TRAINING_CAMP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( QUILLBOAR_FORGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( QUILLBOAR_FORGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( QUILLBOAR_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( QUILLBOAR_HOUSE_OF_ANCESTRY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( QUILLBOAR_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( QUILLBOAR_THORNY_SPIRE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( QUILLBOAR_ANIMAL_BATTLE_GROUNDS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( QUILLBOAR_SACRIFICIAL_GROUNDS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( QUILLBOAR_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + //call SetRaceShipyard(r, QUILLBOAR_THORNY_SPIRE) + //call SetRaceSpecialBuilding(r, QUILLBOAR_THORNY_SPIRE) + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + + // researches + call AddResearch(UPG_QUILLBOAR_BACKPACK , r) + call AddResearch(UPG_QUILLBOAR_MEDICINE_MAN , r) + call AddResearch(UPG_QUILLBOAR_MYSTIC , r) + call AddResearch(UPG_QUILLBOAR_NECROMANCER , r) + call AddResearch(UPG_QUILLBOAR_QUIL_SPRAY , r) + call AddResearch(UPG_QUILLBOAR_QUILLS , r) + call AddResearch(UPG_QUILLBOAR_THORNS_AURA , r) + call AddResearch(UPG_QUILLBOAR_MELEE , r) + call AddResearch(UPG_QUILLBOAR_RANGED , r) + call AddResearch(UPG_QUILLBOAR_ARMOR , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( QUILLBOAR_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( QUILLBOAR_QUILLBOAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( QUILLBOAR_HUNTER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( QUILLBOAR_RAIDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( QUILLBOAR_MEDICINE_MAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( QUILLBOAR_MYSTIC)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( QUILLBOAR_NECROMANCER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( QUILLBOAR_QUILBEAST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( QUILLBOAR_CHIEFTAIN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( QUILLBOAR_HARPY_ROGUE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( QUILLBOAR_HARPY_WINDWITCH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( QUILLBOAR_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( QUILLBOAR_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( QUILLBOAR_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( QUILLBOAR_PET)) // INLINED!! +endfunction + +function InitRaceBandit takes nothing returns nothing + local integer r= udg_RaceBandit + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( BANDIT_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1_ITEM , ( ITEM_TINY_BANDIT_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( BANDIT_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_TINY_BANDIT_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( BANDIT_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_TINY_BANDIT_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( BANDIT_TENT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_TINY_BANDIT_TENT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( BANDIT_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_TINY_BANDIT_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( BANDIT_BLACKSMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_TINY_BANDIT_BLACKSMITH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( BANDIT_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_TINY_BANDIT_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( BANDIT_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_TINY_BANDIT_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( BANDIT_CHURCH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_TINY_BANDIT_CHURCH)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( BANDIT_MARKET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_TINY_BANDIT_MARKET)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_TINY_BANDIT_WATCH_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( BANDIT_PRISON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_TINY_BANDIT_PRISON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( BANDIT_AVIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_TINY_BANDIT_AVIARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( BANDIT_HOUSING)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_TINY_BANDIT_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + //call SetRaceShipyard(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( BANDIT_THIEVES_GUILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_TINY_BANDIT_THIEVES_GUILD)) // INLINED!! + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( BANDIT_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_TINY_BANDIT_SHIPYARD)) // INLINED!! + + // researches + call AddResearch(UPG_BANDIT_BACKPACK , r) + call AddResearch(UPG_BANDIT_ENSNARE , r) + call AddResearch(UPG_BANDIT_SHADOW_MELD , r) + call AddResearch(UPG_BANDIT_ROB , r) + call AddResearch(UPG_BANDIT_ENVENOMED_WEAPONS , r) + call AddResearch(UPG_BANDIT_ENSLAVEMENT , r) + call AddResearch(UPG_BANDIT_WIZARD , r) + call AddResearch(UPG_BANDIT_HERETIC , r) + call AddResearch(UPG_BANDIT_SLAVE_MASTER , r) + call AddResearch(UPG_BANDIT_ARMOR , r) + call AddResearch(UPG_BANDIT_MELEE , r) + call AddResearch(UPG_BANDIT_RANGED , r) + call AddResearch(UPG_BANDIT_WOOD , r) + call AddResearch(UPG_BANDIT_FEATHER_ATTACK , r) + call AddResearch(UPG_BANDIT_TRUE_SIGHT , r) + call AddResearch(UPG_BANDIT_STORM_HAMMERS , r) + call AddResearch(UPG_BANDIT_RIDE_DOWN , r) + call AddResearch(UPG_BANDIT_RESISTANT_SKIN , r) + call AddResearch(UPG_BANDIT_THIEVES_GUILD , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( BANDIT_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( BANDIT_BANDIT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( BANDIT_BRIGAND)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( BANDIT_BANDIT_LORD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( BANDIT_WIZARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( BANDIT_HERETIC)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( BANDIT_SLAVE_MASTER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( BANDIT_CARGE_CART)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( BANDIT_AMBAL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( BANDIT_CROSSBOWMAN)) // INLINED!! + //call SetRaceTauren(r, QUILLBOAR_CHIEFTAIN) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( BANDIT_GRYPHON_RAIDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( BANDIT_CROW)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_AVIARY_3 , ( BANDIT_FLYING_SPEAR_THROWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( BANDIT_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( BANDIT_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( BANDIT_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( BANDIT_PET)) // INLINED!! +endfunction + +function InitRaceDungeon takes nothing returns nothing + local integer r= udg_RaceDungeon + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( DUNGEON_TIER_1)) // INLINED!! + //call SetRaceTier1Item(r, ITEM_TINY_BANDIT_TIER_1) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( DUNGEON_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2_ITEM , ( ITEM_DUNGEON_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DUNGEON_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3_ITEM , ( ITEM_DUNGEON_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( DUNGEON_CAGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM_ITEM , ( ITEM_DUNGEON_CAGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( DUNGEON_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS_ITEM , ( ITEM_DUNGEON_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( DUNGEON_TORTURE_CHAMBER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM , ( ITEM_DUNGEON_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( DUNGEON_TORTURE_CHAMBER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL_ITEM , ( ITEM_DUNGEON_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( DUNGEON_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR_ITEM , ( ITEM_DUNGEON_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( DUNGEON_BRAZIER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM , ( ITEM_DUNGEON_BRAZIER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( DUNGEON_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP_ITEM , ( ITEM_DUNGEON_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM , ( ITEM_DUNGEON_SPIKES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( DUNGEON_PRISON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP_ITEM , ( ITEM_DUNGEON_PRISON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( DUNGEON_DRAGON_ROOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM , ( ITEM_DUNGEON_DRAGON_ROOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DUNGEON_HOUSING)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING_ITEM , ( ITEM_DUNGEON_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + //call SetRaceShipyard(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( DUNGEON_THRONE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM , ( ITEM_DUNGEON_THRONE)) // INLINED!! + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DUNGEON_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD_ITEM , ( ITEM_DUNGEON_SHIPYARD)) // INLINED!! + + // researches + call AddResearch(UPG_DUNGEON_BACKPACK , r) + call AddResearch(UPG_DUNGEON_MELEE , r) + call AddResearch(UPG_DUNGEON_ARMOR , r) + call AddResearch(UPG_DUNGEON_RANGED , r) + call AddResearch(UPG_DUNGEON_EAT_TREE , r) + call AddResearch(UPG_DUNGEON_BURNING_ARROWS , r) + call AddResearch(UPG_DUNGEON_GHOST , r) + call AddResearch(UPG_DUNGEON_FIRE_REVENANT , r) + call AddResearch(UPG_DUNGEON_SKELETON_BONES , r) + call AddResearch(UPG_DUNGEON_CREATE_CORPSE , r) + call AddResearch(UPG_DUNGEON_CAPTURE , r) + call AddResearch(UPG_DUNGEON_DEVOUR , r) + call AddResearch(UPG_DUNGEON_BERSERK , r) + call AddResearch(UPG_DUNGEON_SLEEP_FORM , r) + call AddResearch(DUNGEON_SPIKES , r) + call AddResearch(UPG_DUNGEON_THRONE , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( DUNGEON_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DUNGEON_SKELETON_WARRIOR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DUNGEON_SKELETON_ARCHER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DUNGEON_SKELETON_BERSERKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DUNGEON_FIRE_REVENANT)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SORCERESS , ( DUNGEON_GHOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPELLBREAKER , ( DUNGEON_HERETIC)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SIEGE_ENGINE , ( DUNGEON_SALAMANDER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MORTAR , ( DUNGEON_SLUDGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FLYING_MACHINE , ( DUNGEON_WAR_GOLEM)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TAUREN , ( DUNGEON_LORD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DUNGEON_RED_DRAGON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_DRAGONHAWK , ( DUNGEON_WILDKIN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHADE , ( DUNGEON_PRISONER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DUNGEON_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DUNGEON_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DUNGEON_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DUNGEON_PET)) // INLINED!! +endfunction + +function InitRaceDragonkin takes nothing returns nothing + local integer r= udg_RaceDragonkin + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( DRAGONKIN_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( DRAGONKIN_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DRAGONKIN_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( DRAGONKIN_NEST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( DRAGONKIN_BARRACKS)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( DRAGONKIN_FORGE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( DRAGONKIN_QUARRY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( DRAGONKIN_ALTAR)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( DRAGONKIN_ARCANE_TEMPLE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( DRAGONKIN_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( DRAGONKIN_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( DRAGONKIN_ARENA)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( DRAGONKIN_ROOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DRAGONKIN_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DRAGONKIN_SHIPYARD)) // INLINED!! + //call SetRaceSpecialBuilding(r, QUILLBOAR_THORNY_SPIRE) + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + + // researches + call AddResearch(UPG_DRAGONKIN_BACKPACK , r) + call AddResearch(UPG_DRAGONKIN_SPELL_DAMAGE_REDUCTION , r) + call AddResearch(UPG_DRAGONKIN_RESISTANT_SKIN , r) + call AddResearch(UPG_DRAGONKIN_FIRE_ATTACK , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( DRAGONKIN_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DRAGONKIN_FOOTMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DRAGONKIN_RIFLEMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DRAGONKIN_DRAGON_PRIEST)) // INLINED!! + + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DRAGONKIN_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DRAGONKIN_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DRAGONKIN_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DRAGONKIN_PET)) // INLINED!! +endfunction + +function InitRaceVillage takes nothing returns nothing + local integer r= udg_RaceVillage + + // buildings + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_1 , ( VILLAGE_TIER_1)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_2 , ( VILLAGE_TIER_2)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_TIER_3 , ( DRAGONKIN_TIER_3)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FARM , ( VILLAGE_INN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BARRACKS , ( VILLAGE_STABLES)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_BLACK_SMITH , ( VILLAGE_FRUIT_STAND)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MILL , ( VILLAGE_GRANARY)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ALTAR , ( VILLAGE_TAVERN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_SANCTUM , ( VILLAGE_ANIMAL_PEN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHOP , ( VILLAGE_SHOP)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SCOUT_TOWER , ( VILLAGE_OUTPOST)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GUARD_TOWER , ( VILLAGE_BELL_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CANNON_TOWER , ( VILLAGE_BELL_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_ARCANE_TOWER , ( VILLAGE_BELL_TOWER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKSHOP , ( VILLAGE_BARN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON_AVIARY , ( VILLAGE_WIND_MILL)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_HOUSING , ( DRAGONKIN_HOUSING)) // INLINED!! + //call SetRaceMine(r, QUILLBOAR_THORNY_SPIRE) + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SHIPYARD , ( DRAGONKIN_SHIPYARD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_SPECIAL_BUILDING , ( DRAGONKIN_WYRMREST_TEMPLE)) // INLINED!! + //call SetRaceSpecialBuilding2(r, QUILLBOAR_THORNY_SPIRE) + + // researches + call AddResearch(UPG_DRAGONKIN_BACKPACK , r) + call AddResearch(UPG_DRAGONKIN_SPELL_DAMAGE_REDUCTION , r) + call AddResearch(UPG_DRAGONKIN_RESISTANT_SKIN , r) + call AddResearch(UPG_DRAGONKIN_FIRE_ATTACK , r) + call AddResearch(UPG_DRAGONKIN_WYRMREST_TEMPLE , r) + + // units + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_WORKER , ( VILLAGE_WORKER)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FOOTMAN , ( DRAGONKIN_FOOTMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_RIFLEMAN , ( DRAGONKIN_RIFLEMAN)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_KNIGHT , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_GRYPHON , ( DRAGONKIN_BLACK_DRAGON)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PRIEST , ( DRAGONKIN_DRAGON_PRIEST)) // INLINED!! + + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_MALE_CITIZEN , ( DRAGONKIN_CITIZEN_MALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_FEMALE_CITIZEN , ( DRAGONKIN_CITIZEN_FEMALE)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_CHILD , ( DRAGONKIN_CHILD)) // INLINED!! + call SetRaceObjectType((r ) , RACE_OBJECT_TYPE_PET , ( DRAGONKIN_PET)) // INLINED!! +endfunction + + +function InitRaces takes nothing returns nothing + call InitRaceFreelancer() + call InitRaceOldHorde() + call InitRaceAllianceOfLordaeron() + call InitRaceHuman() + call InitRaceOrc() + call InitRaceUndead() + call InitRaceNightElf() + call InitRaceStormwind() + call InitRaceDalaran() + call InitRaceCentaur() + call InitRaceGnoll() + call InitRaceKobold() + call InitRaceQuillboar() + call InitRaceBandit() + call InitRaceDungeon() + call InitRaceDragonkin() + call InitRaceVillage() +endfunction + + +//library WoWReforgedAllRaces ends +//library WoWReforgedCalendar: + + + +//processed: function interface CalendarEventFunction takes CalendarEvent e returns nothing + + + +function GetCalendarChangeSecondTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedCalendar___changeSecondTimer) +endfunction + +function GetCalendarThunderTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedCalendar___thunderTimer) +endfunction + +function GetCalendarWeatherTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedCalendar___weatherTimer) +endfunction + +function IsBetweenCalendarDay takes integer startDay,real startTimeOfDay,integer endDay,real endTimeOfDay returns boolean + if ( WoWReforgedCalendar___days < startDay or WoWReforgedCalendar___days > endDay ) then + return false + elseif ( startDay == endDay and not IsBetweenTimeOfDay(startTimeOfDay , endTimeOfDay) ) then + return false + elseif ( WoWReforgedCalendar___days == startDay and not IsBetweenTimeOfDay(startTimeOfDay , 0.0) ) then + return false + elseif ( WoWReforgedCalendar___days == endDay and IsBetweenTimeOfDay(0.0 , endTimeOfDay) ) then + return false + endif + return false +endfunction + +function WoWReforgedCalendar___TriggerActionVote takes nothing returns nothing + local integer e= LoadInteger(WoWReforgedCalendar___h, GetHandleId(GetTriggeringTrigger()), 0) + if ( s__CalendarEvent_running[e] ) then + if ( s__CalendarEvent_endFunc[e] != 0 ) then + call h__DisplayTextToForce(GetPlayersAll(), "Event ending: " + s__CalendarEvent_name[e]) + call sc___prototype26_execute(s__CalendarEvent_endFunc[e],e) + set s__CalendarEvent_running[e]=false + endif + else + if ( s__CalendarEvent_startFunc[e] != 0 ) then + set s__CalendarEvent_running[e]=true + call h__DisplayTextToForce(GetPlayersAll(), "Event starting: " + s__CalendarEvent_name[e]) + call sc___prototype26_execute(s__CalendarEvent_startFunc[e],e) + endif + endif +endfunction + +function GetCalendarEventsMax takes nothing returns integer + return WoWReforgedCalendar___calendarEventsCounter +endfunction + +function GetCalendarEvent takes integer index returns integer + return WoWReforgedCalendar___calendarEvents[index] +endfunction + +function AddCalendarEvent takes string name,string vote,integer startDay,real startTimeOfDay,integer endDay,real endTimeOfDay,integer startFunc,integer endFunc,string icon returns integer + local integer e= s__CalendarEvent__allocate() + set s__CalendarEvent_name[e]=name + set s__CalendarEvent_vote[e]=vote + set s__CalendarEvent_startDay[e]=startDay + set s__CalendarEvent_startTimeOfDay[e]=startTimeOfDay + set s__CalendarEvent_endDay[e]=endDay + set s__CalendarEvent_endTimeOfDay[e]=endTimeOfDay + set s__CalendarEvent_startFunc[e]=startFunc + set s__CalendarEvent_endFunc[e]=endFunc + set s__CalendarEvent_icon[e]=icon + set WoWReforgedCalendar___calendarEvents[WoWReforgedCalendar___calendarEventsCounter]=e + set WoWReforgedCalendar___calendarEventsCounter=WoWReforgedCalendar___calendarEventsCounter + 1 + + call SaveInteger(WoWReforgedCalendar___h, GetHandleId(s__CalendarEvent_voteTrigger[e]), 0, e) + call TriggerAddAction(s__CalendarEvent_voteTrigger[e], function WoWReforgedCalendar___TriggerActionVote) + + set udg_TmpString=name + set udg_TmpString2=vote + set udg_TmpTrigger=s__CalendarEvent_voteTrigger[e] + call AddWowReforgedVote() + + return e +endfunction + +// use when dropping more food during harvesting season or candy during halloween +function IsCalendarEventRunning takes integer e returns boolean + return s__CalendarEvent_running[e] +endfunction + +// call this on every change of time +function WoWReforgedCalendar___CheckCalendarEvents takes nothing returns nothing + local integer e= 0 + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedCalendar___calendarEventsCounter ) + set e=WoWReforgedCalendar___calendarEvents[i] + if ( s__CalendarEvent_running[e] ) then + if ( not IsBetweenCalendarDay(s__CalendarEvent_startDay[e] , s__CalendarEvent_startTimeOfDay[e] , s__CalendarEvent_endDay[e] , s__CalendarEvent_endTimeOfDay[e]) ) then + if ( s__CalendarEvent_endFunc[e] != 0 ) then + call sc___prototype26_execute(s__CalendarEvent_endFunc[e],e) + set s__CalendarEvent_running[e]=false + endif + endif + else + if ( IsBetweenCalendarDay(s__CalendarEvent_startDay[e] , s__CalendarEvent_startTimeOfDay[e] , s__CalendarEvent_endDay[e] , s__CalendarEvent_endTimeOfDay[e]) ) then + if ( s__CalendarEvent_startFunc[e] != 0 ) then + set s__CalendarEvent_running[e]=true + call h__DisplayTextToForce(GetPlayersAll(), "Event starting: " + s__CalendarEvent_name[e]) + call sc___prototype26_execute(s__CalendarEvent_startFunc[e],e) + endif + endif + endif + set i=i + 1 + endloop +endfunction + +function GetRunningCalendarEvent takes nothing returns integer + local integer e= 0 + local integer i= 0 + loop + exitwhen ( i >= WoWReforgedCalendar___calendarEventsCounter ) + set e=WoWReforgedCalendar___calendarEvents[i] + if ( s__CalendarEvent_running[e] ) then + return e + endif + set i=i + 1 + endloop + return 0 +endfunction + +function AddTreeMapping takes integer summerId,integer fallId,integer winterId,integer winterSnowyId,integer easterId,integer christmasId returns integer + local integer t= s__TreeMapping__allocate() + set s__TreeMapping_summerId[t]=summerId + set s__TreeMapping_fallId[t]=fallId + set s__TreeMapping_winterId[t]=winterId + set s__TreeMapping_winterSnowyId[t]=winterSnowyId + set s__TreeMapping_easterId[t]=easterId + set s__TreeMapping_christmasId[t]=christmasId + + call SaveInteger(WoWReforgedCalendar___h, summerId, 0, t) + call SaveInteger(WoWReforgedCalendar___h, fallId, 0, t) + call SaveInteger(WoWReforgedCalendar___h, winterId, 0, t) + call SaveInteger(WoWReforgedCalendar___h, winterSnowyId, 0, t) + call SaveInteger(WoWReforgedCalendar___h, easterId, 0, t) + call SaveInteger(WoWReforgedCalendar___h, christmasId, 0, t) + + return t +endfunction + +function GetTreeMappingById takes integer id returns integer + if ( HaveSavedInteger(WoWReforgedCalendar___h, id, 0) ) then + return LoadInteger(WoWReforgedCalendar___h, id, 0) + endif + return 0 +endfunction + +function AddTileMapping takes integer summerId,integer fallId,integer winterId returns integer + local integer t= s__TileMapping__allocate() + set s__TileMapping_summerId[t]=summerId + set s__TileMapping_fallId[t]=fallId + set s__TileMapping_winterId[t]=winterId + set WoWReforgedCalendar___tileMappings[WoWReforgedCalendar___tileMappingsCounter]=t + set WoWReforgedCalendar___tileMappingsCounter=WoWReforgedCalendar___tileMappingsCounter + 1 + + call SaveInteger(WoWReforgedCalendar___h, summerId, 0, t) + call SaveInteger(WoWReforgedCalendar___h, fallId, 0, t) + call SaveInteger(WoWReforgedCalendar___h, winterId, 0, t) + + return t +endfunction + +function GetTileMappingById takes integer id returns integer + return LoadInteger(WoWReforgedCalendar___h, id, 0) +endfunction + +function GetCurrentWeatherIcon takes nothing returns string + if ( WoWReforgedCalendar___weatherRunning ) then + return "ReplaceableTextures\\CommandButtons\\BTNRainyWeather.blp" + endif + return "ReplaceableTextures\\CommandButtons\\BTNOrbOfTheSun.blp" +endfunction + +function GetCurrentWeatherName takes nothing returns string + if ( WoWReforgedCalendar___weatherRunning ) then + return "Bad" + endif + return "Good" +endfunction + +function GetSeasonName takes integer s returns string + if ( s == SEASON_SUMMER ) then + return "Summer" + elseif ( s == SEASON_SPRING ) then + return "Spring" + elseif ( s == SEASON_FALL ) then + return "Fall" + endif + return "Winter" +endfunction + +function GetSeasonIcon takes integer s returns string + if ( s == SEASON_SUMMER ) then + return "ReplaceableTextures\\CommandButtons\\BTNOrbOfTheSun.blp" + elseif ( s == SEASON_SPRING ) then + return "ReplaceableTextures\\CommandButtons\\BTNFlower1.blp" + elseif ( s == SEASON_FALL ) then + return "ReplaceableTextures\\CommandButtons\\BTNEntangled Gold Mine (Fall).blp" + endif + return "ReplaceableTextures\\CommandButtons\\BTNSnowFlake.blp" +endfunction + +function GetCurrentSeason takes nothing returns integer + return WoWReforgedCalendar___season +endfunction + +function GetPassedTime takes nothing returns integer + return udg_GameTime +endfunction + +function GetCurrentDay takes nothing returns integer + return WoWReforgedCalendar___days +endfunction + +function GetCurrentYear takes nothing returns integer + return WoWReforgedCalendar___years +endfunction + +function GetCurrentMonth takes nothing returns integer + return WoWReforgedCalendar___days / DAYS_PER_MONTH + 1 +endfunction + +function GetDayByMonth takes integer day,integer month returns integer + return day + ( month - 1 ) * DAYS_PER_MONTH +endfunction + +function GetMonthName takes integer month returns string + if ( month == JANUARY ) then + return "January" + elseif ( month == FEBRUARY ) then + return "February" + elseif ( month == MARCH ) then + return "March" + elseif ( month == APRIL ) then + return "April" + elseif ( month == MAY ) then + return "May" + elseif ( month == JUNE ) then + return "June" + elseif ( month == JULY ) then + return "July" + elseif ( month == AUGUST ) then + return "August" + elseif ( month == SEPTEMBER ) then + return "September" + elseif ( month == OCTOBER ) then + return "October" + elseif ( month == NOVEMBER ) then + return "November" + elseif ( month == DECEMBER ) then + return "December" + endif + + return "Unknown" +endfunction + +function GetCurrentDate takes nothing returns string + return I2S((WoWReforgedCalendar___years)) + "-" + I2SW((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar___days) , 2) // INLINED!! +endfunction + +function GetTimeText takes nothing returns string + return (I2S((WoWReforgedCalendar___years)) + "-" + I2SW((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar___days) , 2)) + "\nMonth: " + GetMonthName((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1)) + "\nSeason: " + GetSeasonName((WoWReforgedCalendar___season)) + "\nTime of Day: " + (FormatTimeOfDayEx(GetTimeOfDay())) + "\nTotal passed time: " + FormatTimeString((udg_GameTime)) + "\nWeather Report: Rain/Snow/Storm in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar___weatherTimer))) + " and thunder/lightning in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar___thunderTimer))) // INLINED!! +endfunction + +function DisplayTime takes player whichPlayer returns nothing + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, ((I2S((WoWReforgedCalendar___years)) + "-" + I2SW((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar___days) , 2)) + "\nMonth: " + GetMonthName((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1)) + "\nSeason: " + GetSeasonName((WoWReforgedCalendar___season)) + "\nTime of Day: " + (FormatTimeOfDayEx(GetTimeOfDay())) + "\nTotal passed time: " + FormatTimeString((udg_GameTime)) + "\nWeather Report: Rain/Snow/Storm in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar___weatherTimer))) + " and thunder/lightning in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar___thunderTimer))))) // INLINED!! +endfunction + + +function WoWReforgedCalendar___FilterIsTree takes nothing returns boolean + return GetTreeMappingById(GetDestructableTypeId(GetFilterDestructable())) != 0 +endfunction + +function WoWReforgedCalendar___ReplaceTreeEx takes destructable d,integer t returns nothing + local real x= GetDestructableX(d) + local real y= GetDestructableY(d) + local real life= GetDestructableLife(d) + local integer targetId= s__TreeMapping_summerId[t] + if ( WoWReforgedCalendar___easterTrees ) then + set targetId=s__TreeMapping_easterId[t] + elseif ( WoWReforgedCalendar___christmasTrees ) then + set targetId=s__TreeMapping_christmasId[t] + elseif ( WoWReforgedCalendar___targetSeason == SEASON_SUMMER ) then + set targetId=s__TreeMapping_summerId[t] + elseif ( WoWReforgedCalendar___targetSeason == SEASON_FALL ) then + set targetId=s__TreeMapping_fallId[t] + elseif ( WoWReforgedCalendar___targetSeason == SEASON_WINTER ) then + if ( WoWReforgedCalendar___weatherRunning ) then + set targetId=s__TreeMapping_winterSnowyId[t] + else + set targetId=s__TreeMapping_winterId[t] + endif + elseif ( WoWReforgedCalendar___targetSeason == SEASON_SPRING ) then + set targetId=s__TreeMapping_summerId[t] + endif + if ( targetId != 0 ) then + call RemoveDestructable(d) + set d=null + set d=CreateDestructable(targetId, x, y, GetRandomDirectionDeg(), 1.0, 0) + call SetDestructableLife(d, life) + set d=null + endif +endfunction + +function WoWReforgedCalendar___ReplaceTree takes nothing returns nothing + local destructable d= GetEnumDestructable() + local integer t= GetTreeMappingById(GetDestructableTypeId(d)) + if ( t != 0 ) then + call WoWReforgedCalendar___ReplaceTreeEx(d , t) + endif + set d=null +endfunction + +function WoWReforgedCalendar___ReplaceTreeNewOpLimit takes nothing returns nothing + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceTree)) // INLINED!! +endfunction + +function WoWReforgedCalendar___ReplaceTrees takes rect r,integer source,integer target returns nothing + set WoWReforgedCalendar___sourceSeason=source + set WoWReforgedCalendar___targetSeason=target + call EnumDestructablesInRect(r, WoWReforgedCalendar___treeFilter, function WoWReforgedCalendar___ReplaceTreeNewOpLimit) +endfunction + +function WoWReforgedCalendar___ReplaceAffectedWithTrees takes integer source,integer target returns nothing + local integer z= 0 + local integer t= TERRAIN_TYPE_NONE + local integer j= 0 + local integer max2= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i >= max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + set t=(s__Zone_terrainType[(z)]) // INLINED!! + if ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) then + //call BJDebugMsg(GetZoneName(z) + " has terrain Lordaeron with rects counter " + I2S(GetZoneRectsCounter(z))) + set j=0 + set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! + loop + exitwhen ( j >= max2 ) + call WoWReforgedCalendar___ReplaceTrees((s___Zone_rects[s__Zone_rects[(z )]+( j)]) , source , target) // INLINED!! + set j=j + 1 + endloop + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedCalendar___ReplaceWithWinterTrees takes nothing returns nothing + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , SEASON_WINTER) +endfunction + +function WoWReforgedCalendar___ReplaceWithSummerTrees takes nothing returns nothing + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , SEASON_SUMMER) +endfunction + +function WoWReforgedCalendar___ReplaceWithFallTrees takes nothing returns nothing + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , SEASON_FALL) +endfunction + +function WoWReforgedCalendar___GetEffectIndex takes integer zoneIndex,integer rectIndex returns integer + return Index2D(zoneIndex , rectIndex , MAX_ZONE_RECTS) +endfunction + +function WoWReforgedCalendar___HasWeather takes integer t returns boolean + return t != TERRAIN_TYPE_NONE +endfunction + +function WoWReforgedCalendar___GetRandomWeatherEffect takes integer t returns integer + if ( t == TERRAIN_TYPE_ASHENVALE ) then + if ( (WoWReforgedCalendar___season) == SEASON_WINTER ) then // INLINED!! + return GetRandomSnowWeatherEffect() + else + return GetRandomAshenvaleRainWeatherEffect() + endif + elseif ( t == TERRAIN_TYPE_LORDAERON ) then + if ( (WoWReforgedCalendar___season) == SEASON_WINTER ) then // INLINED!! + return GetRandomSnowWeatherEffect() + else + return GetRandomLordaeronRainWeatherEffect() + endif + elseif ( t == TERRAIN_TYPE_NORTHREND ) then + return GetRandomSnowWeatherEffect() + elseif ( t == TERRAIN_TYPE_BARRENS ) then + return WIND_HEAVY + elseif ( t == TERRAIN_TYPE_OUTLAND ) then + return GetRandomOutlandWindWeatherEffect() + elseif ( t == TERRAIN_TYPE_SUNKEN_RUINS ) then + return GetRandomAshenvaleRainWeatherEffect() + elseif ( t == TERRAIN_TYPE_SEA ) then + return GetRandomSeaWeatherEffect() + elseif ( t == TERRAIN_TYPE_DUNGEON ) then + return GetRandomDungeonWhiteFogEffect() + endif + + return 0 +endfunction + +function WoWReforgedCalendar___ForForceAddWeatherResourceBonus takes nothing returns nothing + call AddPlayerResourceBonus(GetEnumPlayer() , udg_ResourceWater , 20) +endfunction + +function WoWReforgedCalendar___ForForceRemoveWeatherResourceBonus takes nothing returns nothing + call RemovePlayerResourceBonus(GetEnumPlayer() , udg_ResourceWater , 20) +endfunction + +function WoWReforgedCalendar___AddWeatherResourceBonus takes nothing returns nothing + call ForForce(GetPlayersAll(), function WoWReforgedCalendar___ForForceAddWeatherResourceBonus) +endfunction + +function WoWReforgedCalendar___RemoveWeatherResourceBonus takes nothing returns nothing + call ForForce(GetPlayersAll(), function WoWReforgedCalendar___ForForceRemoveWeatherResourceBonus) +endfunction + +function WoWReforgedCalendar___EnumUnitFillWater takes nothing returns nothing + call SetUnitResource(GetEnumUnit() , udg_ResourceWater , (LoadInteger(Resources___h, GetHandleId((GetEnumUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX)))) // INLINED!! +endfunction + +function WoWReforgedCalendar___RainAddResourceBonus takes rect r returns nothing + local group g= CreateGroup() + call GroupEnumUnitsInRect(g, r, WoWReforgedCalendar___filterIsMineWithResourceWaterNotFull) + call ForGroup(g, function WoWReforgedCalendar___EnumUnitFillWater) + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function WoWReforgedCalendar___RemoveWeatherEffects takes nothing returns nothing + local integer z= 0 + local integer t= TERRAIN_TYPE_NONE + local integer j= 0 + local integer max2= 0 + local integer index= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer i= 0 + if ( WoWReforgedCalendar___weatherRunning ) then + call ForForce(GetPlayersAll(), function WoWReforgedCalendar___ForForceRemoveWeatherResourceBonus) // INLINED!! + set WoWReforgedCalendar___weatherRunning=false + endif + loop + exitwhen ( i >= max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + set t=(s__Zone_terrainType[(z)]) // INLINED!! + set j=0 + set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! + loop + exitwhen ( j >= max2 ) + set index=(Index2D((i ) , ( j) , MAX_ZONE_RECTS)) // INLINED!! + if ( WoWReforgedCalendar___weather[index] != null ) then + call EnableWeatherEffect(WoWReforgedCalendar___weather[index], false) + call RemoveWeatherEffect(WoWReforgedCalendar___weather[index]) + set WoWReforgedCalendar___weather[index]=null + set WoWReforgedCalendar___weatherEffectIds[index]=0 + call RegionClearRect(WoWReforgedCalendar___rainyRegion, (s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! + endif + if ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) then + call WoWReforgedCalendar___ReplaceTrees((s___Zone_rects[s__Zone_rects[(z )]+( j)]) , (WoWReforgedCalendar___season) , (WoWReforgedCalendar___season)) // INLINED!! + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function WoWReforgedCalendar___AddWeatherEffects takes nothing returns nothing + local integer z= 0 + local integer t= TERRAIN_TYPE_NONE + local integer j= 0 + local integer max2= 0 + local integer index= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer i= 0 + if ( not WoWReforgedCalendar___weatherRunning ) then + call ForForce(GetPlayersAll(), function WoWReforgedCalendar___ForForceAddWeatherResourceBonus) // INLINED!! + set WoWReforgedCalendar___weatherRunning=true + endif + loop + exitwhen ( i >= max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + set t=(s__Zone_terrainType[(z)]) // INLINED!! + if ( ((t) != TERRAIN_TYPE_NONE) ) then // INLINED!! + set j=0 + set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! + loop + exitwhen ( j >= max2 ) + set index=(Index2D((i ) , ( j) , MAX_ZONE_RECTS)) // INLINED!! + if ( WoWReforgedCalendar___weather[index] != null ) then + call EnableWeatherEffect(WoWReforgedCalendar___weather[index], false) + call RemoveWeatherEffect(WoWReforgedCalendar___weather[index]) + set WoWReforgedCalendar___weather[index]=null + set WoWReforgedCalendar___weatherEffectIds[index]=0 + call RegionClearRect(WoWReforgedCalendar___rainyRegion, (s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! + endif + set WoWReforgedCalendar___weatherEffectIds[index]=WoWReforgedCalendar___GetRandomWeatherEffect(t) + if ( WoWReforgedCalendar___weatherEffectIds[index] != 0 ) then + set WoWReforgedCalendar___weather[index]=AddWeatherEffect((s___Zone_rects[s__Zone_rects[(z )]+( j)]), WoWReforgedCalendar___weatherEffectIds[index]) // INLINED!! + call EnableWeatherEffect(WoWReforgedCalendar___weather[index], true) + call RegionAddRect(WoWReforgedCalendar___rainyRegion, (s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! + + if ( IsRainWeatherEffect(WoWReforgedCalendar___weatherEffectIds[index]) ) then + call WoWReforgedCalendar___RainAddResourceBonus((s___Zone_rects[s__Zone_rects[(z )]+( j)])) // INLINED!! + endif + endif + + if ( ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) and (WoWReforgedCalendar___season) == SEASON_WINTER ) then // INLINED!! + call WoWReforgedCalendar___ReplaceTrees((s___Zone_rects[s__Zone_rects[(z )]+( j)]) , SEASON_WINTER , SEASON_WINTER) // INLINED!! + endif + set j=j + 1 + endloop + endif + set i=i + 1 + endloop +endfunction + +function IsCameraInRainyArea takes nothing returns boolean + return IsPointInRegion(WoWReforgedCalendar___rainyRegion, GetCameraTargetPositionX(), GetCameraTargetPositionY()) // async +endfunction + +function Lightning takes nothing returns nothing + if ( (IsPointInRegion(WoWReforgedCalendar___rainyRegion, GetCameraTargetPositionX(), GetCameraTargetPositionY())) ) then // async // INLINED!! + //call PlaySound("Sound\\Doodads\\Cinematic\\Lightningbolt\\LightningBolt1.flac") + // call PlaySound("Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.flac") + call StartSound(gg_snd_LightningBoltWeather) + call CinematicFilterGenericBJ(1.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 100.0) + //call BJDebugMsg("Lightning") + endif +endfunction + +function Thunder takes nothing returns nothing + if ( (IsPointInRegion(WoWReforgedCalendar___rainyRegion, GetCameraTargetPositionX(), GetCameraTargetPositionY())) ) then // async // INLINED!! + call StartSound(gg_snd_RollingThunder1) + //call PlaySound("Sound\\Ambient\\DoodadEffects\\RollingThunder1.flac") + //call BJDebugMsg("Thunder") + endif +endfunction + +function WoWReforgedCalendar___TimerFunctionThunder takes nothing returns nothing + if ( GetRandomInt(0, 1) == 0 ) then + call Thunder() + else + call Lightning() + endif +endfunction + +function WoWReforgedCalendar___StopThunder takes nothing returns nothing + call PauseTimer(WoWReforgedCalendar___thunderTimer) +endfunction + +function WoWReforgedCalendar___StartThunder takes nothing returns nothing + call TimerStart(WoWReforgedCalendar___thunderTimer, GetRandomReal(MIN_THUNDER_DURATION, MAX_THUNDER_DURATION), true, function WoWReforgedCalendar___TimerFunctionThunder) +endfunction + +function WoWReforgedCalendar___TimerFunctionEndWeather takes nothing returns nothing + //call NewOpLimit(function RemoveWeatherEffects) + call PauseTimer(WoWReforgedCalendar___thunderTimer) // INLINED!! +endfunction + +function WoWReforgedCalendar___EndWeather takes nothing returns nothing + call TimerStart(WoWReforgedCalendar___weatherTimer, GetRandomReal(MIN_WEATHER_DURATION, MAX_WEATHER_DURATION), false, function WoWReforgedCalendar___TimerFunctionEndWeather) +endfunction + +function WoWReforgedCalendar___TimerFunctionStartWeather takes nothing returns nothing + //call NewOpLimit(function AddWeatherEffects) + call TimerStart(WoWReforgedCalendar___thunderTimer, GetRandomReal(MIN_THUNDER_DURATION, MAX_THUNDER_DURATION), true, function WoWReforgedCalendar___TimerFunctionThunder) // INLINED!! + call TimerStart(WoWReforgedCalendar___weatherTimer, GetRandomReal(MIN_WEATHER_DURATION, MAX_WEATHER_DURATION), false, function WoWReforgedCalendar___TimerFunctionEndWeather) // INLINED!! +endfunction + +function StartWeather takes nothing returns nothing + call TimerStart(WoWReforgedCalendar___weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar___TimerFunctionStartWeather) +endfunction + +function StartWeatherImmediately takes nothing returns nothing + call TimerStart(WoWReforgedCalendar___weatherTimer, 0.0, false, function WoWReforgedCalendar___TimerFunctionStartWeather) +endfunction + +function StopWeather takes nothing returns nothing + call PauseTimer(WoWReforgedCalendar___weatherTimer) + call PauseTimer(WoWReforgedCalendar___thunderTimer) + call PauseTimer(WoWReforgedCalendar___thunderTimer) // INLINED!! +endfunction + +function WoWReforgedCalendar___ReplaceWithTerrain takes rect whichRect,integer source,integer target returns nothing + local real x= GetRectMinX(whichRect) + local real y= 0.0 + local real maxX= GetRectMaxX(whichRect) + local real maxY= GetRectMaxY(whichRect) + local integer t= 0 + local integer targetId= 0 + loop + exitwhen ( x >= maxX ) + set y=GetRectMinY(whichRect) + //call BJDebugMsg("ReplaceWithTerrain 2") + loop + exitwhen ( y >= maxY ) + set t=(LoadInteger(WoWReforgedCalendar___h, (GetTerrainType(x, y)), 0)) // INLINED!! + //call BJDebugMsg("ReplaceWithTerrain 3") + if ( t != 0 ) then + if ( target == SEASON_WINTER ) then + set targetId=s__TileMapping_winterId[t] + elseif ( target == SEASON_SUMMER ) then + set targetId=s__TileMapping_summerId[t] + elseif ( target == SEASON_SPRING ) then + set targetId=s__TileMapping_summerId[t] + elseif ( target == SEASON_FALL ) then + set targetId=s__TileMapping_fallId[t] + endif + call SetTerrainType(x, y, targetId, GetTerrainVariance(x, y), 1, 0) + //call BJDebugMsg("ReplaceWithTerrain 4") + endif + //call BJDebugMsg("ReplaceWithTerrain 5") + set y=y + bj_CELLWIDTH + endloop + set x=x + bj_CELLWIDTH + endloop +endfunction + +function WoWReforgedCalendar___ReplaceWithTerrainNewOpLmit takes nothing returns nothing + call WoWReforgedCalendar___ReplaceWithTerrain(udg_TmpRect , WoWReforgedCalendar___sourceSeason , WoWReforgedCalendar___targetSeason) +endfunction + +function WoWReforgedCalendar___ReplaceAffectedWithTerrain takes integer source,integer target returns nothing + local integer z= 0 + local integer t= TERRAIN_TYPE_NONE + local integer j= 0 + local integer max2= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer i= 0 + loop + exitwhen ( i >= max ) + set z=(WoWReforgedZones___zones[(i)]) // INLINED!! + set t=(s__Zone_terrainType[(z)]) // INLINED!! + if ( t == TERRAIN_TYPE_LORDAERON or t == TERRAIN_TYPE_ASHENVALE ) then + set j=0 + set max2=(s__Zone_rectsCounter[(z)]) // INLINED!! + loop + exitwhen ( j >= max2 ) + set udg_TmpRect=(s___Zone_rects[s__Zone_rects[(z )]+( j)]) // INLINED!! + set WoWReforgedCalendar___sourceSeason=source + set WoWReforgedCalendar___targetSeason=target + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithTerrainNewOpLmit)) // INLINED!! + set j=j + 1 + endloop + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedCalendar___ReplaceWithWinterTerrain takes nothing returns nothing + call WoWReforgedCalendar___ReplaceAffectedWithTerrain((WoWReforgedCalendar___season) , SEASON_WINTER) // INLINED!! +endfunction + +function WoWReforgedCalendar___ReplaceWithSummerTerrain takes nothing returns nothing + call WoWReforgedCalendar___ReplaceAffectedWithTerrain((WoWReforgedCalendar___season) , SEASON_SUMMER) // INLINED!! +endfunction + +function WoWReforgedCalendar___ReplaceWithFallTerrain takes nothing returns nothing + call WoWReforgedCalendar___ReplaceAffectedWithTerrain((WoWReforgedCalendar___season) , SEASON_FALL) // INLINED!! +endfunction + +function WoWReforgedCalendar___ForForceAddFallResourceBonus takes nothing returns nothing + call AddPlayerResourceBonus(GetEnumPlayer() , udg_ResourceGrain , 20) +endfunction + +function WoWReforgedCalendar___ForForceRemoveFallResourceBonus takes nothing returns nothing + call RemovePlayerResourceBonus(GetEnumPlayer() , udg_ResourceGrain , 20) +endfunction + +function WoWReforgedCalendar___ResourceBonus takes integer previousSeason,integer currentSeason returns nothing + if ( previousSeason == SEASON_FALL ) then + call ForForce(GetPlayersAll(), function WoWReforgedCalendar___ForForceRemoveFallResourceBonus) + elseif ( currentSeason == SEASON_FALL ) then + call ForForce(GetPlayersAll(), function WoWReforgedCalendar___ForForceAddFallResourceBonus) + endif +endfunction + +function Winter takes nothing returns nothing + call SetSkyModel("Environment\\Sky\\LordaeronWinterSky\\LordaeronWinterSky.mdl") + call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithWinterTerrain)) // INLINED!! + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithWinterTrees)) // INLINED!! + call WoWReforgedCalendar___ResourceBonus((WoWReforgedCalendar___season) , SEASON_WINTER) // INLINED!! + set WoWReforgedCalendar___season=SEASON_WINTER + call StopWeather() + call TimerStart(WoWReforgedCalendar___weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar___TimerFunctionStartWeather) // INLINED!! +endfunction + +function Summer takes nothing returns nothing + call SetSkyModel("Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl") + call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithSummerTerrain)) // INLINED!! + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithSummerTrees)) // INLINED!! + call WoWReforgedCalendar___ResourceBonus((WoWReforgedCalendar___season) , SEASON_SUMMER) // INLINED!! + set WoWReforgedCalendar___season=SEASON_SUMMER + call StopWeather() + call TimerStart(WoWReforgedCalendar___weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar___TimerFunctionStartWeather) // INLINED!! +endfunction + +function Spring takes nothing returns nothing + call SetSkyModel("Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl") + call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithSummerTerrain)) // INLINED!! + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithSummerTrees)) // INLINED!! + call WoWReforgedCalendar___ResourceBonus((WoWReforgedCalendar___season) , SEASON_SPRING) // INLINED!! + set WoWReforgedCalendar___season=SEASON_SPRING + call StopWeather() + call TimerStart(WoWReforgedCalendar___weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar___TimerFunctionStartWeather) // INLINED!! +endfunction + +function Fall takes nothing returns nothing + call SetSkyModel("Environment\\Sky\\LordaeronSummerSky\\LordaeronFallSky.mdl") + call SetTerrainFogEx(0, 1000, 8000, 0, 1, 1, 1) + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithFallTerrain)) // INLINED!! + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar___ReplaceWithFallTrees)) // INLINED!! + call WoWReforgedCalendar___ResourceBonus((WoWReforgedCalendar___season) , SEASON_FALL) // INLINED!! + set WoWReforgedCalendar___season=SEASON_FALL + call StopWeather() + call TimerStart(WoWReforgedCalendar___weatherTimer, GetRandomReal(MIN_NO_WEATHER_DURATION, MAX_NO_WEATHER_DURATION), false, function WoWReforgedCalendar___TimerFunctionStartWeather) // INLINED!! +endfunction + +function IsSeasonsEnabled takes nothing returns boolean + return WoWReforgedCalendar___seasonsEnabled +endfunction + +function HappyNewYear takes nothing returns nothing + call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_ITEMACQUIRED, "Happy new year for the year " + I2S((WoWReforgedCalendar___years)) + "!") // INLINED!! +endfunction + +function WeatherPrediction takes player whichPlayer returns nothing + local string msg= "" + if ( WoWReforgedCalendar___weatherRunning ) then + set msg="Snowfall/Storm/Rain with thunder in " + FormatTime(TimerGetRemaining(WoWReforgedCalendar___thunderTimer)) + set msg=msg + " ending in " + FormatTime(TimerGetRemaining(WoWReforgedCalendar___weatherTimer)) + else + set msg="Next Snowfall/Storm/Rain in " + FormatTime(TimerGetRemaining(WoWReforgedCalendar___weatherTimer)) + endif + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, msg) +endfunction + +function WoWReforgedCalendar___TriggerConditionTimeOfDay takes nothing returns boolean + if ( WoWReforgedCalendar___days == DAYS_PER_YEAR ) then + set WoWReforgedCalendar___days=1 + set WoWReforgedCalendar___years=WoWReforgedCalendar___years + 1 + + call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_ITEMACQUIRED, "Happy new year for the year " + I2S((WoWReforgedCalendar___years)) + "!") // INLINED!! + else + set WoWReforgedCalendar___days=WoWReforgedCalendar___days + 1 + endif + + if ( (WoWReforgedCalendar___seasonsEnabled) ) then // INLINED!! + if ( WoWReforgedCalendar___days == SUMMER_DAY ) then + set WoWReforgedCalendar___season=SEASON_SUMMER + call Summer() + elseif ( WoWReforgedCalendar___days == SPRING_DAY ) then + set WoWReforgedCalendar___season=SEASON_SPRING + call Spring() + elseif ( WoWReforgedCalendar___days == FALL_DAY ) then + set WoWReforgedCalendar___season=SEASON_FALL + call Fall() + elseif ( WoWReforgedCalendar___days == WINTER_DAY ) then + set WoWReforgedCalendar___season=SEASON_WINTER + call Winter() + endif + endif + + return false +endfunction + +function StartCurrentSeason takes nothing returns nothing + if ( WoWReforgedCalendar___days >= FALL_DAY ) then + set WoWReforgedCalendar___season=SEASON_FALL + call Fall() + elseif ( WoWReforgedCalendar___days >= SUMMER_DAY ) then + set WoWReforgedCalendar___season=SEASON_SUMMER + call Summer() + elseif ( WoWReforgedCalendar___days >= SPRING_DAY ) then + set WoWReforgedCalendar___season=SEASON_SPRING + call Spring() + else + set WoWReforgedCalendar___season=SEASON_WINTER + call Winter() + endif +endfunction + +function EnableCalendar takes nothing returns nothing + call EnableTrigger(WoWReforgedCalendar___changeDayTrigger) + call TimerStart(WoWReforgedCalendar___changeSecondTimer, 0.01, true, function WoWReforgedCalendar___CheckCalendarEvents) + call StartCurrentSeason() +endfunction + +function DisableCalendar takes nothing returns nothing + call DisableTrigger(WoWReforgedCalendar___changeDayTrigger) + call PauseTimer(WoWReforgedCalendar___changeSecondTimer) + call PauseTimer(WoWReforgedCalendar___weatherTimer) + call PauseTimer(WoWReforgedCalendar___thunderTimer) +endfunction + +function EnableSeasons takes nothing returns nothing + set WoWReforgedCalendar___seasonsEnabled=true + call EnableCalendar() +endfunction + +function DisableSeasons takes nothing returns nothing + set WoWReforgedCalendar___seasonsEnabled=false + call DisableCalendar() +endfunction + +function WoWReforgedCalendar___TimerFunctionStartSeason takes nothing returns nothing + call StartCurrentSeason() + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function WoWReforgedCalendar___StartEaster takes integer e returns nothing + set WoWReforgedCalendar___easterTrees=true + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) + call PlaySoundBJ(gg_snd_EasterIntro) +endfunction + +function WoWReforgedCalendar___EndEaster takes integer e returns nothing + set WoWReforgedCalendar___easterTrees=false + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) +endfunction + +function WoWReforgedCalendar___StartChristmas takes integer e returns nothing + set WoWReforgedCalendar___christmasTrees=true + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) +endfunction + +function WoWReforgedCalendar___EndChristmas takes integer e returns nothing + set WoWReforgedCalendar___christmasTrees=false + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) +endfunction + +function WoWReforgedCalendar___StartNewYear takes integer e returns nothing + local integer index= 0 + local integer zone= 0 + local integer i= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer j= 0 + local integer max2= 0 + loop + exitwhen ( i == max ) + set zone=(WoWReforgedZones___zones[(i)]) // INLINED!! + set max2=(s__Zone_rectsCounter[(zone)]) // INLINED!! + set j=0 + loop + exitwhen ( j == max2 ) + set index=Index2D(i , j , MAX_ZONE_RECTS) + set WoWReforgedCalendar___newYearEffects[index]=AddSpecialEffect("war3mapImported\\Firework3.mdx", GetRectCenterX((s___Zone_rects[s__Zone_rects[(zone )]+( j)])), GetRectCenterY((s___Zone_rects[s__Zone_rects[(zone )]+( j)]))) // INLINED!! + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function WoWReforgedCalendar___EndNewYear takes integer e returns nothing + local integer index= 0 + local integer zone= 0 + local integer i= 0 + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! + local integer j= 0 + local integer max2= 0 + loop + exitwhen ( i == max ) + set zone=(WoWReforgedZones___zones[(i)]) // INLINED!! + set max2=(s__Zone_rectsCounter[(zone)]) // INLINED!! + set j=0 + loop + exitwhen ( j == max2 ) + set index=Index2D(i , j , MAX_ZONE_RECTS) + if ( WoWReforgedCalendar___newYearEffects[index] != null ) then + call DestroyEffect(WoWReforgedCalendar___newYearEffects[index]) + set WoWReforgedCalendar___newYearEffects[index]=null + endif + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + + +function WoWReforgedCalendar___IsMineWithResourceWaterNotFull takes nothing returns boolean + return (IsUnitInGroup((GetFilterUnit()), Resources___mines)) and (LoadInteger(Resources___h, GetHandleId((GetFilterUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) > 0 and (LoadInteger(Resources___h, GetHandleId((GetFilterUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_RESOURCE , Resources___KEY_MAX))) < (LoadInteger(Resources___h, GetHandleId((GetFilterUnit() )), Resources___Index2D(( udg_ResourceWater) , Resources___KEY_MAX_RESOURCE , Resources___KEY_MAX))) // INLINED!! +endfunction + +function WoWReforgedCalendar___Init takes nothing returns nothing + set WoWReforgedCalendar___rainyRegion=CreateRegion() + + call TriggerRegisterGameStateEventTimeOfDay(WoWReforgedCalendar___changeDayTrigger, EQUAL, 0.0) + call TriggerAddCondition(WoWReforgedCalendar___changeDayTrigger, Condition(function WoWReforgedCalendar___TriggerConditionTimeOfDay)) + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedCalendar___TimerFunctionStartSeason) + call TimerStart(WoWReforgedCalendar___changeSecondTimer, 0.01, true, function WoWReforgedCalendar___CheckCalendarEvents) + + set WoWReforgedCalendar___treeFilter=Filter(function WoWReforgedCalendar___FilterIsTree) + + set WoWReforgedCalendar___filterIsMineWithResourceWaterNotFull=Filter(function WoWReforgedCalendar___IsMineWithResourceWaterNotFull) + + call AddTreeMapping(SUMMER_TREE_WALL , FALL_TREE_WALL , WINTER_TREE_WALL , SNOWY_TREE_WALL , EASTERN_TREE_WALL_1 , CHRISTMAS_TREE_WALL) + call AddTreeMapping(CITYSCAPE_SUMMER_TREE_WALL , CITYSCAPE_FALL_TREE_WALL , CITYSCAPE_WINTER_TREE_WALL , CITYSCAPE_SNOWY_TREE_WALL , CARROT_TREE_WALL_1 , CITYSCAPE_CHRISTMAS_TREE_WALL) + call AddTreeMapping(VILLAGE_TREE_WALL , VILLAGE_TREE_WALL_FALL , VILLAGE_TREE_WALL_WINTER , VILLAGE_SNOWY_TREE_WALL , CARROT_TREE_WALL_1 , CITYSCAPE_CHRISTMAS_TREE_WALL) + call AddTreeMapping(ASHENVALE_TREE_WALL , ASHENVALE_TREE_WALL_FALL , ASHENVALE_TREE_WALL_WINTER , ASHENVALE_SNOWY_TREE_WALL , CARROT_TREE_WALL_2 , ASHENVALE_CHRISTMAS_TREE_WALL) + call AddTreeMapping(ASHENVALE_CANOPY_TREE , ASHENVALE_CANOPY_TREE_FALL , ASHENVALE_CANOPY_TREE_WINTER , ASHENVALE_CANOPY_TREE_WINTER , CARROT_TREE_WALL_2 , ASHENVALE_CANOPY_CHRISTMAS_TREE_WALL) + call AddTreeMapping(AZUREMYST_ISLES_TREE_WALL , AZUREMYST_ISLES_TREE_WALL_FALL , AZUREMYST_ISLES_TREE_WALL_WINTER , AZUREMYST_ISLES_TREE_WALL_WINTER , CARROT_TREE_WALL_1 , AZUREMYST_ISLES_CHRISTMAS_TREE_WALL) + call AddTreeMapping(CRANNIES_SUMMER , CRANNIES_FALL , CRANNIES_WINTER , CRANNIES_WINTER_SNOWY , 0 , 0) + + call AddTileMapping(TILE_TYPE_GRASS , TILE_TYPE_DARK_GRASS , TILE_TYPE_SNOW) + + set easter=AddCalendarEvent("Easter" , "-easter" , ((22 ) + ( ( MARCH) - 1 ) * DAYS_PER_MONTH) , 0.0 , ((25 ) + ( ( APRIL) - 1 ) * DAYS_PER_MONTH) , 24.0 , (1) , (2) , "ReplaceableTextures\\CommandButtons\\BTNEasterWabbit.blp") // INLINED!! + set christmas=AddCalendarEvent("Christmas" , "-christmas" , ((24 ) + ( ( DECEMBER) - 1 ) * DAYS_PER_MONTH) , 22.0 , ((26 ) + ( ( DECEMBER) - 1 ) * DAYS_PER_MONTH) , 24.0 , (3) , (4) , "ReplaceableTextures\\CommandButtons\\BTNSanta.blp") // INLINED!! + set newyear=AddCalendarEvent("New Year" , "-newyear" , ((30 ) + ( ( DECEMBER) - 1 ) * DAYS_PER_MONTH) , 22.0 , ((1 ) + ( ( JANUARY) - 1 ) * DAYS_PER_MONTH) , 3.0 , (5) , (6) , "ReplaceableTextures\\CommandButtons\\BTNFirework.blp") // INLINED!! + set thanksgiving=AddCalendarEvent("Thanksgiving" , "-thanksgiving" , ((6 ) + ( ( OCTOBER) - 1 ) * DAYS_PER_MONTH) , 0.0 , ((8 ) + ( ( OCTOBER) - 1 ) * DAYS_PER_MONTH) , 24.0 , 0 , 0 , "ReplaceableTextures\\CommandButtons\\BTNWheat.blp") // INLINED!! + set halloween=AddCalendarEvent("Halloween " , "-halloween" , ((30 ) + ( ( OCTOBER) - 1 ) * DAYS_PER_MONTH) , 22.0 , ((1 ) + ( ( NOVEMBER) - 1 ) * DAYS_PER_MONTH) , 3.0 , 0 , 0 , "ReplaceableTextures\\CommandButtons\\BTNPumpkinMonster.blp") // INLINED!! + set carnival=AddCalendarEvent("Carnival" , "-carnival" , ((14 ) + ( ( FEBRUARY) - 1 ) * DAYS_PER_MONTH) , 0.0 , ((4 ) + ( ( MARCH) - 1 ) * DAYS_PER_MONTH) , 24.0 , 0 , 0 , "ReplaceableTextures\\CommandButtons\\BTNMasks.blp") // INLINED!! +endfunction + + +//library WoWReforgedCalendar ends +//library WoWReforgedMassForestation: + + +function WoWReforgedMassForestation___GetMatchingTreeType takes real x,real y returns integer + local integer zone= GetZoneByCoordinates(x , y) + local string name= null + if ( zone != 0 and (s__Zone_treeTypeId[(zone)]) != 0 ) then // INLINED!! + return (s__Zone_treeTypeId[(zone)]) // INLINED!! + endif + + return RUINS_TREE_WALL +endfunction + +function WoWReforgedMassForestation___FilterIsValidEnemyUnit takes nothing returns boolean + if ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) ) then + return false + elseif ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) ) then + return false + elseif ( IsUnitAlly(GetFilterUnit(), WoWReforgedMassForestation___owner) ) then + return false + elseif ( GetUnitAbilityLevel(GetFilterUnit(), 'Avul') > 0 ) then + return false + elseif ( GetUnitLevel(GetFilterUnit()) > WoWReforgedMassForestation___abilityLevel ) then + return false + endif + + return true +endfunction + +function WoWReforgedMassForestation___ForGroupConvertIntoTree takes nothing returns nothing + local unit u= GetEnumUnit() + local real x= GetUnitX(u) + local real y= GetUnitY(u) + local real face= GetUnitFacing(u) + call h__RemoveUnit(u) + set u=null + call QueueDestructableAnimation(CreateDestructable(WoWReforgedMassForestation___GetMatchingTreeType(x , y), x, y, face, 1.0, 0), "birth") +endfunction + +function MassForestation takes unit caster,integer abilityId,real x,real y returns boolean + local group g= CreateGroup() + local boolean result= false + set WoWReforgedMassForestation___owner=GetOwningPlayer(caster) + set WoWReforgedMassForestation___abilityLevel=GetUnitAbilityLevel(caster, abilityId) * 5 + call GroupEnumUnitsInRange(g, x, y, 256.0, Filter(function WoWReforgedMassForestation___FilterIsValidEnemyUnit)) + set WoWReforgedMassForestation___owner=null + set result=BlzGroupGetSize(g) > 0 + if ( result ) then + call ForGroup(g, function WoWReforgedMassForestation___ForGroupConvertIntoTree) + call GroupClear(g) + endif + + call DestroyGroup(g) + set g=null + + return result +endfunction + +function WoWReforgedMassForestation___TriggerConditionCast takes nothing returns boolean + if ( ( GetSpellAbilityId() == WoWReforgedMassForestation_ABILITY_ID or GetSpellAbilityId() == WoWReforgedMassForestation_ABILITY_ID_2 ) and not MassForestation(GetTriggerUnit() , GetSpellAbilityId() , GetSpellTargetX() , GetSpellTargetY()) ) then + call IssueImmediateOrder(GetTriggerUnit(), "stop") + call SimError(GetOwningPlayer(GetTriggerUnit()) , "No valid targets.") + endif + return false +endfunction + +function WoWReforgedMassForestation___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedMassForestation___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(WoWReforgedMassForestation___castTrigger, Condition(function WoWReforgedMassForestation___TriggerConditionCast)) +endfunction + + +//library WoWReforgedMassForestation ends +//library WoWReforgedMaxHpResearch: + +function WoWReforgedMaxHpResearch___Init takes nothing returns nothing + call AddMaxHpResearchAbsolute(UPG_EVOLUTION , 50 , 50) + call AddMaxHpResearchPercentage(UPG_IMPROVED_MASONRY , 0.1 , 0.1) + call AddMaxHpResearchAbsolute(UPG_IMPROVED_MOUNT , 50 , 50) + call AddMaxHpResearchAbsolute(UPG_IMPROVED_HAND_OF_GOD , 200 , 200) + call AddMaxHpResearchPercentage(UPG_IMPROVED_CLAN , 0.1 , 0.1) + call AddMaxHpResearchPercentage(UPG_IMPROVED_CLAN_HALL , 0.1 , 0.1) + call AddMaxHpResearchAbsolute(UPG_OGRE_STRENGTH , 250 , 250) +endfunction + + +//library WoWReforgedMaxHpResearch ends +//library WoWReforgedPings: + + +// Non leaking ping functions: + +function PingUnitForPlayer takes unit whichUnit,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetUnitX(whichUnit), GetUnitY(whichUnit), PING_DURATION) +endfunction + +function PingUnitForPlayerWoWReforged takes nothing returns nothing + call PingUnitForPlayer(udg_TmpUnit , udg_TmpPlayer) +endfunction + +function PingItemForPlayer takes item whichItem,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetItemX(whichItem), GetItemY(whichItem), PING_DURATION) +endfunction + +function PingItemForPlayerWoWReforged takes nothing returns nothing + call PingItemForPlayer(udg_TmpItem , udg_TmpPlayer) +endfunction + +function PingRectForPlayer takes rect whichRect,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetRectCenterX(whichRect), GetRectCenterY(whichRect), PING_DURATION) +endfunction + +function PingRectForPlayerWoWReforged takes nothing returns nothing + call PingRectForPlayer(udg_TmpRect , udg_TmpPlayer) +endfunction + +function PingDestructableForPlayer takes destructable whichDestructable,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetDestructableX(whichDestructable), GetDestructableY(whichDestructable), PING_DURATION) +endfunction + +function PingDestructableForPlayerWoWReforged takes nothing returns nothing + call PingDestructableForPlayer(udg_TmpDestructible , udg_TmpPlayer) +endfunction + +function GetBossPingRed takes unit boss returns integer + if ( GetHeroLevel(boss) >= 75 ) then + return 0 + elseif ( GetHeroLevel(boss) >= 65 ) then + return 255 + endif + + return 0 +endfunction + +function GetBossPingGreen takes unit boss returns integer + if ( GetHeroLevel(boss) >= 65 ) then + return 0 + endif + + return 255 +endfunction + +function GetBossPingBlue takes unit boss returns integer + return 0 +endfunction + +function PingBossForPlayer takes unit boss,player whichPlayer returns nothing + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call PingMinimapEx(GetUnitX(boss), GetUnitY(boss), 4.0, GetBossPingRed(boss), GetBossPingGreen(boss), GetBossPingBlue(boss), false) + //call StartSound(bj_pingMinimapSound) + endif +endfunction + +function PingBosses takes player whichPlayer returns nothing + local integer i= 0 + local integer max= BlzGroupGetSize(udg_Bosses) + loop + exitwhen ( i == max ) + call PingBossForPlayer(BlzGroupUnitAt(udg_Bosses, i) , whichPlayer) + set i=i + 1 + endloop +endfunction + +function WoWReforgedPings___FilterIsFreelancerHero takes nothing returns boolean + return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and GetUnitTypeId(GetFilterUnit()) != EQUIPMENT_BAG and GetUnitTypeId(GetFilterUnit()) != BACKPACK and IsPlayerFreelancer(GetOwningPlayer(GetFilterUnit())) and IsUnitAlly(GetFilterUnit(), WoWReforgedPings___owner) +endfunction + +function GetFreelancerHeroes takes player whichPlayer returns group + local group g= CreateGroup() + set WoWReforgedPings___owner=whichPlayer + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedPings___FilterIsFreelancerHero)) + return g +endfunction + +function PingFreelancerForPlayer takes unit hero,player whichPlayer returns nothing + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call PingMinimapEx(GetUnitX(hero), GetUnitY(hero), 4.0, 0, 255, 0, false) + //call StartSound(bj_pingMinimapSound) + endif +endfunction + +function PingFreelancers takes player whichPlayer returns nothing + local group g= GetFreelancerHeroes(whichPlayer) + local integer i= 0 + local integer max= BlzGroupGetSize(g) + loop + exitwhen ( i == max ) + call PingFreelancerForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) + set i=i + 1 + endloop + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function GetAltars takes player whichPlayer returns group + local group g= CreateGroup() + call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function IsAltarFilter)) + return g +endfunction + +function PingAltarForPlayer takes unit altar,player whichPlayer returns nothing + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call PingMinimapEx(GetUnitX(altar), GetUnitY(altar), 4.0, 0, 255, 0, false) + //call StartSound(bj_pingMinimapSound) + endif +endfunction + +function PingAltars takes player whichPlayer returns nothing + local group g= GetAltars(whichPlayer) + local integer i= 0 + local integer max= BlzGroupGetSize(g) + loop + exitwhen ( i == max ) + call PingAltarForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) + set i=i + 1 + endloop + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function WoWReforgedPings___IsResurrectionStoneFilter takes nothing returns boolean + return (IsResurrectionStone(GetUnitTypeId((GetFilterUnit())))) // INLINED!! +endfunction + +function GetResurrectionStones takes player whichPlayer returns group + local group g= CreateGroup() + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedPings___IsResurrectionStoneFilter)) + return g +endfunction + +function PingResurrectionStoneForPlayer takes unit u,player whichPlayer returns nothing + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call PingMinimapEx(GetUnitX(u), GetUnitY(u), 4.0, 0, 255, 0, false) + //call StartSound(bj_pingMinimapSound) + endif +endfunction + +function PingRacingTrackNextCheckPointForPlayer takes player whichPlayer returns nothing + local unit u= GetPlayerRacingTrackNextCheckPoint(whichPlayer) + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call PingMinimapEx(GetUnitX(u), GetUnitY(u), 4.0, 0, 255, 0, false) + //call StartSound(bj_pingMinimapSound) + endif + set u=null +endfunction + +function PingResurrectionStones takes player whichPlayer returns nothing + local group g= GetResurrectionStones(whichPlayer) + local integer i= 0 + local integer max= BlzGroupGetSize(g) + loop + exitwhen ( i == max ) + call PingResurrectionStoneForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) + set i=i + 1 + endloop + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function WoWReforgedPings___IsNpcFilter takes nothing returns boolean + return (GetNpcIndexByUnitTypeId((GetUnitTypeId((GetFilterUnit())))) != - 1) // INLINED!! +endfunction + +function GetNpcs takes nothing returns group + local group g= CreateGroup() + call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), Filter(function WoWReforgedPings___IsNpcFilter)) + return g +endfunction + +function PingNpcForPlayer takes unit altar,player whichPlayer returns nothing + if ( GetLocalPlayer() == whichPlayer ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call PingMinimapEx(GetUnitX(altar), GetUnitY(altar), 4.0, 0, 255, 0, false) + //call StartSound(bj_pingMinimapSound) + endif +endfunction + +function PingNpcs takes player whichPlayer returns nothing + local group g= GetNpcs() + local integer i= 0 + local integer max= BlzGroupGetSize(g) + loop + exitwhen ( i == max ) + call PingNpcForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) + set i=i + 1 + endloop + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + + +//library WoWReforgedPings ends +//library WoWReforgedPortals: + + +function IsPortal takes integer unitTypeId returns boolean + return unitTypeId == PORTAL or unitTypeId == PORTAL_NEUTRAL or unitTypeId == PORTAL_NEUTRAL_2 or unitTypeId == PORTAL_NEUTRAL_FREELANCER or unitTypeId == PORTAL_NEUTRAL_WATER +endfunction + +function UpdatePortalName takes unit whichUnit,boolean activate,real destinationX,real destinationY returns nothing + local integer zone= 0 + + if ( activate ) then + set zone=GetZoneByCoordinates(destinationX , destinationY) + if ( zone != 0 ) then + call BlzSetUnitName(whichUnit, "Portal to " + (s__AbstractZone_name[(zone)])) // INLINED!! + call SetUnitColor(whichUnit, (s__Zone_color[(zone)])) // INLINED!! + else + call BlzSetUnitName(whichUnit, "Portal") + endif + else + call BlzSetUnitName(whichUnit, "Disabled Portal") + endif +endfunction + +function UpdatePortalNameByItself takes unit whichUnit returns nothing + call UpdatePortalName(whichUnit , WaygateIsActive(whichUnit) , WaygateGetDestinationX(whichUnit) , WaygateGetDestinationY(whichUnit)) +endfunction + +function WoWReforgedPortals___FilterIsPortal takes nothing returns boolean + return IsPortal(GetUnitTypeId(GetFilterUnit())) +endfunction + +function WoWReforgedPortals___ForGroupUpdateName takes nothing returns nothing + call UpdatePortalNameByItself(GetEnumUnit()) +endfunction + +function InitNames takes nothing returns nothing + local group g= CreateGroup() + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedPortals___FilterIsPortal)) + call ForGroup(g, function WoWReforgedPortals___ForGroupUpdateName) + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction + +function WoWReforgedPortals___TimerFunctionInitNames takes nothing returns nothing + local timer t= GetExpiredTimer() + call InitNames() + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function WoWReforgedPortals___TriggerConditionConstructFinished takes nothing returns boolean + if ( IsPortal(GetUnitTypeId(GetConstructedStructure())) ) then + call UpdatePortalNameByItself(GetConstructedStructure()) + endif + return false +endfunction + +function WoWReforgedPortals___Init takes nothing returns nothing + set WoWReforgedPortals___initialized=true + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedPortals___TimerFunctionInitNames) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedPortals___constructFinishedTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedPortals___constructFinishedTrigger, Condition(function WoWReforgedPortals___TriggerConditionConstructFinished)) +endfunction + +function WoWReforgedPortals___HookWaygateActivate takes unit waygate,boolean activate returns nothing + if ( WoWReforgedPortals___initialized and IsPortal(GetUnitTypeId(waygate)) ) then + call UpdatePortalName(waygate , activate , WaygateGetDestinationX(waygate) , WaygateGetDestinationY(waygate)) + endif +endfunction + +function WoWReforgedPortals___HookWaygateActivateBJ takes boolean activate,unit waygate returns nothing + if ( WoWReforgedPortals___initialized and IsPortal(GetUnitTypeId(waygate)) ) then + call UpdatePortalName(waygate , activate , WaygateGetDestinationX(waygate) , WaygateGetDestinationY(waygate)) + endif +endfunction + +function WoWReforgedPortals___HookWaygateSetDestination takes unit waygate,real x,real y returns nothing + if ( WoWReforgedPortals___initialized and IsPortal(GetUnitTypeId(waygate)) ) then + call UpdatePortalName(waygate , WaygateIsActive(waygate) , x , y) + endif +endfunction + +function WoWReforgedPortals___HookWaygateSetDestinationLocBJ takes unit waygate,location loc returns nothing + if ( WoWReforgedPortals___initialized and IsPortal(GetUnitTypeId(waygate)) ) then + call UpdatePortalName(waygate , WaygateIsActive(waygate) , GetLocationX(loc) , GetLocationY(loc)) + endif +endfunction + +//processed hook: hook WaygateActivate WoWReforgedPortals___HookWaygateActivate +//processed hook: hook WaygateActivateBJ WoWReforgedPortals___HookWaygateActivateBJ +//processed hook: hook WaygateSetDestination WoWReforgedPortals___HookWaygateSetDestination +//processed hook: hook WaygateSetDestinationLocBJ WoWReforgedPortals___HookWaygateSetDestinationLocBJ + + +//library WoWReforgedPortals ends +//library WoWReforgedCalendarMultiboard: + + +function GetCalendarMultiboardTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedCalendarMultiboard___t) +endfunction + +function ShowCalendarMultiboard takes nothing returns nothing + call MultiboardDisplay(WoWReforgedCalendarMultiboard___m, true) +endfunction + +function HideCalendarMultiboard takes nothing returns nothing + call MultiboardDisplay(WoWReforgedCalendarMultiboard___m, false) +endfunction + +function ShowCalendarMultiboardForPlayer takes player whichPlayer returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call MultiboardDisplay(WoWReforgedCalendarMultiboard___m, true) // INLINED!! + endif +endfunction + +function HideCalendarMultiboardForPlayer takes player whichPlayer returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call MultiboardDisplay(WoWReforgedCalendarMultiboard___m, false) // INLINED!! + endif +endfunction + +function WoWReforgedCalendarMultiboard___UpdateMultiboard takes nothing returns nothing + local multiboarditem mbitem= null + local integer e= GetRunningCalendarEvent() + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 0, 1) + call MultiboardSetItemIcon(mbitem, GetSeasonIcon((WoWReforgedCalendar___season))) // INLINED!! + call MultiboardSetItemValue(mbitem, GetSeasonName((WoWReforgedCalendar___season))) // INLINED!! + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 1, 1) + call MultiboardSetItemIcon(mbitem, GetCurrentWeatherIcon()) + call MultiboardSetItemValue(mbitem, GetCurrentWeatherName()) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 2, 1) + call MultiboardSetItemValue(mbitem, (I2S((WoWReforgedCalendar___years)) + "-" + I2SW((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar___days) , 2))) // INLINED!! + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 3, 1) + call MultiboardSetItemValue(mbitem, GetMonthName((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1))) // INLINED!! + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 4, 1) + call MultiboardSetItemValue(mbitem, (FormatTimeOfDayEx(GetTimeOfDay()))) // INLINED!! + if ( IsNight() ) then + call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNElunesBlessing.blp") + else + call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNDay Time2.blp") + endif + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 5, 1) + if ( e != 0 ) then + call MultiboardSetItemValue(mbitem, s__CalendarEvent_name[e]) + call MultiboardSetItemValue(mbitem, s__CalendarEvent_icon[e]) + call MultiboardSetItemStyle(mbitem, true, true) + else + call MultiboardSetItemValue(mbitem, "-") + call MultiboardSetItemStyle(mbitem, true, false) + endif + call MultiboardReleaseItem(mbitem) +endfunction + +function WoWReforgedCalendarMultiboard___TimerFunctionCreateMultiboard takes nothing returns nothing + local multiboarditem mbitem= null + + set WoWReforgedCalendarMultiboard___m=CreateMultiboard() + call MultiboardSetTitleText(WoWReforgedCalendarMultiboard___m, "Calendar") + call MultiboardSetColumnCount(WoWReforgedCalendarMultiboard___m, 2) + call MultiboardSetRowCount(WoWReforgedCalendarMultiboard___m, 6) + call MultiboardDisplay(WoWReforgedCalendarMultiboard___m, false) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 0, 0) + call MultiboardSetItemValue(mbitem, "Season:") + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 0, 1) + call MultiboardSetItemStyle(mbitem, true, true) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 1, 0) + call MultiboardSetItemValue(mbitem, "Weather:") + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 1, 1) + call MultiboardSetItemStyle(mbitem, true, true) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 2, 0) + call MultiboardSetItemValue(mbitem, "Date:") + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 2, 1) + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 3, 0) + call MultiboardSetItemValue(mbitem, "Month:") + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 3, 1) + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 4, 0) + call MultiboardSetItemValue(mbitem, "Time:") + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 4, 1) + call MultiboardSetItemStyle(mbitem, true, true) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 5, 0) + call MultiboardSetItemValue(mbitem, "Event:") + call MultiboardSetItemStyle(mbitem, true, false) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard___m, 5, 1) + call MultiboardSetItemStyle(mbitem, true, true) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard___SIZE) + call MultiboardReleaseItem(mbitem) + + call TimerStart(WoWReforgedCalendarMultiboard___t, 0.3, true, function WoWReforgedCalendarMultiboard___UpdateMultiboard) + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function FixCalendarMultiboardTitleColor takes nothing returns nothing + call MultiboardSetTitleTextColorBJ(WoWReforgedCalendarMultiboard___m, 100, 80, 20, 0) +endfunction + +function WoWReforgedCalendarMultiboard___Init takes nothing returns nothing + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedCalendarMultiboard___TimerFunctionCreateMultiboard) +endfunction + + + +//library WoWReforgedCalendarMultiboard ends +//library WoWReforgedProperties: + + + +function GetMaxProperties takes nothing returns integer + return WoWReforgedProperties___propertiesCounter +endfunction + +function GetProperty takes integer index returns integer + return WoWReforgedProperties___properties[index] +endfunction + +function GetPropertyIndex takes unit whichUnit returns integer + local integer handleId= GetHandleId(whichUnit) + if ( HaveSavedInteger(WoWReforgedProperties___h, handleId, 0) ) then + return LoadInteger(WoWReforgedProperties___h, GetHandleId(whichUnit), 0) + endif + return - 1 +endfunction + +function PlayerOwnsPropertyOfRace takes player whichPlayer,integer whichRace returns boolean + local integer i= 0 + local integer max= 0 + local integer index= 0 + local unit whichUnit= null + if ( whichRace == udg_RaceNone ) then + return true + endif + + set max=BlzGroupGetSize(WoWReforgedProperties___properiesGroup) + loop + exitwhen ( i == max ) + set whichUnit=BlzGroupUnitAt(WoWReforgedProperties___properiesGroup, i) + set index=GetPropertyIndex(whichUnit) + if ( index != - 1 and s__Property_soldRace[(WoWReforgedProperties___properties[(index)])] == whichRace ) then // INLINED!! + return true + endif + set whichUnit=null + set i=i + 1 + endloop + + return false +endfunction + +function PropertyAllowsItemTypeId takes player whichPlayer,integer whichRace,integer itemTypeId returns boolean + local integer t= GetRaceObjectType(whichRace , itemTypeId) + + if ( t == RACE_OBJECT_TYPE_NONE ) then + return true + elseif ( t == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_1_ITEM ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_2_ITEM ) then + return false + elseif ( t == RACE_OBJECT_TYPE_TIER_3_ITEM ) then + return false + endif + + return PlayerOwnsPropertyOfRace(whichPlayer , GetObjectRace(itemTypeId)) +endfunction + +function WoWReforgedProperties___GetPropertyIndexByUnitTypeId takes integer unitTypeId returns integer + local integer i= 0 + local integer max= (WoWReforgedProperties___propertiesCounter) // INLINED!! + loop + exitwhen ( i >= max ) + if ( s__Property_unitTypeId[(WoWReforgedProperties___properties[(i)])] == unitTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function IsProperty takes integer unitTypeId returns boolean + return WoWReforgedProperties___GetPropertyIndexByUnitTypeId(unitTypeId) != - 1 +endfunction + +function IsUnitProperty takes unit whichUnit returns boolean + return (WoWReforgedProperties___GetPropertyIndexByUnitTypeId((GetUnitTypeId(whichUnit))) != - 1) // INLINED!! +endfunction + +function AddProperty takes integer unitTypeId,integer purchaseUnitTypeId,integer resource,integer maxWorkers,integer soldRace,boolean shipyard returns integer + local integer property= s__Property__allocate() + set s__Property_unitTypeId[property]=unitTypeId + set s__Property_purchaseUnitTypeId[property]=purchaseUnitTypeId + set s__Property_resource[property]=resource + set s__Property_maxWorkers[property]=maxWorkers + set s__Property_soldRace[property]=soldRace + set s__Property_shipyard[property]=shipyard + + set WoWReforgedProperties___properties[WoWReforgedProperties___propertiesCounter]=property + set WoWReforgedProperties___propertiesCounter=WoWReforgedProperties___propertiesCounter + 1 + + return property +endfunction + +function AddPropertyWoWReforged takes nothing returns nothing + set udg_TmpInteger=AddProperty(udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpInteger , udg_TmpInteger2 , udg_TmpInteger3 , udg_TmpBoolean) + set udg_TmpBoolean=false +endfunction + +function WoWReforgedProperties___RegisterAllWorkersForLoadedMine takes unit mine returns nothing + local integer i= 0 + local integer max= (udg_MaxRaces) // INLINED!! + loop + exitwhen ( i >= max ) + // TODO new op limit for each? + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_WORKER) != 0 ) then + call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_WORKER)) , true) // INLINED!! + endif + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_MALE_CITIZEN) != 0 ) then + call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_MALE_CITIZEN)) , true) // INLINED!! + endif + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_FEMALE_CITIZEN) != 0 ) then + call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_FEMALE_CITIZEN)) , true) // INLINED!! + endif + if ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CHILD) != 0 ) then + call SetLoadedMineAllowedWorkerUnitTypeId((mine ) , ( GetRaceObjectTypeId(i , RACE_OBJECT_TYPE_CHILD)) , true) // INLINED!! + endif + set i=i + 1 + endloop +endfunction + +function WoWReforgedProperties___AddUnitType takes integer index,unit shop,integer t returns nothing + local integer unitTypeId= GetRaceObjectTypeId(s__Property_soldRace[(WoWReforgedProperties___properties[(index)])] , t) // INLINED!! + if ( unitTypeId != 0 and GenerateId(unitTypeId) ) then +call AddPagedButtonsId((shop ) , ( unitTypeId) , PagedButtons_BUTTON_TYPE_UNIT) // INLINED!! + endif +endfunction + +function WoWReforgedProperties___AddItemType takes integer index,unit shop,integer t returns nothing + local integer itemTypeId= GetRaceObjectTypeId(s__Property_soldRace[(WoWReforgedProperties___properties[(index)])] , t) // INLINED!! + if ( itemTypeId != 0 and GenerateId(itemTypeId) ) then +call AddPagedButtonsId((shop ) , ( itemTypeId) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + endif +endfunction + +function WoWReforgedProperties___PurchaseProperty takes integer index,unit whichUnit,player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + + call h__QuestMessageBJ(bj_FORCE_PLAYER[playerId], bj_QUESTMESSAGE_UNITACQUIRED, "Purchased property " + GetUnitName(whichUnit)) + + call SetUnitOwner(whichUnit, whichPlayer, true) + + call ResearchAllForPlayer(whichPlayer , s__Property_soldRace[(WoWReforgedProperties___properties[(index)])]) // INLINED!! + + call AchievementPropertyShark(whichPlayer) + call AchievementPropertyLandowner(whichPlayer , (WoWReforgedProperties___propertiesCounter)) // INLINED!! + + call RemoveUnitFromStock(whichUnit, s__Property_purchaseUnitTypeId[(WoWReforgedProperties___properties[(index)])]) // INLINED!! + + call AddLoadedMine(whichUnit , s__Property_resource[(WoWReforgedProperties___properties[(index)])] , 9999999 , s__Property_maxWorkers[(WoWReforgedProperties___properties[(index)])]) // INLINED!! + call SetMineExplodesOnDeath(whichUnit , false) + call UnitAddAbility(whichUnit, WoWReforgedProperties_CARGO_HOLD_ABILITY_ID) + call UnitAddAbility(whichUnit, WoWReforgedProperties_LOAD_ABILITY_ID) + call UnitAddAbility(whichUnit, WoWReforgedProperties_UNLOAD_ABILITY_ID) + + + call ResourcesGui_StartUpdateTimerForUnits(whichUnit , null) // update resources UI + + + call EnablePagedButtons(whichUnit) + call SetPagedButtonsSlotsPerPage(whichUnit , 7) + set GenerateIds___generatedIdsCounter=0 // INLINED!! + call NextPagedButtonsPage(whichUnit , "(Units)") + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TOWN_HALL_3) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TOWN_HALL_4) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FEMALE_CITIZEN) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_CHILD) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_PET) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FOOTMAN) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_RIFLEMAN) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_KNIGHT) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_BARRACKS_4) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_PRIEST) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SORCERESS) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SPELLBREAKER) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_GRYPHON) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_DRAGONHAWK) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_AVIARY_3) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_AVIARY_4) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FLYING_MACHINE) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SIEGE_ENGINE) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_MORTAR) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_WORKSHOP_4) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TAUREN) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SHADE) + + if ( s__Property_shipyard[(WoWReforgedProperties___properties[(index)])] ) then // INLINED!! + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_TRANSPORT_SHIP) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_FRIGATE) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_BATTLESHIP) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SHIP_SPECIAL_1) + call WoWReforgedProperties___AddUnitType(index , whichUnit , RACE_OBJECT_TYPE_SHIP_SPECIAL_2) + endif + + call NextPagedButtonsPage(whichUnit , "(Buildings)") + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_FARM_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_ALTAR_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_MILL_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_BARRACKS_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SHOP_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_WORKSHOP_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SHIPYARD_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM) + call WoWReforgedProperties___AddItemType(index , whichUnit , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2_ITEM) + + call WoWReforgedProperties___RegisterAllWorkersForLoadedMine(whichUnit) + + + call ShowPagedButtonsUI(whichPlayer , whichUnit) + +endfunction + +function PingProperties takes player whichPlayer returns nothing + local integer i= 0 + local integer max= BlzGroupGetSize(WoWReforgedProperties___properiesGroup) + loop + exitwhen ( i >= max ) + call PingUnitForPlayer(BlzGroupUnitAt(WoWReforgedProperties___properiesGroup, i) , whichPlayer) + set i=i + 1 + endloop +endfunction + +function WoWReforgedProperties___GetPropertyIndexByPurchaseUnitTypeId takes integer unitTypeId returns integer + local integer i= 0 + local integer max= (WoWReforgedProperties___propertiesCounter) // INLINED!! + loop + exitwhen ( i >= max ) + if ( s__Property_purchaseUnitTypeId[(WoWReforgedProperties___properties[(i)])] == unitTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function WoWReforgedProperties___TriggerActionPurchase takes nothing returns nothing + local integer unitTypeId= GetUnitTypeId(GetSoldUnit()) + local integer index= WoWReforgedProperties___GetPropertyIndexByPurchaseUnitTypeId(unitTypeId) + if ( index != - 1 ) then + call h__RemoveUnit(GetSoldUnit()) + call WoWReforgedProperties___PurchaseProperty(index , GetSellingUnit() , GetOwningPlayer(GetBuyingUnit())) + endif +endfunction + +function WoWReforgedProperties___FilterIsProperty takes nothing returns boolean + return (WoWReforgedProperties___GetPropertyIndexByUnitTypeId((GetUnitTypeId(GetFilterUnit()))) != - 1) // INLINED!! +endfunction + +function WoWReforgedProperties___ForGroupUpdateProperties takes nothing returns nothing + local unit p= GetEnumUnit() + local integer index= WoWReforgedProperties___GetPropertyIndexByUnitTypeId(GetUnitTypeId(p)) + if ( index != - 1 ) then + call GroupAddUnit(WoWReforgedProperties___properiesGroup, p) + call SaveInteger(WoWReforgedProperties___h, GetHandleId(p), 0, index) + call UnitAddAbility(p, 'Asud') + call UnitAddAbility(p, WoWReforgedProperties_SELECT_UNIT_ABILITY_ID) + call UnitAddAbility(p, WoWReforgedProperties_SELECT_HERO_ABILITY_ID) + call UnitAddAbility(p, 'Avul') + call AddUnitToStock(p, s__Property_purchaseUnitTypeId[(WoWReforgedProperties___properties[(index)])], 1, 1) // INLINED!! + endif + set p=null +endfunction + +function WoWReforgedProperties___TimerFunctionUpdateProperties takes nothing returns nothing + local timer t= GetExpiredTimer() + local group g= CreateGroup() + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedProperties___FilterIsProperty)) + call ForGroup(g, function WoWReforgedProperties___ForGroupUpdateProperties) + call GroupClear(g) + call DestroyGroup(g) + set g=null + call PauseTimer(t) + call DestroyTimer(t) + set t=null +endfunction + +function WoWReforgedProperties___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedProperties___purchaseTrigger, EVENT_PLAYER_UNIT_SELL) + // Use a trigger action because of ResourcesGui_StartUpdateTimerForUnits and the player selection. + call TriggerAddAction(WoWReforgedProperties___purchaseTrigger, function WoWReforgedProperties___TriggerActionPurchase) + call TimerStart(CreateTimer(), 1.0, false, function WoWReforgedProperties___TimerFunctionUpdateProperties) +endfunction + + +//library WoWReforgedProperties ends +//library WoWReforgedItemCheck: + +function IsTome takes integer itemTypeId returns boolean + if ( itemTypeId == TOME_OF_AGILITY ) then + return true + elseif ( itemTypeId == TOME_OF_AGILITY_2 ) then + return true + elseif ( itemTypeId == TOME_OF_EXPERIENCE ) then + return true + elseif ( itemTypeId == TOME_OF_GREATER_EXPERIENCE ) then + return true + elseif ( itemTypeId == TOME_OF_INTELLIGENCE ) then + return true + elseif ( itemTypeId == TOME_OF_INTELLIGENCE_2 ) then + return true + elseif ( itemTypeId == TOME_OF_KNOWLEDGE ) then + return true + elseif ( itemTypeId == TOME_OF_STRENGTH ) then + return true + elseif ( itemTypeId == TOME_OF_STRENGTH_2 ) then + return true + elseif ( itemTypeId == TOME_OF_POWER ) then + return true + elseif ( itemTypeId == TOME_OF_ARMOR ) then + return true + elseif ( itemTypeId == TOME_OF_DAMAGE ) then + return true + endif + return false +endfunction + +// TODO Make this function faster by caching item type races and professions! +function CanItemTypeIdBePickedUp takes integer itemTypeId,unit hero returns boolean + local player heroOwner= GetOwningPlayer(hero) + local integer unitTypeId= GetUnitTypeId(hero) + local integer playerId= GetConvertedPlayerId(heroOwner) + local integer itemRace= udg_RaceNone + local integer itemProfession= udg_ProfessionNone + local boolean result= false + if ( udg_PlayerUnlockedAllRaces[playerId] ) then + set result=true + else + set itemRace=(GetObjectRace((itemTypeId))) // INLINED!! + set itemProfession=GetBookItemProfession(itemTypeId) + set result=( itemRace == udg_RaceNone or itemRace == udg_PlayerRace[playerId] or itemRace == udg_PlayerRace2[playerId] or itemRace == udg_PlayerRace3[playerId] or PropertyAllowsItemTypeId(heroOwner , itemRace , itemTypeId) ) and ( itemProfession == udg_ProfessionNone or itemProfession == udg_PlayerProfession[playerId] or itemProfession == udg_PlayerProfession2[playerId] or itemProfession == udg_PlayerProfession3[playerId] or PropertyAllowsItemTypeId(heroOwner , itemRace , itemTypeId) ) + endif + + if ( result and not udg_Tomes and unitTypeId != BACKPACK ) then + set result=not IsTome(itemTypeId) + endif + + set heroOwner=null + return result +endfunction + +function GetItemTypeIdPickupErrorReason takes integer itemTypeId,unit hero returns string + local player heroOwner= GetOwningPlayer(hero) + local integer unitTypeId= GetUnitTypeId(hero) + local integer playerId= GetConvertedPlayerId(heroOwner) + local integer itemRace= udg_RaceNone + local integer itemProfession= udg_ProfessionNone + if ( not udg_PlayerUnlockedAllRaces[playerId] ) then + set itemRace=(GetObjectRace((itemTypeId))) // INLINED!! + if ( itemRace != udg_RaceNone and itemRace != udg_PlayerRace[playerId] and itemRace != udg_PlayerRace2[playerId] and itemRace != udg_PlayerRace3[playerId] ) then + return "Belongs to race " + udg_RaceName[itemRace] + "!" + endif + + set itemProfession=GetBookItemProfession(itemTypeId) + if ( itemProfession != udg_ProfessionNone and itemProfession != udg_PlayerProfession[playerId] and itemProfession != udg_PlayerProfession2[playerId] and itemProfession != udg_PlayerProfession3[playerId] ) then + return "Belongs to profession " + udg_ProfessionName[itemProfession] + "!" + endif + endif + + if ( not udg_Tomes and unitTypeId != BACKPACK and not IsTome(itemTypeId) ) then + return "Tomes are disabled." + endif + + return null +endfunction + + +function IsUniqueScepterOrProfessionBook takes item whichItem,unit hero returns boolean + local integer itemTypeId= GetItemTypeId(whichItem) + if ( GetUnitTypeId(hero) == BACKPACK ) then + return true + endif + if ( GetBookItemProfession(itemTypeId) != udg_ProfessionNone or GetObjectRaceType(itemTypeId) == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then + return CountItemsOfItemTypeId(hero , itemTypeId) <= 1 + endif + return true +endfunction + +function CanItemBePickedUp takes item whichItem,unit hero returns boolean + local player heroOwner= GetOwningPlayer(hero) + local player itemOwner= GetItemPlayer(whichItem) + local boolean result= ( itemOwner == null or itemOwner == Player(PLAYER_NEUTRAL_PASSIVE) or itemOwner == heroOwner ) and IsUniqueScepterOrProfessionBook(whichItem , hero) and CanItemTypeIdBePickedUp(GetItemTypeId(whichItem) , hero) + set heroOwner=null + set itemOwner=null + return result +endfunction + +function GetItemPickupErrorReason takes item whichItem,unit hero returns string + local player heroOwner= GetOwningPlayer(hero) + local player itemOwner= GetItemPlayer(whichItem) + local string result= null + if ( itemOwner != null and itemOwner != Player(PLAYER_NEUTRAL_PASSIVE) and itemOwner != heroOwner ) then + set result="Owner is " + GetPlayerNameColored(itemOwner) + "!" + elseif ( not IsUniqueScepterOrProfessionBook(whichItem , hero) ) then + set result="Item can be only once it inventory!" + else + set result=GetItemTypeIdPickupErrorReason(GetItemTypeId(whichItem) , hero) + endif + set heroOwner=null + set itemOwner=null + return result +endfunction + + +//library WoWReforgedItemCheck ends +//library WoWReforgedBackpacks: + + +function SetPlayerBagInfo takes player whichPlayer,boolean info returns nothing + set WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId(whichPlayer)]=info +endfunction + +function GetPlayerBagInfo takes player whichPlayer returns boolean + return WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId(whichPlayer)] +endfunction + +function GetPlayerBackpack takes player whichPlayer returns unit + return WoWReforgedBackpacks__Backpack[GetPlayerId(whichPlayer)] +endfunction + +function PlayerHasBackpack takes player whichPlayer returns boolean + return (WoWReforgedBackpacks__Backpack[GetPlayerId((whichPlayer))]) != null // INLINED!! +endfunction + +function GetBackpackItemIndex takes integer playerId,integer page,integer slot returns integer + return Index3D(playerId , page , slot , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) +endfunction + +function GetBackpackItemTypeId takes integer index returns integer + return WoWReforgedBackpacks__BackpackItemType[index] +endfunction + +function GetBackpackItemCharges takes integer index returns integer + return WoWReforgedBackpacks__BackpackItemCharges[index] +endfunction + +function GetBackpackItemIsPawnable takes integer index returns boolean + return WoWReforgedBackpacks__BackpackItemPawnable[index] +endfunction + +function GetBackpackItemTooltipExtended takes integer index returns string + return WoWReforgedBackpacks__BackpackItemTooltipExtended[index] +endfunction + +function GetBackpackItemPlayer takes integer index returns player + return WoWReforgedBackpacks__BackpackItemPlayer[index] +endfunction + +function ClearBackpackItem takes integer index returns nothing + set WoWReforgedBackpacks__BackpackItemType[index]=0 + set WoWReforgedBackpacks__BackpackItemCharges[index]=0 + set WoWReforgedBackpacks__BackpackItemPawnable[index]=false + set WoWReforgedBackpacks__BackpackItemInvulnerable[index]=false + set WoWReforgedBackpacks__BackpackItemName[index]="" + set WoWReforgedBackpacks__BackpackItemDescription[index]="" + set WoWReforgedBackpacks__BackpackItemTooltip[index]="" + set WoWReforgedBackpacks__BackpackItemTooltipExtended[index]="" + set WoWReforgedBackpacks__BackpackItemPlayer[index]=null +endfunction + +function SetBackpackItemFromItem takes item whichItem,integer index returns nothing + set WoWReforgedBackpacks__BackpackItemType[index]=GetItemTypeId(whichItem) + set WoWReforgedBackpacks__BackpackItemCharges[index]=GetItemCharges(whichItem) + set WoWReforgedBackpacks__BackpackItemPawnable[index]=IsItemPawnable(whichItem) + set WoWReforgedBackpacks__BackpackItemInvulnerable[index]=IsItemInvulnerable(whichItem) + set WoWReforgedBackpacks__BackpackItemName[index]=GetItemName(whichItem) + set WoWReforgedBackpacks__BackpackItemDescription[index]=BlzGetItemDescription(whichItem) + set WoWReforgedBackpacks__BackpackItemTooltip[index]=BlzGetItemTooltip(whichItem) + set WoWReforgedBackpacks__BackpackItemTooltipExtended[index]=BlzGetItemExtendedTooltip(whichItem) + set WoWReforgedBackpacks__BackpackItemPlayer[index]=GetItemPlayer(whichItem) +endfunction + +function ApplyBackpackItem takes item whichItem,integer index returns nothing + call SetItemCharges(whichItem, WoWReforgedBackpacks__BackpackItemCharges[index]) + call SetItemPawnable(whichItem, WoWReforgedBackpacks__BackpackItemPawnable[index]) + call SetItemDroppable(whichItem, true) // all items must be droppable in the backpack! + call SetItemInvulnerable(whichItem, WoWReforgedBackpacks__BackpackItemInvulnerable[index]) + call BlzSetItemName(whichItem, WoWReforgedBackpacks__BackpackItemName[index]) + call BlzSetItemDescription(whichItem, WoWReforgedBackpacks__BackpackItemDescription[index]) + call BlzSetItemTooltip(whichItem, WoWReforgedBackpacks__BackpackItemTooltip[index]) + call BlzSetItemExtendedTooltip(whichItem, WoWReforgedBackpacks__BackpackItemTooltipExtended[index]) + call SetItemPlayer(whichItem, WoWReforgedBackpacks__BackpackItemPlayer[index], false) +endfunction + +function SetBackpackItemFromIndex takes integer index,integer sourceIndex returns nothing + set WoWReforgedBackpacks__BackpackItemType[index]=WoWReforgedBackpacks__BackpackItemType[sourceIndex] + set WoWReforgedBackpacks__BackpackItemCharges[index]=WoWReforgedBackpacks__BackpackItemCharges[sourceIndex] + set WoWReforgedBackpacks__BackpackItemPawnable[index]=WoWReforgedBackpacks__BackpackItemPawnable[sourceIndex] + set WoWReforgedBackpacks__BackpackItemInvulnerable[index]=WoWReforgedBackpacks__BackpackItemInvulnerable[sourceIndex] + set WoWReforgedBackpacks__BackpackItemName[index]=WoWReforgedBackpacks__BackpackItemName[sourceIndex] + set WoWReforgedBackpacks__BackpackItemDescription[index]=WoWReforgedBackpacks__BackpackItemDescription[sourceIndex] + set WoWReforgedBackpacks__BackpackItemTooltip[index]=WoWReforgedBackpacks__BackpackItemTooltip[sourceIndex] + set WoWReforgedBackpacks__BackpackItemTooltipExtended[index]=WoWReforgedBackpacks__BackpackItemTooltipExtended[sourceIndex] + set WoWReforgedBackpacks__BackpackItemPlayer[index]=WoWReforgedBackpacks__BackpackItemPlayer[sourceIndex] +endfunction + +function BackpackCountItemsOfItemTypeForPlayer takes player whichPlayer,integer itemTypeId returns integer + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + local integer result= 0 + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + if ( WoWReforgedBackpacks__BackpackPageNumber[playerId] == i ) then + if ( UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j) != null and GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j)) == itemTypeId ) then + set result=result + 1 + endif + else + if ( WoWReforgedBackpacks__BackpackItemType[index] == itemTypeId ) then + set result=result + 1 + endif + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + return result +endfunction + +function Hero1CountItemsOfItemType takes unit hero,integer itemTypeId returns integer + local player owner= GetOwningPlayer(hero) + local integer convertedPlayerId= GetConvertedPlayerId(owner) + local integer result= CountItemsOfItemTypeId(hero , itemTypeId) + local integer i= 0 + loop + exitwhen ( i == BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((owner))])) ) // INLINED!! + set result=result + CountItemsOfItemTypeId(BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((owner))]), i) , itemTypeId) // INLINED!! + set i=i + 1 + endloop + set owner=null + return result +endfunction + +function PlayerCountItemsOfItemType takes player whichPlayer,integer itemTypeId returns integer + local integer result= BackpackCountItemsOfItemTypeForPlayer(whichPlayer , itemTypeId) + local unit hero1= (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! + local unit hero2= (udg_Hero2[GetPlayerId((whichPlayer))]) // INLINED!! + local unit hero3= (udg_Hero3[GetPlayerId((whichPlayer))]) // INLINED!! + if ( hero1 != null ) then + set result=result + Hero1CountItemsOfItemType(hero1 , itemTypeId) + endif + if ( hero2 != null ) then + set result=result + Hero1CountItemsOfItemType(hero2 , itemTypeId) + endif + if ( hero3 != null ) then + set result=result + Hero1CountItemsOfItemType(hero3 , itemTypeId) + endif + + return result +endfunction + +function HeroDropRandomItem takes unit hero returns item + local player owner= GetOwningPlayer(hero) + local integer playerId= GetPlayerId(owner) + local integer convertedPlayerId= GetConvertedPlayerId(owner) + local unit array heroes + local integer array slots + local integer counter= 0 + local unit bag= null + local integer maxBags= 0 + local integer i= 0 + local integer j= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + if ( UnitItemInSlot(hero, i) != null ) then + set heroes[counter]=hero + set slots[counter]=i + set counter=counter + 1 + endif + set i=i + 1 + endloop + if ( hero == (udg_Hero[GetPlayerId((owner))]) ) then // INLINED!! + set maxBags=BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((owner))])) // INLINED!! + set i=0 + loop + exitwhen ( i == maxBags ) + set bag=BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((owner))]), i) // INLINED!! + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + if ( UnitItemInSlot(bag, j) != null ) then + set heroes[counter]=bag + set slots[counter]=j + set counter=counter + 1 + endif + set j=j + 1 + endloop + set bag=null + set i=i + 1 + endloop + endif + set owner=null + if ( counter > 0 ) then + set i=GetRandomInt(0, counter) + return UnitRemoveItemFromSlot(heroes[i], slots[i]) + endif + + return null +endfunction + +function RemoveAllBackpackItemTypesForPlayer takes player whichPlayer,integer itemTypeId returns integer + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + local integer result= 0 + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + if ( WoWReforgedBackpacks__BackpackPageNumber[playerId] == i ) then + if ( UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j) != null and GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j)) == itemTypeId ) then + call h__RemoveItem(UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j)) + set result=result + 1 + endif + else + if ( WoWReforgedBackpacks__BackpackItemType[index] == itemTypeId ) then + call ClearBackpackItem(index) + set result=result + 1 + endif + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + return result +endfunction + +// This does not clear the backpack inventory! +function DropBackpackForPlayerTo takes player whichPlayer,real x,real y returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + local item whichItem= null + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + if ( WoWReforgedBackpacks__BackpackPageNumber[playerId] == i ) then + set whichItem=CreateItem(GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j)), x, y) + else + set whichItem=CreateItem(WoWReforgedBackpacks__BackpackItemType[index], x, y) + endif + + call ApplyBackpackItem(whichItem , index) + + if ( WoWReforgedBackpacks__BackpackPageNumber[playerId] == i ) then + call SetItemCharges(whichItem, GetItemCharges(UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j))) + else + call SetItemCharges(whichItem, WoWReforgedBackpacks__BackpackItemCharges[index]) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + + call UpdateItemsForBackpackUIEvaluate(whichPlayer) +endfunction + +function DropBackpackForPlayer takes player whichPlayer,rect whichRect returns nothing + call DropBackpackForPlayerTo(whichPlayer , GetRectCenterX(whichRect) , GetRectCenterY(whichRect)) +endfunction + +function DropBackpack takes player whichPlayer returns integer + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + local item whichItem= null + local real x= GetUnitX(WoWReforgedBackpacks__Backpack[playerId]) + local real y= GetUnitY(WoWReforgedBackpacks__Backpack[playerId]) + local integer result= 0 + // drop before so they won't have to be cleared or removed + set result=DropAllItemsFromHero(WoWReforgedBackpacks__Backpack[playerId]) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index3D(playerId , WoWReforgedBackpacks__BackpackPageNumber[playerId] , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + call ClearBackpackItem(index) + set j=j + 1 + endloop + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + if ( WoWReforgedBackpacks__BackpackItemType[index] != 0 ) then + set whichItem=CreateItem(WoWReforgedBackpacks__BackpackItemType[index], x, y) + call ApplyBackpackItem(whichItem , index) + call SetItemCharges(whichItem, WoWReforgedBackpacks__BackpackItemCharges[index]) + call ClearBackpackItem(index) + set result=result + 1 + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + + call UpdateItemsForBackpackUIEvaluate(whichPlayer) + + return result +endfunction + +function DropQuestItemFromCreepHeroAtRect takes unit hero,integer itemTypeId,rect whichRect returns item + local item whichItem= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY or whichItem != null ) + if ( GetItemTypeId(UnitItemInSlot(hero, i)) == itemTypeId ) then + call h__RemoveItem(UnitItemInSlot(hero, i)) + set whichItem=CreateItem(itemTypeId, GetRectCenterX(whichRect), GetRectCenterY(whichRect)) + call SetItemInvulnerable(whichItem, true) + endif + set i=i + 1 + endloop + return whichItem +endfunction + +function DropQuestItemFromHeroAtRect takes player whichPlayer,integer itemTypeId,rect whichRect returns item + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + local item whichItem= DropQuestItemFromCreepHeroAtRect((udg_Hero[GetPlayerId((whichPlayer))]) , itemTypeId , whichRect) // INLINED!! + // Check second hero inventory + if ( whichItem == null and (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + set whichItem=DropQuestItemFromCreepHeroAtRect((udg_Hero2[GetPlayerId((whichPlayer))]) , itemTypeId , whichRect) // INLINED!! + endif + // Check third hero inventory + if ( whichItem == null and (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + set whichItem=DropQuestItemFromCreepHeroAtRect((udg_Hero3[GetPlayerId((whichPlayer))]) , itemTypeId , whichRect) // INLINED!! + endif + // Check Equipment Bags + if ( whichItem == null and (udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))]) != null ) then // INLINED!! + set i=0 + loop + exitwhen ( i == BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))])) or whichItem != null ) // INLINED!! + set whichItem=DropQuestItemFromCreepHeroAtRect(BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((whichPlayer))]), i) , itemTypeId , whichRect) // INLINED!! + set i=i + 1 + endloop + endif + // Check the backpack + if ( whichItem == null ) then + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES or whichItem != null ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY or whichItem != null ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + if ( WoWReforgedBackpacks__BackpackItemType[index] == itemTypeId or ( WoWReforgedBackpacks__BackpackPageNumber[playerId] == i and GetItemTypeId(UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j)) == itemTypeId ) ) then + if ( WoWReforgedBackpacks__BackpackPageNumber[playerId] == i ) then + call h__RemoveItem(UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], j)) + endif + call ClearBackpackItem(index) + set whichItem=CreateItem(itemTypeId, GetRectCenterX(whichRect), GetRectCenterY(whichRect)) + call SetItemInvulnerable(whichItem, true) + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + endif + + return whichItem +endfunction + +function DropQuestItemFromHeroAtRectByDyingUnit takes integer itemTypeId,rect whichRect returns item + return DropQuestItemFromHeroAtRect(GetOwningPlayer(GetDyingUnit()) , itemTypeId , whichRect) +endfunction + +function DropQuestItemFromDyingUnit takes nothing returns item + return DropQuestItemFromHeroAtRectByDyingUnit(udg_TmpItemTypeId , udg_TmpRect) +endfunction + +function ClearCurrentBackpackPageForPlayer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer j= 0 + local integer index= 0 + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index3D(playerId , WoWReforgedBackpacks__BackpackPageNumber[playerId] , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + //call BJDebugMsg("Clearing item at index " + I2S(index)) + call ClearBackpackItem(index) + set j=j + 1 + endloop +endfunction + +function ClearBackpackForPlayer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + //call BJDebugMsg("Clearing item at index " + I2S(index)) + call ClearBackpackItem(index) + set j=j + 1 + endloop + set i=i + 1 + endloop +endfunction + +function AddItemToBackpackForPlayer takes player whichPlayer,item whichItem returns boolean + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + local integer itemRespawn= - 1 + local item slotItem= null + // try to add it to the inventory first + set i=0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + exitwhen ( whichItem == null ) + set slotItem=UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], i) + if ( slotItem == null or ( GetItemCharges(whichItem) > 0 and GetItemTypeId(whichItem) == GetItemTypeId(slotItem) and GetMaxStacksByItemTypeId(GetItemTypeId(whichItem)) >= GetItemCharges(slotItem) + GetItemCharges(whichItem) ) ) then + if ( UnitAddItem(WoWReforgedBackpacks__Backpack[playerId], whichItem) ) then + if ( (WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Added " + GetItemName(whichItem) + " to backpack bag " + I2S(WoWReforgedBackpacks__BackpackPageNumber[playerId] + 1) + " by stacking it to slot " + I2S(i + 1) + "." )) + endif + + set whichItem=null + return true + else + // TODO Seems to happen for slots with the same item type. If this does not work by default, we have to change the charges and update the backpack page. + if ( (WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Problem on adding " + GetItemName(whichItem) + " to backpack bag " + I2S(WoWReforgedBackpacks__BackpackPageNumber[playerId] + 1) + " by stacking it to slot " + I2S(i + 1) + "." )) + endif + endif + endif + set slotItem=null + set i=i + 1 + endloop + // try adding it to another bag then + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + exitwhen ( whichItem == null ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + exitwhen ( whichItem == null ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + // empty slot + if ( WoWReforgedBackpacks__BackpackItemType[index] == 0 ) then + if ( (WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Added " + GetItemName(whichItem) + " to backpack bag " + I2S(i + 1) + " to empty slot " + I2S(j + 1) + "." )) + endif + call SetBackpackItemFromItem(whichItem , index) + set itemRespawn=(ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId((whichItem)))) // INLINED!! + call h__RemoveItem(whichItem) + set whichItem=null + if ( itemRespawn != - 1 ) then + call StartItemRespawn(itemRespawn) + endif + + return true + // stack + elseif ( GetItemCharges(whichItem) > 0 and GetItemTypeId(whichItem) == WoWReforgedBackpacks__BackpackItemType[index] and GetMaxStacksByItemTypeId(WoWReforgedBackpacks__BackpackItemType[index]) >= WoWReforgedBackpacks__BackpackItemCharges[index] + GetItemCharges(whichItem) ) then + if ( (WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId((whichPlayer))]) ) then // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Added " + GetItemName(whichItem) + " to backpack bag " + I2S(i + 1) + " by stacking it to slot " + I2S(j + 1) + "." )) + endif + set WoWReforgedBackpacks__BackpackItemCharges[index]=WoWReforgedBackpacks__BackpackItemCharges[index] + GetItemCharges(whichItem) + set itemRespawn=(ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId((whichItem)))) // INLINED!! + call h__RemoveItem(whichItem) + set whichItem=null + if ( itemRespawn != - 1 ) then + call StartItemRespawn(itemRespawn) + endif + + return true + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + + call UpdateItemsForBackpackUIEvaluate(whichPlayer) + + return false +endfunction + +function DestroyBackpackSystemForPlayer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + if ( WoWReforgedBackpacks__Backpack[playerId] != null ) then + call h__RemoveUnit(WoWReforgedBackpacks__Backpack[playerId]) + set WoWReforgedBackpacks__Backpack[playerId]=null + endif + call ClearBackpackForPlayer(whichPlayer) +endfunction + +function DisableItemPickupTriggers takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + call DisableTrigger(WoWReforgedBackpacks__BackpackTriggerPickup[playerId]) + call DisableTrigger(WoWReforgedBackpacks__BackpackTriggerDrop[playerId]) +endfunction + +function EnableItemPickupTriggers takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + call EnableTrigger(WoWReforgedBackpacks__BackpackTriggerPickup[playerId]) + call EnableTrigger(WoWReforgedBackpacks__BackpackTriggerDrop[playerId]) +endfunction + +function GetBackpackPageNumber takes player whichPlayer returns integer + local integer playerId= GetPlayerId(whichPlayer) + return WoWReforgedBackpacks__BackpackPageNumber[playerId] +endfunction + +function RefreshBackpackPage takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer page= GetBackpackPageNumber(whichPlayer) + local integer i= 0 + local integer index= 0 + local item whichItem= null + call DisableItemPickupTriggers(whichPlayer) + // Create All Items From Next/Previous Page + set i=0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set index=Index3D(playerId , page , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + if ( WoWReforgedBackpacks__BackpackItemType[index] != 0 ) then + //call BJDebugMsg("Item type " + GetObjectName(BackpackItemType[index]) + " at index " + I2S(index)) + call UnitAddItemToSlotById(WoWReforgedBackpacks__Backpack[playerId], WoWReforgedBackpacks__BackpackItemType[index], i) + set whichItem=UnitItemInSlot(WoWReforgedBackpacks__Backpack[playerId], i) + call ApplyBackpackItem(whichItem , index) + //else + //call BJDebugMsg("Empty at index " + I2S(index)) + endif + set i=i + 1 + endloop + call EnableItemPickupTriggers(whichPlayer) +endfunction + +function ChangeBackpackPageEx takes player whichPlayer,integer newBackpackPage returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer index= 0 + local item SlotItem= null + call DisableItemPickupTriggers(whichPlayer) + // Save All Items + set i=0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set index=Index3D(playerId , WoWReforgedBackpacks__BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + set SlotItem=UnitItemInSlot((WoWReforgedBackpacks__Backpack[GetPlayerId((whichPlayer))]), i) // INLINED!! + if ( SlotItem != null ) then + call SetBackpackItemFromItem(SlotItem , index) + //call BJDebugMsg("Storing at index " + I2S(index) + " with type " + GetObjectName(BackpackItemType[index])) + call h__RemoveItem(SlotItem) + set SlotItem=null + else + //call BJDebugMsg("Storing empty at index " + I2S(index)) + call ClearBackpackItem(index) + endif + set i=i + 1 + endloop + call EnableItemPickupTriggers(whichPlayer) + // change page + set WoWReforgedBackpacks__BackpackPageNumber[playerId]=newBackpackPage + call BlzSetUnitName((WoWReforgedBackpacks__Backpack[GetPlayerId((whichPlayer))]), "Bag " + I2S(newBackpackPage + 1)) // INLINED!! + //call DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ("Open Bag " + I2S(newBackpackPage + 1) + ".")) + call RefreshBackpackPage(whichPlayer) +endfunction + +function ChangeToNextFreeBagInBackpack takes player whichPlayer returns integer + local integer playerId= GetPlayerId(whichPlayer) + local integer currentPage= WoWReforgedBackpacks__BackpackPageNumber[playerId] + local integer result= - 1 + local integer index= 0 + local integer j= 0 + local integer i= currentPage + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + exitwhen ( result != - 1 ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + exitwhen ( result != - 1 ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + // empty slot + if ( WoWReforgedBackpacks__BackpackItemType[index] == 0 ) then + set result=i + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + if ( result == - 1 ) then + set i=0 + loop + exitwhen ( i >= currentPage ) + exitwhen ( result != - 1 ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + exitwhen ( result != - 1 ) + set index=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + // empty slot + if ( WoWReforgedBackpacks__BackpackItemType[index] == 0 ) then + set result=i + endif + set j=j + 1 + endloop + set i=i + 1 + endloop + endif + + if ( result != - 1 ) then + call ChangeBackpackPageEx(whichPlayer , result) + endif + + return result +endfunction + +function ChangeToFirstBagInBackpack takes player whichPlayer returns nothing + call ChangeBackpackPageEx(whichPlayer , 0) +endfunction + +function ChangeToLastBagInBackpack takes player whichPlayer returns nothing + call ChangeBackpackPageEx(whichPlayer , BACKPACK_MAX_PAGES - 1) +endfunction + +function ChangeBackpackPage takes player whichPlayer,boolean next returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer page= WoWReforgedBackpacks__BackpackPageNumber[playerId] + local integer newPage= 0 + if ( next ) then + if ( page != ( BACKPACK_MAX_PAGES - 1 ) ) then + set newPage=page + 1 + else + set newPage=0 + endif + else + if ( page != 0 ) then + set newPage=page - 1 + else + set newPage=BACKPACK_MAX_PAGES - 1 + endif + endif + call ChangeBackpackPageEx(whichPlayer , newPage) +endfunction + +function ClearHeroInventory takes unit hero returns nothing + local item slotItem= null + local integer i= 0 + loop + exitwhen ( i >= bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(hero, i) + if ( slotItem != null ) then + call h__RemoveItem(slotItem) + set slotItem=null + endif + set i=i + 1 + endloop +endfunction + +// Starts from left to right and tries to stack all items of the same type which can be stacked or move items to empty slots. +function OrderBackpack takes player whichPlayer returns integer + local integer playerId= GetPlayerId(whichPlayer) + local integer orderedItems= 0 + local integer index1= 0 + local integer index2= 0 + local integer maxCharges1= 0 + local integer charges1= 0 + local integer charges2= 0 + local integer stackedCharges= 0 + local integer itemTypeId1= 0 + local integer itemTypeId2= 0 + local integer i= 0 + local integer j= 0 + local integer k= 0 + local integer l= 0 + local integer countEmptySlotsAfter= 0 + local integer remainingSlotsAfter= 0 + local boolean doneWithCurrentSlot= false + local boolean doneWithAll= false + loop + exitwhen ( i == BACKPACK_MAX_PAGES or doneWithAll ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY or doneWithAll ) + set index1=Index3D(playerId , i , j , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + set itemTypeId1=WoWReforgedBackpacks__BackpackItemType[index1] + set charges1=WoWReforgedBackpacks__BackpackItemCharges[index1] + set maxCharges1=GetMaxStacksByItemTypeId(itemTypeId1) + set doneWithCurrentSlot=itemTypeId1 != 0 and ( charges1 == 0 ) or ( charges1 >= maxCharges1 ) // stop if the slot is already full + set countEmptySlotsAfter=0 + set remainingSlotsAfter=( bj_MAX_INVENTORY - j - 1 ) + IMaxBJ(0, ( BACKPACK_MAX_PAGES - i - 1 )) * bj_MAX_INVENTORY + set k=i + loop + exitwhen ( k >= BACKPACK_MAX_PAGES or doneWithCurrentSlot ) + if ( k == i ) then + set l=j + 1 + else + set l=0 + endif + loop + exitwhen ( l >= bj_MAX_INVENTORY or doneWithCurrentSlot ) + set index2=Index3D(playerId , k , l , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + set itemTypeId2=WoWReforgedBackpacks__BackpackItemType[index2] + set charges2=WoWReforgedBackpacks__BackpackItemCharges[index2] + // stack items + if ( itemTypeId1 != 0 and itemTypeId1 == itemTypeId2 and charges1 > 0 and charges1 < maxCharges1 ) then + set orderedItems=orderedItems + 1 + + set stackedCharges=IMinBJ(charges2, maxCharges1 - charges1) + set charges1=charges1 + stackedCharges + set WoWReforgedBackpacks__BackpackItemCharges[index1]=charges1 + + if ( stackedCharges == charges2 ) then + call ClearBackpackItem(index2) + set countEmptySlotsAfter=countEmptySlotsAfter + 1 + else + set WoWReforgedBackpacks__BackpackItemCharges[index2]=charges2 - stackedCharges + endif + + set doneWithCurrentSlot=charges1 >= maxCharges1 + // move the item to this empty slot + elseif ( itemTypeId1 == 0 and itemTypeId2 != 0 ) then + set orderedItems=orderedItems + 1 + set countEmptySlotsAfter=countEmptySlotsAfter + 1 + + set itemTypeId1=itemTypeId2 + set charges1=charges2 + set maxCharges1=GetMaxStacksByItemTypeId(itemTypeId2) + + call SetBackpackItemFromIndex(index1 , index2) + call ClearBackpackItem(index2) + + set doneWithCurrentSlot=charges1 == 0 or charges1 >= maxCharges1 // stop if it is not stackable + elseif ( itemTypeId2 == 0 ) then + set countEmptySlotsAfter=countEmptySlotsAfter + 1 + endif + set l=l + 1 + endloop + set k=k + 1 + endloop + + //call BJDebugMsg("Remaining slots after " + I2S(remainingSlotsAfter) + " and empty slots " + I2S(countEmptySlotsAfter)) + + // stop early if there are only empty slots remaining + set doneWithAll=( countEmptySlotsAfter >= remainingSlotsAfter ) + + set j=j + 1 + endloop + set i=i + 1 + endloop + call ClearHeroInventory((WoWReforgedBackpacks__Backpack[GetPlayerId((whichPlayer))])) // INLINED!! + call RefreshBackpackPage(whichPlayer) + call UpdateItemsForBackpackUIEvaluate(whichPlayer) + + call h__DisplayTimedTextToPlayer(whichPlayer, 0.00, 0.00, 4.00, ( "Ordered " + I2S(orderedItems) + " items." )) + + return orderedItems endfunction -function GetSaveCodeMaxHeroLevel takes string playerName,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) - local integer xp= GetSaveCodeXp1(saveCode , playerName) - local integer xp2= GetSaveCodeXp2(saveCode , playerName) - local integer xp3= GetSaveCodeXp3(saveCode , playerName) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! +function WoWReforgedBackpacks__TriggerConditionChangeBackpackPage takes nothing returns boolean + return GetSpellAbilityId() == BACKPACK_NEXT_PAGE_ABILITY_ID or GetSpellAbilityId() == BACKPACK_PREVIOUS_PAGE_ABILITY_ID +endfunction - if ( xp2 > xp and xp2 > xp3 ) then - return GetHeroLevelByXP(xp2) - elseif ( xp3 > xp and xp3 > xp2 ) then - return GetHeroLevelByXP(xp3) +function WoWReforgedBackpacks__TriggerFunctionChangeBackpackPage takes nothing returns nothing + if ( GetSpellAbilityId() == BACKPACK_NEXT_PAGE_ABILITY_ID ) then + call ChangeBackpackPage(GetOwningPlayer(GetTriggerUnit()) , true) + elseif ( GetSpellAbilityId() == BACKPACK_PREVIOUS_PAGE_ABILITY_ID ) then + call ChangeBackpackPage(GetOwningPlayer(GetTriggerUnit()) , false) endif - - return GetHeroLevelByXP(xp) + call UpdateItemsForBackpackUIEvaluate(GetOwningPlayer(GetTriggerUnit())) endfunction -function GetSaveCodeBuildingsMax takes nothing returns integer - return 8 +function WoWReforgedBackpacks__TriggerConditionPickupBackpackItem takes nothing returns boolean + local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + return GetTriggerUnit() == WoWReforgedBackpacks__Backpack[playerId] endfunction -function CreateSaveCodeBuildingsTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer buildings,string buildingNames,string saveCode returns nothing - local string singleplayer= "no" - local string singlePlayerFileName= "Multiplayer" - local string gameMode= "Freelancer" - local string gameType= "Normal" - local string content= "" - - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" - endif - - if ( isWarlord ) then - set gameMode="Warlord" - endif +function WoWReforgedBackpacks__TriggerFunctionPickupBackpackItem takes nothing returns nothing + local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + local item whichItem= null + local integer index= 0 + local integer i= 0 + // update the backpack items from the current inventory + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set whichItem=UnitItemInSlot(GetTriggerUnit(), i) + if ( whichItem != null ) then + set index=Index3D(playerId , WoWReforgedBackpacks__BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + call SetBackpackItemFromItem(whichItem , index) + set whichItem=null + endif + set i=i + 1 + endloop + call UpdateItemsForBackpackUIEvaluate(GetOwningPlayer(GetTriggerUnit())) +endfunction - if ( gameTypeNumber == udg_GameTypeEasy ) then - set gameType="Easy" - elseif ( gameTypeNumber == udg_GameTypeFast ) then - set gameType="Fast" - elseif ( gameTypeNumber == udg_GameTypeHardcore ) then - set gameType="Hardcore" - endif +function WoWReforgedBackpacks__TriggerConditionDropBackpackItem takes nothing returns boolean + return GetTriggerUnit() == WoWReforgedBackpacks__Backpack[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] +endfunction - call FileStart() +function WoWReforgedBackpacks__TriggerFunctionDropBackpackItem takes nothing returns nothing + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + local integer playerId= GetPlayerId(owner) + local integer index= 0 + local integer i= 0 + call TriggerSleepAction(0.0) // TODO Apparently the item is still there without sleeping. + loop + exitwhen ( i == bj_MAX_INVENTORY ) + if ( UnitItemInSlot(triggerUnit, i) == null ) then + set index=Index3D(playerId , WoWReforgedBackpacks__BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + //call BJDebugMsg("Dropping item at index " + I2S(index) + " with type " + GetObjectName(BackpackItemType[index])) + set WoWReforgedBackpacks__BackpackItemType[index]=0 + set WoWReforgedBackpacks__BackpackItemCharges[index]=0 + endif + set i=i + 1 + endloop + call UpdateItemsForBackpackUIEvaluate(owner) + set owner=null + set triggerUnit=null +endfunction - set content=content + ("\r\n" + ("Code: -loadb " + saveCode)) // INLINED!! - set content=content + ("\r\n" + ("Buildings: " + I2S(buildings))) // INLINED!! - set content=content + ("\r\n" + ("Building Names: " + buildingNames)) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! +function WoWReforgedBackpacks__IsMoveItemOrder takes integer orderId returns boolean + return orderId >= A_ORDER_ID_MOVE_SLOT_0 and orderId <= A_ORDER_ID_MOVE_SLOT_5 +endfunction - // The line below creates the log - call Preload((content)) // INLINED!! +function WoWReforgedBackpacks__IsRedirectOrder takes integer orderId returns boolean + return orderId == A_ORDER_ID_SMART or orderId == A_ORDER_ID_MOVE or orderId == A_ORDER_ID_DROP_ITEM +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-buildings-" + I2S(buildings) + "-" + buildingNames + ".txt")) // INLINED!! +function WoWReforgedBackpacks__TriggerConditionMoveBackpackItem takes nothing returns boolean + local integer orderId= GetIssuedOrderId() + return GetTriggerUnit() == WoWReforgedBackpacks__Backpack[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] and ( WoWReforgedBackpacks__IsMoveItemOrder(orderId) or WoWReforgedBackpacks__IsRedirectOrder(orderId) ) endfunction +function WoWReforgedBackpacks__TriggerFunctionMoveBackpackItem takes nothing returns nothing + local integer orderId= GetIssuedOrderId() + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + local integer playerId= GetPlayerId(owner) + local integer i= 0 + local item whichItem= null + local integer index= 0 + local item orderTargetItem= GetOrderTargetItem() + local unit orderTargetUnit= GetOrderTargetUnit() + local boolean smartOrder= WoWReforgedBackpacks__IsRedirectOrder(orderId) + local boolean moveItem= WoWReforgedBackpacks__IsMoveItemOrder(orderId) + if ( moveItem ) then + call TriggerSleepAction(0.0) // TODO Apparently the item is still there without sleeping. + //call BJDebugMsg("Moved item!") + // update all items of the current bag after moving the item + set i=0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set index=Index3D(playerId , WoWReforgedBackpacks__BackpackPageNumber[playerId] , i , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) + set whichItem=UnitItemInSlot(triggerUnit, i) + if ( whichItem == null ) then + //call BJDebugMsg("Dropping item at index " + I2S(index) + " with type " + GetObjectName(BackpackItemType[index])) + call ClearBackpackItem(index) + else + call SetBackpackItemFromItem(whichItem , index) + endif + set i=i + 1 + endloop + call UpdateItemsForBackpackUIEvaluate(owner) + elseif ( (udg_Hero[GetPlayerId((owner))]) != null and WoWReforgedBackpacks__IsRedirectOrder(orderId) ) then // INLINED!! + if ( orderTargetItem != null ) then + // redirect order to hero + call IssueTargetOrderById((udg_Hero[GetPlayerId((owner))]), orderId, orderTargetItem) // INLINED!! + elseif ( orderTargetUnit != null ) then + if ( orderId == A_ORDER_ID_DROP_ITEM ) then + if ( DistanceBetweenUnits(triggerUnit , orderTargetUnit) > 200.0 ) then + call IssueTargetOrderById((udg_Hero[GetPlayerId((owner))]), A_ORDER_ID_MOVE, orderTargetUnit) // INLINED!! + endif + else + call IssueTargetOrderById((udg_Hero[GetPlayerId((owner))]), orderId, orderTargetUnit) // INLINED!! + endif + endif + endif + set orderTargetItem=null + set orderTargetUnit=null + set owner=null + set triggerUnit=null +endfunction -function CountUnitsOfTypeFromGroup takes group whichGroup,integer unitTypeId returns integer +function InventoryIsFull takes unit whichUnit,integer itemTypeId returns boolean + local integer size= UnitInventorySize(whichUnit) + local item whichItem= null local integer i= 0 - local integer max= BlzGroupGetSize(whichGroup) - local integer count= 0 - local unit first= null loop - exitwhen ( i >= max ) - set first=BlzGroupUnitAt(whichGroup, i) - if ( GetPrimaryDependencyEquivalent(GetUnitTypeId(first)) == GetPrimaryDependencyEquivalent(unitTypeId) ) then - set count=count + 1 + exitwhen ( i == size ) + set whichItem=UnitItemInSlot(whichUnit, i) + if ( whichItem == null or ( GetItemTypeId(whichItem) == itemTypeId and GetMaxStacksByItemTypeId(itemTypeId) > GetItemCharges(whichItem) ) ) then + return false endif - set first=null + set whichItem=null set i=i + 1 endloop - //call BJDebugMsg("Count unit type " + GetObjectName(unitTypeId) + " with count " + I2S(i)) + return true +endfunction - return count +function WoWReforgedBackpacks__TriggerConditionOrderBackpackItem takes nothing returns boolean + return (udg_Hero[GetPlayerId((GetOwningPlayer(GetTriggerUnit())))]) == GetTriggerUnit() and GetIssuedOrderId() == A_ORDER_ID_SMART and GetOrderTargetItem() != null and not IsItemPowerup(GetOrderTargetItem()) and InventoryIsFull(GetTriggerUnit() , GetItemTypeId(GetOrderTargetItem())) // INLINED!! endfunction -function DistinctGroup takes group whichGroup returns group +// This code is directly taken from the system "EasyItemStacknSplit v2.7.4" and allows picking up items even if the inventory is full. +function WoWReforgedBackpacks__TimerFunctionPickupItem takes nothing returns nothing local integer i= 0 - local integer max= BlzGroupGetSize(whichGroup) - local group result= CreateGroup() - local unit first= null + local player slotPlayer= null + local unit hero= null + local item targetItem= null + local boolean noTargets= true + local real x= 0.0 + local real y= 0.0 + local integer order= 0 + set i=0 loop - exitwhen ( i >= max ) - set first=BlzGroupUnitAt(whichGroup, i) - //call BJDebugMsg("First: " + GetUnitName(first)) - exitwhen ( first == null ) - if ( CountUnitsOfTypeFromGroup(result , GetPrimaryDependencyEquivalent(GetUnitTypeId(first))) == 0 ) then - call GroupAddUnit(result, first) - //call BJDebugMsg("Add to distinct") + exitwhen ( i >= bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + set hero=(udg_Hero[GetPlayerId((slotPlayer))]) // INLINED!! + set targetItem=WoWReforgedBackpacks__BackpackTargetItem[i] + if ( targetItem != null and hero != null ) then + //call BJDebugMsg("Update backpack for player " + GetPlayerName(slotPlayer) + " with target item " + GetItemName(targetItem) + ".") + if ( GetWidgetLife(hero) > 0.0 and GetWidgetLife(targetItem) > 0.0 ) then + //call BJDebugMsg("Order to item with full inventory periodically.") + if ( GetUnitCurrentOrder(hero) == 851986 ) then // move + set x=GetItemX(targetItem) - GetUnitX(hero) + set y=GetItemY(targetItem) - GetUnitY(hero) + + if ( x * x + y * y <= 22500 ) then + call IssueImmediateOrder(hero, "stop") + // TODO play fake sound + call SetUnitFacing(hero, bj_RADTODEG * Atan2(GetItemY(targetItem) - GetUnitY(hero), GetItemX(targetItem) - GetUnitX(hero))) + + if ( CanItemBePickedUp(targetItem , hero) ) then + if ( not AddItemToBackpackForPlayer(slotPlayer , targetItem) ) then + call SimError(slotPlayer , "Inventory is full.") + endif + else + call SimError(slotPlayer , GetItemName(targetItem) + " cannot be picked up: " + GetItemPickupErrorReason(targetItem , hero)) + endif + set WoWReforgedBackpacks__BackpackTargetItem[i]=null + endif + endif + else + //call BJDebugMsg("Reset ordering to item with full inventory.") + set WoWReforgedBackpacks__BackpackTargetItem[i]=null + endif + + if ( WoWReforgedBackpacks__BackpackTargetItem[i] != null ) then + set noTargets=false + endif endif - set first=null + set hero=null + set targetItem=null + set slotPlayer=null set i=i + 1 endloop - - if ( bj_wantDestroyGroup ) then - call GroupClear(whichGroup) - call DestroyGroup(whichGroup) - set whichGroup=null - set bj_wantDestroyGroup=false + if ( noTargets ) then + set WoWReforgedBackpacks__BackpackPickupTimerHasStarted=false + call PauseTimer(GetExpiredTimer()) endif - - return result endfunction - -function WoWReforgedSaveCodes___FilterIsUnitType takes nothing returns boolean - return GetPrimaryDependencyEquivalent(GetUnitTypeId(GetFilterUnit())) == WoWReforgedSaveCodes___tmpFilterId +function WoWReforgedBackpacks__TriggerFunctionOrderBackpackItem takes nothing returns nothing + local unit hero= GetTriggerUnit() + local player owner= GetOwningPlayer(hero) + local integer playerId= GetPlayerId(owner) + local item whichItem= GetOrderTargetItem() + //call BJDebugMsg("Order to item with full inventory start.") + set WoWReforgedBackpacks__BackpackTargetItem[playerId]=whichItem + if ( not WoWReforgedBackpacks__BackpackPickupTimerHasStarted ) then + set WoWReforgedBackpacks__BackpackPickupTimerHasStarted=true + call TimerStart(WoWReforgedBackpacks__BackpackPickupTimer, 0.05, true, function WoWReforgedBackpacks__TimerFunctionPickupItem) + endif + call IssuePointOrder(GetTriggerUnit(), "move", GetItemX(whichItem), GetItemY(whichItem)) + set hero=null + set owner=null + set whichItem=null endfunction -function CountUnitsOfType takes player whichPlayer,integer id returns integer - local group g= CreateGroup() - local integer count= 0 - set WoWReforgedSaveCodes___tmpFilterId=id - call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function WoWReforgedSaveCodes___FilterIsUnitType)) - set count=BlzGroupGetSize(g) - call GroupClear(g) - call DestroyGroup(g) - set g=null - return count +function CreateBackpackForPlayer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + set WoWReforgedBackpacks__Backpack[playerId]=CreateUnit(whichPlayer, BACK_PACK, GetUnitX((udg_Hero[GetPlayerId((whichPlayer))])), GetUnitY((udg_Hero[GetPlayerId((whichPlayer))])), 0.00) // INLINED!! + call SuspendHeroXP(WoWReforgedBackpacks__Backpack[playerId], true) + call SetUnitInvulnerable(WoWReforgedBackpacks__Backpack[playerId], true) + call BlzSetUnitName(WoWReforgedBackpacks__Backpack[playerId], "Bag 1") + // Change Ruckack Page Trigger + if ( WoWReforgedBackpacks__BackpackTriggerChangePage[playerId] == null ) then + set WoWReforgedBackpacks__BackpackTriggerChangePage[playerId]=CreateTrigger() + call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks__BackpackTriggerChangePage[playerId], whichPlayer, EVENT_PLAYER_UNIT_SPELL_CHANNEL, null) + call TriggerAddCondition(WoWReforgedBackpacks__BackpackTriggerChangePage[playerId], Condition(function WoWReforgedBackpacks__TriggerConditionChangeBackpackPage)) + call TriggerAddAction(WoWReforgedBackpacks__BackpackTriggerChangePage[playerId], function WoWReforgedBackpacks__TriggerFunctionChangeBackpackPage) + endif + if ( WoWReforgedBackpacks__BackpackTriggerPickup[playerId] == null ) then + set WoWReforgedBackpacks__BackpackTriggerPickup[playerId]=CreateTrigger() + call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks__BackpackTriggerPickup[playerId], whichPlayer, EVENT_PLAYER_UNIT_PICKUP_ITEM, null) + call TriggerAddCondition(WoWReforgedBackpacks__BackpackTriggerPickup[playerId], Condition(function WoWReforgedBackpacks__TriggerConditionPickupBackpackItem)) + call TriggerAddAction(WoWReforgedBackpacks__BackpackTriggerPickup[playerId], function WoWReforgedBackpacks__TriggerFunctionPickupBackpackItem) + endif + if ( WoWReforgedBackpacks__BackpackTriggerDrop[playerId] == null ) then + set WoWReforgedBackpacks__BackpackTriggerDrop[playerId]=CreateTrigger() + call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks__BackpackTriggerDrop[playerId], whichPlayer, EVENT_PLAYER_UNIT_DROP_ITEM, null) + call TriggerAddCondition(WoWReforgedBackpacks__BackpackTriggerDrop[playerId], Condition(function WoWReforgedBackpacks__TriggerConditionDropBackpackItem)) + call TriggerAddAction(WoWReforgedBackpacks__BackpackTriggerDrop[playerId], function WoWReforgedBackpacks__TriggerFunctionDropBackpackItem) + endif + if ( WoWReforgedBackpacks__BackpackTriggerMove[playerId] == null ) then + set WoWReforgedBackpacks__BackpackTriggerMove[playerId]=CreateTrigger() + call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks__BackpackTriggerMove[playerId], whichPlayer, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null) + call TriggerAddCondition(WoWReforgedBackpacks__BackpackTriggerMove[playerId], Condition(function WoWReforgedBackpacks__TriggerConditionMoveBackpackItem)) + call TriggerAddAction(WoWReforgedBackpacks__BackpackTriggerMove[playerId], function WoWReforgedBackpacks__TriggerFunctionMoveBackpackItem) + endif + if ( WoWReforgedBackpacks__BackpackTriggerOrder[playerId] == null ) then + set WoWReforgedBackpacks__BackpackTriggerOrder[playerId]=CreateTrigger() + call TriggerRegisterPlayerUnitEvent(WoWReforgedBackpacks__BackpackTriggerOrder[playerId], whichPlayer, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null) + call TriggerAddCondition(WoWReforgedBackpacks__BackpackTriggerOrder[playerId], Condition(function WoWReforgedBackpacks__TriggerConditionOrderBackpackItem)) + call TriggerAddAction(WoWReforgedBackpacks__BackpackTriggerOrder[playerId], function WoWReforgedBackpacks__TriggerFunctionOrderBackpackItem) + endif endfunction -function FilterIsLivingBuildingToBeSaved takes nothing returns boolean - return IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) and IsUnitAliveBJ(GetFilterUnit()) and GetSaveObjectBuildingType(GetPrimaryDependencyEquivalent(GetUnitTypeId(GetFilterUnit()))) != - 1 +function RefreshBackpackForPlayer takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + if ( WoWReforgedBackpacks__Backpack[playerId] != null ) then + call DisableItemPickupTriggers(whichPlayer) + call h__RemoveUnit(WoWReforgedBackpacks__Backpack[playerId]) + set WoWReforgedBackpacks__Backpack[playerId]=null + call EnableItemPickupTriggers(whichPlayer) + endif + call CreateBackpackForPlayer(whichPlayer) + call RefreshBackpackPage(whichPlayer) + call UpdateItemsForBackpackUIEvaluate(whichPlayer) endfunction -function GetPlayerBuildingsOrderedByPriority takes player whichPlayer,integer index returns group - local group whichGroup= CreateGroup() - local group buildingsToBeSaved= CreateGroup() - local unit first= null +function WoWReforgedBackpacks__TimerFunctionUpdateLocationsOfBackpackAndEquipmentBags takes nothing returns nothing + local player slotPlayer= null + local unit hero1= null + local integer countEquipmentBags= 0 local integer i= 0 - local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) - call GroupAddGroup(udg_SaveCodeIncludedUnits[convertedPlayerId], buildingsToBeSaved) - set bj_wantDestroyGroup=true - call GroupAddGroup(GetUnitsOfPlayerMatching(whichPlayer, Filter(function FilterIsLivingBuildingToBeSaved)), buildingsToBeSaved) - call GroupRemoveGroup(udg_SaveCodeExcludedUnits[convertedPlayerId], buildingsToBeSaved) + local real x= 0.0 + local real y= 0.0 + local integer j= 0 + local unit bag= null loop - set first=FirstOfGroup(buildingsToBeSaved) - exitwhen ( first == null or i >= ( index + 1 ) * SAVE_CODE_MAX_BUILDINGS ) - if ( i >= index * SAVE_CODE_MAX_BUILDINGS and i < ( index + 1 ) * SAVE_CODE_MAX_BUILDINGS and not IsUnitInGroup(first, whichGroup) ) then - call GroupAddUnit(whichGroup, first) + exitwhen ( i == bj_MAX_PLAYERS ) + if ( PlayerIsOnlineUser(i) ) then + set slotPlayer=Player(i) + set hero1=(udg_Hero[GetPlayerId((slotPlayer))]) // INLINED!! + if ( hero1 != null ) then + // get hero position even in transporter + set x=GetUnitActualX(hero1) + set y=GetUnitActualY(hero1) + else + set x=GetStartLocationX(i) + set y=GetStartLocationY(i) + endif + + if ( WoWReforgedBackpacks__Backpack[i] != null ) then + set bag=WoWReforgedBackpacks__Backpack[i] + call SetUnitX(bag, x) + call SetUnitY(bag, y) + set bag=null + endif + + if ( (udg_EquipmentBags[GetConvertedPlayerId((slotPlayer))]) != null ) then // INLINED!! + set countEquipmentBags=BlzGroupGetSize((udg_EquipmentBags[GetConvertedPlayerId((slotPlayer))])) // INLINED!! + set j=0 + loop + exitwhen ( j == countEquipmentBags ) + set bag=BlzGroupUnitAt((udg_EquipmentBags[GetConvertedPlayerId((slotPlayer))]), j) // INLINED!! + call SetUnitX(bag, x) + call SetUnitY(bag, y) + // update hero stats for replaced hero spells + if ( hero1 != null ) then + call SetHeroStr(bag, GetHeroStr(hero1, false), true) + //call SetHeroStr(bag, GetHeroStrBonus(hero1), false) + call SetHeroAgi(bag, GetHeroAgi(hero1, false), true) + //call SetHeroAgi(bag, GetHeroAgiBonus(hero1), false) + call SetHeroInt(bag, GetHeroInt(hero1, false), true) + //call SetHeroInt(bag, GetHeroIntBonus(hero1), false) + else + call SetHeroStr(bag, 10, true) + //call SetHeroStr(bag, 0, false) + call SetHeroAgi(bag, 10, true) + //call SetHeroAgi(bag, 0, false) + call SetHeroInt(bag, 10, true) + //call SetHeroInt(bag, 0, false) + endif + set bag=null + set j=j + 1 + endloop + endif + set hero1=null + set slotPlayer=null endif - call GroupRemoveUnit(buildingsToBeSaved, first) set i=i + 1 endloop +endfunction - call GroupClear(buildingsToBeSaved) - call DestroyGroup(buildingsToBeSaved) - set buildingsToBeSaved=null - - return whichGroup +function GetBackpackUpdateLocatiomTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedBackpacks__BackpackUpdateLocationTimer) endfunction -function GetAbsCoordinate takes real coordinate,real min returns real - return RAbsBJ(min) + coordinate +function WoWReforgedBackpacks__Init takes nothing returns nothing + local integer i= 0 + loop + set WoWReforgedBackpacks__BackpackPlayerBagInfo[i]=true + set i=i + 1 + exitwhen ( i == bj_MAX_PLAYERS ) + endloop + call TimerStart(WoWReforgedBackpacks__BackpackUpdateLocationTimer, BACKPACK_MOVE_INTERVAL, true, function WoWReforgedBackpacks__TimerFunctionUpdateLocationsOfBackpackAndEquipmentBags) endfunction -function GetAbsCoordinateX takes real coordinate returns real - local rect worldBounds= GetWorldBounds() - local real x= GetAbsCoordinate(coordinate , GetRectMinX(worldBounds)) - call RemoveRect(worldBounds) - set worldBounds=null - return x -endfunction +//library WoWReforgedBackpacks ends +//library WoWReforgedBackpackUI: -function GetAbsCoordinateY takes real coordinate returns real - local rect worldBounds= GetWorldBounds() - local real y= GetAbsCoordinate(coordinate , GetRectMinY(worldBounds)) - call RemoveRect(worldBounds) - set worldBounds=null - return y +function UpdateItemsForBackpackUI takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer itemTypeId= 0 + local integer index= 0 + local integer i= 0 + local integer j= 0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index2D(i , j , bj_MAX_INVENTORY) + set itemTypeId=(WoWReforgedBackpacks__BackpackItemType[(index)]) // INLINED!! + //call BlzFrameSetTexture(BackpackItemFrame[index], GetIconByItemType(udg_RucksackItemType[index]), 0, true) + if ( itemTypeId == 0 ) then + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackItemBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], false) + else + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackItemBackdropFrame[index], GetIconByItemType(itemTypeId), 0, true) + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], I2S((WoWReforgedBackpacks__BackpackItemCharges[(index)]))) // INLINED!! + if ( WoWReforgedBackpackUI___BackpackUIVisible[playerId] and (WoWReforgedBackpacks__BackpackItemCharges[(index)]) > 0 ) then // INLINED!! + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], true) + endif + endif + endif + set j=j + 1 + endloop + set i=i + 1 + endloop endfunction -function ConvertAbsCoordinate takes real coordinate,real min returns real - return coordinate - RAbsBJ(min) +function BackpackUIExists takes nothing returns boolean + return WoWReforgedBackpackUI___BackpackBackgroundFrame != null endfunction -function ConvertAbsCoordinateX takes real coordinate returns real - local rect worldBounds= GetWorldBounds() - local real x= (((coordinate )*1.0) - RAbsBJ((( GetRectMinX(worldBounds))*1.0))) // INLINED!! - call RemoveRect(worldBounds) - set worldBounds=null - - return x +function WoWReforgedBackpackUI___TriggerActionSyncData takes nothing returns nothing + local player whichPlayer= GetTriggerPlayer() + local string prefix= BlzGetTriggerSyncPrefix() + local string data= BlzGetTriggerSyncData() + local integer bag= S2I(data) + call ChangeBackpackPageEx(whichPlayer , bag) + set whichPlayer=null endfunction -function ConvertAbsCoordinateY takes real coordinate returns real - local rect worldBounds= GetWorldBounds() - local real y= (((coordinate )*1.0) - RAbsBJ((( GetRectMinY(worldBounds))*1.0))) // INLINED!! - call RemoveRect(worldBounds) - set worldBounds=null - - return y +function WoWReforgedBackpackUI___SyncBag takes nothing returns nothing + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 1))) // INLINED!! + local integer bag= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 2))) // INLINED!! + local integer slot= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 3))) // INLINED!! + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "Changed to bag " + I2S(bag + 1) + ".") + call BlzSendSyncData("BackpackUI", I2S(bag)) + endif endfunction -function GetSaveCodeBuildingsEx2 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner,group b returns string - local integer playerNameHash= CompressedAbsStringHash(playerName) - local string result= "" - local integer max= BlzGroupGetSize(b) - local unit first= null - local integer id= - 1 +function ShowBackpackUI takes player whichPlayer returns nothing local integer i= 0 - local integer buildingsCounter= 0 - local string buildingNames= "" - - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - - //call BJDebugMsg("Size of buildings: " + I2S(CountUnitsInGroup(buildings))) - - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_BUILDINGS) - set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) - set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) - set result=result + ConvertDecimalNumberToSaveCodeSegment(index) - - // 5 buildings with their locations + local integer j= 0 + local integer index= 0 + local integer playerId= GetPlayerId(whichPlayer) + if ( not (WoWReforgedBackpackUI___BackpackBackgroundFrame != null) ) then // INLINED!! + return + endif + set WoWReforgedBackpackUI___BackpackUIVisible[playerId]=true + call UpdateItemsForBackpackUI(whichPlayer) + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackBackgroundFrame, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTitleFrame, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___Checkbox, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackCloseButton, true) + //call BlzFrameSetVisible(BackpackItemGoldFrame[GetPlayerId(whichPlayer)], true) + //call BlzFrameSetVisible(BackpackItemGoldIconFrame[GetPlayerId(whichPlayer)], true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipIcon, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipModel, false) + endif set i=0 loop - exitwhen ( i >= SAVE_CODE_MAX_BUILDINGS or i >= max ) - set first=BlzGroupUnitAt(b, i) - set id=GetSaveObjectBuildingType(GetPrimaryDependencyEquivalent(GetUnitTypeId(first))) - if ( id != - 1 ) then - //call BJDebugMsg("Saving building: " + GetObjectName(GetUnitTypeId(first))) - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - //call BJDebugMsg("Saving building X: " + GetObjectName(GetUnitTypeId(first)) + ": " + I2S(R2I(GetUnitX(first)))) - //call BJDebugMsg("Saving building X: " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetUnitX(first))) - //call BJDebugMsg("Saving building X (absolute): " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetAbsCoordinateX(GetUnitX(first)))) - set result=result + ConvertDecimalNumberToSaveCodeSegment(R2I(GetAbsCoordinateX(GetUnitX(first)))) - //call BJDebugMsg("Saving building Y: " + GetObjectName(GetUnitTypeId(first)) + ": " + I2S(R2I(GetUnitY(first)))) - //call BJDebugMsg("Saving building Y: " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetUnitY(first))) - //call BJDebugMsg("Saving building Y (absolute): " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetAbsCoordinateY(GetUnitX(first)))) - set result=result + ConvertDecimalNumberToSaveCodeSegment(R2I(GetAbsCoordinateY(GetUnitY(first)))) - set buildingsCounter=buildingsCounter + 1 - if ( buildingNames != "" ) then - set buildingNames=buildingNames + "," + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index2D(i , j , bj_MAX_INVENTORY) + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemFrame[index], true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBackdropFrame[index], true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], WoWReforgedBackpackUI___Checked[playerId]) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBagFrame[index], WoWReforgedBackpackUI___Checked[playerId]) endif - set buildingNames=buildingNames + GetUnitName(first) - else - //call BJDebugMsg("Not registered save object type for " + GetUnitName(first)) - endif - set first=null + if ( (WoWReforgedBackpacks__BackpackItemType[(index)]) != 0 and GetItemTypePerishable((WoWReforgedBackpacks__BackpackItemType[(index)])) ) then // INLINED!! + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], true) + endif + endif + set j=j + 1 + endloop set i=i + 1 endloop +endfunction - // fill rest +function HideBackpackUI takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local integer i= 0 + local integer j= 0 + local integer index= 0 + if ( not (WoWReforgedBackpackUI___BackpackBackgroundFrame != null) ) then // INLINED!! + return + endif + set WoWReforgedBackpackUI___BackpackUIVisible[playerId]=false + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackBackgroundFrame, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTitleFrame, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___Checkbox, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackCloseButton, false) + //call BlzFrameSetVisible(BackpackItemGoldFrame[GetPlayerId(whichPlayer)], false) + //call BlzFrameSetVisible(BackpackItemGoldIconFrame[GetPlayerId(whichPlayer)], false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipIcon, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipModel, false) + endif + set i=0 loop - exitwhen ( i >= SAVE_CODE_MAX_BUILDINGS ) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index2D(i , j , bj_MAX_INVENTORY) + if ( whichPlayer == GetLocalPlayer() ) then + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemFrame[index], false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBackdropFrame[index], false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBagFrame[index], false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], false) + endif + set j=j + 1 + endloop set i=i + 1 endloop +endfunction - //call BJDebugMsg("Compressed result: " + result) - //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) - //call BJDebugMsg("Checked save code part: " + result) - - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) +function HideBackpackUIForAllPlayers takes nothing returns nothing + local integer i= 0 + if ( (WoWReforgedBackpackUI___BackpackBackgroundFrame != null) ) then // INLINED!! + loop + exitwhen ( i == bj_MAX_PLAYERS ) + call HideBackpackUI(Player(i)) + set i=i + 1 + endloop + endif +endfunction - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) +function BackpackClickItemFunction takes nothing returns nothing + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call WoWReforgedBackpackUI___SyncBag() endif +endfunction - if ( buildingsCounter > 0 ) then - if ( writeFile ) then - call CreateSaveCodeBuildingsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , buildingsCounter , buildingNames , result) - endif +function WoWReforgedBackpackUI___EnterItemFunction takes nothing returns nothing + local integer playerId= GetPlayerId(GetTriggerPlayer()) + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 1))) // INLINED!! + local integer bag= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 2))) // INLINED!! + local integer slot= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 3))) // INLINED!! + local string tooltip= "Empty slot " + I2S(slot + 1) + " at bag " + I2S(bag + 1) + "." + local integer itemTypeId= (WoWReforgedBackpacks__BackpackItemType[(index)]) // INLINED!! + local integer c= 0 + local integer cDefault= 0 + //call BJDebugMsg("Entering item " + I2S(index)) - call AddGeneratedSaveCode(result) - endif + if ( itemTypeId != 0 ) then + if ( (WoWReforgedBackpacks__BackpackItemPawnable[(index)]) ) then // INLINED!! + set tooltip=GetObjectName(itemTypeId) + + if ( (WoWReforgedBackpacks__BackpackItemCharges[(index)]) > 1 ) then // INLINED!! + set tooltip=tooltip + " (|cffffcc00" + I2S((WoWReforgedBackpacks__BackpackItemCharges[(index)])) + "|r)" // INLINED!! + endif + + set tooltip=tooltip + "|n" - return result -endfunction + if ( GetItemValueGold(itemTypeId) > 0 ) then + //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], true) + set tooltip=tooltip + "|cffFCD20D" + I2S(IMaxBJ(1, (WoWReforgedBackpacks__BackpackItemCharges[(index)])) * GetItemValueGold(itemTypeId)) + " Gold|r" // INLINED!! + else + //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], false) + endif -function GetSaveCodeBuildingsEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner returns string - local group buildings= GetPlayerBuildingsOrderedByPriority(owner , index) - local string result= GetSaveCodeBuildingsEx2(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , owner , buildings) + if ( GetItemValueLumber(itemTypeId) > 0 ) then + if ( GetItemValueGold(itemTypeId) > 0 ) then + set tooltip=tooltip + " " + endif - call GroupClear(buildings) - call DestroyGroup(buildings) - set buildings=null + set tooltip=tooltip + "|cffFCD20D" + I2S(IMaxBJ(1, (WoWReforgedBackpacks__BackpackItemCharges[(index)])) * GetItemValueLumber(itemTypeId)) + " Lumber|r" // INLINED!! + endif + else + //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], false) + set tooltip=GetObjectName(itemTypeId) + "|n|n" + (WoWReforgedBackpacks__BackpackItemTooltipExtended[(index)]) // INLINED!! + endif + else + //call BlzFrameSetVisible(BackpackItemGoldIconFrame[playerId], false) + endif + + if ( itemTypeId != 0 ) then + set c=GetPagedButtonsConfig(itemTypeId) + set cDefault=GetPagedButtonsConfig(0) + + if ( (WoWReforgedBackpacks__BackpackItemPawnable[(index)]) ) then // INLINED!! + set tooltip=tooltip + "|n|n|cff808080Drop item on shop to sell|R|n" + (WoWReforgedBackpacks__BackpackItemTooltipExtended[(index)]) // INLINED!! + endif - return result -endfunction + if ( (WoWReforgedBackpacks__BackpackItemPlayer[(index)]) != null and (WoWReforgedBackpacks__BackpackItemPlayer[(index)]) != Player(PLAYER_NEUTRAL_PASSIVE) ) then // INLINED!! + set tooltip=tooltip + "|n|nOwner: " + GetPlayerNameColored((WoWReforgedBackpacks__BackpackItemPlayer[(index)])) // INLINED!! + endif + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackTooltipIcon, GetIconByItemType(itemTypeId), 0, false) + //call BJDebugMsg("Icon " + GetIconByItemType(itemTypeId) + " for item type " + GetObjectName(itemTypeId)) + + if ( c != 0 ) then + call BlzFrameSetModel(WoWReforgedBackpackUI___BackpackTooltipModel, s__PagedButtonsConfig_modelPath[c], 1) + call BlzFrameSetScale(WoWReforgedBackpackUI___BackpackTooltipModel, s__PagedButtonsConfig_modelScale[c]) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipModel, FRAMEPOINT_CENTER, s__PagedButtonsConfig_modelX[c], s__PagedButtonsConfig_modelY[c]) + else + call BlzFrameSetModel(WoWReforgedBackpackUI___BackpackTooltipModel, GetItemTypeModel(itemTypeId), 0) + call BlzFrameSetScale(WoWReforgedBackpackUI___BackpackTooltipModel, s__PagedButtonsConfig_modelScale[cDefault]) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipModel, FRAMEPOINT_CENTER, s__PagedButtonsConfig_modelX[cDefault], s__PagedButtonsConfig_modelY[cDefault]) + endif + call BlzFrameSetSpriteAnimate(WoWReforgedBackpackUI___BackpackTooltipModel, 2, 0) + + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipIcon, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipModel, true) + endif + else + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipIcon, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipModel, false) + endif + endif -function GetSaveCodeBuildingsForIndex takes player whichPlayer,boolean writeFile,integer index returns string - local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) - local boolean isSinglePlayer= IsInSinglePlayer() - local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] - local integer gameType= udg_GameType - local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) + set tooltip=tooltip + "|n|n|cff808080Click to open the bag.|R|n" - return GetSaveCodeBuildingsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, tooltip) + endif endfunction -function GetSaveCodeBuildings takes player whichPlayer returns string - return GetSaveCodeBuildingsForIndex(whichPlayer , true , 0) +function WoWReforgedBackpackUI___LeaveItemFunction takes nothing returns nothing + local integer playerId= GetPlayerId(GetTriggerPlayer()) + local integer index= (LoadInteger(udg_DB, GetHandleId((GetTriggeringTrigger() )), ( 1))) // INLINED!! + //call BJDebugMsg("Leave item " + I2S(index)) + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackTooltipIcon, "", 0, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipIcon, false) + call BlzFrameSetModel(WoWReforgedBackpackUI___BackpackTooltipModel, "", 0) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipModel, false) + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "") + endif endfunction -function GetAllSaveCodeBuildings takes player whichPlayer returns nothing - local integer i= 0 - local integer max= (8) // INLINED!! - loop - exitwhen ( i == max ) - call GetSaveCodeBuildingsForIndex(whichPlayer , true , i) - set i=i + 1 - endloop +function WoWReforgedBackpackUI___CheckedFunction takes nothing returns nothing + set WoWReforgedBackpackUI___Checked[GetPlayerId(GetTriggerPlayer())]=true + call ShowBackpackUI(GetTriggerPlayer()) +endfunction + +function WoWReforgedBackpackUI___UncheckedFunction takes nothing returns nothing + set WoWReforgedBackpackUI___Checked[GetPlayerId(GetTriggerPlayer())]=false + call ShowBackpackUI(GetTriggerPlayer()) endfunction -function IsObjectFromPlayerRace takes integer objectID,player whichPlayer returns boolean - local integer objectRace= GetObjectRace(objectID) - return PlayerHasUnlockedRace(whichPlayer , GetObjectRace(objectID)) +function WoWReforgedBackpackUI___CheckboxEnterItemFunction takes nothing returns nothing + local integer playerId= GetPlayerId(GetTriggerPlayer()) + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "Hide bag numbers.") + endif endfunction -function DisplayObjectRaceLoadSuccess takes integer objectID,player whichPlayer returns nothing - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 8.0, "Successfully loaded " + GetObjectName(objectID) + "!") +function WoWReforgedBackpackUI___CheckboxLeaveItemFunction takes nothing returns nothing + local integer playerId= GetPlayerId(GetTriggerPlayer()) + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "") + endif endfunction -function DisplayObjectRaceLoadError takes integer objectID,player whichPlayer returns nothing - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 8.0, "Unable to load " + GetObjectName(objectID) + " since it does not belong to your chosen race(s)!") +function WoWReforgedBackpackUI___CloseFunction takes nothing returns nothing + call HideBackpackUI(GetTriggerPlayer()) endfunction -function ApplySaveCodeBuildings takes player whichPlayer,string s returns boolean - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! +function CreateBackpackUI takes nothing returns nothing local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer id= 0 + local integer j= 0 local real x= 0.0 local real y= 0.0 - local boolean atLeastOne= false - - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + local integer index= 0 - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) + set WoWReforgedBackpackUI___BackpackBackgroundFrame=CreateFullScreenFrame() + set WoWReforgedBackpackUI___BackpackTitleFrame=CreateFullScreenTitle("BackpackTitle" , "Backpack") + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTitleFrame, false) - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) + set x=WoWReforgedBackpackUI___UI_SLOT_X + set y=WoWReforgedBackpackUI___UI_SLOT_Y + set i=0 + loop + exitwhen ( i == BACKPACK_MAX_PAGES ) + set j=0 + loop + exitwhen ( j == bj_MAX_INVENTORY ) + set index=Index2D(i , j , bj_MAX_INVENTORY) + set WoWReforgedBackpackUI___BackpackItemFrame[index]=BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemFrame[index], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemFrame[index], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE, y - WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE) + //call BlzFrameSetTexture(BackpackItemFrame[index], GetIconByItemType(0), 0, true) + //call BlzFrameSetText(BackpackItemFrame[index], I2S(index)) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemFrame[index], false) - if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then - set i=0 - loop - exitwhen ( i == SAVE_CODE_MAX_BUILDINGS ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdBuilding[(saveObject)]) // INLINED!! - set id=saveObjectId - if ( not IsObjectFromPlayerRace(id , whichPlayer) ) then - set id=(MapRaceObjectType((id ) , ( (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))])))) // INLINED!! - endif - - if ( id != 0 and IsObjectFromPlayerRace(id , whichPlayer) ) then - set x=ConvertAbsCoordinateX(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)))) // INLINED!! - set y=ConvertAbsCoordinateY(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 2) , SAVE_CODE_DIGITS)))) // INLINED!! - //call BJDebugMsg("Loading building " + GetObjectName(saveObjectId) + " at " + R2S(x) + "|" + R2S(y)) - call CreateUnit(whichPlayer, id, x, y, bj_UNIT_FACING) - set atLeastOne=true - call PingMinimapForPlayer(whichPlayer, x, y, 4.0) - call DisplayObjectRaceLoadSuccess(id , whichPlayer) - else - call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) - endif - endif - set i=i + 1 - set pos=pos + 3 - endloop + set WoWReforgedBackpackUI___BackpackItemBackdropFrame[index]=BlzCreateFrameByType("BACKDROP", "BackdropFrame" + I2S(index), WoWReforgedBackpackUI___BackpackItemFrame[index], "", 1) + call BlzFrameSetAllPoints(WoWReforgedBackpackUI___BackpackItemBackdropFrame[index], WoWReforgedBackpackUI___BackpackItemFrame[index]) +// call BlzFrameSetTexture(BackpackItemBackdropFrame[index], "UI\\Widgets\\Console\\Human\\human-inventory-slotfiller.blp", 0, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBackdropFrame[index], false) + + set WoWReforgedBackpackUI___BackpackItemTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___BackpackItemTrigger[index], WoWReforgedBackpackUI___BackpackItemFrame[index], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedBackpackUI___BackpackItemTrigger[index], function BackpackClickItemFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI___BackpackItemTrigger[index] )), ( 1 ), ( index)) // INLINED!! + call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI___BackpackItemTrigger[index] )), ( 2 ), ( i)) // INLINED!! + call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI___BackpackItemTrigger[index] )), ( 3 ), ( j)) // INLINED!! + + set WoWReforgedBackpackUI___BackpackItemTooltipOnTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___BackpackItemTooltipOnTrigger[index], WoWReforgedBackpackUI___BackpackItemFrame[index], FRAMEEVENT_MOUSE_ENTER) + call TriggerAddAction(WoWReforgedBackpackUI___BackpackItemTooltipOnTrigger[index], function WoWReforgedBackpackUI___EnterItemFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI___BackpackItemTooltipOnTrigger[index] )), ( 1 ), ( index)) // INLINED!! + call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI___BackpackItemTooltipOnTrigger[index] )), ( 2 ), ( i)) // INLINED!! + call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI___BackpackItemTooltipOnTrigger[index] )), ( 3 ), ( j)) // INLINED!! + + set WoWReforgedBackpackUI___BackpackItemTooltipOffTrigger[index]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___BackpackItemTooltipOffTrigger[index], WoWReforgedBackpackUI___BackpackItemFrame[index], FRAMEEVENT_MOUSE_LEAVE) + call TriggerAddAction(WoWReforgedBackpackUI___BackpackItemTooltipOffTrigger[index], function WoWReforgedBackpackUI___LeaveItemFunction) + call SaveInteger(udg_DB, GetHandleId((WoWReforgedBackpackUI___BackpackItemTooltipOffTrigger[index] )), ( 1 ), ( index)) // INLINED!! - call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) + // TODO Mouse down and mouse up to drag & drop to another bag or switch or do it like Warcraft's inventory with right click and left click. Add the icon of the item to the mouse cursor. If you click on the map it is dropped, if you click on the inventory it is dropped there. - if ( atLeastOne ) then - call AddGeneratedSaveCode(s) - endif + set WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index]=BlzCreateFrameByType("BACKDROP", "ItemBagBackrgroundFrame" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedBackpackUI___BACKPACK_UI_CHARGES_BACKGROUND_SIZE, y - WoWReforgedBackpackUI___BACKPACK_UI_CHARGES_BACKGROUND_SIZE) + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], false) + call BlzFrameSetLevel(WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], 1) + + set WoWReforgedBackpackUI___BackpackItemBagFrame[index]=BlzCreateFrameByType("TEXT", "bag" + I2S(index), WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedBackpackUI___BackpackItemBagFrame[index], WoWReforgedBackpackUI___BackpackItemBagBackgroundFrame[index]) + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackItemBagFrame[index], I2S(i + 1)) + call BlzFrameSetTextAlignment(WoWReforgedBackpackUI___BackpackItemBagFrame[index], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) + call BlzFrameSetScale(WoWReforgedBackpackUI___BackpackItemBagFrame[index], 0.7) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemBagFrame[index], false) + call BlzFrameSetEnable(WoWReforgedBackpackUI___BackpackItemBagFrame[index], false) + call BlzFrameSetLevel(WoWReforgedBackpackUI___BackpackItemBagFrame[index], 2) + + set WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index]=BlzCreateFrameByType("BACKDROP", "ItemChargesBackrgroundFrame" + I2S(index), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], FRAMEPOINT_TOPLEFT, x + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE - WoWReforgedBackpackUI___BACKPACK_UI_CHARGES_BACKGROUND_SIZE, y - WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE + WoWReforgedBackpackUI___BACKPACK_UI_CHARGES_BACKGROUND_SIZE) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE, y - WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE) + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], "ui\\widgets\\console\\human\\commandbutton\\human-button-lvls-overlay.blp", 0, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], false) + call BlzFrameSetLevel(WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], 1) + + set WoWReforgedBackpackUI___BackpackItemChargesFrame[index]=BlzCreateFrameByType("TEXT", "charges" + I2S(index), WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index], "", 0) + call BlzFrameSetAllPoints(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], WoWReforgedBackpackUI___BackpackItemChargesBackgroundFrame[index]) + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], "|cffFFFFFFCharges|r") + call BlzFrameSetTextAlignment(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_CENTER) + call BlzFrameSetScale(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], 0.7) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], false) + call BlzFrameSetEnable(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], false) + call BlzFrameSetLevel(WoWReforgedBackpackUI___BackpackItemChargesFrame[index], 2) + + set x=x + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SPACE - return atLeastOne + set j=j + 1 + endloop + + set i=i + 1 + + // every 3 bags start another line + if ( ModuloInteger(i, 3) == 0 ) then + set x=WoWReforgedBackpackUI___UI_SLOT_X + set y=y - WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE - WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SPACE endif - else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! - endif + endloop - return false + set WoWReforgedBackpackUI___BackpackTooltipFrame=BlzCreateFrame("EscMenuBackdrop", WoWReforgedBackpackUI___BackpackBackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipFrame, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_X, WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_Y) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipFrame, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_X + WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_WIDTH, WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_Y - WoWReforgedBackpackUI___UI_TOOLTIP_FRAME_HEIGHT) + + set WoWReforgedBackpackUI___BackpackItemGoldFrame=BlzCreateFrame("BACKDROP", WoWReforgedBackpackUI___BackpackBackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemGoldFrame, FRAMEPOINT_TOPLEFT, 0.69, 0.50) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemGoldFrame, FRAMEPOINT_BOTTOMRIGHT, 0.71, 0.48) + //call BlzFrameSetAllPoints(BackpackItemGoldFrame, BackpackBackgroundFrame) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemGoldFrame, false) + + set WoWReforgedBackpackUI___BackpackItemGoldIconFrame=BlzCreateFrameByType("BACKDROP", "TooltipGoldFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemGoldIconFrame, FRAMEPOINT_TOPLEFT, 0.67, 0.50) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackItemGoldIconFrame, FRAMEPOINT_BOTTOMRIGHT, 0.69, 0.48) + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackItemGoldIconFrame, "UI\\Feedback\\Resources\\ResourceGold.blp", 0, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackItemGoldIconFrame, false) + + set WoWReforgedBackpackUI___BackpackTooltipIcon=BlzCreateFrameByType("BACKDROP", "TooltipIconFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipIcon, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI___UI_TOOLTIP_ICON_X, WoWReforgedBackpackUI___UI_TOOLTIP_ICON_Y) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipIcon, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI___UI_TOOLTIP_ICON_X + WoWReforgedBackpackUI___UI_TOOLTIP_ICON_SIZE, WoWReforgedBackpackUI___UI_TOOLTIP_ICON_Y - WoWReforgedBackpackUI___UI_TOOLTIP_ICON_SIZE) + call BlzFrameSetTexture(WoWReforgedBackpackUI___BackpackTooltipIcon, "ReplaceableTextures\\WorldEditUI\\Editor-Random-Item.blp", 0, true) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipIcon, false) + + + set WoWReforgedBackpackUI___BackpackTooltipModel=BlzCreateFrameByType("SPRITE", "TooltipModelFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipModel, FRAMEPOINT_TOPLEFT, 0.65, 0.20) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipModel, FRAMEPOINT_BOTTOMRIGHT, 0.70, 0.12) + call BlzFrameSetModel(WoWReforgedBackpackUI___BackpackTooltipModel, "Abilities\\Weapons\\RockBoltMissile\\RockBoltMissile.mdl", 0) + call BlzFrameSetScale(WoWReforgedBackpackUI___BackpackTooltipModel, 0.00006) + call BlzFrameSetSpriteAnimate(WoWReforgedBackpackUI___BackpackTooltipModel, 2, 0) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTooltipModel, false) + + set WoWReforgedBackpackUI___BackpackTooltipText=BlzCreateFrameByType("TEXT", "BackpackTooltipText", WoWReforgedBackpackUI___BackpackBackgroundFrame, "", 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipText, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI___UI_TOOLTIP_X, WoWReforgedBackpackUI___UI_TOOLTIP_Y) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___BackpackTooltipText, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI___UI_TOOLTIP_X + WoWReforgedBackpackUI___UI_TOOLTIP_WIDTH, WoWReforgedBackpackUI___UI_TOOLTIP_Y - WoWReforgedBackpackUI___UI_TOOLTIP_HEIGHT) + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "") + call BlzFrameSetEnable(WoWReforgedBackpackUI___BackpackTooltipText, false) + call BlzFrameSetScale(WoWReforgedBackpackUI___BackpackTooltipText, 1.00) + call BlzFrameSetTextAlignment(WoWReforgedBackpackUI___BackpackTooltipText, TEXT_JUSTIFY_TOP, TEXT_JUSTIFY_LEFT) + //call BlzFrameSetTooltip(Frame05, BackpackTooltipText) + + set WoWReforgedBackpackUI___Checkbox=BlzCreateFrame("QuestCheckBox2", WoWReforgedBackpackUI___BackpackBackgroundFrame, 0, 0) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___Checkbox, FRAMEPOINT_TOPLEFT, WoWReforgedBackpackUI___UI_CHECKBOX_X, WoWReforgedBackpackUI___UI_CHECKBOX_Y) + call BlzFrameSetAbsPoint(WoWReforgedBackpackUI___Checkbox, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedBackpackUI___UI_CHECKBOX_X + WoWReforgedBackpackUI___UI_CHECKBOX_SIZE, WoWReforgedBackpackUI___UI_CHECKBOX_Y - WoWReforgedBackpackUI___UI_CHECKBOX_SIZE) + call BlzFrameSetScale(WoWReforgedBackpackUI___Checkbox, 1.00) + + set WoWReforgedBackpackUI___CheckTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___CheckTrigger, WoWReforgedBackpackUI___Checkbox, FRAMEEVENT_CHECKBOX_CHECKED) + call TriggerAddAction(WoWReforgedBackpackUI___CheckTrigger, function WoWReforgedBackpackUI___CheckedFunction) + + set WoWReforgedBackpackUI___UncheckTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___UncheckTrigger, WoWReforgedBackpackUI___Checkbox, FRAMEEVENT_CHECKBOX_UNCHECKED) + call TriggerAddAction(WoWReforgedBackpackUI___UncheckTrigger, function WoWReforgedBackpackUI___UncheckedFunction) + + set WoWReforgedBackpackUI___CheckboxTooltipOnTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___CheckboxTooltipOnTrigger, WoWReforgedBackpackUI___Checkbox, FRAMEEVENT_MOUSE_ENTER) + call TriggerAddAction(WoWReforgedBackpackUI___CheckboxTooltipOnTrigger, function WoWReforgedBackpackUI___CheckboxEnterItemFunction) + + set WoWReforgedBackpackUI___CheckboxTooltipOffTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___CheckboxTooltipOffTrigger, WoWReforgedBackpackUI___Checkbox, FRAMEEVENT_MOUSE_LEAVE) + call TriggerAddAction(WoWReforgedBackpackUI___CheckboxTooltipOffTrigger, function WoWReforgedBackpackUI___CheckboxLeaveItemFunction) + + set WoWReforgedBackpackUI___BackpackCloseButton=CreateFullScreenCloseButton() + + set WoWReforgedBackpackUI___BackpackCloseTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___BackpackCloseTrigger, WoWReforgedBackpackUI___BackpackCloseButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedBackpackUI___BackpackCloseTrigger, function WoWReforgedBackpackUI___CloseFunction) + + set WoWReforgedBackpackUI___BackpackSyncTrigger=CreateTrigger() + call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedBackpackUI___BackpackSyncTrigger , "BackpackUI" , false) + call TriggerAddAction(WoWReforgedBackpackUI___BackpackSyncTrigger, function WoWReforgedBackpackUI___TriggerActionSyncData) + + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackBackgroundFrame, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackCloseButton, false) + + //call FrameSaverAdd(function HideBackpackUIForAllPlayers) endfunction -function GetSaveCodeInfosBuildings takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "Multiplayer" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "Freelancer" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local real x= 0.0 - local real y= 0.0 - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" - local string result= "" - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif +//library WoWReforgedBackpackUI ends +//library WoWReforgedComputer: - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif +function GetComputerAINavy takes player whichPlayer returns group + return udg_ComputerNavy[GetPlayerId(whichPlayer)] +endfunction - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" +function ComputerAINavyAttacks takes player whichPlayer returns nothing + local integer target= GetRandomInt(0, udg_NavyAttackLocationsCounter) + local rect targetRect= udg_NavyAttackLocations[target] + local real x= GetRectCenterX(targetRect) + local real y= GetRectCenterY(targetRect) + local string zone= GetZoneNameByCoordinates(x , y) + call GroupPointOrder((udg_ComputerNavy[GetPlayerId((whichPlayer))]), "attack", x, y) // INLINED!! + call h__BlzDisplayChatMessage(whichPlayer, 0, "My navy will attack " + zone + "!") + if ( IsPlayerAlly(whichPlayer, GetLocalPlayer()) ) then + call PingMinimapEx(x, y, 4.0, 0, 255, 0, false) endif + set targetRect=null +endfunction - if ( isWarlord ) then - set warlordStatus="Warlord" +function ComputerAINavyIsReadyForAttack takes player whichPlayer returns boolean + return BlzGroupGetSize((udg_ComputerNavy[GetPlayerId((whichPlayer))])) >= 5 // INLINED!! +endfunction + +function ComputerAITrainNavy takes unit shipyard returns boolean + local player owner= GetOwningPlayer(shipyard) + local integer r= (udg_PlayerRace[GetConvertedPlayerId((owner))]) // INLINED!! + local integer unitTypeId= (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_BATTLESHIP)) // INLINED!! + if ( (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_FRIGATE)) != 0 and GetRandomInt(0, 1) == 1 ) then // INLINED!! + set unitTypeId=(GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_FRIGATE)) // INLINED!! + endif + if ( unitTypeId != 0 ) then + return IssueImmediateOrderById(shipyard, unitTypeId) endif + + return false +endfunction + +function WoWReforgedComputer___IsRaceMine takes integer r,integer unitTypeId returns boolean + return r != udg_RaceNone and ( unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_MINE)) or unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_HOUSING)) ) // INLINED!! +endfunction + +function WoWReforgedComputer___IsRaceWorker takes integer r,integer unitTypeId returns boolean + return r != udg_RaceNone and unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_WORKER)) // INLINED!! +endfunction + +function WoWReforgedComputer___FilterIsUnitMineOrHousingOfRace takes nothing returns boolean + local unit u= GetFilterUnit() + local integer unitTypeId= GetUnitTypeId(u) + local player owner= GetOwningPlayer(u) + local boolean result= WoWReforgedComputer___IsRaceMine((udg_PlayerRace[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer___IsRaceMine((udg_PlayerRace2[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer___IsRaceMine((udg_PlayerRace3[GetConvertedPlayerId((owner))]) , unitTypeId) // INLINED!! + //call BJDebugMsg("Checking mine " + GetUnitName(u) + " for player " + GetPlayerName(owner) + " with race " + GetRaceName(GetPlayerRace1(owner)) + " and race mine " + GetObjectName(GetRaceMine(GetPlayerRace1(owner)))) + set owner=null + set u=null + return result +endfunction + +function WoWReforgedComputer___FilterIsUnitFreeWorker takes nothing returns boolean + local unit u= GetFilterUnit() + local integer unitTypeId= GetUnitTypeId(u) + local player owner= GetOwningPlayer(u) + local boolean result= IsUnitAliveBJ(u) and not IsUnitLoaded(u) and GetUnitCurrentOrder(u) != OrderId("harvest") and ( WoWReforgedComputer___IsRaceWorker((udg_PlayerRace[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer___IsRaceWorker((udg_PlayerRace2[GetConvertedPlayerId((owner))]) , unitTypeId) or WoWReforgedComputer___IsRaceWorker((udg_PlayerRace3[GetConvertedPlayerId((owner))]) , unitTypeId) ) // INLINED!! + set owner=null + set u=null + return result +endfunction - set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) - set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) - set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) - set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) - set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) - set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) - set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) - set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) +function WoWReforgedComputer___AutoLoadMineAI takes unit mine returns nothing + local integer mineRace= GetObjectRace(GetUnitTypeId(mine)) + local unit worker= null + local integer i= 0 + local integer max= 0 + local group usedWorkers= CreateGroup() + // TODO How to detect how many workers are already in the mine? + set max=BlzGroupGetSize(WoWReforgedComputer___autoLoadMineWorkers) set i=0 loop - exitwhen ( i == SAVE_CODE_MAX_BUILDINGS ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdBuilding[(saveObject)]) // INLINED!! - set x=ConvertAbsCoordinateX(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)))) // INLINED!! - set y=ConvertAbsCoordinateY(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 2) , SAVE_CODE_DIGITS)))) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r (" + R2S(x) + "|" + R2S(y) + ")") - else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r (" + R2S(x) + "|" + R2S(y) + ")") - endif - elseif ( saveObject == 0 ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Building Slot") - else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Building with ID " + I2S(saveObject)) + exitwhen ( i == max or BlzGroupGetSize(usedWorkers) >= WoWReforgedComputer_MAX_WORKERS_PER_MINE ) // stop at 5 workers per mine + set worker=BlzGroupUnitAt(WoWReforgedComputer___autoLoadMineWorkers, i) + if ( GetObjectRace(GetUnitTypeId(worker)) == mineRace ) then + set WoWReforgedComputer___autoLoadMineCounter=WoWReforgedComputer___autoLoadMineCounter + 1 + call IssueTargetOrder(worker, "smart", mine) + call GroupAddUnit(usedWorkers, worker) endif + set worker=null set i=i + 1 - set pos=pos + 3 endloop + //call BJDebugMsg("Used Workers: " + I2S(BlzGroupGetSize(usedWorkers)) + " for mine " + GetUnitName(mine)) + call GroupRemoveGroup(usedWorkers, WoWReforgedComputer___autoLoadMineWorkers) + call GroupClear(usedWorkers) + call DestroyGroup(usedWorkers) + set usedWorkers=null +endfunction - return result +function WoWReforgedComputer___ForGroupAutoLoadMine takes nothing returns nothing + call WoWReforgedComputer___AutoLoadMineAI(GetEnumUnit()) endfunction -function GetSaveCodeShortInfosBuildings takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "M" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "F" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local real x= 0.0 - local real y= 0.0 - local string checksumStatus= "Valid" - local string result= "" +function AutloadWorkersIntoMinesAI takes player whichPlayer returns nothing + local group mines= CreateGroup() + local group workers= CreateGroup() + call GroupEnumUnitsOfPlayer(mines, whichPlayer, Filter(function WoWReforgedComputer___FilterIsUnitMineOrHousingOfRace)) + call GroupEnumUnitsOfPlayer(workers, whichPlayer, Filter(function WoWReforgedComputer___FilterIsUnitFreeWorker)) + //call BJDebugMsg("Mines: " + I2S(BlzGroupGetSize(mines))) + //call BJDebugMsg("Workers: " + I2S(BlzGroupGetSize(workers))) + set WoWReforgedComputer___autoLoadMineCounter=0 + set WoWReforgedComputer___autoLoadMineWorkers=workers + call ForGroup(mines, function WoWReforgedComputer___ForGroupAutoLoadMine) + call GroupClear(mines) + call DestroyGroup(mines) + call GroupClear(workers) + call DestroyGroup(workers) + set workers=null + // gets annoying + //call DisplayTimedTextToForce(GetPlayersAll(), 4.0, "Auto loaded " + I2S(autoLoadMineCounter) + " workers for player " + GetPlayerNameColored(whichPlayer)) + set mines=null +endfunction - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" +function StartingUnitsPeons takes player whichPlayer,location l,integer whichRace returns nothing + local integer peonId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_WORKER) + local integer ghoulId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_FOOTMAN) + local real peonX= GetLocationX(l) + local real peonY= GetLocationY(l) - 224.00 + local real unitSpacing= 64.00 + local unit peon= null + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + // Spawn Peasants directly south of the town hall. + set peon=CreateUnit(whichPlayer, peonId, peonX + 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) + set peon=CreateUnit(whichPlayer, peonId, peonX + 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) + set peon=CreateUnit(whichPlayer, peonId, peonX + 0.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) + if ( (udg_RaceHasFootmanWorker[(whichRace)]) ) then // INLINED!! + set peon=CreateUnit(whichPlayer, ghoulId, peonX - 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + set WoWReforgedComputer___ghoul[GetPlayerId(whichPlayer)]=peon + else + set peon=CreateUnit(whichPlayer, peonId, peonX - 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) + set peon=CreateUnit(whichPlayer, peonId, peonX - 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + call GroupAddUnit(udg_ComputerWorkers[convertedPlayerId], peon) endif +endfunction - if ( isSinglePlayer ) then - set singlePlayerStatus="S" - endif +function StartingUnitsShredders takes player whichPlayer,location l,integer whichRace returns nothing + local real peonX= GetLocationX(l) + local real peonY= GetLocationY(l) - 412.00 + local real unitSpacing= 64.00 + local unit peon= null + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + // Spawn Peasants directly south of the town hall. + set peon=CreateUnit(whichPlayer, SHREDDER, peonX + 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + set peon=CreateUnit(whichPlayer, SHREDDER, peonX + 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) + set peon=CreateUnit(whichPlayer, SHREDDER, peonX + 0.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING) + call GroupAddUnit(udg_ComputerUnits[convertedPlayerId], peon) +endfunction - if ( isWarlord ) then - set warlordStatus="W" +function WoWReforgedComputer___FilterFunctionIsMine takes nothing returns boolean + return GetUnitTypeId(GetFilterUnit()) == GOLD_MINE +endfunction + +function StartingUnitsReplaceMine takes player whichPlayer,unit mine,integer whichRace returns nothing + local integer mineId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MINE) + local location l= GetUnitLoc(mine) + call ReplaceUnitBJ(mine, mineId, bj_UNIT_STATE_METHOD_RELATIVE) + call SetUnitOwner(GetLastReplacedUnitBJ(), whichPlayer, true) + call SetResourceAmount(GetLastReplacedUnitBJ(), 1000000) + call StartingUnitsPeons(whichPlayer , l , whichRace) + + if ( (udg_RaceHasBlight[(whichRace)]) ) then // INLINED!! + // Create a patch of blight around the gold mine. + call SetBlightLoc(whichPlayer, l, 768, true) endif + + call RemoveLocation(l) + set l=null +endfunction - set i=0 +function StartingUnitsReplaceAllMines takes player whichPlayer,location l,integer whichRace returns nothing + local group mines= GetUnitsInRangeOfLocMatching(2048.00, l, Filter(function WoWReforgedComputer___FilterFunctionIsMine)) + local integer max= BlzGroupGetSize(mines) + local integer i= 0 loop - exitwhen ( i == SAVE_CODE_MAX_BUILDINGS ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - set result=result + "-" - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdBuilding[(saveObject)]) // INLINED!! - set x=ConvertAbsCoordinateX(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)))) // INLINED!! - set y=ConvertAbsCoordinateY(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 2) , SAVE_CODE_DIGITS)))) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r" - else - set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r" - endif - elseif ( saveObject == 0 ) then - set result=result + "Empty Building Slot" - else - set result=result + "Invalid Building with ID " - endif + exitwhen ( i == max ) + call StartingUnitsReplaceMine(whichPlayer , BlzGroupUnitAt(mines, i) , whichRace) set i=i + 1 - set pos=pos + 3 - endloop - - return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result -endfunction - -function CreateSaveCodeItemsTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer items,string itemNames,string saveCode returns nothing - local string singleplayer= "no" - local string singlePlayerFileName= "Multiplayer" - local string gameMode= "Freelancer" - local string gameType= "Normal" - local string content= "" + endloop + call GroupClear(mines) + call DestroyGroup(mines) + set mines=null +endfunction - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" +function StartingUnitsAndPickAIStandard takes player whichPlayer,location l,integer whichRace,boolean recreate returns nothing + local integer townHallId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_TIER_1) + local unit townHall= CreateUnitAtLoc(whichPlayer, townHallId, l, bj_UNIT_FACING) + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + call GroupAddUnit(udg_ComputerTownHalls[convertedPlayerId], townHall) + call GroupAddUnit(udg_ComputerBuildings[convertedPlayerId], townHall) + // Spawn Peasants directly south of the town hall. + call StartingUnitsPeons(whichPlayer , l , whichRace) + call StartingUnitsShredders(whichPlayer , l , whichRace) + if ( not recreate ) then + call StartCampaignAI(whichPlayer, (udg_RaceAIScript[(whichRace)])) // INLINED!! endif - - if ( isWarlord ) then - set gameMode="Warlord" + if ( (udg_RaceHasFootmanWorker[(whichRace)]) ) then // INLINED!! + call RecycleGuardPosition(WoWReforgedComputer___ghoul[GetPlayerId(whichPlayer)]) endif +endfunction - if ( gameTypeNumber == udg_GameTypeEasy ) then - set gameType="Easy" - elseif ( gameTypeNumber == udg_GameTypeFast ) then - set gameType="Fast" - elseif ( gameTypeNumber == udg_GameTypeHardcore ) then - set gameType="Hardcore" +function StartingUnitsAndPickAIEx takes player whichPlayer,location l,integer whichRace,boolean recreate returns nothing + local integer mineId= GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MINE) + call PingMinimap(GetLocationX(l), GetLocationY(l), 4.0) + //call BJDebugMsg("Create starting units with peons for player " + GetPlayerName(whichPlayer) + " and race " + I2S(whichRace)) + call StartingUnitsAndPickAIStandard(whichPlayer , l , whichRace , recreate) + if ( mineId != 0 ) then + call StartingUnitsReplaceAllMines(whichPlayer , l , whichRace) + call EnableTrigger(gg_trg_Computer_Auto_Load_Mines) + call AutloadWorkersIntoMinesAI(whichPlayer) endif +endfunction - call FileStart() +function StartingUnitsAndPickAI takes player whichPlayer,location l,integer whichRace returns nothing + call StartingUnitsAndPickAIEx(whichPlayer , l , whichRace , false) +endfunction - set content=content + ("\r\n" + ("Code: -loadi " + saveCode)) // INLINED!! - set content=content + ("\r\n" + ("Items: " + I2S(items))) // INLINED!! - set content=content + ("\r\n" + ("Item Names: " + itemNames)) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! +function RecreateStartingUnitsAI takes player whichPlayer returns nothing + local location l= GetRectCenter(udg_TownHallLocation[udg_ComputerStartLocation[GetConvertedPlayerId(whichPlayer)]]) + call StartingUnitsAndPickAIEx(whichPlayer , l , (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) , true) // INLINED!! + call RemoveLocation(l) + set l=null +endfunction - // The line below creates the log - call Preload((content)) // INLINED!! +function WoWReforgedComputer___FilterIsRemovableUnit takes nothing returns boolean + local integer unitTypeId= GetUnitTypeId(GetFilterUnit()) + return unitTypeId != FOUNTAIN_OF_LIFE and unitTypeId != GNOMISH_LOCOMOTIVE_TRAIN and not IsUnitInGroup(GetFilterUnit(), udg_ClanHalls) +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-items-" + I2S(items) + "-" + itemNames + ".txt")) // INLINED!! +function WoWReforgedComputer___ForGroupRemoveUnit takes nothing returns nothing + call DropItemsFromHero(GetEnumUnit()) + call h__RemoveUnit(GetEnumUnit()) endfunction -// TODO Add some kind of unique ID for grouping multiple item savecodes together to prevent faking the same items in different slots. -function GetSaveCodeItemsEx3 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,integer itemTypeSlot0,integer itemChargesSlot0,integer itemTypeSlot1,integer itemChargesSlot1,integer itemTypeSlot2,integer itemChargesSlot2,integer itemTypeSlot3,integer itemChargesSlot3,integer itemTypeSlot4,integer itemChargesSlot4,integer itemTypeSlot5,integer itemChargesSlot5 returns string - local integer playerNameHash= CompressedAbsStringHash(playerName) - local string result= "" - local integer id= - 1 - local integer itemCounter= 0 - local string itemNames= "" +function RemovePlayerUnits takes player whichPlayer returns nothing + local group g= CreateGroup() + call KillAllHauntedGoldMines(whichPlayer) + call MountKillAll(whichPlayer) + call DropBackpackForPlayer(whichPlayer , gg_rct_redirect_forbidden_zone) + call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function WoWReforgedComputer___FilterIsRemovableUnit)) + call ForGroup(g, function WoWReforgedComputer___ForGroupRemoveUnit) + call GroupClear(g) + call DestroyGroup(g) + set g=null +endfunction - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - - if ( itemTypeSlot0 != 0 or itemTypeSlot1 != 0 or itemTypeSlot2 != 0 or itemTypeSlot3 != 0 or itemTypeSlot4 != 0 or itemTypeSlot5 != 0 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_ITEMS) - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) - set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) - set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) - set result=result + ConvertDecimalNumberToSaveCodeSegment(index) - if ( itemTypeSlot0 != 0 ) then - set id=GetSaveObjectItemType(itemTypeSlot0) - if ( id != - 1 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot0) - set itemCounter=itemCounter + 1 - if ( itemNames != "" ) then - set itemNames=itemNames + "," - endif - set itemNames=itemNames + GetObjectName(itemTypeSlot0) - else - //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) - endif - endif +//library WoWReforgedComputer ends +//library WoWReforgedDemigod: - if ( itemTypeSlot1 != 0 ) then - set id=GetSaveObjectItemType(itemTypeSlot1) - if ( id != - 1 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot1) - set itemCounter=itemCounter + 1 - if ( itemNames != "" ) then - set itemNames=itemNames + "," - endif - set itemNames=itemNames + GetObjectName(itemTypeSlot1) - else - //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) - endif - endif +function BecomeDemigod takes unit hero,integer unitTypeId returns unit + local unit replaced= ReplaceHero(hero , unitTypeId , bj_UNIT_STATE_METHOD_RELATIVE , false , false) + call RefreshBackpackForPlayer(GetOwningPlayer(replaced)) + call RecreateAllEquipmentBags(GetOwningPlayer(replaced)) + call h__DisplayTimedTextToPlayer(GetOwningPlayer(replaced), 0, 0, 30, GetPlayerNameColored(GetOwningPlayer(replaced)) + " has become an \"Eternal Guardian\" (demigod)!") + call SetPlayerTechResearchedSwap(UPG_DEMIGOD, 1, GetOwningPlayer(replaced)) + return replaced +endfunction - if ( itemTypeSlot2 != 0 ) then - set id=GetSaveObjectItemType(itemTypeSlot2) - if ( id != - 1 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot2) - set itemCounter=itemCounter + 1 - if ( itemNames != "" ) then - set itemNames=itemNames + "," - endif - set itemNames=itemNames + GetObjectName(itemTypeSlot2) - else - //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) - endif - endif +function BecomeDemigodLight takes unit hero returns unit + return BecomeDemigod(hero , DEMIGOD_LIGHT) +endfunction - if ( itemTypeSlot3 != 0 ) then - set id=GetSaveObjectItemType(itemTypeSlot3) - if ( id != - 1 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot3) - set itemCounter=itemCounter + 1 - if ( itemNames != "" ) then - set itemNames=itemNames + "," - endif - set itemNames=itemNames + GetObjectName(itemTypeSlot3) - else - //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) - endif - endif +function BecomeDemigodDark takes unit hero returns unit + return BecomeDemigod(hero , DEMIGOD_DARK) +endfunction - if ( itemTypeSlot4 != 0 ) then - set id=GetSaveObjectItemType(itemTypeSlot4) - if ( id != - 1 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot4) - set itemCounter=itemCounter + 1 - if ( itemNames != "" ) then - set itemNames=itemNames + "," - endif - set itemNames=itemNames + GetObjectName(itemTypeSlot4) - else - //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) - endif - endif +function GetUnitsInRectOfPlayerAndTypeFilter takes nothing returns boolean + return GetOwningPlayer(GetFilterUnit()) == bj_groupEnumOwningPlayer and GetUnitTypeId(GetFilterUnit()) == bj_groupEnumTypeId +endfunction - if ( itemTypeSlot5 != 0 ) then - set id=GetSaveObjectItemType(itemTypeSlot5) - if ( id != - 1 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot5) - set itemCounter=itemCounter + 1 - if ( itemNames != "" ) then - set itemNames=itemNames + "," - endif - set itemNames=itemNames + GetObjectName(itemTypeSlot5) - else - //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) - endif - endif +function CountDemigodDragonsEx takes player whichPlayer,integer unitTypeId,rect whichRect returns integer + local group g= CreateGroup() + local integer count= 0 + set bj_groupEnumOwningPlayer=whichPlayer + set bj_groupEnumTypeId=unitTypeId + call GroupEnumUnitsInRect(g, whichRect, Filter(function GetUnitsInRectOfPlayerAndTypeFilter)) + set count=BlzGroupGetSize(g) + call GroupClear(g) + call DestroyGroup(g) + set g=null + return count +endfunction - //call BJDebugMsg("Compressed result: " + result) - //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) - //call BJDebugMsg("Checked save code part: " + result) +function CountDemigodDragons takes nothing returns integer + return CountDemigodDragonsEx(udg_TmpPlayer , udg_TmpUnitType , udg_TmpRect) +endfunction - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) - endif +//library WoWReforgedDemigod ends +//library WoWReforgedHeroTransformation: - if ( itemCounter > 0 ) then - call AddGeneratedSaveCode(result) - - if ( writeFile ) then - call CreateSaveCodeItemsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , itemCounter , itemNames , result) - endif - - return result - endif +function ReplaceHeroForTransformation takes unit hero,integer unitTypeId returns unit + local integer sourceHandleId= GetHandleId(hero) + local force selectedForce= GetSelectedForce(hero) + local integer heroStandardAbilityIndex= GetStandardHeroAbility(hero) + local unit replacedUnit= ReplaceHero(hero , unitTypeId , bj_UNIT_STATE_METHOD_RELATIVE , true , false) + if ( heroStandardAbilityIndex != - 1 ) then + call RemoveStandardHeroAbilitiesForHero(replacedUnit) + call UnitAddAbility(replacedUnit, (s__WoWReforgedStandardHeroAbilities__A_abilityId[WoWReforgedStandardHeroAbilities__standardHeroAbilities[(heroStandardAbilityIndex)]])) // INLINED!! + endif + if ( IsPlayerInForce(GetLocalPlayer(), selectedForce) ) then + // Use only local code (no net traffic) within this block to avoid desyncs. + call SelectUnit(replacedUnit, true) endif + call ApplyAllHeroLearnedSkills(replacedUnit , sourceHandleId) + //call ResetHeroLearnedSkills(sourceHandleId) + call ForceClear(selectedForce) + call DestroyForce(selectedForce) + set selectedForce=null + return replacedUnit +endfunction + - return "" + function s__WoWReforgedHeroTransformation___HeroTransformationItemType_getUnitTypeId takes integer this,unit source returns integer + local integer sourcePrimaryAttribute= BlzGetUnitIntegerField(source, UNIT_IF_PRIMARY_ATTRIBUTE) + if ( sourcePrimaryAttribute == 3 ) then + return s__WoWReforgedHeroTransformation___HeroTransformationItemType_agilityUnitTypeId[this] + elseif ( sourcePrimaryAttribute == 2 ) then + return s__WoWReforgedHeroTransformation___HeroTransformationItemType_intelligenceUnitTypeId[this] + endif + + return s__WoWReforgedHeroTransformation___HeroTransformationItemType_strengthUnitTypeId[this] + endfunction + + function s__WoWReforgedHeroTransformation___HeroTransformationItemType_matchesUnit takes integer this,unit whichUnit returns boolean + local integer unitTypeId= GetUnitTypeId(whichUnit) + return unitTypeId == s__WoWReforgedHeroTransformation___HeroTransformationItemType_strengthUnitTypeId[this] or unitTypeId == s__WoWReforgedHeroTransformation___HeroTransformationItemType_agilityUnitTypeId[this] or unitTypeId == s__WoWReforgedHeroTransformation___HeroTransformationItemType_intelligenceUnitTypeId[this] + endfunction + + +function AddHeroTransformationItemTypeIdEx takes integer id,integer strengthUnitTypeId,integer agilityUnitTypeId,integer intelligenceUnitTypeId returns integer + local integer index= WoWReforgedHeroTransformation___typesCounter + local integer t= s__WoWReforgedHeroTransformation___HeroTransformationItemType__allocate() + set s__WoWReforgedHeroTransformation___HeroTransformationItemType_id[t]=id + set s__WoWReforgedHeroTransformation___HeroTransformationItemType_strengthUnitTypeId[t]=strengthUnitTypeId + set s__WoWReforgedHeroTransformation___HeroTransformationItemType_agilityUnitTypeId[t]=agilityUnitTypeId + set s__WoWReforgedHeroTransformation___HeroTransformationItemType_intelligenceUnitTypeId[t]=intelligenceUnitTypeId + set WoWReforgedHeroTransformation___types[index]=t + set WoWReforgedHeroTransformation___typesCounter=WoWReforgedHeroTransformation___typesCounter + 1 + return index endfunction -function GetSaveCodeItemsEx2 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,item itemSlot0,item itemSlot1,item itemSlot2,item itemSlot3,item itemSlot4,item itemSlot5 returns string - return GetSaveCodeItemsEx3(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , GetItemTypeId(itemSlot0) , GetItemCharges(itemSlot0) , GetItemTypeId(itemSlot1) , GetItemCharges(itemSlot1) , GetItemTypeId(itemSlot2) , GetItemCharges(itemSlot2) , GetItemTypeId(itemSlot3) , GetItemCharges(itemSlot3) , GetItemTypeId(itemSlot4) , GetItemCharges(itemSlot4) , GetItemTypeId(itemSlot5) , GetItemCharges(itemSlot5)) +function AddHeroTransformationItemTypeId takes nothing returns integer + return AddHeroTransformationItemTypeIdEx(udg_TmpItemTypeId , udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpUnitType3) endfunction -function GetSaveCodeItemsEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,unit hero,boolean writeFile,integer index returns string - return GetSaveCodeItemsEx2(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , UnitItemInSlot(hero, 0) , UnitItemInSlot(hero, 1) , UnitItemInSlot(hero, 2) , UnitItemInSlot(hero, 3) , UnitItemInSlot(hero, 4) , UnitItemInSlot(hero, 5)) +function AddHeroTransformationAbilityId takes nothing returns integer + return AddHeroTransformationItemTypeIdEx(udg_TmpAbilityCode , udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpUnitType3) endfunction -function GetSaveCodeItemsForIndex takes player whichPlayer,boolean writeFile,integer index returns string - local boolean isSinglePlayer= IsInSinglePlayer() - local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] - local integer gameType= udg_GameType - local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) - local integer playerId= GetPlayerId(whichPlayer) - local string playerName= GetPlayerName(whichPlayer) - local integer i= index +function SetHeroOriginalUnitType takes player owner,integer heroIndex,integer unitTypeId returns nothing + set WoWReforgedHeroTransformation___playerHeroOriginalUnitTypeId[Index2D(GetPlayerId(owner) , 0 , WoWReforgedHeroTransformation___MAX_HEROES)]=unitTypeId +endfunction - if ( index == 0 ) then - return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero[GetPlayerId((whichPlayer))]) , writeFile , index) // INLINED!! - elseif ( index == 1 ) then - return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero2[GetPlayerId((whichPlayer))]) , writeFile , index) // INLINED!! - elseif ( index == 3 ) then - return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero3[GetPlayerId((whichPlayer))]) , writeFile , index) // INLINED!! - elseif ( index > 3 and index < 3 + BACKPACK_MAX_PAGES ) then - set i=index - 3 - //call BJDebugMsg("Backpack item " + I2S(i)) - return GetSaveCodeItemsEx3(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))])) // INLINED!! - elseif ( index >= 3 + BACKPACK_MAX_PAGES and index < BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) ) then - set i=index - 3 + BACKPACK_MAX_PAGES - return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) , writeFile , index) - endif - return "" +function GetHeroOriginalUnitType takes player owner,integer heroIndex returns integer + return WoWReforgedHeroTransformation___playerHeroOriginalUnitTypeId[Index2D(GetPlayerId(owner) , 0 , WoWReforgedHeroTransformation___MAX_HEROES)] endfunction -function GetSaveCodeItems takes player whichPlayer returns string - return GetSaveCodeItemsForIndex(whichPlayer , true , 0) +function IsOriginalUnitTypeCustomizableAttributesHero takes unit hero returns boolean + local integer heroIndex= GetPlayerHeroIndex(GetOwningPlayer(hero) , hero) + return heroIndex != - 1 and IsCustomizableAttributesHero(GetHeroOriginalUnitType(GetOwningPlayer(hero) , heroIndex)) endfunction -function GetAllSaveCodeItems takes player whichPlayer returns string - local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) - local boolean isSinglePlayer= IsInSinglePlayer() - local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] - local integer gameType= udg_GameType - local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) +function WoWReforgedHeroTransformation___FindMatchingType takes integer id returns integer local integer i= 0 - local integer index= 0 - local integer playerId= GetPlayerId(whichPlayer) - local integer max= BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) - local string result= GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero[GetPlayerId((whichPlayer))]) , true , 0) // INLINED!! - call GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero2[GetPlayerId((whichPlayer))]) , true , 1) // INLINED!! - call GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero3[GetPlayerId((whichPlayer))]) , true , 2) // INLINED!! - - set index=3 - set i=0 - set max=BACKPACK_MAX_PAGES - loop - exitwhen ( i == max ) - call GetSaveCodeItemsEx3(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , true , index , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemType[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks___BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))])) // INLINED!! - set index=index + 1 - set i=i + 1 - endloop - - set i=0 - set max=BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) loop - exitwhen ( i == max ) - call GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) , true , index) - set index=index + 1 + exitwhen ( i >= WoWReforgedHeroTransformation___typesCounter ) + if ( s__WoWReforgedHeroTransformation___HeroTransformationItemType_id[(WoWReforgedHeroTransformation___types[i])] == id ) then + return (WoWReforgedHeroTransformation___types[i]) + endif set i=i + 1 endloop - - return result + return 0 endfunction -function GetSaveCodeItemsMax takes nothing returns integer - return 3 + BACKPACK_MAX_PAGES + 3 +function WoWReforgedHeroTransformation___TransformForId takes unit hero,integer id returns boolean + local player owner= GetOwningPlayer(hero) + local integer heroIndex= GetPlayerHeroIndex(owner , hero) + local integer matchingType= WoWReforgedHeroTransformation___FindMatchingType(id) + local boolean result= false + if ( matchingType != 0 and heroIndex != - 1 ) then + call DisableTrigger(WoWReforgedHeroTransformation___pickupTrigger) + if ( GetHeroOriginalUnitType(owner , heroIndex) == 0 ) then + //call BJDebugMsg("Hero original unit type: " + GetObjectName(GetUnitTypeId(hero))) + call SetHeroOriginalUnitType(owner , heroIndex , GetUnitTypeId(hero)) + endif + call ReplaceHeroForTransformation(hero , s__WoWReforgedHeroTransformation___HeroTransformationItemType_getUnitTypeId(matchingType,hero)) + call RefreshBackpackForPlayer(owner) + call RecreateAllEquipmentBags(owner) + call EnableTrigger(WoWReforgedHeroTransformation___pickupTrigger) + set result=true + endif + set owner=null + return result endfunction -function GetSaveCodeItemsFromUnit takes player whichPlayer,unit hero,integer index returns string - local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) - local boolean isSinglePlayer= IsInSinglePlayer() - local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] - local integer gameType= udg_GameType - local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) - - return GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , hero , true , index) +function WoWReforgedHeroTransformation___TransformByHeroInventory takes unit hero returns nothing + local item slotItem= null + local integer i= 0 + loop + set slotItem=UnitItemInSlot(hero, i) + if ( slotItem != null and WoWReforgedHeroTransformation___TransformForId(hero , GetItemTypeId(slotItem)) ) then + call h__BJDebugMsg("Still transforming because of item " + GetItemName(slotItem) + " in inventory.") + set slotItem=null + exitwhen ( true ) + endif + set slotItem=null + set i=i + 1 + exitwhen ( i == bj_MAX_INVENTORY ) + endloop + set udg_TmpUnit=hero + call ConditionalTriggerExecute(gg_trg_Bosses_On_Transform) endfunction -function ApplySaveCodeItemsEx takes player whichPlayer,string s,unit hero returns boolean - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! +function TransformHeroBack takes unit hero returns unit + local player owner= GetOwningPlayer(hero) + local integer heroIndex= GetPlayerHeroIndex(owner , hero) local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer id= 0 - local integer charges= 0 - local boolean atLeastOne= false - - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + if ( heroIndex != - 1 ) then + loop + exitwhen ( i >= WoWReforgedHeroTransformation___typesCounter ) + //call BJDebugMsg("Matching transform type for ability " + GetObjectName(GetSpellAbilityId()) + ": " + I2S(matchingType) + " and hero Index " + I2S(heroIndex)) + if ( heroIndex != - 1 and s__WoWReforgedHeroTransformation___HeroTransformationItemType_matchesUnit((WoWReforgedHeroTransformation___types[i]),hero) ) then + call ReplaceHeroForTransformation(hero , GetHeroOriginalUnitType(owner , heroIndex)) + call SetHeroOriginalUnitType(owner , heroIndex , 0) // allows transforming again + call RefreshBackpackForPlayer(owner) + call RecreateAllEquipmentBags(owner) + call WoWReforgedHeroTransformation___TransformByHeroInventory(GetLastReplacedUnitBJ()) + + return GetLastReplacedUnitBJ() + endif + set i=i + 1 + endloop + endif + set owner=null + return hero +endfunction - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) +function WoWReforgedHeroTransformation___TriggerConditionPickup takes nothing returns boolean + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + local integer heroIndex= GetPlayerHeroIndex(owner , triggerUnit) + local boolean result= IsUnitType(triggerUnit, UNIT_TYPE_HERO) and heroIndex != - 1 and GetHeroOriginalUnitType(owner , heroIndex) == 0 + set triggerUnit=null + set owner=null + return result +endfunction - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) +function WoWReforgedHeroTransformation___TriggerActionPickup takes nothing returns nothing + local unit hero= GetTriggerUnit() + local player owner= GetOwningPlayer(hero) + local item whichItem= GetManipulatedItem() + local integer itemTypeId= GetItemTypeId(whichItem) + // wait for picking the item up into the inventory + call TriggerSleepAction(0.0) + if ( UnitHasItem(hero, whichItem) ) then + call WoWReforgedHeroTransformation___TransformForId(hero , itemTypeId) + endif + set hero=null + set owner=null + set whichItem=null +endfunction - if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY or pos >= lastSaveCodeSegment ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdItem[(saveObject)]) // INLINED!! - set id=saveObjectId - if ( not IsObjectFromPlayerRace(id , whichPlayer) ) then - set id=(MapRaceObjectType((id ) , ( (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))])))) // INLINED!! - endif - - if ( id != 0 and IsObjectFromPlayerRace(id , whichPlayer) ) then - call UnitAddItemByIdSwapped(id, hero) - set charges=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - if ( GetItemTypePerishable(id) and charges <= 0 ) then - // never let perishable items be used unlimited - set charges=1 - endif - call SetItemCharges(bj_lastCreatedItem, charges) - set atLeastOne=true - else - call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) - endif - endif - set i=i + 1 - set pos=pos + 2 - endloop +function WoWReforgedHeroTransformation___TriggerConditionDrop takes nothing returns boolean + return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetPlayerHeroIndex(GetOwningPlayer(GetTriggerUnit()) , GetTriggerUnit()) != - 1 +endfunction - call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) +function WoWReforgedHeroTransformation___TriggerActionDrop takes nothing returns nothing + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + local integer heroIndex= GetPlayerHeroIndex(owner , triggerUnit) + local integer matchingType= WoWReforgedHeroTransformation___FindMatchingType(GetItemTypeId(GetManipulatedItem())) + if ( matchingType != 0 and heroIndex != - 1 and s__WoWReforgedHeroTransformation___HeroTransformationItemType_matchesUnit(matchingType,triggerUnit) ) then + // wait for dropping the item from the inventory + call TriggerSleepAction(0.0) + // refresh values + set heroIndex=GetPlayerHeroIndex(owner , triggerUnit) + if ( heroIndex != - 1 ) then + call DisableTrigger(WoWReforgedHeroTransformation___dropTrigger) - if ( atLeastOne ) then - call AddGeneratedSaveCode(s) + if ( GetHeroOriginalUnitType(owner , heroIndex) == 0 ) then + call h__BJDebugMsg("Warning: Original unit type has not been stored.") endif - - return atLeastOne + + call ReplaceHeroForTransformation(triggerUnit , GetHeroOriginalUnitType(owner , heroIndex)) + call SetHeroOriginalUnitType(owner , heroIndex , 0) // allows transforming again + call RefreshBackpackForPlayer(owner) + call RecreateAllEquipmentBags(owner) + call EnableTrigger(WoWReforgedHeroTransformation___dropTrigger) + call WoWReforgedHeroTransformation___TransformByHeroInventory(GetLastReplacedUnitBJ()) endif - else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! endif + set triggerUnit=null + set owner=null +endfunction - return false +function WoWReforgedHeroTransformation___TriggerConditionCast takes nothing returns boolean + return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetPlayerHeroIndex(GetOwningPlayer(GetTriggerUnit()) , GetTriggerUnit()) != - 1 endfunction -function ApplySaveCodeItems takes player whichPlayer,string s returns boolean - local unit hero= udg_Hero[GetPlayerId(whichPlayer)] - return ApplySaveCodeItemsEx(whichPlayer , s , hero) +function WoWReforgedHeroTransformation___TriggerActionCast takes nothing returns nothing + local unit triggerUnit= GetTriggerUnit() + local player owner= GetOwningPlayer(triggerUnit) + local integer heroIndex= GetPlayerHeroIndex(owner , triggerUnit) + local integer abilityId= GetSpellAbilityId() + local integer matchingType= WoWReforgedHeroTransformation___FindMatchingType(abilityId) + local unit u= null + //call BJDebugMsg("Matching transform type for ability " + GetObjectName(GetSpellAbilityId()) + ": " + I2S(matchingType) + " and hero Index " + I2S(heroIndex)) + if ( matchingType != 0 and heroIndex != - 1 ) then + //if (GetHeroOriginalUnitType(owner, heroIndex) == 0) then + //call TransformForId(triggerUnit, abilityId) + // restore + if ( s__WoWReforgedHeroTransformation___HeroTransformationItemType_matchesUnit(matchingType,triggerUnit) ) then + call ReplaceHeroForTransformation(triggerUnit , GetHeroOriginalUnitType(owner , heroIndex)) + call SetHeroOriginalUnitType(owner , heroIndex , 0) // allows transforming again + call RefreshBackpackForPlayer(owner) + call RecreateAllEquipmentBags(owner) + call WoWReforgedHeroTransformation___TransformByHeroInventory(GetLastReplacedUnitBJ()) + // transform + else + call WoWReforgedHeroTransformation___TransformForId(triggerUnit , abilityId) + endif + endif + set triggerUnit=null + set owner=null endfunction -function GetSaveCodeInfosItems takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "Multiplayer" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "Freelancer" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean generated= (GetGeneratedSaveCode((s)) != - 1) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer charges= 0 - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= GetChecksumStatus(checksum , checkedSaveCode) - local string generatedStatus= GetGeneratedStatus(generated) - local string result= "" +function WoWReforgedHeroTransformation___Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroTransformation___pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) + call TriggerAddCondition(WoWReforgedHeroTransformation___pickupTrigger, Condition(function WoWReforgedHeroTransformation___TriggerConditionPickup)) + call TriggerAddAction(WoWReforgedHeroTransformation___pickupTrigger, function WoWReforgedHeroTransformation___TriggerActionPickup) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroTransformation___dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) + call TriggerAddCondition(WoWReforgedHeroTransformation___dropTrigger, Condition(function WoWReforgedHeroTransformation___TriggerConditionDrop)) + call TriggerAddAction(WoWReforgedHeroTransformation___dropTrigger, function WoWReforgedHeroTransformation___TriggerActionDrop) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedHeroTransformation___castTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(WoWReforgedHeroTransformation___castTrigger, Condition(function WoWReforgedHeroTransformation___TriggerConditionCast)) + call TriggerAddAction(WoWReforgedHeroTransformation___castTrigger, function WoWReforgedHeroTransformation___TriggerActionCast) +endfunction - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif +//library WoWReforgedHeroTransformation ends +//library WoWReforgedItemUtils: - if ( isWarlord ) then - set warlordStatus="Warlord" + +function ActionFunctionPickupItem takes nothing returns nothing + local player heroOwner= GetOwningPlayer(WoWReforgedItemUtils__pickedupItemsHero) + if ( CanItemBePickedUp(GetEnumItem() , WoWReforgedItemUtils__pickedupItemsHero) and AddItemToBackpackForPlayer(heroOwner , GetEnumItem()) ) then + set WoWReforgedItemUtils__pickedupItemsCounter=WoWReforgedItemUtils__pickedupItemsCounter + 1 endif + set heroOwner=null +endfunction - set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) - set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) - set result=AppendSaveCodeInfo(result , "Generated: " + generatedStatus) - set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) - set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) - set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) - set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) - set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) - set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) +function PickupAllItemsAround takes unit hero returns integer + local location tmpLocation= GetUnitLoc(hero) + local rect tmpRect= RectFromCenterSizeBJ(tmpLocation, 2200.00, 2200.00) + set WoWReforgedItemUtils__pickedupItemsCounter=0 + set WoWReforgedItemUtils__pickedupItemsHero=hero + call EnumItemsInRect(tmpRect, null, function ActionFunctionPickupItem) + if ( WoWReforgedItemUtils__pickedupItemsCounter == 1 ) then + call h__DisplayTextToPlayer(GetOwningPlayer(hero), 0, 0, "Picked up 1 item.") + else + call h__DisplayTextToPlayer(GetOwningPlayer(hero), 0, 0, "Picked up " + I2S(WoWReforgedItemUtils__pickedupItemsCounter) + " items.") + endif + call RemoveRect(tmpRect) + set tmpRect=null + call RemoveLocation(tmpLocation) + set tmpLocation=null + return WoWReforgedItemUtils__pickedupItemsCounter +endfunction - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY or pos >= lastSaveCodeSegment ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdItem[(saveObject)]) // INLINED!! - set charges=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r") +function PickupAllItemsAroundByPlayer takes player whichPlayer returns integer + local unit hero= (udg_Hero[GetPlayerId((whichPlayer))]) // INLINED!! + if ( hero != null ) then + if ( IsUnitAliveBJ(hero) ) then + if ( not (UnitEventEx__Transporter[(GetUnitUserData(((hero))))] != null) ) then // INLINED!! + return PickupAllItemsAround((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r") - endif - - if ( charges > 0 ) then - set result=result + " (" + I2S(charges) + ")" + call SimError(whichPlayer , "Hero is in transporter.") endif - elseif ( saveObject == 0 ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Item Slot") else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Item with ID " + I2S(saveObject)) + call SimError(whichPlayer , "Hero is dead.") endif - set i=i + 1 - set pos=pos + 2 - endloop - - return result + else + call SimError(whichPlayer , "No hero picked.") + endif + return 0 endfunction -function GetSaveCodeShortInfosItems takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "M" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "F" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! +function DropAllItemsNotFromRaceForHero takes unit hero returns nothing + local player owner= GetOwningPlayer(hero) + local integer convertedPlayerId= GetConvertedPlayerId(owner) + local boolean playerUnlockedAllRaces= udg_PlayerUnlockedAllRaces[convertedPlayerId] + local integer playerRace1= udg_PlayerRace[convertedPlayerId] + local integer playerRace2= udg_PlayerRace2[convertedPlayerId] + local integer playerRace3= udg_PlayerRace3[convertedPlayerId] + local item slotItem= null + local integer itemRace= udg_RaceNone local integer i= 0 - local integer pos= 5 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer charges= 0 - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" - local string result= "" + if ( not playerUnlockedAllRaces ) then + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(hero, i) + if ( slotItem != null ) then + set itemRace=(GetObjectRace((GetItemTypeId(slotItem)))) // INLINED!! + if ( itemRace != udg_RaceNone and itemRace != playerRace1 and itemRace != playerRace2 and itemRace != playerRace3 ) then + call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Dropping item " + GetItemName(slotItem) + " because it is from another race.") + call UnitRemoveItemFromSlot(hero, i) + endif + endif + set slotItem=null + set i=i + 1 + endloop + endif + set owner=null +endfunction - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" +function DropAllItemsNotFromRace takes player whichPlayer returns nothing + local boolean result= false + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + set result=true + call DropAllItemsNotFromRaceForHero((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! + endif + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + set result=true + call DropAllItemsNotFromRaceForHero((udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! + endif + if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + set result=true + call DropAllItemsNotFromRaceForHero((udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! + endif + if ( not result ) then + call SimError(whichPlayer , "No hero picked.") endif +endfunction - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" +function DropAllItemsNotFromProfessionForHero takes unit hero returns nothing + local player owner= GetOwningPlayer(hero) + local integer convertedPlayerId= GetConvertedPlayerId(owner) + local integer playerProfession1= udg_PlayerProfession[convertedPlayerId] + local integer playerProfession2= udg_PlayerProfession2[convertedPlayerId] + local integer playerProfession3= udg_PlayerProfession3[convertedPlayerId] + local item slotItem= null + local integer j= 0 + local integer i= 0 + if ( not udg_PlayerUnlockedAllRaces[convertedPlayerId] ) then + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(hero, i) + if ( slotItem != null ) then + set j=0 + loop + exitwhen ( j == udg_Max_Berufe ) + if ( udg_ProfessionItemType[j] == GetItemTypeId(slotItem) and playerProfession1 != j and playerProfession2 != j and playerProfession3 != j ) then + call h__DisplayTextToPlayer(owner, 0.0, 0.0, "Dropping item " + GetItemName(slotItem) + " because it is from another profession.") + call UnitRemoveItemFromSlot(hero, i) + exitwhen ( true ) + endif + set j=j + 1 + endloop + endif + set slotItem=null + set i=i + 1 + endloop endif + set owner=null +endfunction - if ( isSinglePlayer ) then - set singlePlayerStatus="S" +function DropAllItemsNotFromProfession takes player whichPlayer returns nothing + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call DropAllItemsNotFromProfessionForHero((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! endif + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call DropAllItemsNotFromProfessionForHero((udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! + endif + if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call DropAllItemsNotFromProfessionForHero((udg_Hero3[GetPlayerId((whichPlayer))])) // INLINED!! + endif +endfunction - if ( isWarlord ) then - set warlordStatus="W" +function DropItemAtRectFromHeroByItemType takes unit hero,integer itemTypeId,rect whichRect returns nothing + local player owner= GetOwningPlayer(hero) + if ( hero == (udg_Hero[GetPlayerId((owner))]) ) then // INLINED!! + call DropQuestItemFromHeroAtRect(owner , itemTypeId , whichRect) + else + call DropQuestItemFromCreepHeroAtRect(hero , itemTypeId , whichRect) endif + set owner=null +endfunction - set i=0 - loop - exitwhen ( i == bj_MAX_INVENTORY or pos >= lastSaveCodeSegment ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - set result=result + "-" - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdItem[(saveObject)]) // INLINED!! - set charges=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r" - else - set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r" - endif - if ( charges > 0 ) then - set result=result + " (" + I2S(charges) + ")" - endif - elseif ( saveObject == 0 ) then - set result=result + "Empty Item Slot" - else - set result=result + "Invalid Item with ID " + I2S(saveObject) - endif - set i=i + 1 - set pos=pos + 2 - endloop - return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result -endfunction +//library WoWReforgedItemUtils ends +//library WoWReforgedNeutralZone: +function ResetHeroToNeutralZone takes unit hero,real x,real y,real facing returns nothing + call SetUnitPosition(hero, x, y) + call ReviveHero(hero, x, y, true) + call SetUnitFacing(hero, facing) + call DropAllItemsFromHero(hero) +endfunction -function FilterIsLivingUnitToBeSaved takes nothing returns boolean - return not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) and IsUnitAliveBJ(GetFilterUnit()) and GetUnitTypeId(GetFilterUnit()) != 'o018' and GetUnitTypeId(GetFilterUnit()) != 'o00P' and GetSaveObjectUnitType(GetUnitTypeId(GetFilterUnit())) != - 1 +function ResetAllHeroesToNeutralZone takes player whichPlayer returns nothing + local real x= GetMapNeutralZoneX(whichPlayer) + local real y= GetMapNeutralZoneY(whichPlayer) + local real facing= GetMapNeutralZoneFacing(whichPlayer) + + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call ResetHeroToNeutralZone((udg_Hero[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! + endif + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call ResetHeroToNeutralZone((udg_Hero2[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! + endif + if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call ResetHeroToNeutralZone((udg_Hero3[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! + endif + call DropBackpackForPlayerTo(whichPlayer , x , y) endfunction -function GetPlayerUnitsOrderedByPriority takes player whichPlayer,integer index returns group + +//library WoWReforgedNeutralZone ends +//library WoWReforgedPickpocketing: + + +function GetBountyGold takes unit whichUnit returns integer + local integer bountyBase= BlzGetUnitIntegerField(whichUnit, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE) + local integer bountyNumberOfDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_GOLD_BOUNTY_AWARDED_NUMBER_OF_DICE) + local integer bountySidesPerDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_GOLD_BOUNTY_AWARDED_SIDES_PER_DIE) + local integer bounty= bountyBase local integer i= 0 - local group whichGroup= CreateGroup() - local group livingUnitsToBeSaved= CreateGroup() - local unit first= null - call GroupAddGroup(udg_SaveCodeIncludedUnits[GetConvertedPlayerId(whichPlayer)], livingUnitsToBeSaved) - set bj_wantDestroyGroup=true - call GroupAddGroup(GetUnitsOfPlayerMatching(whichPlayer, Filter(function FilterIsLivingUnitToBeSaved)), livingUnitsToBeSaved) - call GroupRemoveGroup(udg_SaveCodeExcludedUnits[GetConvertedPlayerId(whichPlayer)], livingUnitsToBeSaved) - //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(livingUnitsToBeSaved))) - set bj_wantDestroyGroup=true - set livingUnitsToBeSaved=DistinctGroup(livingUnitsToBeSaved) - //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(livingUnitsToBeSaved))) loop - set first=FirstOfGroup(livingUnitsToBeSaved) - exitwhen ( first == null or i >= ( index + 1 ) * SAVE_CODE_MAX_UNITS ) - if ( i >= index * SAVE_CODE_MAX_UNITS and i < ( index + 1 ) * SAVE_CODE_MAX_UNITS and not IsUnitInGroup(first, whichGroup) ) then - call GroupAddUnit(whichGroup, first) - endif - call GroupRemoveUnit(livingUnitsToBeSaved, first) + exitwhen ( i == bountyNumberOfDice ) + set bounty=bounty + GetRandomInt(0, bountySidesPerDice) set i=i + 1 endloop - - //call BJDebugMsg("Size of units before distinct: " + I2S(CountUnitsInGroup(whichGroup))) - //call BJDebugMsg("Size of units after distinct: " + I2S(CountUnitsInGroup(result))) - - call GroupClear(livingUnitsToBeSaved) - call DestroyGroup(livingUnitsToBeSaved) - set livingUnitsToBeSaved=null - //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(whichGroup))) - - return whichGroup + return bounty endfunction -function GetSaveCodeUnitsMax takes nothing returns integer - return 8 +function GetBountyLumber takes unit whichUnit returns integer + local integer bountyBase= BlzGetUnitIntegerField(whichUnit, UNIT_IF_LUMBER_BOUNTY_AWARDED_BASE) + local integer bountyNumberOfDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_LUMBER_BOUNTY_AWARDED_NUMBER_OF_DICE) + local integer bountySidesPerDice= BlzGetUnitIntegerField(whichUnit, UNIT_IF_LUMBER_BOUNTY_AWARDED_SIDES_PER_DIE) + local integer bounty= bountyBase + local integer i= 0 + loop + exitwhen ( i == bountyNumberOfDice ) + set bounty=bounty + GetRandomInt(0, bountySidesPerDice) + set i=i + 1 + endloop + + return bounty endfunction -function CreateSaveCodeUnitsTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer units,string unitNames,string saveCode returns nothing - local string singleplayer= "no" - local string singlePlayerFileName= "Multiplayer" - local string gameMode= "Freelancer" - local string gameType= "Normal" - local string content= "" - - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" +function ShowThiefBounty takes unit hero,unit whichUnit returns nothing + local force whichForce= CreateForce() + local integer bountyGold= R2I(I2R(GetBountyGold(whichUnit)) * PICKPOCKETING_BOUNTY_PERCENTAGE) + local integer bountyLumber= R2I(I2R(GetBountyLumber(whichUnit)) * PICKPOCKETING_BOUNTY_PERCENTAGE) + call ForceAddPlayer(whichForce, GetOwningPlayer(hero)) + if ( bountyGold > 0 ) then + call Bounty(whichForce , GetUnitX(whichUnit) , GetUnitY(whichUnit) , bountyGold) + endif + if ( bountyLumber > 0 ) then + call BountyLumber(whichForce , GetUnitX(whichUnit) - 200.0 , GetUnitY(whichUnit) , bountyLumber) endif + call ForceClear(whichForce) + call DestroyForce(whichForce) + set whichForce=null +endfunction - if ( isWarlord ) then - set gameMode="Warlord" +function PickpocketingStealItem takes unit hero,unit target returns item + local integer countStealingItem= 0 + local real random= 0.0 + local item stolenItem= null + local real chance= 0 + if ( GetUnitAbilityLevel(hero, PICKPOCKETING_ABILITY_ID) > 0 ) then + set chance=GetUnitAbilityLevel(hero, PICKPOCKETING_ABILITY_ID) * 5.0 + 20 + set countStealingItem=1 + else + if ( hero == udg_Hero[GetPlayerId(GetOwningPlayer(hero))] ) then + set countStealingItem=Hero1CountItemsOfItemType(hero , PICKPOCKETING_ITEM_TYPE_ID) + else + set countStealingItem=CountItemsOfItemTypeId(hero , PICKPOCKETING_ITEM_TYPE_ID) + endif + set chance=chance + I2R(countStealingItem) * PICKPOCKETING_CHANCE endif + if ( countStealingItem > 0 ) then + set random=GetRandomReal(0.0, 100.0) + if ( random <= chance ) then + set stolenItem=HeroDropRandomItem(target) + if ( stolenItem != null ) then + call AchievementPickpocket(hero , target , stolenItem) + call UnitAddItem(hero, stolenItem) + call h__DisplayTextToPlayer(GetOwningPlayer(target), 0.0, 0.0, GetUnitName(hero) + " has stolen the item " + GetItemName(stolenItem) + " from your unit " + GetUnitName(target) + "!") + call h__DisplayTextToPlayer(GetOwningPlayer(hero), 0.0, 0.0, "Stole item " + GetItemName(stolenItem) + " from " + GetUnitName(target) + "!") + endif - if ( gameTypeNumber == udg_GameTypeEasy ) then - set gameType="Easy" - elseif ( gameTypeNumber == udg_GameTypeFast ) then - set gameType="Fast" - elseif ( gameTypeNumber == udg_GameTypeHardcore ) then - set gameType="Hardcore" + return stolenItem + endif endif + call ShowThiefBounty(hero , target) + + return null +endfunction - call FileStart() - set content=content + ("\r\n" + ("Code: -loadu " + saveCode)) // INLINED!! - set content=content + ("\r\n" + ("Units: " + I2S(units))) // INLINED!! - set content=content + ("\r\n" + ("Unit Names: " + unitNames)) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! +//library WoWReforgedPickpocketing ends +//library WoWReforgedEquipment: - // The line below creates the log - call Preload((content)) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-units-" + I2S(units) + "-" + unitNames + ".txt")) // INLINED!! +function GetEquipmentItemTypeId takes integer index returns integer + return WoWReforgedEquipment__equipmentItemTypeId[index] endfunction -function GetSaveCodeUnitsEx2 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner,group source returns string - local integer playerNameHash= CompressedAbsStringHash(playerName) - local string result= "" - local integer max= BlzGroupGetSize(source) - local unit first= null - local integer id= - 1 - local integer unitTypeId= 0 - local integer i= 0 - local integer unitsCounter= 0 - local integer count= 0 - local string unitNames= "" +function GetEquipmentItemTypeCategoryName takes integer index returns string + return WoWReforgedEquipment__equipmentItemTypeCategoryName[index] +endfunction - //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) +function GetEquipmentItemTypeCategory takes integer index returns integer + return WoWReforgedEquipment__equipmentItemTypeCategory[index] +endfunction - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) +function GetEquipmentItemTypeCategoryType takes integer index,integer category returns boolean + local integer i= Index2D(index , category , WoWReforgedEquipment_CATEGORY_TYPE_MAX) + return WoWReforgedEquipment__equipmentItemTypeCategoryType[i] +endfunction - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_UNITS) - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) - set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) - set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) - set result=result + ConvertDecimalNumberToSaveCodeSegment(index) +function SetEquipmentItemTypeCategoryType takes integer index,integer category,boolean value returns nothing + local integer i= Index2D(index , category , WoWReforgedEquipment_CATEGORY_TYPE_MAX) + set WoWReforgedEquipment__equipmentItemTypeCategoryType[i]=value +endfunction - set i=0 - loop - exitwhen ( unitsCounter >= SAVE_CODE_MAX_UNITS or i >= max ) - set first=BlzGroupUnitAt(source, i) - set unitTypeId=GetPrimaryDependencyEquivalent(GetUnitTypeId(first)) - set id=GetSaveObjectUnitType(unitTypeId) - if ( id != - 1 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(id) - set count=CountUnitsOfType(owner , unitTypeId) - set result=result + ConvertDecimalNumberToSaveCodeSegment(count) - if ( unitNames != "" ) then - set unitNames=unitNames + "," - endif - set unitNames=unitNames + I2S(count) + GetObjectName(unitTypeId) - set unitsCounter=unitsCounter + 1 - //call BJDebugMsg("Added " + GetUnitName(first) + " with count " + I2S(count)) - else - //call BJDebugMsg("Not registered save object type for " + GetUnitName(first)) - endif - set first=null - set i=i + 1 - endloop +function GetEquipmentTypeAnimation takes integer index returns integer + return WoWReforgedEquipment__equipmentItemTypeAnimation[index] +endfunction - // fill rest - loop - exitwhen ( i >= SAVE_CODE_MAX_UNITS ) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) - set i=i + 1 - endloop - - //call BJDebugMsg("Compressed result: " + result) - //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) - //call BJDebugMsg("Checked save code part: " + result) +function SetEquipmentTypeAnimation takes integer index,integer animation returns nothing + set WoWReforgedEquipment__equipmentItemTypeAnimation[index]=animation +endfunction + +function AddEquipmentItemType takes integer itemTypeId,string categoryName,integer category,integer animation returns integer + set WoWReforgedEquipment__equipmentItemTypeId[WoWReforgedEquipment__equipmentTypesCounter]=itemTypeId + set WoWReforgedEquipment__equipmentItemTypeCategoryName[WoWReforgedEquipment__equipmentTypesCounter]=categoryName + set WoWReforgedEquipment__equipmentItemTypeCategory[WoWReforgedEquipment__equipmentTypesCounter]=category + set WoWReforgedEquipment__equipmentItemTypeAnimation[WoWReforgedEquipment__equipmentTypesCounter]=animation + set WoWReforgedEquipment__equipmentTypesCounter=WoWReforgedEquipment__equipmentTypesCounter + 1 + return WoWReforgedEquipment__equipmentTypesCounter +endfunction + +// VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON +function AddEquipmentItemTypeWoWReforged takes nothing returns integer + local integer index= AddEquipmentItemType(udg_TmpItemTypeId , udg_TmpString , udg_TmpInteger , udg_TmpInteger2) + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON + return index +endfunction + +function EquipmentCategoryTwoHanded takes nothing returns nothing + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) +endfunction + +function EquipmentCategoryRange takes nothing returns nothing + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) +endfunction + +function EquipmentCategoryHead takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_HEAD +endfunction + +function EquipmentCategoryLeftHand takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND +endfunction + +function EquipmentCategoryRightHand takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND +endfunction + +function EquipmentCategoryBody takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_BODY +endfunction - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) +function EquipmentCategoryFoot takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_FOOT +endfunction - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) - endif +function EquipmentAnimationShield takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHIELD +endfunction - if ( unitsCounter > 0 ) then - if ( writeFile ) then - call CreateSaveCodeUnitsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , unitsCounter , unitNames , result) - endif +function EquipmentAnimationNoWeapon takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON +endfunction - call AddGeneratedSaveCode(result) - endif +function EquipmentAnimationLeftHandWeapon takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON +endfunction - return result +function EquipmentAnimationTwoHandHammer takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND_HAMMER endfunction -function GetSaveCodeUnitsEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner returns string - local group units= GetPlayerUnitsOrderedByPriority(owner , index) - local string result= GetSaveCodeUnitsEx2(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , owner , units) +function EquipmentAnimationTwoWeapons takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_WEAPONS +endfunction - call GroupClear(units) - call DestroyGroup(units) - set units=null +function EquipmentAnimationBow takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_BOW +endfunction - return result +function EquipmentAnimationMinigun takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_MINIGUN endfunction -function GetSaveCodeUnitsForIndex takes player whichPlayer,boolean writeFile,integer index returns string - local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) - local boolean isSinglePlayer= IsInSinglePlayer() - local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] - local integer gameType= udg_GameType - local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) +function EquipmentAnimationTwoHand takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND +endfunction - return GetSaveCodeUnitsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) +function EquipmentAnimationGun takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN endfunction -function GetSaveCodeUnits takes player whichPlayer returns string - return GetSaveCodeUnitsForIndex(whichPlayer , true , 0) +function GetMaxEquipmentItemTypes takes nothing returns integer + return WoWReforgedEquipment__equipmentTypesCounter endfunction -function GetAllSaveCodeUnits takes player whichPlayer returns nothing +function GetEquipmentItemTypeByItemTypeId takes integer itemTypeId returns integer local integer i= 0 - local integer max= (8) // INLINED!! loop - exitwhen ( i == max ) - call GetSaveCodeUnitsForIndex(whichPlayer , true , i) + exitwhen ( i >= WoWReforgedEquipment__equipmentTypesCounter ) + if ( WoWReforgedEquipment__equipmentItemTypeId[i] == itemTypeId ) then + return i + endif set i=i + 1 endloop + return 0 endfunction -function ForGroupApplyLoadedUnitEvolution takes nothing returns nothing - call AddEvolution(GetEnumUnit()) +function WoWReforgedEquipment__SetUnitEquipmentType takes unit hero,integer c,integer index returns nothing + call SaveInteger(WoWReforgedEquipment__h, GetHandleId(hero), c, index) endfunction -function ApplySaveCodeUnits takes player whichPlayer,string s returns boolean - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer j= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer id= 0 - local integer count= 0 - local location tmpLocation= GetUnitLoc((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - local boolean atLeastOne= false - local group createdUnits= CreateGroup() +function WoWReforgedEquipment__SetUnitEquipmentTypeItem takes unit hero,integer c,item whichItem returns nothing + call SaveItemHandle(WoWReforgedEquipment__h2, GetHandleId(hero), c, whichItem) +endfunction - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) +function GetUnitEquipmentType takes unit hero,integer c returns integer + return LoadInteger(WoWReforgedEquipment__h, GetHandleId(hero), c) +endfunction - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) +function GetUnitEquipmentTypeItem takes unit hero,integer c returns item + return LoadItemHandle(WoWReforgedEquipment__h2, GetHandleId(hero), c) +endfunction - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) +function GetUnitEquipmentTypeByHandleId takes integer handleId,integer c returns integer + return LoadInteger(WoWReforgedEquipment__h, handleId, c) +endfunction - if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then - set i=0 - loop - exitwhen ( i == SAVE_CODE_MAX_UNITS ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - //call BJDebugMsg("Loading save object: " + I2S(saveObject)) - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdUnit[(saveObject)]) // INLINED!! - set id=saveObjectId - if ( not IsObjectFromPlayerRace(id , whichPlayer) ) then - set id=MapUnitID(id , (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) , true) // INLINED!! - endif - - if ( id != 0 ) then - set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - //call BJDebugMsg("Loading save object " + GetObjectName(saveObjectId) + " with number: " + I2S(count)) - set j=0 - loop - exitwhen ( j == count ) - // the player does not have to build all farms before but the limit should not be exceeded - if ( GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_FOOD_USED) + GetFoodUsed(id) <= GetPlayerState(whichPlayer, PLAYER_STATE_FOOD_CAP_CEILING) ) then - if ( IsObjectFromPlayerRace(id , whichPlayer) ) then - call MoveLocation(tmpLocation, GetMapWaterNeutralZoneX(whichPlayer), GetMapWaterNeutralZoneY(whichPlayer)) - call CreateUnitAtLocSaveLast(whichPlayer, id, tmpLocation, GetMapWaterNeutralZoneFacing(whichPlayer)) - - if ( not (ConvertMoveType(BlzGetUnitIntegerField((bj_lastCreatedUnit), UNIT_IF_MOVE_TYPE)) == MOVE_TYPE_FLOAT) ) then // INLINED!! - call MoveLocationToUnit(tmpLocation , (udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - call SetUnitPositionLocFacingBJ(bj_lastCreatedUnit, tmpLocation, GetUnitFacing((udg_Hero[GetPlayerId((whichPlayer))]))) // INLINED!! - endif - - if ( IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_PEON) ) then - call AddWoWReforgedWorker(null , bj_lastCreatedUnit) - endif - - call GroupAddUnit(createdUnits, bj_lastCreatedUnit) - set atLeastOne=true - else - call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) - endif - else - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, GetObjectName(saveObjectId) + " exceeds your food maximum and hence is not loaded.") - endif - set j=j + 1 - endloop - else - call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) - endif - endif - set i=i + 1 - set pos=pos + 2 - endloop +function GetUnitEquipmentTypeItemByHandleId takes integer handleId,integer c returns item + return LoadItemHandle(WoWReforgedEquipment__h2, handleId, c) +endfunction - call ForGroupBJ(createdUnits, function ForGroupApplyLoadedUnitEvolution) - call GroupClear(createdUnits) - call DestroyGroup(createdUnits) - set createdUnits=null +function DropEquipment takes unit hero,integer c returns nothing + local integer index= (LoadInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( c))) // INLINED!! + if ( index != 0 ) then + //call BJDebugMsg("Drop item " + GetItemName(GetUnitEquipmentTypeItem(hero, c))) + call DisableTrigger(WoWReforgedEquipment__dropTrigger) + call UnitDropItemPoint(hero, (LoadItemHandle(WoWReforgedEquipment__h2, GetHandleId((hero )), ( c))), GetUnitX(hero), GetUnitY(hero)) // INLINED!! + call EnableTrigger(WoWReforgedEquipment__dropTrigger) + call SaveInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( c ), ( 0)) // INLINED!! + call SaveItemHandle(WoWReforgedEquipment__h2, GetHandleId((hero )), ( c ), ( null)) // INLINED!! + else + //call BJDebugMsg("Item in category " + I2S(c) + " is null") + endif +endfunction - call RemoveLocation(tmpLocation) - set tmpLocation=null +function GetRangeUnitTypeId takes integer unitTypeId returns integer + if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE ) then + return CUSTOMIZABLE_HERO_STRENGTH_RANGE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE ) then + return CUSTOMIZABLE_HERO_AGILITY_RANGE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE ) then + return CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE ) then + return CUSTOMIZABLE_HERO_STRENGTH_RANGE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE ) then + return CUSTOMIZABLE_HERO_AGILITY_RANGE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE ) then + return CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE + endif + + return CUSTOMIZABLE_HERO_STRENGTH_RANGE +endfunction - call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) +function GetMeleeUnitTypeId takes integer unitTypeId returns integer + if ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_MELEE ) then + return CUSTOMIZABLE_HERO_STRENGTH_MELEE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_MELEE ) then + return CUSTOMIZABLE_HERO_AGILITY_MELEE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE ) then + return CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_STRENGTH_RANGE ) then + return CUSTOMIZABLE_HERO_STRENGTH_MELEE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_AGILITY_RANGE ) then + return CUSTOMIZABLE_HERO_AGILITY_MELEE + elseif ( unitTypeId == CUSTOMIZABLE_HERO_INTELLIGENCE_RANGE ) then + return CUSTOMIZABLE_HERO_INTELLIGENCE_MELEE + endif + + return CUSTOMIZABLE_HERO_STRENGTH_MELEE +endfunction + +function ReplaceHeroForEquipment takes unit hero,integer unitTypeId returns unit + local integer i= 0 + local integer oldHandleId= GetHandleId(hero) + local player owner= GetOwningPlayer(hero) + local unit replaced= null + call DisableTrigger(WoWReforgedEquipment__pickupTrigger) + call DisableTrigger(WoWReforgedEquipment__dropTrigger) + set replaced=ReplaceHeroForTransformation(hero , unitTypeId) + call RefreshBackpackForPlayer(owner) + call RecreateAllEquipmentBags(owner) + set i=0 + loop + exitwhen ( i == WoWReforgedEquipment_CATEGORY_MAX ) + call SaveInteger(WoWReforgedEquipment__h, GetHandleId((replaced )), ( i ), ( (LoadInteger(WoWReforgedEquipment__h, (oldHandleId ), ( i))))) // INLINED!! + call SaveItemHandle(WoWReforgedEquipment__h2, GetHandleId((replaced )), ( i ), ( (LoadItemHandle(WoWReforgedEquipment__h2, (oldHandleId ), ( i))))) // INLINED!! + set i=i + 1 + endloop + if ( oldHandleId != GetHandleId(replaced) ) then + call FlushChildHashtable(WoWReforgedEquipment__h, oldHandleId) + call FlushChildHashtable(WoWReforgedEquipment__h2, oldHandleId) + endif + call EnableTrigger(WoWReforgedEquipment__pickupTrigger) + call EnableTrigger(WoWReforgedEquipment__dropTrigger) + set owner=null + return replaced +endfunction + +function WoWReforgedEquipment__UpdateEquipmentFromInventory takes unit hero returns nothing + local item slotItem= null + local integer c= 0 + local integer index= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_INVENTORY ) + set slotItem=UnitItemInSlot(hero, i) + if ( slotItem != null ) then + set index=GetEquipmentItemTypeByItemTypeId(GetItemTypeId(slotItem)) + if ( index != 0 ) then + set c=(WoWReforgedEquipment__equipmentItemTypeCategory[(index)]) // INLINED!! + call SaveInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( c ), ( index)) // INLINED!! + call SaveItemHandle(WoWReforgedEquipment__h2, GetHandleId((hero )), ( c ), ( slotItem)) // INLINED!! + endif + endif + set slotItem=null + set i=i + 1 + endloop +endfunction + +function WoWReforgedEquipment__TriggerConditionIsCustomizableAttriburesHero takes nothing returns boolean + local integer unitTypeId= GetUnitTypeId(GetTriggerUnit()) + return IsCustomizableAttributesHero(unitTypeId) or unitTypeId == ITEM_VALUES_DUMMY_HERO +endfunction + +function WoWReforgedEquipment__TriggerActionPickupItem takes nothing returns nothing + local unit hero= GetTriggerUnit() + local item whichItem= GetManipulatedItem() + local integer unitTypeId= GetUnitTypeId(hero) + local integer c= 0 + local integer indexOld= 0 + local integer index= GetEquipmentItemTypeByItemTypeId(GetItemTypeId(whichItem)) + if ( index != 0 ) then + set c=(WoWReforgedEquipment__equipmentItemTypeCategory[(index)]) // INLINED!! + if ( GetEquipmentItemTypeCategoryType(index , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED) ) then + //call BJDebugMsg("Drop all weapons.") + call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_LEFT_HAND) + call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_RIGHT_HAND) + else + // drop equipped two hand weapons if necessary + if ( (LoadInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_LEFT_HAND))) != 0 and GetEquipmentItemTypeCategoryType((LoadInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_LEFT_HAND))) , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED) ) then // INLINED!! + call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_LEFT_HAND) + endif - if ( atLeastOne ) then - call AddGeneratedSaveCode(s) + if ( (LoadInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_RIGHT_HAND))) != 0 and GetEquipmentItemTypeCategoryType((LoadInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_RIGHT_HAND))) , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED) ) then // INLINED!! + call DropEquipment(hero , WoWReforgedEquipment_CATEGORY_RIGHT_HAND) + endif + + //call BJDebugMsg("Drop current weapon from category " + I2S(c)) + // always drop the replaced equipment + call DropEquipment(hero , c) + endif + + call SaveInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( c ), ( index)) // INLINED!! + call SaveItemHandle(WoWReforgedEquipment__h2, GetHandleId((hero )), ( c ), ( whichItem)) // INLINED!! + + //call BJDebugMsg("Set equipment " + I2S(c) + " to " + GetItemName(whichItem)) + + if ( GetEquipmentItemTypeCategoryType(index , WoWReforgedEquipment_CATEGORY_TYPE_RANGE) ) then + if ( GetRangeUnitTypeId(unitTypeId) != unitTypeId ) then + //call BJDebugMsg("Replace hero.") + set hero=ReplaceHeroForEquipment(hero , GetRangeUnitTypeId(unitTypeId)) + endif + else + if ( GetMeleeUnitTypeId(unitTypeId) != unitTypeId ) then + //call BJDebugMsg("Replace hero.") + set hero=ReplaceHeroForEquipment(hero , GetMeleeUnitTypeId(unitTypeId)) endif + endif + + //call UpdateEquipmentFromInventory(hero) + endif + set whichItem=null + set hero=null +endfunction - return atLeastOne +function WoWReforgedEquipment__TriggerActionDropItem takes nothing returns nothing + local unit hero= GetTriggerUnit() + local integer index= GetEquipmentItemTypeByItemTypeId(GetItemTypeId(GetManipulatedItem())) + local integer c= 0 + if ( index != 0 ) then + set c=(WoWReforgedEquipment__equipmentItemTypeCategory[(index)]) // INLINED!! + //call BJDebugMsg("Drop " + I2S(c) + " with item " + GetItemName(GetUnitEquipmentTypeItem(hero, c))) + call SaveInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( c ), ( 0)) // INLINED!! + call SaveItemHandle(WoWReforgedEquipment__h2, GetHandleId((hero )), ( c ), ( null)) // INLINED!! + //call UpdateEquipmentFromInventory(hero) + endif + set hero=null +endfunction + +function WoWReforgedEquipment__TriggerConditionAttack takes nothing returns boolean + return IsCustomizableAttributesHero(BlzGetUnitSkin(GetAttacker())) +endfunction + +function WoWReforgedEquipment__TriggerActionAttack takes nothing returns nothing + local unit hero= GetAttacker() + local integer leftHandIndex= (LoadInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_LEFT_HAND))) // INLINED!! + local integer rightHandIndex= (LoadInteger(WoWReforgedEquipment__h, GetHandleId((hero )), ( WoWReforgedEquipment_CATEGORY_RIGHT_HAND))) // INLINED!! + if ( rightHandIndex != 0 ) then + if ( leftHandIndex != 0 and (WoWReforgedEquipment__equipmentItemTypeAnimation[(rightHandIndex)]) == VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON ) then // INLINED!! + //call BJDebugMsg("Left hand weapon even with right.") + call SetVillager255Animation(hero , (WoWReforgedEquipment__equipmentItemTypeAnimation[(leftHandIndex)])) // INLINED!! + else + //call BJDebugMsg("Right hand weapon.") + call SetVillager255Animation(hero , (WoWReforgedEquipment__equipmentItemTypeAnimation[(rightHandIndex)])) // INLINED!! endif + elseif ( leftHandIndex != 0 ) then + //call BJDebugMsg("Left hand weapon.") + //call BJDebugMsg("Left hand weapon index " + I2S(leftHandIndex)) + //call BJDebugMsg("Left hand weapon animation index " + I2S(GetEquipmentTypeAnimation(leftHandIndex))) + call SetVillager255Animation(hero , (WoWReforgedEquipment__equipmentItemTypeAnimation[(leftHandIndex)])) // INLINED!! else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + call SetVillager255Animation(hero , VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON) endif + set hero=null +endfunction - call RemoveLocation(tmpLocation) - set tmpLocation=null +function WoWReforgedEquipment__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment__pickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) + call TriggerAddCondition(WoWReforgedEquipment__pickupTrigger, Condition(function WoWReforgedEquipment__TriggerConditionIsCustomizableAttriburesHero)) + call TriggerAddAction(WoWReforgedEquipment__pickupTrigger, function WoWReforgedEquipment__TriggerActionPickupItem) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment__dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) + call TriggerAddCondition(WoWReforgedEquipment__dropTrigger, Condition(function WoWReforgedEquipment__TriggerConditionIsCustomizableAttriburesHero)) + call TriggerAddAction(WoWReforgedEquipment__dropTrigger, function WoWReforgedEquipment__TriggerActionDropItem) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment__attackTrigger, EVENT_PLAYER_UNIT_ATTACKED) + call TriggerAddCondition(WoWReforgedEquipment__attackTrigger, Condition(function WoWReforgedEquipment__TriggerConditionAttack)) + call TriggerAddAction(WoWReforgedEquipment__attackTrigger, function WoWReforgedEquipment__TriggerActionAttack) +endfunction - call ForGroupBJ(createdUnits, function ForGroupApplyLoadedUnitEvolution) - call GroupClear(createdUnits) - call DestroyGroup(createdUnits) - set createdUnits=null +function AddSaveObjectItemTypesFromEquipment takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedEquipment__equipmentTypesCounter) // INLINED!! + loop + exitwhen ( i == max ) + if ( (WoWReforgedEquipment__equipmentItemTypeId[(i)]) != 0 ) then // INLINED!! + set udg_TmpItemTypeId=(WoWReforgedEquipment__equipmentItemTypeId[(i)]) // INLINED!! +call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! + endif + set i=i + 1 + endloop +endfunction - return false +function WoWReforgedEquipment__RemoveUnitHook takes unit whichUnit returns nothing + local integer handleId= GetHandleId(whichUnit) + call FlushChildHashtable(WoWReforgedEquipment__h, handleId) + call FlushChildHashtable(WoWReforgedEquipment__h2, handleId) endfunction -function GetSaveCodeInfosUnits takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "Multiplayer" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "Freelancer" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer count= 0 - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" - local string result= "" +//processed hook: hook RemoveUnit WoWReforgedEquipment__RemoveUnitHook - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" +//library WoWReforgedEquipment ends +//library WoWReforgedSaveCodes: + + +function GetSaveCodeTypeName takes integer t returns string + if ( t == SAVE_CODE_TYPE_HEROES ) then + return "Heroes" + elseif ( t == SAVE_CODE_TYPE_ITEMS ) then + return "Items" + elseif ( t == SAVE_CODE_TYPE_UNITS ) then + return "Units" + elseif ( t == SAVE_CODE_TYPE_BUILDINGS ) then + return "Buildings" + elseif ( t == SAVE_CODE_TYPE_RESEARCHES ) then + return "Researches" + elseif ( t == SAVE_CODE_TYPE_RESOURCES ) then + return "Resources" + elseif ( t == SAVE_CODE_TYPE_CLAN ) then + return "Clan" + elseif ( t == SAVE_CODE_TYPE_LETTER ) then + return "Letter" endif + return "Unknown" +endfunction +function GetSinglePlayerStatus takes boolean isSinglePlayer returns string if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" + return "S" endif - if ( isWarlord ) then - set warlordStatus="Warlord" + return "M" +endfunction + +function GetGameTypeName takes integer gameType returns string + if ( gameType == udg_GameTypeEasy ) then + return "E" + elseif ( gameType == udg_GameTypeHardcore ) then + return "H" + elseif ( gameType == udg_GameTypeFast ) then + return "F" endif - set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) - set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) - set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) - set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) - set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) - set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) - set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) - set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) + return "N" +endfunction - set i=0 +// keep the folder name short +// otherwise there won't be any folder +function GetSaveCodeFolderNameEx takes force whichForce,real duration,integer seed returns string + local string result= "wowr-" + GetSinglePlayerStatus(IsInSinglePlayer()) + "-" + GetGameTypeName(udg_GameType) + local integer playerCounter= 0 + local integer i= 0 loop - exitwhen ( i == SAVE_CODE_MAX_UNITS ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - //call BJDebugMsg("Loading save object: " + I2S(saveObject)) - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdUnit[(saveObject)]) // INLINED!! - set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")") - else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")") - endif - elseif ( saveObject == 0 ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Unit Slot") - else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Item with ID " + I2S(saveObject)) + exitwhen ( i == bj_MAX_PLAYERS ) + if ( IsPlayerInForce(Player(i), whichForce) ) then + set playerCounter=playerCounter + 1 endif set i=i + 1 - set pos=pos + 2 endloop - return result + return result + "-" + I2S(playerCounter) + "-" + FormatTimeString(R2I(duration)) + "-S_" + I2S(WoWReforgedSaveCodes__gameSeed) endfunction -function GetSaveCodeShortInfosUnits takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "M" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "F" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer count= 0 - local string checksumStatus= "Valid" +function GetSaveCodeFolderName takes nothing returns string + local force whichForce= CreateForce() local string result= "" + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if GetPlayerController(Player(i)) == MAP_CONTROL_USER and ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING or GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_LEFT ) then + call ForceAddPlayer(whichForce, Player(i)) + endif + set i=i + 1 + endloop + set result=GetSaveCodeFolderNameEx(whichForce , udg_GameTime , WoWReforgedSaveCodes__gameSeed) + call ForceClear(whichForce) + call DestroyForce(whichForce) + set whichForce=null + return result +endfunction - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif +function GetGeneratedSaveCode takes string saveCode returns integer + local integer i= 0 + loop + exitwhen ( i >= generatedSaveCodesCounter ) + if ( saveCode == generatedSaveCodes[i] ) then + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction - if ( isSinglePlayer ) then - set singlePlayerStatus="S" - endif +function IsGeneratedSaveCode takes string saveCode returns boolean + return GetGeneratedSaveCode(saveCode) != - 1 +endfunction - if ( isWarlord ) then - set warlordStatus="W" +function AddGeneratedSaveCode takes string saveCode returns integer + local integer index= GetGeneratedSaveCode(saveCode) + if ( index == - 1 ) then + set generatedSaveCodes[generatedSaveCodesCounter]=saveCode + set generatedSaveCodesCounter=generatedSaveCodesCounter + 1 + return generatedSaveCodesCounter endif + return index +endfunction - set i=0 +function DisplayGeneratedSaveCodes takes player whichPlayer returns nothing + local string msg= "" + local integer counter= 0 + local integer i= 0 loop - exitwhen ( i == SAVE_CODE_MAX_UNITS ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - set result=result + "-" - //call BJDebugMsg("Loading save object: " + I2S(saveObject)) - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdUnit[(saveObject)]) // INLINED!! - set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")" - else - set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")" - endif - elseif ( saveObject == 0 ) then - set result=result + "Empty Unit Slot" - else - set result=result + "Invalid Item with ID " + I2S(saveObject) - endif + exitwhen ( i >= generatedSaveCodesCounter ) + set msg=msg + "\n- " + generatedSaveCodes[i] + set counter=counter + 1 set i=i + 1 - set pos=pos + 2 endloop + call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "Generated (" + I2S(counter) + "):" + msg) +endfunction - return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result +function GetGeneratedStatus takes boolean generated returns string + if ( generated ) then + return "|cffff0000Yes|r" + endif + return "|cff00ff00No|r" endfunction +function GetChecksumStatus takes integer checksum,string checkedSaveCode returns string + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + return "|cffff0000Invalid|r" + endif + return "|cff00ff00Valid|r" +endfunction -function GetSaveCodeResearchesMax takes nothing returns integer - return 8 +function ConvertSaveCodeDemigodValueToInfo takes integer value returns string + if ( value == 1 ) then + return "Light Demigod" + elseif ( value == 2 ) then + return "Dark Demigod" + elseif ( value == 3 ) then + return "Any Demigod" + endif + + return "No Demigod" endfunction -function CreateSaveCodeResearchesTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer researches,string researchNames,string saveCode returns nothing +function CreateSaveCodeTextFileHeroes takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer xpRate,integer heroLevel,integer xp,integer gold,integer lumber,integer evolutionLevel,integer powerGeneratorLevel,integer handOfGodLevel,integer mountLevel,integer masonryLevel,integer heroKills,integer heroDeaths,integer unitKills,integer unitDeaths,integer buildingsRazed,integer totalBossKills,integer heroLevel2,integer xp2,integer heroLevel3,integer xp3,integer improvedNavyLevel,integer improvedCreepHunterLevel,integer demigodValue,integer equipmentBags,string saveCode returns nothing local string singleplayer= "no" local string singlePlayerFileName= "Multiplayer" local string gameMode= "Freelancer" @@ -82565,580 +80148,439 @@ function CreateSaveCodeResearchesTextFile takes string playerName,boolean isSing call FileStart() - set content=content + ("\r\n" + ("Code: -loadr " + saveCode)) // INLINED!! - set content=content + ("\r\n" + ("Researches: " + I2S(researches))) // INLINED!! - set content=content + ("\r\n" + ("Research Names: " + researchNames)) // INLINED!! + set content=content + ("\r\n" + ("Code: -load " + saveCode)) // INLINED!! + set content=content + ("\r\n" + ("Player: " + playerName)) // INLINED!! + set content=content + ("\r\n" + ("Singleplayer: " + singleplayer)) // INLINED!! + set content=content + ("\r\n" + ("Game Mode: " + gameMode)) // INLINED!! + set content=content + ("\r\n" + ("Game Type: " + gameType)) // INLINED!! + set content=content + ("\r\n" + ("XP rate: " + I2S(xpRate))) // INLINED!! + set content=content + ("\r\n" + ("Hero Level: " + I2S(heroLevel))) // INLINED!! + set content=content + ("\r\n" + ("XP: " + I2S(xp))) // INLINED!! + set content=content + ("\r\n" + ("Demigod: " + ConvertSaveCodeDemigodValueToInfo(demigodValue))) // INLINED!! + set content=content + ("\r\n" + ("Gold: " + I2S(gold))) // INLINED!! + set content=content + ("\r\n" + ("Lumber: " + I2S(lumber))) // INLINED!! set content=content + ("\r\n" + ("")) // INLINED!! // The line below creates the log call Preload((content)) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-researches-" + I2S(researches) + "-" + researchNames + ".txt")) // INLINED!! -endfunction - -function GetSaveCodeResearchesEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner returns string - local integer playerNameHash= CompressedAbsStringHash(playerName) - local string result= "" - local integer id= - 1 - local integer i= 0 - local integer researchesCounter= 0 - local integer count= 0 - local string researchNames= "" - - //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) - - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_RESEARCHES) - set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) - set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) - set result=result + ConvertDecimalNumberToSaveCodeSegment(index) - - set i=0 - loop - exitwhen ( researchesCounter == SAVE_CODE_MAX_RESEARCHES or i == SaveObjectResearchCounter ) - exitwhen ( i >= ( index + 1 ) * SAVE_CODE_MAX_RESEARCHES ) - if ( i >= index * SAVE_CODE_MAX_RESEARCHES and i < ( index + 1 ) * SAVE_CODE_MAX_RESEARCHES ) then - set id=(SaveObjectIdResearch[(i)]) // INLINED!! - set count=GetPlayerTechCountSimple(id, owner) - if ( count > 0 ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(i) - set result=result + ConvertDecimalNumberToSaveCodeSegment(GetPlayerTechCountSimple(id, owner)) - if ( researchNames != "" ) then - set researchNames=researchNames + "," - endif - set researchNames=researchNames + GetObjectName(id) + "_" + I2S(count) - set researchesCounter=researchesCounter + 1 - endif - endif - set i=i + 1 - endloop - - // fill rest - set i=researchesCounter - loop - exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) - set i=i + 1 - endloop - - //call BJDebugMsg("Compressed result: " + result) - //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) - //call BJDebugMsg("Checked save code part: " + result) + set content="" + set content=content + ("\r\n" + ("Evolution: " + I2S(evolutionLevel))) // INLINED!! + set content=content + ("\r\n" + ("Improved Power Generator: " + I2S(powerGeneratorLevel))) // INLINED!! + set content=content + ("\r\n" + ("Hand of God: " + I2S(handOfGodLevel))) // INLINED!! + set content=content + ("\r\n" + ("Improved Mount: " + I2S(mountLevel))) // INLINED!! + set content=content + ("\r\n" + ("Improved Masonry: " + I2S(masonryLevel))) // INLINED!! + set content=content + ("\r\n" + ("Improved Navy: " + I2S(improvedNavyLevel))) // INLINED!! + set content=content + ("\r\n" + ("Improved Creep Hunter: " + I2S(improvedCreepHunterLevel))) // INLINED!! + set content=content + ("\r\n" + ("Equipment Bags: " + I2S(equipmentBags))) // INLINED!! + set content=content + ("\r\n" + ("Hero Kills: " + I2S(heroKills))) // INLINED!! + set content=content + ("\r\n" + ("Hero Deaths: " + I2S(heroDeaths))) // INLINED!! + set content=content + ("\r\n" + ("Unit Kills: " + I2S(unitKills))) // INLINED!! + set content=content + ("\r\n" + ("Unit Deaths: " + I2S(unitDeaths))) // INLINED!! + set content=content + ("\r\n" + ("Buildings Razed: " + I2S(buildingsRazed))) // INLINED!! + set content=content + ("\r\n" + ("Boss Kills: " + I2S(totalBossKills))) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) + // The line below creates the log + call Preload((content)) // INLINED!! - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) - endif + set content="" + set content=content + ("\r\n" + ("Hero Level 2: " + I2S(heroLevel2))) // INLINED!! + set content=content + ("\r\n" + ("XP 2: " + I2S(xp2))) // INLINED!! - if ( researchesCounter > 0 ) then - if ( writeFile ) then - call CreateSaveCodeResearchesTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , researchesCounter , researchNames , result) - endif + set content=content + ("\r\n" + ("Hero Level 3: " + I2S(heroLevel3))) // INLINED!! + set content=content + ("\r\n" + ("XP 3: " + I2S(xp3))) // INLINED!! - call AddGeneratedSaveCode(result) - endif + // The line below creates the log + call Preload((content)) // INLINED!! - return result + // The line below creates the file at the specified location + call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-level1-" + I2S(heroLevel) + "-level2-" + I2S(heroLevel2) + "-level3-" + I2S(heroLevel3) + "-gold-" + I2S(gold) + "-lumber-" + I2S(lumber) + ".txt")) // INLINED!! endfunction -function GetSaveCodeResearchesForIndex takes player whichPlayer,boolean writeFile,integer index returns string - local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) - local boolean isSinglePlayer= IsInSinglePlayer() - local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] - local integer gameType= udg_GameType - local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) +// use one single symbol to store these two flags +function GetSinglePlayerAndGameMode takes boolean isSinglePlayer,boolean isWarlord returns integer + if ( isSinglePlayer and isWarlord ) then + //call BJDebugMsg("Save code single player and mode 0") + return 0 + elseif ( isSinglePlayer and not isWarlord ) then + //call BJDebugMsg("Save code single player and mode 1") + return 1 + elseif ( not isSinglePlayer and isWarlord ) then + //call BJDebugMsg("Save code single player and mode 2") + return 2 + else + //call BJDebugMsg("Save code single player and mode 3") + return 3 + endif - return GetSaveCodeResearchesEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) + return 0 endfunction -function GetSaveCodeResearches takes player whichPlayer returns string - return GetSaveCodeResearchesForIndex(whichPlayer , true , 0) -endfunction +function GetSinglePlayerFromSaveCodeSegment takes integer saveCodeSegment returns boolean + if ( saveCodeSegment == 0 ) then + //call BJDebugMsg("Save code single player and mode 0") + return true + elseif ( saveCodeSegment == 1 ) then + return true + elseif ( saveCodeSegment == 2 ) then + return false + else + return false + endif -function GetAllSaveCodeResearches takes player whichPlayer returns nothing - local integer i= 0 - local integer max= (8) // INLINED!! - loop - exitwhen ( i == max ) - call GetSaveCodeResearchesForIndex(whichPlayer , true , i) - set i=i + 1 - endloop + return false endfunction -function ApplySaveCodeResearches takes player whichPlayer,string s returns boolean - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local boolean isWarlord= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer count= 0 - local boolean atLeastOne= false - - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) - - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - - if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then - set i=0 - loop - exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - //call BJDebugMsg("Loading save object: " + I2S(saveObject)) - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdResearch[(saveObject)]) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - //call BJDebugMsg("Loading save object " + GetObjectName(saveObjectId) + " with number: " + I2S(count)) - if ( not SetPlayerTechResearchedIfHigher(whichPlayer , saveObjectId , count) ) then - call h__DisplayTimedTextToPlayer(((whichPlayer ) ), 0.0, 0.0, 6.0, ( "Not loading research " + GetObjectName(( saveObjectId)) + " since your current level is higher or equal!")) // INLINED!! - endif - set atLeastOne=true - else - call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) - endif - endif - set i=i + 1 - set pos=pos + 2 - endloop - - call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) - - if ( atLeastOne ) then - call AddGeneratedSaveCode(s) - set udg_TmpPlayer=whichPlayer - call ConditionalTriggerExecute(gg_trg_Ogre_Update_Captured_Black_Drakes) - set udg_TmpPlayer=whichPlayer - call ConditionalTriggerExecute(gg_trg_Dragonkin_Update_Black_Dragons) - endif - - return atLeastOne - endif +function GetWarlordFromSaveCodeSegment takes integer saveCodeSegment returns boolean + if ( saveCodeSegment == 0 ) then + //call BJDebugMsg("Save code single player and mode 0") + return true + elseif ( saveCodeSegment == 1 ) then + return false + elseif ( saveCodeSegment == 2 ) then + return true else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + return false endif return false endfunction -function GetSaveCodeInfosResearches takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "Multiplayer" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "Freelancer" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer level= 0 - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" +function GetSaveCodeEx takes player whichPlayer,string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,integer heroLevel,integer xp,integer gold,integer lumber,integer evolutionLevel,integer powerGeneratorLevel,integer handOfGodLevel,integer mountLevel,integer masonryLevel,integer heroKills,integer heroDeaths,integer unitKills,integer unitDeaths,integer buildingsRazed,integer totalBossKills,integer heroLevel2,integer xp2,integer heroLevel3,integer xp3,integer improvedNavyLevel,integer improvedCreepHunterLevel,integer demigodValue,integer equipmentBags returns string + local integer playerNameHash= CompressedAbsStringHash(playerName) local string result= "" + + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_HEROES) + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif + set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) + set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) + set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) + set result=result + ConvertDecimalNumberToSaveCodeSegment(xp) - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif + // resources + set result=result + ConvertDecimalNumberToSaveCodeSegment(gold) + set result=result + ConvertDecimalNumberToSaveCodeSegment(lumber) - if ( isWarlord ) then - set warlordStatus="Warlord" - endif + // upgrades + set result=result + ConvertDecimalNumberToSaveCodeSegment(evolutionLevel) + set result=result + ConvertDecimalNumberToSaveCodeSegment(powerGeneratorLevel) + set result=result + ConvertDecimalNumberToSaveCodeSegment(handOfGodLevel) + set result=result + ConvertDecimalNumberToSaveCodeSegment(mountLevel) + set result=result + ConvertDecimalNumberToSaveCodeSegment(masonryLevel) - set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) - set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) - set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) - set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) - set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) - set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) - set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) - set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) + // stats + set result=result + ConvertDecimalNumberToSaveCodeSegment(heroKills) + set result=result + ConvertDecimalNumberToSaveCodeSegment(heroDeaths) + set result=result + ConvertDecimalNumberToSaveCodeSegment(unitKills) + set result=result + ConvertDecimalNumberToSaveCodeSegment(unitDeaths) + set result=result + ConvertDecimalNumberToSaveCodeSegment(buildingsRazed) + set result=result + ConvertDecimalNumberToSaveCodeSegment(totalBossKills) - set i=0 - loop - exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdResearch[(saveObject)]) // INLINED!! - set level=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")") - else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")") - endif - elseif ( saveObject == 0 ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Research Slot") - else - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Research with ID " + I2S(saveObject)) - endif - set i=i + 1 - set pos=pos + 2 - endloop + // hero 2 + set result=result + ConvertDecimalNumberToSaveCodeSegment(xp2) - return result -endfunction + // hero 3 + set result=result + ConvertDecimalNumberToSaveCodeSegment(xp3) -function GetSaveCodeShortInfosResearches takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "M" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "F" - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer i= 0 - local integer pos= 6 - local integer saveObject= 0 - local integer saveObjectId= 0 - local integer level= 0 - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" - local string result= "" + //call BJDebugMsg("Compressed result: " + result) + //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) + //call BJDebugMsg("Checked save code part: " + result) - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif + // upgrades + set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedNavyLevel) + set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedCreepHunterLevel) - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif + // demigod + set result=result + ConvertDecimalNumberToSaveCodeSegment(demigodValue) - if ( isSinglePlayer ) then - set singlePlayerStatus="S" + set result=result + ConvertDecimalNumberToSaveCodeSegment(equipmentBags) + + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) + + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) endif - if ( isWarlord ) then - set warlordStatus="W" + // never store savecode files of other players on the disk + if ( GetLocalPlayer() == whichPlayer ) then + call CreateSaveCodeTextFileHeroes(playerName , isSinglePlayer , isWarlord , gameType , xpRate , heroLevel , xp , gold , lumber , evolutionLevel , powerGeneratorLevel , handOfGodLevel , mountLevel , masonryLevel , heroKills , heroDeaths , unitKills , unitDeaths , buildingsRazed , totalBossKills , heroLevel2 , xp2 , heroLevel3 , xp3 , improvedNavyLevel , improvedCreepHunterLevel , demigodValue , equipmentBags , result) endif - set i=0 - loop - exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) - set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! - set result=result + "-" - if ( saveObject > 0 ) then - set saveObjectId=(SaveObjectIdResearch[(saveObject)]) // INLINED!! - set level=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! - if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then - set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")" - else - set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")" - endif - elseif ( saveObject == 0 ) then - set result=result + "Empty Research Slot" - else - set result=result + "Invalid Research with ID " + I2S(saveObject) - endif - set i=i + 1 - set pos=pos + 2 - endloop + call AddGeneratedSaveCode(result) - return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result + return result endfunction -function AppendClanSaveCodeMember takes string members,string playerName,integer playerRank returns string - if ( StringLength(playerName) > 0 ) then - if ( StringLength(members) > 0 ) then - set members=members + ", " - endif - - return members + playerName + "_" + GetClanRankName(playerRank) +function GetSaveCodeDemigodValue takes player whichPlayer returns integer + local integer unitTypeId= GetUnitTypeId(udg_Held[GetConvertedPlayerId(whichPlayer)]) + if ( unitTypeId == DEMIGOD_LIGHT ) then + return 1 + elseif ( unitTypeId == DEMIGOD_DARK ) then + return 2 + elseif ( GetPlayerTechCountSimple(UPG_DEMIGOD, whichPlayer) > 0 ) then + return 3 endif - return members + return 0 endfunction -function CreateSaveCodeClanTextFile takes boolean isSinglePlayer,string clanName,integer icon,integer clanSoundIndex,integer gold,integer lumber,integer improvedClanHallLevel,integer improvedClanLevel,string playerName0,integer playerRank0,string playerName1,integer playerRank1,string playerName2,integer playerRank2,string playerName3,integer playerRank3,string playerName4,integer playerRank4,string playerName5,integer playerRank5,string playerName6,integer playerRank6,integer memberCounter,string saveCode returns nothing - local string singleplayer= "no" - local string singlePlayerFileName= "Multiplayer" - local string leader= "" - local string members= "" - local string content= "" - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" - endif +function GetSaveCode takes player whichPlayer returns string + local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) + local boolean isSinglePlayer= IsInSinglePlayer() + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + local boolean isWarlord= udg_PlayerIsWarlord[convertedPlayerId] + local integer gameType= udg_GameType + local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) + local integer heroLevel= GetHeroLevel1(whichPlayer) + local integer xp= GetHeroXP1(whichPlayer) + local integer gold= GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_GOLD) + local integer lumber= GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER) + local integer evolutionLevel= GetPlayerTechCountSimple(UPG_EVOLUTION, whichPlayer) + local integer powerGeneratorLevel= GetPlayerTechCountSimple(UPG_IMPROVED_POWER_GENERATOR, whichPlayer) + local integer handOfGodLevel= GetPlayerTechCountSimple(UPG_IMPROVED_HAND_OF_GOD, whichPlayer) + local integer mountLevel= GetPlayerTechCountSimple(UPG_IMPROVED_MOUNT, whichPlayer) + local integer masonryLevel= GetPlayerTechCountSimple(UPG_IMPROVED_MASONRY, whichPlayer) + local integer heroKills= GetPlayerScore(whichPlayer, PLAYER_SCORE_HEROES_KILLED) + local integer heroDeaths= udg_HeroDeaths[convertedPlayerId] + local integer unitKills= GetPlayerScore(whichPlayer, PLAYER_SCORE_UNITS_KILLED) + local integer unitDeaths= udg_UnitsLost[convertedPlayerId] + local integer buildingsRazed= GetPlayerScore(whichPlayer, PLAYER_SCORE_STRUCT_RAZED) + local integer totalBossKills= udg_BossKills[convertedPlayerId] + local integer heroLevel2= GetHeroLevel2(whichPlayer) + local integer xp2= GetHeroXP2(whichPlayer) + local integer heroLevel3= GetHeroLevel3(whichPlayer) + local integer xp3= GetHeroXP3(whichPlayer) + local integer improvedNavyLevel= GetPlayerTechCountSimple(UPG_IMPROVED_NAVY, whichPlayer) + local integer improvedCreepHunterLevel= GetPlayerTechCountSimple(UPG_IMPROVED_CREEP_HUNTER, whichPlayer) + local integer equipmentBags= BlzGroupGetSize(udg_EquipmentBags[convertedPlayerId]) - set members=AppendClanSaveCodeMember(members , playerName0 , playerRank0) + return GetSaveCodeEx(whichPlayer , GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , heroLevel , xp , gold , lumber , evolutionLevel , powerGeneratorLevel , handOfGodLevel , mountLevel , masonryLevel , heroKills , heroDeaths , unitKills , unitDeaths , buildingsRazed , totalBossKills , heroLevel2 , xp2 , heroLevel3 , xp3 , improvedNavyLevel , improvedCreepHunterLevel , GetSaveCodeDemigodValue(whichPlayer) , equipmentBags) +endfunction - if ( playerRank0 == udg_ClanRankLeader ) then - set leader=playerName0 +function ReadSaveCodeEx takes string saveCode,integer hash,string alphabet returns string + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Deobfuscating with the hash!") + return ConvertSaveCodeFromObfuscatedVersionEx(saveCode , hash , alphabet) endif - set members=AppendClanSaveCodeMember(members , playerName1 , playerRank1) - - if ( playerRank1 == udg_ClanRankLeader ) then - set leader=playerName1 - endif + //call BJDebugMsg("Just returning!") - set members=AppendClanSaveCodeMember(members , playerName2 , playerRank2) + return saveCode +endfunction - if ( playerRank2 == udg_ClanRankLeader ) then - set leader=playerName2 +function ReadSaveCode takes string saveCode,integer hash returns string + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Deobfuscating with the hash!") + return (ConvertSaveCodeFromObfuscatedVersionEx((saveCode ) , ( hash) , SAVE_CODE_DIGITS)) // INLINED!! endif - set members=AppendClanSaveCodeMember(members , playerName3 , playerRank3) - - if ( playerRank3 == udg_ClanRankLeader ) then - set leader=playerName3 - endif + //call BJDebugMsg("Just returning!") - set members=AppendClanSaveCodeMember(members , playerName4 , playerRank4) + return saveCode +endfunction - if ( playerRank4 == udg_ClanRankLeader ) then - set leader=playerName4 +function SetPlayerStateIfHigher takes player whichPlayer,playerstate playerState,integer value returns boolean + if ( value > GetPlayerState(whichPlayer, playerState) ) then + call SetPlayerStateBJ(whichPlayer, playerState, value) + return true endif - set members=AppendClanSaveCodeMember(members , playerName5 , playerRank5) + return false +endfunction - if ( playerRank5 == udg_ClanRankLeader ) then - set leader=playerName5 +function SetPlayerTechResearchedIfHigher takes player whichPlayer,integer techId,integer level returns boolean + if ( level > GetPlayerTechCountSimple(techId, whichPlayer) ) then + call h__SetPlayerTechResearched(whichPlayer, techId, level) + return true endif + return false +endfunction - set members=AppendClanSaveCodeMember(members , playerName6 , playerRank6) +function DisplaySaveCodeError takes player whichPlayer,string message returns nothing + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, message) +endfunction - if ( playerRank6 == udg_ClanRankLeader ) then - set leader=playerName6 +function DisplaySaveCodeErrorAtLeastOne takes player whichPlayer,boolean atLeastOne returns nothing + if ( not atLeastOne ) then + call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "Empty savecode!")) // INLINED!! endif +endfunction - call FileStart() - - set content=content + ("\r\n" + ("Code: -loadc " + saveCode + " " + clanName)) // INLINED!! - set content=content + ("\r\n" + ("Singleplayer: " + singleplayer)) // INLINED!! - set content=content + ("\r\n" + ("Name: " + clanName)) // INLINED!! - set content=content + ("\r\n" + ("Icon: " + GetObjectName(icon))) // INLINED!! - set content=content + ("\r\n" + ("Sound: " + (GetObjectName((WoWReforgedClanShop___clanSoundsItemTypeIds[((clanSoundIndex))]))))) // INLINED!! - set content=content + ("\r\n" + ("Leader: " + leader)) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - - // The line below creates the log - call Preload((content)) // INLINED!! - - set content="" - set content=content + ("\r\n" + ("Members: " + members)) // INLINED!! - set content=content + ("\r\n" + ("Gold: " + I2S(gold))) // INLINED!! - set content=content + ("\r\n" + ("Lumber: " + I2S(lumber))) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - - // The line below creates the log - call Preload((content)) // INLINED!! - - set content="" - set content=content + ("\r\n" + ("Improved Clan Hall Level: " + I2S(improvedClanHallLevel))) // INLINED!! - set content=content + ("\r\n" + ("Improved Clan Level: " + I2S(improvedClanLevel))) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - - // The line below creates the log - call Preload((content)) // INLINED!! +function DisplaySaveCodeErrorLowerResearch takes player whichPlayer,integer techId returns nothing + call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "Not loading research " + GetObjectName(techId) + " since your current level is higher or equal!")) // INLINED!! +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WoWR-Clan-" + clanName + "-" + playerName0 + "-" + singlePlayerFileName + "-gold-" + I2S(gold) + "-lumber-" + I2S(lumber) + "-members-" + I2S(memberCounter) + ".txt")) // INLINED!! +function DisplaySaveCodeErrorSameGame takes player whichPlayer returns nothing + call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! endfunction -function GetSaveCodeClanEx takes boolean isSinglePlayer,string clanName,integer icon,sound whichSound,integer gold,integer lumber,boolean hasAIPlayer,integer improvedClanHallLevel,integer improvedClanLevel,string playerName0,integer playerRank0,string playerName1,integer playerRank1,string playerName2,integer playerRank2,string playerName3,integer playerRank3,string playerName4,integer playerRank4,string playerName5,integer playerRank5,string playerName6,integer playerRank6,integer membersCounter returns string - local string result= "" - local integer clanSoundIndex= GetClanSoundIndex(whichSound) +function ApplySaveCode3_14 takes player whichPlayer,string s returns boolean + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local real demigodX= GetRectCenterX(gg_rct_redirect_forbidden_zone) + local real demigodY= GetRectCenterY(gg_rct_redirect_forbidden_zone) - //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) //call BJDebugMsg("Save code XP " + I2S(xp)) - - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_CLAN) // 0 - if ( isSinglePlayer ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) // 1 - else - set result=result + ConvertDecimalNumberToSaveCodeSegment(1) // 1 - endif - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(clanName)) // 2 - set result=result + ConvertDecimalNumberToSaveCodeSegment(icon) // 3 - set result=result + ConvertDecimalNumberToSaveCodeSegment(clanSoundIndex) // 4 - set result=result + ConvertDecimalNumberToSaveCodeSegment(gold) // 5 - set result=result + ConvertDecimalNumberToSaveCodeSegment(lumber) // 6 - set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedClanHallLevel) // 7 - set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedClanLevel) // 8 - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName0)) // 9 - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank0) // 10 - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName1)) // 11 - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank1) // 12 - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName2)) // 13 - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank2) // 14 - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName3)) // 15 - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank3) // 16 - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName4)) // 17 - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank4) // 18 - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName5)) // 19 - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank5) // 20 - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName6)) // 21 - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank6) // 22 + if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[convertedPlayerId] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) and xp >= GetHeroXP(udg_Held[convertedPlayerId]) ) then + if ( demigodValue == 1 ) then + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) + if ( udg_Held[convertedPlayerId] != null ) then + set udg_TmpUnit=udg_Held[convertedPlayerId] +call BecomeDemigod((udg_TmpUnit) , DEMIGOD_LIGHT) // INLINED!! + endif + elseif ( demigodValue == 2 ) then + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) + if ( udg_Held[convertedPlayerId] != null ) then + set udg_TmpUnit=udg_Held[convertedPlayerId] +call BecomeDemigod((udg_TmpUnit) , DEMIGOD_DARK) // INLINED!! + endif + elseif ( demigodValue == 3 ) then + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) + endif - if ( hasAIPlayer ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(1) // 23 - else - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) // 23 - endif + call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_GOLD, gold) + call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER, lumber) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_EVOLUTION , evolutionLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_CHEAP_EVOLUTION , evolutionLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_POWER_GENERATOR , powerGeneratorLevel) + set udg_TmpPlayer=whichPlayer + call TriggerExecute(gg_trg_Power_Generator_Update_Heal_Icons) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_HAND_OF_GOD , handOfGodLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MOUNT , mountLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MASONRY , masonryLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_NAVY , improvedNavyLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_CREEP_HUNTER , improvedCreepHunterLevel) - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) + set udg_HeroKills[convertedPlayerId]=heroKills + set udg_HeroDeaths[convertedPlayerId]=heroDeaths + set udg_UnitKills[convertedPlayerId]=unitKills + set udg_UnitsLost[convertedPlayerId]=unitDeaths + set udg_BossKills[convertedPlayerId]=totalBossKills - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , CompressedAbsStringHash(clanName)) - endif + if ( udg_Held[convertedPlayerId] != null and xp > GetHeroXP(udg_Held[convertedPlayerId]) ) then + call SetHeroXP(udg_Held[convertedPlayerId], xp, true) + endif - call CreateSaveCodeClanTextFile(isSinglePlayer , clanName , icon , clanSoundIndex , gold , lumber , improvedClanHallLevel , improvedClanLevel , playerName0 , playerRank0 , playerName1 , playerRank1 , playerName2 , playerRank2 , playerName3 , playerRank3 , playerName4 , playerRank4 , playerName5 , playerRank5 , playerName6 , playerRank6 , membersCounter , result) + if ( udg_Held[convertedPlayerId] == null and xp > udg_CharacterStartXP[convertedPlayerId] ) then + set udg_CharacterStartXP[convertedPlayerId]=xp + set udg_TmpPlayer=whichPlayer + set udg_TmpInteger=GetHeroLevelByXP(xp) + call TriggerExecute(gg_trg_Hero_Journey_Update_from_Level) + endif - call AddGeneratedSaveCode(result) + if ( udg_Held2[convertedPlayerId] != null and xp2 > GetHeroXP(udg_Held2[convertedPlayerId]) ) then + call SetHeroXP(udg_Held2[convertedPlayerId], xp2, true) + endif - return result -endfunction + if ( udg_Held2[convertedPlayerId] == null and xp2 > udg_Held2XP[convertedPlayerId] ) then + set udg_Held2XP[convertedPlayerId]=xp2 + endif -function GetSaveCodeClan takes integer clan returns string - local string playerName0= "" - local integer playerRank0= udg_ClanRankMember - local string playerName1= "" - local integer playerRank1= udg_ClanRankMember - local string playerName2= "" - local integer playerRank2= udg_ClanRankMember - local string playerName3= "" - local integer playerRank3= udg_ClanRankMember - local string playerName4= "" - local integer playerRank4= udg_ClanRankMember - local string playerName5= "" - local integer playerRank5= udg_ClanRankMember - local string playerName6= "" - local integer playerRank6= udg_ClanRankMember - local integer improvedClanHallLevel= 0 - local integer improvedClanLevel= 0 - local integer clanMemberCounter= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then - set improvedClanHallLevel=IMaxBJ(GetPlayerTechCountSimple(UPG_IMPROVED_CLAN_HALL, Player(i)), improvedClanHallLevel) - set improvedClanLevel=IMaxBJ(GetPlayerTechCountSimple(UPG_IMPROVED_CLAN, Player(i)), improvedClanLevel) + if ( udg_Held3[convertedPlayerId] != null and xp3 > GetHeroXP(udg_Held3[convertedPlayerId]) ) then + call SetHeroXP(udg_Held3[convertedPlayerId], xp3, true) + endif - if ( clanMemberCounter == 0 ) then - set playerName0=GetPlayerName(Player(i)) - set playerRank0=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] - elseif ( clanMemberCounter == 1 ) then - set playerName1=GetPlayerName(Player(i)) - set playerRank1=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] - elseif ( clanMemberCounter == 2 ) then - set playerName2=GetPlayerName(Player(i)) - set playerRank2=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] - elseif ( clanMemberCounter == 3 ) then - set playerName3=GetPlayerName(Player(i)) - set playerRank3=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] - elseif ( clanMemberCounter == 4 ) then - set playerName4=GetPlayerName(Player(i)) - set playerRank4=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] - elseif ( clanMemberCounter == 5 ) then - set playerName5=GetPlayerName(Player(i)) - set playerRank5=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] - elseif ( clanMemberCounter == 6 ) then - set playerName6=GetPlayerName(Player(i)) - set playerRank6=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + if ( udg_Held3[convertedPlayerId] == null and xp3 > udg_Held3XP[convertedPlayerId] ) then + set udg_Held3XP[convertedPlayerId]=xp3 endif - set clanMemberCounter=clanMemberCounter + 1 + + call RecreateEquipmentBags(whichPlayer , equipmentBags) + + call AddGeneratedSaveCode(s) + + return true endif - set i=i + 1 - endloop + else + call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + endif - return GetSaveCodeClanEx(IsInSinglePlayer() , udg_ClanName[clan] , udg_ClanIcon[clan] , udg_ClanSound[clan] , udg_ClanGold[clan] , udg_ClanLumber[clan] , udg_ClanHasAIPlayer[clan] , improvedClanHallLevel , improvedClanLevel , playerName0 , playerRank0 , playerName1 , playerRank1 , playerName2 , playerRank2 , playerName3 , playerRank3 , playerName4 , playerRank4 , playerName5 , playerRank5 , playerName6 , playerRank6 , clanMemberCounter) + return false endfunction -function ApplySaveCodeClan takes player whichPlayer,string name,string s returns boolean - local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= isSinglePlayerFlag == 0 - local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! +function ApplySaveCodePre3_14 takes player whichPlayer,string s returns boolean + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + local string saveCode= ReadSaveCodeEx(s , CompressedAbsStringHash(GetPlayerName(whichPlayer)) , SAVE_CODE_DIGITS_PRE_3_14) + local integer playerNameHash= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 0 , SAVE_CODE_DIGITS_PRE_3_14) + local integer isSinglePlayerAndWarlord= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 1 , SAVE_CODE_DIGITS_PRE_3_14) + local integer gameType= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 2 , SAVE_CODE_DIGITS_PRE_3_14) + local integer xpRate= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 3 , SAVE_CODE_DIGITS_PRE_3_14) + local integer xp= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 4 , SAVE_CODE_DIGITS_PRE_3_14) + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local integer gold= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 5 , SAVE_CODE_DIGITS_PRE_3_14) + local integer lumber= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 6 , SAVE_CODE_DIGITS_PRE_3_14) + local integer evolutionLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 7 , SAVE_CODE_DIGITS_PRE_3_14) + local integer powerGeneratorLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 8 , SAVE_CODE_DIGITS_PRE_3_14) + local integer handOfGodLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 9 , SAVE_CODE_DIGITS_PRE_3_14) + local integer mountLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 10 , SAVE_CODE_DIGITS_PRE_3_14) + local integer masonryLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 11 , SAVE_CODE_DIGITS_PRE_3_14) + local integer heroKills= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 12 , SAVE_CODE_DIGITS_PRE_3_14) + local integer heroDeaths= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 13 , SAVE_CODE_DIGITS_PRE_3_14) + local integer unitKills= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 14 , SAVE_CODE_DIGITS_PRE_3_14) + local integer unitDeaths= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 15 , SAVE_CODE_DIGITS_PRE_3_14) + local integer buildingsRazed= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 16 , SAVE_CODE_DIGITS_PRE_3_14) + local integer totalBossKills= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 17 , SAVE_CODE_DIGITS_PRE_3_14) + local integer xp2= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 18 , SAVE_CODE_DIGITS_PRE_3_14) + local integer xp3= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 19 , SAVE_CODE_DIGITS_PRE_3_14) + local integer improvedNavyLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 20 , SAVE_CODE_DIGITS_PRE_3_14) + local integer improvedCreepHunterLevel= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 21 , SAVE_CODE_DIGITS_PRE_3_14) + local integer demigodValue= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 22 , SAVE_CODE_DIGITS_PRE_3_14) + local integer equipmentBags= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , 23 , SAVE_CODE_DIGITS_PRE_3_14) local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean atLeastOne= false - local integer clan= 0 - local integer i= 0 - local integer currentPlayerNameHash= 0 + local integer checksum= ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx(saveCode , lastSaveCodeSegment , SAVE_CODE_DIGITS_PRE_3_14) + local real demigodX= GetRectCenterX(gg_rct_redirect_forbidden_zone) + local real demigodY= GetRectCenterY(gg_rct_redirect_forbidden_zone) //call BJDebugMsg("Obfuscated save code: " + s) //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) @@ -83151,84 +80593,74 @@ function ApplySaveCodeClan takes player whichPlayer,string name,string s returns //call BJDebugMsg("Save code XP " + I2S(xp)) if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and nameHash == CompressedAbsStringHash(name) and isSinglePlayer == IsInSinglePlayer() ) then - if ( playerNameHash == playerNameHash0 or playerNameHash == playerNameHash1 or playerNameHash == playerNameHash2 or playerNameHash == playerNameHash3 or playerNameHash == playerNameHash4 or playerNameHash == playerNameHash5 or playerNameHash == playerNameHash6 ) then - set i=1 - loop - exitwhen ( i > udg_ClanCounter ) - if ( StringLength(udg_ClanName[i]) > 0 and udg_ClanName[i] == name ) then - set clan=i - endif - set i=i + 1 - endloop - - if ( clan == 0 ) then - set udg_ClanName[udg_ClanCounter]=name - set udg_ClanIcon[udg_ClanCounter]=icon - set udg_ClanSound[udg_ClanCounter]=(udg_ClanSound[(clanSoundIndex)]) // INLINED!! - set udg_ClanGold[udg_ClanCounter]=gold - set udg_ClanLumber[udg_ClanCounter]=lumber - set clan=udg_ClanCounter - set udg_ClanCounter=udg_ClanCounter + 1 - //call BJDebugMsg("Creating new clan " + name) + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[convertedPlayerId] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) and xp >= GetHeroXP(udg_Held[convertedPlayerId]) ) then + if ( demigodValue == 1 ) then + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) + if ( udg_Held[convertedPlayerId] != null ) then + set udg_TmpUnit=udg_Held[convertedPlayerId] +call BecomeDemigod((udg_TmpUnit) , DEMIGOD_LIGHT) // INLINED!! + endif + elseif ( demigodValue == 2 ) then + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) + if ( udg_Held[convertedPlayerId] != null ) then + set udg_TmpUnit=udg_Held[convertedPlayerId] +call BecomeDemigod((udg_TmpUnit) , DEMIGOD_DARK) // INLINED!! endif + elseif ( demigodValue == 3 ) then + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_DEMIGOD , 1) + endif - set i=0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then - //call BJDebugMsg("Checking for player " + GetPlayerName(Player(i))) - set currentPlayerNameHash=CompressedAbsStringHash(GetPlayerName(Player(i))) - if ( currentPlayerNameHash == playerNameHash0 or currentPlayerNameHash == playerNameHash1 or currentPlayerNameHash == playerNameHash2 or currentPlayerNameHash == playerNameHash3 or currentPlayerNameHash == playerNameHash4 or CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash5 or currentPlayerNameHash == playerNameHash6 ) then - //call BJDebugMsg("Got clan player " + GetPlayerName(Player(i))) - set atLeastOne=true - if ( not IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then - call ForceAddPlayer(udg_ClanPlayers[clan], Player(i)) - endif - set udg_ClanPlayerClan[i + 1]=clan - call SetPlayerTechResearchedIfHigher(Player(i) , UPG_HERO_CLAN , 1) - call SetPlayerTechResearchedIfHigher(Player(i) , UPG_IMPROVED_CLAN_HALL , improvedClanHallLevel) - call SetPlayerTechResearchedIfHigher(Player(i) , UPG_IMPROVED_CLAN , improvedClanLevel) + call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_GOLD, gold) + call SetPlayerStateBJ(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER, lumber) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_EVOLUTION , evolutionLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_CHEAP_EVOLUTION , evolutionLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_POWER_GENERATOR , powerGeneratorLevel) + set udg_TmpPlayer=whichPlayer + call TriggerExecute(gg_trg_Power_Generator_Update_Heal_Icons) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_HAND_OF_GOD , handOfGodLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MOUNT , mountLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_MASONRY , masonryLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_NAVY , improvedNavyLevel) + call SetPlayerTechResearchedIfHigher(whichPlayer , UPG_IMPROVED_CREEP_HUNTER , improvedCreepHunterLevel) - if ( clanHasAIPlayer == 1 ) then - call SetPlayerTechResearchedSwap(UPG_CLAN_HAS_NO_AI_PLAYER, 0, Player(i)) - endif - endif + set udg_HeroKills[convertedPlayerId]=heroKills + set udg_HeroDeaths[convertedPlayerId]=heroDeaths + set udg_UnitKills[convertedPlayerId]=unitKills + set udg_UnitsLost[convertedPlayerId]=unitDeaths + set udg_BossKills[convertedPlayerId]=totalBossKills - if ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash0 ) then - set udg_ClanPlayerRank[i + 1]=playerRank0 - elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash1 ) then - set udg_ClanPlayerRank[i + 1]=playerRank1 - elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash2 ) then - set udg_ClanPlayerRank[i + 1]=playerRank2 - elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash3 ) then - set udg_ClanPlayerRank[i + 1]=playerRank3 - elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash4 ) then - set udg_ClanPlayerRank[i + 1]=playerRank4 - elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash5 ) then - set udg_ClanPlayerRank[i + 1]=playerRank5 - elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash6 ) then - set udg_ClanPlayerRank[i + 1]=playerRank6 - endif - endif - set i=i + 1 - endloop + if ( udg_Held[convertedPlayerId] != null and xp > GetHeroXP(udg_Held[convertedPlayerId]) ) then + call SetHeroXP(udg_Held[convertedPlayerId], xp, true) + endif - call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) + if ( udg_Held[convertedPlayerId] == null and xp > udg_CharacterStartXP[convertedPlayerId] ) then + set udg_CharacterStartXP[GetConvertedPlayerId(whichPlayer)]=xp + set udg_TmpPlayer=whichPlayer + set udg_TmpInteger=GetHeroLevelByXP(xp) + call TriggerExecute(gg_trg_Hero_Journey_Update_from_Level) + endif - if ( atLeastOne ) then - call AddGeneratedSaveCode(s) - - call PickClanAIPlayer(clan) + if ( udg_Held2[convertedPlayerId] != null and xp2 > GetHeroXP(udg_Held2[convertedPlayerId]) ) then + call SetHeroXP(udg_Held2[convertedPlayerId], xp2, true) + endif - call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_UNITACQUIRED, GetPlayerNameColored(whichPlayer) + " has created a new clan " + udg_ClanName[clan] + "!") - call PlaySoundBJ(gg_snd_ClanInvitation) - endif + if ( udg_Held2[convertedPlayerId] == null and xp2 > udg_Held2XP[convertedPlayerId] ) then + set udg_Held2XP[convertedPlayerId]=xp2 + endif - return atLeastOne - else - call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "You are not a member of this clan!")) // INLINED!! + if ( udg_Held3[convertedPlayerId] != null and xp3 > GetHeroXP(udg_Held3[convertedPlayerId]) ) then + call SetHeroXP(udg_Held3[convertedPlayerId], xp3, true) + endif + + if ( udg_Held3[convertedPlayerId] == null and xp3 > udg_Held3XP[convertedPlayerId] ) then + set udg_Held3XP[convertedPlayerId]=xp3 endif + + call RecreateEquipmentBags(whichPlayer , equipmentBags) + + call AddGeneratedSaveCode(s) + + return true endif else call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! @@ -83237,1671 +80669,1858 @@ function ApplySaveCodeClan takes player whichPlayer,string name,string s returns return false endfunction -function GetClanPlayerName takes integer playerNameHash returns string - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( StringLength(GetPlayerName(Player(i))) > 0 and CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash ) then - return GetPlayerName(Player(i)) +function ApplySaveCode takes player whichPlayer,string s returns boolean + return ApplySaveCode3_14(whichPlayer , s) or ApplySaveCodePre3_14(whichPlayer , s) +endfunction + +function GetSaveCodeErrors takes player whichPlayer,string s returns string + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string result= "" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + + if ( (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! + set result=result + "Is from the same game!" + endif + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " endif - set i=i + 1 - endloop + + set result=result + "Expected different checksum!" + endif - return "Unknown" + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif + + set result=result + "Expected different player name!" + endif + + if ( isSinglePlayer != IsInSinglePlayer() ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif + + if ( isSinglePlayer ) then + set result=result + "Expected singleplayer!" + else + set result=result + "Expected multiplayer!" + endif + endif + + if ( gameType != udg_GameType ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif + + set result=result + "Expected game type: " + I2S(gameType) + endif + + if ( isWarlord != udg_PlayerIsWarlord[convertedPlayerId] ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif + + if ( isWarlord ) then + set result=result + "Expected game mode Warlord!" + else + set result=result + "Expected game mode Freelancer!" + endif + endif + + if ( xpRate != R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif + + set result=result + "Expected XP rate: " + I2S(xpRate) + endif + + if ( xp < GetHeroXP(udg_Held[convertedPlayerId]) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif + + set result=result + "Expected more XP than your current!" + endif + + if ( checksum == CompressedAbsStringHash(saveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[convertedPlayerId] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) and xp >= GetHeroXP(udg_Held[convertedPlayerId]) ) then + set result="None errors detected. Stored " + I2S(xp) + "XP." + endif + + return result endfunction -function GetSaveCodeInfosClan takes string name,string s returns string - local string result= "" - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) +function AppendSaveCodeInfo takes string result,string appended returns string + if ( StringLength(result) > 0 ) then + set result=result + "|n" + endif + + return result + appended +endfunction + +function GetSaveCodeInfos takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= isSinglePlayerFlag == 0 + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local string playerName= GetPlayerName(whichPlayer) + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) local string singlePlayerStatus= "Multiplayer" - local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! - local string clanHasAIPlayerText= "No AI player" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "Freelancer" + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local string demigodValueInfo= ConvertSaveCodeDemigodValueToInfo(demigodValue) + local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! + local string result= "" local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) local string checksumStatus= "Valid" - local boolean atLeastOne= false - local integer clan= 0 - local integer i= 0 - - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) - - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then set checksumStatus="Invalid" endif + + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif + if ( isSinglePlayer ) then set singlePlayerStatus="Singleplayer" endif - if ( clanHasAIPlayer == 1 ) then - set clanHasAIPlayerText="Has AI player" + if ( isWarlord ) then + set warlordStatus="Warlord" endif set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) - set result=AppendSaveCodeInfo(result , "Name: " + name) - set result=AppendSaveCodeInfo(result , "Icon: " + GetObjectName(icon)) - set result=AppendSaveCodeInfo(result , "Sound: " + (GetObjectName((WoWReforgedClanShop___clanSoundsItemTypeIds[((clanSoundIndex))])))) // INLINED!! + set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) + set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) + set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) + set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) + set result=AppendSaveCodeInfo(result , "XP: " + I2S(xp)) + set result=AppendSaveCodeInfo(result , "Demigod: " + demigodValueInfo) + set result=AppendSaveCodeInfo(result , "XP 2: " + I2S(xp2)) + set result=AppendSaveCodeInfo(result , "XP 3: " + I2S(xp3)) set result=AppendSaveCodeInfo(result , "Gold: " + I2S(gold)) set result=AppendSaveCodeInfo(result , "Lumber: " + I2S(lumber)) - set result=AppendSaveCodeInfo(result , "Improved Clan Hall: " + I2S(improvedClanHallLevel)) - set result=AppendSaveCodeInfo(result , "Improved Clan: " + I2S(improvedClanLevel)) - set result=AppendSaveCodeInfo(result , clanHasAIPlayerText) - set result=AppendSaveCodeInfo(result , "Player 1: " + GetClanPlayerName(playerNameHash0) + " (" + GetClanRankName(playerRank0) + ")") - set result=AppendSaveCodeInfo(result , "Player 2: " + GetClanPlayerName(playerNameHash1) + " (" + GetClanRankName(playerRank1) + ")") - set result=AppendSaveCodeInfo(result , "Player 3: " + GetClanPlayerName(playerNameHash2) + " (" + GetClanRankName(playerRank2) + ")") - set result=AppendSaveCodeInfo(result , "Player 4: " + GetClanPlayerName(playerNameHash3) + " (" + GetClanRankName(playerRank3) + ")") - set result=AppendSaveCodeInfo(result , "Player 5: " + GetClanPlayerName(playerNameHash4) + " (" + GetClanRankName(playerRank4) + ")") - set result=AppendSaveCodeInfo(result , "Player 6: " + GetClanPlayerName(playerNameHash5) + " (" + GetClanRankName(playerRank5) + ")") - set result=AppendSaveCodeInfo(result , "Player 7: " + GetClanPlayerName(playerNameHash6) + " (" + GetClanRankName(playerRank6) + ")") + set result=AppendSaveCodeInfo(result , "Evolution: " + I2S(evolutionLevel)) + set result=AppendSaveCodeInfo(result , "Power Generator: " + I2S(powerGeneratorLevel)) + set result=AppendSaveCodeInfo(result , "Hand of God: " + I2S(handOfGodLevel)) + set result=AppendSaveCodeInfo(result , "Mount: " + I2S(mountLevel)) + set result=AppendSaveCodeInfo(result , "Masonry: " + I2S(masonryLevel)) + set result=AppendSaveCodeInfo(result , "Navy: " + I2S(improvedNavyLevel)) + set result=AppendSaveCodeInfo(result , "Creep Hunter: " + I2S(improvedCreepHunterLevel)) + set result=AppendSaveCodeInfo(result , "Equipment Bags: " + I2S(equipmentBags)) + set result=AppendSaveCodeInfo(result , "Hero Kills: " + I2S(heroKills)) + set result=AppendSaveCodeInfo(result , "Hero Deaths: " + I2S(heroDeaths)) + set result=AppendSaveCodeInfo(result , "Hero Kills: " + I2S(unitKills)) + set result=AppendSaveCodeInfo(result , "Unit Deaths: " + I2S(unitDeaths)) + set result=AppendSaveCodeInfo(result , "Buildings Razed: " + I2S(buildingsRazed)) + set result=AppendSaveCodeInfo(result , "Boss kills: " + I2S(totalBossKills)) return result endfunction -function GetSaveCodeShortInfosClan takes string name,string s returns string - local string result= "" - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) +function GetSaveCodeShortInfos takes string playerName,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= isSinglePlayerFlag == 0 + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) local string singlePlayerStatus= "M" - local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! - local string clanHasAIPlayerText= "No AI player" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "F" + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! + local string demigodValueInfo= ConvertSaveCodeDemigodValueToInfo(demigodValue) local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! local string checksumStatus= "Valid" - local boolean atLeastOne= false - local integer clan= 0 - local integer i= 0 - - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) - - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then set checksumStatus="Invalid" endif + + if ( playerNameHash != CompressedAbsStringHash(playerName) ) then + set playerName="Not yours" + endif + if ( isSinglePlayer ) then set singlePlayerStatus="S" endif - if ( clanHasAIPlayer == 1 ) then - set clanHasAIPlayerText="Has AI player" + if ( isWarlord ) then + set warlordStatus="W" endif - return name + "-" + singlePlayerStatus + "-gold_" + I2S(gold) + "-lumber_" + I2S(lumber) + "-p1_" + GetClanPlayerName(playerNameHash0) + "-p2_" + GetClanPlayerName(playerNameHash1) + "-p3_" + GetClanPlayerName(playerNameHash2) + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-l1_" + I2S(GetHeroLevelByXP(xp)) + "-l2_" + I2S(GetHeroLevelByXP(xp2)) + "-l3_" + I2S(GetHeroLevelByXP(xp3)) + "-g_" + I2S(gold) + "-l_" + I2S(lumber) + "-e_" + I2S(evolutionLevel) endfunction -function GetSaveCodeClanGold takes string name,string s returns integer +function GetSaveCodeXp1 takes string name,string s returns integer local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local string checksumStatus= "Valid" - - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif + local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - return gold + return xp endfunction -function GetSaveCodeClanLumber takes string name,string s returns integer +function GetSaveCodeXp2 takes string name,string s returns integer local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local string checksumStatus= "Valid" - - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif + local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - return lumber + return xp2 endfunction -function AccountNameBelongsToClanSaveCode takes string name,string s returns boolean - local string result= "" - local integer accountNameHash= StringHash(name) +function GetSaveCodeXp3 takes string name,string s returns integer local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! - local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! - local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! - return accountNameHash == playerNameHash0 or accountNameHash == playerNameHash1 or accountNameHash == playerNameHash2 or accountNameHash == playerNameHash3 or accountNameHash == playerNameHash4 or accountNameHash == playerNameHash5 or accountNameHash == playerNameHash6 + return xp3 endfunction -// Mailbox System - -function CreateSaveCodeLetterTextFile takes string playerNameFrom,string playerNameTo,string message,string saveCode returns nothing - local string content= "" - - call FileStart() - - set content=content + ("\r\n" + ("Code:")) // INLINED!! - set content=content + ("\r\n" + ("-loadl " + saveCode)) // INLINED!! - set content=content + ("\r\n" + ("From: " + playerNameFrom)) // INLINED!! - set content=content + ("\r\n" + ("To: " + playerNameTo)) // INLINED!! - set content=content + ("\r\n" + ("Message Length: " + I2S(StringLength(message)))) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - - // The line below creates the log - call Preload((content)) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-letter-from_" + playerNameFrom + "-to_" + playerNameTo + "-messageLength_" + I2S(StringLength(message)) + ".txt")) // INLINED!! +function GetSaveCodeGold takes string name,string s returns integer + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + + return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! endfunction -function AddGeneratedSaveCodeLetter takes string playerNameFrom,string playerNameTo,string message returns nothing - local integer index= 0 - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( GetPlayerName(Player(i)) == playerNameTo ) then - call h__DisplayTimedTextToPlayer(Player(i), 0.0, 0.0, 40.0, "You received a letter from " + playerNameFrom + ". Use \"-mailbox\" to list all letters.") - exitwhen ( true ) - endif - set i=i + 1 - endloop - set index=PrestoredSaveCodeCounter - set PrestoredSaveCodePlayerName[index]=playerNameTo - set PrestoredSaveCode[index]=message - set PrestoredSaveCodeType[index]=PRESTORED_SAVECODE_TYPE_LETTER - set PrestoredSaveCodePlayerNamesCounter[index]=0 - set PrestoredSaveCodeCounter=PrestoredSaveCodeCounter + 1 - set lastAddedPrestoredClan=index +function GetSaveCodeLumber takes string name,string s returns integer + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + + return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! endfunction -function GetSaveCodeLetter takes string playerNameFrom,string playerNameTo,string message returns string - local integer i= 0 - local integer playerNameToHash= CompressedAbsStringHash(playerNameTo) - local string result= "" +function GetSaveCodeHeroKills takes string name,string s returns integer + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_LETTER) - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameToHash) - set result=result + ConvertStringToSaveCodeSegment(playerNameFrom , playerNameToHash) - set result=result + ConvertStringToSaveCodeSegment(message , playerNameToHash) - - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) - - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameToHash) - endif - - call CreateSaveCodeLetterTextFile(playerNameFrom , playerNameTo , message , result) - - call AddGeneratedSaveCode(result) - call AddGeneratedSaveCodeLetter(playerNameFrom , playerNameTo , message) - - return result + return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! endfunction -function GetSaveCodeInfosLetter takes string playerNameTo,string s returns string - local string result= "" - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerNameTo)) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local string playerNameToText= playerNameTo - local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) - local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" - - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) - - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - - if ( playerNameToHash != CompressedAbsStringHash(playerNameTo) ) then - set playerNameToText="Invalid" - endif - - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - - set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) - set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) - set result=AppendSaveCodeInfo(result , "To: " + playerNameToText) - set result=AppendSaveCodeInfo(result , "From: " + playerNameFrom) - set result=AppendSaveCodeInfo(result , "Message: " + message) - - return result +function GetSaveCodeHeroDeaths takes string name,string s returns integer + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + + return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! endfunction -function GetSaveCodeShortInfosLetter takes string playerNameTo,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerNameTo)) +function GetSaveCodeIsMatching takes player whichPlayer,string s returns boolean + local string playerName= GetPlayerName(whichPlayer) + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local string playerNameToText= playerNameTo - local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) - local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "M" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "F" + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer evolutionLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer powerGeneratorLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer handOfGodLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer mountLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer masonryLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer heroDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer unitDeaths= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer buildingsRazed= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer totalBossKills= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xp3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedNavyLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedCreepHunterLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer demigodValue= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local integer equipmentBags= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 24) , SAVE_CODE_DIGITS)) // INLINED!! + local string demigodValueInfo= ConvertSaveCodeDemigodValueToInfo(demigodValue) local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" - - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) - - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) - - if ( playerNameToHash != CompressedAbsStringHash(playerNameTo) ) then - set playerNameToText="Invalid" - endif - - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - return "f_" + playerNameFrom + "-t_" + playerNameToText + "-m_" + I2S(StringLength(message)) + return isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) endfunction -function ApplySaveCodeLetterEx takes player whichPlayer,string playerName,string s returns boolean +function GetSaveCodeMaxHeroLevel takes string playerName,string s returns integer local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) - local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) + local integer xp= GetSaveCodeXp1(saveCode , playerName) + local integer xp2= GetSaveCodeXp2(saveCode , playerName) + local integer xp3= GetSaveCodeXp3(saveCode , playerName) local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameToHash == CompressedAbsStringHash(playerName) ) then - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 120.0, "Letter from " + playerNameFrom + ": " + message) - - return true + if ( xp2 > xp and xp2 > xp3 ) then + return GetHeroLevelByXP(xp2) + elseif ( xp3 > xp and xp3 > xp2 ) then + return GetHeroLevelByXP(xp3) endif - return false + return GetHeroLevelByXP(xp) endfunction -function ApplySaveCodeLetter takes player whichPlayer,string playerName,string s returns boolean - return ApplySaveCodeLetterEx(whichPlayer , "all" , s) or ApplySaveCodeLetterEx(whichPlayer , playerName , s) +function GetSaveCodeBuildingsMax takes nothing returns integer + return 8 endfunction -function GetSaveCodeErrorsLetter takes player whichPlayer,string playerName,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) - local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) - local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) - local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) - local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local string result= "" - +function CreateSaveCodeBuildingsTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer buildings,string buildingNames,string saveCode returns nothing + local string singleplayer= "no" + local string singlePlayerFileName= "Multiplayer" + local string gameMode= "Freelancer" + local string gameType= "Normal" + local string content= "" - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set result=result + "Expected different checksum!" + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" endif - if ( playerNameToHash != CompressedAbsStringHash(playerName) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif - - set result=result + "Expected different player name!" + if ( isWarlord ) then + set gameMode="Warlord" endif - if ( StringLength(result) == 0 ) then - set result="None errors detected." + if ( gameTypeNumber == udg_GameTypeEasy ) then + set gameType="Easy" + elseif ( gameTypeNumber == udg_GameTypeFast ) then + set gameType="Fast" + elseif ( gameTypeNumber == udg_GameTypeHardcore ) then + set gameType="Hardcore" endif - return result -endfunction + call FileStart() -// Save and Load Auto + set content=content + ("\r\n" + ("Code: -loadb " + saveCode)) // INLINED!! + set content=content + ("\r\n" + ("Buildings: " + I2S(buildings))) // INLINED!! + set content=content + ("\r\n" + ("Building Names: " + buildingNames)) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + // The line below creates the log + call Preload((content)) // INLINED!! -function SaveAndLoadAutoGetPlayerFromSyncData takes string source returns player - return Player(S2I((StringTokenEx((source ) , ( 0) , " " , false)))) // INLINED!! + // The line below creates the file at the specified location + call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-buildings-" + I2S(buildings) + "-" + buildingNames + ".txt")) // INLINED!! endfunction -function SaveAndLoadAutoGetContentFromSyncData takes string source returns string - return (StringTokenEx((source ) , ( 1) , " " , false)) // INLINED!! -endfunction -function SaveAndLoadAutoTriggerAction takes nothing returns nothing - local string syncData= BlzGetTriggerSyncData() - local player sourcePlayer= (Player(S2I((StringTokenEx(((syncData) ) , ( 0) , " " , false))))) // INLINED!! - local string content= (StringTokenEx(((syncData) ) , ( 1) , " " , false)) // INLINED!! - //call BJDebugMsg("Syncing data from player " + GetPlayerName(sourcePlayer) + ": " + content) - set SaveAndLoadAutoSyncCounter[GetPlayerId(sourcePlayer)]=SaveAndLoadAutoSyncCounter[GetPlayerId(sourcePlayer)] + 1 -endfunction +function CountUnitsOfTypeFromGroup takes group whichGroup,integer unitTypeId returns integer + local integer i= 0 + local integer max= BlzGroupGetSize(whichGroup) + local integer count= 0 + local unit first= null + loop + exitwhen ( i >= max ) + set first=BlzGroupUnitAt(whichGroup, i) + if ( GetPrimaryDependencyEquivalent(GetUnitTypeId(first)) == GetPrimaryDependencyEquivalent(unitTypeId) ) then + set count=count + 1 + endif + set first=null + set i=i + 1 + endloop + //call BJDebugMsg("Count unit type " + GetObjectName(unitTypeId) + " with count " + I2S(i)) -function SaveAndLoadAutoInit takes nothing returns nothing - call TriggerRegisterAnyPlayerSyncEvent(SaveAndLoadAutoSyncTrigger , SAVE_AND_LOAD_AUTO_PREFIX , false) - call TriggerAddAction(SaveAndLoadAutoSyncTrigger, function SaveAndLoadAutoTriggerAction) + return count endfunction -function LoadFileForAllPlayers takes integer file,player whichPlayer returns string - local force allPlayingUsers= null - local string content= "" - local boolean synced= false - local real timeout= 0.0 - set SaveAndLoadAutoSyncCounter[GetPlayerId(whichPlayer)]=0 - if ( GetLocalPlayer() == whichPlayer ) then - set content=(s__File_readEx((file),false)) // INLINED!! - call BlzSendSyncData(SAVE_AND_LOAD_AUTO_PREFIX, I2S(GetPlayerId(whichPlayer)) + " " + content) - endif - +function DistinctGroup takes group whichGroup returns group + local integer i= 0 + local integer max= BlzGroupGetSize(whichGroup) + local group result= CreateGroup() + local unit first= null loop - set synced=SaveAndLoadAutoSyncCounter[GetPlayerId(whichPlayer)] >= CountPlayersInForceBJ((ForceUtils___allPlayingUsers)) // INLINED!! - exitwhen ( timeout >= 5.0 or synced ) - call TriggerSleepAction(1.0) - set timeout=timeout + 1.0 + exitwhen ( i >= max ) + set first=BlzGroupUnitAt(whichGroup, i) + //call BJDebugMsg("First: " + GetUnitName(first)) + exitwhen ( first == null ) + if ( CountUnitsOfTypeFromGroup(result , GetPrimaryDependencyEquivalent(GetUnitTypeId(first))) == 0 ) then + call GroupAddUnit(result, first) + //call BJDebugMsg("Add to distinct") + endif + set first=null + set i=i + 1 endloop - - if ( synced ) then - return content + + if ( bj_wantDestroyGroup ) then + call GroupClear(whichGroup) + call DestroyGroup(whichGroup) + set whichGroup=null + set bj_wantDestroyGroup=false endif - return null + return result endfunction -//library WoWReforgedSaveCodes ends -//library WoWReforgedSkillUI: +function WoWReforgedSaveCodes__FilterIsUnitType takes nothing returns boolean + return GetPrimaryDependencyEquivalent(GetUnitTypeId(GetFilterUnit())) == WoWReforgedSaveCodes__tmpFilterId +endfunction + +function CountUnitsOfType takes player whichPlayer,integer id returns integer + local group g= CreateGroup() + local integer count= 0 + set WoWReforgedSaveCodes__tmpFilterId=id + call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function WoWReforgedSaveCodes__FilterIsUnitType)) + set count=BlzGroupGetSize(g) + call GroupClear(g) + call DestroyGroup(g) + set g=null + return count +endfunction +function FilterIsLivingBuildingToBeSaved takes nothing returns boolean + return IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) and IsUnitAliveBJ(GetFilterUnit()) and GetSaveObjectBuildingType(GetPrimaryDependencyEquivalent(GetUnitTypeId(GetFilterUnit()))) != - 1 +endfunction -function WoWReforgedSkillUI__SetSkillUIVisibleAll takes boolean visible returns nothing +function GetPlayerBuildingsOrderedByPriority takes player whichPlayer,integer index returns group + local group whichGroup= CreateGroup() + local group buildingsToBeSaved= CreateGroup() + local unit first= null local integer i= 0 - local integer max= 3 + local integer convertedPlayerId= GetConvertedPlayerId(whichPlayer) + call GroupAddGroup(udg_SaveCodeIncludedUnits[convertedPlayerId], buildingsToBeSaved) + set bj_wantDestroyGroup=true + call GroupAddGroup(GetUnitsOfPlayerMatching(whichPlayer, Filter(function FilterIsLivingBuildingToBeSaved)), buildingsToBeSaved) + call GroupRemoveGroup(udg_SaveCodeExcludedUnits[convertedPlayerId], buildingsToBeSaved) loop - exitwhen ( i == max ) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameUp[i], visible) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameDown[i], visible) + set first=FirstOfGroup(buildingsToBeSaved) + exitwhen ( first == null or i >= ( index + 1 ) * SAVE_CODE_MAX_BUILDINGS ) + if ( i >= index * SAVE_CODE_MAX_BUILDINGS and i < ( index + 1 ) * SAVE_CODE_MAX_BUILDINGS and not IsUnitInGroup(first, whichGroup) ) then + call GroupAddUnit(whichGroup, first) + endif + call GroupRemoveUnit(buildingsToBeSaved, first) set i=i + 1 endloop -endfunction - -// use in trigger action because of GetSingleSelectedUnit -function UpdateSkillPointsUI takes player whichPlayer returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string attributePoints= I2S(R2I((LoadReal(Attributes___h, GetHandleId((WoWReforgedSkillUI__currentHero[playerId] )), ( udg_AttributeAttributePoints))))) // INLINED!! - local boolean visible= not WoWReforgedSkillUI__hidden[playerId] - //call BJDebugMsg("Selection for player " + I2S(playerId)) - if ( WoWReforgedSkillUI__currentHero[playerId] != null and ( IsCustomizableAttributesHero(GetUnitTypeId(WoWReforgedSkillUI__currentHero[playerId])) or IsOriginalUnitTypeCustomizableAttributesHero(WoWReforgedSkillUI__currentHero[playerId]) ) and GetSingleSelectedUnit(whichPlayer) == WoWReforgedSkillUI__currentHero[playerId] ) then - if ( whichPlayer == GetLocalPlayer() ) then - call WoWReforgedSkillUI__SetSkillUIVisibleAll(visible) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameToggle, true) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameAttributePoints, true) - call BlzFrameSetText(WoWReforgedSkillUI__IconFrameAttributePoints, attributePoints) - endif - else - //call BJDebugMsg("Hide mine " + GetUnitName(selected)) - if ( whichPlayer == GetLocalPlayer() ) then - call WoWReforgedSkillUI__SetSkillUIVisibleAll(false) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameToggle, false) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameAttributePoints, false) - endif - endif -endfunction -function WoWReforgedSkillUI__TriggerActionUpdateSkillPointsUI takes nothing returns nothing - call UpdateSkillPointsUI(WoWReforgedSkillUI__tmpPlayer) -endfunction + call GroupClear(buildingsToBeSaved) + call DestroyGroup(buildingsToBeSaved) + set buildingsToBeSaved=null -function WoWReforgedSkillUI__UpdateSkillPointsUIExec takes player whichPlayer returns nothing - set WoWReforgedSkillUI__tmpPlayer=whichPlayer - call TriggerExecute(WoWReforgedSkillUI__tmpTrigger) + return whichGroup endfunction -function WoWReforgedSkillUI__SetSkillUIVisible takes player whichPlayer,boolean visible returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call WoWReforgedSkillUI__SetSkillUIVisibleAll(visible) - endif - call UpdateSkillPointsUI(whichPlayer) +function GetAbsCoordinate takes real coordinate,real min returns real + return RAbsBJ(min) + coordinate endfunction -function WoWReforgedSkillUI__TriggerActionUp takes nothing returns nothing - local integer a= LoadInteger(WoWReforgedSkillUI__h, GetHandleId(GetTriggeringTrigger()), 0) +function GetAbsCoordinateX takes real coordinate returns real + local rect worldBounds= GetWorldBounds() + local real x= GetAbsCoordinate(coordinate , GetRectMinX(worldBounds)) + call RemoveRect(worldBounds) + set worldBounds=null - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzSendSyncData(WoWReforgedSkillUI__PREFIX, "Up" + I2S(a)) - endif + return x endfunction -function WoWReforgedSkillUI__TriggerActionDown takes nothing returns nothing - local integer a= LoadInteger(WoWReforgedSkillUI__h, GetHandleId(GetTriggeringTrigger()), 0) - - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzSendSyncData(WoWReforgedSkillUI__PREFIX, "Down" + I2S(a)) - endif -endfunction +function GetAbsCoordinateY takes real coordinate returns real + local rect worldBounds= GetWorldBounds() + local real y= GetAbsCoordinate(coordinate , GetRectMinY(worldBounds)) + call RemoveRect(worldBounds) + set worldBounds=null -function WoWReforgedSkillUI__TriggerActionToggle takes nothing returns nothing - local integer playerId= GetPlayerId(GetTriggerPlayer()) - local boolean visible= WoWReforgedSkillUI__hidden[playerId] - set WoWReforgedSkillUI__hidden[playerId]=not WoWReforgedSkillUI__hidden[playerId] - call WoWReforgedSkillUI__SetSkillUIVisible(GetTriggerPlayer() , not WoWReforgedSkillUI__hidden[playerId]) - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - if ( visible ) then - call BlzFrameSetTexture(WoWReforgedSkillUI__IconFrameToggleFrame, "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-DownArrow.blp", 0, true) - else - call BlzFrameSetTexture(WoWReforgedSkillUI__IconFrameToggleFrame, "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-UpArrow.blp", 0, true) - endif - endif - call UpdateSkillPointsUI(GetTriggerPlayer()) - //call BJDebugMsg("Click toggle.") + return y endfunction -function WoWReforgedSkillUI__CreateSkillUIButtons takes integer a,real x,real y returns nothing - set WoWReforgedSkillUI__IconFrameUp[a]=BlzCreateFrameByType("BUTTON", "AttributeUpButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameUp[a], FRAMEPOINT_TOPLEFT, x, y) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameUp[a], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedSkillUI__WIDTH, y - WoWReforgedSkillUI__HEIGHT) - call BlzFrameSetLevel(WoWReforgedSkillUI__IconFrameUp[a], 2) - - set WoWReforgedSkillUI__IconFrameUpFrame[a]=BlzCreateFrameByType("BACKDROP", "AttributeUpButtonFrame", WoWReforgedSkillUI__IconFrameUp[a], "", 0) - call BlzFrameSetAllPoints(WoWReforgedSkillUI__IconFrameUpFrame[a], WoWReforgedSkillUI__IconFrameUp[a]) - call BlzFrameSetTexture(WoWReforgedSkillUI__IconFrameUpFrame[a], "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-UpArrow.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedSkillUI__IconFrameUpFrame[a], true) - - set WoWReforgedSkillUI__upTrigger[a]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedSkillUI__upTrigger[a], WoWReforgedSkillUI__IconFrameUp[a], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedSkillUI__upTrigger[a], function WoWReforgedSkillUI__TriggerActionUp) - call SaveInteger(WoWReforgedSkillUI__h, GetHandleId(WoWReforgedSkillUI__upTrigger[a]), 0, a) - - set WoWReforgedSkillUI__IconFrameDown[a]=BlzCreateFrameByType("BUTTON", "AttributeDownButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameDown[a], FRAMEPOINT_TOPLEFT, x, y - WoWReforgedSkillUI__HEIGHT - WoWReforgedSkillUI__SPACING) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameDown[a], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedSkillUI__WIDTH, y - WoWReforgedSkillUI__HEIGHT - WoWReforgedSkillUI__SPACING - WoWReforgedSkillUI__HEIGHT) - call BlzFrameSetLevel(WoWReforgedSkillUI__IconFrameDown[a], 2) - - set WoWReforgedSkillUI__IconFrameDownFrame[a]=BlzCreateFrameByType("BACKDROP", "AttributeDownButtonFrame", WoWReforgedSkillUI__IconFrameDown[a], "", 0) - call BlzFrameSetAllPoints(WoWReforgedSkillUI__IconFrameDownFrame[a], WoWReforgedSkillUI__IconFrameDown[a]) - call BlzFrameSetTexture(WoWReforgedSkillUI__IconFrameDownFrame[a], "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-DownArrow.blp", 0, true) - call BlzFrameSetEnable(WoWReforgedSkillUI__IconFrameDownFrame[a], true) - - set WoWReforgedSkillUI__downTrigger[a]=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedSkillUI__downTrigger[a], WoWReforgedSkillUI__IconFrameDown[a], FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedSkillUI__downTrigger[a], function WoWReforgedSkillUI__TriggerActionDown) - call SaveInteger(WoWReforgedSkillUI__h, GetHandleId(WoWReforgedSkillUI__downTrigger[a]), 0, a) +function ConvertAbsCoordinate takes real coordinate,real min returns real + return coordinate - RAbsBJ(min) endfunction -function WoWReforgedSkillUI__HideSkillUI takes nothing returns nothing - call WoWReforgedSkillUI__SetSkillUIVisibleAll(false) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameToggle, false) - call BlzFrameSetVisible(WoWReforgedSkillUI__IconFrameAttributePoints, false) -endfunction +function ConvertAbsCoordinateX takes real coordinate returns real + local rect worldBounds= GetWorldBounds() + local real x= (((coordinate )*1.0) - RAbsBJ((( GetRectMinX(worldBounds))*1.0))) // INLINED!! + call RemoveRect(worldBounds) + set worldBounds=null -function WoWReforgedSkillUI__CreateSkillUI takes nothing returns nothing - call WoWReforgedSkillUI__CreateSkillUIButtons(bj_HEROSTAT_STR , WoWReforgedSkillUI__X , WoWReforgedSkillUI__Y) - call WoWReforgedSkillUI__CreateSkillUIButtons(bj_HEROSTAT_AGI , WoWReforgedSkillUI__X , WoWReforgedSkillUI__Y2) - call WoWReforgedSkillUI__CreateSkillUIButtons(bj_HEROSTAT_INT , WoWReforgedSkillUI__X , WoWReforgedSkillUI__Y3) + return x +endfunction - set WoWReforgedSkillUI__IconFrameToggle=BlzCreateFrameByType("BUTTON", "AttributeToggleButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameToggle, FRAMEPOINT_TOPLEFT, WoWReforgedSkillUI__TOGGLE_X, WoWReforgedSkillUI__TOGGLE_Y) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameToggle, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedSkillUI__TOGGLE_X + WoWReforgedSkillUI__WIDTH, WoWReforgedSkillUI__TOGGLE_Y - WoWReforgedSkillUI__HEIGHT) - call BlzFrameSetLevel(WoWReforgedSkillUI__IconFrameToggle, 2) - - set WoWReforgedSkillUI__IconFrameToggleFrame=BlzCreateFrameByType("BACKDROP", "AttributeToggleButtonFrame", WoWReforgedSkillUI__IconFrameToggle, "", 0) - call BlzFrameSetAllPoints(WoWReforgedSkillUI__IconFrameToggleFrame, WoWReforgedSkillUI__IconFrameToggle) - call BlzFrameSetTexture(WoWReforgedSkillUI__IconFrameToggleFrame, "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-DownArrow.blp", 0, true) - - set WoWReforgedSkillUI__toggleTrigger=CreateTrigger() - call BlzTriggerRegisterFrameEvent(WoWReforgedSkillUI__toggleTrigger, WoWReforgedSkillUI__IconFrameToggle, FRAMEEVENT_CONTROL_CLICK) - call TriggerAddAction(WoWReforgedSkillUI__toggleTrigger, function WoWReforgedSkillUI__TriggerActionToggle) - - set WoWReforgedSkillUI__IconFrameAttributePoints=BlzCreateFrameByType("TEXT", "AttributePoints", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameAttributePoints, FRAMEPOINT_TOPLEFT, WoWReforgedSkillUI__ATTRIBUTE_POINTS_X, WoWReforgedSkillUI__TOGGLE_Y) - call BlzFrameSetAbsPoint(WoWReforgedSkillUI__IconFrameAttributePoints, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedSkillUI__ATTRIBUTE_POINTS_X + WoWReforgedSkillUI__ATTRIBUTE_POINTS_WIDTH, WoWReforgedSkillUI__TOGGLE_Y - WoWReforgedSkillUI__HEIGHT) - call BlzFrameSetText(WoWReforgedSkillUI__IconFrameAttributePoints, "0") - call BlzFrameSetTextAlignment(WoWReforgedSkillUI__IconFrameAttributePoints, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) +function ConvertAbsCoordinateY takes real coordinate returns real + local rect worldBounds= GetWorldBounds() + local real y= (((coordinate )*1.0) - RAbsBJ((( GetRectMinY(worldBounds))*1.0))) // INLINED!! + call RemoveRect(worldBounds) + set worldBounds=null - // hide for all players - call WoWReforgedSkillUI__HideSkillUI() + return y endfunction -function WoWReforgedSkillUI__TriggerConditionSync takes nothing returns boolean - local string data= BlzGetTriggerSyncData() - local integer playerId= GetPlayerId(GetTriggerPlayer()) - local integer a= bj_HEROSTAT_STR - if ( StringStartsWith(data , "Up") ) then - set a=S2I(StringRemoveFromStart(data , "Up")) - call WoWReforgedSkillAttribute(WoWReforgedSkillUI__currentHero[playerId] , a , 1.0) - call UpdateSkillPointsUI(GetTriggerPlayer()) - elseif ( StringStartsWith(data , "Down") ) then - set a=S2I(StringRemoveFromStart(data , "Down")) - call WoWReforgedSkillAttribute(WoWReforgedSkillUI__currentHero[playerId] , a , - 1.0) - call UpdateSkillPointsUI(GetTriggerPlayer()) - endif - return false -endfunction +function GetSaveCodeBuildingsEx2 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner,group b returns string + local integer playerNameHash= CompressedAbsStringHash(playerName) + local string result= "" + local integer max= BlzGroupGetSize(b) + local unit first= null + local integer id= - 1 + local integer i= 0 + local integer buildingsCounter= 0 + local string buildingNames= "" -function WoWReforgedSkillUI__TriggerConditionSelected takes nothing returns boolean - local integer playerId= GetPlayerId(GetTriggerPlayer()) - set WoWReforgedSkillUI__currentHero[playerId]=GetTriggerUnit() - - call WoWReforgedSkillUI__UpdateSkillPointsUIExec(GetTriggerPlayer()) + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) - return false -endfunction + //call BJDebugMsg("Size of buildings: " + I2S(CountUnitsInGroup(buildings))) -function WoWReforgedSkillUI__TriggerConditionDeselected takes nothing returns boolean - local integer playerId= GetPlayerId(GetTriggerPlayer()) - //call BJDebugMsg("Selection for player " + I2S(playerId)) - if ( WoWReforgedSkillUI__currentHero[playerId] == GetTriggerUnit() ) then - set WoWReforgedSkillUI__currentHero[playerId]=null - endif - - call WoWReforgedSkillUI__UpdateSkillPointsUIExec(GetTriggerPlayer()) - - return false -endfunction + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_BUILDINGS) + set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) + set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) + set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) + set result=result + ConvertDecimalNumberToSaveCodeSegment(index) -function WoWReforgedSkillUI__UpdateSkillPointsUIForAllPlayersForHero takes unit hero returns nothing - local integer i= 0 + // 5 buildings with their locations + set i=0 loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( WoWReforgedSkillUI__currentHero[i] == hero ) then - call WoWReforgedSkillUI__UpdateSkillPointsUIExec(Player(i)) + exitwhen ( i >= SAVE_CODE_MAX_BUILDINGS or i >= max ) + set first=BlzGroupUnitAt(b, i) + set id=GetSaveObjectBuildingType(GetPrimaryDependencyEquivalent(GetUnitTypeId(first))) + if ( id != - 1 ) then + //call BJDebugMsg("Saving building: " + GetObjectName(GetUnitTypeId(first))) + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + //call BJDebugMsg("Saving building X: " + GetObjectName(GetUnitTypeId(first)) + ": " + I2S(R2I(GetUnitX(first)))) + //call BJDebugMsg("Saving building X: " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetUnitX(first))) + //call BJDebugMsg("Saving building X (absolute): " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetAbsCoordinateX(GetUnitX(first)))) + set result=result + ConvertDecimalNumberToSaveCodeSegment(R2I(GetAbsCoordinateX(GetUnitX(first)))) + //call BJDebugMsg("Saving building Y: " + GetObjectName(GetUnitTypeId(first)) + ": " + I2S(R2I(GetUnitY(first)))) + //call BJDebugMsg("Saving building Y: " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetUnitY(first))) + //call BJDebugMsg("Saving building Y (absolute): " + GetObjectName(GetUnitTypeId(first)) + ": " + R2S(GetAbsCoordinateY(GetUnitX(first)))) + set result=result + ConvertDecimalNumberToSaveCodeSegment(R2I(GetAbsCoordinateY(GetUnitY(first)))) + set buildingsCounter=buildingsCounter + 1 + if ( buildingNames != "" ) then + set buildingNames=buildingNames + "," + endif + set buildingNames=buildingNames + GetUnitName(first) + else + //call BJDebugMsg("Not registered save object type for " + GetUnitName(first)) endif + set first=null set i=i + 1 endloop -endfunction -function UpdateSkillPointsUIForAllPlayers takes nothing returns nothing - local integer i= 0 + // fill rest loop - exitwhen ( i == bj_MAX_PLAYERS ) - call WoWReforgedSkillUI__UpdateSkillPointsUIExec(Player(i)) + exitwhen ( i >= SAVE_CODE_MAX_BUILDINGS ) + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) set i=i + 1 endloop -endfunction -function WoWReforgedSkillUI__TriggerConditioLoaded takes nothing returns boolean - call WoWReforgedSkillUI__UpdateSkillPointsUIForAllPlayersForHero(GetTriggerUnit()) - - return false -endfunction + //call BJDebugMsg("Compressed result: " + result) + //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) + //call BJDebugMsg("Checked save code part: " + result) -function EnableSkillUITriggers takes nothing returns nothing - call EnableTrigger(WoWReforgedSkillUI__selectionTrigger) - call EnableTrigger(WoWReforgedSkillUI__deselectionTrigger) - call EnableTrigger(WoWReforgedSkillUI__loadTrigger) -endfunction + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) -function DisableSkillUITriggers takes nothing returns nothing - call DisableTrigger(WoWReforgedSkillUI__selectionTrigger) - call DisableTrigger(WoWReforgedSkillUI__deselectionTrigger) - call DisableTrigger(WoWReforgedSkillUI__loadTrigger) -endfunction + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) + endif -function CreateAndEnableSkillUI takes nothing returns nothing - call WoWReforgedSkillUI__CreateSkillUI() - - call EnableSkillUITriggers() -endfunction + if ( buildingsCounter > 0 ) then + if ( writeFile ) then + call CreateSaveCodeBuildingsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , buildingsCounter , buildingNames , result) + endif -function WoWReforgedSkillUI__AboutToSave takes nothing returns nothing - call DisableSkillUITriggers() - call WoWReforgedSkillUI__HideSkillUI() -endfunction + call AddGeneratedSaveCode(result) + endif -function WoWReforgedSkillUI__AfterSaving takes nothing returns nothing - call EnableSkillUITriggers() - call UpdateSkillPointsUIForAllPlayers() + return result endfunction -function WoWReforgedSkillUI__Init takes nothing returns nothing - call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedSkillUI__syncTrigger , WoWReforgedSkillUI__PREFIX , false) - call TriggerAddCondition(WoWReforgedSkillUI__syncTrigger, Condition(function WoWReforgedSkillUI__TriggerConditionSync)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkillUI__selectionTrigger, EVENT_PLAYER_UNIT_SELECTED) - call TriggerAddCondition(WoWReforgedSkillUI__selectionTrigger, Condition(function WoWReforgedSkillUI__TriggerConditionSelected)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkillUI__deselectionTrigger, EVENT_PLAYER_UNIT_DESELECTED) - call TriggerAddCondition(WoWReforgedSkillUI__deselectionTrigger, Condition(function WoWReforgedSkillUI__TriggerConditionDeselected)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkillUI__loadTrigger, EVENT_PLAYER_UNIT_LOADED) - call TriggerAddCondition(WoWReforgedSkillUI__loadTrigger, Condition(function WoWReforgedSkillUI__TriggerConditioLoaded)) - - // leveling is done by UpdateSkillUIEvaluate - - call DisableSkillUITriggers() - - call TriggerAddAction(WoWReforgedSkillUI__tmpTrigger, function WoWReforgedSkillUI__TriggerActionUpdateSkillPointsUI) - - // Makes sure no events are triggered before the UI is restored after loading the game. - call TriggerAddAction(FrameLoader___actionTrigger, (function CreateAndEnableSkillUI)) // INLINED!! - //call FrameSaverAddEx(function AboutToSave, function AfterSaving) -endfunction +function GetSaveCodeBuildingsEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner returns string + local group buildings= GetPlayerBuildingsOrderedByPriority(owner , index) + local string result= GetSaveCodeBuildingsEx2(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , owner , buildings) + call GroupClear(buildings) + call DestroyGroup(buildings) + set buildings=null -//library WoWReforgedSkillUI ends -//library WoWReforgedUpdateBackpackUI: + return result +endfunction +function GetSaveCodeBuildingsForIndex takes player whichPlayer,boolean writeFile,integer index returns string + local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) + local boolean isSinglePlayer= IsInSinglePlayer() + local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] + local integer gameType= udg_GameType + local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) -function WoWReforgedUpdateBackpackUI__TriggerActionUpdateBackpackUI takes nothing returns nothing - call UpdateItemsForBackpackUI(updateBackpackUIPlayer) + return GetSaveCodeBuildingsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) endfunction -function WoWReforgedUpdateBackpackUI__Init takes nothing returns nothing - call TriggerAddAction(updateBackpackUITrigger, function WoWReforgedUpdateBackpackUI__TriggerActionUpdateBackpackUI) +function GetSaveCodeBuildings takes player whichPlayer returns string + return GetSaveCodeBuildingsForIndex(whichPlayer , true , 0) endfunction - -//library WoWReforgedUpdateBackpackUI ends -//library WoWReforgedArmory: - - -function WoWReforgedArmory___AddEquipmentItemsToShop takes unit shop returns nothing - local integer i= 1 - local integer max= (WoWReforgedEquipment___equipmentTypesCounter) // INLINED!! - local string pageName= "" - //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - call EnablePagedButtons(shop) - call SetPagedButtonsSlotsPerPage(shop , 9) +function GetAllSaveCodeBuildings takes player whichPlayer returns nothing + local integer i= 0 + local integer max= (8) // INLINED!! loop - exitwhen ( i >= max ) - if ( i > 1 and (WoWReforgedEquipment___equipmentItemTypeCategoryName[(i)]) != "" and (WoWReforgedEquipment___equipmentItemTypeCategoryName[(i)]) != null and (WoWReforgedEquipment___equipmentItemTypeCategoryName[(i)]) != pageName ) then // INLINED!! - call AddPagedButtonsSpacersRemaining(shop) - endif -call AddPagedButtonsId((shop ) , ( (WoWReforgedEquipment___equipmentItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - if ( (WoWReforgedEquipment___equipmentItemTypeCategoryName[(i)]) != "" and (WoWReforgedEquipment___equipmentItemTypeCategoryName[(i)]) != null ) then // INLINED!! - set pageName=(WoWReforgedEquipment___equipmentItemTypeCategoryName[(i)]) // INLINED!! - call SetPagedButtonsCurrentPageName(shop , pageName) - endif + exitwhen ( i == max ) + call GetSaveCodeBuildingsForIndex(whichPlayer , true , i) set i=i + 1 endloop - - //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") - - //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") -endfunction - -function IsArmory takes integer unitTypeId returns boolean - return unitTypeId == ARMORY or unitTypeId == ARMORY_NEUTRAL -endfunction - -function IsUnitArmory takes unit whichUnit returns boolean - return IsArmory(GetUnitTypeId(whichUnit)) -endfunction - -function WoWReforgedArmory___TriggerConditionSellItem takes nothing returns boolean - return (IsArmory(GetUnitTypeId((GetTriggerUnit())))) // INLINED!! endfunction -function WoWReforgedArmory___TriggerAction1SellItem takes nothing returns nothing - local unit hero= GetBuyingUnit() - local player owner= GetOwningPlayer(hero) - local integer unitTypeId= GetUnitTypeId(hero) - local integer itemTypeId= GetItemTypeId(GetSoldItem()) - local integer index= GetEquipmentItemTypeByItemTypeId(itemTypeId) - if ( index != 0 ) then - if ( not IsCustomizableAttributesHero(unitTypeId) ) then - call RefundItem(GetSoldItem() , owner) - call SimError(owner , "Only customizable heroes can use equipment items.") - endif - //else - //call BJDebugMsg("No matching learnable skill for item " + GetItemName(GetSoldItem())) - endif - set hero=null - set owner=null +function IsObjectFromPlayerRace takes integer objectID,player whichPlayer returns boolean + local integer objectRace= GetObjectRace(objectID) + return PlayerHasUnlockedRace(whichPlayer , GetObjectRace(objectID)) endfunction -function WoWReforgedArmory___TriggerConditionConstructed takes nothing returns boolean - if ( (IsArmory(GetUnitTypeId((GetTriggerUnit())))) ) then // INLINED!! - call WoWReforgedArmory___AddEquipmentItemsToShop(GetConstructedStructure()) - endif - return false +function DisplayObjectRaceLoadSuccess takes integer objectID,player whichPlayer returns nothing + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 8.0, "Successfully loaded " + GetObjectName(objectID) + "!") endfunction -function WoWReforgedArmory___TriggerConditionSummoned takes nothing returns boolean - if ( (IsArmory(GetUnitTypeId((GetSummonedUnit())))) ) then // INLINED!! - call WoWReforgedArmory___AddEquipmentItemsToShop(GetSummonedUnit()) - endif - return false +function DisplayObjectRaceLoadError takes integer objectID,player whichPlayer returns nothing + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 8.0, "Unable to load " + GetObjectName(objectID) + " since it does not belong to your chosen race(s)!") endfunction -function WoWReforgedArmory___ForGroupEnableArmory takes nothing returns nothing - call WoWReforgedArmory___AddEquipmentItemsToShop(GetEnumUnit()) -endfunction +function ApplySaveCodeBuildings takes player whichPlayer,string s returns boolean + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer id= 0 + local real x= 0.0 + local real y= 0.0 + local boolean atLeastOne= false -function WoWReforgedArmory___FilterBuilding takes nothing returns boolean - return (IsArmory(GetUnitTypeId((GetFilterUnit())))) // INLINED!! -endfunction + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) -function WoWReforgedArmory___UpdateAllShops takes nothing returns nothing - local group g= CreateGroup() - - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedArmory___FilterBuilding)) - call ForGroup(g, function WoWReforgedArmory___ForGroupEnableArmory) - - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) -function WoWReforgedArmory___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmory___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedArmory___sellTrigger, Condition(function WoWReforgedArmory___TriggerConditionSellItem)) - call TriggerAddAction(WoWReforgedArmory___sellTrigger, function WoWReforgedArmory___TriggerAction1SellItem) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmory___constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) - call TriggerAddCondition(WoWReforgedArmory___constructionTrigger, Condition(function WoWReforgedArmory___TriggerConditionConstructed)) - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmory___summonTrigger, EVENT_PLAYER_UNIT_SUMMON) - call TriggerAddCondition(WoWReforgedArmory___summonTrigger, Condition(function WoWReforgedArmory___TriggerConditionSummoned)) - - call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedArmory___UpdateAllShops) -endfunction + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then + set i=0 + loop + exitwhen ( i == SAVE_CODE_MAX_BUILDINGS ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdBuilding[(saveObject)]) // INLINED!! + set id=saveObjectId + if ( not IsObjectFromPlayerRace(id , whichPlayer) ) then + set id=(MapRaceObjectType((id ) , ( (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))])))) // INLINED!! + endif + + if ( id != 0 and IsObjectFromPlayerRace(id , whichPlayer) ) then + set x=ConvertAbsCoordinateX(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)))) // INLINED!! + set y=ConvertAbsCoordinateY(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 2) , SAVE_CODE_DIGITS)))) // INLINED!! + //call BJDebugMsg("Loading building " + GetObjectName(saveObjectId) + " at " + R2S(x) + "|" + R2S(y)) + call CreateUnit(whichPlayer, id, x, y, bj_UNIT_FACING) + set atLeastOne=true + call PingMinimapForPlayer(whichPlayer, x, y, 4.0) + call DisplayObjectRaceLoadSuccess(id , whichPlayer) + else + call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) + endif + endif + set i=i + 1 + set pos=pos + 3 + endloop -//library WoWReforgedArmory ends -//library WoWReforgedCheatsSaveCodes: + call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) + + if ( atLeastOne ) then + call AddGeneratedSaveCode(s) + endif -// Generated Save Codes + return atLeastOne + endif + else + call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + endif -function GetSaveCodeStrong takes string playerName,boolean singlePlayer,boolean warlord,integer xpRate returns string - return GetSaveCodeEx(GetTriggerPlayer() , playerName , singlePlayer , warlord , udg_GameTypeNormal , xpRate , 1000 , 50049900 , 800000 , 800000 , 1000 , 100 , 100 , 100 , 100 , 8000 , 0 , 20000 , 0 , 20000 , 5000 , 1000 , 50049900 , 1000 , 50049900 , 100 , 100 , 2 , 3) + return false endfunction -function GetSaveCodeNormal takes string playerName,boolean singlePlayer,boolean warlord,integer xpRate returns string - return GetSaveCodeEx(GetTriggerPlayer() , playerName , singlePlayer , warlord , udg_GameTypeNormal , xpRate , 30 , 50000 , 100000 , 100000 , 20 , 20 , 20 , 20 , 20 , 30 , 0 , 2000 , 0 , 800 , 10 , 30 , 50000 , 30 , 50000 , 20 , 20 , 0 , 2) -endfunction +function GetSaveCodeInfosBuildings takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "Multiplayer" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "Freelancer" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local real x= 0.0 + local real y= 0.0 + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + local string result= "" -function ForGroupRemoveUnit takes nothing returns nothing - call h__RemoveUnit(GetEnumUnit()) -endfunction + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif -function GetSaveCodeBase takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord returns string - local location tmpLocation= Location(0.0, 0.0) - local group allBuildings= CreateGroup() - local string result - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'htow', GetRectCenterX(gg_rct_Save_Code_Town_Hall), GetRectCenterY(gg_rct_Save_Code_Town_Hall), bj_UNIT_FACING)) - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hgtw', GetRectCenterX(gg_rct_Save_Code_Guard_Tower_1), GetRectCenterY(gg_rct_Save_Code_Guard_Tower_1), bj_UNIT_FACING)) - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hgtw', GetRectCenterX(gg_rct_Save_Code_Guard_Tower_2), GetRectCenterY(gg_rct_Save_Code_Guard_Tower_2), bj_UNIT_FACING)) - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'halt', GetRectCenterX(gg_rct_Save_Code_Altar), GetRectCenterY(gg_rct_Save_Code_Altar), bj_UNIT_FACING)) - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hlum', GetRectCenterX(gg_rct_Save_Code_Lumber_Mill), GetRectCenterY(gg_rct_Save_Code_Lumber_Mill), bj_UNIT_FACING)) - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hvlt', GetRectCenterX(gg_rct_Save_Code_Arcane_Vault), GetRectCenterY(gg_rct_Save_Code_Arcane_Vault), bj_UNIT_FACING)) - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'harm', GetRectCenterX(gg_rct_Save_Code_Workshop), GetRectCenterY(gg_rct_Save_Code_Workshop), bj_UNIT_FACING)) - call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hbar', GetRectCenterX(gg_rct_Save_Code_Barracks), GetRectCenterY(gg_rct_Save_Code_Barracks), bj_UNIT_FACING)) + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif - set result=GetSaveCodeBuildingsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer , allBuildings) + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif - call ForGroupBJ(allBuildings, function ForGroupRemoveUnit) + if ( isWarlord ) then + set warlordStatus="Warlord" + endif - call GroupClear(allBuildings) - call DestroyGroup(allBuildings) - set allBuildings=null + set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) + set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) + set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) + set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) + set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) + set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) + set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) + set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) - call RemoveLocation(tmpLocation) - set tmpLocation=null + set i=0 + loop + exitwhen ( i == SAVE_CODE_MAX_BUILDINGS ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdBuilding[(saveObject)]) // INLINED!! + set x=ConvertAbsCoordinateX(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)))) // INLINED!! + set y=ConvertAbsCoordinateY(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 2) , SAVE_CODE_DIGITS)))) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r (" + R2S(x) + "|" + R2S(y) + ")") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r (" + R2S(x) + "|" + R2S(y) + ")") + endif + elseif ( saveObject == 0 ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Building Slot") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Building with ID " + I2S(saveObject)) + endif + set i=i + 1 + set pos=pos + 3 + endloop return result endfunction -function CreateAllDragons takes player whichPlayer returns group - local location tmpLocation= Location(0.0, 0.0) - local group allDragons= CreateGroup() - call GroupAddGroup(CreateNUnitsAtLoc(10, 'nrwm', whichPlayer, tmpLocation, 0.0), allDragons) - call GroupAddGroup(CreateNUnitsAtLoc(10, 'ngrd', whichPlayer, tmpLocation, 0.0), allDragons) - call GroupAddGroup(CreateNUnitsAtLoc(10, 'nbwm', whichPlayer, tmpLocation, 0.0), allDragons) - call GroupAddGroup(CreateNUnitsAtLoc(10, 'nadr', whichPlayer, tmpLocation, 0.0), allDragons) - call GroupAddGroup(CreateNUnitsAtLoc(10, 'nbzd', whichPlayer, tmpLocation, 0.0), allDragons) - call GroupAddGroup(CreateNUnitsAtLoc(10, 'nndr', whichPlayer, tmpLocation, 0.0), allDragons) - - call RemoveLocation(tmpLocation) - set tmpLocation=null - - return allDragons -endfunction +function GetSaveCodeShortInfosBuildings takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "M" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "F" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local real x= 0.0 + local real y= 0.0 + local string checksumStatus= "Valid" + local string result= "" -function GetSaveCodeDragonUnits takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord returns string - local location tmpLocation= Location(0.0, 0.0) - local group allDragons= CreateAllDragons(whichPlayer) - local group allDragonsDistinct= DistinctGroup(allDragons) - local string result= GetSaveCodeUnitsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer , allDragonsDistinct) + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif - call ForGroupBJ(allDragons, function ForGroupRemoveUnit) + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif - call GroupClear(allDragons) - call DestroyGroup(allDragons) - set allDragons=null + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif - call GroupClear(allDragonsDistinct) - call DestroyGroup(allDragonsDistinct) - set allDragonsDistinct=null + if ( isWarlord ) then + set warlordStatus="W" + endif - call RemoveLocation(tmpLocation) - set tmpLocation=null + set i=0 + loop + exitwhen ( i == SAVE_CODE_MAX_BUILDINGS ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + set result=result + "-" + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdBuilding[(saveObject)]) // INLINED!! + set x=ConvertAbsCoordinateX(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)))) // INLINED!! + set y=ConvertAbsCoordinateY(I2R((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 2) , SAVE_CODE_DIGITS)))) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r" + else + set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r" + endif + elseif ( saveObject == 0 ) then + set result=result + "Empty Building Slot" + else + set result=result + "Invalid Building with ID " + endif + set i=i + 1 + set pos=pos + 3 + endloop - return result + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result endfunction -function GetSaveCodeGoodItems takes string playerName,boolean singlePlayer,boolean warlord returns string - local item item0= CreateItem('gcel', 0.0, 0.0) - local item item1= CreateItem('pnvu', 0.0, 0.0) - local item item2= CreateItem('sres', 0.0, 0.0) - local item item3= CreateItem('ankh', 0.0, 0.0) - local item item4= CreateItem('whwd', 0.0, 0.0) - local item item5= CreateItem('hlst', 0.0, 0.0) - local string result +function CreateSaveCodeItemsTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer items,string itemNames,string saveCode returns nothing + local string singleplayer= "no" + local string singlePlayerFileName= "Multiplayer" + local string gameMode= "Freelancer" + local string gameType= "Normal" + local string content= "" - call SetItemCharges(item0, 100) - call SetItemCharges(item1, 100) - call SetItemCharges(item2, 100) - call SetItemCharges(item3, 100) - call SetItemCharges(item4, 100) - call SetItemCharges(item5, 100) + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" + endif - set result=GetSaveCodeItemsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , item0 , item1 , item2 , item3 , item4 , item5) + if ( isWarlord ) then + set gameMode="Warlord" + endif - call h__RemoveItem(item0) - set item0=null + if ( gameTypeNumber == udg_GameTypeEasy ) then + set gameType="Easy" + elseif ( gameTypeNumber == udg_GameTypeFast ) then + set gameType="Fast" + elseif ( gameTypeNumber == udg_GameTypeHardcore ) then + set gameType="Hardcore" + endif - call h__RemoveItem(item1) - set item1=null + call FileStart() - call h__RemoveItem(item2) - set item2=null + set content=content + ("\r\n" + ("Code: -loadi " + saveCode)) // INLINED!! + set content=content + ("\r\n" + ("Items: " + I2S(items))) // INLINED!! + set content=content + ("\r\n" + ("Item Names: " + itemNames)) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! - call h__RemoveItem(item3) - set item3=null + // The line below creates the log + call Preload((content)) // INLINED!! - call h__RemoveItem(item4) - set item4=null + // The line below creates the file at the specified location + call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-items-" + I2S(items) + "-" + itemNames + ".txt")) // INLINED!! +endfunction - call h__RemoveItem(item5) - set item5=null +// TODO Add some kind of unique ID for grouping multiple item savecodes together to prevent faking the same items in different slots. +function GetSaveCodeItemsEx3 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,integer itemTypeSlot0,integer itemChargesSlot0,integer itemTypeSlot1,integer itemChargesSlot1,integer itemTypeSlot2,integer itemChargesSlot2,integer itemTypeSlot3,integer itemChargesSlot3,integer itemTypeSlot4,integer itemChargesSlot4,integer itemTypeSlot5,integer itemChargesSlot5 returns string + local integer playerNameHash= CompressedAbsStringHash(playerName) + local string result= "" + local integer id= - 1 + local integer itemCounter= 0 + local string itemNames= "" - return result -endfunction + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( itemTypeSlot0 != 0 or itemTypeSlot1 != 0 or itemTypeSlot2 != 0 or itemTypeSlot3 != 0 or itemTypeSlot4 != 0 or itemTypeSlot5 != 0 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_ITEMS) + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) + set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) + set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) + set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) + set result=result + ConvertDecimalNumberToSaveCodeSegment(index) -function GetSaveCodeHumanUpgrades takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord returns string - local integer ironForgedSwordsLevel= GetPlayerTechCountSimple('Rhme', whichPlayer) - local string result + if ( itemTypeSlot0 != 0 ) then + set id=GetSaveObjectItemType(itemTypeSlot0) + if ( id != - 1 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot0) + set itemCounter=itemCounter + 1 + if ( itemNames != "" ) then + set itemNames=itemNames + "," + endif + set itemNames=itemNames + GetObjectName(itemTypeSlot0) + else + //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) + endif + endif - call h__SetPlayerTechResearched(whichPlayer, 'Rhme', 3) + if ( itemTypeSlot1 != 0 ) then + set id=GetSaveObjectItemType(itemTypeSlot1) + if ( id != - 1 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot1) + set itemCounter=itemCounter + 1 + if ( itemNames != "" ) then + set itemNames=itemNames + "," + endif + set itemNames=itemNames + GetObjectName(itemTypeSlot1) + else + //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) + endif + endif - set result=GetSaveCodeResearchesEx(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer) + if ( itemTypeSlot2 != 0 ) then + set id=GetSaveObjectItemType(itemTypeSlot2) + if ( id != - 1 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot2) + set itemCounter=itemCounter + 1 + if ( itemNames != "" ) then + set itemNames=itemNames + "," + endif + set itemNames=itemNames + GetObjectName(itemTypeSlot2) + else + //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) + endif + endif - call h__SetPlayerTechResearched(whichPlayer, 'Rhme', ironForgedSwordsLevel) + if ( itemTypeSlot3 != 0 ) then + set id=GetSaveObjectItemType(itemTypeSlot3) + if ( id != - 1 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot3) + set itemCounter=itemCounter + 1 + if ( itemNames != "" ) then + set itemNames=itemNames + "," + endif + set itemNames=itemNames + GetObjectName(itemTypeSlot3) + else + //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) + endif + endif - return result -endfunction + if ( itemTypeSlot4 != 0 ) then + set id=GetSaveObjectItemType(itemTypeSlot4) + if ( id != - 1 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot4) + set itemCounter=itemCounter + 1 + if ( itemNames != "" ) then + set itemNames=itemNames + "," + endif + set itemNames=itemNames + GetObjectName(itemTypeSlot4) + else + //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) + endif + endif -function GetSaveCodeTheElvenClan takes boolean singlePlayer,string playerName returns string - // there seems to be an issue if we pass these values directly as literals - local integer clanIcon= 0 - local integer gold= 40000 - local integer lumber= 40000 - return GetSaveCodeClanEx(singlePlayer , "TheElvenClan" , clanIcon , (udg_ClanSound[(1)]) , gold , lumber , true , 10 , 10 , playerName , udg_ClanRankLeader , "WorldEdit" , udg_ClanRankLeader , "Barade#2569" , udg_ClanRankLeader , "Runeblade14#2451" , udg_ClanRankCaptain , "AntiDenseMan#1202" , udg_ClanRankCaptain , "Chaoskrieger#21738" , udg_ClanRankCaptain , "" , 0 , 5) // INLINED!! -endfunction + if ( itemTypeSlot5 != 0 ) then + set id=GetSaveObjectItemType(itemTypeSlot5) + if ( id != - 1 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + set result=result + ConvertDecimalNumberToSaveCodeSegment(itemChargesSlot5) + set itemCounter=itemCounter + 1 + if ( itemNames != "" ) then + set itemNames=itemNames + "," + endif + set itemNames=itemNames + GetObjectName(itemTypeSlot5) + else + //call BJDebugMsg("Not registered save object type for " + GetItemName(itemSlot0)) + endif + endif + //call BJDebugMsg("Compressed result: " + result) + //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) + //call BJDebugMsg("Checked save code part: " + result) -function GenerateSaveCode takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord,integer xpRate returns nothing - call GetSaveCodeStrong(playerName , singlePlayer , warlord , xpRate) - call GetSaveCodeNormal(playerName , singlePlayer , warlord , xpRate) - call GetSaveCodeBase(whichPlayer , playerName , singlePlayer , warlord) - call GetSaveCodeDragonUnits(whichPlayer , playerName , singlePlayer , warlord) - call GetSaveCodeGoodItems(playerName , singlePlayer , warlord) - call GetSaveCodeHumanUpgrades(whichPlayer , playerName , singlePlayer , warlord) - call GetSaveCodeLetter(playerName , "all" , "Hello citizens!") -endfunction + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) -function GenerateSaveCodeNewOpLimit takes nothing returns nothing - call GenerateSaveCode(WoWReforgedCheatsSaveCodes___generateSaveCodePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodePlayerName , WoWReforgedCheatsSaveCodes___generateSaveCodeSinglePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodeWarlord , WoWReforgedCheatsSaveCodes___generateSaveCodeXpRate) -endfunction + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) + endif -function GetSaveCodeTheElvenClanNewOpLimit takes nothing returns nothing - call h__BJDebugMsg("Generating savecodes for TheElvenClan") - call GetSaveCodeTheElvenClan(WoWReforgedCheatsSaveCodes___generateSaveCodeClanSinglePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodeClanPlayerName) - call h__BJDebugMsg("Done generating savecodes for TheElvenClan") + if ( itemCounter > 0 ) then + call AddGeneratedSaveCode(result) + + if ( writeFile ) then + call CreateSaveCodeItemsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , itemCounter , itemNames , result) + endif + + return result + endif + endif + + return "" endfunction -function GenerateSaveCodes takes player whichPlayer returns nothing - local integer playerNameSize= 2 - local string array playerName - local integer singlePlayerSize= 2 - local boolean array singlePlayer - local integer warlordSize= 2 - local boolean array warlord - local integer xpRate= 100 - local integer i= 0 - local integer j= 0 - local integer k= 0 - set playerName[0]="Barade#2569" - set playerName[1]="WorldEdit" - set singlePlayer[0]=true - set singlePlayer[1]=false - set warlord[0]=true - set warlord[1]=false - set i=0 - loop - exitwhen ( i >= playerNameSize ) - set j=0 - loop - exitwhen ( j >= singlePlayerSize ) - set k=0 - loop - exitwhen ( k >= warlordSize ) - if ( not warlord[k] ) then - set xpRate=130 - else - set xpRate=100 - endif - call h__BJDebugMsg("Generating savecodes for player name " + playerName[i]) - if ( singlePlayer[j] ) then - call h__BJDebugMsg("Singleplayer") - else - call h__BJDebugMsg("Multiplayer") - endif - if ( warlord[k] ) then - call h__BJDebugMsg("Warlord") - else - call h__BJDebugMsg("Freelancer") - endif - - set WoWReforgedCheatsSaveCodes___generateSaveCodePlayer=whichPlayer - set WoWReforgedCheatsSaveCodes___generateSaveCodePlayerName=playerName[i] - set WoWReforgedCheatsSaveCodes___generateSaveCodeSinglePlayer=singlePlayer[j] - set WoWReforgedCheatsSaveCodes___generateSaveCodeWarlord=warlord[k] - set WoWReforgedCheatsSaveCodes___generateSaveCodeXpRate=xpRate - call ForForce(bj_FORCE_PLAYER[0], (function GenerateSaveCodeNewOpLimit)) // INLINED!! - set k=k + 1 - endloop - call h__BJDebugMsg("Clan Save Code") - set WoWReforgedCheatsSaveCodes___generateSaveCodeClanSinglePlayer=singlePlayer[j] - set WoWReforgedCheatsSaveCodes___generateSaveCodeClanPlayerName=playerName[i] - call ForForce(bj_FORCE_PLAYER[0], (function GetSaveCodeTheElvenClanNewOpLimit)) // INLINED!! - call h__BJDebugMsg("After Generating Clan Save Code") - set j=j + 1 - endloop - set i=i + 1 - endloop +function GetSaveCodeItemsEx2 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,item itemSlot0,item itemSlot1,item itemSlot2,item itemSlot3,item itemSlot4,item itemSlot5 returns string + return GetSaveCodeItemsEx3(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , GetItemTypeId(itemSlot0) , GetItemCharges(itemSlot0) , GetItemTypeId(itemSlot1) , GetItemCharges(itemSlot1) , GetItemTypeId(itemSlot2) , GetItemCharges(itemSlot2) , GetItemTypeId(itemSlot3) , GetItemCharges(itemSlot3) , GetItemTypeId(itemSlot4) , GetItemCharges(itemSlot4) , GetItemTypeId(itemSlot5) , GetItemCharges(itemSlot5)) endfunction +function GetSaveCodeItemsEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,unit hero,boolean writeFile,integer index returns string + return GetSaveCodeItemsEx2(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , UnitItemInSlot(hero, 0) , UnitItemInSlot(hero, 1) , UnitItemInSlot(hero, 2) , UnitItemInSlot(hero, 3) , UnitItemInSlot(hero, 4) , UnitItemInSlot(hero, 5)) +endfunction -//library WoWReforgedCheatsSaveCodes ends -//library WoWReforgedPrestoredSaveCodes: +function GetSaveCodeItemsForIndex takes player whichPlayer,boolean writeFile,integer index returns string + local boolean isSinglePlayer= IsInSinglePlayer() + local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] + local integer gameType= udg_GameType + local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) + local integer playerId= GetPlayerId(whichPlayer) + local string playerName= GetPlayerName(whichPlayer) + local integer i= index + if ( index == 0 ) then + return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero[GetPlayerId((whichPlayer))]) , writeFile , index) // INLINED!! + elseif ( index == 1 ) then + return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero2[GetPlayerId((whichPlayer))]) , writeFile , index) // INLINED!! + elseif ( index == 3 ) then + return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero3[GetPlayerId((whichPlayer))]) , writeFile , index) // INLINED!! + elseif ( index > 3 and index < 3 + BACKPACK_MAX_PAGES ) then + set i=index - 3 + //call BJDebugMsg("Backpack item " + I2S(i)) + return GetSaveCodeItemsEx3(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))])) // INLINED!! + elseif ( index >= 3 + BACKPACK_MAX_PAGES and index < BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) ) then + set i=index - 3 + BACKPACK_MAX_PAGES + return GetSaveCodeItemsEx(playerName , isSinglePlayer , isWarlord , gameType , xpRate , BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) , writeFile , index) + endif + return "" +endfunction -function PlayerIsInElvenClan takes player whichPlayer returns boolean - return IsPlayerInForce(whichPlayer, prestoredElvenClanMembers) +function GetSaveCodeItems takes player whichPlayer returns string + return GetSaveCodeItemsForIndex(whichPlayer , true , 0) endfunction -function GetPrestoredClanSaveCodeMatchingPlayer takes integer saveCodeIndex returns player - local player result= null - local integer playerRank= - 1 - local integer index= 0 +function GetAllSaveCodeItems takes player whichPlayer returns string + local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) + local boolean isSinglePlayer= IsInSinglePlayer() + local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] + local integer gameType= udg_GameType + local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) local integer i= 0 - local integer j= 0 + local integer index= 0 + local integer playerId= GetPlayerId(whichPlayer) + local integer max= BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) + local string result= GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero[GetPlayerId((whichPlayer))]) , true , 0) // INLINED!! + call GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero2[GetPlayerId((whichPlayer))]) , true , 1) // INLINED!! + call GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , (udg_Hero3[GetPlayerId((whichPlayer))]) , true , 2) // INLINED!! + + set index=3 + set i=0 + set max=BACKPACK_MAX_PAGES loop - exitwhen ( i >= bj_MAX_PLAYERS ) - if ( GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then - set j=0 - loop - exitwhen ( j >= PrestoredSaveCodePlayerNamesCounter[saveCodeIndex] ) - set index=Index2D(saveCodeIndex , j , PRESTORED_SAVECODE_MAX_CLAN_MEMBERS) - //call BJDebugMsg("Comparing player name " + PrestoredSaveCodePlayerNames[index] + " to online player name " + GetPlayerName(Player(i))) - if ( GetPlayerName(Player(i)) == PrestoredSaveCodePlayerNames[index] and PrestoredSaveCodePlayerRanks[index] > playerRank ) then - set result=Player(i) - set playerRank=PrestoredSaveCodePlayerRanks[index] - endif - set j=j + 1 - endloop - endif + exitwhen ( i == max ) + call GetSaveCodeItemsEx3(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , true , index , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 0) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 1) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 2) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 3) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 4) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemType[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))]) , (WoWReforgedBackpacks__BackpackItemCharges[((Index3D((playerId ) , ( i ) , ( 5) , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY)))])) // INLINED!! + set index=index + 1 set i=i + 1 endloop - return result -endfunction - -function LoadPrestoredClanSaveCodes takes nothing returns nothing - local player matchingPlayer= null - local boolean foundElvenClan= false - local integer j= 0 - local integer i= 0 + + set i=0 + set max=BlzGroupGetSize(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)]) loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_CLANS ) then - if ( PrestoredSaveCodePlayerName[i] == "TheElvenClan" and PrestoredSaveCodeMultiplayer[i] == not IsInSinglePlayer() ) then - set foundElvenClan=true - set matchingPlayer=GetPrestoredClanSaveCodeMatchingPlayer(i) - if ( matchingPlayer != null ) then - //call BJDebugMsg("Applying TheElvenClan savecode for player " + GetPlayerName(matchingPlayer)) - call ApplySaveCodeClan(matchingPlayer , "TheElvenClan" , PrestoredSaveCode[i]) - set j=0 - loop - exitwhen ( j >= bj_MAX_PLAYERS ) - if ( GetPlayerController(Player(j)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(j)) == PLAYER_SLOT_STATE_PLAYING and udg_ClanPlayerClan[j + 1] > 0 and udg_ClanName[udg_ClanPlayerClan[j + 1]] == "TheElvenClan" ) then - //call BJDebugMsg("Adding player to TheElvenClan") - call ForceAddPlayer(prestoredElvenClanMembers, Player(j)) - endif - set j=j + 1 - endloop - endif - endif - endif + exitwhen ( i == max ) + call GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , BlzGroupUnitAt(udg_EquipmentBags[GetConvertedPlayerId(whichPlayer)], i) , true , index) + set index=index + 1 set i=i + 1 endloop - if ( not foundElvenClan ) then - //call BJDebugMsg("Did not find TheElvenClan") - endif - if ( matchingPlayer == null ) then - //call BJDebugMsg("No player of TheElvenClan is online") - endif + + return result endfunction -function GetPrestoredSaveCodesMax takes nothing returns integer - return PrestoredSaveCodeCounter +function GetSaveCodeItemsMax takes nothing returns integer + return 3 + BACKPACK_MAX_PAGES + 3 endfunction -function AddPrestoredSaveCodeEx takes integer saveCodeType,string playerName,string saveCode returns integer - local integer index= PrestoredSaveCodeCounter - set PrestoredSaveCodePlayerName[index]=playerName - set PrestoredSaveCode[index]=saveCode - set PrestoredSaveCodeType[index]=saveCodeType - set PrestoredSaveCodePlayerNamesCounter[index]=0 - set PrestoredSaveCodeCounter=PrestoredSaveCodeCounter + 1 - set lastAddedPrestoredClan=index - return index -endfunction +function GetSaveCodeItemsFromUnit takes player whichPlayer,unit hero,integer index returns string + local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) + local boolean isSinglePlayer= IsInSinglePlayer() + local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] + local integer gameType= udg_GameType + local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) -function AddPrestoredSaveCode takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_HEROES , playerName , saveCode) + return GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , hero , true , index) endfunction -function AddPrestoredSaveCodeItems takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_ITEMS , playerName , saveCode) -endfunction +function ApplySaveCodeItemsEx takes player whichPlayer,string s,unit hero returns boolean + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer id= 0 + local integer charges= 0 + local boolean atLeastOne= false -function AddPrestoredSaveCodeUnits takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_UNITS , playerName , saveCode) -endfunction + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) -function AddPrestoredSaveCodeBuildings takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_BUILDINGS , playerName , saveCode) -endfunction + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) -function AddPrestoredSaveCodeResearches takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_RESEARCHES , playerName , saveCode) -endfunction + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) -function AddPrestoredSaveCodeLetter takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_LETTER , playerName , saveCode) -endfunction + if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then + set i=0 + loop + exitwhen ( i == bj_MAX_INVENTORY or pos >= lastSaveCodeSegment ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdItem[(saveObject)]) // INLINED!! + set id=saveObjectId + if ( not IsObjectFromPlayerRace(id , whichPlayer) ) then + set id=(MapRaceObjectType((id ) , ( (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))])))) // INLINED!! + endif + + if ( id != 0 and IsObjectFromPlayerRace(id , whichPlayer) ) then + call UnitAddItemByIdSwapped(id, hero) + set charges=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + if ( GetItemTypePerishable(id) and charges <= 0 ) then + // never let perishable items be used unlimited + set charges=1 + endif + call SetItemCharges(bj_lastCreatedItem, charges) + set atLeastOne=true + else + call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) + endif + endif + set i=i + 1 + set pos=pos + 2 + endloop -function AddPrestoredSaveCodeClan takes string clanName,boolean isSinglePlayer,string saveCode returns integer - local integer result= AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_CLANS , clanName , saveCode) - set PrestoredSaveCodeMultiplayer[result]=not isSinglePlayer - return result -endfunction + call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) + + if ( atLeastOne ) then + call AddGeneratedSaveCode(s) + endif -function AddPrestoredSaveCodeClanPlayer takes string playerName,integer playerRank returns integer - local integer saveCodePlayerIndex= PrestoredSaveCodePlayerNamesCounter[lastAddedPrestoredClan] - local integer index= Index2D(lastAddedPrestoredClan , saveCodePlayerIndex , PRESTORED_SAVECODE_MAX_CLAN_MEMBERS) - set PrestoredSaveCodePlayerNames[index]=playerName - set PrestoredSaveCodePlayerRanks[index]=playerRank - set PrestoredSaveCodePlayerNamesCounter[lastAddedPrestoredClan]=PrestoredSaveCodePlayerNamesCounter[lastAddedPrestoredClan] + 1 - return saveCodePlayerIndex -endfunction + return atLeastOne + endif + else + call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + endif -function GetPrestoredSaveCodePlayerNameByIndex takes integer index returns string - return PrestoredSaveCodePlayerName[index] + return false endfunction -function GetPrestoredSaveCodeByIndex takes integer index returns string - return PrestoredSaveCode[index] +function ApplySaveCodeItems takes player whichPlayer,string s returns boolean + local unit hero= udg_Hero[GetPlayerId(whichPlayer)] + return ApplySaveCodeItemsEx(whichPlayer , s , hero) endfunction -function GetPrestoredSaveCodeTypeByIndex takes integer index returns integer - return PrestoredSaveCodeType[index] -endfunction +function GetSaveCodeInfosItems takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "Multiplayer" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "Freelancer" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean generated= (GetGeneratedSaveCode((s)) != - 1) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer charges= 0 + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= GetChecksumStatus(checksum , checkedSaveCode) + local string generatedStatus= GetGeneratedStatus(generated) + local string result= "" -function GetPrestoredSaveCodeMemberPlayerName takes integer index returns string - return PrestoredSaveCodePlayerNames[index] -endfunction + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif -function GetPrestoredSaveCodeMemberPlayerRank takes integer index returns integer - return PrestoredSaveCodePlayerRanks[index] -endfunction + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif -function GetPrestoredSaveCodeCounter takes string playerName returns integer - local integer counter= 0 - local integer i= 0 - loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodePlayerName[i] == playerName ) then - set counter=counter + 1 - endif - set i=i + 1 - endloop - return counter -endfunction + if ( isWarlord ) then + set warlordStatus="Warlord" + endif -function GetPrestoredSaveCodeIndices takes string playerName returns string - local string result= "" - local integer counter= 0 - local integer i= 0 + set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) + set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) + set result=AppendSaveCodeInfo(result , "Generated: " + generatedStatus) + set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) + set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) + set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) + set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) + set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) + set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) + + set i=0 loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodePlayerName[i] == playerName ) then - if ( counter > 0 ) then - set result=result + "\n" + exitwhen ( i == bj_MAX_INVENTORY or pos >= lastSaveCodeSegment ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdItem[(saveObject)]) // INLINED!! + set charges=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r") endif - set result=result + "- " + I2S(i) - set counter=counter + 1 + + if ( charges > 0 ) then + set result=result + " (" + I2S(charges) + ")" + endif + elseif ( saveObject == 0 ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Item Slot") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Item with ID " + I2S(saveObject)) endif set i=i + 1 + set pos=pos + 2 endloop + return result endfunction -function GetPrestoredSaveCodeAccounts takes nothing returns string - local string result= "" - local string array onlinePlayers - local player array onlinePlayersMatching - local integer onlinePlayersCounter= 0 - local string array offlinePlayers - local integer offlinePlayersCounter= 0 - local player matchingPlayer= null - local boolean add= true - local integer counter= 0 - local integer j= 0 +function GetSaveCodeShortInfosItems takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "M" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "F" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! local integer i= 0 + local integer pos= 5 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer charges= 0 + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + local string result= "" + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif + + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif + + if ( isWarlord ) then + set warlordStatus="W" + endif + + set i=0 loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodeType[i] != PRESTORED_SAVECODE_TYPE_CLANS and PrestoredSaveCodePlayerName[i] != "all" ) then - set add=true - set matchingPlayer=null - set j=0 - loop - exitwhen ( j >= bj_MAX_PLAYERS or matchingPlayer != null ) - if ( GetPlayerName(Player(j)) == PrestoredSaveCodePlayerName[i] ) then - set matchingPlayer=Player(j) - endif - set j=j + 1 - endloop - if ( matchingPlayer != null ) then - set j=0 - loop - exitwhen ( j >= onlinePlayersCounter or not add ) - if ( onlinePlayers[j] == PrestoredSaveCodePlayerName[i] ) then - set add=false - endif - set j=j + 1 - endloop - if ( add ) then - set onlinePlayers[onlinePlayersCounter]=PrestoredSaveCodePlayerName[i] - set onlinePlayersMatching[onlinePlayersCounter]=matchingPlayer - set onlinePlayersCounter=onlinePlayersCounter + 1 - endif + exitwhen ( i == bj_MAX_INVENTORY or pos >= lastSaveCodeSegment ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + set result=result + "-" + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdItem[(saveObject)]) // INLINED!! + set charges=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r" else - set j=0 - loop - exitwhen ( j >= offlinePlayersCounter or not add ) - if ( offlinePlayers[j] == PrestoredSaveCodePlayerName[i] ) then - set add=false - endif - set j=j + 1 - endloop - if ( add ) then - set offlinePlayers[offlinePlayersCounter]=PrestoredSaveCodePlayerName[i] - set offlinePlayersCounter=offlinePlayersCounter + 1 - endif + set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r" + endif + if ( charges > 0 ) then + set result=result + " (" + I2S(charges) + ")" endif + elseif ( saveObject == 0 ) then + set result=result + "Empty Item Slot" + else + set result=result + "Invalid Item with ID " + I2S(saveObject) endif set i=i + 1 + set pos=pos + 2 endloop - set i=0 - loop - exitwhen ( i >= onlinePlayersCounter ) - if ( counter > 0 ) then - set result=result + "\n" - endif - set result=result + GetPlayerNameColored(onlinePlayersMatching[i]) - if ( (udg_ClanPlayerClan[GetConvertedPlayerId((onlinePlayersMatching[i]))]) != 0 ) then // INLINED!! - set result=result + " (" + (udg_ClanName[((udg_ClanPlayerClan[GetConvertedPlayerId((onlinePlayersMatching[i]))]))]) + ")" // INLINED!! - endif - if ( (IsPlayerInForce((onlinePlayersMatching[i]), WoWReforgedVIPs___vipPlayers)) ) then // INLINED!! - set result=result + " (VIP)" - endif - set counter=counter + 1 - set i=i + 1 - endloop - set i=0 - loop - exitwhen ( i >= offlinePlayersCounter ) - if ( counter > 0 ) then - set result=result + "\n" - endif + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result +endfunction - set result=result + offlinePlayers[i] + " (offline)" - if ( IsAccountVIP(offlinePlayers[i]) ) then - set result=result + " (VIP)" - endif - set counter=counter + 1 - set i=i + 1 - endloop - return result +function FilterIsLivingUnitToBeSaved takes nothing returns boolean + return not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) and IsUnitAliveBJ(GetFilterUnit()) and GetUnitTypeId(GetFilterUnit()) != 'o018' and GetUnitTypeId(GetFilterUnit()) != 'o00P' and GetSaveObjectUnitType(GetUnitTypeId(GetFilterUnit())) != - 1 endfunction -// only shows matching savecodes to keep the number limited -function GetPrestoredSaveCodeInfos takes player whichPlayer returns string - local string playerName= GetPlayerName(whichPlayer) - local string result= "" - local integer counter= 0 +function GetPlayerUnitsOrderedByPriority takes player whichPlayer,integer index returns group local integer i= 0 + local group whichGroup= CreateGroup() + local group livingUnitsToBeSaved= CreateGroup() + local unit first= null + call GroupAddGroup(udg_SaveCodeIncludedUnits[GetConvertedPlayerId(whichPlayer)], livingUnitsToBeSaved) + set bj_wantDestroyGroup=true + call GroupAddGroup(GetUnitsOfPlayerMatching(whichPlayer, Filter(function FilterIsLivingUnitToBeSaved)), livingUnitsToBeSaved) + call GroupRemoveGroup(udg_SaveCodeExcludedUnits[GetConvertedPlayerId(whichPlayer)], livingUnitsToBeSaved) + //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(livingUnitsToBeSaved))) + set bj_wantDestroyGroup=true + set livingUnitsToBeSaved=DistinctGroup(livingUnitsToBeSaved) + //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(livingUnitsToBeSaved))) loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodePlayerName[i] == playerName or PrestoredSaveCodePlayerName[i] == "all" ) then - if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_HEROES and GetSaveCodeIsMatching(whichPlayer , PrestoredSaveCode[i]) ) then - if ( counter > 0 ) then - set result=result + "\n" - endif + set first=FirstOfGroup(livingUnitsToBeSaved) + exitwhen ( first == null or i >= ( index + 1 ) * SAVE_CODE_MAX_UNITS ) + if ( i >= index * SAVE_CODE_MAX_UNITS and i < ( index + 1 ) * SAVE_CODE_MAX_UNITS and not IsUnitInGroup(first, whichGroup) ) then + call GroupAddUnit(whichGroup, first) + endif + call GroupRemoveUnit(livingUnitsToBeSaved, first) + set i=i + 1 + endloop - set result=result + "-loadp " + I2S(i) + ": " + GetSaveCodeShortInfos(playerName , PrestoredSaveCode[i]) + //call BJDebugMsg("Size of units before distinct: " + I2S(CountUnitsInGroup(whichGroup))) + //call BJDebugMsg("Size of units after distinct: " + I2S(CountUnitsInGroup(result))) - set counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_ITEMS ) then - if ( counter > 0 ) then - set result=result + "\n" - endif + call GroupClear(livingUnitsToBeSaved) + call DestroyGroup(livingUnitsToBeSaved) + set livingUnitsToBeSaved=null + + //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(whichGroup))) - set result=result + "-loadpi " + I2S(i) + ": " + GetSaveCodeShortInfosItems(whichPlayer , PrestoredSaveCode[i]) + return whichGroup +endfunction - set counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_UNITS ) then - if ( counter > 0 ) then - set result=result + "\n" - endif +function GetSaveCodeUnitsMax takes nothing returns integer + return 8 +endfunction - set result=result + "-loadpu " + I2S(i) + ": " + GetSaveCodeShortInfosUnits(whichPlayer , PrestoredSaveCode[i]) +function CreateSaveCodeUnitsTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer units,string unitNames,string saveCode returns nothing + local string singleplayer= "no" + local string singlePlayerFileName= "Multiplayer" + local string gameMode= "Freelancer" + local string gameType= "Normal" + local string content= "" - set counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_BUILDINGS ) then - if ( counter > 0 ) then - set result=result + "\n" - endif + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" + endif - set result=result + "-loadpb " + I2S(i) + ": " + GetSaveCodeShortInfosBuildings(whichPlayer , PrestoredSaveCode[i]) + if ( isWarlord ) then + set gameMode="Warlord" + endif - set counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_RESEARCHES ) then - if ( counter > 0 ) then - set result=result + "\n" - endif + if ( gameTypeNumber == udg_GameTypeEasy ) then + set gameType="Easy" + elseif ( gameTypeNumber == udg_GameTypeFast ) then + set gameType="Fast" + elseif ( gameTypeNumber == udg_GameTypeHardcore ) then + set gameType="Hardcore" + endif - set result=result + "-loadpr " + I2S(i) + ": " + GetSaveCodeShortInfosResearches(whichPlayer , PrestoredSaveCode[i]) - set counter=counter + 1 -// elseif (PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_LETTER) then -// if (counter > 0) then -// set result = result + "\n" -// endif -// -// set result = result + "-loadpl " + I2S(i) + ": " + GetSaveCodeShortInfosLetter(PrestoredSaveCodePlayerName[i], PrestoredSaveCode[i]) -// -// set counter = counter + 1 - endif - endif - set i=i + 1 - endloop - return result + call FileStart() + + set content=content + ("\r\n" + ("Code: -loadu " + saveCode)) // INLINED!! + set content=content + ("\r\n" + ("Units: " + I2S(units))) // INLINED!! + set content=content + ("\r\n" + ("Unit Names: " + unitNames)) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + + // The line below creates the log + call Preload((content)) // INLINED!! + + // The line below creates the file at the specified location + call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-units-" + I2S(units) + "-" + unitNames + ".txt")) // INLINED!! endfunction -function GetPrestoredSaveCodeInfosClans takes nothing returns string +function GetSaveCodeUnitsEx2 takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner,group source returns string + local integer playerNameHash= CompressedAbsStringHash(playerName) local string result= "" - local integer counter= 0 + local integer max= BlzGroupGetSize(source) + local unit first= null + local integer id= - 1 + local integer unitTypeId= 0 local integer i= 0 + local integer unitsCounter= 0 + local integer count= 0 + local string unitNames= "" + + //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_UNITS) + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) + set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) + set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) + set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) + set result=result + ConvertDecimalNumberToSaveCodeSegment(index) + + set i=0 loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_CLANS ) then - if ( counter > 0 ) then - set result=result + "\n" + exitwhen ( unitsCounter >= SAVE_CODE_MAX_UNITS or i >= max ) + set first=BlzGroupUnitAt(source, i) + set unitTypeId=GetPrimaryDependencyEquivalent(GetUnitTypeId(first)) + set id=GetSaveObjectUnitType(unitTypeId) + if ( id != - 1 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(id) + set count=CountUnitsOfType(owner , unitTypeId) + set result=result + ConvertDecimalNumberToSaveCodeSegment(count) + if ( unitNames != "" ) then + set unitNames=unitNames + "," endif - set result=result + "- " + I2S(i) + ": " + GetSaveCodeShortInfosClan(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) - set counter=counter + 1 + set unitNames=unitNames + I2S(count) + GetObjectName(unitTypeId) + set unitsCounter=unitsCounter + 1 + //call BJDebugMsg("Added " + GetUnitName(first) + " with count " + I2S(count)) + else + //call BJDebugMsg("Not registered save object type for " + GetUnitName(first)) endif + set first=null set i=i + 1 endloop - return result -endfunction -function GetPrestoredSaveCodeClans takes string accountName returns string - local string result= "" - local integer counter= 0 - local integer i= 0 + // fill rest loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_CLANS and AccountNameBelongsToClanSaveCode(accountName , PrestoredSaveCode[i]) ) then - if ( counter > 0 ) then - set result=result + "\n" - endif - set result=result + "- " + I2S(i) + ": " + GetSaveCodeShortInfosClan(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) - set counter=counter + 1 - endif + exitwhen ( i >= SAVE_CODE_MAX_UNITS ) + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) set i=i + 1 endloop - return result -endfunction + + //call BJDebugMsg("Compressed result: " + result) + //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) + //call BJDebugMsg("Checked save code part: " + result) -function GetPrestoredSaveCodeInfosLetters takes player whichPlayer returns string - local string result= "" - local string playerName= GetPlayerName(whichPlayer) - local integer counter= 0 - local integer i= 0 - loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_LETTER and ( PrestoredSaveCodePlayerName[i] == playerName or PrestoredSaveCodePlayerName[i] == "all" or ( udg_ClanPlayerClan[GetConvertedPlayerId(whichPlayer)] > 0 and udg_ClanName[udg_ClanPlayerClan[GetConvertedPlayerId(whichPlayer)]] == PrestoredSaveCodePlayerName[i] ) ) ) then - if ( counter > 0 ) then - set result=result + "\n" - endif - set result=result + "-loadpl " + I2S(i) + ": " + GetSaveCodeShortInfosLetter(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) - set counter=counter + 1 + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) + + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) + endif + + if ( unitsCounter > 0 ) then + if ( writeFile ) then + call CreateSaveCodeUnitsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , unitsCounter , unitNames , result) endif - set i=i + 1 - endloop + + call AddGeneratedSaveCode(result) + endif + return result endfunction -function GetPrestoredSaveCodeMaxLevelIndex takes string skipPlayerName1,string skipPlayerName2,string skipPlayerName3 returns integer - local integer maxLevel= 0 - local integer tmpMaxLevel= 0 - local integer result= - 1 - local integer i= 0 - loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( ( skipPlayerName1 == null or (PrestoredSaveCodePlayerName[(i)]) != skipPlayerName1 ) and ( skipPlayerName2 == null or (PrestoredSaveCodePlayerName[(i)]) != skipPlayerName2 ) and ( skipPlayerName3 == null or (PrestoredSaveCodePlayerName[(i)]) != skipPlayerName3 ) ) then // INLINED!! - set tmpMaxLevel=GetSaveCodeMaxHeroLevel(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) - set tmpMaxLevel=IMinBJ(tmpMaxLevel, MAX_HERO_LEVEL) - if ( tmpMaxLevel > maxLevel ) then - set maxLevel=tmpMaxLevel - set result=i - endif - endif - set i=i + 1 - endloop +function GetSaveCodeUnitsEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner returns string + local group units= GetPlayerUnitsOrderedByPriority(owner , index) + local string result= GetSaveCodeUnitsEx2(playerName , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , owner , units) + + call GroupClear(units) + call DestroyGroup(units) + set units=null return result endfunction -function IsValidAccount takes string name returns boolean - return GetPrestoredSaveCodeCounter(name) > 0 -endfunction +function GetSaveCodeUnitsForIndex takes player whichPlayer,boolean writeFile,integer index returns string + local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) + local boolean isSinglePlayer= IsInSinglePlayer() + local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] + local integer gameType= udg_GameType + local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) -function DisplayAccountInfo takes player to,string account returns nothing - local string prestored= "Prestored savecodes: " + I2S(GetPrestoredSaveCodeCounter(account)) - local string clans= "Clans: " + GetPrestoredSaveCodeClans(account) - call h__DisplayTimedTextToPlayer(to, 0, 0, 20.0, account + "):\n" + prestored + "\n- " + clans) + return GetSaveCodeUnitsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) endfunction -// Add all prestored savecodes into this function -function InitPrestoredSaveCodes takes nothing returns nothing - // ############################################################## - // WorldOfWarcraftReforged-letter-from_Barade#2569-to_all-messageLength_15.txt - // Hello citizens! -call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_LETTER , ("all" ) , ( "B;LRoioFXl6I(S:(S:(S:(S:(U/(-(!6Z(-(!6Z(E,(C35g(C35g(S:(S:(!()(SG(")) // INLINED!! - // WorldOfWarcraftReforged-Barade#2569-Multiplayer-Normal-Warlord-items-6-Gloves of Haste,Potion of Invulnerability,Scroll of Restoration,Ankh of Reincarnation,Healing Wards,Health Stone.txt -call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_ITEMS , ("Barade#2569" ) , ( "!,(!(-(S:(0(S:()(S:(k(S:(e(S:(SR(S:(!(S:(S(")) // INLINED!! - // WorldOfWarcraftReforged-Barade#2569-Multiplayer-Normal-Warlord-buildings-7-Guard Tower,Guard Tower,Altar of Kings,Lumber Mill,Arcane Vault,Workshop,Barracks.txt -call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_BUILDINGS , ("Barade#2569" ) , ( "!,(!(-(S:(f()HV(SPN(f()HV(SHg(k().5(S]g(e()sC(SAC(,()8h(SQs(3()8h(Sc2(@()89(SN-(!~(")) // INLINED!! - // WorldOfWarcraftReforged-Barade#2569-Multiplayer-Normal-Warlord-units-6-30Red Dragon,30Green Dragon,30Black Dragon,30Blue Dragon,30Bronze Dragon,30Nether Dragon.txt -call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_UNITS , ("Barade#2569" ) , ( "!,(!(-(S:(S2(t(SV(t(S&(t(S\"(t(Sm(t(Sd(t(-(-(-(-(-(-(-(-(,(")) // INLINED!! - // Klekot#2393 -call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_HEROES , ("Klekot#2393" ) , ( "Phc>c>cj2c[dqcNkWcPWecMcMcMcMcMc>PcUcRicPcPUcmcMcMcMcMcMcMcP3c")) // INLINED!! - // ############################################################## - // CLANS - // MULTIPLAYER - // TheElvenClan - // WorldOfWarcraftReforged-Clan-TheElvenClan-Barade#2569-Multiplayer-gold-40000-lumber-40000-members-5.txt - // Barade#2569_Leader, WorldEdit_Leader, Barade#2569_Leader, Runeblade14#2451_Captain, AntiDenseMan#1202_Captain, Chaoskrieger#21738_Captain - call AddPrestoredSaveCodeClan("TheElvenClan" , false , "Squq[q/quq(*+q(*+qzqzq7?q/q7-q/q7?q/qHquqKququ8quq/q/quq7iq") - call AddPrestoredSaveCodeClanPlayer("Barade#2569" , udg_ClanRankLeader) - call AddPrestoredSaveCodeClanPlayer("WorldEdit" , udg_ClanRankLeader) - call AddPrestoredSaveCodeClanPlayer("Barade" , udg_ClanRankLeader) - call AddPrestoredSaveCodeClanPlayer("Runeblade14#2451" , udg_ClanRankCaptain) - call AddPrestoredSaveCodeClanPlayer("AntiDenseMan#1202" , udg_ClanRankCaptain) - call AddPrestoredSaveCodeClanPlayer("Chaoskrieger#21738" , udg_ClanRankCaptain) - // SINGLEPLAYER - // TheElvenClan - // WorldOfWarcraftReforged-Clan-TheElvenClan-Barade#2569-Singleplayer-gold-40000-lumber-40000-members-5.txt - // Barade#2569_Leader, WorldEdit_Leader, Barade#2569_Leader, Runeblade14#2451_Captain, AntiDenseMan#1202_Captain, Chaoskrieger#21738_Captain - call AddPrestoredSaveCodeClan("TheElvenClan" , true , "Sq/q[q/quq(*+q(*+qzqzq7?q/q7-q/q7?q/qHquqKququ8quq/q/quqnq") - call AddPrestoredSaveCodeClanPlayer("Barade#2569" , udg_ClanRankLeader) - call AddPrestoredSaveCodeClanPlayer("WorldEdit" , udg_ClanRankLeader) - call AddPrestoredSaveCodeClanPlayer("Barade" , udg_ClanRankLeader) - call AddPrestoredSaveCodeClanPlayer("Runeblade14#2451" , udg_ClanRankCaptain) - call AddPrestoredSaveCodeClanPlayer("AntiDenseMan#1202" , udg_ClanRankCaptain) - call AddPrestoredSaveCodeClanPlayer("Chaoskrieger#21738" , udg_ClanRankCaptain) +function GetSaveCodeUnits takes player whichPlayer returns string + return GetSaveCodeUnitsForIndex(whichPlayer , true , 0) endfunction - -//library WoWReforgedPrestoredSaveCodes ends -//library WoWReforgedRandomSaveCode: - -function WoWReforgedRandomSaveCode__CreateRandomUnits takes player whichPlayer returns group - local location tmpLocation= Location(0.0, 0.0) - local group allCreeps= CreateGroup() +function GetAllSaveCodeUnits takes player whichPlayer returns nothing local integer i= 0 - local integer max= GetRandomInt(2, 8) + local integer max= (8) // INLINED!! loop - exitwhen ( i >= max ) - call GroupAddGroup(CreateNUnitsAtLoc(GetRandomInt(1, 6), ChooseRandomCreep(GetRandomInt(1, 10)), whichPlayer, tmpLocation, 0.0), allCreeps) + exitwhen ( i == max ) + call GetSaveCodeUnitsForIndex(whichPlayer , true , i) set i=i + 1 endloop +endfunction - call RemoveLocation(tmpLocation) - set tmpLocation=null - - return allCreeps +function ForGroupApplyLoadedUnitEvolution takes nothing returns nothing + call AddEvolution(GetEnumUnit()) endfunction -function WoWReforgedRandomSaveCode__GetSaveCodeRandomUnits takes player whichPlayer returns string - local location tmpLocation= Location(0.0, 0.0) - local group allCreeps= WoWReforgedRandomSaveCode__CreateRandomUnits(whichPlayer) - local group allCreepsDistinct= DistinctGroup(allCreeps) - local string result= GetSaveCodeUnitsEx2(GetPlayerName(whichPlayer) , IsInSinglePlayer() , IsPlayerWarlord(whichPlayer) , udg_GameType , R2I(GetPlayerHandicapXP(whichPlayer)) , true , 0 , whichPlayer , allCreepsDistinct) +function ApplySaveCodeUnits takes player whichPlayer,string s returns boolean + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer j= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer id= 0 + local integer count= 0 + local location tmpLocation= GetUnitLoc((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! + local boolean atLeastOne= false + local group createdUnits= CreateGroup() - call ForGroupBJ(allCreeps, function ForGroupRemoveUnit) + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) - call GroupClear(allCreeps) - call DestroyGroup(allCreeps) - set allCreeps=null + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) - call GroupClear(allCreepsDistinct) - call DestroyGroup(allCreepsDistinct) - set allCreepsDistinct=null + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then + set i=0 + loop + exitwhen ( i == SAVE_CODE_MAX_UNITS ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + //call BJDebugMsg("Loading save object: " + I2S(saveObject)) + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdUnit[(saveObject)]) // INLINED!! + set id=saveObjectId + if ( not IsObjectFromPlayerRace(id , whichPlayer) ) then + set id=MapUnitID(id , (udg_PlayerRace[GetConvertedPlayerId((whichPlayer))]) , true) // INLINED!! + endif + + if ( id != 0 ) then + set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + //call BJDebugMsg("Loading save object " + GetObjectName(saveObjectId) + " with number: " + I2S(count)) + set j=0 + loop + exitwhen ( j == count ) + // the player does not have to build all farms before but the limit should not be exceeded + if ( GetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_FOOD_USED) + GetFoodUsed(id) <= GetPlayerState(whichPlayer, PLAYER_STATE_FOOD_CAP_CEILING) ) then + if ( IsObjectFromPlayerRace(id , whichPlayer) ) then + call MoveLocation(tmpLocation, GetMapWaterNeutralZoneX(whichPlayer), GetMapWaterNeutralZoneY(whichPlayer)) + call CreateUnitAtLocSaveLast(whichPlayer, id, tmpLocation, GetMapWaterNeutralZoneFacing(whichPlayer)) + + if ( not (ConvertMoveType(BlzGetUnitIntegerField((bj_lastCreatedUnit), UNIT_IF_MOVE_TYPE)) == MOVE_TYPE_FLOAT) ) then // INLINED!! + call MoveLocationToUnit(tmpLocation , (udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! + call SetUnitPositionLocFacingBJ(bj_lastCreatedUnit, tmpLocation, GetUnitFacing((udg_Hero[GetPlayerId((whichPlayer))]))) // INLINED!! + endif + + if ( IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_PEON) ) then + call AddWoWReforgedWorker(null , bj_lastCreatedUnit) + endif + + call GroupAddUnit(createdUnits, bj_lastCreatedUnit) + set atLeastOne=true + else + call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) + endif + else + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, GetObjectName(saveObjectId) + " exceeds your food maximum and hence is not loaded.") + endif + set j=j + 1 + endloop + else + call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) + endif + endif + set i=i + 1 + set pos=pos + 2 + endloop + + call ForGroupBJ(createdUnits, function ForGroupApplyLoadedUnitEvolution) + call GroupClear(createdUnits) + call DestroyGroup(createdUnits) + set createdUnits=null + + call RemoveLocation(tmpLocation) + set tmpLocation=null + + call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) + + if ( atLeastOne ) then + call AddGeneratedSaveCode(s) + endif + + return atLeastOne + endif + else + call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + endif call RemoveLocation(tmpLocation) set tmpLocation=null - return result -endfunction - -function WoWReforgedRandomSaveCode__GetSaveCodeRandomItems takes player whichPlayer returns string - local item item0= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) - local item item1= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) - local item item2= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) - local item item3= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) - local item item4= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) - local item item5= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) - local string result + call ForGroupBJ(createdUnits, function ForGroupApplyLoadedUnitEvolution) + call GroupClear(createdUnits) + call DestroyGroup(createdUnits) + set createdUnits=null - call SetItemCharges(item0, GetRandomInt(1, 30)) - call SetItemCharges(item1, GetRandomInt(1, 30)) - call SetItemCharges(item2, GetRandomInt(1, 30)) - call SetItemCharges(item3, GetRandomInt(1, 30)) - call SetItemCharges(item4, GetRandomInt(1, 30)) - call SetItemCharges(item5, GetRandomInt(1, 30)) + return false +endfunction - set result=GetSaveCodeItemsEx2(GetPlayerName(whichPlayer) , IsInSinglePlayer() , IsPlayerWarlord(whichPlayer) , udg_GameType , R2I(GetPlayerHandicapXP(whichPlayer)) , true , 0 , item0 , item1 , item2 , item3 , item4 , item5) +function GetSaveCodeInfosUnits takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "Multiplayer" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "Freelancer" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer count= 0 + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + local string result= "" - call h__RemoveItem(item0) - set item0=null + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif - call h__RemoveItem(item1) - set item1=null + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif - call h__RemoveItem(item2) - set item2=null + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif - call h__RemoveItem(item3) - set item3=null + if ( isWarlord ) then + set warlordStatus="Warlord" + endif - call h__RemoveItem(item4) - set item4=null + set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) + set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) + set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) + set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) + set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) + set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) + set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) + set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) - call h__RemoveItem(item5) - set item5=null + set i=0 + loop + exitwhen ( i == SAVE_CODE_MAX_UNITS ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + //call BJDebugMsg("Loading save object: " + I2S(saveObject)) + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdUnit[(saveObject)]) // INLINED!! + set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")") + endif + elseif ( saveObject == 0 ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Unit Slot") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Item with ID " + I2S(saveObject)) + endif + set i=i + 1 + set pos=pos + 2 + endloop return result endfunction -function WoWReforgedRandomSaveCode__ShowUrl takes player whichPlayer,string title,string saveCode returns nothing +function GetSaveCodeShortInfosUnits takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "M" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "F" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer count= 0 + local string checksumStatus= "Valid" + local string result= "" + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif - call ShowUrlUi(whichPlayer , title , saveCode) + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif + if ( isWarlord ) then + set warlordStatus="W" + endif -endfunction + set i=0 + loop + exitwhen ( i == SAVE_CODE_MAX_UNITS ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + set result=result + "-" + //call BJDebugMsg("Loading save object: " + I2S(saveObject)) + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdUnit[(saveObject)]) // INLINED!! + set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")" + else + set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(count) + ")" + endif + elseif ( saveObject == 0 ) then + set result=result + "Empty Unit Slot" + else + set result=result + "Invalid Item with ID " + I2S(saveObject) + endif + set i=i + 1 + set pos=pos + 2 + endloop -function GenerateRandomSaveCode takes unit hero returns nothing - if ( GetRandomInt(0, 1) == 0 ) then - call ShowUrlUi((GetOwningPlayer(hero) ) , ( "Units Save Code" ) , ( WoWReforgedRandomSaveCode__GetSaveCodeRandomUnits(GetOwningPlayer(hero)))) // INLINED!! - else - call ShowUrlUi((GetOwningPlayer(hero) ) , ( "Items Save Code" ) , ( WoWReforgedRandomSaveCode__GetSaveCodeRandomItems(GetOwningPlayer(hero)))) // INLINED!! - endif + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result endfunction -//library WoWReforgedRandomSaveCode ends -//library WoWReforgedSaveCodesResources: - -function IsSavedResource takes integer index returns boolean - local integer r= (s__Resource_resources[(index)]) // INLINED!! - return r != Resources_GOLD and r != Resources_LUMBER and r != Resources_FOOD and r != Resources_FOOD_MAX +function GetSaveCodeResearchesMax takes nothing returns integer + return 8 endfunction -function CreateSaveCodeResourcesTextFile takes player owner,string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,string saveCode returns nothing +function CreateSaveCodeResearchesTextFile takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,integer index,integer researches,string researchNames,string saveCode returns nothing local string singleplayer= "no" local string singlePlayerFileName= "Multiplayer" local string gameMode= "Freelancer" local string gameType= "Normal" local string content= "" - local string fileName= "" - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! if ( isSinglePlayer ) then set singleplayer="yes" @@ -84922,59 +82541,72 @@ function CreateSaveCodeResourcesTextFile takes player owner,string playerName,bo call FileStart() - set content=content + ("\r\n" + ("Code: -loadres " + saveCode)) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! - - // The line below creates the log - call Preload((content)) // INLINED!! - set content="" - - set i=0 - loop - exitwhen ( i == max ) - if ( IsSavedResource(i) ) then - set content=content + ("\r\n" + ((s__Resource_name[((s__Resource_resources[(i)]))]) + " - " + I2S(GetPlayerResource(owner , (s__Resource_resources[(i)]))))) // INLINED!! - set fileName=fileName + "-" + I2S(GetPlayerResource(owner , (s__Resource_resources[(i)]))) // INLINED!! - endif - set i=i + 1 - endloop - + set content=content + ("\r\n" + ("Code: -loadr " + saveCode)) // INLINED!! + set content=content + ("\r\n" + ("Researches: " + I2S(researches))) // INLINED!! + set content=content + ("\r\n" + ("Research Names: " + researchNames)) // INLINED!! set content=content + ("\r\n" + ("")) // INLINED!! // The line below creates the log call Preload((content)) // INLINED!! - set content="" // The line below creates the file at the specified location - call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-resources" + fileName + ".txt")) // INLINED!! + call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-index-" + I2S(index) + "-researches-" + I2S(researches) + "-" + researchNames + ".txt")) // INLINED!! endfunction -function GetSaveCodeResourcesEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,player owner returns string +function GetSaveCodeResearchesEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,boolean writeFile,integer index,player owner returns string local integer playerNameHash= CompressedAbsStringHash(playerName) local string result= "" - local integer max= (s__Resource_resourcesCount) // INLINED!! + local integer id= - 1 local integer i= 0 + local integer researchesCounter= 0 + local integer count= 0 + local string researchNames= "" //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) //call BJDebugMsg("Save code XP " + I2S(xp)) - set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_RESOURCES) - set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_RESEARCHES) set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) + set result=result + ConvertDecimalNumberToSaveCodeSegment(index) set i=0 loop - exitwhen ( i == max ) - if ( IsSavedResource(i) ) then - set result=result + ConvertDecimalNumberToSaveCodeSegment(GetPlayerResource(owner , (s__Resource_resources[(i)]))) // INLINED!! + exitwhen ( researchesCounter == SAVE_CODE_MAX_RESEARCHES or i == SaveObjectResearchCounter ) + exitwhen ( i >= ( index + 1 ) * SAVE_CODE_MAX_RESEARCHES ) + if ( i >= index * SAVE_CODE_MAX_RESEARCHES and i < ( index + 1 ) * SAVE_CODE_MAX_RESEARCHES ) then + set id=(SaveObjectIdResearch[(i)]) // INLINED!! + set count=GetPlayerTechCountSimple(id, owner) + if ( count > 0 ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(i) + set result=result + ConvertDecimalNumberToSaveCodeSegment(GetPlayerTechCountSimple(id, owner)) + if ( researchNames != "" ) then + set researchNames=researchNames + "," + endif + set researchNames=researchNames + GetObjectName(id) + "_" + I2S(count) + set researchesCounter=researchesCounter + 1 + endif endif set i=i + 1 endloop + // fill rest + set i=researchesCounter + loop + exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) + set i=i + 1 + endloop + + //call BJDebugMsg("Compressed result: " + result) + //call BJDebugMsg("Checksum: " + I2S(CompressedAbsStringHash(result))) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(result))) + //call BJDebugMsg("Checked save code part: " + result) + // checksum set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) @@ -84983,39 +82615,60 @@ function GetSaveCodeResourcesEx takes string playerName,boolean isSinglePlayer,b set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) endif - call CreateSaveCodeResourcesTextFile(owner , playerName , isSinglePlayer , isWarlord , gameType , result) + if ( researchesCounter > 0 ) then + if ( writeFile ) then + call CreateSaveCodeResearchesTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , researchesCounter , researchNames , result) + endif - call AddGeneratedSaveCode(result) + call AddGeneratedSaveCode(result) + endif return result endfunction -function GetSaveCodeResources takes player whichPlayer returns string +function GetSaveCodeResearchesForIndex takes player whichPlayer,boolean writeFile,integer index returns string local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) local boolean isSinglePlayer= IsInSinglePlayer() local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] local integer gameType= udg_GameType local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) - return GetSaveCodeResourcesEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , whichPlayer) + return GetSaveCodeResearchesEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) endfunction -function ApplySaveCodeResources takes player whichPlayer,string s returns boolean +function GetSaveCodeResearches takes player whichPlayer returns string + return GetSaveCodeResearchesForIndex(whichPlayer , true , 0) +endfunction + +function GetAllSaveCodeResearches takes player whichPlayer returns nothing + local integer i= 0 + local integer max= (8) // INLINED!! + loop + exitwhen ( i == max ) + call GetSaveCodeResearchesForIndex(whichPlayer , true , i) + set i=i + 1 + endloop +endfunction + +function ApplySaveCodeResearches takes player whichPlayer,string s returns boolean local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) local boolean isWarlord= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer pos= 5 local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer count= 0 + local boolean atLeastOne= false //call BJDebugMsg("Obfuscated save code: " + s) //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) @@ -85031,15 +82684,37 @@ function ApplySaveCodeResources takes player whichPlayer,string s returns boolea if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then set i=0 loop - exitwhen ( i >= max ) - if ( IsSavedResource(i) ) then - call SetPlayerResource(whichPlayer , (s__Resource_resources[(i)]) , (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS))) // INLINED!! + exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + //call BJDebugMsg("Loading save object: " + I2S(saveObject)) + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdResearch[(saveObject)]) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set count=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + //call BJDebugMsg("Loading save object " + GetObjectName(saveObjectId) + " with number: " + I2S(count)) + if ( not SetPlayerTechResearchedIfHigher(whichPlayer , saveObjectId , count) ) then + call h__DisplayTimedTextToPlayer(((whichPlayer ) ), 0.0, 0.0, 6.0, ( "Not loading research " + GetObjectName(( saveObjectId)) + " since your current level is higher or equal!")) // INLINED!! + endif + set atLeastOne=true + else + call DisplayObjectRaceLoadError(saveObjectId , whichPlayer) + endif endif set i=i + 1 - set pos=pos + 1 + set pos=pos + 2 endloop + + call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) - call AddGeneratedSaveCode(s) + if ( atLeastOne ) then + call AddGeneratedSaveCode(s) + set udg_TmpPlayer=whichPlayer + call ConditionalTriggerExecute(gg_trg_Ogre_Update_Captured_Black_Drakes) + set udg_TmpPlayer=whichPlayer + call ConditionalTriggerExecute(gg_trg_Dragonkin_Update_Black_Dragons) + endif + + return atLeastOne endif else call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! @@ -85048,7 +82723,7 @@ function ApplySaveCodeResources takes player whichPlayer,string s returns boolea return false endfunction -function GetSaveCodeInfosResources takes player whichPlayer,string s returns string +function GetSaveCodeInfosResearches takes player whichPlayer,string s returns string local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) local string playerName= GetPlayerName(whichPlayer) local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! @@ -85057,6 +82732,7 @@ function GetSaveCodeInfosResources takes player whichPlayer,string s returns str local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! local string gameTypeName= GetGameTypeName(gameType) local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) local string singlePlayerStatus= "Multiplayer" local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) @@ -85064,4629 +82740,3110 @@ function GetSaveCodeInfosResources takes player whichPlayer,string s returns str local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer pos= 5 local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer level= 0 + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + local string result= "" + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif + + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif + + if ( isWarlord ) then + set warlordStatus="Warlord" + endif + + set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) + set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) + set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) + set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) + set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) + set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) + set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) + set result=AppendSaveCodeInfo(result , "Index: " + I2S(index)) + + set i=0 + loop + exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdResearch[(saveObject)]) // INLINED!! + set level=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")") + endif + elseif ( saveObject == 0 ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - Empty Research Slot") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + "Invalid Research with ID " + I2S(saveObject)) + endif + set i=i + 1 + set pos=pos + 2 + endloop + + return result +endfunction + +function GetSaveCodeShortInfosResearches takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer index= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "M" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "F" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer i= 0 + local integer pos= 6 + local integer saveObject= 0 + local integer saveObjectId= 0 + local integer level= 0 + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + local string result= "" + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif + + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif + + if ( isWarlord ) then + set warlordStatus="W" + endif + + set i=0 + loop + exitwhen ( i >= SAVE_CODE_MAX_RESEARCHES ) + set saveObject=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS)) // INLINED!! + set result=result + "-" + if ( saveObject > 0 ) then + set saveObjectId=(SaveObjectIdResearch[(saveObject)]) // INLINED!! + set level=(ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos + 1) , SAVE_CODE_DIGITS)) // INLINED!! + if ( IsObjectFromPlayerRace(saveObjectId , whichPlayer) ) then + set result=result + "|cff00ff00" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")" + else + set result=result + "|cffff0000" + GetObjectName(saveObjectId) + "|r (" + I2S(level) + ")" + endif + elseif ( saveObject == 0 ) then + set result=result + "Empty Research Slot" + else + set result=result + "Invalid Research with ID " + I2S(saveObject) + endif + set i=i + 1 + set pos=pos + 2 + endloop + + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result +endfunction + +function AppendClanSaveCodeMember takes string members,string playerName,integer playerRank returns string + if ( StringLength(playerName) > 0 ) then + if ( StringLength(members) > 0 ) then + set members=members + ", " + endif + + return members + playerName + "_" + GetClanRankName(playerRank) + endif + + return members +endfunction + +function CreateSaveCodeClanTextFile takes boolean isSinglePlayer,string clanName,integer icon,integer clanSoundIndex,integer gold,integer lumber,integer improvedClanHallLevel,integer improvedClanLevel,string playerName0,integer playerRank0,string playerName1,integer playerRank1,string playerName2,integer playerRank2,string playerName3,integer playerRank3,string playerName4,integer playerRank4,string playerName5,integer playerRank5,string playerName6,integer playerRank6,integer memberCounter,string saveCode returns nothing + local string singleplayer= "no" + local string singlePlayerFileName= "Multiplayer" + local string leader= "" + local string members= "" + local string content= "" + + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" + endif + + set members=AppendClanSaveCodeMember(members , playerName0 , playerRank0) + + if ( playerRank0 == udg_ClanRankLeader ) then + set leader=playerName0 + endif + + set members=AppendClanSaveCodeMember(members , playerName1 , playerRank1) + + if ( playerRank1 == udg_ClanRankLeader ) then + set leader=playerName1 + endif + + set members=AppendClanSaveCodeMember(members , playerName2 , playerRank2) + + if ( playerRank2 == udg_ClanRankLeader ) then + set leader=playerName2 + endif + + set members=AppendClanSaveCodeMember(members , playerName3 , playerRank3) + + if ( playerRank3 == udg_ClanRankLeader ) then + set leader=playerName3 + endif + + set members=AppendClanSaveCodeMember(members , playerName4 , playerRank4) + + if ( playerRank4 == udg_ClanRankLeader ) then + set leader=playerName4 + endif + + set members=AppendClanSaveCodeMember(members , playerName5 , playerRank5) + + if ( playerRank5 == udg_ClanRankLeader ) then + set leader=playerName5 + endif + + + set members=AppendClanSaveCodeMember(members , playerName6 , playerRank6) + + if ( playerRank6 == udg_ClanRankLeader ) then + set leader=playerName6 + endif + + call FileStart() + + set content=content + ("\r\n" + ("Code: -loadc " + saveCode + " " + clanName)) // INLINED!! + set content=content + ("\r\n" + ("Singleplayer: " + singleplayer)) // INLINED!! + set content=content + ("\r\n" + ("Name: " + clanName)) // INLINED!! + set content=content + ("\r\n" + ("Icon: " + GetObjectName(icon))) // INLINED!! + set content=content + ("\r\n" + ("Sound: " + (GetObjectName((WoWReforgedClanShop__clanSoundsItemTypeIds[((clanSoundIndex))]))))) // INLINED!! + set content=content + ("\r\n" + ("Leader: " + leader)) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + + // The line below creates the log + call Preload((content)) // INLINED!! + + set content="" + set content=content + ("\r\n" + ("Members: " + members)) // INLINED!! + set content=content + ("\r\n" + ("Gold: " + I2S(gold))) // INLINED!! + set content=content + ("\r\n" + ("Lumber: " + I2S(lumber))) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + + // The line below creates the log + call Preload((content)) // INLINED!! + + set content="" + set content=content + ("\r\n" + ("Improved Clan Hall Level: " + I2S(improvedClanHallLevel))) // INLINED!! + set content=content + ("\r\n" + ("Improved Clan Level: " + I2S(improvedClanLevel))) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + + // The line below creates the log + call Preload((content)) // INLINED!! + + // The line below creates the file at the specified location + call PreloadGenEnd(("WoWR-Clan-" + clanName + "-" + playerName0 + "-" + singlePlayerFileName + "-gold-" + I2S(gold) + "-lumber-" + I2S(lumber) + "-members-" + I2S(memberCounter) + ".txt")) // INLINED!! +endfunction + +function GetSaveCodeClanEx takes boolean isSinglePlayer,string clanName,integer icon,sound whichSound,integer gold,integer lumber,boolean hasAIPlayer,integer improvedClanHallLevel,integer improvedClanLevel,string playerName0,integer playerRank0,string playerName1,integer playerRank1,string playerName2,integer playerRank2,string playerName3,integer playerRank3,string playerName4,integer playerRank4,string playerName5,integer playerRank5,string playerName6,integer playerRank6,integer membersCounter returns string + local string result= "" + local integer clanSoundIndex= GetClanSoundIndex(whichSound) + + //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_CLAN) // 0 + + if ( isSinglePlayer ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) // 1 + else + set result=result + ConvertDecimalNumberToSaveCodeSegment(1) // 1 + endif + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(clanName)) // 2 + set result=result + ConvertDecimalNumberToSaveCodeSegment(icon) // 3 + set result=result + ConvertDecimalNumberToSaveCodeSegment(clanSoundIndex) // 4 + set result=result + ConvertDecimalNumberToSaveCodeSegment(gold) // 5 + set result=result + ConvertDecimalNumberToSaveCodeSegment(lumber) // 6 + set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedClanHallLevel) // 7 + set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedClanLevel) // 8 + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName0)) // 9 + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank0) // 10 + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName1)) // 11 + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank1) // 12 + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName2)) // 13 + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank2) // 14 + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName3)) // 15 + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank3) // 16 + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName4)) // 17 + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank4) // 18 + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName5)) // 19 + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank5) // 20 + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(playerName6)) // 21 + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerRank6) // 22 + + if ( hasAIPlayer ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(1) // 23 + else + set result=result + ConvertDecimalNumberToSaveCodeSegment(0) // 23 + endif + + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) + + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , CompressedAbsStringHash(clanName)) + endif + + call CreateSaveCodeClanTextFile(isSinglePlayer , clanName , icon , clanSoundIndex , gold , lumber , improvedClanHallLevel , improvedClanLevel , playerName0 , playerRank0 , playerName1 , playerRank1 , playerName2 , playerRank2 , playerName3 , playerRank3 , playerName4 , playerRank4 , playerName5 , playerRank5 , playerName6 , playerRank6 , membersCounter , result) + + call AddGeneratedSaveCode(result) + + return result +endfunction + +function GetSaveCodeClan takes integer clan returns string + local string playerName0= "" + local integer playerRank0= udg_ClanRankMember + local string playerName1= "" + local integer playerRank1= udg_ClanRankMember + local string playerName2= "" + local integer playerRank2= udg_ClanRankMember + local string playerName3= "" + local integer playerRank3= udg_ClanRankMember + local string playerName4= "" + local integer playerRank4= udg_ClanRankMember + local string playerName5= "" + local integer playerRank5= udg_ClanRankMember + local string playerName6= "" + local integer playerRank6= udg_ClanRankMember + local integer improvedClanHallLevel= 0 + local integer improvedClanLevel= 0 + local integer clanMemberCounter= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then + set improvedClanHallLevel=IMaxBJ(GetPlayerTechCountSimple(UPG_IMPROVED_CLAN_HALL, Player(i)), improvedClanHallLevel) + set improvedClanLevel=IMaxBJ(GetPlayerTechCountSimple(UPG_IMPROVED_CLAN, Player(i)), improvedClanLevel) + + if ( clanMemberCounter == 0 ) then + set playerName0=GetPlayerName(Player(i)) + set playerRank0=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + elseif ( clanMemberCounter == 1 ) then + set playerName1=GetPlayerName(Player(i)) + set playerRank1=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + elseif ( clanMemberCounter == 2 ) then + set playerName2=GetPlayerName(Player(i)) + set playerRank2=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + elseif ( clanMemberCounter == 3 ) then + set playerName3=GetPlayerName(Player(i)) + set playerRank3=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + elseif ( clanMemberCounter == 4 ) then + set playerName4=GetPlayerName(Player(i)) + set playerRank4=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + elseif ( clanMemberCounter == 5 ) then + set playerName5=GetPlayerName(Player(i)) + set playerRank5=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + elseif ( clanMemberCounter == 6 ) then + set playerName6=GetPlayerName(Player(i)) + set playerRank6=udg_ClanPlayerRank[GetConvertedPlayerId(Player(i))] + endif + set clanMemberCounter=clanMemberCounter + 1 + endif + set i=i + 1 + endloop + + return GetSaveCodeClanEx(IsInSinglePlayer() , udg_ClanName[clan] , udg_ClanIcon[clan] , udg_ClanSound[clan] , udg_ClanGold[clan] , udg_ClanLumber[clan] , udg_ClanHasAIPlayer[clan] , improvedClanHallLevel , improvedClanLevel , playerName0 , playerRank0 , playerName1 , playerRank1 , playerName2 , playerRank2 , playerName3 , playerRank3 , playerName4 , playerRank4 , playerName5 , playerRank5 , playerName6 , playerRank6 , clanMemberCounter) +endfunction + +function ApplySaveCodeClan takes player whichPlayer,string name,string s returns boolean + local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= isSinglePlayerFlag == 0 + local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean atLeastOne= false + local integer clan= 0 + local integer i= 0 + local integer currentPlayerNameHash= 0 + + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and nameHash == CompressedAbsStringHash(name) and isSinglePlayer == IsInSinglePlayer() ) then + if ( playerNameHash == playerNameHash0 or playerNameHash == playerNameHash1 or playerNameHash == playerNameHash2 or playerNameHash == playerNameHash3 or playerNameHash == playerNameHash4 or playerNameHash == playerNameHash5 or playerNameHash == playerNameHash6 ) then + set i=1 + loop + exitwhen ( i > udg_ClanCounter ) + if ( StringLength(udg_ClanName[i]) > 0 and udg_ClanName[i] == name ) then + set clan=i + endif + set i=i + 1 + endloop + + if ( clan == 0 ) then + set udg_ClanName[udg_ClanCounter]=name + set udg_ClanIcon[udg_ClanCounter]=icon + set udg_ClanSound[udg_ClanCounter]=(udg_ClanSound[(clanSoundIndex)]) // INLINED!! + set udg_ClanGold[udg_ClanCounter]=gold + set udg_ClanLumber[udg_ClanCounter]=lumber + set clan=udg_ClanCounter + set udg_ClanCounter=udg_ClanCounter + 1 + //call BJDebugMsg("Creating new clan " + name) + endif + + set i=0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then + //call BJDebugMsg("Checking for player " + GetPlayerName(Player(i))) + set currentPlayerNameHash=CompressedAbsStringHash(GetPlayerName(Player(i))) + if ( currentPlayerNameHash == playerNameHash0 or currentPlayerNameHash == playerNameHash1 or currentPlayerNameHash == playerNameHash2 or currentPlayerNameHash == playerNameHash3 or currentPlayerNameHash == playerNameHash4 or CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash5 or currentPlayerNameHash == playerNameHash6 ) then + //call BJDebugMsg("Got clan player " + GetPlayerName(Player(i))) + set atLeastOne=true + if ( not IsPlayerInForce(Player(i), udg_ClanPlayers[clan]) ) then + call ForceAddPlayer(udg_ClanPlayers[clan], Player(i)) + endif + set udg_ClanPlayerClan[i + 1]=clan + call SetPlayerTechResearchedIfHigher(Player(i) , UPG_HERO_CLAN , 1) + call SetPlayerTechResearchedIfHigher(Player(i) , UPG_IMPROVED_CLAN_HALL , improvedClanHallLevel) + call SetPlayerTechResearchedIfHigher(Player(i) , UPG_IMPROVED_CLAN , improvedClanLevel) + + if ( clanHasAIPlayer == 1 ) then + call SetPlayerTechResearchedSwap(UPG_CLAN_HAS_NO_AI_PLAYER, 0, Player(i)) + endif + endif + + if ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash0 ) then + set udg_ClanPlayerRank[i + 1]=playerRank0 + elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash1 ) then + set udg_ClanPlayerRank[i + 1]=playerRank1 + elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash2 ) then + set udg_ClanPlayerRank[i + 1]=playerRank2 + elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash3 ) then + set udg_ClanPlayerRank[i + 1]=playerRank3 + elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash4 ) then + set udg_ClanPlayerRank[i + 1]=playerRank4 + elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash5 ) then + set udg_ClanPlayerRank[i + 1]=playerRank5 + elseif ( CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash6 ) then + set udg_ClanPlayerRank[i + 1]=playerRank6 + endif + endif + set i=i + 1 + endloop + + call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) + + if ( atLeastOne ) then + call AddGeneratedSaveCode(s) + + call PickClanAIPlayer(clan) + + call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_UNITACQUIRED, GetPlayerNameColored(whichPlayer) + " has created a new clan " + udg_ClanName[clan] + "!") + call PlaySoundBJ(gg_snd_ClanInvitation) + endif + + return atLeastOne + else + call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "You are not a member of this clan!")) // INLINED!! + endif + endif + else + call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + endif + + return false +endfunction + +function GetClanPlayerName takes integer playerNameHash returns string + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( StringLength(GetPlayerName(Player(i))) > 0 and CompressedAbsStringHash(GetPlayerName(Player(i))) == playerNameHash ) then + return GetPlayerName(Player(i)) + endif + set i=i + 1 + endloop + + return "Unknown" +endfunction + +function GetSaveCodeInfosClan takes string name,string s returns string + local string result= "" + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= isSinglePlayerFlag == 0 + local string singlePlayerStatus= "Multiplayer" + local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local string clanHasAIPlayerText= "No AI player" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) local string checksumStatus= "Valid" + local boolean atLeastOne= false + local integer clan= 0 + local integer i= 0 + + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif + + if ( clanHasAIPlayer == 1 ) then + set clanHasAIPlayerText="Has AI player" + endif + + set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) + set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) + set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) + set result=AppendSaveCodeInfo(result , "Name: " + name) + set result=AppendSaveCodeInfo(result , "Icon: " + GetObjectName(icon)) + set result=AppendSaveCodeInfo(result , "Sound: " + (GetObjectName((WoWReforgedClanShop__clanSoundsItemTypeIds[((clanSoundIndex))])))) // INLINED!! + set result=AppendSaveCodeInfo(result , "Gold: " + I2S(gold)) + set result=AppendSaveCodeInfo(result , "Lumber: " + I2S(lumber)) + set result=AppendSaveCodeInfo(result , "Improved Clan Hall: " + I2S(improvedClanHallLevel)) + set result=AppendSaveCodeInfo(result , "Improved Clan: " + I2S(improvedClanLevel)) + set result=AppendSaveCodeInfo(result , clanHasAIPlayerText) + set result=AppendSaveCodeInfo(result , "Player 1: " + GetClanPlayerName(playerNameHash0) + " (" + GetClanRankName(playerRank0) + ")") + set result=AppendSaveCodeInfo(result , "Player 2: " + GetClanPlayerName(playerNameHash1) + " (" + GetClanRankName(playerRank1) + ")") + set result=AppendSaveCodeInfo(result , "Player 3: " + GetClanPlayerName(playerNameHash2) + " (" + GetClanRankName(playerRank2) + ")") + set result=AppendSaveCodeInfo(result , "Player 4: " + GetClanPlayerName(playerNameHash3) + " (" + GetClanRankName(playerRank3) + ")") + set result=AppendSaveCodeInfo(result , "Player 5: " + GetClanPlayerName(playerNameHash4) + " (" + GetClanRankName(playerRank4) + ")") + set result=AppendSaveCodeInfo(result , "Player 6: " + GetClanPlayerName(playerNameHash5) + " (" + GetClanRankName(playerRank5) + ")") + set result=AppendSaveCodeInfo(result , "Player 7: " + GetClanPlayerName(playerNameHash6) + " (" + GetClanRankName(playerRank6) + ")") + + return result +endfunction + +function GetSaveCodeShortInfosClan takes string name,string s returns string + local string result= "" + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= isSinglePlayerFlag == 0 + local string singlePlayerStatus= "M" + local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local string clanHasAIPlayerText= "No AI player" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local string checksumStatus= "Valid" + local boolean atLeastOne= false + local integer clan= 0 + local integer i= 0 + + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif + + if ( clanHasAIPlayer == 1 ) then + set clanHasAIPlayerText="Has AI player" + endif + + return name + "-" + singlePlayerStatus + "-gold_" + I2S(gold) + "-lumber_" + I2S(lumber) + "-p1_" + GetClanPlayerName(playerNameHash0) + "-p2_" + GetClanPlayerName(playerNameHash1) + "-p3_" + GetClanPlayerName(playerNameHash2) +endfunction + +function GetSaveCodeClanGold takes string name,string s returns integer + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local string checksumStatus= "Valid" + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + return gold +endfunction + +function GetSaveCodeClanLumber takes string name,string s returns integer + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local string checksumStatus= "Valid" + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + return lumber +endfunction + +function AccountNameBelongsToClanSaveCode takes string name,string s returns boolean + local string result= "" + local integer accountNameHash= StringHash(name) + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerFlag= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer nameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer icon= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanSoundIndex= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gold= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 5) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lumber= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 6) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanHallLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + local integer improvedClanLevel= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 8) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 9) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank0= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 10) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 11) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank1= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 12) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank2= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 15) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank3= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 16) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 17) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank4= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 18) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 19) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank5= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 20) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 21) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerRank6= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 22) , SAVE_CODE_DIGITS)) // INLINED!! + local integer clanHasAIPlayer= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 23) , SAVE_CODE_DIGITS)) // INLINED!! + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + + return accountNameHash == playerNameHash0 or accountNameHash == playerNameHash1 or accountNameHash == playerNameHash2 or accountNameHash == playerNameHash3 or accountNameHash == playerNameHash4 or accountNameHash == playerNameHash5 or accountNameHash == playerNameHash6 +endfunction + +// Mailbox System + +function CreateSaveCodeLetterTextFile takes string playerNameFrom,string playerNameTo,string message,string saveCode returns nothing + local string content= "" + + call FileStart() + + set content=content + ("\r\n" + ("Code:")) // INLINED!! + set content=content + ("\r\n" + ("-loadl " + saveCode)) // INLINED!! + set content=content + ("\r\n" + ("From: " + playerNameFrom)) // INLINED!! + set content=content + ("\r\n" + ("To: " + playerNameTo)) // INLINED!! + set content=content + ("\r\n" + ("Message Length: " + I2S(StringLength(message)))) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + + // The line below creates the log + call Preload((content)) // INLINED!! + + // The line below creates the file at the specified location + call PreloadGenEnd(("WorldOfWarcraftReforged-letter-from_" + playerNameFrom + "-to_" + playerNameTo + "-messageLength_" + I2S(StringLength(message)) + ".txt")) // INLINED!! +endfunction + +function AddGeneratedSaveCodeLetter takes string playerNameFrom,string playerNameTo,string message returns nothing + local integer index= 0 + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( GetPlayerName(Player(i)) == playerNameTo ) then + call h__DisplayTimedTextToPlayer(Player(i), 0.0, 0.0, 40.0, "You received a letter from " + playerNameFrom + ". Use \"-mailbox\" to list all letters.") + exitwhen ( true ) + endif + set i=i + 1 + endloop + set index=PrestoredSaveCodeCounter + set PrestoredSaveCodePlayerName[index]=playerNameTo + set PrestoredSaveCode[index]=message + set PrestoredSaveCodeType[index]=PRESTORED_SAVECODE_TYPE_LETTER + set PrestoredSaveCodePlayerNamesCounter[index]=0 + set PrestoredSaveCodeCounter=PrestoredSaveCodeCounter + 1 + set lastAddedPrestoredClan=index +endfunction + +function GetSaveCodeLetter takes string playerNameFrom,string playerNameTo,string message returns string + local integer i= 0 + local integer playerNameToHash= CompressedAbsStringHash(playerNameTo) + local string result= "" + + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_LETTER) + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameToHash) + set result=result + ConvertStringToSaveCodeSegment(playerNameFrom , playerNameToHash) + set result=result + ConvertStringToSaveCodeSegment(message , playerNameToHash) + + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) + + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameToHash) + endif + + call CreateSaveCodeLetterTextFile(playerNameFrom , playerNameTo , message , result) + + call AddGeneratedSaveCode(result) + call AddGeneratedSaveCodeLetter(playerNameFrom , playerNameTo , message) + + return result +endfunction + +function GetSaveCodeInfosLetter takes string playerNameTo,string s returns string local string result= "" + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerNameTo)) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local string playerNameToText= playerNameTo + local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) + local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( playerNameToHash != CompressedAbsStringHash(playerNameTo) ) then + set playerNameToText="Invalid" + endif + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif + + set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) + set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) + set result=AppendSaveCodeInfo(result , "To: " + playerNameToText) + set result=AppendSaveCodeInfo(result , "From: " + playerNameFrom) + set result=AppendSaveCodeInfo(result , "Message: " + message) + + return result +endfunction + +function GetSaveCodeShortInfosLetter takes string playerNameTo,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerNameTo)) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local string playerNameToText= playerNameTo + local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) + local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( playerNameToHash != CompressedAbsStringHash(playerNameTo) ) then + set playerNameToText="Invalid" + endif if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then set checksumStatus="Invalid" endif - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif + return "f_" + playerNameFrom + "-t_" + playerNameToText + "-m_" + I2S(StringLength(message)) +endfunction - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif +function ApplySaveCodeLetterEx takes player whichPlayer,string playerName,string s returns boolean + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) + local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - if ( isWarlord ) then - set warlordStatus="Warlord" - endif + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameToHash == CompressedAbsStringHash(playerName) ) then + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 120.0, "Letter from " + playerNameFrom + ": " + message) - set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) - set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) - set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) - set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) - set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) - set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) - set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) + return true + endif - set i=0 - loop - exitwhen ( i >= max ) - if ( IsSavedResource(i) ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + (s__Resource_name[((s__Resource_resources[(i)]))]) + " (" + I2S((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS))) + ")") // INLINED!! - set pos=pos + 1 - endif - set i=i + 1 - endloop + return false +endfunction - return result +function ApplySaveCodeLetter takes player whichPlayer,string playerName,string s returns boolean + return ApplySaveCodeLetterEx(whichPlayer , "all" , s) or ApplySaveCodeLetterEx(whichPlayer , playerName , s) endfunction -function GetSaveCodeShortInfosResources takes player whichPlayer,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) - local string playerName= GetPlayerName(whichPlayer) +function GetSaveCodeErrorsLetter takes player whichPlayer,string playerName,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! - local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! - local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! - local string gameTypeName= GetGameTypeName(gameType) - local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! - local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string singlePlayerStatus= "M" - local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) - local string warlordStatus= "F" + local integer playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local string playerNameFrom= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 2 , playerNameToHash) + local string message= ConvertSaveCodeSegmentIntoStringFromSaveCode(saveCode , 3 , playerNameToHash) local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! - local integer pos= 5 - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" local string result= "" + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" + set result=result + "Expected different checksum!" endif - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif + if ( playerNameToHash != CompressedAbsStringHash(playerName) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif - if ( isSinglePlayer ) then - set singlePlayerStatus="S" + set result=result + "Expected different player name!" endif - if ( isWarlord ) then - set warlordStatus="W" + if ( StringLength(result) == 0 ) then + set result="None errors detected." endif - set i=0 - loop - exitwhen ( i >= max ) - if ( IsSavedResource(i) ) then - set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + (s__Resource_name[((s__Resource_resources[(i)]))]) + " (" + I2S((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS))) + ")") // INLINED!! - set pos=pos + 1 - endif - set i=i + 1 - endloop - - return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + result + return result endfunction +// Save and Load Auto -//library WoWReforgedSaveCodesResources ends -//library WoWReforgedStandardObjectFields: -function WoWReforgedStandardObjectFields___AddObjectMappingTinyItem takes integer whichRace,integer t0,integer t1 returns nothing - if ( GetRaceObjectTypeId(whichRace , t0) != 0 and GetRaceObjectTypeId(whichRace , t1) != 0 ) then - call AddObjectMapping(GetRaceObjectTypeId(whichRace , t0) , GetRaceObjectTypeId(whichRace , t1)) - endif +function SaveAndLoadAutoGetPlayerFromSyncData takes string source returns player + return Player(S2I((StringTokenEx((source ) , ( 0) , " " , false)))) // INLINED!! endfunction -function AddRaceStandardObjectIdFields takes nothing returns nothing - local integer j= 0 - local integer max2= 0 - local integer max= (udg_MaxRaces) // INLINED!! - local integer i= 1 - loop - exitwhen ( i == max ) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_TIER_1 , RACE_OBJECT_TYPE_TIER_1_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_TIER_2 , RACE_OBJECT_TYPE_TIER_2_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_TIER_3 , RACE_OBJECT_TYPE_TIER_3_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_FARM , RACE_OBJECT_TYPE_FARM_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_ALTAR , RACE_OBJECT_TYPE_ALTAR_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_MILL , RACE_OBJECT_TYPE_MILL_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_BLACK_SMITH , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_BARRACKS , RACE_OBJECT_TYPE_BARRACKS_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_WORKSHOP , RACE_OBJECT_TYPE_WORKSHOP_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_ARCANE_SANCTUM , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SCOUT_TOWER , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_GUARD_TOWER , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_CANNON_TOWER , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_ARCANE_TOWER , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SHOP , RACE_OBJECT_TYPE_SHOP_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_GRYPHON_AVIARY , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SACRIFICAL_PIT , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_HOUSING , RACE_OBJECT_TYPE_HOUSING_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SHIPYARD , RACE_OBJECT_TYPE_SHIPYARD_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM) - call WoWReforgedStandardObjectFields___AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2_ITEM) - //call AddObjectMappingTinyItem(i, RACE_OBJECT_TYPE_MINE, RACE_OBJECT_TYPE_MINE_ITEM) - - - - set i=i + 1 - endloop - - +function SaveAndLoadAutoGetContentFromSyncData takes string source returns string + return (StringTokenEx((source ) , ( 1) , " " , false)) // INLINED!! endfunction - -//library WoWReforgedStandardObjectFields ends -//library WoWReforgedUpdateSkillUI: - - -function WoWReforgedUpdateSkillUI__Init takes nothing returns nothing - call TriggerAddAction(updateSkillUITrigger, function UpdateSkillPointsUIForAllPlayers) +function SaveAndLoadAutoTriggerAction takes nothing returns nothing + local string syncData= BlzGetTriggerSyncData() + local player sourcePlayer= (Player(S2I((StringTokenEx(((syncData) ) , ( 0) , " " , false))))) // INLINED!! + local string content= (StringTokenEx(((syncData) ) , ( 1) , " " , false)) // INLINED!! + //call BJDebugMsg("Syncing data from player " + GetPlayerName(sourcePlayer) + ": " + content) + set SaveAndLoadAutoSyncCounter[GetPlayerId(sourcePlayer)]=SaveAndLoadAutoSyncCounter[GetPlayerId(sourcePlayer)] + 1 endfunction - -//library WoWReforgedUpdateSkillUI ends -//library WoWReforgedSaveCodesAll: - - -function ResetSaveCodeAllTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__loadedAllOnce[GetPlayerId(whichPlayer)]=true +function SaveAndLoadAutoInit takes nothing returns nothing + call TriggerRegisterAnyPlayerSyncEvent(SaveAndLoadAutoSyncTrigger , SAVE_AND_LOAD_AUTO_PREFIX , false) + call TriggerAddAction(SaveAndLoadAutoSyncTrigger, function SaveAndLoadAutoTriggerAction) endfunction -function GetModeSuffix takes nothing returns string - if ( IsInSinglePlayer() ) then - return "Singleplayer" +function LoadFileForAllPlayers takes integer file,player whichPlayer returns string + local force allPlayingUsers= null + local string content= "" + local boolean synced= false + local real timeout= 0.0 + set SaveAndLoadAutoSyncCounter[GetPlayerId(whichPlayer)]=0 + if ( GetLocalPlayer() == whichPlayer ) then + set content=(s__File_readEx((file),false)) // INLINED!! + call BlzSendSyncData(SAVE_AND_LOAD_AUTO_PREFIX, I2S(GetPlayerId(whichPlayer)) + " " + content) endif - return "Multiplayer" -endfunction -function GetGameTypeSuffixEx takes integer t returns string - if ( t == udg_GameTypeEasy ) then - return "Easy" - elseif ( t == udg_GameTypeFast ) then - return "Fast" - elseif ( t == udg_GameTypeHardcore ) then - return "Hardcore" + loop + set synced=SaveAndLoadAutoSyncCounter[GetPlayerId(whichPlayer)] >= CountPlayersInForceBJ((ForceUtils__allPlayingUsers)) // INLINED!! + exitwhen ( timeout >= 5.0 or synced ) + call TriggerSleepAction(1.0) + set timeout=timeout + 1.0 + endloop + + if ( synced ) then + return content endif - - return "Normal" -endfunction -function GetGameTypeSuffix takes nothing returns string - return GetGameTypeSuffixEx(udg_GameType) + return null endfunction -function GetGameModeSuffix takes boolean isWarlord returns string - if ( isWarlord ) then - return "Warlord" - endif - - return "Freelancer" -endfunction -function GetSaveCodeAllFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + ".txt" // INLINED!! -endfunction +//library WoWReforgedSaveCodes ends +//library WoWReforgedSkillUI: -function GetSaveCodeAllItemsFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Items.txt" // INLINED!! -endfunction -function GetSaveCodeAllUnitsFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Units.txt" // INLINED!! +function WoWReforgedSkillUI___SetSkillUIVisibleAll takes boolean visible returns nothing + local integer i= 0 + local integer max= 3 + loop + exitwhen ( i == max ) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameUp[i], visible) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameDown[i], visible) + set i=i + 1 + endloop endfunction -function GetSaveCodeAllBuildingsFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Buildings.txt" // INLINED!! +// use in trigger action because of GetSingleSelectedUnit +function UpdateSkillPointsUI takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string attributePoints= I2S(R2I((LoadReal(Attributes___h, GetHandleId((WoWReforgedSkillUI___currentHero[playerId] )), ( udg_AttributeAttributePoints))))) // INLINED!! + local boolean visible= not WoWReforgedSkillUI___hidden[playerId] + //call BJDebugMsg("Selection for player " + I2S(playerId)) + if ( WoWReforgedSkillUI___currentHero[playerId] != null and ( IsCustomizableAttributesHero(GetUnitTypeId(WoWReforgedSkillUI___currentHero[playerId])) or IsOriginalUnitTypeCustomizableAttributesHero(WoWReforgedSkillUI___currentHero[playerId]) ) and GetSingleSelectedUnit(whichPlayer) == WoWReforgedSkillUI___currentHero[playerId] ) then + if ( whichPlayer == GetLocalPlayer() ) then + call WoWReforgedSkillUI___SetSkillUIVisibleAll(visible) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameToggle, true) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameAttributePoints, true) + call BlzFrameSetText(WoWReforgedSkillUI___IconFrameAttributePoints, attributePoints) + endif + else + //call BJDebugMsg("Hide mine " + GetUnitName(selected)) + if ( whichPlayer == GetLocalPlayer() ) then + call WoWReforgedSkillUI___SetSkillUIVisibleAll(false) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameToggle, false) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameAttributePoints, false) + endif + endif endfunction -function GetSaveCodeAllResearchesFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Researches.txt" // INLINED!! +function WoWReforgedSkillUI___TriggerActionUpdateSkillPointsUI takes nothing returns nothing + call UpdateSkillPointsUI(WoWReforgedSkillUI___tmpPlayer) endfunction -function GetSaveCodeAllResourcesFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Resources.txt" // INLINED!! +function WoWReforgedSkillUI___UpdateSkillPointsUIExec takes player whichPlayer returns nothing + set WoWReforgedSkillUI___tmpPlayer=whichPlayer + call TriggerExecute(WoWReforgedSkillUI___tmpTrigger) endfunction -function GetSaveCodeAllClanFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Clan.txt" // INLINED!! +function WoWReforgedSkillUI___SetSkillUIVisible takes player whichPlayer,boolean visible returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call WoWReforgedSkillUI___SetSkillUIVisibleAll(visible) + endif + call UpdateSkillPointsUI(whichPlayer) endfunction -function GetSaveCodeAllFileNameForPlayer takes player whichPlayer returns string - return GetSaveCodeAllFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) -endfunction +function WoWReforgedSkillUI___TriggerActionUp takes nothing returns nothing + local integer a= LoadInteger(WoWReforgedSkillUI___h, GetHandleId(GetTriggeringTrigger()), 0) -function GetSaveCodeAllFileNameItemsForPlayer takes player whichPlayer returns string - return GetSaveCodeAllItemsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzSendSyncData(WoWReforgedSkillUI___PREFIX, "Up" + I2S(a)) + endif endfunction -function GetSaveCodeAllFileNameUnitsForPlayer takes player whichPlayer returns string - return GetSaveCodeAllUnitsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +function WoWReforgedSkillUI___TriggerActionDown takes nothing returns nothing + local integer a= LoadInteger(WoWReforgedSkillUI___h, GetHandleId(GetTriggeringTrigger()), 0) + + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzSendSyncData(WoWReforgedSkillUI___PREFIX, "Down" + I2S(a)) + endif endfunction -function GetSaveCodeAllFileNameBuildingsForPlayer takes player whichPlayer returns string - return GetSaveCodeAllBuildingsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +function WoWReforgedSkillUI___TriggerActionToggle takes nothing returns nothing + local integer playerId= GetPlayerId(GetTriggerPlayer()) + local boolean visible= WoWReforgedSkillUI___hidden[playerId] + set WoWReforgedSkillUI___hidden[playerId]=not WoWReforgedSkillUI___hidden[playerId] + call WoWReforgedSkillUI___SetSkillUIVisible(GetTriggerPlayer() , not WoWReforgedSkillUI___hidden[playerId]) + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + if ( visible ) then + call BlzFrameSetTexture(WoWReforgedSkillUI___IconFrameToggleFrame, "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-DownArrow.blp", 0, true) + else + call BlzFrameSetTexture(WoWReforgedSkillUI___IconFrameToggleFrame, "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-UpArrow.blp", 0, true) + endif + endif + call UpdateSkillPointsUI(GetTriggerPlayer()) + //call BJDebugMsg("Click toggle.") endfunction -function GetSaveCodeAllFileNameResearchesForPlayer takes player whichPlayer returns string - return GetSaveCodeAllResearchesFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +function WoWReforgedSkillUI___CreateSkillUIButtons takes integer a,real x,real y returns nothing + set WoWReforgedSkillUI___IconFrameUp[a]=BlzCreateFrameByType("BUTTON", "AttributeUpButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameUp[a], FRAMEPOINT_TOPLEFT, x, y) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameUp[a], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedSkillUI___WIDTH, y - WoWReforgedSkillUI___HEIGHT) + call BlzFrameSetLevel(WoWReforgedSkillUI___IconFrameUp[a], 2) + + set WoWReforgedSkillUI___IconFrameUpFrame[a]=BlzCreateFrameByType("BACKDROP", "AttributeUpButtonFrame", WoWReforgedSkillUI___IconFrameUp[a], "", 0) + call BlzFrameSetAllPoints(WoWReforgedSkillUI___IconFrameUpFrame[a], WoWReforgedSkillUI___IconFrameUp[a]) + call BlzFrameSetTexture(WoWReforgedSkillUI___IconFrameUpFrame[a], "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-UpArrow.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedSkillUI___IconFrameUpFrame[a], true) + + set WoWReforgedSkillUI___upTrigger[a]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedSkillUI___upTrigger[a], WoWReforgedSkillUI___IconFrameUp[a], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedSkillUI___upTrigger[a], function WoWReforgedSkillUI___TriggerActionUp) + call SaveInteger(WoWReforgedSkillUI___h, GetHandleId(WoWReforgedSkillUI___upTrigger[a]), 0, a) + + set WoWReforgedSkillUI___IconFrameDown[a]=BlzCreateFrameByType("BUTTON", "AttributeDownButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameDown[a], FRAMEPOINT_TOPLEFT, x, y - WoWReforgedSkillUI___HEIGHT - WoWReforgedSkillUI___SPACING) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameDown[a], FRAMEPOINT_BOTTOMRIGHT, x + WoWReforgedSkillUI___WIDTH, y - WoWReforgedSkillUI___HEIGHT - WoWReforgedSkillUI___SPACING - WoWReforgedSkillUI___HEIGHT) + call BlzFrameSetLevel(WoWReforgedSkillUI___IconFrameDown[a], 2) + + set WoWReforgedSkillUI___IconFrameDownFrame[a]=BlzCreateFrameByType("BACKDROP", "AttributeDownButtonFrame", WoWReforgedSkillUI___IconFrameDown[a], "", 0) + call BlzFrameSetAllPoints(WoWReforgedSkillUI___IconFrameDownFrame[a], WoWReforgedSkillUI___IconFrameDown[a]) + call BlzFrameSetTexture(WoWReforgedSkillUI___IconFrameDownFrame[a], "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-DownArrow.blp", 0, true) + call BlzFrameSetEnable(WoWReforgedSkillUI___IconFrameDownFrame[a], true) + + set WoWReforgedSkillUI___downTrigger[a]=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedSkillUI___downTrigger[a], WoWReforgedSkillUI___IconFrameDown[a], FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedSkillUI___downTrigger[a], function WoWReforgedSkillUI___TriggerActionDown) + call SaveInteger(WoWReforgedSkillUI___h, GetHandleId(WoWReforgedSkillUI___downTrigger[a]), 0, a) endfunction -function GetSaveCodeAllFileNameResourcesForPlayer takes player whichPlayer returns string - return GetSaveCodeAllResourcesFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +function WoWReforgedSkillUI___HideSkillUI takes nothing returns nothing + call WoWReforgedSkillUI___SetSkillUIVisibleAll(false) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameToggle, false) + call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameAttributePoints, false) endfunction -function GetSaveCodeAllFileNameClanForPlayer takes player whichPlayer returns string - return GetSaveCodeAllClanFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) -endfunction +function WoWReforgedSkillUI___CreateSkillUI takes nothing returns nothing + call WoWReforgedSkillUI___CreateSkillUIButtons(bj_HEROSTAT_STR , WoWReforgedSkillUI___X , WoWReforgedSkillUI___Y) + call WoWReforgedSkillUI___CreateSkillUIButtons(bj_HEROSTAT_AGI , WoWReforgedSkillUI___X , WoWReforgedSkillUI___Y2) + call WoWReforgedSkillUI___CreateSkillUIButtons(bj_HEROSTAT_INT , WoWReforgedSkillUI___X , WoWReforgedSkillUI___Y3) -function CreateSaveCodeAllHeroesTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= GetSaveCode(whichPlayer) - local string content= "" + set WoWReforgedSkillUI___IconFrameToggle=BlzCreateFrameByType("BUTTON", "AttributeToggleButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "ScoreScreenTabButtonTemplate", 0) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameToggle, FRAMEPOINT_TOPLEFT, WoWReforgedSkillUI___TOGGLE_X, WoWReforgedSkillUI___TOGGLE_Y) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameToggle, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedSkillUI___TOGGLE_X + WoWReforgedSkillUI___WIDTH, WoWReforgedSkillUI___TOGGLE_Y - WoWReforgedSkillUI___HEIGHT) + call BlzFrameSetLevel(WoWReforgedSkillUI___IconFrameToggle, 2) - set content=content + " -load " + saveCode - set content=content + " " + set WoWReforgedSkillUI___IconFrameToggleFrame=BlzCreateFrameByType("BACKDROP", "AttributeToggleButtonFrame", WoWReforgedSkillUI___IconFrameToggle, "", 0) + call BlzFrameSetAllPoints(WoWReforgedSkillUI___IconFrameToggleFrame, WoWReforgedSkillUI___IconFrameToggle) + call BlzFrameSetTexture(WoWReforgedSkillUI___IconFrameToggleFrame, "UI\\Widgets\\Glues\\Gluescreen-Scrollbar-DownArrow.blp", 0, true) - call FileIO_Write(GetSaveCodeAllFileNameForPlayer(whichPlayer) , content) -endfunction + set WoWReforgedSkillUI___toggleTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedSkillUI___toggleTrigger, WoWReforgedSkillUI___IconFrameToggle, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedSkillUI___toggleTrigger, function WoWReforgedSkillUI___TriggerActionToggle) + + set WoWReforgedSkillUI___IconFrameAttributePoints=BlzCreateFrameByType("TEXT", "AttributePoints", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameAttributePoints, FRAMEPOINT_TOPLEFT, WoWReforgedSkillUI___ATTRIBUTE_POINTS_X, WoWReforgedSkillUI___TOGGLE_Y) + call BlzFrameSetAbsPoint(WoWReforgedSkillUI___IconFrameAttributePoints, FRAMEPOINT_BOTTOMRIGHT, WoWReforgedSkillUI___ATTRIBUTE_POINTS_X + WoWReforgedSkillUI___ATTRIBUTE_POINTS_WIDTH, WoWReforgedSkillUI___TOGGLE_Y - WoWReforgedSkillUI___HEIGHT) + call BlzFrameSetText(WoWReforgedSkillUI___IconFrameAttributePoints, "0") + call BlzFrameSetTextAlignment(WoWReforgedSkillUI___IconFrameAttributePoints, TEXT_JUSTIFY_MIDDLE, TEXT_JUSTIFY_LEFT) -function CreateSaveCodeAllHeroesTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllHeroesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) + // hide for all players + call WoWReforgedSkillUI___HideSkillUI() endfunction -function CreateSaveCodeAllHeroesTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllHeroesTextFileNewOpLimit)) // INLINED!! +function WoWReforgedSkillUI___TriggerConditionSync takes nothing returns boolean + local string data= BlzGetTriggerSyncData() + local integer playerId= GetPlayerId(GetTriggerPlayer()) + local integer a= bj_HEROSTAT_STR + if ( StringStartsWith(data , "Up") ) then + set a=S2I(StringRemoveFromStart(data , "Up")) + call WoWReforgedSkillAttribute(WoWReforgedSkillUI___currentHero[playerId] , a , 1.0) + call UpdateSkillPointsUI(GetTriggerPlayer()) + elseif ( StringStartsWith(data , "Down") ) then + set a=S2I(StringRemoveFromStart(data , "Down")) + call WoWReforgedSkillAttribute(WoWReforgedSkillUI___currentHero[playerId] , a , - 1.0) + call UpdateSkillPointsUI(GetTriggerPlayer()) + endif + return false endfunction -function CreateSaveCodeAllItemsTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= "" - local string content= "" - local integer i= 0 - local integer max= (3 + BACKPACK_MAX_PAGES + 3) // INLINED!! - loop - exitwhen ( i >= max ) - set saveCode=GetSaveCodeItemsForIndex(whichPlayer , false , i) - if ( saveCode != null and saveCode != "" ) then - set content=content + " -loadi " + saveCode - set content=content + " " - endif - set i=i + 1 - endloop - - call FileIO_Write(GetSaveCodeAllFileNameItemsForPlayer(whichPlayer) , content) -endfunction +function WoWReforgedSkillUI___TriggerConditionSelected takes nothing returns boolean + local integer playerId= GetPlayerId(GetTriggerPlayer()) + set WoWReforgedSkillUI___currentHero[playerId]=GetTriggerUnit() + + call WoWReforgedSkillUI___UpdateSkillPointsUIExec(GetTriggerPlayer()) -function CreateSaveCodeAllItemsTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllItemsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) + return false endfunction -function CreateSaveCodeAllItemsTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllItemsTextFileNewOpLimit)) // INLINED!! +function WoWReforgedSkillUI___TriggerConditionDeselected takes nothing returns boolean + local integer playerId= GetPlayerId(GetTriggerPlayer()) + //call BJDebugMsg("Selection for player " + I2S(playerId)) + if ( WoWReforgedSkillUI___currentHero[playerId] == GetTriggerUnit() ) then + set WoWReforgedSkillUI___currentHero[playerId]=null + endif + + call WoWReforgedSkillUI___UpdateSkillPointsUIExec(GetTriggerPlayer()) + + return false endfunction -function CreateSaveCodeAllUnitsTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= "" - local string content= "" +function WoWReforgedSkillUI___UpdateSkillPointsUIForAllPlayersForHero takes unit hero returns nothing local integer i= 0 - local integer max= (8) // INLINED!! loop - exitwhen ( i >= max ) - //call BJDebugMsg("Loop " + I2S(i) + " for units") - set saveCode=GetSaveCodeUnitsForIndex(whichPlayer , false , i) - if ( saveCode != null and saveCode != "" ) then - set content=content + " -loadu " + saveCode - set content=content + " " + exitwhen ( i == bj_MAX_PLAYERS ) + if ( WoWReforgedSkillUI___currentHero[i] == hero ) then + call WoWReforgedSkillUI___UpdateSkillPointsUIExec(Player(i)) endif set i=i + 1 endloop - - call FileIO_Write(GetSaveCodeAllFileNameUnitsForPlayer(whichPlayer) , content) -endfunction - -function CreateSaveCodeAllUnitsTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllUnitsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) -endfunction - -function CreateSaveCodeAllUnitsTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllUnitsTextFileNewOpLimit)) // INLINED!! endfunction -function CreateSaveCodeAllBuildingsTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= "" - local string content= "" +function UpdateSkillPointsUIForAllPlayers takes nothing returns nothing local integer i= 0 - local integer max= (8) // INLINED!! loop - exitwhen ( i >= max ) - //call BJDebugMsg("Loop " + I2S(i) + " for buildings") - set saveCode=GetSaveCodeBuildingsForIndex(whichPlayer , false , i) - if ( saveCode != null and saveCode != "" ) then - set content=content + " -loadb " + saveCode - set content=content + " " - endif + exitwhen ( i == bj_MAX_PLAYERS ) + call WoWReforgedSkillUI___UpdateSkillPointsUIExec(Player(i)) set i=i + 1 endloop - - set content=content + " " - - call FileIO_Write(GetSaveCodeAllFileNameBuildingsForPlayer(whichPlayer) , content) endfunction -function CreateSaveCodeAllBuildingsTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllBuildingsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +function WoWReforgedSkillUI___TriggerConditioLoaded takes nothing returns boolean + call WoWReforgedSkillUI___UpdateSkillPointsUIForAllPlayersForHero(GetTriggerUnit()) + + return false endfunction -function CreateSaveCodeAllBuildingsTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllBuildingsTextFileNewOpLimit)) // INLINED!! +function EnableSkillUITriggers takes nothing returns nothing + call EnableTrigger(WoWReforgedSkillUI___selectionTrigger) + call EnableTrigger(WoWReforgedSkillUI___deselectionTrigger) + call EnableTrigger(WoWReforgedSkillUI___loadTrigger) endfunction -function CreateSaveCodeAllResearchesTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= "" - local string content= "" - local integer i= 0 - local integer max= (8) // INLINED!! - loop - exitwhen ( i >= max ) - //call BJDebugMsg("Loop " + I2S(i) + " for researches") - set saveCode=GetSaveCodeResearchesForIndex(whichPlayer , false , i) - if ( saveCode != null and saveCode != "" ) then - set content=content + " -loadr " + saveCode - set content=content + " " - endif - set i=i + 1 - endloop - - set content=content + " " - - call FileIO_Write(GetSaveCodeAllFileNameResearchesForPlayer(whichPlayer) , content) +function DisableSkillUITriggers takes nothing returns nothing + call DisableTrigger(WoWReforgedSkillUI___selectionTrigger) + call DisableTrigger(WoWReforgedSkillUI___deselectionTrigger) + call DisableTrigger(WoWReforgedSkillUI___loadTrigger) endfunction -function CreateSaveCodeAllResearchesTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllResearchesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +function CreateAndEnableSkillUI takes nothing returns nothing + call WoWReforgedSkillUI___CreateSkillUI() + + call EnableSkillUITriggers() endfunction -function CreateSaveCodeAllResearchesTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllResearchesTextFileNewOpLimit)) // INLINED!! +function WoWReforgedSkillUI___AboutToSave takes nothing returns nothing + call DisableSkillUITriggers() + call WoWReforgedSkillUI___HideSkillUI() endfunction -function CreateSaveCodeAllResourcesTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= GetSaveCodeResources(whichPlayer) - local string content= "" +function WoWReforgedSkillUI___AfterSaving takes nothing returns nothing + call EnableSkillUITriggers() + call UpdateSkillPointsUIForAllPlayers() +endfunction - set content=content + " -loadres " + saveCode - set content=content + " " +function WoWReforgedSkillUI___Init takes nothing returns nothing + call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedSkillUI___syncTrigger , WoWReforgedSkillUI___PREFIX , false) + call TriggerAddCondition(WoWReforgedSkillUI___syncTrigger, Condition(function WoWReforgedSkillUI___TriggerConditionSync)) - call FileIO_Write(GetSaveCodeAllFileNameResourcesForPlayer(whichPlayer) , content) + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkillUI___selectionTrigger, EVENT_PLAYER_UNIT_SELECTED) + call TriggerAddCondition(WoWReforgedSkillUI___selectionTrigger, Condition(function WoWReforgedSkillUI___TriggerConditionSelected)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkillUI___deselectionTrigger, EVENT_PLAYER_UNIT_DESELECTED) + call TriggerAddCondition(WoWReforgedSkillUI___deselectionTrigger, Condition(function WoWReforgedSkillUI___TriggerConditionDeselected)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedSkillUI___loadTrigger, EVENT_PLAYER_UNIT_LOADED) + call TriggerAddCondition(WoWReforgedSkillUI___loadTrigger, Condition(function WoWReforgedSkillUI___TriggerConditioLoaded)) + + // leveling is done by UpdateSkillUIEvaluate + + call DisableSkillUITriggers() + + call TriggerAddAction(WoWReforgedSkillUI___tmpTrigger, function WoWReforgedSkillUI___TriggerActionUpdateSkillPointsUI) + + // Makes sure no events are triggered before the UI is restored after loading the game. + call TriggerAddAction(FrameLoader___actionTrigger, (function CreateAndEnableSkillUI)) // INLINED!! + //call FrameSaverAddEx(function AboutToSave, function AfterSaving) endfunction -function CreateSaveCodeAllResourcesTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllResourcesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) -endfunction -function CreateSaveCodeAllResourcesTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllResourcesTextFileNewOpLimit)) // INLINED!! -endfunction +//library WoWReforgedSkillUI ends +//library WoWReforgedUpdateBackpackUI: -function CreateSaveCodeAllClanTextFileEx takes player whichPlayer,string clanName returns nothing - local string saveCode= GetSaveCodeClan((udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))])) // INLINED!! - local string content= "" - - set content=content + " -clan " + clanName - set content=content + " -loadc " + saveCode - set content=content + " " - call FileIO_Write(GetSaveCodeAllFileNameClanForPlayer(whichPlayer) , content) +function WoWReforgedUpdateBackpackUI___TriggerActionUpdateBackpackUI takes nothing returns nothing + call UpdateItemsForBackpackUI(updateBackpackUIPlayer) endfunction -function CreateSaveCodeAllClanTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllClanTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer , WoWReforgedSaveCodesAll__tmpString) +function WoWReforgedUpdateBackpackUI___Init takes nothing returns nothing + call TriggerAddAction(updateBackpackUITrigger, function WoWReforgedUpdateBackpackUI___TriggerActionUpdateBackpackUI) endfunction -function CreateSaveCodeAllClanTextFile takes player whichPlayer,string clanName returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - set WoWReforgedSaveCodesAll__tmpString=clanName - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllClanTextFileNewOpLimit)) // INLINED!! -endfunction -function CreateSaveCodeAllTextFile takes player whichPlayer returns nothing - if ( WoWReforgedSaveCodesAll__loadedAllOnce[GetPlayerId(whichPlayer)] ) then - call CreateSaveCodeAllHeroesTextFile(whichPlayer) - //call BJDebugMsg("After heroes") - call CreateSaveCodeAllItemsTextFile(whichPlayer) - //call BJDebugMsg("After items") - call CreateSaveCodeAllUnitsTextFile(whichPlayer) - //call BJDebugMsg("After units") - call CreateSaveCodeAllBuildingsTextFile(whichPlayer) - //call BJDebugMsg("After buildings") - call CreateSaveCodeAllResearchesTextFile(whichPlayer) - //call BJDebugMsg("After researches") - call CreateSaveCodeAllResourcesTextFile(whichPlayer) - //call BJDebugMsg("After resources") - if ( (udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))]) > 0 ) then // INLINED!! - call CreateSaveCodeAllClanTextFile(whichPlayer , (udg_ClanName[((udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))]))])) // INLINED!! - endif - else - call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "At least load all savecodes once with \"-aload\" before saving it again or use \"-areset\" to overwrite your automatic savecode.") - endif -endfunction +//library WoWReforgedUpdateBackpackUI ends +//library WoWReforgedArmory: -function GetSaveCodeFromFile takes string s,string prefix,integer tokenIndex returns string - local integer index= 0 - local integer index2= 0 - local integer i= 0 + +function WoWReforgedArmory__AddEquipmentItemsToShop takes unit shop returns nothing + local integer i= 1 + local integer max= (WoWReforgedEquipment__equipmentTypesCounter) // INLINED!! + local string pageName= "" + //call BJDebugMsg("Before enabling shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + call EnablePagedButtons(shop) + call SetPagedButtonsSlotsPerPage(shop , 9) loop - set index=IndexOfStringEx(prefix , s , index2) - if ( index != - 1 ) then - set index2=IndexOfStringEx(" " , s , index + StringLength(prefix)) - if ( index2 != - 1 and tokenIndex == i ) then - return SubString(s, index + StringLength(prefix), index2) - endif + exitwhen ( i >= max ) + if ( i > 1 and (WoWReforgedEquipment__equipmentItemTypeCategoryName[(i)]) != "" and (WoWReforgedEquipment__equipmentItemTypeCategoryName[(i)]) != null and (WoWReforgedEquipment__equipmentItemTypeCategoryName[(i)]) != pageName ) then // INLINED!! + call AddPagedButtonsSpacersRemaining(shop) endif - exitwhen ( index == - 1 or index2 == - 1 ) - set i=i + 1 - endloop - return null -endfunction - -// TODO Create hero and apply settings before. -function LoadSaveCodeAllHeroes takes player whichPlayer,string allSaveCodes returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string saveCode= GetSaveCodeFromFile(allSaveCodes , "-load " , 0) - if ( saveCode != null ) then - if ( TimerGetRemaining(udg_SaveCodeCooldownHeroTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then - if ( ApplySaveCode(whichPlayer , saveCode) ) then - call StartTimerBJ(udg_SaveCodeCooldownHeroTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownHeroes) - endif - else - call SimError(whichPlayer , "You can load another savecode for heroes in: " + FormatTimeString(R2I(TimerGetRemaining(udg_SaveCodeCooldownHeroTimer[GetConvertedPlayerId(whichPlayer)]))) + ".") +call AddPagedButtonsId((shop ) , ( (WoWReforgedEquipment__equipmentItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + if ( (WoWReforgedEquipment__equipmentItemTypeCategoryName[(i)]) != "" and (WoWReforgedEquipment__equipmentItemTypeCategoryName[(i)]) != null ) then // INLINED!! + set pageName=(WoWReforgedEquipment__equipmentItemTypeCategoryName[(i)]) // INLINED!! + call SetPagedButtonsCurrentPageName(shop , pageName) endif - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded savecodes.") - else - call SimError(whichPlayer , "Missing savecode with \"-load \" in file: " + allSaveCodes) - endif -endfunction - -function LoadSaveCodeAllItems takes player whichPlayer,string allSaveCodes returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string saveCode= null - local integer i= 0 - loop - set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadi " , i) - exitwhen ( saveCode == null ) - call ApplySaveCodeItems(whichPlayer , saveCode) set i=i + 1 endloop - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded item savecodes.") -endfunction - -function LoadSaveCodeAllUnits takes player whichPlayer,string allSaveCodes returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string saveCode= null - local integer i= 0 - if ( TimerGetRemaining(udg_SaveCodeCooldownUnitsTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then - set i=0 - loop - set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadu " , i) - exitwhen ( saveCode == null ) - call ApplySaveCodeUnits(whichPlayer , saveCode) - set i=i + 1 - endloop - call StartTimerBJ(udg_SaveCodeCooldownUnitsTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) - endif - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded unit savecodes.") + + //call BJDebugMsg("Before enabling paged buttons for shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") + + //call BJDebugMsg("Enabled shop " + GetUnitName(shop) + " with " + I2S(max) + " total learnable skills.") endfunction -function LoadSaveCodeAllBuildings takes player whichPlayer,string allSaveCodes returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string saveCode= null - local integer i= 0 - if ( TimerGetRemaining(udg_SaveCodeCooldownBuildingsTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then - set i=0 - loop - set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadb " , i) - exitwhen ( saveCode == null ) - call ApplySaveCodeBuildings(whichPlayer , saveCode) - set i=i + 1 - endloop - call StartTimerBJ(udg_SaveCodeCooldownBuildingsTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) - endif - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded building savecodes.") +function IsArmory takes integer unitTypeId returns boolean + return unitTypeId == ARMORY or unitTypeId == ARMORY_NEUTRAL endfunction -function LoadSaveCodeAllResearches takes player whichPlayer,string allSaveCodes returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string saveCode= null - local integer i= 0 - if ( TimerGetRemaining(udg_SaveCodeCooldownResearchesTime[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then - set i=0 - loop - set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadr " , i) - exitwhen ( saveCode == null ) - call ApplySaveCodeResearches(whichPlayer , saveCode) - set i=i + 1 - endloop - call StartTimerBJ(udg_SaveCodeCooldownResearchesTime[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) - endif - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded research savecodes.") +function IsUnitArmory takes unit whichUnit returns boolean + return IsArmory(GetUnitTypeId(whichUnit)) endfunction -function LoadSaveCodeAllResources takes player whichPlayer,string allSaveCodes returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string saveCode= GetSaveCodeFromFile(allSaveCodes , "-loadres " , 0) - local integer i= 0 - if ( saveCode != null ) then - if ( TimerGetRemaining(udg_SaveCodeCooldownResourcesTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then - if ( ApplySaveCodeResources(whichPlayer , saveCode) ) then - call StartTimerBJ(udg_SaveCodeCooldownResourcesTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded resources savecodes.") - endif - else - call SimError(whichPlayer , "You can load another savecode for resources in: " + FormatTimeString(R2I(TimerGetRemaining(udg_SaveCodeCooldownResourcesTimer[GetConvertedPlayerId(whichPlayer)]))) + ".") - endif - else - call SimError(whichPlayer , "Missing savecode with \"-loadres \" in file: " + allSaveCodes) - endif +function WoWReforgedArmory__TriggerConditionSellItem takes nothing returns boolean + return (IsArmory(GetUnitTypeId((GetTriggerUnit())))) // INLINED!! endfunction -function LoadSaveCodeAllClan takes player whichPlayer,string allSaveCodes returns nothing - local integer playerId= GetPlayerId(whichPlayer) - local string saveCode= GetSaveCodeFromFile(allSaveCodes , "-loadc " , 0) - local string clanName= GetSaveCodeFromFile(allSaveCodes , "-clan " , 0) - - if ( saveCode != null ) then - if ( TimerGetRemaining(udg_SaveCodeCooldownClanTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then - if ( ApplySaveCodeClan(whichPlayer , clanName , saveCode) ) then - call StartTimerBJ(udg_SaveCodeCooldownClanTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) - - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded clan savecodes.") - endif - else - call SimError(whichPlayer , "You can load another savecode for clan in: " + FormatTimeString(R2I(TimerGetRemaining(udg_SaveCodeCooldownClanTimer[GetConvertedPlayerId(whichPlayer)]))) + ".") +function WoWReforgedArmory__TriggerAction1SellItem takes nothing returns nothing + local unit hero= GetBuyingUnit() + local player owner= GetOwningPlayer(hero) + local integer unitTypeId= GetUnitTypeId(hero) + local integer itemTypeId= GetItemTypeId(GetSoldItem()) + local integer index= GetEquipmentItemTypeByItemTypeId(itemTypeId) + if ( index != 0 ) then + if ( not IsCustomizableAttributesHero(unitTypeId) ) then + call RefundItem(GetSoldItem() , owner) + call SimError(owner , "Only customizable heroes can use equipment items.") endif - else - call SimError(whichPlayer , "Missing savecode with \"-loadc \" in file: " + allSaveCodes) + //else + //call BJDebugMsg("No matching learnable skill for item " + GetItemName(GetSoldItem())) endif + set hero=null + set owner=null endfunction -function GetSaveCodeAllTextFile takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local integer playerId= GetPlayerId(whichPlayer) - local string fileNameHeroes= GetSaveCodeAllFileNameForPlayer(whichPlayer) - local string fileNameItems= GetSaveCodeAllFileNameItemsForPlayer(whichPlayer) - local string fileNameUnits= GetSaveCodeAllFileNameUnitsForPlayer(whichPlayer) - local string fileNameBuildings= GetSaveCodeAllFileNameBuildingsForPlayer(whichPlayer) - local string fileNameResearches= GetSaveCodeAllFileNameResearchesForPlayer(whichPlayer) - local string fileNameResources= GetSaveCodeAllFileNameResourcesForPlayer(whichPlayer) - local string fileNameClan= GetSaveCodeAllFileNameClanForPlayer(whichPlayer) - local string fileContent= null - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loading your character from file " + fileNameHeroes + ".") - if ( GetLocalPlayer() == whichPlayer ) then - set fileContent=(s__File_readEx(s__File_open((fileNameHeroes)),true)) // INLINED!! - //call BJDebugMsg("File content: " + fileContent) - if ( fileContent != null ) then - call BlzSendSyncData("SaveCodeAllHeroes", fileContent) - else - call BlzSendSyncData("SaveCodeAllHeroes", "missing") - endif - - set fileContent=(s__File_readEx(s__File_open((fileNameItems)),true)) // INLINED!! - //call BJDebugMsg("File content: " + fileContent) - if ( fileContent != null ) then - call BlzSendSyncData("SaveCodeAllItems", fileContent) - else - call BlzSendSyncData("SaveCodeAllItems", "missing") - endif - - set fileContent=(s__File_readEx(s__File_open((fileNameUnits)),true)) // INLINED!! - //call BJDebugMsg("File content: " + fileContent) - if ( fileContent != null ) then - call BlzSendSyncData("SaveCodeAllUnits", fileContent) - else - call BlzSendSyncData("SaveCodeAllUnits", "missing") - endif - - set fileContent=(s__File_readEx(s__File_open((fileNameBuildings)),true)) // INLINED!! - //call BJDebugMsg("File content: " + fileContent) - if ( fileContent != null ) then - call BlzSendSyncData("SaveCodeAllBuildings", fileContent) - else - call BlzSendSyncData("SaveCodeAllBuildings", "missing") - endif - - set fileContent=(s__File_readEx(s__File_open((fileNameResearches)),true)) // INLINED!! - //call BJDebugMsg("File content: " + fileContent) - if ( fileContent != null ) then - call BlzSendSyncData("SaveCodeAllResearches", fileContent) - else - call BlzSendSyncData("SaveCodeAllResearches", "missing") - endif - - set fileContent=(s__File_readEx(s__File_open((fileNameResources)),true)) // INLINED!! - //call BJDebugMsg("File content: " + fileContent) - if ( fileContent != null ) then - call BlzSendSyncData("SaveCodeAllResources", fileContent) - else - call BlzSendSyncData("SaveCodeAllResources", "missing") - endif - - set fileContent=(s__File_readEx(s__File_open((fileNameClan)),true)) // INLINED!! - //call BJDebugMsg("File content: " + fileContent) - if ( fileContent != null ) then - call BlzSendSyncData("SaveCodeAllClan", fileContent) - else - call BlzSendSyncData("SaveCodeAllClan", "missing") - endif +function WoWReforgedArmory__TriggerConditionConstructed takes nothing returns boolean + if ( (IsArmory(GetUnitTypeId((GetTriggerUnit())))) ) then // INLINED!! + call WoWReforgedArmory__AddEquipmentItemsToShop(GetConstructedStructure()) endif + return false endfunction -function WoWReforgedSaveCodesAll__TriggerConditionSync takes nothing returns boolean - local player triggerPlayer= GetTriggerPlayer() - local integer playerId= GetPlayerId(triggerPlayer) - local string prefix= BlzGetTriggerSyncPrefix() - local string data= BlzGetTriggerSyncData() - if ( prefix == "SaveCodeAllHeroes" ) then - set WoWReforgedSaveCodesAll__loadedAllOnce[playerId]=true - //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) - if ( data == "missing" ) then - call SimError(triggerPlayer , "Missing heroes savecode file.") - else - call LoadSaveCodeAllHeroes(triggerPlayer , data) - endif - elseif ( prefix == "SaveCodeAllItems" ) then - //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) - if ( data == "missing" ) then - call SimError(triggerPlayer , "Missing items savecode file.") - else - call LoadSaveCodeAllItems(triggerPlayer , data) - endif - elseif ( prefix == "SaveCodeAllUnits" ) then - //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) - if ( data == "missing" ) then - call SimError(triggerPlayer , "Missing units savecode file.") - else - call LoadSaveCodeAllUnits(triggerPlayer , data) - endif - elseif ( prefix == "SaveCodeAllBuildings" ) then - //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) - if ( data == "missing" ) then - call SimError(triggerPlayer , "Missing buildings savecode file.") - else - call LoadSaveCodeAllBuildings(triggerPlayer , data) - endif - elseif ( prefix == "SaveCodeAllResearches" ) then - //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) - if ( data == "missing" ) then - call SimError(triggerPlayer , "Missing researches savecode file.") - else - call LoadSaveCodeAllResearches(triggerPlayer , data) - endif - elseif ( prefix == "SaveCodeAllResources" ) then - //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) - if ( data == "missing" ) then - call SimError(triggerPlayer , "Missing resources savecode file.") - else - call LoadSaveCodeAllResources(triggerPlayer , data) - endif - elseif ( prefix == "SaveCodeAllClan" ) then - //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) - if ( data == "missing" ) then - call SimError(triggerPlayer , "Missing clan savecode file.") - else - call LoadSaveCodeAllClan(triggerPlayer , data) - endif +function WoWReforgedArmory__TriggerConditionSummoned takes nothing returns boolean + if ( (IsArmory(GetUnitTypeId((GetSummonedUnit())))) ) then // INLINED!! + call WoWReforgedArmory__AddEquipmentItemsToShop(GetSummonedUnit()) endif - set triggerPlayer=null return false endfunction -function WoWReforgedSaveCodesAll__Init takes nothing returns nothing - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - call TriggerRegisterPlayerEvent(WoWReforgedSaveCodesAll__syncTrigger, Player(i), EVENT_PLAYER_SYNC_DATA) - set i=i + 1 - endloop - call TriggerAddCondition(WoWReforgedSaveCodesAll__syncTrigger, Condition(function WoWReforgedSaveCodesAll__TriggerConditionSync)) +function WoWReforgedArmory__ForGroupEnableArmory takes nothing returns nothing + call WoWReforgedArmory__AddEquipmentItemsToShop(GetEnumUnit()) endfunction - -//library WoWReforgedSaveCodesAll ends -//library WoWReforgedStartLocations: - - -function GetMaxStartLocations takes nothing returns integer - return WoWReforgedStartLocations__startLocationsCounter +function WoWReforgedArmory__FilterBuilding takes nothing returns boolean + return (IsArmory(GetUnitTypeId((GetFilterUnit())))) // INLINED!! endfunction -function AddStartLocation takes integer itemTypeId,real x,real y,real facing,boolean isClanArea returns integer - local integer index= WoWReforgedStartLocations__startLocationsCounter - set WoWReforgedStartLocations__startLocationsItemTypeIds[index]=itemTypeId - set WoWReforgedStartLocations__startLocationsX[index]=x - set WoWReforgedStartLocations__startLocationsY[index]=y - set WoWReforgedStartLocations__startLocationsFacing[index]=facing - set WoWReforgedStartLocations__startLocationsIsClanArea[index]=isClanArea - set WoWReforgedStartLocations__startLocationsCounter=WoWReforgedStartLocations__startLocationsCounter + 1 +function WoWReforgedArmory__UpdateAllShops takes nothing returns nothing + local group g= CreateGroup() - return index + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedArmory__FilterBuilding)) + call ForGroup(g, function WoWReforgedArmory__ForGroupEnableArmory) + + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) endfunction -function AddWoWReforgedStartLocation takes nothing returns integer - local integer startLocation= AddStartLocation(udg_TmpItemTypeId , GetRectCenterX(udg_TmpRect) , GetRectCenterY(udg_TmpRect) , udg_TmpReal , udg_TmpBoolean) - set udg_TmpBoolean=false - return startLocation +function WoWReforgedArmory__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmory__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedArmory__sellTrigger, Condition(function WoWReforgedArmory__TriggerConditionSellItem)) + call TriggerAddAction(WoWReforgedArmory__sellTrigger, function WoWReforgedArmory__TriggerAction1SellItem) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmory__constructionTrigger, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH) + call TriggerAddCondition(WoWReforgedArmory__constructionTrigger, Condition(function WoWReforgedArmory__TriggerConditionConstructed)) + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedArmory__summonTrigger, EVENT_PLAYER_UNIT_SUMMON) + call TriggerAddCondition(WoWReforgedArmory__summonTrigger, Condition(function WoWReforgedArmory__TriggerConditionSummoned)) + + call TimerStart(CreateTimer(), 2.0, false, function WoWReforgedArmory__UpdateAllShops) endfunction -function GetStartLocationItemTypeId takes integer startLocation returns integer - return WoWReforgedStartLocations__startLocationsItemTypeIds[startLocation] -endfunction -function GetStartLocationIsClanArea takes integer startLocation returns boolean - return WoWReforgedStartLocations__startLocationsIsClanArea[startLocation] -endfunction +//library WoWReforgedArmory ends +//library WoWReforgedCheatsSaveCodes: -function GetStartLocationName takes integer startLocation returns string - return GetObjectName((WoWReforgedStartLocations__startLocationsItemTypeIds[(startLocation)])) // INLINED!! -endfunction +// Generated Save Codes -function MoveUnitToStartLocation takes unit whichUnit,integer startLocation returns nothing - call SetUnitX(whichUnit, WoWReforgedStartLocations__startLocationsX[startLocation]) - call SetUnitY(whichUnit, WoWReforgedStartLocations__startLocationsY[startLocation]) - call SetUnitFacing(whichUnit, WoWReforgedStartLocations__startLocationsFacing[startLocation]) +function GetSaveCodeStrong takes string playerName,boolean singlePlayer,boolean warlord,integer xpRate returns string + return GetSaveCodeEx(GetTriggerPlayer() , playerName , singlePlayer , warlord , udg_GameTypeNormal , xpRate , 1000 , 50049900 , 800000 , 800000 , 1000 , 100 , 100 , 100 , 100 , 8000 , 0 , 20000 , 0 , 20000 , 5000 , 1000 , 50049900 , 1000 , 50049900 , 100 , 100 , 2 , 3) endfunction -function GetStartLocationByItemTypeId takes integer itemTypeId returns integer - local integer i= 0 - local integer max= (WoWReforgedStartLocations__startLocationsCounter) // INLINED!! - loop - exitwhen ( i == max ) - if ( itemTypeId == (WoWReforgedStartLocations__startLocationsItemTypeIds[(i)]) ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 +function GetSaveCodeNormal takes string playerName,boolean singlePlayer,boolean warlord,integer xpRate returns string + return GetSaveCodeEx(GetTriggerPlayer() , playerName , singlePlayer , warlord , udg_GameTypeNormal , xpRate , 30 , 50000 , 100000 , 100000 , 20 , 20 , 20 , 20 , 20 , 30 , 0 , 2000 , 0 , 800 , 10 , 30 , 50000 , 30 , 50000 , 20 , 20 , 0 , 2) endfunction -function PlayerCanBuyStartLocationEx takes player whichPlayer,integer itemTypeId returns boolean - local integer index= GetStartLocationByItemTypeId(itemTypeId) - if ( index >= 0 ) then - return not (WoWReforgedStartLocations__startLocationsIsClanArea[(index)]) or (IsPlayerInForce((whichPlayer), prestoredElvenClanMembers)) // INLINED!! - endif - return false +function ForGroupRemoveUnit takes nothing returns nothing + call h__RemoveUnit(GetEnumUnit()) endfunction +function GetSaveCodeBase takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord returns string + local location tmpLocation= Location(0.0, 0.0) + local group allBuildings= CreateGroup() + local string result + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'htow', GetRectCenterX(gg_rct_Save_Code_Town_Hall), GetRectCenterY(gg_rct_Save_Code_Town_Hall), bj_UNIT_FACING)) + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hgtw', GetRectCenterX(gg_rct_Save_Code_Guard_Tower_1), GetRectCenterY(gg_rct_Save_Code_Guard_Tower_1), bj_UNIT_FACING)) + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hgtw', GetRectCenterX(gg_rct_Save_Code_Guard_Tower_2), GetRectCenterY(gg_rct_Save_Code_Guard_Tower_2), bj_UNIT_FACING)) + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'halt', GetRectCenterX(gg_rct_Save_Code_Altar), GetRectCenterY(gg_rct_Save_Code_Altar), bj_UNIT_FACING)) + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hlum', GetRectCenterX(gg_rct_Save_Code_Lumber_Mill), GetRectCenterY(gg_rct_Save_Code_Lumber_Mill), bj_UNIT_FACING)) + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hvlt', GetRectCenterX(gg_rct_Save_Code_Arcane_Vault), GetRectCenterY(gg_rct_Save_Code_Arcane_Vault), bj_UNIT_FACING)) + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'harm', GetRectCenterX(gg_rct_Save_Code_Workshop), GetRectCenterY(gg_rct_Save_Code_Workshop), bj_UNIT_FACING)) + call GroupAddUnit(allBuildings, CreateUnit(whichPlayer, 'hbar', GetRectCenterX(gg_rct_Save_Code_Barracks), GetRectCenterY(gg_rct_Save_Code_Barracks), bj_UNIT_FACING)) -//library WoWReforgedStartLocations ends -//library WoWReforgedWebsite: - + set result=GetSaveCodeBuildingsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer , allBuildings) + call ForGroupBJ(allBuildings, function ForGroupRemoveUnit) + call GroupClear(allBuildings) + call DestroyGroup(allBuildings) + set allBuildings=null + call RemoveLocation(tmpLocation) + set tmpLocation=null -function WoWReforgedWebsite__CreateTmpUnit takes integer unitTypeId returns unit - local unit whichUnit= CreateUnit(Player(0), unitTypeId, 0.0, 0.0, 0.0) - - call SetUnitLifePercentBJ(whichUnit, 100.0) - call SetUnitManaPercentBJ(whichUnit, 100.0) - - return whichUnit + return result endfunction -function WoWReforgedWebsite__StringReplaceNewOpLimit takes nothing returns nothing - set WoWReforgedWebsite__tmpResult=StringReplace(WoWReforgedWebsite__tmpSource , WoWReforgedWebsite__tmpMatch , WoWReforgedWebsite__tmpReplacement) -endfunction +function CreateAllDragons takes player whichPlayer returns group + local location tmpLocation= Location(0.0, 0.0) + local group allDragons= CreateGroup() + call GroupAddGroup(CreateNUnitsAtLoc(10, 'nrwm', whichPlayer, tmpLocation, 0.0), allDragons) + call GroupAddGroup(CreateNUnitsAtLoc(10, 'ngrd', whichPlayer, tmpLocation, 0.0), allDragons) + call GroupAddGroup(CreateNUnitsAtLoc(10, 'nbwm', whichPlayer, tmpLocation, 0.0), allDragons) + call GroupAddGroup(CreateNUnitsAtLoc(10, 'nadr', whichPlayer, tmpLocation, 0.0), allDragons) + call GroupAddGroup(CreateNUnitsAtLoc(10, 'nbzd', whichPlayer, tmpLocation, 0.0), allDragons) + call GroupAddGroup(CreateNUnitsAtLoc(10, 'nndr', whichPlayer, tmpLocation, 0.0), allDragons) -function WoWReforgedWebsite__StringReplaceLong takes string source,string match,string replacement returns string - set WoWReforgedWebsite__tmpSource=source - set WoWReforgedWebsite__tmpMatch=match - set WoWReforgedWebsite__tmpReplacement=replacement - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__StringReplaceNewOpLimit)) // INLINED!! - return WoWReforgedWebsite__tmpResult -endfunction + call RemoveLocation(tmpLocation) + set tmpLocation=null -function WoWReforgedWebsite__FormatTooltipTokenEx takes string token returns nothing - local string result= "" - local integer i= 0 - local string subString= "" - local boolean isInColor= false - local integer colorCounter= 0 - local integer max= StringLength(token) - loop - exitwhen ( i >= max ) - set subString=SubString(token, i, i + 1) - if ( subString == "<" or subString == ">" ) then - set i=i + 1 - // prevents the string from getting too long for Warcraft III strings and to be cut off: - elseif ( subString == " " and StringLength(result) >= 50 ) then - call Preload((result + subString)) // INLINED!! - set result="" - set i=i + 1 - elseif ( StringStartsWith(SubString(token, i, i + 2) , "|c") ) then - set result=result + "
" - set i=i + 2 - set isInColor=false - set colorCounter=0 - else - set result=result + SubString(token, i, i + 1) - set i=i + 1 - if ( isInColor ) then - set colorCounter=colorCounter + 1 - if ( colorCounter >= 6 ) then - set result=result + "\">" - set isInColor=false - set colorCounter=0 - endif - endif - endif - endloop - - if ( StringLength(result) > 0 ) then - call Preload((result)) // INLINED!! - set result="" - endif + return allDragons endfunction -function WoWReforgedWebsite__FormatTokenNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__FormatTooltipTokenEx(WoWReforgedWebsite__tmpSource) -endfunction +function GetSaveCodeDragonUnits takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord returns string + local location tmpLocation= Location(0.0, 0.0) + local group allDragons= CreateAllDragons(whichPlayer) + local group allDragonsDistinct= DistinctGroup(allDragons) + local string result= GetSaveCodeUnitsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer , allDragonsDistinct) -function WoWReforgedWebsite__FormatToken takes string source returns nothing - set WoWReforgedWebsite__tmpSource=source - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__FormatTokenNewOpLimit)) // INLINED!! -endfunction + call ForGroupBJ(allDragons, function ForGroupRemoveUnit) -function WoWReforgedWebsite__FormatTooltip takes string tooltip returns nothing - // there can be multiple line breaks without any content - local integer max= StringCount(tooltip , "|n") + 1 - local integer index= 0 - loop - exitwhen ( index >= max ) - - if ( index > 0 ) then - call Preload(("
")) // INLINED!! - endif - - call WoWReforgedWebsite__FormatToken(StringSplit(tooltip , index , "|n")) - set index=index + 1 - endloop -endfunction + call GroupClear(allDragons) + call DestroyGroup(allDragons) + set allDragons=null -function WoWReforgedWebsite__R2SHtml takes real r returns string - return R2SW(r, 1, 2) -endfunction + call GroupClear(allDragonsDistinct) + call DestroyGroup(allDragonsDistinct) + set allDragonsDistinct=null -function WoWReforgedWebsite__IconPath takes string iconPath returns string - set iconPath=StringReplace(iconPath , "\\" , "/") - set iconPath=StringReplace(iconPath , "#" , "") - return iconPath -endfunction + call RemoveLocation(tmpLocation) + set tmpLocation=null -function WoWReforgedWebsite__Icon takes string id,string file,string name,string iconPath returns nothing - local string path= WoWReforgedWebsite__IconPath(iconPath) - local string href= file + "#" + id - call Preload(("")) // INLINED!! + return result endfunction -function WoWReforgedWebsite__GetIconPath takes integer objectTypeId returns string - return WoWReforgedWebsite__IconPath(BlzGetAbilityIcon(objectTypeId)) -endfunction +function GetSaveCodeGoodItems takes string playerName,boolean singlePlayer,boolean warlord returns string + local item item0= CreateItem('gcel', 0.0, 0.0) + local item item1= CreateItem('pnvu', 0.0, 0.0) + local item item2= CreateItem('sres', 0.0, 0.0) + local item item3= CreateItem('ankh', 0.0, 0.0) + local item item4= CreateItem('whwd', 0.0, 0.0) + local item item5= CreateItem('hlst', 0.0, 0.0) + local string result -function WoWReforgedWebsite__IconButton takes integer objectTypeId returns nothing - local string path= (WoWReforgedWebsite__IconPath(BlzGetAbilityIcon((objectTypeId)))) // INLINED!! - local string name= GetObjectName(objectTypeId) - call Preload(("")) // INLINED!! -endfunction + call SetItemCharges(item0, 100) + call SetItemCharges(item1, 100) + call SetItemCharges(item2, 100) + call SetItemCharges(item3, 100) + call SetItemCharges(item4, 100) + call SetItemCharges(item5, 100) -function WoWReforgedWebsite__IconToHtmlEx4 takes string path,string file,string name,string id returns nothing - local string href= file + "#" + id - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! -endfunction + set result=GetSaveCodeItemsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , item0 , item1 , item2 , item3 , item4 , item5) -function WoWReforgedWebsite__IconToHtmlEx3 takes string path,string file,string name returns nothing - local string href= file + "#" + name - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! -endfunction + call h__RemoveItem(item0) + set item0=null -function WoWReforgedWebsite__IconToHtmlEx2 takes integer objectTypeId,string file,string name returns nothing - local string path= (WoWReforgedWebsite__IconPath(BlzGetAbilityIcon((objectTypeId)))) // INLINED!! - local string href= file + "#" + A2S(objectTypeId) - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! -endfunction + call h__RemoveItem(item1) + set item1=null -function WoWReforgedWebsite__IconToHtmlEx takes integer objectTypeId,string file returns nothing - call WoWReforgedWebsite__IconToHtmlEx2(objectTypeId , file , GetObjectName(objectTypeId)) -endfunction + call h__RemoveItem(item2) + set item2=null -function WoWReforgedWebsite__IconToHtml takes integer objectTypeId returns nothing - call WoWReforgedWebsite__IconToHtmlEx(objectTypeId , "") -endfunction + call h__RemoveItem(item3) + set item3=null -function WoWReforgedWebsite__ColumnDataOrder takes string order,string search returns string - local string txt= " 0 ) then - set txt=txt + " data-order=\"" + order + "\"" - endif - if ( search != null and StringLength(search) > 0 ) then - set txt=txt + " data-search=\"" + search + "\"" - endif - set txt=txt + ">" - - return txt -endfunction + call h__RemoveItem(item4) + set item4=null -function WoWReforgedWebsite__GenerateGoldIcon takes nothing returns nothing - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! -endfunction + call h__RemoveItem(item5) + set item5=null -function WoWReforgedWebsite__GenerateLumberIcon takes nothing returns nothing - call Preload(("\"images/WC3lumber.webp\"")) // INLINED!! + return result endfunction -function WoWReforgedWebsite__GenerateFoodIcon takes nothing returns nothing - call Preload(("\"images/WC3food.webp\"")) // INLINED!! -endfunction +function GetSaveCodeHumanUpgrades takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord returns string + local integer ironForgedSwordsLevel= GetPlayerTechCountSimple('Rhme', whichPlayer) + local string result -function WoWReforgedWebsite__GenerateUnitTypeIdGoldCostPopover takes integer unitTypeId returns nothing - local integer goldCost= 0 - if ( not IsUnitIdType(unitTypeId, UNIT_TYPE_HERO) ) then - set goldCost=GetUnitGoldCost(unitTypeId) // crash for heroes - endif - if ( goldCost > 0 ) then - call Preload((I2S(goldCost))) // INLINED!! - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! - endif -endfunction + call h__SetPlayerTechResearched(whichPlayer, 'Rhme', 3) -function WoWReforgedWebsite__GenerateUnitTypeIdGoldCost takes integer unitTypeId returns nothing - local integer goldCost= 0 - if ( not IsUnitIdType(unitTypeId, UNIT_TYPE_HERO) ) then - set goldCost=GetUnitGoldCost(unitTypeId) // crash for heroes - endif - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(goldCost) , I2S(goldCost)))) // INLINED!! - if ( goldCost > 0 ) then - call Preload((I2S(goldCost))) // INLINED!! - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! + set result=GetSaveCodeResearchesEx(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer) + + call h__SetPlayerTechResearched(whichPlayer, 'Rhme', ironForgedSwordsLevel) + + return result endfunction -function WoWReforgedWebsite__GenerateUnitTypeIdLumberCostPopover takes integer unitTypeId returns nothing - local integer lumberCost= 0 - if ( not IsUnitIdType(unitTypeId, UNIT_TYPE_HERO) ) then - set lumberCost=GetUnitWoodCost(unitTypeId) // crash for heroes - endif - if ( lumberCost > 0 ) then - call Preload((I2S(lumberCost))) // INLINED!! - call Preload(("\"images/WC3lumber.webp\"")) // INLINED!! - endif +function GetSaveCodeTheElvenClan takes boolean singlePlayer,string playerName returns string + // there seems to be an issue if we pass these values directly as literals + local integer clanIcon= 0 + local integer gold= 40000 + local integer lumber= 40000 + return GetSaveCodeClanEx(singlePlayer , "TheElvenClan" , clanIcon , (udg_ClanSound[(1)]) , gold , lumber , true , 10 , 10 , playerName , udg_ClanRankLeader , "WorldEdit" , udg_ClanRankLeader , "Barade#2569" , udg_ClanRankLeader , "Runeblade14#2451" , udg_ClanRankCaptain , "AntiDenseMan#1202" , udg_ClanRankCaptain , "Chaoskrieger#21738" , udg_ClanRankCaptain , "" , 0 , 5) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateUnitTypeIdLumberCost takes integer unitTypeId returns nothing - local integer lumberCost= 0 - if ( not IsUnitIdType(unitTypeId, UNIT_TYPE_HERO) ) then - set lumberCost=GetUnitWoodCost(unitTypeId) // crash for heroes - endif - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(lumberCost) , I2S(lumberCost)))) // INLINED!! - if ( lumberCost > 0 ) then - call Preload((I2S(lumberCost))) // INLINED!! - call Preload(("\"images/WC3lumber.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! + +function GenerateSaveCode takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord,integer xpRate returns nothing + call GetSaveCodeStrong(playerName , singlePlayer , warlord , xpRate) + call GetSaveCodeNormal(playerName , singlePlayer , warlord , xpRate) + call GetSaveCodeBase(whichPlayer , playerName , singlePlayer , warlord) + call GetSaveCodeDragonUnits(whichPlayer , playerName , singlePlayer , warlord) + call GetSaveCodeGoodItems(playerName , singlePlayer , warlord) + call GetSaveCodeHumanUpgrades(whichPlayer , playerName , singlePlayer , warlord) + call GetSaveCodeLetter(playerName , "all" , "Hello citizens!") endfunction -function WoWReforgedWebsite__GenerateUnitTypeIdFoodCostPopover takes integer unitTypeId returns nothing - local integer foodCost= GetFoodUsed(unitTypeId) - if ( foodCost > 0 ) then - call Preload((I2S(foodCost))) // INLINED!! - call Preload(("\"images/WC3food.webp\"")) // INLINED!! - endif +function GenerateSaveCodeNewOpLimit takes nothing returns nothing + call GenerateSaveCode(WoWReforgedCheatsSaveCodes___generateSaveCodePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodePlayerName , WoWReforgedCheatsSaveCodes___generateSaveCodeSinglePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodeWarlord , WoWReforgedCheatsSaveCodes___generateSaveCodeXpRate) endfunction -function WoWReforgedWebsite__GenerateUnitTypeIdFoodCost takes integer unitTypeId returns nothing - local integer foodCost= GetFoodUsed(unitTypeId) - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(foodCost) , I2S(foodCost)))) // INLINED!! - if ( foodCost > 0 ) then - call Preload((I2S(foodCost))) // INLINED!! - call Preload(("\"images/WC3food.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! +function GetSaveCodeTheElvenClanNewOpLimit takes nothing returns nothing + call h__BJDebugMsg("Generating savecodes for TheElvenClan") + call GetSaveCodeTheElvenClan(WoWReforgedCheatsSaveCodes___generateSaveCodeClanSinglePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodeClanPlayerName) + call h__BJDebugMsg("Done generating savecodes for TheElvenClan") endfunction -function WoWReforgedWebsite__GenerateUnitTypeIdFoodMadePopover takes integer unitTypeId returns nothing - local integer foodMade= GetFoodMade(unitTypeId) - if ( foodMade > 0 ) then - call Preload((I2S(foodMade))) // INLINED!! - call Preload(("\"images/WC3food.webp\"")) // INLINED!! - endif +function GenerateSaveCodes takes player whichPlayer returns nothing + local integer playerNameSize= 2 + local string array playerName + local integer singlePlayerSize= 2 + local boolean array singlePlayer + local integer warlordSize= 2 + local boolean array warlord + local integer xpRate= 100 + local integer i= 0 + local integer j= 0 + local integer k= 0 + set playerName[0]="Barade#2569" + set playerName[1]="WorldEdit" + set singlePlayer[0]=true + set singlePlayer[1]=false + set warlord[0]=true + set warlord[1]=false + set i=0 + loop + exitwhen ( i >= playerNameSize ) + set j=0 + loop + exitwhen ( j >= singlePlayerSize ) + set k=0 + loop + exitwhen ( k >= warlordSize ) + if ( not warlord[k] ) then + set xpRate=130 + else + set xpRate=100 + endif + call h__BJDebugMsg("Generating savecodes for player name " + playerName[i]) + if ( singlePlayer[j] ) then + call h__BJDebugMsg("Singleplayer") + else + call h__BJDebugMsg("Multiplayer") + endif + if ( warlord[k] ) then + call h__BJDebugMsg("Warlord") + else + call h__BJDebugMsg("Freelancer") + endif + + set WoWReforgedCheatsSaveCodes___generateSaveCodePlayer=whichPlayer + set WoWReforgedCheatsSaveCodes___generateSaveCodePlayerName=playerName[i] + set WoWReforgedCheatsSaveCodes___generateSaveCodeSinglePlayer=singlePlayer[j] + set WoWReforgedCheatsSaveCodes___generateSaveCodeWarlord=warlord[k] + set WoWReforgedCheatsSaveCodes___generateSaveCodeXpRate=xpRate + call ForForce(bj_FORCE_PLAYER[0], (function GenerateSaveCodeNewOpLimit)) // INLINED!! + set k=k + 1 + endloop + call h__BJDebugMsg("Clan Save Code") + set WoWReforgedCheatsSaveCodes___generateSaveCodeClanSinglePlayer=singlePlayer[j] + set WoWReforgedCheatsSaveCodes___generateSaveCodeClanPlayerName=playerName[i] + call ForForce(bj_FORCE_PLAYER[0], (function GetSaveCodeTheElvenClanNewOpLimit)) // INLINED!! + call h__BJDebugMsg("After Generating Clan Save Code") + set j=j + 1 + endloop + set i=i + 1 + endloop endfunction -function WoWReforgedWebsite__GenerateUnitTypeIdFoodMade takes integer unitTypeId returns nothing - local integer foodMade= GetFoodMade(unitTypeId) - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(foodMade) , I2S(foodMade)))) // INLINED!! - if ( foodMade > 0 ) then - call Preload((I2S(foodMade))) // INLINED!! - call Preload(("\"images/WC3food.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! -endfunction -function WoWReforgedWebsite__GenerateItemTypeIdGoldCost takes integer itemTypeId returns nothing - local integer goldCost= GetItemValueGold(itemTypeId) - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(goldCost) , I2S(goldCost)))) // INLINED!! - if ( goldCost > 0 ) then - call Preload((I2S(goldCost))) // INLINED!! - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! -endfunction +//library WoWReforgedCheatsSaveCodes ends +//library WoWReforgedPrestoredSaveCodes: -function WoWReforgedWebsite__GenerateItemTypeIdLumberCost takes integer itemTypeId returns nothing - local integer lumberCost= GetItemValueLumber(itemTypeId) - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(lumberCost) , I2S(lumberCost)))) // INLINED!! - if ( lumberCost > 0 ) then - call Preload((I2S(lumberCost))) // INLINED!! - call Preload(("\"images/WC3lumber.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! -endfunction -function WoWReforgedWebsite__RaceIconToHtml takes integer whichRace returns nothing - if ( whichRace == udg_RaceNone ) then - call Preload(("-")) // INLINED!! - else - call WoWReforgedWebsite__IconToHtmlEx(udg_RaceTavernItemType[whichRace] , "races.html") - endif +function PlayerIsInElvenClan takes player whichPlayer returns boolean + return IsPlayerInForce(whichPlayer, prestoredElvenClanMembers) endfunction -function WoWReforgedWebsite__GetQuestByReward takes integer objectId returns integer +function GetPrestoredClanSaveCodeMatchingPlayer takes integer saveCodeIndex returns player + local player result= null + local integer playerRank= - 1 + local integer index= 0 local integer i= 0 - local integer max= (WoWReforgedQuests__questsMax) // INLINED!! + local integer j= 0 loop - exitwhen ( i == max ) - if ( objectId == (WoWReforgedQuests__questReward[(i)]) ) then // INLINED!! - return i + exitwhen ( i >= bj_MAX_PLAYERS ) + if ( GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then + set j=0 + loop + exitwhen ( j >= PrestoredSaveCodePlayerNamesCounter[saveCodeIndex] ) + set index=Index2D(saveCodeIndex , j , PRESTORED_SAVECODE_MAX_CLAN_MEMBERS) + //call BJDebugMsg("Comparing player name " + PrestoredSaveCodePlayerNames[index] + " to online player name " + GetPlayerName(Player(i))) + if ( GetPlayerName(Player(i)) == PrestoredSaveCodePlayerNames[index] and PrestoredSaveCodePlayerRanks[index] > playerRank ) then + set result=Player(i) + set playerRank=PrestoredSaveCodePlayerRanks[index] + endif + set j=j + 1 + endloop endif set i=i + 1 endloop - return - 1 -endfunction - -function WoWReforgedWebsite__RaceOrProfessionOrQuestIconToHtml takes integer objectId,integer whichRace returns nothing - local integer profession= GetObjectProfession(objectId) - local integer whichQuest= WoWReforgedWebsite__GetQuestByReward(objectId) - local integer legendaryItem= GetLegendaryItemByItemTypeId(objectId) - local integer recipe= GetRecipeByItemTypeId(objectId) - local boolean isArenaReward= (GetArenaTicketByReward((objectId)) != 0) // INLINED!! - local boolean isArenaOpponent= (GetArenaTicketByOpponent((objectId)) != 0) // INLINED!! - local boolean matches= false - if ( whichRace != udg_RaceNone ) then - call WoWReforgedWebsite__RaceIconToHtml(whichRace) - set matches=true - endif - if ( profession != udg_ProfessionNone ) then - call WoWReforgedWebsite__IconToHtmlEx(GetProfessionItemTypeId(profession) , "professions.html") - set matches=true - endif - if ( whichQuest != - 1 ) then - call WoWReforgedWebsite__IconToHtmlEx4((WoWReforgedQuests__questIcon[(whichQuest)]) , "quests.html" , (WoWReforgedQuests__questId[(whichQuest)]) , (WoWReforgedQuests__questId[(whichQuest)])) // INLINED!! - set matches=true - endif - if ( legendaryItem != - 1 ) then - call WoWReforgedWebsite__IconToHtmlEx2(GetUnitTypeId((WoWReforgedBosses___legendaryItemBoss[(legendaryItem)])) , "bosses.html" , GetNpcName((WoWReforgedBosses___legendaryItemBoss[(legendaryItem)]))) // INLINED!! - set matches=true - endif - if ( recipe != - 1 ) then - call WoWReforgedWebsite__IconToHtmlEx((Crafting___recipesUIItemTypeIds[(recipe)]) , "recipes.html") // INLINED!! - set matches=true - endif - if ( isArenaReward ) then - call WoWReforgedWebsite__Icon("Arena" , "infoquests.html" , "Arena Reward" , "ReplaceableTextures\\CommandButtons\\BTNArmoredOge.blp") - set matches=true - endif - if ( isArenaOpponent ) then - call WoWReforgedWebsite__Icon("Arena" , "infoquests.html" , "Arena Opponent" , "ReplaceableTextures\\CommandButtons\\BTNArmoredOge.blp") - set matches=true - endif - if ( not matches ) then - call Preload(("-")) // INLINED!! - endif -endfunction - -function WoWReforgedWebsite__GetPrimaryAttribute takes unit hero returns string - local integer v= BlzGetUnitIntegerField(hero, UNIT_IF_PRIMARY_ATTRIBUTE) - if ( v == 3 ) then - //return "Agility" - return "\"Agility\"" - elseif ( v == 2 ) then - //return "Intelligence" - return "\"Intelligence\"" - endif - //return "Strength" - // v == 1 - return "\"Strength\"" -endfunction - -function WoWReforgedWebsite__WriteHeroPrimaryAttributeColumn takes unit hero returns nothing - local integer a= GetHeroPrimaryStat(hero) - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(a) , GetHeroPrimaryStatName(a)))) // INLINED!! - call Preload((WoWReforgedWebsite__GetPrimaryAttribute(hero))) // INLINED!! - call Preload(("")) // INLINED!! -endfunction - -function WoWReforgedWebsite__GetUnitBountyBase takes unit creep returns integer - return BlzGetUnitIntegerField(creep, UNIT_IF_GOLD_BOUNTY_AWARDED_BASE) -endfunction - -function WoWReforgedWebsite__GetUnitBountyGold takes unit creep returns string - local integer bountyBase= (BlzGetUnitIntegerField((creep), UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)) // INLINED!! - local integer bountyNumberOfDice= BlzGetUnitIntegerField(creep, UNIT_IF_GOLD_BOUNTY_AWARDED_NUMBER_OF_DICE) - local integer bountySidesPerDice= BlzGetUnitIntegerField(creep, UNIT_IF_GOLD_BOUNTY_AWARDED_SIDES_PER_DIE) - local integer bountyMax= bountyBase + bountyNumberOfDice * bountySidesPerDice - - return I2S(bountyBase) + " - " + I2S(bountyMax) -endfunction - -function WoWReforgedWebsite__GetUnitDamage takes unit creep returns string - local integer damageBase= BlzGetUnitWeaponIntegerField(creep, UNIT_WEAPON_IF_ATTACK_DAMAGE_BASE, 0) - local integer damageNumberOfDice= BlzGetUnitWeaponIntegerField(creep, UNIT_WEAPON_IF_ATTACK_DAMAGE_NUMBER_OF_DICE, 0) - local integer damageSidesPerDice= BlzGetUnitWeaponIntegerField(creep, UNIT_WEAPON_IF_ATTACK_DAMAGE_SIDES_PER_DIE, 0) - local integer damageMax= damageBase + damageNumberOfDice * damageSidesPerDice - - return I2S(damageBase) + " - " + I2S(damageMax) -endfunction - -function WoWReforgedWebsite__GetMoveType takes unit hero returns string - local movetype v= ConvertMoveType(BlzGetUnitIntegerField(hero, UNIT_IF_MOVE_TYPE)) - if ( v == MOVE_TYPE_FOOT ) then - return "Foot" - elseif ( v == MOVE_TYPE_HORSE ) then - return "On Horse" - elseif ( v == MOVE_TYPE_FLY ) then - return "Fly" - elseif ( v == MOVE_TYPE_HOVER ) then - return "Hover" - elseif ( v == MOVE_TYPE_FLOAT ) then - return "Float" - elseif ( v == MOVE_TYPE_AMPHIBIOUS ) then - return "Amphibious" - endif - - return "None" -endfunction - -function WoWReforgedWebsite__GetArmorType takes unit hero returns string - local defensetype v= ConvertDefenseType(BlzGetUnitIntegerField(hero, UNIT_IF_DEFENSE_TYPE)) - if ( v == DEFENSE_TYPE_NORMAL ) then - return "Normal" - elseif ( v == DEFENSE_TYPE_LIGHT ) then - return "Small" - elseif ( v == DEFENSE_TYPE_MEDIUM ) then - return "Medium" - elseif ( v == DEFENSE_TYPE_LARGE ) then - return "Large" - elseif ( v == DEFENSE_TYPE_FORT ) then - return "Fortified" - elseif ( v == DEFENSE_TYPE_HERO ) then - return "Hero" - elseif ( v == DEFENSE_TYPE_DIVINE ) then - return "Divine" - endif - - return "None" -endfunction - -function WoWReforgedWebsite__GetArmorTypeIcon takes unit hero returns string - local defensetype v= ConvertDefenseType(BlzGetUnitIntegerField(hero, UNIT_IF_DEFENSE_TYPE)) - if ( v == DEFENSE_TYPE_NORMAL ) then - return "images/Infocard-neutral-armor-unarmored.webp" - elseif ( v == DEFENSE_TYPE_LIGHT ) then - return "images/Infocard-neutral-armor-small.webp" - elseif ( v == DEFENSE_TYPE_MEDIUM ) then - return "images/Infocard-neutral-armor-medium.webp" - elseif ( v == DEFENSE_TYPE_LARGE ) then - return "images/Infocard-neutral-armor-large.webp" - elseif ( v == DEFENSE_TYPE_FORT ) then - return "images/Infocard-neutral-armor-fortified.webp" - elseif ( v == DEFENSE_TYPE_HERO ) then - return "images/Infocard-armor-hero.webp" - elseif ( v == DEFENSE_TYPE_DIVINE ) then - return "images/Infocard-armor-hero.webp" - endif - - return "images/Infocard-neutral-armor-unarmored.webp" -endfunction - -function WoWReforgedWebsite__GenerateArmorCell takes unit hero returns nothing - call Preload(("")) // INLINED!! -endfunction - -function WoWReforgedWebsite__GetAttackType takes unit hero returns string - local attacktype v= ConvertAttackType(BlzGetUnitWeaponIntegerField(hero, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0)) - if ( v == ATTACK_TYPE_NORMAL ) then - return "Normal" - elseif ( v == ATTACK_TYPE_PIERCE ) then - return "Pierce" - elseif ( v == ATTACK_TYPE_SIEGE ) then - return "Siege" - elseif ( v == ATTACK_TYPE_MELEE ) then - return "Melee" - elseif ( v == ATTACK_TYPE_CHAOS ) then - return "Chaos" - elseif ( v == ATTACK_TYPE_HERO ) then - return "Hero" - elseif ( v == ATTACK_TYPE_MAGIC ) then - return "Magic" - endif - - return "Unknown" -endfunction - -function WoWReforgedWebsite__GetAttackTypeIcon takes unit hero returns string - local attacktype v= ConvertAttackType(BlzGetUnitWeaponIntegerField(hero, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0)) - if ( v == ATTACK_TYPE_NORMAL ) then - return "images/Infocard-neutral-attack-melee.webp" - elseif ( v == ATTACK_TYPE_PIERCE ) then - return "images/Infocard-neutral-attack-piercing.webp" - elseif ( v == ATTACK_TYPE_SIEGE ) then - return "images/Infocard-neutral-attack-siege.webp" - elseif ( v == ATTACK_TYPE_MELEE ) then - return "images/Infocard-neutral-attack-melee.webp" - elseif ( v == ATTACK_TYPE_CHAOS ) then - return "images/Infocard-neutral-attack-chaos.webp" - elseif ( v == ATTACK_TYPE_HERO ) then - return "images/Infocard-neutral-attack-hero.webp" - elseif ( v == ATTACK_TYPE_MAGIC ) then - return "images/Infocard-neutral-attack-magic.webp" - endif - - return "images/Infocard-neutral-attack-melee.webp" -endfunction - -function WoWReforgedWebsite__GenerateAttackTypeCell takes unit hero returns nothing - call Preload(("")) // INLINED!! -endfunction - - -function WoWReforgedWebsite__AddIgnoredAbility takes integer abilityId returns nothing - set WoWReforgedWebsite__ignoredAbilities[WoWReforgedWebsite__ignoredAbilitiesCounter]=abilityId - set WoWReforgedWebsite__ignoredAbilitiesCounter=WoWReforgedWebsite__ignoredAbilitiesCounter + 1 + return result endfunction -function WoWReforgedWebsite__IsValidAbility takes integer abilityId returns boolean +function LoadPrestoredClanSaveCodes takes nothing returns nothing + local player matchingPlayer= null + local boolean foundElvenClan= false + local integer j= 0 local integer i= 0 loop - exitwhen ( i == WoWReforgedWebsite__ignoredAbilitiesCounter ) - if ( WoWReforgedWebsite__ignoredAbilities[i] == abilityId ) then - return false + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_CLANS ) then + if ( PrestoredSaveCodePlayerName[i] == "TheElvenClan" and PrestoredSaveCodeMultiplayer[i] == not IsInSinglePlayer() ) then + set foundElvenClan=true + set matchingPlayer=GetPrestoredClanSaveCodeMatchingPlayer(i) + if ( matchingPlayer != null ) then + //call BJDebugMsg("Applying TheElvenClan savecode for player " + GetPlayerName(matchingPlayer)) + call ApplySaveCodeClan(matchingPlayer , "TheElvenClan" , PrestoredSaveCode[i]) + set j=0 + loop + exitwhen ( j >= bj_MAX_PLAYERS ) + if ( GetPlayerController(Player(j)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(j)) == PLAYER_SLOT_STATE_PLAYING and udg_ClanPlayerClan[j + 1] > 0 and udg_ClanName[udg_ClanPlayerClan[j + 1]] == "TheElvenClan" ) then + //call BJDebugMsg("Adding player to TheElvenClan") + call ForceAddPlayer(prestoredElvenClanMembers, Player(j)) + endif + set j=j + 1 + endloop + endif + endif endif set i=i + 1 endloop - return true -endfunction - -function WoWReforgedWebsite__GenerateUnitAttack takes unit whichUnit returns nothing - local integer attackType= BlzGetUnitWeaponIntegerField(whichUnit, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0) - local boolean attack0Enabled= BlzGetUnitWeaponBooleanField(whichUnit, UNIT_WEAPON_BF_ATTACKS_ENABLED, 0) - - // attack type - if ( attack0Enabled ) then - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(attackType) , WoWReforgedWebsite__GetAttackType(whichUnit)))) // INLINED!! - call WoWReforgedWebsite__GenerateAttackTypeCell(whichUnit) - else - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // attack speed - call Preload(("")) // INLINED!! - if ( attack0Enabled ) then - call Preload(((R2SW(((BlzGetUnitWeaponRealField(whichUnit, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, 0))*1.0), 1, 2)))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // attack range - call Preload(("")) // INLINED!! - if ( attack0Enabled ) then - call Preload((I2S(R2I(BlzGetUnitWeaponRealField(whichUnit, UNIT_WEAPON_RF_ATTACK_RANGE, 0))))) // INLINED!! - else - call Preload(("-")) // INLINED!! + if ( not foundElvenClan ) then + //call BJDebugMsg("Did not find TheElvenClan") endif - call Preload(("")) // INLINED!! - - // attack damage - call Preload(("")) // INLINED!! - if ( attack0Enabled ) then - call Preload((WoWReforgedWebsite__GetUnitDamage(whichUnit))) // INLINED!! - else - call Preload(("-")) // INLINED!! + if ( matchingPlayer == null ) then + //call BJDebugMsg("No player of TheElvenClan is online") endif - call Preload(("")) // INLINED!! endfunction -function WoWReforgedWebsite__WriteBuildingPopoverWithIcon takes integer unitTypeId returns nothing - call Preload(("
")) // INLINED!! - - // popover - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(unitTypeId , "buildings.html") - // name - call Preload((GetObjectName(unitTypeId))) // INLINED!! - call Preload(("
")) // INLINED!! - // gold cost - call WoWReforgedWebsite__GenerateUnitTypeIdGoldCostPopover(unitTypeId) - // wood cost - call WoWReforgedWebsite__GenerateUnitTypeIdLumberCostPopover(unitTypeId) - - // tooltip - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip(unitTypeId, 0)) - call Preload(("
")) // INLINED!! - // popover end - - // icon - call WoWReforgedWebsite__IconButton(unitTypeId) - - call Preload(("
")) // INLINED!! -endfunction - -function WoWReforgedWebsite__WriteUnitPopoverWithIconExExEx takes unit whichUnit,integer iconUnitTypeId,string name,string file returns nothing - local integer unitTypeId= GetUnitTypeId(whichUnit) - - call Preload(("
")) // INLINED!! - - // popover - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(iconUnitTypeId , file) - // name - call Preload((GetNpcName(whichUnit))) // INLINED!! - call Preload(("
")) // INLINED!! - - // gold cost - call WoWReforgedWebsite__GenerateUnitTypeIdGoldCostPopover(unitTypeId) - - // wood cost - call WoWReforgedWebsite__GenerateUnitTypeIdLumberCostPopover(unitTypeId) - - // food cost - call WoWReforgedWebsite__GenerateUnitTypeIdFoodCostPopover(unitTypeId) - - // tooltip - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip(unitTypeId, 0)) - call Preload(("
")) // INLINED!! - // popover end - - // icon - call WoWReforgedWebsite__IconButton(iconUnitTypeId) - - call Preload(("
")) // INLINED!! +function GetPrestoredSaveCodesMax takes nothing returns integer + return PrestoredSaveCodeCounter endfunction -function WoWReforgedWebsite__WriteUnitPopoverWithIconExEx takes unit whichUnit,string file returns nothing - call WoWReforgedWebsite__WriteUnitPopoverWithIconExExEx(whichUnit , GetUnitTypeId(whichUnit) , GetNpcName(whichUnit) , file) +function AddPrestoredSaveCodeEx takes integer saveCodeType,string playerName,string saveCode returns integer + local integer index= PrestoredSaveCodeCounter + set PrestoredSaveCodePlayerName[index]=playerName + set PrestoredSaveCode[index]=saveCode + set PrestoredSaveCodeType[index]=saveCodeType + set PrestoredSaveCodePlayerNamesCounter[index]=0 + set PrestoredSaveCodeCounter=PrestoredSaveCodeCounter + 1 + set lastAddedPrestoredClan=index + return index endfunction -function WoWReforgedWebsite__WriteUnitPopoverWithIconExNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__WriteUnitPopoverWithIconExEx(WoWReforgedWebsite__tmpUnit , WoWReforgedWebsite__tmpString) +function AddPrestoredSaveCode takes string playerName,string saveCode returns integer + return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_HEROES , playerName , saveCode) endfunction -function WoWReforgedWebsite__WriteUnitPopoverWithIconEx takes unit whichUnit,string file returns nothing - if ( whichUnit != null ) then - set WoWReforgedWebsite__tmpUnit=whichUnit - set WoWReforgedWebsite__tmpString=file - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__WriteUnitPopoverWithIconExNewOpLimit)) // INLINED!! - else - call h__BJDebugMsg("Warning: Unit is null.") - endif +function AddPrestoredSaveCodeItems takes string playerName,string saveCode returns integer + return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_ITEMS , playerName , saveCode) endfunction -function WoWReforgedWebsite__WriteUnitPopoverWithIcon takes integer unitTypeId,string file returns nothing - local unit whichUnit= null - - if ( unitTypeId != 0 ) then - set whichUnit=WoWReforgedWebsite__CreateTmpUnit(unitTypeId) - call WoWReforgedWebsite__WriteUnitPopoverWithIconEx(whichUnit , file) - call h__RemoveUnit(whichUnit) - set whichUnit=null - else - call h__BJDebugMsg("Warning: unit type ID is 0.") - endif +function AddPrestoredSaveCodeUnits takes string playerName,string saveCode returns integer + return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_UNITS , playerName , saveCode) endfunction -function WoWReforgedWebsite__WriteItemPopoverWithIcon takes integer itemTypeId,string file returns nothing - call Preload(("
")) // INLINED!! - - // popover - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(itemTypeId , file) - // name - call Preload((GetObjectName(itemTypeId))) // INLINED!! - call Preload(("
")) // INLINED!! - - // gold cost - if ( GetItemValueGold(itemTypeId) > 0 ) then - call Preload((I2S(GetItemValueGold(itemTypeId)))) // INLINED!! - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! - endif - - // lumber cost - if ( GetItemValueLumber(itemTypeId) > 0 ) then - call Preload((I2S(GetItemValueLumber(itemTypeId)))) // INLINED!! - call Preload(("\"images/WC3lumber.webp\"")) // INLINED!! - endif - - // tooltip - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip(itemTypeId, 0)) - call Preload(("
")) // INLINED!! - // popover end - - // icon - call WoWReforgedWebsite__IconButton(itemTypeId) - - call Preload(("
")) // INLINED!! +function AddPrestoredSaveCodeBuildings takes string playerName,string saveCode returns integer + return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_BUILDINGS , playerName , saveCode) endfunction -function WoWReforgedWebsite__WriteHeroAbilityPopoverWithIcon takes integer abilityId,string file returns nothing - call Preload(("
")) // INLINED!! - - // popover - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(abilityId , file) - // name - call Preload((GetObjectName(abilityId))) // INLINED!! - call Preload(("
")) // INLINED!! - - // tooltip - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityResearchExtendedTooltip(abilityId, 0)) - call Preload(("
")) // INLINED!! - // popover end - - // icon - call WoWReforgedWebsite__IconButton(abilityId) - - call Preload(("
")) // INLINED!! +function AddPrestoredSaveCodeResearches takes string playerName,string saveCode returns integer + return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_RESEARCHES , playerName , saveCode) endfunction -function WoWReforgedWebsite__WriteAbilityPopoverWithIcon takes integer abilityId,string file returns nothing - call Preload(("
")) // INLINED!! - - // popover - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(abilityId , file) - // name - call Preload((GetObjectName(abilityId))) // INLINED!! - call Preload(("
")) // INLINED!! - - // tooltip - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip(abilityId, 0)) - call Preload(("
")) // INLINED!! - // popover end - - // icon - call WoWReforgedWebsite__IconButton(abilityId) - - call Preload(("
")) // INLINED!! +function AddPrestoredSaveCodeLetter takes string playerName,string saveCode returns integer + return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_LETTER , playerName , saveCode) endfunction -function WoWReforgedWebsite__WriteResearchPopoverWithIcon takes integer researchItemTypeId returns nothing - call Preload(("
")) // INLINED!! - - // popover - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(researchItemTypeId , "researches.html") - // name - call Preload((GetObjectName(researchItemTypeId))) // INLINED!! - call Preload(("
")) // INLINED!! - - // tooltip - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip(researchItemTypeId, 0)) - call Preload(("
")) // INLINED!! - // popover end - - // icon - call WoWReforgedWebsite__IconButton(researchItemTypeId) - - call Preload(("
")) // INLINED!! +function AddPrestoredSaveCodeClan takes string clanName,boolean isSinglePlayer,string saveCode returns integer + local integer result= AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_CLANS , clanName , saveCode) + set PrestoredSaveCodeMultiplayer[result]=not isSinglePlayer + return result endfunction -function WoWReforgedWebsite__WriteRacePopoverWithIconExEx takes item whichItem,string file returns nothing - local integer itemTypeId= GetItemTypeId(whichItem) - - call Preload(("
")) // INLINED!! - - // popover - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(itemTypeId , file) - // name - call Preload((GetItemName(whichItem))) // INLINED!! - call Preload(("
")) // INLINED!! - - // tooltip - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetItemExtendedTooltip(whichItem)) - call Preload(("
")) // INLINED!! - // popover end - - // icon - call WoWReforgedWebsite__IconButton(itemTypeId) - - call Preload(("
")) // INLINED!! +function AddPrestoredSaveCodeClanPlayer takes string playerName,integer playerRank returns integer + local integer saveCodePlayerIndex= PrestoredSaveCodePlayerNamesCounter[lastAddedPrestoredClan] + local integer index= Index2D(lastAddedPrestoredClan , saveCodePlayerIndex , PRESTORED_SAVECODE_MAX_CLAN_MEMBERS) + set PrestoredSaveCodePlayerNames[index]=playerName + set PrestoredSaveCodePlayerRanks[index]=playerRank + set PrestoredSaveCodePlayerNamesCounter[lastAddedPrestoredClan]=PrestoredSaveCodePlayerNamesCounter[lastAddedPrestoredClan] + 1 + return saveCodePlayerIndex endfunction -function WoWReforgedWebsite__WriteRacePopoverWithIconExNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__WriteRacePopoverWithIconExEx(WoWReforgedWebsite__tmpItem , WoWReforgedWebsite__tmpString) +function GetPrestoredSaveCodePlayerNameByIndex takes integer index returns string + return PrestoredSaveCodePlayerName[index] endfunction -function WoWReforgedWebsite__WriteRacePopoverWithIconEx takes item whichItem,string file returns nothing - if ( whichItem != null ) then - set WoWReforgedWebsite__tmpItem=whichItem - set WoWReforgedWebsite__tmpString=file - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__WriteRacePopoverWithIconExNewOpLimit)) // INLINED!! - else - call h__BJDebugMsg("Warning: Item is null.") - endif +function GetPrestoredSaveCodeByIndex takes integer index returns string + return PrestoredSaveCode[index] endfunction -function WoWReforgedWebsite__GenerateHeroEx takes integer heroTypeId,integer whichRace,integer index returns nothing - local unit hero= WoWReforgedWebsite__CreateTmpUnit(heroTypeId) - local integer j= 0 - local integer maxHeroSpells= 0 - local integer abilityId= 0 - local integer standardHeroAbilityIndex= 0 - local integer mount= 0 - - call Preload(("")) // INLINED!! - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , GetNpcName(hero)))) // INLINED!! - //call IconToHtml(heroTypeId) - call WoWReforgedWebsite__WriteUnitPopoverWithIconEx(hero , "heroes.html") - call Preload(("")) // INLINED!! - // name - call Preload(("")) // INLINED!! - call Preload((GetNpcName(hero))) // INLINED!! - call Preload(("")) // INLINED!! - // race - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(whichRace) , (GetObjectName(udg_RaceTavernItemType[(whichRace)]))))) // INLINED!! - call WoWReforgedWebsite__RaceIconToHtml(whichRace) - call Preload(("")) // INLINED!! - // primary attribute - call WoWReforgedWebsite__WriteHeroPrimaryAttributeColumn(hero) - - // mount - call Preload(("")) // INLINED!! - set mount=GetHeroMountUnitTypeId(hero) - if ( mount != 0 ) then - call WoWReforgedWebsite__IconToHtmlEx(mount , "mounts.html") - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // standard hero ability - call Preload(("")) // INLINED!! - set standardHeroAbilityIndex=GetStandardHeroAbility(hero) - if ( standardHeroAbilityIndex != - 1 ) then - call WoWReforgedWebsite__IconToHtmlEx((s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(standardHeroAbilityIndex)]]) , "herostandardabilities.html") // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // abilities and description - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - set j=1 // start with 1 - set maxHeroSpells=(LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (heroTypeId), 0) + 1) // INLINED!! - loop - exitwhen ( j >= maxHeroSpells ) - set abilityId=(LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (heroTypeId ), ( j))) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(abilityId , "spells.html") - - set j=j + 1 - endloop - call Preload(("
")) // INLINED!! - //call FileWriteLine("
") - //call FormatTooltip(BlzGetAbilityExtendedTooltip(heroTypeId, 0)) - //call FileWriteLine("
") - call Preload(("")) // INLINED!! - - // start strength - call Preload(("")) // INLINED!! - call Preload((I2S(BlzGetUnitIntegerField(hero, UNIT_IF_STRENGTH)))) // INLINED!! - call Preload(("")) // INLINED!! - - // start agility - call Preload(("")) // INLINED!! - call Preload((I2S(BlzGetUnitIntegerField(hero, UNIT_IF_AGILITY)))) // INLINED!! - call Preload(("")) // INLINED!! - - // start intelligence - call Preload(("")) // INLINED!! - call Preload((I2S(BlzGetUnitIntegerField(hero, UNIT_IF_INTELLIGENCE)))) // INLINED!! - call Preload(("")) // INLINED!! - - // strength per level - call Preload(("")) // INLINED!! - call Preload(((R2SW(((BlzGetUnitRealField(hero, UNIT_RF_STRENGTH_PER_LEVEL))*1.0), 1, 2)))) // INLINED!! - call Preload(("")) // INLINED!! - - // agility per level - call Preload(("")) // INLINED!! - call Preload(((R2SW(((BlzGetUnitRealField(hero, UNIT_RF_AGILITY_PER_LEVEL))*1.0), 1, 2)))) // INLINED!! - call Preload(("")) // INLINED!! - - // intelligence per level - call Preload(("")) // INLINED!! - call Preload(((R2SW(((BlzGetUnitRealField(hero, UNIT_RF_INTELLIGENCE_PER_LEVEL))*1.0), 1, 2)))) // INLINED!! - call Preload(("")) // INLINED!! - - // move type - call Preload(("")) // INLINED!! - call Preload((WoWReforgedWebsite__GetMoveType(hero))) // INLINED!! - call Preload(("")) // INLINED!! - - // move speed - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(GetUnitMoveSpeed(hero))))) // INLINED!! - call Preload(("")) // INLINED!! - - call WoWReforgedWebsite__GenerateUnitAttack(hero) - - // armor type - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__GenerateArmorCell(hero) - call Preload(("")) // INLINED!! - - // armor - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitArmor(hero))))) // INLINED!! - call Preload(("")) // INLINED!! - - // day sight range - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitRealField(hero, UNIT_RF_SIGHT_RADIUS))))) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - call h__RemoveUnit(hero) - set hero=null +function GetPrestoredSaveCodeTypeByIndex takes integer index returns integer + return PrestoredSaveCodeType[index] endfunction -function WoWReforgedWebsite__GenerateHeroNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateHeroEx(WoWReforgedWebsite__tmpInteger , WoWReforgedWebsite__tmpInteger2 , WoWReforgedWebsite__tmpInteger3) +function GetPrestoredSaveCodeMemberPlayerName takes integer index returns string + return PrestoredSaveCodePlayerNames[index] endfunction -function WoWReforgedWebsite__GenerateHero takes integer heroTypeId,integer whichRace,integer index returns nothing - set WoWReforgedWebsite__tmpInteger=heroTypeId - set WoWReforgedWebsite__tmpInteger2=whichRace - set WoWReforgedWebsite__tmpInteger3=index - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateHeroNewOpLimit)) // INLINED!! +function GetPrestoredSaveCodeMemberPlayerRank takes integer index returns integer + return PrestoredSaveCodePlayerRanks[index] endfunction -function WoWReforgedWebsite__GenerateHeroes takes nothing returns nothing +function GetPrestoredSaveCodeCounter takes string playerName returns integer + local integer counter= 0 local integer i= 0 - local integer max= (udg_HeroUnitTypeIndex) // INLINED!! - - set GenerateIds___generatedIdsCounter=0 // INLINED!! - - call FileStart() - - call Preload(("")) // INLINED!! - set i=0 loop - exitwhen ( i >= max ) - if ( GenerateId((udg_HeroUnitType[(i)])) ) then // INLINED!! - call WoWReforgedWebsite__GenerateHero((udg_HeroUnitType[(i)]) , (udg_HeroRace[(i)]) , i) // INLINED!! + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodePlayerName[i] == playerName ) then + set counter=counter + 1 endif set i=i + 1 endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Heroes.txt")) // INLINED!! + return counter endfunction -function WoWReforgedWebsite__GenerateBossEx takes unit hero,integer index returns nothing - local integer zone= 0 - local integer heroTypeId= GetUnitTypeId(hero) - local integer legendaryItemIndex= - 1 +function GetPrestoredSaveCodeIndices takes string playerName returns string + local string result= "" + local integer counter= 0 local integer i= 0 - local integer maxHeroSpells= 0 - local integer abilityId= 0 - call Preload(("")) // INLINED!! - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , GetNpcName(hero)))) // INLINED!! - //call IconToHtml(GetUnitTypeId(hero)) - call WoWReforgedWebsite__WriteUnitPopoverWithIconEx(hero , "bosses.html") - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetNpcName(hero))) // INLINED!! - call Preload(("")) // INLINED!! - - // level - call Preload(("")) // INLINED!! - call Preload((I2S(GetHeroLevel(hero)))) // INLINED!! - call Preload(("")) // INLINED!! - - // location - call Preload(("")) // INLINED!! - - set zone=GetZoneByCoordinates(GetUnitX(hero) , GetUnitY(hero)) - if ( zone != 0 ) then - call WoWReforgedWebsite__IconToHtmlEx4((s__AbstractZone_icon[(zone)]) , "zones.html" , (s__AbstractZone_name[(zone)]) , (s__AbstractZone_id[(zone)])) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - - // legendary item - set legendaryItemIndex=GetLegendaryItemByBoss(hero) - - if ( legendaryItemIndex != - 1 ) then - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx((WoWReforgedBosses___legendaryItemTypeId[(legendaryItemIndex)]) , "items.html") // INLINED!! - call Preload(("")) // INLINED!! - else - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - endif - - // abilities - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - set i=1 // start with 1 - set maxHeroSpells=(LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (heroTypeId), 0) + 1) // INLINED!! loop - exitwhen ( i >= maxHeroSpells ) - set abilityId=(LoadInteger(HeroAbilitySystem___HeroAbilitiesHashTable, (heroTypeId ), ( i))) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(abilityId , "spells.html") - + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodePlayerName[i] == playerName ) then + if ( counter > 0 ) then + set result=result + "\n" + endif + set result=result + "- " + I2S(i) + set counter=counter + 1 + endif set i=i + 1 endloop - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! + return result +endfunction - // primary attribute - call WoWReforgedWebsite__WriteHeroPrimaryAttributeColumn(hero) +function GetPrestoredSaveCodeAccounts takes nothing returns string + local string result= "" + local string array onlinePlayers + local player array onlinePlayersMatching + local integer onlinePlayersCounter= 0 + local string array offlinePlayers + local integer offlinePlayersCounter= 0 + local player matchingPlayer= null + local boolean add= true + local integer counter= 0 + local integer j= 0 + local integer i= 0 + loop + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodeType[i] != PRESTORED_SAVECODE_TYPE_CLANS and PrestoredSaveCodePlayerName[i] != "all" ) then + set add=true + set matchingPlayer=null + set j=0 + loop + exitwhen ( j >= bj_MAX_PLAYERS or matchingPlayer != null ) + if ( GetPlayerName(Player(j)) == PrestoredSaveCodePlayerName[i] ) then + set matchingPlayer=Player(j) + endif + set j=j + 1 + endloop + if ( matchingPlayer != null ) then + set j=0 + loop + exitwhen ( j >= onlinePlayersCounter or not add ) + if ( onlinePlayers[j] == PrestoredSaveCodePlayerName[i] ) then + set add=false + endif + set j=j + 1 + endloop + if ( add ) then + set onlinePlayers[onlinePlayersCounter]=PrestoredSaveCodePlayerName[i] + set onlinePlayersMatching[onlinePlayersCounter]=matchingPlayer + set onlinePlayersCounter=onlinePlayersCounter + 1 + endif + else + set j=0 + loop + exitwhen ( j >= offlinePlayersCounter or not add ) + if ( offlinePlayers[j] == PrestoredSaveCodePlayerName[i] ) then + set add=false + endif + set j=j + 1 + endloop + if ( add ) then + set offlinePlayers[offlinePlayersCounter]=PrestoredSaveCodePlayerName[i] + set offlinePlayersCounter=offlinePlayersCounter + 1 + endif + endif + endif + set i=i + 1 + endloop + set i=0 + loop + exitwhen ( i >= onlinePlayersCounter ) + if ( counter > 0 ) then + set result=result + "\n" + endif - // start strength - call Preload(("")) // INLINED!! - call Preload((I2S(BlzGetUnitIntegerField(hero, UNIT_IF_STRENGTH)))) // INLINED!! - call Preload(("")) // INLINED!! + set result=result + GetPlayerNameColored(onlinePlayersMatching[i]) + if ( (udg_ClanPlayerClan[GetConvertedPlayerId((onlinePlayersMatching[i]))]) != 0 ) then // INLINED!! + set result=result + " (" + (udg_ClanName[((udg_ClanPlayerClan[GetConvertedPlayerId((onlinePlayersMatching[i]))]))]) + ")" // INLINED!! + endif + if ( (IsPlayerInForce((onlinePlayersMatching[i]), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! + set result=result + " (VIP)" + endif + set counter=counter + 1 + set i=i + 1 + endloop + set i=0 + loop + exitwhen ( i >= offlinePlayersCounter ) + if ( counter > 0 ) then + set result=result + "\n" + endif - // start agility - call Preload(("")) // INLINED!! - call Preload((I2S(BlzGetUnitIntegerField(hero, UNIT_IF_AGILITY)))) // INLINED!! - call Preload(("")) // INLINED!! - - // start intelligence - call Preload(("")) // INLINED!! - call Preload((I2S(BlzGetUnitIntegerField(hero, UNIT_IF_INTELLIGENCE)))) // INLINED!! - call Preload(("")) // INLINED!! - - // strength per level - call Preload(("")) // INLINED!! - call Preload(((R2SW(((BlzGetUnitRealField(hero, UNIT_RF_STRENGTH_PER_LEVEL))*1.0), 1, 2)))) // INLINED!! - call Preload(("")) // INLINED!! + set result=result + offlinePlayers[i] + " (offline)" + if ( IsAccountVIP(offlinePlayers[i]) ) then + set result=result + " (VIP)" + endif + set counter=counter + 1 + set i=i + 1 + endloop - // agility per level - call Preload(("")) // INLINED!! - call Preload(((R2SW(((BlzGetUnitRealField(hero, UNIT_RF_AGILITY_PER_LEVEL))*1.0), 1, 2)))) // INLINED!! - call Preload(("")) // INLINED!! + return result +endfunction - // intelligence per level - call Preload(("")) // INLINED!! - call Preload(((R2SW(((BlzGetUnitRealField(hero, UNIT_RF_INTELLIGENCE_PER_LEVEL))*1.0), 1, 2)))) // INLINED!! - call Preload(("")) // INLINED!! +// only shows matching savecodes to keep the number limited +function GetPrestoredSaveCodeInfos takes player whichPlayer returns string + local string playerName= GetPlayerName(whichPlayer) + local string result= "" + local integer counter= 0 + local integer i= 0 + loop + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodePlayerName[i] == playerName or PrestoredSaveCodePlayerName[i] == "all" ) then + if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_HEROES and GetSaveCodeIsMatching(whichPlayer , PrestoredSaveCode[i]) ) then + if ( counter > 0 ) then + set result=result + "\n" + endif - // move type - call Preload(("")) // INLINED!! - call Preload((WoWReforgedWebsite__GetMoveType(hero))) // INLINED!! - call Preload(("")) // INLINED!! + set result=result + "-loadp " + I2S(i) + ": " + GetSaveCodeShortInfos(playerName , PrestoredSaveCode[i]) - // move speed - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(GetUnitMoveSpeed(hero))))) // INLINED!! - call Preload(("")) // INLINED!! + set counter=counter + 1 + elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_ITEMS ) then + if ( counter > 0 ) then + set result=result + "\n" + endif - // attack type - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__GenerateAttackTypeCell(hero) - call Preload(("")) // INLINED!! + set result=result + "-loadpi " + I2S(i) + ": " + GetSaveCodeShortInfosItems(whichPlayer , PrestoredSaveCode[i]) - // attack speed - call Preload(("")) // INLINED!! - call Preload(((R2SW(((BlzGetUnitWeaponRealField(hero, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, 0))*1.0), 1, 2)))) // INLINED!! - call Preload(("")) // INLINED!! - - // attack range - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitWeaponRealField(hero, UNIT_WEAPON_RF_ATTACK_RANGE, 0))))) // INLINED!! - call Preload(("")) // INLINED!! - - // attack damage - call Preload(("")) // INLINED!! - call Preload((WoWReforgedWebsite__GetUnitDamage(hero))) // INLINED!! - call Preload(("")) // INLINED!! + set counter=counter + 1 + elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_UNITS ) then + if ( counter > 0 ) then + set result=result + "\n" + endif - // armor type - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__GenerateArmorCell(hero) - call Preload(("")) // INLINED!! + set result=result + "-loadpu " + I2S(i) + ": " + GetSaveCodeShortInfosUnits(whichPlayer , PrestoredSaveCode[i]) - // armor - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitArmor(hero))))) // INLINED!! - call Preload(("")) // INLINED!! + set counter=counter + 1 + elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_BUILDINGS ) then + if ( counter > 0 ) then + set result=result + "\n" + endif - // day sight range - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitRealField(hero, UNIT_RF_SIGHT_RADIUS))))) // INLINED!! - call Preload(("")) // INLINED!! + set result=result + "-loadpb " + I2S(i) + ": " + GetSaveCodeShortInfosBuildings(whichPlayer , PrestoredSaveCode[i]) - call Preload(("")) // INLINED!! -endfunction + set counter=counter + 1 + elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_RESEARCHES ) then + if ( counter > 0 ) then + set result=result + "\n" + endif -function WoWReforgedWebsite__GenerateBossNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateBossEx(WoWReforgedWebsite__tmpUnit , WoWReforgedWebsite__tmpInteger) -endfunction + set result=result + "-loadpr " + I2S(i) + ": " + GetSaveCodeShortInfosResearches(whichPlayer , PrestoredSaveCode[i]) -function WoWReforgedWebsite__GenerateBoss takes unit hero,integer index returns nothing - set WoWReforgedWebsite__tmpUnit=hero - set WoWReforgedWebsite__tmpInteger=index - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateBossNewOpLimit)) // INLINED!! + set counter=counter + 1 +// elseif (PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_LETTER) then +// if (counter > 0) then +// set result = result + "\n" +// endif +// +// set result = result + "-loadpl " + I2S(i) + ": " + GetSaveCodeShortInfosLetter(PrestoredSaveCodePlayerName[i], PrestoredSaveCode[i]) +// +// set counter = counter + 1 + endif + endif + set i=i + 1 + endloop + return result endfunction -function WoWReforgedWebsite__GenerateBosses takes nothing returns nothing +function GetPrestoredSaveCodeInfosClans takes nothing returns string + local string result= "" + local integer counter= 0 local integer i= 0 - local integer max= BlzGroupGetSize(udg_Bosses) - local integer j= 0 - local integer maxHeroSpells= 0 - local integer abilityId= 0 - local integer legendaryItemIndex= - 1 - local unit hero= null - - call FileStart() - call Preload(("")) // INLINED!! - - set i=0 loop - exitwhen ( i == max ) - set hero=BlzGroupUnitAt(udg_Bosses, i) - call WoWReforgedWebsite__GenerateBoss(hero , i) - set hero=null + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_CLANS ) then + if ( counter > 0 ) then + set result=result + "\n" + endif + set result=result + "- " + I2S(i) + ": " + GetSaveCodeShortInfosClan(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) + set counter=counter + 1 + endif set i=i + 1 endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Bosses.txt")) // INLINED!! -endfunction - -function WoWReforgedWebsite__GetUnitCountInMap takes integer unitTypeId returns string - local group g= GetUnitsOfTypeIdAll(unitTypeId) - local integer count= BlzGroupGetSize(g) - 1 - call GroupClear(g) - call DestroyGroup(g) - set g=null - if ( count > 0 ) then - return I2S(count) - endif - return "-" -endfunction - -function WoWReforgedWebsite__GetItemCountInMap takes integer itemTypeId returns string - local integer count= CountItemsOfTypeIdAll(itemTypeId) - 1 - if ( count > 0 ) then - return I2S(count) - endif - return "-" + return result endfunction -function WoWReforgedWebsite__GenerateUnitEx takes integer unitTypeId,integer whichRace,integer index returns nothing - local unit creep= WoWReforgedWebsite__CreateTmpUnit(unitTypeId) +function GetPrestoredSaveCodeClans takes string accountName returns string + local string result= "" + local integer counter= 0 local integer i= 0 - local integer max= 0 - local integer abilityId= 0 - - call Preload(("")) // INLINED!! - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , GetUnitName(creep)))) // INLINED!! - //call IconToHtml(unitTypeId) - call WoWReforgedWebsite__WriteUnitPopoverWithIconEx(creep , "units.html") - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetUnitName(creep))) // INLINED!! - call Preload(("")) // INLINED!! - - // count - call Preload(("")) // INLINED!! - call Preload((WoWReforgedWebsite__GetUnitCountInMap(unitTypeId))) // INLINED!! - call Preload(("")) // INLINED!! - - // abilities and description - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - set i=0 loop - exitwhen ( i == WoWReforgedWebsite__MAX_ABILITIES ) - if ( BlzGetUnitAbilityByIndex(creep, i) != null ) then - set abilityId=BlzGetAbilityId(BlzGetUnitAbilityByIndex(creep, i)) - if ( abilityId != 0 and WoWReforgedWebsite__IsValidAbility(abilityId) ) then - call WoWReforgedWebsite__IconToHtmlEx(abilityId , "spells.html") + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_CLANS and AccountNameBelongsToClanSaveCode(accountName , PrestoredSaveCode[i]) ) then + if ( counter > 0 ) then + set result=result + "\n" endif + set result=result + "- " + I2S(i) + ": " + GetSaveCodeShortInfosClan(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) + set counter=counter + 1 endif set i=i + 1 endloop - call Preload(("
")) // INLINED!! - //call FileWriteLine("
") - //call FormatTooltip(BlzGetAbilityExtendedTooltip(unitTypeId, 0)) - //call FileWriteLine("
") - call Preload(("")) // INLINED!! - - // race - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(whichRace) , (GetObjectName(udg_RaceTavernItemType[(whichRace)]))))) // INLINED!! - call WoWReforgedWebsite__RaceOrProfessionOrQuestIconToHtml(unitTypeId , whichRace) - call Preload(("")) // INLINED!! - - // items - if ( GetUnitTypeIdTrophy(unitTypeId) != 0 ) then - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(GetUnitTypeIdTrophy(unitTypeId) , "items.html") - call Preload(("")) // INLINED!! - else - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - endif - - - // level - call Preload(("")) // INLINED!! - call Preload((I2S(GetUnitLevel(creep)))) // INLINED!! - call Preload(("")) // INLINED!! - - // gold bounty - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S((BlzGetUnitIntegerField((creep), UNIT_IF_GOLD_BOUNTY_AWARDED_BASE))) , I2S((BlzGetUnitIntegerField((creep), UNIT_IF_GOLD_BOUNTY_AWARDED_BASE)))))) // INLINED!! - call Preload((WoWReforgedWebsite__GetUnitBountyGold(creep))) // INLINED!! - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! - call Preload(("")) // INLINED!! - - // food cost - call WoWReforgedWebsite__GenerateUnitTypeIdFoodCost(unitTypeId) - - // gold cost - call WoWReforgedWebsite__GenerateUnitTypeIdGoldCost(unitTypeId) - - // wood cost - call WoWReforgedWebsite__GenerateUnitTypeIdLumberCost(unitTypeId) - - // move type - call Preload(("")) // INLINED!! - call Preload((WoWReforgedWebsite__GetMoveType(creep))) // INLINED!! - call Preload(("")) // INLINED!! - - // move speed - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(GetUnitMoveSpeed(creep))))) // INLINED!! - call Preload(("")) // INLINED!! - - // armor type - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__GenerateArmorCell(creep) - call Preload(("")) // INLINED!! - - // armor - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitArmor(creep))))) // INLINED!! - call Preload(("")) // INLINED!! - - call WoWReforgedWebsite__GenerateUnitAttack(creep) - - // max hp - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitRealField(creep, UNIT_RF_HP))))) // INLINED!! - call Preload(("")) // INLINED!! - - // hp regeneration - call Preload(("")) // INLINED!! - if ( BlzGetUnitRealField(creep, UNIT_RF_HIT_POINTS_REGENERATION_RATE) > 0.0 ) then - call Preload(((R2SW(((BlzGetUnitRealField(creep, UNIT_RF_HIT_POINTS_REGENERATION_RATE))*1.0), 1, 2)))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // max mana - call Preload(("")) // INLINED!! - if ( BlzGetUnitRealField(creep, UNIT_RF_MANA) > 0.0 ) then - call Preload((I2S(R2I(BlzGetUnitRealField(creep, UNIT_RF_MANA))))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // mana regeneration - call Preload(("")) // INLINED!! - if ( BlzGetUnitRealField(creep, UNIT_RF_MANA_REGENERATION) > 0.0 ) then - call Preload(((R2SW(((BlzGetUnitRealField(creep, UNIT_RF_MANA_REGENERATION))*1.0), 1, 2)))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // sight range - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitRealField(creep, UNIT_RF_SIGHT_RADIUS))))) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - call h__RemoveUnit(creep) - set creep=null -endfunction - -function WoWReforgedWebsite__OpLimitGenerateUnit takes nothing returns nothing - if ( GenerateId(WoWReforgedWebsite__tmpInteger) ) then - call WoWReforgedWebsite__GenerateUnitEx(WoWReforgedWebsite__tmpInteger , WoWReforgedWebsite__tmpInteger2 , WoWReforgedWebsite__tmpInteger3) - endif -endfunction - -function WoWReforgedWebsite__GenerateUnit takes integer objectTypeId,integer index returns nothing - set WoWReforgedWebsite__tmpInteger=objectTypeId - set WoWReforgedWebsite__tmpInteger2=GetObjectRace(objectTypeId) - set WoWReforgedWebsite__tmpInteger3=index - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__OpLimitGenerateUnit)) // INLINED!! + return result endfunction -function WoWReforgedWebsite__GenerateNonCreepUnits takes nothing returns integer - local integer index= 1 - local integer id= 0 - local integer i= 1 - local integer max= (SaveObjectUnitCounter) // INLINED!! - local integer d= 0 - local integer j= 0 - local integer max2= 0 +function GetPrestoredSaveCodeInfosLetters takes player whichPlayer returns string + local string result= "" + local string playerName= GetPlayerName(whichPlayer) + local integer counter= 0 + local integer i= 0 loop - exitwhen ( i == max ) - set id=(SaveObjectIdUnit[(i)]) // INLINED!! - if ( id != 0 ) then - call WoWReforgedWebsite__GenerateUnit(id , index) - - set d=(LoadInteger(WoWReforgedDependencyEquivalents___h, (id), 0)) // INLINED!! - if ( d != 0 ) then - set j=0 - set max2=s__DependencyEquivalents_count[d] - loop - exitwhen ( j >= max2 ) - set index=index + 1 - call WoWReforgedWebsite__GenerateUnit(s___DependencyEquivalents_ids[s__DependencyEquivalents_ids[d]+j] , index) - set j=j + 1 - endloop + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_LETTER and ( PrestoredSaveCodePlayerName[i] == playerName or PrestoredSaveCodePlayerName[i] == "all" or ( udg_ClanPlayerClan[GetConvertedPlayerId(whichPlayer)] > 0 and udg_ClanName[udg_ClanPlayerClan[GetConvertedPlayerId(whichPlayer)]] == PrestoredSaveCodePlayerName[i] ) ) ) then + if ( counter > 0 ) then + set result=result + "\n" endif - else - call h__BJDebugMsg("Warning: ID 0 for unit type with index " + I2S(i)) + set result=result + "-loadpl " + I2S(i) + ": " + GetSaveCodeShortInfosLetter(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) + set counter=counter + 1 endif set i=i + 1 - set index=index + 1 endloop - - return index + return result endfunction -function WoWReforgedWebsite__GenerateCreepUnits takes integer index returns nothing - local integer id= 0 +function GetPrestoredSaveCodeMaxLevelIndex takes string skipPlayerName1,string skipPlayerName2,string skipPlayerName3 returns integer + local integer maxLevel= 0 + local integer tmpMaxLevel= 0 + local integer result= - 1 local integer i= 0 - local integer max= (WoWReforgedRaces___objectTypeNeutralUnitsCounter) // INLINED!! - local integer d= 0 - local integer j= 0 - local integer max2= 0 loop - exitwhen ( i == max ) - set id=(WoWReforgedRaces___objectTypeNeutralUnits[(i)]) // INLINED!! - if ( id != 0 ) then - call WoWReforgedWebsite__GenerateUnit(id , index) - - set d=(LoadInteger(WoWReforgedDependencyEquivalents___h, (id), 0)) // INLINED!! - if ( d != 0 ) then - set j=0 - set max2=s__DependencyEquivalents_count[d] - loop - exitwhen ( j >= max2 ) - set index=index + 1 - call WoWReforgedWebsite__GenerateUnit(s___DependencyEquivalents_ids[s__DependencyEquivalents_ids[d]+j] , index) - set j=j + 1 - endloop + exitwhen ( i >= PrestoredSaveCodeCounter ) + if ( ( skipPlayerName1 == null or (PrestoredSaveCodePlayerName[(i)]) != skipPlayerName1 ) and ( skipPlayerName2 == null or (PrestoredSaveCodePlayerName[(i)]) != skipPlayerName2 ) and ( skipPlayerName3 == null or (PrestoredSaveCodePlayerName[(i)]) != skipPlayerName3 ) ) then // INLINED!! + set tmpMaxLevel=GetSaveCodeMaxHeroLevel(PrestoredSaveCodePlayerName[i] , PrestoredSaveCode[i]) + set tmpMaxLevel=IMinBJ(tmpMaxLevel, MAX_HERO_LEVEL) + if ( tmpMaxLevel > maxLevel ) then + set maxLevel=tmpMaxLevel + set result=i endif - else - call h__BJDebugMsg("Warning: ID 0 for unit type with index " + I2S(i)) endif set i=i + 1 - set index=index + 1 endloop + + return result endfunction -function WoWReforgedWebsite__GenerateUnits takes nothing returns nothing - local integer index= 0 +function IsValidAccount takes string name returns boolean + return GetPrestoredSaveCodeCounter(name) > 0 +endfunction - call FileStart() - call Preload(("")) // INLINED!! - - set GenerateIds___generatedIdsCounter=0 // INLINED!! - - set index=WoWReforgedWebsite__GenerateNonCreepUnits() - call WoWReforgedWebsite__GenerateCreepUnits(index) - - call Preload(("")) // INLINED!! +function DisplayAccountInfo takes player to,string account returns nothing + local string prestored= "Prestored savecodes: " + I2S(GetPrestoredSaveCodeCounter(account)) + local string clans= "Clans: " + GetPrestoredSaveCodeClans(account) + call h__DisplayTimedTextToPlayer(to, 0, 0, 20.0, account + "):\n" + prestored + "\n- " + clans) +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Units.txt")) // INLINED!! +// Add all prestored savecodes into this function +function InitPrestoredSaveCodes takes nothing returns nothing + // ############################################################## + // WorldOfWarcraftReforged-letter-from_Barade#2569-to_all-messageLength_15.txt + // Hello citizens! +call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_LETTER , ("all" ) , ( "B;LRoioFXl6I(S:(S:(S:(S:(U/(-(!6Z(-(!6Z(E,(C35g(C35g(S:(S:(!()(SG(")) // INLINED!! + // WorldOfWarcraftReforged-Barade#2569-Multiplayer-Normal-Warlord-items-6-Gloves of Haste,Potion of Invulnerability,Scroll of Restoration,Ankh of Reincarnation,Healing Wards,Health Stone.txt +call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_ITEMS , ("Barade#2569" ) , ( "!,(!(-(S:(0(S:()(S:(k(S:(e(S:(SR(S:(!(S:(S(")) // INLINED!! + // WorldOfWarcraftReforged-Barade#2569-Multiplayer-Normal-Warlord-buildings-7-Guard Tower,Guard Tower,Altar of Kings,Lumber Mill,Arcane Vault,Workshop,Barracks.txt +call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_BUILDINGS , ("Barade#2569" ) , ( "!,(!(-(S:(f()HV(SPN(f()HV(SHg(k().5(S]g(e()sC(SAC(,()8h(SQs(3()8h(Sc2(@()89(SN-(!~(")) // INLINED!! + // WorldOfWarcraftReforged-Barade#2569-Multiplayer-Normal-Warlord-units-6-30Red Dragon,30Green Dragon,30Black Dragon,30Blue Dragon,30Bronze Dragon,30Nether Dragon.txt +call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_UNITS , ("Barade#2569" ) , ( "!,(!(-(S:(S2(t(SV(t(S&(t(S\"(t(Sm(t(Sd(t(-(-(-(-(-(-(-(-(,(")) // INLINED!! + // Klekot#2393 +call AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_HEROES , ("Klekot#2393" ) , ( "Phc>c>cj2c[dqcNkWcPWecMcMcMcMcMc>PcUcRicPcPUcmcMcMcMcMcMcMcP3c")) // INLINED!! + // ############################################################## + // CLANS + // MULTIPLAYER + // TheElvenClan + // WorldOfWarcraftReforged-Clan-TheElvenClan-Barade#2569-Multiplayer-gold-40000-lumber-40000-members-5.txt + // Barade#2569_Leader, WorldEdit_Leader, Barade#2569_Leader, Runeblade14#2451_Captain, AntiDenseMan#1202_Captain, Chaoskrieger#21738_Captain + call AddPrestoredSaveCodeClan("TheElvenClan" , false , "Squq[q/quq(*+q(*+qzqzq7?q/q7-q/q7?q/qHquqKququ8quq/q/quq7iq") + call AddPrestoredSaveCodeClanPlayer("Barade#2569" , udg_ClanRankLeader) + call AddPrestoredSaveCodeClanPlayer("WorldEdit" , udg_ClanRankLeader) + call AddPrestoredSaveCodeClanPlayer("Barade" , udg_ClanRankLeader) + call AddPrestoredSaveCodeClanPlayer("Runeblade14#2451" , udg_ClanRankCaptain) + call AddPrestoredSaveCodeClanPlayer("AntiDenseMan#1202" , udg_ClanRankCaptain) + call AddPrestoredSaveCodeClanPlayer("Chaoskrieger#21738" , udg_ClanRankCaptain) + // SINGLEPLAYER + // TheElvenClan + // WorldOfWarcraftReforged-Clan-TheElvenClan-Barade#2569-Singleplayer-gold-40000-lumber-40000-members-5.txt + // Barade#2569_Leader, WorldEdit_Leader, Barade#2569_Leader, Runeblade14#2451_Captain, AntiDenseMan#1202_Captain, Chaoskrieger#21738_Captain + call AddPrestoredSaveCodeClan("TheElvenClan" , true , "Sq/q[q/quq(*+q(*+qzqzq7?q/q7-q/q7?q/qHquqKququ8quq/q/quqnq") + call AddPrestoredSaveCodeClanPlayer("Barade#2569" , udg_ClanRankLeader) + call AddPrestoredSaveCodeClanPlayer("WorldEdit" , udg_ClanRankLeader) + call AddPrestoredSaveCodeClanPlayer("Barade" , udg_ClanRankLeader) + call AddPrestoredSaveCodeClanPlayer("Runeblade14#2451" , udg_ClanRankCaptain) + call AddPrestoredSaveCodeClanPlayer("AntiDenseMan#1202" , udg_ClanRankCaptain) + call AddPrestoredSaveCodeClanPlayer("Chaoskrieger#21738" , udg_ClanRankCaptain) endfunction -function WoWReforgedWebsite__GenerateBuildingEx takes integer unitTypeId,integer whichRace,integer index returns nothing - local unit creep= WoWReforgedWebsite__CreateTmpUnit(unitTypeId) - local integer i= 0 - local integer max= 0 - local integer abilityId= 0 - call Preload(("")) // INLINED!! - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , GetUnitName(creep)))) // INLINED!! - //call IconToHtml(unitTypeId) - call WoWReforgedWebsite__WriteUnitPopoverWithIconEx(creep , "buildings.html") - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetUnitName(creep))) // INLINED!! - call Preload(("")) // INLINED!! - - // count - call Preload(("")) // INLINED!! - call Preload((WoWReforgedWebsite__GetUnitCountInMap(unitTypeId))) // INLINED!! - call Preload(("")) // INLINED!! - - // abilities/items/tooltip - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - set i=0 +//library WoWReforgedPrestoredSaveCodes ends +//library WoWReforgedRandomSaveCode: + +function WoWReforgedRandomSaveCode___CreateRandomUnits takes player whichPlayer returns group + local location tmpLocation= Location(0.0, 0.0) + local group allCreeps= CreateGroup() + local integer i= 0 + local integer max= GetRandomInt(2, 8) loop - exitwhen ( i == WoWReforgedWebsite__MAX_ABILITIES ) - set abilityId=BlzGetAbilityId(BlzGetUnitAbilityByIndex(creep, i)) - if ( abilityId != 0 and WoWReforgedWebsite__IsValidAbility(abilityId) ) then - call WoWReforgedWebsite__IconToHtmlEx(abilityId , "spells.html") - endif + exitwhen ( i >= max ) + call GroupAddGroup(CreateNUnitsAtLoc(GetRandomInt(1, 6), ChooseRandomCreep(GetRandomInt(1, 10)), whichPlayer, tmpLocation, 0.0), allCreeps) set i=i + 1 endloop - call Preload(("
")) // INLINED!! - - - call Preload(("")) // INLINED!! - - // race - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(whichRace) , (GetObjectName(udg_RaceTavernItemType[(whichRace)]))))) // INLINED!! - call WoWReforgedWebsite__RaceIconToHtml(whichRace) - call Preload(("")) // INLINED!! - - // tiny item - if ( (LoadInteger(WoWReforgedObjectMappings___h, (unitTypeId), 0)) != 0 ) then // INLINED!! - call Preload((WoWReforgedWebsite__ColumnDataOrder(A2S((LoadInteger(WoWReforgedObjectMappings___h, (unitTypeId), 0))) , GetObjectName((LoadInteger(WoWReforgedObjectMappings___h, (unitTypeId), 0)))))) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx((LoadInteger(WoWReforgedObjectMappings___h, (unitTypeId), 0)) , "items.html") // INLINED!! - call Preload(("")) // INLINED!! - else - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - endif - // gold cost - call WoWReforgedWebsite__GenerateUnitTypeIdGoldCost(unitTypeId) - - // wood cost - call WoWReforgedWebsite__GenerateUnitTypeIdLumberCost(unitTypeId) - - // food made - call WoWReforgedWebsite__GenerateUnitTypeIdFoodMade(unitTypeId) - - // armor type - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__GenerateArmorCell(creep) - call Preload(("")) // INLINED!! - - // armor - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitArmor(creep))))) // INLINED!! - call Preload(("")) // INLINED!! - - call WoWReforgedWebsite__GenerateUnitAttack(creep) + call RemoveLocation(tmpLocation) + set tmpLocation=null - // max hp - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitRealField(creep, UNIT_RF_HP))))) // INLINED!! - call Preload(("")) // INLINED!! + return allCreeps +endfunction - // hp regeneration - call Preload(("")) // INLINED!! - if ( BlzGetUnitRealField(creep, UNIT_RF_HIT_POINTS_REGENERATION_RATE) > 0.0 ) then - call Preload(((R2SW(((BlzGetUnitRealField(creep, UNIT_RF_HIT_POINTS_REGENERATION_RATE))*1.0), 1, 2)))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! +function WoWReforgedRandomSaveCode___GetSaveCodeRandomUnits takes player whichPlayer returns string + local location tmpLocation= Location(0.0, 0.0) + local group allCreeps= WoWReforgedRandomSaveCode___CreateRandomUnits(whichPlayer) + local group allCreepsDistinct= DistinctGroup(allCreeps) + local string result= GetSaveCodeUnitsEx2(GetPlayerName(whichPlayer) , IsInSinglePlayer() , IsPlayerWarlord(whichPlayer) , udg_GameType , R2I(GetPlayerHandicapXP(whichPlayer)) , true , 0 , whichPlayer , allCreepsDistinct) - // max mana - call Preload(("")) // INLINED!! - if ( BlzGetUnitRealField(creep, UNIT_RF_MANA) > 0.0 ) then - call Preload((I2S(R2I(BlzGetUnitRealField(creep, UNIT_RF_MANA))))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! + call ForGroupBJ(allCreeps, function ForGroupRemoveUnit) - // mana regeneration - call Preload(("")) // INLINED!! - if ( BlzGetUnitRealField(creep, UNIT_RF_MANA_REGENERATION) > 0.0 ) then - call Preload(((R2SW(((BlzGetUnitRealField(creep, UNIT_RF_MANA_REGENERATION))*1.0), 1, 2)))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! + call GroupClear(allCreeps) + call DestroyGroup(allCreeps) + set allCreeps=null - // sight range - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(BlzGetUnitRealField(creep, UNIT_RF_SIGHT_RADIUS))))) // INLINED!! - call Preload(("")) // INLINED!! + call GroupClear(allCreepsDistinct) + call DestroyGroup(allCreepsDistinct) + set allCreepsDistinct=null - call Preload(("")) // INLINED!! - - call h__RemoveUnit(creep) - set creep=null -endfunction + call RemoveLocation(tmpLocation) + set tmpLocation=null -function WoWReforgedWebsite__GenerateBuildingNewOpLimit takes nothing returns nothing - if ( GenerateId(WoWReforgedWebsite__tmpInteger) ) then - call WoWReforgedWebsite__GenerateBuildingEx(WoWReforgedWebsite__tmpInteger , WoWReforgedWebsite__tmpInteger2 , WoWReforgedWebsite__tmpInteger3) - endif + return result endfunction -function WoWReforgedWebsite__GenerateBuilding takes integer unitTypeId,integer index returns nothing - set WoWReforgedWebsite__tmpInteger=unitTypeId - set WoWReforgedWebsite__tmpInteger2=GetObjectRace(unitTypeId) - set WoWReforgedWebsite__tmpInteger3=index - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateBuildingNewOpLimit)) // INLINED!! -endfunction +function WoWReforgedRandomSaveCode___GetSaveCodeRandomItems takes player whichPlayer returns string + local item item0= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) + local item item1= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) + local item item2= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) + local item item3= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) + local item item4= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) + local item item5= CreateItem(ChooseRandomItem(GetRandomInt(0, 8)), 0.0, 0.0) + local string result -function WoWReforgedWebsite__GenerateNeutralBuildings takes nothing returns nothing - local integer max= (WoWReforgedRaces___objectTypeNeutralBuildingsCounter) // INLINED!! - local integer i= 0 - loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateBuilding((WoWReforgedRaces___objectTypeNeutralBuildings[(i)]) , i) // INLINED!! - set i=i + 1 - endloop -endfunction + call SetItemCharges(item0, GetRandomInt(1, 30)) + call SetItemCharges(item1, GetRandomInt(1, 30)) + call SetItemCharges(item2, GetRandomInt(1, 30)) + call SetItemCharges(item3, GetRandomInt(1, 30)) + call SetItemCharges(item4, GetRandomInt(1, 30)) + call SetItemCharges(item5, GetRandomInt(1, 30)) -function WoWReforgedWebsite__GenerateRaceBuildings takes nothing returns nothing - local integer max= (SaveObjectBuildingCounter) // INLINED!! - local integer i= 1 - loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateBuilding((SaveObjectIdBuilding[(i)]) , (WoWReforgedRaces___objectTypeNeutralBuildingsCounter) + i) // INLINED!! - set i=i + 1 - endloop -endfunction + set result=GetSaveCodeItemsEx2(GetPlayerName(whichPlayer) , IsInSinglePlayer() , IsPlayerWarlord(whichPlayer) , udg_GameType , R2I(GetPlayerHandicapXP(whichPlayer)) , true , 0 , item0 , item1 , item2 , item3 , item4 , item5) -function WoWReforgedWebsite__GenerateBuildings takes nothing returns nothing - call FileStart() - call Preload(("")) // INLINED!! - - set GenerateIds___generatedIdsCounter=0 // INLINED!! - - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateNeutralBuildings)) // INLINED!! + call h__RemoveItem(item0) + set item0=null - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRaceBuildings)) // INLINED!! - - call Preload(("")) // INLINED!! + call h__RemoveItem(item1) + set item1=null - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Buildings.txt")) // INLINED!! -endfunction + call h__RemoveItem(item2) + set item2=null -function WoWReforgedWebsite__GenerateItemEx takes integer itemTypeId,integer whichRace,integer index returns nothing - local item whichItem= CreateItem(itemTypeId, 0.0, 0.0) - local integer goldCost= 0 - local integer lumberCost= 0 - - call Preload(("")) // INLINED!! - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , GetItemName(whichItem)))) // INLINED!! - //call IconToHtml(itemTypeId) - call WoWReforgedWebsite__WriteItemPopoverWithIcon(itemTypeId , "items.html") - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetItemName(whichItem))) // INLINED!! - call Preload(("")) // INLINED!! - - // count - call Preload(("")) // INLINED!! - call Preload((WoWReforgedWebsite__GetItemCountInMap(itemTypeId))) // INLINED!! - call Preload(("")) // INLINED!! - - // race - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(whichRace) , (GetObjectName(udg_RaceTavernItemType[(whichRace)]))))) // INLINED!! - call WoWReforgedWebsite__RaceOrProfessionOrQuestIconToHtml(itemTypeId , whichRace) - call Preload(("")) // INLINED!! - - // building for tiny item - if ( (LoadInteger(WoWReforgedObjectMappings___h, (itemTypeId), 0)) != 0 ) then // INLINED!! - call Preload((WoWReforgedWebsite__ColumnDataOrder(A2S((LoadInteger(WoWReforgedObjectMappings___h, (itemTypeId), 0))) , GetObjectName((LoadInteger(WoWReforgedObjectMappings___h, (itemTypeId), 0)))))) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx((LoadInteger(WoWReforgedObjectMappings___h, (itemTypeId), 0)) , "buildings.html") // INLINED!! - call Preload(("")) // INLINED!! - else - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - endif - - // level - call Preload(("")) // INLINED!! - call Preload((I2S(GetItemLevel(whichItem)))) // INLINED!! - call Preload(("")) // INLINED!! - - // tooltip - //call FileWriteLine("") - //call FormatTooltip(BlzGetItemExtendedTooltip(whichItem)) - //call FileWriteLine("") - - // gold cost - call WoWReforgedWebsite__GenerateUnitTypeIdGoldCost(itemTypeId) - - // lumber cost - call WoWReforgedWebsite__GenerateUnitTypeIdLumberCost(itemTypeId) - - // charges - call Preload(("")) // INLINED!! - call Preload((I2S(GetItemCharges(whichItem)))) // INLINED!! - call Preload(("")) // INLINED!! + call h__RemoveItem(item3) + set item3=null - call Preload(("")) // INLINED!! - - call h__RemoveItem(whichItem) - set whichItem=null -endfunction + call h__RemoveItem(item4) + set item4=null -function WoWReforgedWebsite__GenerateItemNewOpLimit takes nothing returns nothing - if ( GenerateId(WoWReforgedWebsite__tmpInteger) ) then - call WoWReforgedWebsite__GenerateItemEx(WoWReforgedWebsite__tmpInteger , WoWReforgedWebsite__tmpInteger2 , WoWReforgedWebsite__tmpInteger3) - endif -endfunction + call h__RemoveItem(item5) + set item5=null -function WoWReforgedWebsite__GenerateItem takes integer itemTypeId,integer index returns nothing - set WoWReforgedWebsite__tmpInteger=itemTypeId - set WoWReforgedWebsite__tmpInteger2=GetObjectRace(itemTypeId) - set WoWReforgedWebsite__tmpInteger3=index - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateItemNewOpLimit)) // INLINED!! + return result endfunction -function WoWReforgedWebsite__GenerateNormalItemsEx takes integer start,integer count returns nothing - local integer i= start - local integer max= IMinBJ(start + count, (SaveObjectItemCounter)) // INLINED!! - // contain race and profession items - loop - exitwhen ( i >= max ) - if ( (SaveObjectIdItem[(i)]) != 0 ) then // INLINED!! - call WoWReforgedWebsite__GenerateItem((SaveObjectIdItem[(i)]) , i) // INLINED!! - else - call h__BJDebugMsg("Warning: Item save object with index " + I2S(i) + " is 0.") - endif - set i=i + 1 - endloop -endfunction +function WoWReforgedRandomSaveCode___ShowUrl takes player whichPlayer,string title,string saveCode returns nothing + + call ShowUrlUi(whichPlayer , title , saveCode) + + -function WoWReforgedWebsite__GenerateNormalItemsNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateNormalItemsEx(WoWReforgedWebsite__tmpInteger , WoWReforgedWebsite__tmpInteger2) endfunction -function WoWReforgedWebsite__GenerateNormalItems takes integer start,integer count returns nothing - set WoWReforgedWebsite__tmpInteger=start - set WoWReforgedWebsite__tmpInteger2=count - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateNormalItemsNewOpLimit)) // INLINED!! +function GenerateRandomSaveCode takes unit hero returns nothing + if ( GetRandomInt(0, 1) == 0 ) then + call ShowUrlUi((GetOwningPlayer(hero) ) , ( "Units Save Code" ) , ( WoWReforgedRandomSaveCode___GetSaveCodeRandomUnits(GetOwningPlayer(hero)))) // INLINED!! + else + call ShowUrlUi((GetOwningPlayer(hero) ) , ( "Items Save Code" ) , ( WoWReforgedRandomSaveCode___GetSaveCodeRandomItems(GetOwningPlayer(hero)))) // INLINED!! + endif endfunction -function WoWReforgedWebsite__GenerateLegendaryItems takes nothing returns nothing - local integer i= 0 - local integer max= udg_LegendaryItemTypeSize - loop - exitwhen ( i == max ) - if ( udg_LegendaryItemType[i] != 0 ) then - call WoWReforgedWebsite__GenerateItem(udg_LegendaryItemType[i] , (SaveObjectItemCounter) + i) // INLINED!! - else - call h__BJDebugMsg("Warning: Legendary item with index " + I2S(i) + " is 0.") - endif - set i=i + 1 - endloop + +//library WoWReforgedRandomSaveCode ends +//library WoWReforgedSaveCodesResources: + +function IsSavedResource takes integer index returns boolean + local integer r= (s__Resource_resources[(index)]) // INLINED!! + return r != Resources_GOLD and r != Resources_LUMBER and r != Resources_FOOD and r != Resources_FOOD_MAX endfunction -function WoWReforgedWebsite__GenerateQuestRewardItems takes nothing returns nothing +function CreateSaveCodeResourcesTextFile takes player owner,string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameTypeNumber,string saveCode returns nothing + local string singleplayer= "no" + local string singlePlayerFileName= "Multiplayer" + local string gameMode= "Freelancer" + local string gameType= "Normal" + local string content= "" + local string fileName= "" local integer i= 0 - local integer max= (WoWReforgedQuests__questsMax) // INLINED!! - loop - exitwhen ( i == max ) - if ( (WoWReforgedQuests__questReward[(i)]) != 0 ) then // INLINED!! - call WoWReforgedWebsite__GenerateItem((WoWReforgedQuests__questReward[(i)]) , (SaveObjectItemCounter) + udg_LegendaryItemTypeSize + i) // INLINED!! - else - call h__BJDebugMsg("Warning: Quest reward item with index " + I2S(i) + " is 0.") - endif - set i=i + 1 - endloop -endfunction + local integer max= (s__Resource_resourcesCount) // INLINED!! + + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" + endif + + if ( isWarlord ) then + set gameMode="Warlord" + endif + + if ( gameTypeNumber == udg_GameTypeEasy ) then + set gameType="Easy" + elseif ( gameTypeNumber == udg_GameTypeFast ) then + set gameType="Fast" + elseif ( gameTypeNumber == udg_GameTypeHardcore ) then + set gameType="Hardcore" + endif -function WoWReforgedWebsite__GenerateItems takes nothing returns nothing - local integer i= 1 - local integer max= (SaveObjectItemCounter) // INLINED!! call FileStart() - call Preload(("")) // INLINED!! + + set content=content + ("\r\n" + ("Code: -loadres " + saveCode)) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! - set GenerateIds___generatedIdsCounter=0 // INLINED!! + // The line below creates the log + call Preload((content)) // INLINED!! + set content="" - // contain race and profession items - // split because of huge number + set i=0 loop - exitwhen ( i >= max ) - call WoWReforgedWebsite__GenerateNormalItems(i , 100) - set i=i + 100 + exitwhen ( i == max ) + if ( IsSavedResource(i) ) then + set content=content + ("\r\n" + ((s__Resource_name[((s__Resource_resources[(i)]))]) + " - " + I2S(GetPlayerResource(owner , (s__Resource_resources[(i)]))))) // INLINED!! + set fileName=fileName + "-" + I2S(GetPlayerResource(owner , (s__Resource_resources[(i)]))) // INLINED!! + endif + set i=i + 1 endloop - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateLegendaryItems)) // INLINED!! - - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateQuestRewardItems)) // INLINED!! - - call Preload(("")) // INLINED!! + set content=content + ("\r\n" + ("")) // INLINED!! + + // The line below creates the log + call Preload((content)) // INLINED!! + set content="" // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Items.txt")) // INLINED!! + call PreloadGenEnd(("WoWR-" + playerName + "-" + singlePlayerFileName + "-" + gameType + "-" + gameMode + "-resources" + fileName + ".txt")) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateAllRaceIconsEx takes integer whichRace returns nothing - local unit hero= null - local integer r= 0 - local integer id= 0 +function GetSaveCodeResourcesEx takes string playerName,boolean isSinglePlayer,boolean isWarlord,integer gameType,integer xpRate,player owner returns string + local integer playerNameHash= CompressedAbsStringHash(playerName) + local string result= "" + local integer max= (s__Resource_resourcesCount) // INLINED!! local integer i= 0 - local integer max= (udg_HeroUnitTypeIndex) // INLINED!! - local integer d= 0 - local integer j= 0 - local integer max2= 0 - - set GenerateIds___generatedIdsCounter=0 // INLINED!! - // heroes - set i=0 - loop - exitwhen ( i >= max ) - set id=(udg_HeroUnitType[(i)]) // INLINED!! - if ( (udg_HeroRace[(i)]) == whichRace and id != 0 and GenerateId(id) ) then // INLINED!! - set hero=WoWReforgedWebsite__CreateTmpUnit(id) - call WoWReforgedWebsite__WriteUnitPopoverWithIconEx(hero , "heroes.html") - call h__RemoveUnit(hero) - set hero=null - endif - set i=i + 1 - endloop - // buildings - set i=RACE_OBJECT_TYPE_FARM - set max=RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 + 1 - loop - exitwhen ( i >= max ) - set id=GetRaceObjectTypeId(whichRace , i) - if ( id != 0 and GenerateId(id) ) then - call WoWReforgedWebsite__WriteBuildingPopoverWithIcon(id) - endif - set i=i + 1 - endloop - // units - set i=RACE_OBJECT_TYPE_WORKER - set max=RACE_MAX_OBJECT_TYPES - loop - exitwhen ( i >= max ) - set id=GetRaceObjectTypeId(whichRace , i) - if ( id != 0 and GenerateId(id) ) then - call WoWReforgedWebsite__WriteUnitPopoverWithIcon(id , "units.html") - - set d=(LoadInteger(WoWReforgedDependencyEquivalents___h, (id), 0)) // INLINED!! - if ( d != 0 ) then - set j=0 - set max2=s__DependencyEquivalents_count[d] - loop - exitwhen ( j >= max2 ) - call WoWReforgedWebsite__WriteUnitPopoverWithIcon(s___DependencyEquivalents_ids[s__DependencyEquivalents_ids[d]+j] , "units.html") - set j=j + 1 - endloop - endif - endif - set i=i + 1 - endloop - // researches - set max=(WoWReforgedResearches__researchesCounter) // INLINED!! + + //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + set result=result + ConvertDecimalNumberToSaveCodeSegment(SAVE_CODE_TYPE_RESOURCES) + set result=result + ConvertDecimalNumberToSaveCodeSegment(playerNameHash) + set result=result + ConvertDecimalNumberToSaveCodeSegment(GetSinglePlayerAndGameMode(isSinglePlayer , isWarlord)) + set result=result + ConvertDecimalNumberToSaveCodeSegment(gameType) + set result=result + ConvertDecimalNumberToSaveCodeSegment(xpRate) + set i=0 loop exitwhen ( i == max ) - set r=(WoWReforgedResearches__researches[(i)]) // INLINED!! - if ( r != 0 and (s__Research_whichRace[(r)]) == whichRace and (s__Research_researchId[(r)]) != 0 and GenerateId((s__Research_researchId[(r)])) ) then // INLINED!! - call WoWReforgedWebsite__WriteResearchPopoverWithIcon((s__Research_researchId[(r)])) // INLINED!! + if ( IsSavedResource(i) ) then + set result=result + ConvertDecimalNumberToSaveCodeSegment(GetPlayerResource(owner , (s__Resource_resources[(i)]))) // INLINED!! endif set i=i + 1 endloop -endfunction - -function WoWReforgedWebsite__GenerateAllRaceIconsNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateAllRaceIconsEx(WoWReforgedWebsite__tmpInteger) -endfunction -function WoWReforgedWebsite__GenerateAllRaceIcons takes integer whichRace returns nothing - set WoWReforgedWebsite__tmpInteger=whichRace - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateAllRaceIconsNewOpLimit)) // INLINED!! -endfunction + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) -function WoWReforgedWebsite__GenerateRaceEx takes integer i returns nothing - local item whichItem= CreateItem(udg_RaceTavernItemType[i], 0.0, 0.0) - local item scepterItem= CreateItem(udg_RaceItemType[i], 0.0, 0.0) - local item tinyItem= CreateItem(udg_RaceItemTypeTinyCastle[i], 0.0, 0.0) - call Preload(("")) // INLINED!! - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__WriteRacePopoverWithIconEx(whichItem , "races.html") - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload((GetItemName(whichItem))) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - // scepter - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(GetItemTypeId(scepterItem) , "items.html") - call Preload(("")) // INLINED!! - - // start building - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(GetItemTypeId(tinyItem) , "items.html") - call Preload(("")) // INLINED!! - - // bonus/required hero level - call Preload(("")) // INLINED!! - if ( (udg_RaceIsBonus[(i)]) ) then // INLINED!! - call Preload(("30")) // INLINED!! - else - call Preload(("-")) // INLINED!! + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) endif - call Preload(("")) // INLINED!! - - // all heroes buildings, units and researches - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__GenerateAllRaceIcons(i) - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - call h__RemoveItem(whichItem) - set whichItem=null - call h__RemoveItem(scepterItem) - set scepterItem=null - call h__RemoveItem(tinyItem) - set tinyItem=null -endfunction -function WoWReforgedWebsite__GenerateRaceNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateRaceEx(WoWReforgedWebsite__tmpInteger) + call CreateSaveCodeResourcesTextFile(owner , playerName , isSinglePlayer , isWarlord , gameType , result) + + call AddGeneratedSaveCode(result) + + return result endfunction -function WoWReforgedWebsite__GenerateRace takes integer whichRace returns nothing - set WoWReforgedWebsite__tmpInteger=whichRace - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRaceNewOpLimit)) // INLINED!! +function GetSaveCodeResources takes player whichPlayer returns string + local integer playerNameHash= CompressedAbsStringHash(GetPlayerName(whichPlayer)) + local boolean isSinglePlayer= IsInSinglePlayer() + local boolean isWarlord= udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] + local integer gameType= udg_GameType + local integer xpRate= R2I(GetPlayerHandicapXPBJ(whichPlayer)) + + return GetSaveCodeResourcesEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , whichPlayer) endfunction -function WoWReforgedWebsite__GenerateRaceTechnologyTreeBuildingEx takes integer unitTypeId returns nothing - local unit whichUnit +function ApplySaveCodeResources takes player whichPlayer,string s returns boolean + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local boolean isWarlord= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer pos= 5 local integer i= 0 - local integer max= 0 - local integer t= 0 - - if ( unitTypeId != 0 and GenerateId(unitTypeId) ) then - set whichUnit=WoWReforgedWebsite__CreateTmpUnit(unitTypeId) - - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - - call WoWReforgedWebsite__WriteBuildingPopoverWithIcon(unitTypeId) - call Preload(("
")) // INLINED!! - - // name - call Preload((GetUnitName(whichUnit))) // INLINED!! - call Preload(("
")) // INLINED!! + local integer max= (s__Resource_resourcesCount) // INLINED!! - // units trained - - - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - call h__RemoveUnit(whichUnit) - set whichUnit=null - endif -endfunction + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) -function WoWReforgedWebsite__GenerateRaceTechnologyTreeBuildingNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuildingEx(WoWReforgedWebsite__tmpInteger) -endfunction + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) + + if ( not (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! + if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameHash == CompressedAbsStringHash(GetPlayerName(whichPlayer)) and isSinglePlayer == IsInSinglePlayer() and gameType == udg_GameType and isWarlord == udg_PlayerIsWarlord[GetConvertedPlayerId(whichPlayer)] and xpRate == R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then + set i=0 + loop + exitwhen ( i >= max ) + if ( IsSavedResource(i) ) then + call SetPlayerResource(whichPlayer , (s__Resource_resources[(i)]) , (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS))) // INLINED!! + endif + set i=i + 1 + set pos=pos + 1 + endloop + + call AddGeneratedSaveCode(s) + endif + else + call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + endif -function WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding takes integer unitTypeId returns nothing - set WoWReforgedWebsite__tmpInteger=unitTypeId - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRaceTechnologyTreeBuildingNewOpLimit)) // INLINED!! + return false endfunction -function WoWReforgedWebsite__GenerateRaceTechnologyTreeEx takes integer whichRace returns nothing +function GetSaveCodeInfosResources takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "Multiplayer" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "Freelancer" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer pos= 5 local integer i= 0 - local integer max= 0 - - set GenerateIds___generatedIdsCounter=0 // INLINED!! - - // tier 1 - call Preload(("")) // INLINED!! - - // tier 1 - call Preload(("")) // INLINED!! - call Preload(("Tier 1")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_TIER_1)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_HOUSING)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_FARM)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_ALTAR)) - - // summoned heroes - - - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_BARRACKS)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MILL)) - - if ( GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MILL) != GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_BLACK_SMITH) ) then - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_BLACK_SMITH)) + local integer max= (s__Resource_resourcesCount) // INLINED!! + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + local string result= "" + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" endif - - // tower - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_SCOUT_TOWER)) - - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_GUARD_TOWER)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_CANNON_TOWER)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_ARCANE_TOWER)) - - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_SHOP)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_MINE)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_SHIPYARD)) - - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - // tier 2 - call Preload(("")) // INLINED!! - - // tier 2 - call Preload(("")) // INLINED!! - call Preload(("Tier 2")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_TIER_2)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_ARCANE_SANCTUM)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_GRYPHON_AVIARY)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_WORKSHOP)) - - if ( GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT) != 0 ) then - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_SACRIFICAL_PIT)) + + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" endif - - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - // tier 3 - call Preload(("")) // INLINED!! - - // tier 3 - call Preload(("")) // INLINED!! - call Preload(("Tier 3")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_TIER_3)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(GetRaceObjectTypeId(whichRace , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2)) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(POWER_GENERATOR) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(PORTAL) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(RESEARCH_TENT) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(EVENT_HOUSE) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(TRADING_POST) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(ALCHEMIST_LAB) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(WALL) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(ANTIMAGIC_WARD) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(SPELL_BOOK) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(MARKETPLACE) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(THIEVES_GUILD) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(MOUNTS_CAGE) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(DRAGON_ROOST) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(ARMORY) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(BANNER_SHOP) - - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - // tier 4 - call Preload(("")) // INLINED!! - - // tier 4 - call Preload(("")) // INLINED!! - call Preload(("Tier 4")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(TEMPLE_OF_LIGHT) - call WoWReforgedWebsite__GenerateRaceTechnologyTreeBuilding(TEMPLE_OF_DARKNESS) - - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! -endfunction -function WoWReforgedWebsite__GenerateRaceTechnologyTreeNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateRaceTechnologyTreeEx(WoWReforgedWebsite__tmpInteger) -endfunction + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif -function WoWReforgedWebsite__GenerateRaceTechnologyTree takes integer whichRace returns nothing - set WoWReforgedWebsite__tmpInteger=whichRace - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRaceTechnologyTreeNewOpLimit)) // INLINED!! -endfunction + if ( isWarlord ) then + set warlordStatus="Warlord" + endif -function WoWReforgedWebsite__GenerateRaces takes nothing returns nothing - local integer i= 0 - local integer max= udg_MaxRaces + set result=AppendSaveCodeInfo(result , "Type: " + saveCodeTypeName) + set result=AppendSaveCodeInfo(result , "Checksum: " + checksumStatus) + set result=AppendSaveCodeInfo(result , "Game: " + singlePlayerStatus) + set result=AppendSaveCodeInfo(result , "Game Mode: " + warlordStatus) + set result=AppendSaveCodeInfo(result , "Player Name: " + playerName) + set result=AppendSaveCodeInfo(result , "Game Type: " + gameTypeName) + set result=AppendSaveCodeInfo(result , "XP rate: " + I2S(xpRate)) - call FileStart() - call Preload(("")) // INLINED!! set i=0 loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateRace(i) + exitwhen ( i >= max ) + if ( IsSavedResource(i) ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + (s__Resource_name[((s__Resource_resources[(i)]))]) + " (" + I2S((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS))) + ")") // INLINED!! + set pos=pos + 1 + endif set i=i + 1 endloop - - call Preload(("")) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Races.txt")) // INLINED!! - - set i=0 - loop - exitwhen ( i == max ) - call FileStart() - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__GenerateRaceTechnologyTree(i) - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Race-" + (GetObjectName(udg_RaceTavernItemType[(i)])) + ".txt")) // INLINED!! - set i=i + 1 - endloop + return result endfunction -function WoWReforgedWebsite__GenerateProfessionEx takes integer p returns nothing +function GetSaveCodeShortInfosResources takes player whichPlayer,string s returns string + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(GetPlayerName(whichPlayer))) + local string playerName= GetPlayerName(whichPlayer) + local integer saveCodeType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 0) , SAVE_CODE_DIGITS)) // INLINED!! + local integer playerNameHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! + local integer isSinglePlayerAndWarlord= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 2) , SAVE_CODE_DIGITS)) // INLINED!! + local integer gameType= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 3) , SAVE_CODE_DIGITS)) // INLINED!! + local string gameTypeName= GetGameTypeName(gameType) + local integer xpRate= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 4) , SAVE_CODE_DIGITS)) // INLINED!! + local boolean isSinglePlayer= GetSinglePlayerFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string singlePlayerStatus= "M" + local boolean isWarlord= GetWarlordFromSaveCodeSegment(isSinglePlayerAndWarlord) + local string warlordStatus= "F" + local integer lastSaveCodeSegment= GetSaveCodeSegments(saveCode) - 1 + local string checkedSaveCode= GetSaveCodeUntil(saveCode , lastSaveCodeSegment) + local integer checksum= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( lastSaveCodeSegment) , SAVE_CODE_DIGITS)) // INLINED!! + local integer pos= 5 local integer i= 0 - local integer max= PROFESSION_RANK_MAX - local integer j= 0 - local integer max2= 0 - local item whichItem= CreateItem(GetProfessionItemTypeId(p), 0.0, 0.0) - - call Preload(("")) // INLINED!! - // icon - call Preload(("")) // INLINED!! - //call IconToHtml(GetProfessionItemTypeId(i)) - call WoWReforgedWebsite__WriteRacePopoverWithIconEx(whichItem , "professions.html") - //call WriteItemPopoverWithIcon(GetProfessionItemTypeId(i), "professions.html") - call Preload(("")) // INLINED!! - // name - call Preload(("")) // INLINED!! - call Preload((GetProfessionName(p))) // INLINED!! - call Preload(("")) // INLINED!! - // crafted items/units - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - set i=0 - set max=PROFESSION_RANK_MAX - loop - exitwhen ( i == max ) - set j=0 - set max2=GetProfessionCraftedItemsCount(p , i) - loop - exitwhen ( j >= max2 ) - if ( GetProfessionCraftedUnit(p , i , j) == 0 ) then - //call IconToHtmlEx(GetProfessionCraftedItem(i, j), "items.html") - call WoWReforgedWebsite__WriteItemPopoverWithIcon(GetProfessionCraftedItem(p , i , j) , "items.html") - else - //call IconToHtmlEx(GetProfessionCraftedUnit(i, j), "units.html") - call WoWReforgedWebsite__WriteUnitPopoverWithIcon(GetProfessionCraftedUnit(p , i , j) , "units.html") - endif - call Preload(("
(" + I2S(GetProfessionCraftedCount(p , i , j)) + ")
")) // INLINED!! - set j=j + 1 - endloop - set i=i + 1 - endloop - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - // book - call Preload(("")) // INLINED!! - //call IconToHtmlEx(GetProfessionBookItemTypeId(i), "items.html") - call WoWReforgedWebsite__WriteItemPopoverWithIcon(GetProfessionBookItemTypeId(p) , "items.html") - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - call h__RemoveItem(whichItem) - set whichItem=null -endfunction + local integer max= (s__Resource_resourcesCount) // INLINED!! + local string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) + local string checksumStatus= "Valid" + local string result= "" -function WoWReforgedWebsite__GenerateProfessionNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateProfessionEx(WoWReforgedWebsite__tmpInteger) -endfunction + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif -function WoWReforgedWebsite__GenerateProfession takes integer p returns nothing - set WoWReforgedWebsite__tmpInteger=p - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateProfessionNewOpLimit)) // INLINED!! -endfunction + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif -function WoWReforgedWebsite__GenerateProfessions takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedProfessions___professionsCounter) // INLINED!! + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif + + if ( isWarlord ) then + set warlordStatus="W" + endif - call FileStart() - call Preload(("")) // INLINED!! set i=0 loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateProfession(i) + exitwhen ( i >= max ) + if ( IsSavedResource(i) ) then + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - " + (s__Resource_name[((s__Resource_resources[(i)]))]) + " (" + I2S((ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( pos) , SAVE_CODE_DIGITS))) + ")") // INLINED!! + set pos=pos + 1 + endif set i=i + 1 endloop - - call Preload(("")) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Professions.txt")) // INLINED!! + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + result endfunction -function WoWReforgedWebsite__GeneratePlayers takes nothing returns nothing - local integer i= 0 - local integer max= (PrestoredSaveCodeCounter) // INLINED!! - local string saveCode= "" - local string playerName= "" - - call FileStart() - call Preload(("")) // INLINED!! - set i=0 - loop - exitwhen ( i == max ) - if ( (PrestoredSaveCodeType[(i)]) == PRESTORED_SAVECODE_TYPE_HEROES ) then // INLINED!! - set saveCode=(PrestoredSaveCode[(i)]) // INLINED!! - set playerName=(PrestoredSaveCodePlayerName[(i)]) // INLINED!! - - call Preload(("")) // INLINED!! - // name - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload((playerName)) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - // VIP - call Preload(("")) // INLINED!! - if ( IsAccountVIP(playerName) ) then - call Preload(("yes")) // INLINED!! - else - call Preload(("no")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // hero level 1 - call Preload(("")) // INLINED!! - call Preload((I2S(IMinBJ(MAX_HERO_LEVEL, GetHeroLevelByXP(GetSaveCodeXp1(playerName , saveCode)))))) // INLINED!! - call Preload(("")) // INLINED!! - - // hero level 2 - call Preload(("")) // INLINED!! - call Preload((I2S(IMinBJ(MAX_HERO_LEVEL, GetHeroLevelByXP(GetSaveCodeXp2(playerName , saveCode)))))) // INLINED!! - call Preload(("")) // INLINED!! - - // hero level 3 - call Preload(("")) // INLINED!! - call Preload((I2S(IMinBJ(MAX_HERO_LEVEL, GetHeroLevelByXP(GetSaveCodeXp3(playerName , saveCode)))))) // INLINED!! - call Preload(("")) // INLINED!! - - // gold - call Preload(("")) // INLINED!! - call Preload((I2S(GetSaveCodeGold(playerName , saveCode)))) // INLINED!! - call Preload(("")) // INLINED!! - - // lumber - call Preload(("")) // INLINED!! - call Preload((I2S(GetSaveCodeLumber(playerName , saveCode)))) // INLINED!! - call Preload(("")) // INLINED!! - - // hero kills - call Preload(("")) // INLINED!! - call Preload((I2S(GetSaveCodeHeroKills(playerName , saveCode)))) // INLINED!! - call Preload(("")) // INLINED!! - - // hero deaths - call Preload(("")) // INLINED!! - call Preload((I2S(GetSaveCodeHeroDeaths(playerName , saveCode)))) // INLINED!! - call Preload(("")) // INLINED!! - // savecode - call Preload(("")) // INLINED!! - call Preload((saveCode)) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - endif - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! +//library WoWReforgedSaveCodesResources ends +//library WoWReforgedStandardObjectFields: - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Players.txt")) // INLINED!! +function WoWReforgedStandardObjectFields__AddObjectMappingTinyItem takes integer whichRace,integer t0,integer t1 returns nothing + if ( GetRaceObjectTypeId(whichRace , t0) != 0 and GetRaceObjectTypeId(whichRace , t1) != 0 ) then + call AddObjectMapping(GetRaceObjectTypeId(whichRace , t0) , GetRaceObjectTypeId(whichRace , t1)) + endif endfunction -function WoWReforgedWebsite__GenerateClans takes nothing returns nothing - local integer i= 0 - local integer max= (PrestoredSaveCodeCounter) // INLINED!! - local string name= "" - local string saveCode= "" +function AddRaceStandardObjectIdFields takes nothing returns nothing local integer j= 0 local integer max2= 0 - local integer index= 0 - - set GenerateIds___generatedIdsStringsCounter=0 // INLINED!! - - call FileStart() - call Preload(("")) // INLINED!! - set i=0 + local integer max= (udg_MaxRaces) // INLINED!! + local integer i= 1 loop exitwhen ( i == max ) - if ( (PrestoredSaveCodeType[(i)]) == PRESTORED_SAVECODE_TYPE_CLANS ) then // INLINED!! - set name=(PrestoredSaveCodePlayerName[(i)]) // INLINED!! - - if ( GenerateIdString(name) ) then - set saveCode=(PrestoredSaveCode[(i)]) // INLINED!! - - call Preload(("")) // INLINED!! - - // banner - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((name)) // INLINED!! - call Preload(("")) // INLINED!! - - // gold - call Preload(("")) // INLINED!! - call Preload((I2S(GetSaveCodeClanGold(name , saveCode)))) // INLINED!! - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! - call Preload(("")) // INLINED!! - - // lumber - call Preload(("")) // INLINED!! - call Preload((I2S(GetSaveCodeClanLumber(name , saveCode)))) // INLINED!! - call Preload(("\"images/WC3lumber.webp\"")) // INLINED!! - call Preload(("")) // INLINED!! - - // members - call Preload(("")) // INLINED!! - call Preload(("
    ")) // INLINED!! - set j=0 - set max2=PrestoredSaveCodePlayerNamesCounter[i] - loop - exitwhen ( j == max2 ) - set index=Index2D(i , j , PRESTORED_SAVECODE_MAX_CLAN_MEMBERS) - call Preload(("
  • ")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(((PrestoredSaveCodePlayerNames[(index)]))) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload((" - ")) // INLINED!! - call Preload((GetClanRankName((PrestoredSaveCodePlayerRanks[(index)])))) // INLINED!! - call Preload(("
  • ")) // INLINED!! - - set j=j + 1 - endloop - - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - // savecode - call Preload(("")) // INLINED!! - call Preload((saveCode)) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - endif - endif + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_TIER_1 , RACE_OBJECT_TYPE_TIER_1_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_TIER_2 , RACE_OBJECT_TYPE_TIER_2_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_TIER_3 , RACE_OBJECT_TYPE_TIER_3_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_FARM , RACE_OBJECT_TYPE_FARM_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_ALTAR , RACE_OBJECT_TYPE_ALTAR_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_MILL , RACE_OBJECT_TYPE_MILL_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_BLACK_SMITH , RACE_OBJECT_TYPE_BLACK_SMITH_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_BARRACKS , RACE_OBJECT_TYPE_BARRACKS_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_WORKSHOP , RACE_OBJECT_TYPE_WORKSHOP_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_ARCANE_SANCTUM , RACE_OBJECT_TYPE_ARCANE_SANCTUM_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SCOUT_TOWER , RACE_OBJECT_TYPE_SCOUT_TOWER_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_GUARD_TOWER , RACE_OBJECT_TYPE_GUARD_TOWER_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_CANNON_TOWER , RACE_OBJECT_TYPE_CANNON_TOWER_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_ARCANE_TOWER , RACE_OBJECT_TYPE_ARCANE_TOWER_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SHOP , RACE_OBJECT_TYPE_SHOP_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_GRYPHON_AVIARY , RACE_OBJECT_TYPE_GRYPHON_AVIARY_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SACRIFICAL_PIT , RACE_OBJECT_TYPE_SACRIFICAL_PIT_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_HOUSING , RACE_OBJECT_TYPE_HOUSING_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SHIPYARD , RACE_OBJECT_TYPE_SHIPYARD_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING , RACE_OBJECT_TYPE_SPECIAL_BUILDING_ITEM) + call WoWReforgedStandardObjectFields__AddObjectMappingTinyItem(i , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2 , RACE_OBJECT_TYPE_SPECIAL_BUILDING_2_ITEM) + //call AddObjectMappingTinyItem(i, RACE_OBJECT_TYPE_MINE, RACE_OBJECT_TYPE_MINE_ITEM) + + + set i=i + 1 endloop - call Preload(("")) // INLINED!! + +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Clans.txt")) // INLINED!! + +//library WoWReforgedStandardObjectFields ends +//library WoWReforgedUpdateSkillUI: + + +function WoWReforgedUpdateSkillUI___Init takes nothing returns nothing + call TriggerAddAction(updateSkillUITrigger, function UpdateSkillPointsUIForAllPlayers) endfunction -function WoWReforgedWebsite__GenerateQuests takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedQuests__questsMax) // INLINED!! - - call FileStart() - call Preload(("")) // INLINED!! - set i=0 - loop - exitwhen ( i == max ) - call Preload(("")) // INLINED!! - // icon - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload(((WoWReforgedQuests__questTitle[(i)]))) // INLINED!! - call Preload(("")) // INLINED!! - - // npc - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx2(GetUnitTypeId((WoWReforgedQuests__questNpc[(i)])) , "npcs.html" , GetNpcName((WoWReforgedQuests__questNpc[(i)]))) // INLINED!! - call Preload(("")) // INLINED!! - - // reward - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx((WoWReforgedQuests__questReward[(i)]) , "items.html") // INLINED!! - call Preload(("")) // INLINED!! - // requirement - call Preload(("")) // INLINED!! - if ( (WoWReforgedQuests__questRequirement[(i)]) != - 1 ) then // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! +//library WoWReforgedUpdateSkillUI ends +//library WoWReforgedSaveCodesAll: - // description - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip((WoWReforgedQuests__questDescription[(i)])) // INLINED!! - //call FileWriteLine(GetQuestDescription(i)) - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! +function ResetSaveCodeAllTextFile takes player whichPlayer returns nothing + set WoWReforgedSaveCodesAll__loadedAllOnce[GetPlayerId(whichPlayer)]=true +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Quests.txt")) // INLINED!! +function GetModeSuffix takes nothing returns string + if ( IsInSinglePlayer() ) then + return "Singleplayer" + endif + return "Multiplayer" endfunction -function WoWReforgedWebsite__GenerateInfoQuest takes integer i returns nothing - local string id= StringReplace((WoWReforgedInfoQuests__questId[(i)]) , " " , "") // INLINED!! - local integer j= 0 - local integer max2= 0 - - call Preload(("")) // INLINED!! - // icon - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! +function GetGameTypeSuffixEx takes integer t returns string + if ( t == udg_GameTypeEasy ) then + return "Easy" + elseif ( t == udg_GameTypeFast ) then + return "Fast" + elseif ( t == udg_GameTypeHardcore ) then + return "Hardcore" + endif - // name - call Preload(("")) // INLINED!! - call Preload(((WoWReforgedInfoQuests__questTitle[(i)]))) // INLINED!! - call Preload(("")) // INLINED!! + return "Normal" +endfunction - // description - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip((WoWReforgedInfoQuests__questDescription[(i)])) // INLINED!! - call Preload(("")) // INLINED!! - - // items - call Preload(("")) // INLINED!! - call Preload(("
    ")) // INLINED!! - if ( (WoWReforgedInfoQuests__questHandle[(i)]) != null ) then // INLINED!! - set j=0 - set max2=QuestGetItemCount((WoWReforgedInfoQuests__questHandle[(i)])) // INLINED!! - loop - exitwhen ( j == max2 ) - call Preload(("
  • " + QuestItemGetDescription(QuestGetItem((WoWReforgedInfoQuests__questHandle[(i)]) , j)) + "
  • ")) // INLINED!! - set j=j + 1 - endloop - endif - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! +function GetGameTypeSuffix takes nothing returns string + return GetGameTypeSuffixEx(udg_GameType) +endfunction - call Preload(("")) // INLINED!! +function GetGameModeSuffix takes boolean isWarlord returns string + if ( isWarlord ) then + return "Warlord" + endif + + return "Freelancer" endfunction -function WoWReforgedWebsite__GenerateInfoQuestTmpInteger takes nothing returns nothing - call WoWReforgedWebsite__GenerateInfoQuest(WoWReforgedWebsite__tmpInteger) +function GetSaveCodeAllFileName takes string playerName,boolean isWarlord returns string + return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + ".txt" // INLINED!! endfunction -function WoWReforgedWebsite__GenerateInfoQuestOpLimit takes integer i returns nothing - set WoWReforgedWebsite__tmpInteger=i - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateInfoQuestTmpInteger)) // INLINED!! +function GetSaveCodeAllItemsFileName takes string playerName,boolean isWarlord returns string + return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Items.txt" // INLINED!! endfunction -function WoWReforgedWebsite__GenerateInfoQuests takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedInfoQuests__questsMax) // INLINED!! - - call FileStart() - call Preload(("")) // INLINED!! - set i=0 - loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateInfoQuestOpLimit(i) - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! +function GetSaveCodeAllUnitsFileName takes string playerName,boolean isWarlord returns string + return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Units.txt" // INLINED!! +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-InfoQuests.txt")) // INLINED!! +function GetSaveCodeAllBuildingsFileName takes string playerName,boolean isWarlord returns string + return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Buildings.txt" // INLINED!! endfunction -function WoWReforgedWebsite__GenerateNpcs takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedNpcs__npcUnitTypeIdsCount) // INLINED!! - local integer unitTypeId= 0 - local integer zone= 0 - local unit u= null - - call FileStart() - call Preload(("")) // INLINED!! - set i=0 - loop - exitwhen ( i == max ) - set unitTypeId=(WoWReforgedNpcs__npcUnitTypeIds[(i)]) // INLINED!! - set u=GetNpcUnitByUnitTypeId(unitTypeId) - - if ( u != null ) then - call Preload(("")) // INLINED!! - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx((unitTypeId) , "") // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetNpcName(u))) // INLINED!! - call Preload(("")) // INLINED!! - - // location - call Preload(("")) // INLINED!! - set zone=GetZoneByCoordinates(GetUnitX(u) , GetUnitY(u)) - if ( zone != 0 ) then - call WoWReforgedWebsite__IconToHtmlEx4((s__AbstractZone_icon[(zone)]) , "zones.html" , (s__AbstractZone_name[(zone)]) , (s__AbstractZone_id[(zone)])) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! +function GetSaveCodeAllResearchesFileName takes string playerName,boolean isWarlord returns string + return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Researches.txt" // INLINED!! +endfunction - call Preload(("")) // INLINED!! - endif - set u=null - set i=i + 1 - endloop +function GetSaveCodeAllResourcesFileName takes string playerName,boolean isWarlord returns string + return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Resources.txt" // INLINED!! +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Npcs.txt")) // INLINED!! +function GetSaveCodeAllClanFileName takes string playerName,boolean isWarlord returns string + return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Clan.txt" // INLINED!! endfunction -function WoWReforgedWebsite__GenerateResearchEx takes integer researchId,integer whichRace,integer index returns nothing - call Preload(("")) // INLINED!! - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , GetObjectName(researchId)))) // INLINED!! - //call IconToHtml(researchId) - call WoWReforgedWebsite__WriteResearchPopoverWithIcon(researchId) - call Preload(("")) // INLINED!! +function GetSaveCodeAllFileNameForPlayer takes player whichPlayer returns string + return GetSaveCodeAllFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +endfunction - // name - call Preload(("")) // INLINED!! - call Preload((GetObjectName(researchId))) // INLINED!! - call Preload(("")) // INLINED!! - - // race - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(whichRace) , (GetObjectName(udg_RaceTavernItemType[(whichRace)]))))) // INLINED!! - call WoWReforgedWebsite__RaceIconToHtml(whichRace) - call Preload(("")) // INLINED!! - - // description - - - // levels - call Preload(("")) // INLINED!! - call Preload((I2S(GetPlayerTechMaxAllowed(Player(0), researchId)))) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! +function GetSaveCodeAllFileNameItemsForPlayer takes player whichPlayer returns string + return GetSaveCodeAllItemsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) endfunction -function WoWReforgedWebsite__GenerateResearchNewOpLimit takes nothing returns nothing - if ( GenerateId(WoWReforgedWebsite__tmpInteger) ) then - call WoWReforgedWebsite__GenerateResearchEx(WoWReforgedWebsite__tmpInteger , WoWReforgedWebsite__tmpInteger2 , WoWReforgedWebsite__tmpInteger3) - endif +function GetSaveCodeAllFileNameUnitsForPlayer takes player whichPlayer returns string + return GetSaveCodeAllUnitsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) endfunction -function WoWReforgedWebsite__GenerateResearch takes integer researchId,integer whichRace,integer index returns nothing - set WoWReforgedWebsite__tmpInteger=researchId - set WoWReforgedWebsite__tmpInteger2=whichRace - set WoWReforgedWebsite__tmpInteger3=index - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateResearchNewOpLimit)) // INLINED!! +function GetSaveCodeAllFileNameBuildingsForPlayer takes player whichPlayer returns string + return GetSaveCodeAllBuildingsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) endfunction -function WoWReforgedWebsite__GenerateResearches takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedResearches__researchesCounter) // INLINED!! - local integer r= 0 +function GetSaveCodeAllFileNameResearchesForPlayer takes player whichPlayer returns string + return GetSaveCodeAllResearchesFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +endfunction - call FileStart() +function GetSaveCodeAllFileNameResourcesForPlayer takes player whichPlayer returns string + return GetSaveCodeAllResourcesFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +endfunction - call Preload(("")) // INLINED!! - set i=0 - loop - exitwhen ( i == max ) - set r=(WoWReforgedResearches__researches[(i)]) // INLINED!! - if ( r != 0 ) then - call WoWReforgedWebsite__GenerateResearch((s__Research_researchId[(r)]) , (s__Research_whichRace[(r)]) , i) // INLINED!! - endif - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Researches.txt")) // INLINED!! +function GetSaveCodeAllFileNameClanForPlayer takes player whichPlayer returns string + return GetSaveCodeAllClanFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) endfunction -function WoWReforgedWebsite__GenerateSpell takes integer i returns nothing - call Preload(("")) // INLINED!! - // icon - call Preload(("")) // INLINED!! - //call IconToHtml(GetLearnableSkillAbilityId(i)) - call WoWReforgedWebsite__WriteHeroAbilityPopoverWithIcon((WoWReforgedLearnableSkills___learnableSkillAbilityId[(i)]) , "spells.html") // INLINED!! - - call Preload(("")) // INLINED!! - // name - call Preload(("")) // INLINED!! - call Preload((GetObjectName((WoWReforgedLearnableSkills___learnableSkillAbilityId[(i)])))) // INLINED!! - call Preload(("")) // INLINED!! - - // race - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - - // hero - call Preload(("")) // INLINED!! - call Preload(("yes")) // INLINED!! - call Preload(("")) // INLINED!! - - // description - - // slot - call Preload(("")) // INLINED!! - call Preload((I2S((WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) + 1))) // INLINED!! - call Preload(("")) // INLINED!! - // required level - call Preload(("")) // INLINED!! - if ( (WoWReforgedLearnableSkills___learnableSkillSlot[(i)]) == 3 ) then // INLINED!! - call Preload(("6")) // INLINED!! - else - call Preload(("1")) // INLINED!! - endif - call Preload(("")) // INLINED!! - // levels - call Preload(("")) // INLINED!! - call Preload(("15")) // INLINED!! - call Preload(("")) // INLINED!! - // equipment bag - call Preload(("")) // INLINED!! - if ( (WoWReforgedLearnableSkills___learnableSkillForbidEquipmentBag[(i)]) ) then // INLINED!! - call Preload(("no")) // INLINED!! - else - call Preload(("yes")) // INLINED!! - endif - call Preload(("")) // INLINED!! +function CreateSaveCodeAllHeroesTextFileEx takes player whichPlayer returns nothing + local string playerName= GetPlayerName(whichPlayer) + local string saveCode= GetSaveCode(whichPlayer) + local string content= "" - call Preload(("")) // INLINED!! + set content=content + " -load " + saveCode + set content=content + " " + call FileIO_Write(GetSaveCodeAllFileNameForPlayer(whichPlayer) , content) endfunction +function CreateSaveCodeAllHeroesTextFileNewOpLimit takes nothing returns nothing + call CreateSaveCodeAllHeroesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +endfunction -function GenerateSpellNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateSpell(WoWReforgedWebsite__tmpSpellIndex) +function CreateSaveCodeAllHeroesTextFile takes player whichPlayer returns nothing + set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer + call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllHeroesTextFileNewOpLimit)) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateSpells takes nothing returns nothing +function CreateSaveCodeAllItemsTextFileEx takes player whichPlayer returns nothing + local string playerName= GetPlayerName(whichPlayer) + local string saveCode= "" + local string content= "" local integer i= 0 - local integer max= (WoWReforgedLearnableSkills___learnableSkillCounter) // INLINED!! - local integer max2= 0 - local integer abilityId= 0 - call FileStart() - call Preload(("")) // INLINED!! - - set i=0 + local integer max= (3 + BACKPACK_MAX_PAGES + 3) // INLINED!! loop - exitwhen ( i == max ) - if ( IsLearnableSkillValid(i) ) then - set WoWReforgedWebsite__tmpSpellIndex=i - call ForForce(bj_FORCE_PLAYER[0], (function GenerateSpellNewOpLimit)) // INLINED!! + exitwhen ( i >= max ) + set saveCode=GetSaveCodeItemsForIndex(whichPlayer , false , i) + if ( saveCode != null and saveCode != "" ) then + set content=content + " -loadi " + saveCode + set content=content + " " endif set i=i + 1 endloop - - set i=0 - set max2=(WoWReforgedRaces___objectTypeAbilitiesCounter) // INLINED!! - loop - exitwhen ( i == max2 ) - set abilityId=(WoWReforgedRaces___objectTypeAbilities[(i)]) // INLINED!! - call Preload(("")) // INLINED!! - // icon - call Preload(("")) // INLINED!! - //call IconToHtml(abilityId) - call WoWReforgedWebsite__WriteAbilityPopoverWithIcon(abilityId , "spells.html") - call Preload(("")) // INLINED!! - // name - call Preload(("")) // INLINED!! - call Preload((GetObjectName(abilityId))) // INLINED!! - call Preload(("")) // INLINED!! - // race - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S((WoWReforgedRaces___objectTypeAbilitiesRace[(i)])) , (GetObjectName(udg_RaceTavernItemType[((WoWReforgedRaces___objectTypeAbilitiesRace[(i)]))]))))) // INLINED!! - call WoWReforgedWebsite__RaceIconToHtml((WoWReforgedRaces___objectTypeAbilitiesRace[(i)])) // INLINED!! - call Preload(("")) // INLINED!! - - // hero - call Preload(("")) // INLINED!! - call Preload(("no")) // INLINED!! - call Preload(("")) // INLINED!! - // description - - // slot - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - // required level - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - // levels - call Preload(("")) // INLINED!! - call Preload((I2S((WoWReforgedRaces___objectTypeAbilitiesLevels[(i)])))) // INLINED!! - call Preload(("")) // INLINED!! - // Allowed for Equipment Bag - call Preload(("")) // INLINED!! - call Preload(("-")) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - set i=i + 1 - endloop - call Preload(("")) // INLINED!! + call FileIO_Write(GetSaveCodeAllFileNameItemsForPlayer(whichPlayer) , content) +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Spells.txt")) // INLINED!! +function CreateSaveCodeAllItemsTextFileNewOpLimit takes nothing returns nothing + call CreateSaveCodeAllItemsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) endfunction -function WoWReforgedWebsite__GenerateMounts takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedMounts__mountTypesCounter) // INLINED!! - local integer j= 0 - local boolean isRunningWild= false - local integer maxHeroSpells= 0 - local integer abilityId= 0 - local unit mount= null - - call FileStart() - call Preload(("")) // INLINED!! +function CreateSaveCodeAllItemsTextFile takes player whichPlayer returns nothing + set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer + call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllItemsTextFileNewOpLimit)) // INLINED!! +endfunction - set i=0 +function CreateSaveCodeAllUnitsTextFileEx takes player whichPlayer returns nothing + local string playerName= GetPlayerName(whichPlayer) + local string saveCode= "" + local string content= "" + local integer i= 0 + local integer max= (8) // INLINED!! loop - exitwhen ( i == max ) - set isRunningWild=s__WoWReforgedMounts__M_itemTypeId[(WoWReforgedMounts__mountTypes[(i)])] == WoWReforgedMounts_RUNNING_WILD_ITEM_TYPE_ID // INLINED!! - set mount=WoWReforgedWebsite__CreateTmpUnit(s__WoWReforgedMounts__M_unitTypeId[(WoWReforgedMounts__mountTypes[(i)])]) // INLINED!! - call Preload(("")) // INLINED!! - // icon - - - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(i) , GetObjectName(s__WoWReforgedMounts__M_unitTypeId[(WoWReforgedMounts__mountTypes[(i)])])))) // INLINED!! - call WoWReforgedWebsite__WriteItemPopoverWithIcon(s__WoWReforgedMounts__M_itemTypeId[(WoWReforgedMounts__mountTypes[(i)])] , "items.html") // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload((GetUnitName(mount))) // INLINED!! - else - call Preload((GetObjectName(s__WoWReforgedMounts__M_itemTypeId[(WoWReforgedMounts__mountTypes[(i)])]))) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // abilities - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - if ( not isRunningWild ) then - set j=0 - loop - exitwhen ( j == WoWReforgedWebsite__MAX_ABILITIES ) - set abilityId=BlzGetAbilityId(BlzGetUnitAbilityByIndex(mount, j)) - if ( abilityId != 0 and WoWReforgedWebsite__IsValidAbility(abilityId) ) then - call WoWReforgedWebsite__IconToHtmlEx(abilityId , "spells.html") - endif - set j=j + 1 - endloop - else - call WoWReforgedWebsite__IconToHtmlEx(WoWReforgedMounts_RUNNING_WILD_WORGEN_DEATH_KNIGHT , "spells.html") - endif - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - // move type - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload((WoWReforgedWebsite__GetMoveType(mount))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // move speed - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload((I2S(R2I(GetUnitMoveSpeed(mount))))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // attack type - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call WoWReforgedWebsite__GenerateAttackTypeCell(mount) - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // attack speed - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload(((R2SW(((BlzGetUnitWeaponRealField(mount, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, 0))*1.0), 1, 2)))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // attack range - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload((I2S(R2I(BlzGetUnitWeaponRealField(mount, UNIT_WEAPON_RF_ATTACK_RANGE, 0))))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // attack damage - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload((WoWReforgedWebsite__GetUnitDamage(mount))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // armor type - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call WoWReforgedWebsite__GenerateArmorCell(mount) - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // armor - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload((I2S(R2I(BlzGetUnitArmor(mount))))) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // day sight range - call Preload(("")) // INLINED!! - if ( not isRunningWild ) then - call Preload((I2S(R2I(BlzGetUnitRealField(mount, UNIT_RF_SIGHT_RADIUS))))) // INLINED!! - else - call Preload(("-")) // INLINED!! + exitwhen ( i >= max ) + //call BJDebugMsg("Loop " + I2S(i) + " for units") + set saveCode=GetSaveCodeUnitsForIndex(whichPlayer , false , i) + if ( saveCode != null and saveCode != "" ) then + set content=content + " -loadu " + saveCode + set content=content + " " endif - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - call h__RemoveUnit(mount) - set mount=null - set i=i + 1 endloop - call Preload(("")) // INLINED!! + call FileIO_Write(GetSaveCodeAllFileNameUnitsForPlayer(whichPlayer) , content) +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Mounts.txt")) // INLINED!! +function CreateSaveCodeAllUnitsTextFileNewOpLimit takes nothing returns nothing + call CreateSaveCodeAllUnitsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +endfunction + +function CreateSaveCodeAllUnitsTextFile takes player whichPlayer returns nothing + set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer + call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllUnitsTextFileNewOpLimit)) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateChatCommands takes nothing returns nothing +function CreateSaveCodeAllBuildingsTextFileEx takes player whichPlayer returns nothing + local string playerName= GetPlayerName(whichPlayer) + local string saveCode= "" + local string content= "" local integer i= 0 - local integer max= QuestGetItemCount(udg_QuestChatCommands) - - call FileStart() - call Preload(("")) // INLINED!! - call Preload(("
    ")) // INLINED!! + local integer max= (8) // INLINED!! loop - exitwhen ( i == max ) - call Preload(("
  • " + QuestItemGetDescription(QuestGetItem(udg_QuestChatCommands , i)) + "
  • ")) // INLINED!! + exitwhen ( i >= max ) + //call BJDebugMsg("Loop " + I2S(i) + " for buildings") + set saveCode=GetSaveCodeBuildingsForIndex(whichPlayer , false , i) + if ( saveCode != null and saveCode != "" ) then + set content=content + " -loadb " + saveCode + set content=content + " " + endif set i=i + 1 endloop - - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-ChatCommands.txt")) // INLINED!! + set content=content + " " + + call FileIO_Write(GetSaveCodeAllFileNameBuildingsForPlayer(whichPlayer) , content) endfunction -function WoWReforgedWebsite__GenerateHeroJourney takes nothing returns nothing - local integer i= 0 - local integer max= QuestGetItemCount(udg_QuestHeroJourney) - - call FileStart() - call Preload(("")) // INLINED!! - call Preload(("
    ")) // INLINED!! - loop - exitwhen ( i == max ) - call Preload(("
  • " + QuestItemGetDescription(QuestGetItem(udg_QuestHeroJourney , i)) + "
  • ")) // INLINED!! - set i=i + 1 - endloop - - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! +function CreateSaveCodeAllBuildingsTextFileNewOpLimit takes nothing returns nothing + call CreateSaveCodeAllBuildingsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-HeroJourney.txt")) // INLINED!! +function CreateSaveCodeAllBuildingsTextFile takes player whichPlayer returns nothing + set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer + call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllBuildingsTextFileNewOpLimit)) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateCredits takes nothing returns nothing +function CreateSaveCodeAllResearchesTextFileEx takes player whichPlayer returns nothing + local string playerName= GetPlayerName(whichPlayer) + local string saveCode= "" + local string content= "" local integer i= 0 - local integer max= QuestGetItemCount(udg_QuestCredits) - - call FileStart() - call Preload(("")) // INLINED!! - call Preload(("
    ")) // INLINED!! + local integer max= (8) // INLINED!! loop - exitwhen ( i == max ) - call Preload(("
  • " + QuestItemGetDescription(QuestGetItem(udg_QuestCredits , i)) + "
  • ")) // INLINED!! + exitwhen ( i >= max ) + //call BJDebugMsg("Loop " + I2S(i) + " for researches") + set saveCode=GetSaveCodeResearchesForIndex(whichPlayer , false , i) + if ( saveCode != null and saveCode != "" ) then + set content=content + " -loadr " + saveCode + set content=content + " " + endif set i=i + 1 endloop - - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Credits.txt")) // INLINED!! -endfunction + set content=content + " " -function WoWReforgedWebsite__GenerateZoneEx takes integer i returns nothing - local integer zone= (WoWReforgedZones__zones[(i)]) // INLINED!! - call Preload(("")) // INLINED!! + call FileIO_Write(GetSaveCodeAllFileNameResearchesForPlayer(whichPlayer) , content) +endfunction - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__Icon("???" , "" , (s__AbstractZone_name[(zone)]) , (s__AbstractZone_icon[(zone)])) // INLINED!! - call Preload(("")) // INLINED!! +function CreateSaveCodeAllResearchesTextFileNewOpLimit takes nothing returns nothing + call CreateSaveCodeAllResearchesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +endfunction - // name - call Preload(("")) // INLINED!! - call Preload(((s__AbstractZone_name[(zone)]))) // INLINED!! - call Preload(("")) // INLINED!! - - // type - call Preload(("")) // INLINED!! - if ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_ZONE ) then - call Preload(("Zone")) // INLINED!! - elseif ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_CONTINENT ) then - call Preload(("Continent")) // INLINED!! - elseif ( s__AbstractZone_zoneType[zone] == ZONE_TYPE_WORLD ) then - call Preload(("World")) // INLINED!! - else - call Preload(("???")) // INLINED!! - endif - call Preload(("")) // INLINED!! +function CreateSaveCodeAllResearchesTextFile takes player whichPlayer returns nothing + set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer + call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllResearchesTextFileNewOpLimit)) // INLINED!! +endfunction - // size - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(GetZoneTotalArea(zone) / bj_CELLWIDTH)))) // INLINED!! - call Preload(("")) // INLINED!! +function CreateSaveCodeAllResourcesTextFileEx takes player whichPlayer returns nothing + local string playerName= GetPlayerName(whichPlayer) + local string saveCode= GetSaveCodeResources(whichPlayer) + local string content= "" - // description - call Preload(("")) // INLINED!! - if ( (s__AbstractZone_description[(zone)]) != null and StringLength((s__AbstractZone_description[(zone)])) > 0 ) then // INLINED!! - call WoWReforgedWebsite__FormatTooltip((s__AbstractZone_description[(zone)])) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! + set content=content + " -loadres " + saveCode + set content=content + " " - call Preload(("")) // INLINED!! + call FileIO_Write(GetSaveCodeAllFileNameResourcesForPlayer(whichPlayer) , content) endfunction -function WoWReforgedWebsite__GenerateZoneOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateZoneEx(WoWReforgedWebsite__tmpInteger) +function CreateSaveCodeAllResourcesTextFileNewOpLimit takes nothing returns nothing + call CreateSaveCodeAllResourcesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) endfunction -function WoWReforgedWebsite__GenerateZone takes integer index returns nothing - set WoWReforgedWebsite__tmpInteger=index - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateZoneOpLimit)) // INLINED!! +function CreateSaveCodeAllResourcesTextFile takes player whichPlayer returns nothing + set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer + call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllResourcesTextFileNewOpLimit)) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateZones takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! - local integer zone= 0 - - call FileStart() - call Preload(("")) // INLINED!! - loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateZone(i) - set i=i + 1 - endloop +function CreateSaveCodeAllClanTextFileEx takes player whichPlayer,string clanName returns nothing + local string saveCode= GetSaveCodeClan((udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))])) // INLINED!! + local string content= "" - call Preload(("")) // INLINED!! + set content=content + " -clan " + clanName + set content=content + " -loadc " + saveCode + set content=content + " " - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Zones.txt")) // INLINED!! + call FileIO_Write(GetSaveCodeAllFileNameClanForPlayer(whichPlayer) , content) endfunction -function WoWReforgedWebsite__GenerateRecipeEx takes integer i returns nothing - local integer j= 0 - local integer max2= 0 - - call Preload(("")) // INLINED!! - - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(((Crafting___recipesUIItemTypeIds[(i)])) , "") // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload(((GetObjectName(Crafting___recipesUIItemTypeIds[(i)])))) // INLINED!! - call Preload(("")) // INLINED!! - - // item/unit - call Preload(("")) // INLINED!! - if ( (Crafting___recipesIsUnit[(i)]) ) then // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx((Crafting___recipesItemTypeIds[(i)]) , "units.html") // INLINED!! - else - call WoWReforgedWebsite__IconToHtmlEx((Crafting___recipesItemTypeIds[(i)]) , "items.html") // INLINED!! - endif - call Preload(("")) // INLINED!! - - // description - call Preload(("")) // INLINED!! - call Preload(("
")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip((Crafting___recipesUIItemTypeIds[(i)]), 0)) // INLINED!! - call Preload(("
")) // INLINED!! - call Preload(("")) // INLINED!! - - // requirements - call Preload(("")) // INLINED!! - set j=0 - set max2=(Crafting___recipesRequirementCounters[(i)]) // INLINED!! - - loop - exitwhen ( j == max2 ) - call WoWReforgedWebsite__IconToHtmlEx(GetRecipeRequirementItemTypeId(i , j) , "items.html") - call Preload((" (" + I2S(GetRecipeRequirementCharges(i , j)) + ")")) // INLINED!! - set j=j + 1 - endloop - - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! +function CreateSaveCodeAllClanTextFileNewOpLimit takes nothing returns nothing + call CreateSaveCodeAllClanTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer , WoWReforgedSaveCodesAll__tmpString) endfunction -function WoWReforgedWebsite__GenerateRecipeNewOpLimit takes nothing returns nothing - call WoWReforgedWebsite__GenerateRecipeEx(WoWReforgedWebsite__tmpInteger) +function CreateSaveCodeAllClanTextFile takes player whichPlayer,string clanName returns nothing + set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer + set WoWReforgedSaveCodesAll__tmpString=clanName + call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllClanTextFileNewOpLimit)) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateRecipe takes integer recipe returns nothing - set WoWReforgedWebsite__tmpInteger=recipe - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRecipeNewOpLimit)) // INLINED!! +function CreateSaveCodeAllTextFile takes player whichPlayer returns nothing + if ( WoWReforgedSaveCodesAll__loadedAllOnce[GetPlayerId(whichPlayer)] ) then + call CreateSaveCodeAllHeroesTextFile(whichPlayer) + //call BJDebugMsg("After heroes") + call CreateSaveCodeAllItemsTextFile(whichPlayer) + //call BJDebugMsg("After items") + call CreateSaveCodeAllUnitsTextFile(whichPlayer) + //call BJDebugMsg("After units") + call CreateSaveCodeAllBuildingsTextFile(whichPlayer) + //call BJDebugMsg("After buildings") + call CreateSaveCodeAllResearchesTextFile(whichPlayer) + //call BJDebugMsg("After researches") + call CreateSaveCodeAllResourcesTextFile(whichPlayer) + //call BJDebugMsg("After resources") + if ( (udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))]) > 0 ) then // INLINED!! + call CreateSaveCodeAllClanTextFile(whichPlayer , (udg_ClanName[((udg_ClanPlayerClan[GetConvertedPlayerId((whichPlayer))]))])) // INLINED!! + endif + else + call h__DisplayTextToPlayer(whichPlayer, 0.0, 0.0, "At least load all savecodes once with \"-aload\" before saving it again or use \"-areset\" to overwrite your automatic savecode.") + endif endfunction -function WoWReforgedWebsite__GenerateRecipes takes nothing returns nothing +function GetSaveCodeFromFile takes string s,string prefix,integer tokenIndex returns string + local integer index= 0 + local integer index2= 0 local integer i= 0 - local integer max= (Crafting___recipesCounter) // INLINED!! - - call FileStart() - call Preload(("")) // INLINED!! loop - exitwhen ( i == max ) - if ( not (Crafting___recipesIsSpacer[(i)]) ) then // INLINED!! - call WoWReforgedWebsite__GenerateRecipe(i) + set index=IndexOfStringEx(prefix , s , index2) + if ( index != - 1 ) then + set index2=IndexOfStringEx(" " , s , index + StringLength(prefix)) + if ( index2 != - 1 and tokenIndex == i ) then + return SubString(s, index + StringLength(prefix), index2) + endif endif + exitwhen ( index == - 1 or index2 == - 1 ) set i=i + 1 endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Recipes.txt")) // INLINED!! + return null endfunction -function WoWReforgedWebsite__GenerateResources takes nothing returns nothing - local integer i= 0 - local integer max= (s__Resource_resourcesCount) // INLINED!! - local integer r= 0 - - call FileStart() - call Preload(("")) // INLINED!! - - loop - exitwhen ( i == max ) - set r=(s__Resource_resources[(i)]) // INLINED!! - call Preload(("")) // INLINED!! - - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx3((s__Resource_icon[(r)]) , "resources.html" , (s__Resource_name[(r)])) // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload(((s__Resource_name[(r)]))) // INLINED!! - call Preload(("")) // INLINED!! - - // gold exchange rate - call Preload(("")) // INLINED!! - call Preload((R2SW((s__Resource_goldExchangeRate[(r)]), 0, 2))) // INLINED!! - call Preload(("")) // INLINED!! - - // tax levels - call Preload(("")) // INLINED!! - if ( r == Resources_GOLD ) then - call Preload(("
    ")) // INLINED!! - call Preload(("
  • ")) // INLINED!! - call Preload(("0-150 Food: 100 percent income")) // INLINED!! - call Preload(("
  • ")) // INLINED!! - call Preload(("
  • ")) // INLINED!! - call Preload(("151-250 Food: 70 percent income")) // INLINED!! - call Preload(("
  • ")) // INLINED!! - call Preload(("
  • ")) // INLINED!! - call Preload(("251-600 Food: 40 percent income")) // INLINED!! - call Preload(("
  • ")) // INLINED!! - call Preload(("
")) // INLINED!! - elseif ( r == Resources_LUMBER ) then - call Preload(("-")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! +// TODO Create hero and apply settings before. +function LoadSaveCodeAllHeroes takes player whichPlayer,string allSaveCodes returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string saveCode= GetSaveCodeFromFile(allSaveCodes , "-load " , 0) + if ( saveCode != null ) then + if ( TimerGetRemaining(udg_SaveCodeCooldownHeroTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then + if ( ApplySaveCode(whichPlayer , saveCode) ) then + call StartTimerBJ(udg_SaveCodeCooldownHeroTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownHeroes) + endif + else + call SimError(whichPlayer , "You can load another savecode for heroes in: " + FormatTimeString(R2I(TimerGetRemaining(udg_SaveCodeCooldownHeroTimer[GetConvertedPlayerId(whichPlayer)]))) + ".") + endif - // description - call Preload(("")) // INLINED!! - call Preload(((s__Resource_description[(r)]))) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Resources.txt")) // INLINED!! -endfunction - -function WoWReforgedWebsite__AchievementNameToId takes string name returns string - return (StringReplace((name ) , ( " ") , "")) // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded savecodes.") + else + call SimError(whichPlayer , "Missing savecode with \"-load \" in file: " + allSaveCodes) + endif endfunction -function WoWReforgedWebsite__GenerateAchievements takes nothing returns nothing +function LoadSaveCodeAllItems takes player whichPlayer,string allSaveCodes returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string saveCode= null local integer i= 0 - local integer max= (WoWReforgedAchievements__achievementsCounter) // INLINED!! - - call FileStart() - call Preload(("")) // INLINED!! - loop - exitwhen ( i == max ) - call Preload(("")) // INLINED!! - - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx3((s__Achievement_icon[WoWReforgedAchievements__achievements[(i)]]) , "achievements.html" , (StringReplace((((s__Achievement_name[WoWReforgedAchievements__achievements[(i)]])) ) , ( " ") , ""))) // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload(((s__Achievement_name[WoWReforgedAchievements__achievements[(i)]]))) // INLINED!! - call Preload(("")) // INLINED!! - - // gold exchange rate - call Preload(("")) // INLINED!! - call Preload(((s__Achievement_description[WoWReforgedAchievements__achievements[(i)]]))) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! + set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadi " , i) + exitwhen ( saveCode == null ) + call ApplySaveCodeItems(whichPlayer , saveCode) set i=i + 1 endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Achievements.txt")) // INLINED!! + + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded item savecodes.") endfunction -function WoWReforgedWebsite__GenerateHeroStandardAbilities takes nothing returns nothing +function LoadSaveCodeAllUnits takes player whichPlayer,string allSaveCodes returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string saveCode= null local integer i= 0 - local integer max= (WoWReforgedStandardHeroAbilities___standardHeroAbilitiesCounter) // INLINED!! - - call FileStart() - call Preload(("")) // INLINED!! - - loop - exitwhen ( i == max ) - call Preload(("")) // INLINED!! - - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(((s__WoWReforgedStandardHeroAbilities___A_abilityId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]])) , "") // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetObjectName((s__WoWReforgedStandardHeroAbilities___A_itemTypeId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]])))) // INLINED!! - call Preload(("")) // INLINED!! - - // levels - call Preload(("")) // INLINED!! - call Preload((I2S((s__WoWReforgedStandardHeroAbilities___A_maxLevel[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]])))) // INLINED!! - call Preload(("")) // INLINED!! - - // description - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip((s__WoWReforgedStandardHeroAbilities___A_itemTypeId[WoWReforgedStandardHeroAbilities___standardHeroAbilities[(i)]]), 0)) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - set i=i + 1 - endloop + if ( TimerGetRemaining(udg_SaveCodeCooldownUnitsTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then + set i=0 + loop + set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadu " , i) + exitwhen ( saveCode == null ) + call ApplySaveCodeUnits(whichPlayer , saveCode) + set i=i + 1 + endloop + call StartTimerBJ(udg_SaveCodeCooldownUnitsTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) + endif - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-HeroStandardAbilities.txt")) // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded unit savecodes.") endfunction -function WoWReforgedWebsite__GenerateSkins takes nothing returns nothing +function LoadSaveCodeAllBuildings takes player whichPlayer,string allSaveCodes returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string saveCode= null local integer i= 0 - local integer max= (WoWReforgedSkins___skinCounter) // INLINED!! - - call FileStart() - call Preload(("")) // INLINED!! - - loop - exitwhen ( i == max ) - call Preload(("")) // INLINED!! - - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx(((WoWReforgedSkins___skinItemTypeId[(i)])) , "") // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetObjectName((WoWReforgedSkins___skinItemTypeId[(i)])))) // INLINED!! - call Preload(("")) // INLINED!! + if ( TimerGetRemaining(udg_SaveCodeCooldownBuildingsTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then + set i=0 + loop + set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadb " , i) + exitwhen ( saveCode == null ) + call ApplySaveCodeBuildings(whichPlayer , saveCode) + set i=i + 1 + endloop + call StartTimerBJ(udg_SaveCodeCooldownBuildingsTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) + endif - // description - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip((WoWReforgedSkins___skinItemTypeId[(i)]), 0)) // INLINED!! - call Preload(("")) // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded building savecodes.") +endfunction - call Preload(("")) // INLINED!! - set i=i + 1 - endloop +function LoadSaveCodeAllResearches takes player whichPlayer,string allSaveCodes returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string saveCode= null + local integer i= 0 + if ( TimerGetRemaining(udg_SaveCodeCooldownResearchesTime[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then + set i=0 + loop + set saveCode=GetSaveCodeFromFile(allSaveCodes , "-loadr " , i) + exitwhen ( saveCode == null ) + call ApplySaveCodeResearches(whichPlayer , saveCode) + set i=i + 1 + endloop + call StartTimerBJ(udg_SaveCodeCooldownResearchesTime[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) + endif - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Skins.txt")) // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded research savecodes.") endfunction -function WoWReforgedWebsite__GenerateEquipment takes nothing returns nothing +function LoadSaveCodeAllResources takes player whichPlayer,string allSaveCodes returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string saveCode= GetSaveCodeFromFile(allSaveCodes , "-loadres " , 0) local integer i= 0 - local integer max= (WoWReforgedEquipment___equipmentTypesCounter) // INLINED!! - local integer itemTypeId= 0 - local item whichItem= null - local integer goldCost= 0 - local integer lumberCost= 0 - - call FileStart() - call Preload(("")) // INLINED!! - - loop - exitwhen ( i == max ) - set itemTypeId=(WoWReforgedEquipment___equipmentItemTypeId[(i)]) // INLINED!! - if ( itemTypeId != 0 ) then - set whichItem=CreateItem(itemTypeId, 0.0, 0.0) - call Preload(("")) // INLINED!! + if ( saveCode != null ) then + if ( TimerGetRemaining(udg_SaveCodeCooldownResourcesTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then + if ( ApplySaveCodeResources(whichPlayer , saveCode) ) then + call StartTimerBJ(udg_SaveCodeCooldownResourcesTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) - // icon - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx((itemTypeId) , "") // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload((GetObjectName(itemTypeId))) // INLINED!! - call Preload(("")) // INLINED!! - - // level - call Preload(("")) // INLINED!! - call Preload((I2S(GetItemLevel(whichItem)))) // INLINED!! - call Preload(("")) // INLINED!! - - // tooltip - //call FileWriteLine("") - //call FormatTooltip(BlzGetItemExtendedTooltip(whichItem)) - //call FileWriteLine("") - - // gold cost - set goldCost=GetItemValueGold(itemTypeId) - call Preload(("")) // INLINED!! - if ( goldCost > 0 ) then - call Preload((I2S(goldCost))) // INLINED!! - call Preload(("\"images/WC3gold.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! - endif - call Preload(("")) // INLINED!! - - // lumber cost - set lumberCost=GetItemValueLumber(itemTypeId) - call Preload(("")) // INLINED!! - if ( lumberCost > 0 ) then - call Preload((I2S(lumberCost))) // INLINED!! - call Preload(("\"images/WC3lumber.webp\"")) // INLINED!! - else - call Preload(("-")) // INLINED!! + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded resources savecodes.") endif - call Preload(("")) // INLINED!! - - // description - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip(BlzGetAbilityExtendedTooltip(itemTypeId, 0)) - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - call h__RemoveItem(whichItem) - set whichItem=null + else + call SimError(whichPlayer , "You can load another savecode for resources in: " + FormatTimeString(R2I(TimerGetRemaining(udg_SaveCodeCooldownResourcesTimer[GetConvertedPlayerId(whichPlayer)]))) + ".") endif - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Equipment.txt")) // INLINED!! -endfunction - -function WoWReforgedWebsite__GenerateAttribute takes integer attribute returns nothing - call Preload(("")) // INLINED!! - - // icon - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - call Preload(("")) // INLINED!! - - // name - call Preload(("")) // INLINED!! - call Preload(((s__Attributes___A_name[(attribute)]))) // INLINED!! - call Preload(("")) // INLINED!! - - // description - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__FormatTooltip((s__Attributes___A_description[(attribute)])) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! + else + call SimError(whichPlayer , "Missing savecode with \"-loadres \" in file: " + allSaveCodes) + endif endfunction -function WoWReforgedWebsite__GenerateAttributes takes nothing returns nothing - local integer i= 0 - local integer max= 0 - call FileStart() - call Preload(("")) // INLINED!! - - set max=(Attributes___attributesCounter) // INLINED!! - set i=0 - loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateAttribute((Attributes___attributes[(i)])) // INLINED!! - set i=i + 1 - endloop +function LoadSaveCodeAllClan takes player whichPlayer,string allSaveCodes returns nothing + local integer playerId= GetPlayerId(whichPlayer) + local string saveCode= GetSaveCodeFromFile(allSaveCodes , "-loadc " , 0) + local string clanName= GetSaveCodeFromFile(allSaveCodes , "-clan " , 0) - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Attributes.txt")) // INLINED!! -endfunction - -function FirstUnitOfTypeId takes integer unitTypeId returns unit - local group g= GetUnitsOfTypeIdAll(unitTypeId) - local unit first= FirstOfGroup(g) - call GroupClear(g) - call DestroyGroup(g) - set g=null - return first + if ( saveCode != null ) then + if ( TimerGetRemaining(udg_SaveCodeCooldownClanTimer[GetConvertedPlayerId(whichPlayer)]) <= 0.00 ) then + if ( ApplySaveCodeClan(whichPlayer , clanName , saveCode) ) then + call StartTimerBJ(udg_SaveCodeCooldownClanTimer[GetConvertedPlayerId(whichPlayer)], false, udg_SaveCodeCooldownObjects) + + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loaded clan savecodes.") + endif + else + call SimError(whichPlayer , "You can load another savecode for clan in: " + FormatTimeString(R2I(TimerGetRemaining(udg_SaveCodeCooldownClanTimer[GetConvertedPlayerId(whichPlayer)]))) + ".") + endif + else + call SimError(whichPlayer , "Missing savecode with \"-loadc \" in file: " + allSaveCodes) + endif endfunction -function WoWReforgedWebsite__GenerateProperties takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedProperties__propertiesCounter) // INLINED!! - local unit creep= null - local integer zone= 0 - - call FileStart() - call Preload(("")) // INLINED!! - - loop - exitwhen ( i == max ) - call Preload(("")) // INLINED!! - - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(i) , GetObjectName(s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])])))) // INLINED!! - //call WriteUnitPopoverWithIcon(GetProperty(i).unitTypeId, "units.html") - - //set creep = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), GetProperty(i).purchaseUnitTypeId, 0.0, 0.0, 0.0) - set creep=FirstUnitOfTypeId(s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])]) // INLINED!! - call WoWReforgedWebsite__WriteUnitPopoverWithIconExExEx(creep , s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])] , GetObjectName(s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])]) , "buildings.html") // INLINED!! - //call RemoveUnit(creep) - //set creep = null - call Preload(("")) // INLINED!! - - // name - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(i) , GetObjectName(s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])])))) // INLINED!! - call Preload((GetObjectName(s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])]))) // INLINED!! - call Preload(("")) // INLINED!! - - // gold - call WoWReforgedWebsite__GenerateUnitTypeIdGoldCost(s__Property_purchaseUnitTypeId[(WoWReforgedProperties__properties[(i)])]) // INLINED!! - - // lumber - call WoWReforgedWebsite__GenerateUnitTypeIdLumberCost(s__Property_purchaseUnitTypeId[(WoWReforgedProperties__properties[(i)])]) // INLINED!! - - // race - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(s__Property_soldRace[(WoWReforgedProperties__properties[(i)])]) , (GetObjectName(udg_RaceTavernItemType[(s__Property_soldRace[(WoWReforgedProperties__properties[(i)])])]))))) // INLINED!! - call WoWReforgedWebsite__RaceIconToHtml(s__Property_soldRace[(WoWReforgedProperties__properties[(i)])]) // INLINED!! - call Preload(("")) // INLINED!! - - // food made - call WoWReforgedWebsite__GenerateUnitTypeIdFoodMade(s__Property_unitTypeId[(WoWReforgedProperties__properties[(i)])]) // INLINED!! +function GetSaveCodeAllTextFile takes player whichPlayer returns nothing + local string playerName= GetPlayerName(whichPlayer) + local integer playerId= GetPlayerId(whichPlayer) + local string fileNameHeroes= GetSaveCodeAllFileNameForPlayer(whichPlayer) + local string fileNameItems= GetSaveCodeAllFileNameItemsForPlayer(whichPlayer) + local string fileNameUnits= GetSaveCodeAllFileNameUnitsForPlayer(whichPlayer) + local string fileNameBuildings= GetSaveCodeAllFileNameBuildingsForPlayer(whichPlayer) + local string fileNameResearches= GetSaveCodeAllFileNameResearchesForPlayer(whichPlayer) + local string fileNameResources= GetSaveCodeAllFileNameResourcesForPlayer(whichPlayer) + local string fileNameClan= GetSaveCodeAllFileNameClanForPlayer(whichPlayer) + local string fileContent= null + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, "Loading your character from file " + fileNameHeroes + ".") + if ( GetLocalPlayer() == whichPlayer ) then + set fileContent=(s__File_readEx(s__File_open((fileNameHeroes)),true)) // INLINED!! + //call BJDebugMsg("File content: " + fileContent) + if ( fileContent != null ) then + call BlzSendSyncData("SaveCodeAllHeroes", fileContent) + else + call BlzSendSyncData("SaveCodeAllHeroes", "missing") + endif - // resource - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__IconToHtmlEx3((s__Resource_icon[(s__Property_resource[(WoWReforgedProperties__properties[(i)])])]) , "resources.html" , (s__Resource_name[(s__Property_resource[(WoWReforgedProperties__properties[(i)])])])) // INLINED!! - call Preload(("")) // INLINED!! + set fileContent=(s__File_readEx(s__File_open((fileNameItems)),true)) // INLINED!! + //call BJDebugMsg("File content: " + fileContent) + if ( fileContent != null ) then + call BlzSendSyncData("SaveCodeAllItems", fileContent) + else + call BlzSendSyncData("SaveCodeAllItems", "missing") + endif - // max workers - call Preload(("")) // INLINED!! - call Preload((I2S(s__Property_maxWorkers[(WoWReforgedProperties__properties[(i)])]))) // INLINED!! - call Preload(("")) // INLINED!! + set fileContent=(s__File_readEx(s__File_open((fileNameUnits)),true)) // INLINED!! + //call BJDebugMsg("File content: " + fileContent) + if ( fileContent != null ) then + call BlzSendSyncData("SaveCodeAllUnits", fileContent) + else + call BlzSendSyncData("SaveCodeAllUnits", "missing") + endif - // shipyard - call Preload(("")) // INLINED!! - if ( s__Property_shipyard[(WoWReforgedProperties__properties[(i)])] ) then // INLINED!! - call Preload(("yes")) // INLINED!! + set fileContent=(s__File_readEx(s__File_open((fileNameBuildings)),true)) // INLINED!! + //call BJDebugMsg("File content: " + fileContent) + if ( fileContent != null ) then + call BlzSendSyncData("SaveCodeAllBuildings", fileContent) else - call Preload(("-")) // INLINED!! + call BlzSendSyncData("SaveCodeAllBuildings", "missing") endif - call Preload(("")) // INLINED!! - // location - call Preload(("")) // INLINED!! + set fileContent=(s__File_readEx(s__File_open((fileNameResearches)),true)) // INLINED!! + //call BJDebugMsg("File content: " + fileContent) + if ( fileContent != null ) then + call BlzSendSyncData("SaveCodeAllResearches", fileContent) + else + call BlzSendSyncData("SaveCodeAllResearches", "missing") + endif - set zone=GetZoneByCoordinates(GetUnitX(creep) , GetUnitY(creep)) - if ( zone != 0 ) then - call WoWReforgedWebsite__IconToHtmlEx4((s__AbstractZone_icon[(zone)]) , "zones.html" , (s__AbstractZone_name[(zone)]) , (s__AbstractZone_id[(zone)])) // INLINED!! + set fileContent=(s__File_readEx(s__File_open((fileNameResources)),true)) // INLINED!! + //call BJDebugMsg("File content: " + fileContent) + if ( fileContent != null ) then + call BlzSendSyncData("SaveCodeAllResources", fileContent) else - call Preload(("-")) // INLINED!! + call BlzSendSyncData("SaveCodeAllResources", "missing") endif - call Preload(("")) // INLINED!! - - - call Preload(("")) // INLINED!! - set i=i + 1 - endloop - call Preload(("")) // INLINED!! + set fileContent=(s__File_readEx(s__File_open((fileNameClan)),true)) // INLINED!! + //call BJDebugMsg("File content: " + fileContent) + if ( fileContent != null ) then + call BlzSendSyncData("SaveCodeAllClan", fileContent) + else + call BlzSendSyncData("SaveCodeAllClan", "missing") + endif + endif +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Properties.txt")) // INLINED!! +function WoWReforgedSaveCodesAll__TriggerConditionSync takes nothing returns boolean + local player triggerPlayer= GetTriggerPlayer() + local integer playerId= GetPlayerId(triggerPlayer) + local string prefix= BlzGetTriggerSyncPrefix() + local string data= BlzGetTriggerSyncData() + if ( prefix == "SaveCodeAllHeroes" ) then + set WoWReforgedSaveCodesAll__loadedAllOnce[playerId]=true + //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) + if ( data == "missing" ) then + call SimError(triggerPlayer , "Missing heroes savecode file.") + else + call LoadSaveCodeAllHeroes(triggerPlayer , data) + endif + elseif ( prefix == "SaveCodeAllItems" ) then + //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) + if ( data == "missing" ) then + call SimError(triggerPlayer , "Missing items savecode file.") + else + call LoadSaveCodeAllItems(triggerPlayer , data) + endif + elseif ( prefix == "SaveCodeAllUnits" ) then + //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) + if ( data == "missing" ) then + call SimError(triggerPlayer , "Missing units savecode file.") + else + call LoadSaveCodeAllUnits(triggerPlayer , data) + endif + elseif ( prefix == "SaveCodeAllBuildings" ) then + //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) + if ( data == "missing" ) then + call SimError(triggerPlayer , "Missing buildings savecode file.") + else + call LoadSaveCodeAllBuildings(triggerPlayer , data) + endif + elseif ( prefix == "SaveCodeAllResearches" ) then + //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) + if ( data == "missing" ) then + call SimError(triggerPlayer , "Missing researches savecode file.") + else + call LoadSaveCodeAllResearches(triggerPlayer , data) + endif + elseif ( prefix == "SaveCodeAllResources" ) then + //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) + if ( data == "missing" ) then + call SimError(triggerPlayer , "Missing resources savecode file.") + else + call LoadSaveCodeAllResources(triggerPlayer , data) + endif + elseif ( prefix == "SaveCodeAllClan" ) then + //call BJDebugMsg("Synced: " + BlzGetTriggerSyncData()) + if ( data == "missing" ) then + call SimError(triggerPlayer , "Missing clan savecode file.") + else + call LoadSaveCodeAllClan(triggerPlayer , data) + endif + endif + set triggerPlayer=null + return false endfunction -function WoWReforgedWebsite__GenerateRacingTracks takes nothing returns nothing +function WoWReforgedSaveCodesAll__Init takes nothing returns nothing local integer i= 0 - local integer max= (WoWReforgedRacing__racingTracksCounter) // INLINED!! - local integer t= 0 - - call FileStart() - call Preload(("")) // INLINED!! - loop - exitwhen ( i == max ) - set t=(WoWReforgedRacing__racingTracks[(i)]) // INLINED!! - call Preload(("")) // INLINED!! - - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(i) , GetObjectName(s__RacingTrack_itemTypeId[t])))) // INLINED!! - call WoWReforgedWebsite__WriteItemPopoverWithIcon(s__RacingTrack_itemTypeId[t] , "items.html") - call Preload(("")) // INLINED!! - - // name - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(i) , s__RacingTrack_name[t]))) // INLINED!! - call Preload((s__RacingTrack_name[t])) // INLINED!! - call Preload(("")) // INLINED!! - - // gold - call WoWReforgedWebsite__GenerateUnitTypeIdGoldCost(s__RacingTrack_itemTypeId[t]) - - // lumber - call WoWReforgedWebsite__GenerateItemTypeIdLumberCost(s__RacingTrack_itemTypeId[t]) - - // trophies - call Preload(("")) // INLINED!! - call WoWReforgedWebsite__WriteItemPopoverWithIcon(s__RacingTrack_firstPlaceTrophyItemTypeId[t] , "items.html") - call WoWReforgedWebsite__WriteItemPopoverWithIcon(s__RacingTrack_secondPlaceTrophyItemTypeId[t] , "items.html") - call WoWReforgedWebsite__WriteItemPopoverWithIcon(s__RacingTrack_thirdPlaceTrophyItemTypeId[t] , "items.html") - call Preload(("")) // INLINED!! - - // checkpoints - call Preload(("")) // INLINED!! - call Preload((I2S(s__RacingTrack_checkpointsCounter[t]))) // INLINED!! - call Preload(("")) // INLINED!! - - // distance - call Preload(("")) // INLINED!! - call Preload((I2S(R2I(GetRacingTrackDistance(t))))) // INLINED!! - call Preload(("")) // INLINED!! - - // durations - call Preload(("")) // INLINED!! - call Preload((I2S(R2I((GetRacingTrackDistance((t)) / 100.0))))) // INLINED!! - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! + exitwhen ( i == bj_MAX_PLAYERS ) + call TriggerRegisterPlayerEvent(WoWReforgedSaveCodesAll__syncTrigger, Player(i), EVENT_PLAYER_SYNC_DATA) set i=i + 1 endloop - - call Preload(("")) // INLINED!! + call TriggerAddCondition(WoWReforgedSaveCodesAll__syncTrigger, Condition(function WoWReforgedSaveCodesAll__TriggerConditionSync)) +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-RacingTracks.txt")) // INLINED!! + +//library WoWReforgedSaveCodesAll ends +//library WoWReforgedStartLocations: + + +function GetMaxStartLocations takes nothing returns integer + return WoWReforgedStartLocations___startLocationsCounter endfunction -function WoWReforgedWebsite__GenerateSeason takes integer season,integer startDay,integer endDay returns nothing - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(season) , GetSeasonName(season)))) // INLINED!! - call WoWReforgedWebsite__Icon(I2S(season) , GetSeasonIcon(season) , GetSeasonName(season) , GetSeasonIcon(season)) - call Preload(("")) // INLINED!! - - // name - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(season) , GetSeasonName(season)))) // INLINED!! - call Preload((GetSeasonName(season))) // INLINED!! - call Preload(("")) // INLINED!! - - // start day - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(season) , I2S(startDay)))) // INLINED!! - call Preload((I2S(startDay))) // INLINED!! - call Preload((" day, ")) // INLINED!! - call Preload((FormatTimeOfDayEx(0.0))) // INLINED!! - call Preload(("")) // INLINED!! +function AddStartLocation takes integer itemTypeId,real x,real y,real facing,boolean isClanArea returns integer + local integer index= WoWReforgedStartLocations___startLocationsCounter + set WoWReforgedStartLocations___startLocationsItemTypeIds[index]=itemTypeId + set WoWReforgedStartLocations___startLocationsX[index]=x + set WoWReforgedStartLocations___startLocationsY[index]=y + set WoWReforgedStartLocations___startLocationsFacing[index]=facing + set WoWReforgedStartLocations___startLocationsIsClanArea[index]=isClanArea + set WoWReforgedStartLocations___startLocationsCounter=WoWReforgedStartLocations___startLocationsCounter + 1 - // end day - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(season) , I2S(endDay)))) // INLINED!! - call Preload((I2S(endDay))) // INLINED!! - call Preload((" day, ")) // INLINED!! - call Preload((FormatTimeOfDayEx(0.0))) // INLINED!! - call Preload(("")) // INLINED!! + return index +endfunction - call Preload(("")) // INLINED!! +function AddWoWReforgedStartLocation takes nothing returns integer + local integer startLocation= AddStartLocation(udg_TmpItemTypeId , GetRectCenterX(udg_TmpRect) , GetRectCenterY(udg_TmpRect) , udg_TmpReal , udg_TmpBoolean) + set udg_TmpBoolean=false + return startLocation endfunction -function WoWReforgedWebsite__GenerateCalendarEvents takes nothing returns nothing - local integer i= 0 - local integer index= 0 - local integer max= (WoWReforgedCalendar__calendarEventsCounter) // INLINED!! - local integer t= 0 - - call FileStart() - call Preload(("")) // INLINED!! - - call Preload(("")) // INLINED!! - - // seasons - call WoWReforgedWebsite__GenerateSeason(SEASON_SPRING , SPRING_DAY , SUMMER_DAY - 1) - call WoWReforgedWebsite__GenerateSeason(SEASON_SUMMER , SUMMER_DAY , FALL_DAY - 1) - call WoWReforgedWebsite__GenerateSeason(SEASON_FALL , FALL_DAY , DAYS_PER_YEAR - 1) - call WoWReforgedWebsite__GenerateSeason(SEASON_WINTER , WINTER_DAY , SPRING_DAY - 1) - - loop - exitwhen ( i == max ) - set index=i + SEASON_WINTER - set t=(WoWReforgedCalendar__calendarEvents[(i)]) // INLINED!! - call Preload(("")) // INLINED!! - - // icon - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , s__CalendarEvent_name[t]))) // INLINED!! - call WoWReforgedWebsite__Icon(I2S(index) , s__CalendarEvent_icon[t] , s__CalendarEvent_name[t] , s__CalendarEvent_icon[t]) - call Preload(("")) // INLINED!! - - // name - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , s__CalendarEvent_name[t]))) // INLINED!! - call Preload((s__CalendarEvent_name[t])) // INLINED!! - call Preload(("")) // INLINED!! - - // start day - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , I2S(s__CalendarEvent_startDay[t])))) // INLINED!! - call Preload((I2S(s__CalendarEvent_startDay[t]))) // INLINED!! - call Preload((" day, ")) // INLINED!! - call Preload((FormatTimeOfDayEx(s__CalendarEvent_startTimeOfDay[t]))) // INLINED!! - call Preload(("")) // INLINED!! - - // end day - call Preload((WoWReforgedWebsite__ColumnDataOrder(I2S(index) , I2S(s__CalendarEvent_endDay[t])))) // INLINED!! - call Preload((I2S(s__CalendarEvent_endDay[t]))) // INLINED!! - call Preload((" day, ")) // INLINED!! - call Preload((FormatTimeOfDayEx(s__CalendarEvent_endTimeOfDay[t]))) // INLINED!! - call Preload(("")) // INLINED!! +function GetStartLocationItemTypeId takes integer startLocation returns integer + return WoWReforgedStartLocations___startLocationsItemTypeIds[startLocation] +endfunction - call Preload(("")) // INLINED!! - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! +function GetStartLocationIsClanArea takes integer startLocation returns boolean + return WoWReforgedStartLocations___startLocationsIsClanArea[startLocation] +endfunction - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-CalendarEvents.txt")) // INLINED!! +function GetStartLocationName takes integer startLocation returns string + return GetObjectName((WoWReforgedStartLocations___startLocationsItemTypeIds[(startLocation)])) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateChangeLogs takes nothing returns nothing - local integer i= 0 - local integer max= (WoWReforgedChangeLog__versionQuestsCounter) // INLINED!! - local integer j= 0 - local integer max2= 0 +function MoveUnitToStartLocation takes unit whichUnit,integer startLocation returns nothing + call SetUnitX(whichUnit, WoWReforgedStartLocations___startLocationsX[startLocation]) + call SetUnitY(whichUnit, WoWReforgedStartLocations___startLocationsY[startLocation]) + call SetUnitFacing(whichUnit, WoWReforgedStartLocations___startLocationsFacing[startLocation]) +endfunction +function GetStartLocationByItemTypeId takes integer itemTypeId returns integer + local integer i= 0 + local integer max= (WoWReforgedStartLocations___startLocationsCounter) // INLINED!! loop exitwhen ( i == max ) - call FileStart() - call Preload(("")) // INLINED!! - - set j=0 - set max2=QuestGetItemCount((WoWReforgedChangeLog__versionQuests[(i)])) // INLINED!! - loop - exitwhen ( j == max2 ) - call Preload(("- " + QuestItemGetDescription(QuestGetItem((WoWReforgedChangeLog__versionQuests[(i)]) , j)))) // INLINED!! - set j=j + 1 - endloop - - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-ChangeLog-" + QuestGetTitle((WoWReforgedChangeLog__versionQuests[(i)])) + ".txt")) // INLINED!! + if ( itemTypeId == (WoWReforgedStartLocations___startLocationsItemTypeIds[(i)]) ) then // INLINED!! + return i + endif set i=i + 1 endloop + return - 1 endfunction -function WoWReforgedWebsite__TriggerConditionIsSinglePlayer takes nothing returns boolean - local boolean result= bj_isSinglePlayer - if ( result ) then - return true +function PlayerCanBuyStartLocationEx takes player whichPlayer,integer itemTypeId returns boolean + local integer index= GetStartLocationByItemTypeId(itemTypeId) + if ( index >= 0 ) then + return not (WoWReforgedStartLocations___startLocationsIsClanArea[(index)]) or (IsPlayerInForce((whichPlayer), prestoredElvenClanMembers)) // INLINED!! endif - - call SimError(GetTriggerPlayer() , "Requires single player.") - return false endfunction -function WoWReforgedWebsite__TriggerActionWebsite takes nothing returns nothing - // Summon all bosses: - call TimerStart(udg_BossDeathwingTimer, 0.0, false, null) - call TimerStart(udg_BossCenariusTimer, 0.0, false, null) - call TriggerSleepAction(1.0) - call SetTimeOfDay(12.0) - call SuspendTimeOfDay(true) - - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateHeroes)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateSpells)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateMounts)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateBosses)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateUnits)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateBuildings)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateItems)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateProfessions)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GeneratePlayers)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateClans)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateNpcs)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateQuests)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateInfoQuests)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateResearches)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateChatCommands)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateHeroJourney)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateCredits)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateZones)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRecipes)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateResources)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateAchievements)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateHeroStandardAbilities)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateSkins)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateEquipment)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateAttributes)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateProperties)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRacingTracks)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateCalendarEvents)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateChangeLogs)) // INLINED!! - call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedWebsite__GenerateRaces)) // INLINED!! - - call SuspendTimeOfDay(false) - - call h__BJDebugMsg("String token 0 " + StringSplit("1|n|n|n2" , 0 , "|n") + " and token 3 " + StringSplit("1|n|n|n2" , 3 , "|n")) - call h__BJDebugMsg("String token 0 " + StringSplit("1|n2|n3|n4" , 0 , "|n") + " and token 3 " + StringSplit("1|n2|n3|n4" , 3 , "|n")) - call h__BJDebugMsg("String count: " + I2S(StringCount("|n|n|n" , "|n"))) - call h__BJDebugMsg("Icon path: " + (WoWReforgedWebsite__IconPath(BlzGetAbilityIcon(('R02Q'))))) // INLINED!! -endfunction -function WoWReforgedWebsite__Init takes nothing returns nothing - local integer i= 0 - loop - call TriggerRegisterPlayerChatEvent(WoWReforgedWebsite__chatCommandTrigger, Player(i), "-website", true) - set i=i + 1 - exitwhen ( i == bj_MAX_PLAYERS ) - endloop - call TriggerAddCondition(WoWReforgedWebsite__chatCommandTrigger, Condition(function WoWReforgedWebsite__TriggerConditionIsSinglePlayer)) - call TriggerAddAction(WoWReforgedWebsite__chatCommandTrigger, function WoWReforgedWebsite__TriggerActionWebsite) - - call WoWReforgedWebsite__AddIgnoredAbility('A1YZ') - call WoWReforgedWebsite__AddIgnoredAbility('A02Z') - call WoWReforgedWebsite__AddIgnoredAbility('AInv') - call WoWReforgedWebsite__AddIgnoredAbility('AHer') - call WoWReforgedWebsite__AddIgnoredAbility('Aatk') - call WoWReforgedWebsite__AddIgnoredAbility('Amov') - call WoWReforgedWebsite__AddIgnoredAbility('Achd') - call WoWReforgedWebsite__AddIgnoredAbility('Abdt') - call WoWReforgedWebsite__AddIgnoredAbility('BHad') - call WoWReforgedWebsite__AddIgnoredAbility('Aalr') - call WoWReforgedWebsite__AddIgnoredAbility('Afih') - call WoWReforgedWebsite__AddIgnoredAbility('Afio') - call WoWReforgedWebsite__AddIgnoredAbility('Afin') - call WoWReforgedWebsite__AddIgnoredAbility('Asei') - call WoWReforgedWebsite__AddIgnoredAbility('Asel') - call WoWReforgedWebsite__AddIgnoredAbility('Afiu') - call WoWReforgedWebsite__AddIgnoredAbility('Aque') - call WoWReforgedWebsite__AddIgnoredAbility('Advc') - call WoWReforgedWebsite__AddIgnoredAbility('Srtt') - call WoWReforgedWebsite__AddIgnoredAbility('Sch2') - call WoWReforgedWebsite__AddIgnoredAbility('Amai') - call WoWReforgedWebsite__AddIgnoredAbility('Aupg') - call WoWReforgedWebsite__AddIgnoredAbility('Atol') - call WoWReforgedWebsite__AddIgnoredAbility('A07A') - call WoWReforgedWebsite__AddIgnoredAbility('BNpi') - call WoWReforgedWebsite__AddIgnoredAbility('S000') - call WoWReforgedWebsite__AddIgnoredAbility('BUtt') - call WoWReforgedWebsite__AddIgnoredAbility('BUau') - call WoWReforgedWebsite__AddIgnoredAbility('Bakb') - call WoWReforgedWebsite__AddIgnoredAbility('BOac') - call WoWReforgedWebsite__AddIgnoredAbility('Sch3') - call WoWReforgedWebsite__AddIgnoredAbility('ACsp') - call WoWReforgedWebsite__AddIgnoredAbility('BEah') - call WoWReforgedWebsite__AddIgnoredAbility('BHab') - call WoWReforgedWebsite__AddIgnoredAbility('BUav') - call WoWReforgedWebsite__AddIgnoredAbility('Abun') - call WoWReforgedWebsite__AddIgnoredAbility('BOae') - call WoWReforgedWebsite__AddIgnoredAbility('BEar') - call WoWReforgedWebsite__AddIgnoredAbility('S00G') - call WoWReforgedWebsite__AddIgnoredAbility('Ablr') - call WoWReforgedWebsite__AddIgnoredAbility('S00T') - call WoWReforgedWebsite__AddIgnoredAbility('Sch5') - call WoWReforgedWebsite__AddIgnoredAbility('A0NY') - call WoWReforgedWebsite__AddIgnoredAbility('Aegm') - call WoWReforgedWebsite__AddIgnoredAbility('A0O3') - call WoWReforgedWebsite__AddIgnoredAbility('S013') - call WoWReforgedWebsite__AddIgnoredAbility('A09X') - call WoWReforgedWebsite__AddIgnoredAbility('A1ZN') - call WoWReforgedWebsite__AddIgnoredAbility('A0P8') - call WoWReforgedWebsite__AddIgnoredAbility('S004') - call WoWReforgedWebsite__AddIgnoredAbility('S01B') - call WoWReforgedWebsite__AddIgnoredAbility('S00L') - call WoWReforgedWebsite__AddIgnoredAbility('S014') - call WoWReforgedWebsite__AddIgnoredAbility('Sch4') - call WoWReforgedWebsite__AddIgnoredAbility('A1EE') - call WoWReforgedWebsite__AddIgnoredAbility('A1V5') - call WoWReforgedWebsite__AddIgnoredAbility('S00S') - call WoWReforgedWebsite__AddIgnoredAbility('S00W') - call WoWReforgedWebsite__AddIgnoredAbility('S011') - call WoWReforgedWebsite__AddIgnoredAbility('S012') - call WoWReforgedWebsite__AddIgnoredAbility('S015') - call WoWReforgedWebsite__AddIgnoredAbility('o04S') - call WoWReforgedWebsite__AddIgnoredAbility('Aphx') - call WoWReforgedWebsite__AddIgnoredAbility('Bphx') - call WoWReforgedWebsite__AddIgnoredAbility('Adt1') - call WoWReforgedWebsite__AddIgnoredAbility('Asp1') - call WoWReforgedWebsite__AddIgnoredAbility('S00Z') - call WoWReforgedWebsite__AddIgnoredAbility('BUts') - call WoWReforgedWebsite__AddIgnoredAbility('A0O5') - call WoWReforgedWebsite__AddIgnoredAbility('S016') - call WoWReforgedWebsite__AddIgnoredAbility('S01M') - call WoWReforgedWebsite__AddIgnoredAbility('A0BD') - call WoWReforgedWebsite__AddIgnoredAbility('S01F') - call WoWReforgedWebsite__AddIgnoredAbility('Bmil') - call WoWReforgedWebsite__AddIgnoredAbility('S01G') - call WoWReforgedWebsite__AddIgnoredAbility('S00P') -endfunction - - -//library WoWReforgedWebsite ends +//library WoWReforgedStartLocations ends //library WoWReforgedPlayerInfos: function GetHelpText takes nothing returns string @@ -89765,12 +85922,12 @@ function ShowPlayers takes player to returns nothing else set clanName="" endif - if ( (IsPlayerInForce((listedPlayer), WoWReforgedVIPs___vipPlayers)) ) then // INLINED!! + if ( (IsPlayerInForce((listedPlayer), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! set vip=", VIP" else set vip="" endif - call h__DisplayTimedTextToPlayer(to, 0, 0, 20.0, I2S(GetPlayerTeam(listedPlayer) + 1) + " [" + I2S(i + 1) + "]" + GetPlayerColorString(GetPlayerColor(listedPlayer) , GetPlayerName(listedPlayer)) + ": " + (StringCase(PlayerColorUtils___PlayerColorNames[GetPlayerId((listedPlayer))], false)) + clanName + vip) // INLINED!! + call h__DisplayTimedTextToPlayer(to, 0, 0, 20.0, I2S(GetPlayerTeam(listedPlayer) + 1) + " [" + I2S(i + 1) + "]" + GetPlayerColorString(GetPlayerColor(listedPlayer) , GetPlayerName(listedPlayer)) + ": " + (StringCase(PlayerColorUtils__PlayerColorNames[GetPlayerId((listedPlayer))], false)) + clanName + vip) // INLINED!! endif set listedPlayer=null set i=i + 1 @@ -89822,7 +85979,7 @@ function DisplayStats takes player to,player from returns nothing if ( udg_ClanPlayerClan[convertedPlayerId] != 0 ) then set clanName=", Clan: " + udg_ClanName[udg_ClanPlayerClan[convertedPlayerId]] endif - if ( (IsPlayerInForce((from), WoWReforgedVIPs___vipPlayers)) ) then // INLINED!! + if ( (IsPlayerInForce((from), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! set vip=", VIP" endif if ( from == udg_BossesPlayer ) then @@ -89934,7 +86091,7 @@ function GetPlayerSelectionSettings takes player whichPlayer returns string set profession3=udg_ProfessionName[udg_PlayerSelectionProfession3[convertedPlayerId]] endif - set startLocation=(GetObjectName((WoWReforgedStartLocations__startLocationsItemTypeIds[((udg_PlayerSelectionStartLocation[convertedPlayerId]))]))) // INLINED!! + set startLocation=(GetObjectName((WoWReforgedStartLocations___startLocationsItemTypeIds[((udg_PlayerSelectionStartLocation[convertedPlayerId]))]))) // INLINED!! return "- Mode: " + mode + "\n- Heroes: " + hero1 + "/" + hero2 + "/" + hero3 + "\n- Races: " + race1 + "/" + race2 + "/" + race3 + "\n- Professions: " + profession1 + "/" + profession2 + "/" + profession3 + "\n- Start Location: " + startLocation endfunction @@ -91405,26 +87562,26 @@ endfunction //library WoWReforgedStartLocationsTavern: -function WoWReforgedStartLocationsTavern___AddStartLocationsTavern takes unit tavern returns nothing +function WoWReforgedStartLocationsTavern__AddStartLocationsTavern takes unit tavern returns nothing local integer i= 0 call EnablePagedButtons(tavern) call SetPagedButtonsSlotsPerPage(tavern , 10) call AddPagedButtonsId((tavern ) , ( ITEM_TYPE_RANDOM_START_LOCATION) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! set i=0 loop - exitwhen ( i >= (WoWReforgedStartLocations__startLocationsCounter) ) // INLINED!! -call AddPagedButtonsId((tavern ) , ( (WoWReforgedStartLocations__startLocationsItemTypeIds[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + exitwhen ( i >= (WoWReforgedStartLocations___startLocationsCounter) ) // INLINED!! +call AddPagedButtonsId((tavern ) , ( (WoWReforgedStartLocations___startLocationsItemTypeIds[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! set i=i + 1 endloop call SetPagedButtonsPage(tavern , 0) endfunction -function WoWReforgedStartLocationsTavern___ForGroupAddStartLocationsTavern takes nothing returns nothing - call WoWReforgedStartLocationsTavern___AddStartLocationsTavern(GetEnumUnit()) +function WoWReforgedStartLocationsTavern__ForGroupAddStartLocationsTavern takes nothing returns nothing + call WoWReforgedStartLocationsTavern__AddStartLocationsTavern(GetEnumUnit()) endfunction -function WoWReforgedStartLocationsTavern___TimerFunctionAddStartLocationsTaverns takes nothing returns nothing - call ForGroupBJ(GetUnitsOfTypeIdAll(START_LOCATIONS_TAVERN), function WoWReforgedStartLocationsTavern___ForGroupAddStartLocationsTavern) +function WoWReforgedStartLocationsTavern__TimerFunctionAddStartLocationsTaverns takes nothing returns nothing + call ForGroupBJ(GetUnitsOfTypeIdAll(START_LOCATIONS_TAVERN), function WoWReforgedStartLocationsTavern__ForGroupAddStartLocationsTavern) call PauseTimer(GetExpiredTimer()) call DestroyTimer(GetExpiredTimer()) @@ -91439,10 +87596,10 @@ function SelectRandomStartLocation takes unit buyingUnit,unit tavern returns not local integer page= 0 local integer index= 0 local integer i= 1 - local integer max= (WoWReforgedStartLocations__startLocationsCounter) // INLINED!! + local integer max= (WoWReforgedStartLocations___startLocationsCounter) // INLINED!! loop exitwhen ( i >= max ) - set id=(WoWReforgedStartLocations__startLocationsItemTypeIds[(i)]) // INLINED!! + set id=(WoWReforgedStartLocations___startLocationsItemTypeIds[(i)]) // INLINED!! if ( PlayerCanBuyStartLocationEx(owner , id) ) then set availableIds[availableIdsCounter]=id set availableIdsCounter=availableIdsCounter + 1 @@ -91463,7 +87620,7 @@ function SelectRandomStartLocation takes unit buyingUnit,unit tavern returns not set owner=null endfunction -function WoWReforgedStartLocationsTavern___TriggerConditionSellItem takes nothing returns boolean +function WoWReforgedStartLocationsTavern__TriggerConditionSellItem takes nothing returns boolean if ( GetItemTypeId(GetSoldItem()) == ITEM_TYPE_RANDOM_START_LOCATION ) then call SelectRandomStartLocation(GetBuyingUnit() , GetTriggerUnit()) call h__RemoveItem(GetSoldItem()) @@ -91472,11 +87629,11 @@ function WoWReforgedStartLocationsTavern___TriggerConditionSellItem takes nothin endfunction -function WoWReforgedStartLocationsTavern___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(WoWReforgedStartLocationsTavern___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedStartLocationsTavern___sellTrigger, Condition(function WoWReforgedStartLocationsTavern___TriggerConditionSellItem)) +function WoWReforgedStartLocationsTavern__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(WoWReforgedStartLocationsTavern__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedStartLocationsTavern__sellTrigger, Condition(function WoWReforgedStartLocationsTavern__TriggerConditionSellItem)) - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedStartLocationsTavern___TimerFunctionAddStartLocationsTaverns) + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedStartLocationsTavern__TimerFunctionAddStartLocationsTaverns) endfunction @@ -92195,8 +88352,8 @@ function WoWReforgedActionsBarUI___TriggerConditionSync takes nothing returns bo elseif ( data == "DropBackpack" ) then call WoWReforgedActionsBarUI___DropAllBackpackItems(GetTriggerPlayer()) elseif ( data == "Backpack" ) then - if ( (WoWReforgedBackpacks___Backpack[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! - call SelectUnitForPlayerSingle((WoWReforgedBackpacks___Backpack[GetPlayerId((GetTriggerPlayer()))]), GetTriggerPlayer()) // INLINED!! + if ( (WoWReforgedBackpacks__Backpack[GetPlayerId((GetTriggerPlayer()))]) != null ) then // INLINED!! + call SelectUnitForPlayerSingle((WoWReforgedBackpacks__Backpack[GetPlayerId((GetTriggerPlayer()))]), GetTriggerPlayer()) // INLINED!! call ShowBackpackUI(GetTriggerPlayer()) else call SimError(GetTriggerPlayer() , "No backpack.") @@ -92254,39 +88411,39 @@ endfunction function AddCinematicActor takes unit whichUnit returns nothing - call GroupAddUnit(WoWReforgedCinematic__actors, whichUnit) + call GroupAddUnit(WoWReforgedCinematic___actors, whichUnit) endfunction -function WoWReforgedCinematic__StorePlayerSelections takes nothing returns nothing +function WoWReforgedCinematic___StorePlayerSelections takes nothing returns nothing local player slotPlayer= null local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) set slotPlayer=Player(i) - if ( WoWReforgedCinematic__playerSelections[i] != null ) then - call GroupClear(WoWReforgedCinematic__playerSelections[i]) - call DestroyGroup(WoWReforgedCinematic__playerSelections[i]) - set WoWReforgedCinematic__playerSelections[i]=null + if ( WoWReforgedCinematic___playerSelections[i] != null ) then + call GroupClear(WoWReforgedCinematic___playerSelections[i]) + call DestroyGroup(WoWReforgedCinematic___playerSelections[i]) + set WoWReforgedCinematic___playerSelections[i]=null endif if ( GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_COMPUTER ) then - set WoWReforgedCinematic__playerSelections[i]=GetUnitsSelectedAll(slotPlayer) + set WoWReforgedCinematic___playerSelections[i]=GetUnitsSelectedAll(slotPlayer) endif set slotPlayer=null set i=i + 1 endloop endfunction -function WoWReforgedCinematic__RestorePlayerSelections takes nothing returns nothing +function WoWReforgedCinematic___RestorePlayerSelections takes nothing returns nothing local player slotPlayer= null local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) set slotPlayer=Player(i) - if ( WoWReforgedCinematic__playerSelections[i] != null and GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_COMPUTER ) then - call SelectGroupForPlayerBJ(WoWReforgedCinematic__playerSelections[i], slotPlayer) + if ( WoWReforgedCinematic___playerSelections[i] != null and GetPlayerSlotState(slotPlayer) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(slotPlayer) == MAP_CONTROL_COMPUTER ) then + call SelectGroupForPlayerBJ(WoWReforgedCinematic___playerSelections[i], slotPlayer) endif set slotPlayer=null @@ -92294,36 +88451,36 @@ function WoWReforgedCinematic__RestorePlayerSelections takes nothing returns not endloop endfunction -function WoWReforgedCinematic__StorePlayerQueueUI takes nothing returns nothing +function WoWReforgedCinematic___StorePlayerQueueUI takes nothing returns nothing local player slotPlayer= null local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) set slotPlayer=Player(i) - set WoWReforgedCinematic__playerQueueUIEnabled[i]=(QueueUI___enabledForPlayer[GetPlayerId((slotPlayer))]) // INLINED!! + set WoWReforgedCinematic___playerQueueUIEnabled[i]=(QueueUI__enabledForPlayer[GetPlayerId((slotPlayer))]) // INLINED!! set slotPlayer=null set i=i + 1 endloop endfunction -function WoWReforgedCinematic__RestorePlayerQueueUI takes nothing returns nothing +function WoWReforgedCinematic___RestorePlayerQueueUI takes nothing returns nothing local player slotPlayer= null local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) set slotPlayer=Player(i) - call SetQueueUIEnabledForPlayer(slotPlayer , WoWReforgedCinematic__playerQueueUIEnabled[i]) + call SetQueueUIEnabledForPlayer(slotPlayer , WoWReforgedCinematic___playerQueueUIEnabled[i]) set slotPlayer=null set i=i + 1 endloop endfunction -function WoWReforgedCinematic__ForForceEnableCinematic takes nothing returns nothing +function WoWReforgedCinematic___ForForceEnableCinematic takes nothing returns nothing call ShowAllTextTagsForPlayer(GetEnumPlayer() , false) call SetActionsBarUIVisibleForPlayer((GetEnumPlayer()) , false) // INLINED!! endfunction -function WoWReforgedCinematic__SyncCameraPositions takes nothing returns nothing +function WoWReforgedCinematic___SyncCameraPositions takes nothing returns nothing local player slotPlayer= null local integer i= 0 loop @@ -92341,7 +88498,7 @@ function WoWReforgedCinematic__SyncCameraPositions takes nothing returns nothing endfunction -function WoWReforgedCinematic__FilterIsNotPaused takes nothing returns boolean +function WoWReforgedCinematic___FilterIsNotPaused takes nothing returns boolean return not IsUnitPaused(GetFilterUnit()) endfunction @@ -92352,7 +88509,7 @@ function PauseAllUnits takes nothing returns nothing set bj_pauseAllUnitsFlag=true set g=CreateGroup() - call GroupClear(WoWReforgedCinematic__paused) + call GroupClear(WoWReforgedCinematic___paused) set index=0 loop set indexPlayer=Player(index) @@ -92363,9 +88520,9 @@ function PauseAllUnits takes nothing returns nothing endif // Enumerate and unpause every unit owned by the player. - call GroupEnumUnitsOfPlayer(g, indexPlayer, Filter(function WoWReforgedCinematic__FilterIsNotPaused)) + call GroupEnumUnitsOfPlayer(g, indexPlayer, Filter(function WoWReforgedCinematic___FilterIsNotPaused)) call ForGroup(g, function PauseAllUnitsBJEnum) - call GroupAddGroup(g, WoWReforgedCinematic__paused) + call GroupAddGroup(g, WoWReforgedCinematic___paused) call GroupClear(g) set index=index + 1 @@ -92380,7 +88537,7 @@ function UnpauseAllUnits takes nothing returns nothing local player indexPlayer set bj_pauseAllUnitsFlag=false - call ForGroup(WoWReforgedCinematic__paused, function PauseAllUnitsBJEnum) + call ForGroup(WoWReforgedCinematic___paused, function PauseAllUnitsBJEnum) set index=0 loop set indexPlayer=Player(index) @@ -92393,15 +88550,15 @@ function UnpauseAllUnits takes nothing returns nothing set index=index + 1 exitwhen index == bj_MAX_PLAYER_SLOTS endloop - call GroupClear(WoWReforgedCinematic__paused) + call GroupClear(WoWReforgedCinematic___paused) endfunction function EnableCinematic takes nothing returns nothing - call WoWReforgedCinematic__StorePlayerSelections() - call WoWReforgedCinematic__StorePlayerQueueUI() + call WoWReforgedCinematic___StorePlayerSelections() + call WoWReforgedCinematic___StorePlayerQueueUI() call HideQueueUI() - call ForForce(GetPlayersAll(), function WoWReforgedCinematic__ForForceEnableCinematic) - call WoWReforgedCinematic__SyncCameraPositions() + call ForForce(GetPlayersAll(), function WoWReforgedCinematic___ForForceEnableCinematic) + call WoWReforgedCinematic___SyncCameraPositions() call DisableCalendar() call ClearSelection() call PauseAllUnits() @@ -92409,32 +88566,32 @@ function EnableCinematic takes nothing returns nothing set udg_CinematicRunning=true endfunction -function WoWReforgedCinematic__ForForceDisableCinematic takes nothing returns nothing +function WoWReforgedCinematic___ForForceDisableCinematic takes nothing returns nothing local integer playerId= GetPlayerId(GetEnumPlayer()) call ShowAllTextTagsForPlayer(GetEnumPlayer() , true) call SetActionsBarUIVisibleForPlayer((GetEnumPlayer()) , true) // INLINED!! - call PanCameraToTimedForPlayer(GetEnumPlayer(), WoWReforgedCinematic__playerCameraX[playerId], WoWReforgedCinematic__playerCameraY[playerId], 0.0) + call PanCameraToTimedForPlayer(GetEnumPlayer(), WoWReforgedCinematic___playerCameraX[playerId], WoWReforgedCinematic___playerCameraY[playerId], 0.0) endfunction -function WoWReforgedCinematic__EnumRemoveUnit takes nothing returns nothing +function WoWReforgedCinematic___EnumRemoveUnit takes nothing returns nothing call h__RemoveUnit(GetEnumUnit()) endfunction function DisableCinematic takes nothing returns nothing - call WoWReforgedCinematic__RestorePlayerSelections() - call WoWReforgedCinematic__RestorePlayerQueueUI() - call ForForce(GetPlayersAll(), function WoWReforgedCinematic__ForForceDisableCinematic) - call ForGroup(WoWReforgedCinematic__actors, function WoWReforgedCinematic__EnumRemoveUnit) - call GroupClear(WoWReforgedCinematic__actors) - if ( (WoWReforgedCalendar__seasonsEnabled) ) then // INLINED!! + call WoWReforgedCinematic___RestorePlayerSelections() + call WoWReforgedCinematic___RestorePlayerQueueUI() + call ForForce(GetPlayersAll(), function WoWReforgedCinematic___ForForceDisableCinematic) + call ForGroup(WoWReforgedCinematic___actors, function WoWReforgedCinematic___EnumRemoveUnit) + call GroupClear(WoWReforgedCinematic___actors) + if ( (WoWReforgedCalendar___seasonsEnabled) ) then // INLINED!! call EnableCalendar() endif call UnpauseAllUnits() call ResetToGameCamera(0.0) endfunction -function WoWReforgedCinematic__ForForceSelectHero takes nothing returns nothing +function WoWReforgedCinematic___ForForceSelectHero takes nothing returns nothing local unit hero= GetLivingHero(GetEnumPlayer()) if ( hero != null ) then call PanCameraToTimedForPlayer(GetEnumPlayer(), GetUnitX(hero), GetUnitY(hero), 0.0) @@ -92443,32 +88600,32 @@ function WoWReforgedCinematic__ForForceSelectHero takes nothing returns nothing endfunction function SelectHeroes takes nothing returns nothing - call ForForce(GetPlayersAll(), function WoWReforgedCinematic__ForForceSelectHero) + call ForForce(GetPlayersAll(), function WoWReforgedCinematic___ForForceSelectHero) endfunction -function WoWReforgedCinematic__TriggerActionSync takes nothing returns nothing +function WoWReforgedCinematic___TriggerActionSync takes nothing returns nothing local integer playerId= GetPlayerId(GetTriggerPlayer()) local string prefix= BlzGetTriggerSyncPrefix() local string data= BlzGetTriggerSyncData() if ( prefix == WoWReforgedCinematic_PREFIX_X ) then - set WoWReforgedCinematic__playerCameraX[playerId]=S2R(data) + set WoWReforgedCinematic___playerCameraX[playerId]=S2R(data) elseif ( prefix == WoWReforgedCinematic_PREFIX_Y ) then - set WoWReforgedCinematic__playerCameraY[playerId]=S2R(data) + set WoWReforgedCinematic___playerCameraY[playerId]=S2R(data) endif endfunction -function WoWReforgedCinematic__Init takes nothing returns nothing +function WoWReforgedCinematic___Init takes nothing returns nothing local integer i= 0 loop exitwhen ( i == bj_MAX_PLAYERS ) - set WoWReforgedCinematic__playerSelections[i]=CreateGroup() - set WoWReforgedCinematic__playerCameraX[i]=GetPlayerStartLocationX(Player(i)) - set WoWReforgedCinematic__playerCameraY[i]=GetPlayerStartLocationY(Player(i)) - call BlzTriggerRegisterPlayerSyncEvent(WoWReforgedCinematic__syncTrigger, Player(i), WoWReforgedCinematic_PREFIX_X, false) - call BlzTriggerRegisterPlayerSyncEvent(WoWReforgedCinematic__syncTrigger, Player(i), WoWReforgedCinematic_PREFIX_Y, false) + set WoWReforgedCinematic___playerSelections[i]=CreateGroup() + set WoWReforgedCinematic___playerCameraX[i]=GetPlayerStartLocationX(Player(i)) + set WoWReforgedCinematic___playerCameraY[i]=GetPlayerStartLocationY(Player(i)) + call BlzTriggerRegisterPlayerSyncEvent(WoWReforgedCinematic___syncTrigger, Player(i), WoWReforgedCinematic_PREFIX_X, false) + call BlzTriggerRegisterPlayerSyncEvent(WoWReforgedCinematic___syncTrigger, Player(i), WoWReforgedCinematic_PREFIX_Y, false) set i=i + 1 endloop - call TriggerAddAction(WoWReforgedCinematic__syncTrigger, function WoWReforgedCinematic__TriggerActionSync) + call TriggerAddAction(WoWReforgedCinematic___syncTrigger, function WoWReforgedCinematic___TriggerActionSync) endfunction @@ -92550,7 +88707,7 @@ function WoWReforgedRacesUI___ForForceUpdateIdleWorkerIcons takes nothing return endfunction function WoWReforgedRacesUI___TimerFunctionUpdateIdleWorkerIcons takes nothing returns nothing - call ForForce((ForceUtils___allPlayingUsers), function WoWReforgedRacesUI___ForForceUpdateIdleWorkerIcons) // INLINED!! + call ForForce((ForceUtils__allPlayingUsers), function WoWReforgedRacesUI___ForForceUpdateIdleWorkerIcons) // INLINED!! endfunction function UseCustomConsoleUIForCustomRace takes player whichPlayer,integer whichRace returns nothing @@ -92563,7 +88720,7 @@ function UseCustomConsoleUIForCustomRace takes player whichPlayer,integer whichR if ( GetLocalPlayer() == whichPlayer ) then call SetActionsBarRaceTexturesFromRace(whichRace) endif - call ForForce((ForceUtils___allPlayingUsers), function WoWReforgedRacesUI___ForForceUpdateIdleWorkerIcons) // INLINED!! + call ForForce((ForceUtils__allPlayingUsers), function WoWReforgedRacesUI___ForForceUpdateIdleWorkerIcons) // INLINED!! endfunction function ConsoleUIExistsForCustomRace takes integer whichRace returns boolean @@ -95223,8 +91380,6 @@ endfunction //*************************************************************************** //* WoW Reforged Cages //*************************************************************************** -//* WoW Reforged Website -//*************************************************************************** //* WoW Reforged Item Sets //*************************************************************************** //* WoW Reforged Fel @@ -110015,39 +106170,39 @@ function Trig_Taunts_Init_Actions takes nothing returns nothing // ########################### set udg_TmpString="Yes my lord!" set udg_TmpSound=gg_snd_PeasantYes2 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="Work work!" set udg_TmpSound=gg_snd_PeonYes3 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="That's it, I am dead!" set udg_TmpSound=gg_snd_PeasantYesAttack4 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="Intriguing!" set udg_TmpSound=gg_snd_NecromancerYes1 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="For Lordaeron!" set udg_TmpSound=gg_snd_ArthasWarcry1 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="I should have been a farmer like my father wanted!" set udg_TmpSound=gg_snd_CaptainPissed1 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="Hippity Hoppity!" set udg_TmpSound=gg_snd_FunnyBunnyYes1 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="Who dares defile this ancient land? " set udg_TmpSound=gg_snd_Cenarius_What1 - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### set udg_TmpString="Tremble mortals and despair, doom has come to this world. " set udg_TmpSound=gg_snd_DemiDark - call AddTaunt(I2S((Taunts___TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! + call AddTaunt(I2S((Taunts__TauntsCount) + 1) , udg_TmpString , udg_TmpSound) // INLINED!! // ########################### endfunction @@ -112408,7 +108563,7 @@ function Trig_Equipment_Init_Actions takes nothing returns nothing // ########################### set udg_TmpItemTypeId='I0V7' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### @@ -112434,7 +108589,7 @@ function Trig_Equipment_Init_Actions takes nothing returns nothing // ########################### set udg_TmpItemTypeId='I0V2' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### @@ -112460,7 +108615,7 @@ function Trig_Equipment_Init_Actions takes nothing returns nothing // ########################### set udg_TmpItemTypeId='I0VB' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### @@ -112471,43 +108626,43 @@ function Trig_Equipment_Init_Actions takes nothing returns nothing // ########################### set udg_TmpItemTypeId='I0U8' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND_HAMMER // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0UH' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0V2' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0VK' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0VL' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0V0' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0ZR' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### @@ -112522,13 +108677,13 @@ function Trig_Equipment_Init_Actions takes nothing returns nothing // ########################### set udg_TmpItemTypeId='I0UJ' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0UV' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### @@ -112536,84 +108691,84 @@ function Trig_Equipment_Init_Actions takes nothing returns nothing // ########################### set udg_TmpItemTypeId='I0UG' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_BOW // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0V6' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_BOW // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0UW' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0WT' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0VA' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0VG' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0VJ' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0V8' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0UX' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_MINIGUN // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I138' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I139' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I13H' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_MINIGUN // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### set udg_TmpItemTypeId='I0UU' set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) // INLINED!! + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) // INLINED!! set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_MINIGUN // INLINED!! call AddEquipmentItemTypeWoWReforged() // ########################### @@ -119273,8 +115428,8 @@ function Trig_Unit_Respawns_Respawn_Func004C takes nothing returns boolean endfunction function Trig_Unit_Respawns_Respawn_Actions takes nothing returns nothing - local location tmpLocation= GetUnitLoc((UnitGroupRespawnSystem___callbackUnit)) // INLINED!! - set udg_TmpUnit=(UnitGroupRespawnSystem___callbackUnit) // INLINED!! + local location tmpLocation= GetUnitLoc((UnitGroupRespawnSystem__callbackUnit)) // INLINED!! + set udg_TmpUnit=(UnitGroupRespawnSystem__callbackUnit) // INLINED!! set udg_TmpBoolean=RespawnRectContainsNoBuilding(tmpLocation) if ( Trig_Unit_Respawns_Respawn_Func004C() ) then call DestroyEffect(AddSpecialEffectLocBJ(tmpLocation, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl")) @@ -119384,7 +115539,7 @@ function Trig_Save_Games_Load_Actions takes nothing returns nothing call ForForce(bj_FORCE_PLAYER[0], (function CreateAiPlayersUI)) // INLINED!! // Somehow Warcraft changes the title color to white after loading a save game. call MultiboardSetTitleTextColorBJ(udg_StatsMultiboard, 100, 80, 20, 0) - call MultiboardSetTitleTextColorBJ(WoWReforgedCalendarMultiboard__m, 100, 80, 20, 0) // INLINED!! + call MultiboardSetTitleTextColorBJ(WoWReforgedCalendarMultiboard___m, 100, 80, 20, 0) // INLINED!! endfunction //=========================================================================== @@ -124454,7 +120609,7 @@ function Trig_Items_Unlimited_Bag_of_Food_Conditions takes nothing returns boole endfunction function Trig_Items_Unlimited_Bag_of_Food_Actions takes nothing returns nothing - call UnitAddItemById((GetTriggerUnit()), (WoWReforgedUnlimitedBagOfFood__ids[GetRandomInt(0, WoWReforgedUnlimitedBagOfFood__counter)])) // INLINED!! + call UnitAddItemById((GetTriggerUnit()), (WoWReforgedUnlimitedBagOfFood___ids[GetRandomInt(0, WoWReforgedUnlimitedBagOfFood___counter)])) // INLINED!! endfunction //=========================================================================== @@ -128059,9 +124214,9 @@ endfunction //=========================================================================== function Trig_Spells_Mind_Control_Init_Actions takes nothing returns nothing set udg_TmpPlayer=udg_BossesPlayer - call ForceAddPlayer(MindControl___notAllowedPlayers, (udg_TmpPlayer)) // INLINED!! + call ForceAddPlayer(MindControl__notAllowedPlayers, (udg_TmpPlayer)) // INLINED!! set udg_TmpPlayer=udg_TheBurningLegion - call ForceAddPlayer(MindControl___notAllowedPlayers, (udg_TmpPlayer)) // INLINED!! + call ForceAddPlayer(MindControl__notAllowedPlayers, (udg_TmpPlayer)) // INLINED!! endfunction //=========================================================================== @@ -132191,31 +128346,31 @@ function Trig_Professions_Init_Herbalist_Actions takes nothing returns nothing set udg_TmpAbilityCode='A00E' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='hlst' set udg_TmpAbilityCode='A00I' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='pnvu' set udg_TmpAbilityCode='A01B' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I025' set udg_TmpAbilityCode='A01D' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='shea' set udg_TmpAbilityCode='A0WR' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I10A' set udg_TmpAbilityCode='A0WS' @@ -132243,31 +128398,31 @@ function Trig_Professions_Init_Alchemist_Actions takes nothing returns nothing set udg_TmpAbilityCode='A007' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='mnst' set udg_TmpAbilityCode='A01M' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='woms' set udg_TmpAbilityCode='A009' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I024' set udg_TmpAbilityCode='A00A' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='sman' set udg_TmpAbilityCode='A0WK' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I10C' set udg_TmpAbilityCode='A0WO' @@ -132295,31 +128450,31 @@ function Trig_Professions_Init_Weapon_Smith_Actions takes nothing returns nothin set udg_TmpAbilityCode='A00L' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00P' set udg_TmpAbilityCode='A00R' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00Q' set udg_TmpAbilityCode='A00S' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00R' set udg_TmpAbilityCode='A00T' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15Q' set udg_TmpAbilityCode='A0YG' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15V' set udg_TmpAbilityCode='A107' @@ -132347,31 +128502,31 @@ function Trig_Professions_Init_Armorer_Actions takes nothing returns nothing set udg_TmpAbilityCode='A00C' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00L' set udg_TmpAbilityCode='A00B' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00M' set udg_TmpAbilityCode='A01N' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00N' set udg_TmpAbilityCode='A01O' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15T' set udg_TmpAbilityCode='A0YM' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15U' set udg_TmpAbilityCode='A0ZK' @@ -132399,20 +128554,20 @@ function Trig_Professions_Init_Engineer_Actions takes nothing returns nothing set udg_TmpAbilityCode='A01A' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00U' set udg_TmpAbilityCode='A006' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpUnitType='ngsp' set udg_TmpAbilityCode='A016' set udg_TmpInteger=2 call AddProfessionCrafted(0 , udg_TmpUnitType , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I00S' set udg_TmpAbilityCode='A00H' @@ -132440,31 +128595,31 @@ function Trig_Professions_Init_Lore_Master_Actions takes nothing returns nothing set udg_TmpAbilityCode='A00Q' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='sres' set udg_TmpAbilityCode='A00F' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='srrc' set udg_TmpAbilityCode='A00G' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='ankh' set udg_TmpAbilityCode='A00O' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='sror' set udg_TmpAbilityCode='A17M' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='arsc' set udg_TmpAbilityCode='A17N' @@ -132493,35 +128648,35 @@ function Trig_Professions_Init_Sorcerer_Actions takes nothing returns nothing set udg_TmpInteger=8 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='wcyc' set udg_TmpAbilityCode='A06H' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I038' set udg_TmpAbilityCode='A06E' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I039' set udg_TmpAbilityCode='A06G' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='wshs' set udg_TmpAbilityCode='A1BE' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0XW' set udg_TmpAbilityCode='A1BF' @@ -132551,21 +128706,21 @@ function Trig_Professions_Init_Runeforger_Actions takes nothing returns nothing set udg_TmpInteger=8 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I031' set udg_TmpAbilityCode='A06J' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I02Z' set udg_TmpAbilityCode='A06J' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I032' set udg_TmpAbilityCode='A06L' @@ -132573,14 +128728,14 @@ function Trig_Professions_Init_Runeforger_Actions takes nothing returns nothing set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I163' set udg_TmpAbilityCode='A10R' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I164' set udg_TmpAbilityCode='A10T' @@ -132609,31 +128764,31 @@ function Trig_Professions_Init_Dragon_Breeder_Actions takes nothing returns noth set udg_TmpAbilityCode='A06M' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I036' set udg_TmpAbilityCode='A06N' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I035' set udg_TmpAbilityCode='A06N' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I037' set udg_TmpAbilityCode='A06P' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0B1' set udg_TmpAbilityCode='A0WM' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I10B' set udg_TmpAbilityCode='A0WN' @@ -132661,31 +128816,31 @@ function Trig_Professions_Init_Jewelcrafter_Actions takes nothing returns nothin set udg_TmpAbilityCode='A0IL' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I077' set udg_TmpAbilityCode='A0IN' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I078' set udg_TmpAbilityCode='A0IO' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I079' set udg_TmpAbilityCode='A0IP' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I166' set udg_TmpAbilityCode='A10W' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I165' set udg_TmpAbilityCode='A10X' @@ -132713,31 +128868,31 @@ function Trig_Professions_Init_Enchanter_Actions takes nothing returns nothing set udg_TmpAbilityCode='A0IS' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I07H' set udg_TmpAbilityCode='A0IT' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I07I' set udg_TmpAbilityCode='A0IU' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I07J' set udg_TmpAbilityCode='A0IV' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15R' set udg_TmpAbilityCode='A0YJ' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15S' set udg_TmpAbilityCode='A0YL' @@ -132765,19 +128920,19 @@ function Trig_Professions_Init_Captain_Actions takes nothing returns nothing set udg_TmpAbilityCode='A0JK' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I083' set udg_TmpAbilityCode='A0JN' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I085' set udg_TmpAbilityCode='A0JP' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I086' set udg_TmpAbilityCode='A0JQ' @@ -132806,35 +128961,35 @@ function Trig_Professions_Init_Archaelogist_Actions takes nothing returns nothin set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0IF' set udg_TmpAbilityCode='A0ML' set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0IG' set udg_TmpAbilityCode='A0MK' set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0IH' set udg_TmpAbilityCode='A0MM' set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15Z' set udg_TmpAbilityCode='A10F' set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I160' set udg_TmpAbilityCode='A10H' @@ -132863,35 +129018,35 @@ function Trig_Professions_Init_Witch_Doctor_Actions takes nothing returns nothin set udg_TmpInteger=8 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I09K' set udg_TmpAbilityCode='A0MU' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I09I' set udg_TmpAbilityCode='A0MW' set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='whwd' set udg_TmpAbilityCode='A0MX' set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0FH' set udg_TmpAbilityCode='A17I' set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0R4' set udg_TmpAbilityCode='A17L' @@ -132920,19 +129075,19 @@ function Trig_Professions_Init_Merchant_Actions takes nothing returns nothing set udg_TmpAbilityCode='A0U3' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0D4' set udg_TmpAbilityCode='A0U9' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0D5' set udg_TmpAbilityCode='A0UA' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0D6' set udg_TmpAbilityCode='A0UB' @@ -132960,19 +129115,19 @@ function Trig_Professions_Init_Farmer_Actions takes nothing returns nothing set udg_TmpAbilityCode='A170' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0JW' set udg_TmpAbilityCode='A172' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0KA' set udg_TmpAbilityCode='A17V' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0KB' set udg_TmpAbilityCode='A181' @@ -133000,19 +129155,19 @@ function Trig_Professions_Init_Tamer_Actions takes nothing returns nothing set udg_TmpAbilityCode='A191' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0L5' set udg_TmpAbilityCode='A194' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0L6' set udg_TmpAbilityCode='A196' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0L2' set udg_TmpAbilityCode='A181' @@ -133040,31 +129195,31 @@ function Trig_Professions_Init_Inscriptor_Actions takes nothing returns nothing set udg_TmpAbilityCode='A1CO' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0NQ' set udg_TmpAbilityCode='A1CS' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0NP' set udg_TmpAbilityCode='A1CQ' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0NR' set udg_TmpAbilityCode='A1CR' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15W' set udg_TmpAbilityCode='A108' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15X' set udg_TmpAbilityCode='A109' @@ -133093,35 +129248,35 @@ function Trig_Professions_Init_Necromancer_Actions takes nothing returns nothing set udg_TmpInteger=8 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0S9' set udg_TmpAbilityCode='A1M2' set udg_TmpInteger=8 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='skul' set udg_TmpAbilityCode='A1M3' set udg_TmpInteger=10 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='fgsk' set udg_TmpAbilityCode='A1M4' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='sand' set udg_TmpAbilityCode='A0WV' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I110' set udg_TmpAbilityCode='A0WY' @@ -133151,21 +129306,21 @@ function Trig_Professions_Init_Golem_Sculptor_Actions takes nothing returns noth set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0SL' set udg_TmpAbilityCode='A1MC' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0SK' set udg_TmpAbilityCode='A1MS' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0SM' set udg_TmpAbilityCode='A1MT' @@ -133194,19 +129349,19 @@ function Trig_Professions_Init_Combiner_Actions takes nothing returns nothing set udg_TmpAbilityCode='A1O6' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0T7' set udg_TmpAbilityCode='A1O7' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0T8' set udg_TmpAbilityCode='A1O8' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0T9' set udg_TmpAbilityCode='A1O9' @@ -133234,21 +129389,21 @@ function Trig_Professions_Init_Hunter_Actions takes nothing returns nothing set udg_TmpAbilityCode='A1SI' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0VW' set udg_TmpAbilityCode='A1SO' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0VX' set udg_TmpAbilityCode='A1SQ' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0VV' set udg_TmpAbilityCode='A1SL' @@ -133277,21 +129432,21 @@ function Trig_Professions_Init_Miner_Actions takes nothing returns nothing set udg_TmpAbilityCode='A1T4' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0W9' set udg_TmpAbilityCode='A1T5' set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0WA' set udg_TmpAbilityCode='A1T6' set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0W8' set udg_TmpAbilityCode='A1T7' @@ -133320,20 +129475,20 @@ function Trig_Professions_Init_Cook_Actions takes nothing returns nothing set udg_TmpAbilityCode='A1U2' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0XA' set udg_TmpAbilityCode='A1UJ' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0XB' set udg_TmpAbilityCode='A1UK' set udg_TmpBoolean=false call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0XC' set udg_TmpAbilityCode='A1UL' @@ -133362,21 +129517,21 @@ function Trig_Professions_Init_Fisherman_Actions takes nothing returns nothing set udg_TmpAbilityCode='A1UA' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0Q2' set udg_TmpAbilityCode='A1UB' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0X9' set udg_TmpAbilityCode='A1UH' set udg_TmpInteger=4 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0X8' set udg_TmpAbilityCode='A1UF' @@ -133404,7 +129559,7 @@ function Trig_Professions_Init_Prospector_Actions takes nothing returns nothing set udg_TmpAbilityCode='A21M' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A21N' set udg_TmpItemTypeId='I120' @@ -133414,14 +129569,14 @@ function Trig_Professions_Init_Prospector_Actions takes nothing returns nothing set udg_TmpInteger=1 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpUnitType='n0M5' set udg_TmpAbilityCode='A21O' set udg_TmpInteger=2 call AddProfessionCrafted(0 , udg_TmpUnitType , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I11Y' set udg_TmpAbilityCode='A21P' @@ -133452,7 +129607,7 @@ function Trig_Professions_Init_Lumberjack_Actions takes nothing returns nothing set udg_TmpAbilityCode='A1UX' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A1UY' set udg_TmpItemTypeId='I00V' @@ -133465,14 +129620,14 @@ function Trig_Professions_Init_Lumberjack_Actions takes nothing returns nothing set udg_TmpInteger=1 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpUnitType='ngir' set udg_TmpAbilityCode='A1UZ' set udg_TmpInteger=2 call AddProfessionCrafted(0 , udg_TmpUnitType , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0XN' set udg_TmpAbilityCode='A1V0' @@ -133504,27 +129659,27 @@ function Trig_Professions_Init_Warlock_Actions takes nothing returns nothing set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='infs' set udg_TmpAbilityCode='A1WX' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0Y7' set udg_TmpAbilityCode='A1WY' set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I0YG' set udg_TmpAbilityCode='A1WZ' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A10A' set udg_TmpItemTypeId='fgdg' @@ -133532,7 +129687,7 @@ function Trig_Professions_Init_Warlock_Actions takes nothing returns nothing set udg_TmpItemTypeId='fgfh' call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I15Y' set udg_TmpAbilityCode='A10B' @@ -133564,7 +129719,7 @@ function Trig_Professions_Init_Thief_Actions takes nothing returns nothing set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A20M' set udg_TmpItemTypeId='I09H' @@ -133577,14 +129732,14 @@ function Trig_Professions_Init_Thief_Actions takes nothing returns nothing set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I03F' set udg_TmpAbilityCode='A20N' set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I10R' set udg_TmpAbilityCode='A20O' @@ -133619,7 +129774,7 @@ function Trig_Professions_Init_Astromancer_Actions takes nothing returns nothing set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A230' set udg_TmpItemTypeId='fgun' @@ -133629,7 +129784,7 @@ function Trig_Professions_Init_Astromancer_Actions takes nothing returns nothing set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A231' set udg_TmpItemTypeId='I12U' @@ -133639,7 +129794,7 @@ function Trig_Professions_Init_Astromancer_Actions takes nothing returns nothing set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpItemTypeId='I12Z' set udg_TmpAbilityCode='A232' @@ -133672,21 +129827,21 @@ function Trig_Professions_Init_Bard_Actions takes nothing returns nothing set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A25B' set udg_TmpItemTypeId='I14R' set udg_TmpInteger=2 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A25E' set udg_TmpItemTypeId='I14S' set udg_TmpInteger=3 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A25A' set udg_TmpItemTypeId='I14Q' @@ -133719,7 +129874,7 @@ function Trig_Professions_Init_Scribe_Actions takes nothing returns nothing set udg_TmpInteger=1 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A0SS' set udg_TmpItemTypeId='manh' @@ -133729,7 +129884,7 @@ function Trig_Professions_Init_Scribe_Actions takes nothing returns nothing set udg_TmpInteger=1 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A0ST' set udg_TmpItemTypeId='I13E' @@ -133739,21 +129894,21 @@ function Trig_Professions_Init_Scribe_Actions takes nothing returns nothing set udg_TmpInteger=1 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A0SU' set udg_TmpItemTypeId='texp' set udg_TmpInteger=1 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A0YI' set udg_TmpItemTypeId='tgxp' set udg_TmpInteger=1 call AddProfessionCrafted(udg_TmpItemTypeId , 0 , udg_TmpInteger , udg_TmpBoolean , udg_TmpAbilityCode) // INLINED!! // ########################### - set WoWReforgedProfessions___tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions___tmpRankCounter + 1) // INLINED!! + set WoWReforgedProfessions__tmpRankCounter=IMinBJ(PROFESSION_RANK_FINAL, WoWReforgedProfessions__tmpRankCounter + 1) // INLINED!! // ########################### set udg_TmpAbilityCode='A0YH' set udg_TmpItemTypeId='tkno' @@ -133937,26 +130092,26 @@ function Trig_Professions_Craft_Extra_Actions takes nothing returns nothing endif // MINER if ( Trig_Professions_Craft_Extra_Func013C() ) then - set udg_TmpItemTypeId=(WoWReforgedMiner__oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner__oreItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WoWReforgedMiner___oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner___oreItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) - set udg_TmpItemTypeId=(WoWReforgedMiner__oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner__oreItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WoWReforgedMiner___oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner___oreItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) - set udg_TmpItemTypeId=(WoWReforgedMiner__oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner__oreItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WoWReforgedMiner___oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner___oreItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) - set udg_TmpItemTypeId=(WoWReforgedMiner__oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner__oreItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WoWReforgedMiner___oreItemTypeIds[GetRandomInt(0, WoWReforgedMiner___oreItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) else call DoNothing() endif if ( Trig_Professions_Craft_Extra_Func014C() ) then - set udg_TmpItemTypeId=(WoWReforgedMiner__gemItemTypeIds[GetRandomInt(0, WoWReforgedMiner__gemItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WoWReforgedMiner___gemItemTypeIds[GetRandomInt(0, WoWReforgedMiner___gemItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) - set udg_TmpItemTypeId=(WoWReforgedMiner__gemItemTypeIds[GetRandomInt(0, WoWReforgedMiner__gemItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WoWReforgedMiner___gemItemTypeIds[GetRandomInt(0, WoWReforgedMiner___gemItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) else @@ -133964,16 +130119,16 @@ function Trig_Professions_Craft_Extra_Actions takes nothing returns nothing endif // COOK if ( Trig_Professions_Craft_Extra_Func016C() ) then - set udg_TmpItemTypeId=(WowReforgedCook__foodItemTypeIds[GetRandomInt(0, WowReforgedCook__foodItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WowReforgedCook___foodItemTypeIds[GetRandomInt(0, WowReforgedCook___foodItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) - set udg_TmpItemTypeId=(WowReforgedCook__foodItemTypeIds[GetRandomInt(0, WowReforgedCook__foodItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WowReforgedCook___foodItemTypeIds[GetRandomInt(0, WowReforgedCook___foodItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) - set udg_TmpItemTypeId=(WowReforgedCook__foodItemTypeIds[GetRandomInt(0, WowReforgedCook__foodItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WowReforgedCook___foodItemTypeIds[GetRandomInt(0, WowReforgedCook___foodItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) - set udg_TmpItemTypeId=(WowReforgedCook__foodItemTypeIds[GetRandomInt(0, WowReforgedCook__foodItemTypeIdsCounter - 1)]) // INLINED!! + set udg_TmpItemTypeId=(WowReforgedCook___foodItemTypeIds[GetRandomInt(0, WowReforgedCook___foodItemTypeIdsCounter - 1)]) // INLINED!! set udg_TmpInteger=1 call ProfessionCraftItems(udg_TmpUnit , udg_TmpAbilityCode , udg_TmpItemTypeId , udg_TmpInteger) else @@ -134349,7 +130504,7 @@ function Trig_Miner_Summon_Mine_Conditions takes nothing returns boolean endfunction function Trig_Miner_Summon_Mine_Actions takes nothing returns nothing - call AddMineEx((GetSummonedUnit()) , (WoWReforgedMiner__mineralResources[GetRandomInt(0, WoWReforgedMiner__mineralResourcesCounter - 1)]) , GetRandomInt(200, 1500)) // INLINED!! + call AddMineEx((GetSummonedUnit()) , (WoWReforgedMiner___mineralResources[GetRandomInt(0, WoWReforgedMiner___mineralResourcesCounter - 1)]) , GetRandomInt(200, 1500)) // INLINED!! endfunction //=========================================================================== @@ -135930,7 +132085,7 @@ function Trig_Races_Sell_Unit_Refund_Actions takes nothing returns nothing set udg_TmpInteger=GetRaceObjectType(udg_TmpInteger , udg_TmpUnitType) set udg_TmpBoolean=IsWaterRaceUnit(udg_TmpInteger) if ( Trig_Races_Sell_Unit_Refund_Func007Func003C() ) then - set udg_TmpBoolean=(WoWReforgedProperties__GetPropertyIndexByUnitTypeId((GetUnitTypeId(GetTriggerUnit()))) != - 1) // INLINED!! + set udg_TmpBoolean=(WoWReforgedProperties___GetPropertyIndexByUnitTypeId((GetUnitTypeId(GetTriggerUnit()))) != - 1) // INLINED!! if ( Trig_Races_Sell_Unit_Refund_Func007Func003Func004C() ) then set udg_TmpString=( GetUnitName(udg_TmpUnit) + " is refunded since it has a different race." ) call RefundUnit(udg_TmpUnit) @@ -135989,7 +132144,7 @@ function Trig_Races_Sell_Item_Refund_Actions takes nothing returns nothing set udg_TmpInteger=GetObjectRace(udg_TmpItemTypeId) set udg_TmpBoolean=PlayerHasUnlockedRace(udg_TmpPlayer , udg_TmpInteger) if ( Trig_Races_Sell_Item_Refund_Func009C() ) then - set udg_TmpBoolean=(WoWReforgedProperties__GetPropertyIndexByUnitTypeId((GetUnitTypeId(GetTriggerUnit()))) != - 1) // INLINED!! + set udg_TmpBoolean=(WoWReforgedProperties___GetPropertyIndexByUnitTypeId((GetUnitTypeId(GetTriggerUnit()))) != - 1) // INLINED!! if ( Trig_Races_Sell_Item_Refund_Func009Func002C() ) then set udg_TmpString=( GetItemName(udg_TmpItem) + " is refunded since it has a different race." ) call RefundItem(udg_TmpItem , udg_TmpPlayer) @@ -145557,7 +141712,7 @@ function Trig_Dalaran_Shield_Enable_Func002C takes nothing returns boolean endfunction function Trig_Dalaran_Shield_Enable_Actions takes nothing returns nothing - set udg_TmpBoolean=(IsUnitInGroup((GetTriggerUnit()), WoWReforgedDalaranShields__powerGenerators)) // INLINED!! + set udg_TmpBoolean=(IsUnitInGroup((GetTriggerUnit()), WoWReforgedDalaranShields___powerGenerators)) // INLINED!! if ( Trig_Dalaran_Shield_Enable_Func002C() ) then call EnableDalaranShield(GetTriggerUnit()) call EnableTrigger(gg_trg_Dalaran_Shield_Timer) @@ -145603,10 +141758,10 @@ function Trig_Dalaran_Shield_Disable_Func002C takes nothing returns boolean endfunction function Trig_Dalaran_Shield_Disable_Actions takes nothing returns nothing - set udg_TmpBoolean=(IsUnitInGroup((GetTriggerUnit()), WoWReforgedDalaranShields__powerGenerators)) // INLINED!! + set udg_TmpBoolean=(IsUnitInGroup((GetTriggerUnit()), WoWReforgedDalaranShields___powerGenerators)) // INLINED!! if ( Trig_Dalaran_Shield_Disable_Func002C() ) then call DisableDalaranShield(GetTriggerUnit()) - set udg_TmpBoolean=(BlzGroupGetSize(WoWReforgedDalaranShields__powerGenerators) == 0) // INLINED!! + set udg_TmpBoolean=(BlzGroupGetSize(WoWReforgedDalaranShields___powerGenerators) == 0) // INLINED!! if ( Trig_Dalaran_Shield_Disable_Func002Func005C() ) then call DisableTrigger(gg_trg_Dalaran_Shield_Timer) else @@ -145645,10 +141800,10 @@ function Trig_Dalaran_Shield_Death_Func002C takes nothing returns boolean endfunction function Trig_Dalaran_Shield_Death_Actions takes nothing returns nothing - set udg_TmpBoolean=(IsUnitInGroup((GetTriggerUnit()), WoWReforgedDalaranShields__powerGenerators)) // INLINED!! + set udg_TmpBoolean=(IsUnitInGroup((GetTriggerUnit()), WoWReforgedDalaranShields___powerGenerators)) // INLINED!! if ( Trig_Dalaran_Shield_Death_Func002C() ) then call DisableDalaranShield(GetTriggerUnit()) - set udg_TmpBoolean=(BlzGroupGetSize(WoWReforgedDalaranShields__powerGenerators) == 0) // INLINED!! + set udg_TmpBoolean=(BlzGroupGetSize(WoWReforgedDalaranShields___powerGenerators) == 0) // INLINED!! if ( Trig_Dalaran_Shield_Death_Func002Func005C() ) then call DisableTrigger(gg_trg_Dalaran_Shield_Timer) else @@ -145695,7 +141850,7 @@ endfunction function Trig_Dalaran_Shield_Timer_Actions takes nothing returns nothing call GroupClear(udg_TmpGroup) - call GroupAddGroup(WoWReforgedDalaranShields__powerGenerators, (udg_TmpGroup)) // INLINED!! + call GroupAddGroup(WoWReforgedDalaranShields___powerGenerators, (udg_TmpGroup)) // INLINED!! call ForGroupBJ(udg_TmpGroup, function Trig_Dalaran_Shield_Timer_Func003A) endfunction @@ -148125,7 +144280,7 @@ function Trig_Recipes_Init_Actions takes nothing returns nothing set udg_TmpItemTypeId='I0PM' call AddRecipeRequirementWoWReforged() set udg_TmpInteger2=6 - set Crafting___recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! + set Crafting__recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! // Shadow Orb +1 set udg_TmpItemTypeId='sor1' set udg_TmpItemTypeId2='I0NV' @@ -148169,7 +144324,7 @@ function Trig_Recipes_Init_Actions takes nothing returns nothing call AddRecipeRequirementWoWReforged() // Page set udg_TmpString="(Orbs)" - set Crafting___recipesPageName[Crafting___lastCreatedRecipe]=(udg_TmpString) // INLINED!! + set Crafting__recipesPageName[Crafting__lastCreatedRecipe]=(udg_TmpString) // INLINED!! // Shadow Orb +7 set udg_TmpItemTypeId='sor7' set udg_TmpItemTypeId2='I0O1' @@ -148428,7 +144583,7 @@ function Trig_Recipes_Init_Actions takes nothing returns nothing // ########################### // Page set udg_TmpString="(Permanent)" - set Crafting___recipesPageName[Crafting___lastCreatedRecipe]=(udg_TmpString) // INLINED!! + set Crafting__recipesPageName[Crafting__lastCreatedRecipe]=(udg_TmpString) // INLINED!! // ########################### set udg_TmpItemTypeId='srbd' set udg_TmpItemTypeId2='I0OB' @@ -148526,7 +144681,7 @@ function Trig_Recipes_Init_Actions takes nothing returns nothing set udg_TmpItemTypeId='I0OQ' call AddRecipeRequirementWoWReforged() set udg_TmpInteger2=6 - set Crafting___recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! + set Crafting__recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! // ########################### set udg_TmpString="(Powerful Creatures)" call AddRecipeSpacer(udg_TmpString) @@ -148612,7 +144767,7 @@ function Trig_Crafting_Stash_Start_Actions takes nothing returns nothing call TriggerRegisterItemCraftingEvent(gg_trg_Crafting_Stash_On_Crafting_Item) call TriggerRegisterUnitCraftingEvent(gg_trg_Crafting_Stash_On_Crafting_Unit) call TriggerRegisterItemDisassembleEvent(gg_trg_Crafting_Stash_On_Disassemble_Item) - set Crafting___recipeRequirementCallbackTrigger=(gg_trg_Crafting_Stash_On_Requirement) // INLINED!! + set Crafting__recipeRequirementCallbackTrigger=(gg_trg_Crafting_Stash_On_Requirement) // INLINED!! call ForGroupBJ(GetUnitsOfTypeIdAll('h04V'), function Trig_Crafting_Stash_Start_Func005A) call ForGroupBJ(GetUnitsOfTypeIdAll('h0J2'), function Trig_Crafting_Stash_Start_Func006A) endfunction @@ -148653,8 +144808,8 @@ function Trig_Crafting_Stash_On_Crafting_Item_Func008C takes nothing returns boo endfunction function Trig_Crafting_Stash_On_Crafting_Item_Actions takes nothing returns nothing - set udg_TmpUnit=(Crafting___triggerCraftingUnit) // INLINED!! - set udg_TmpItem=(Crafting___triggerCraftedItem) // INLINED!! + set udg_TmpUnit=(Crafting__triggerCraftingUnit) // INLINED!! + set udg_TmpItem=(Crafting__triggerCraftedItem) // INLINED!! call CraftItemCook(udg_TmpUnit , udg_TmpItem) set udg_TmpPlayer=GetOwningPlayer(udg_TmpUnit) set udg_TmpInteger=IMaxBJ(1, GetItemCharges(udg_TmpItem)) @@ -148694,8 +144849,8 @@ function Trig_Crafting_Stash_On_Disassemble_Item_Func007C takes nothing returns endfunction function Trig_Crafting_Stash_On_Disassemble_Item_Actions takes nothing returns nothing - set udg_TmpUnit=(Crafting___triggerCraftingUnit) // INLINED!! - set udg_TmpItem=(Crafting___triggerCraftedItem) // INLINED!! + set udg_TmpUnit=(Crafting__triggerCraftingUnit) // INLINED!! + set udg_TmpItem=(Crafting__triggerCraftedItem) // INLINED!! set udg_TmpPlayer=GetOwningPlayer(udg_TmpUnit) set udg_TmpInteger=IMaxBJ(1, GetItemCharges(udg_TmpItem)) call h__QuestMessageBJ(GetForceOfPlayer(udg_TmpPlayer), bj_QUESTMESSAGE_ITEMACQUIRED, ( "Disassemble item " + ( GetItemName(udg_TmpItem) + ( " (" + ( I2S(udg_TmpInteger) + ")!" ) ) ) )) @@ -148724,8 +144879,8 @@ endfunction // Gives some feedback to the player when crafting units. //=========================================================================== function Trig_Crafting_Stash_On_Crafting_Unit_Actions takes nothing returns nothing - set udg_TmpUnit=(Crafting___triggerCraftingUnit) // INLINED!! - set udg_TmpUnit2=(Crafting___triggerCraftedUnit) // INLINED!! + set udg_TmpUnit=(Crafting__triggerCraftingUnit) // INLINED!! + set udg_TmpUnit2=(Crafting__triggerCraftedUnit) // INLINED!! set udg_TmpPlayer=GetOwningPlayer(udg_TmpUnit) call h__QuestMessageBJ(GetForceOfPlayer(udg_TmpPlayer), bj_QUESTMESSAGE_UNITACQUIRED, ( "Summoned unit " + ( GetUnitName(udg_TmpUnit2) + "!" ) )) call PingUnitForPlayer(udg_TmpUnit2 , udg_TmpPlayer) @@ -148741,16 +144896,16 @@ endfunction // Trigger: Crafting Stash On Requirement //=========================================================================== function Trig_Crafting_Stash_On_Requirement_Conditions takes nothing returns boolean - if ( (Crafting___triggerRecipe) == udg_RecipeHolyGrail and udg_HolyGrail != null or (Crafting___triggerCraftedCharges) > 0 ) then // INLINED!! + if ( (Crafting__triggerRecipe) == udg_RecipeHolyGrail and udg_HolyGrail != null or (Crafting__triggerCraftedCharges) > 0 ) then // INLINED!! //call SimError(GetOwningPlayer(GetTriggerCraftingUnit()), "There can be only 1 Holy Grail.") return false - elseif ( (Crafting___triggerRecipe) == udg_RecipeBootsOfTeleportation and GetUnitLegendaryItemsCount((Crafting___triggerCraftingUnit)) < 6 ) then // INLINED!! + elseif ( (Crafting__triggerRecipe) == udg_RecipeBootsOfTeleportation and GetUnitLegendaryItemsCount((Crafting__triggerCraftingUnit)) < 6 ) then // INLINED!! return false - elseif ( (Crafting___triggerRecipe) == udg_RecipePotionOfGreaterHealing and not PlayerHasProfession(GetOwningPlayer((Crafting___triggerCraftingUnit)) , udg_ProfessionHerbalist) ) then // INLINED!! + elseif ( (Crafting__triggerRecipe) == udg_RecipePotionOfGreaterHealing and not PlayerHasProfession(GetOwningPlayer((Crafting__triggerCraftingUnit)) , udg_ProfessionHerbalist) ) then // INLINED!! return false - elseif ( (Crafting___triggerRecipe) == udg_RecipePotionOfGreaterMana and not PlayerHasProfession(GetOwningPlayer((Crafting___triggerCraftingUnit)) , udg_ProfessionAlchemist) ) then // INLINED!! + elseif ( (Crafting__triggerRecipe) == udg_RecipePotionOfGreaterMana and not PlayerHasProfession(GetOwningPlayer((Crafting__triggerCraftingUnit)) , udg_ProfessionAlchemist) ) then // INLINED!! return false - elseif ( (Crafting___triggerRecipe) >= udg_RecipeCooking and not PlayerHasProfession(GetOwningPlayer((Crafting___triggerCraftingUnit)) , udg_ProfessionCook) ) then // INLINED!! + elseif ( (Crafting__triggerRecipe) >= udg_RecipeCooking and not PlayerHasProfession(GetOwningPlayer((Crafting__triggerCraftingUnit)) , udg_ProfessionCook) ) then // INLINED!! return false endif return true @@ -148814,7 +144969,7 @@ function Trig_Crafting_Stash_Link_Func002C takes nothing returns boolean endfunction function Trig_Crafting_Stash_Link_Actions takes nothing returns nothing - set udg_TmpBoolean=(IsUnitInGroup((GetSpellTargetUnit()), Crafting___itemCraftingUnits)) // INLINED!! + set udg_TmpBoolean=(IsUnitInGroup((GetSpellTargetUnit()), Crafting__itemCraftingUnits)) // INLINED!! if ( Trig_Crafting_Stash_Link_Func002C() ) then set udg_TmpBoolean=ItemCraftingUnitInventoriesAreLinked(GetTriggerUnit() , GetSpellTargetUnit()) if ( Trig_Crafting_Stash_Link_Func002Func002C() ) then @@ -155031,7 +151186,7 @@ endfunction // Trigger: Engineer Unlearn //=========================================================================== function Trig_Engineer_Unlearn_Actions takes nothing returns nothing - set udg_TmpUnit=(HeroUtils___unskilledHero) // INLINED!! + set udg_TmpUnit=(HeroUtils__unskilledHero) // INLINED!! call TinkerUpdateEngineeringUpgrade(udg_TmpUnit) endfunction @@ -155136,7 +151291,7 @@ function Trig_Malganis_Aura_of_Darkness_Unlearn_Func002C takes nothing returns b endfunction function Trig_Malganis_Aura_of_Darkness_Unlearn_Actions takes nothing returns nothing - set udg_TmpUnit=(HeroUtils___unskilledHero) // INLINED!! + set udg_TmpUnit=(HeroUtils__unskilledHero) // INLINED!! if ( Trig_Malganis_Aura_of_Darkness_Unlearn_Func002C() ) then call GroupRemoveUnitSimple(udg_TmpUnit, udg_MalganisTargets) set udg_TmpHandle=udg_TmpUnit @@ -167466,7 +163621,7 @@ endfunction function Trig_Evolution_Upgrade_Event_Actions takes nothing returns nothing set udg_TmpPlayer=GetOwningPlayer(GetTriggerUnit()) - call WoWReforgedEvolution__SetEvolutionLevel((udg_TmpPlayer) , 1) // INLINED!! + call WoWReforgedEvolution___SetEvolutionLevel((udg_TmpPlayer) , 1) // INLINED!! endfunction //=========================================================================== @@ -169673,7 +165828,7 @@ endfunction // Trigger: Chat Command Time //=========================================================================== function Trig_Chat_Command_Time_Actions takes nothing returns nothing - call h__DisplayTimedTextToPlayer((GetTriggerPlayer()), 0.0, 0.0, 6.0, ((I2S((WoWReforgedCalendar__years)) + "-" + I2SW((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar__days) , 2)) + "\nMonth: " + GetMonthName((WoWReforgedCalendar__days / DAYS_PER_MONTH + 1)) + "\nSeason: " + GetSeasonName((WoWReforgedCalendar__season)) + "\nTime of Day: " + (FormatTimeOfDayEx(GetTimeOfDay())) + "\nTotal passed time: " + FormatTimeString((udg_GameTime)) + "\nWeather Report: Rain/Snow/Storm in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar__weatherTimer))) + " and thunder/lightning in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar__thunderTimer))))) // INLINED!! + call h__DisplayTimedTextToPlayer((GetTriggerPlayer()), 0.0, 0.0, 6.0, ((I2S((WoWReforgedCalendar___years)) + "-" + I2SW((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1) , 2) + "-" + I2SW((WoWReforgedCalendar___days) , 2)) + "\nMonth: " + GetMonthName((WoWReforgedCalendar___days / DAYS_PER_MONTH + 1)) + "\nSeason: " + GetSeasonName((WoWReforgedCalendar___season)) + "\nTime of Day: " + (FormatTimeOfDayEx(GetTimeOfDay())) + "\nTotal passed time: " + FormatTimeString((udg_GameTime)) + "\nWeather Report: Rain/Snow/Storm in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar___weatherTimer))) + " and thunder/lightning in " + FormatTimeString(R2I(TimerGetRemaining(WoWReforgedCalendar___thunderTimer))))) // INLINED!! endfunction //=========================================================================== @@ -175250,7 +171405,7 @@ endfunction // Trigger: Chat Command Bag Info On //=========================================================================== function Trig_Chat_Command_Bag_Info_On_Actions takes nothing returns nothing - set WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId((GetTriggerPlayer() ))]=( true) // INLINED!! + set WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId((GetTriggerPlayer() ))]=( true) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_24958") endfunction @@ -175264,7 +171419,7 @@ endfunction // Trigger: Chat Command Bag Info Off //=========================================================================== function Trig_Chat_Command_Bag_Info_Off_Actions takes nothing returns nothing - set WoWReforgedBackpacks___BackpackPlayerBagInfo[GetPlayerId((GetTriggerPlayer() ))]=( false) // INLINED!! + set WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId((GetTriggerPlayer() ))]=( false) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_24959") endfunction @@ -175396,7 +171551,7 @@ function Trig_Chat_Command_Player_Color_Actions takes nothing returns nothing if ( Trig_Chat_Command_Player_Color_Func005Func003Func004C() ) then set udg_TmpPlayerColor=c call SetPlayerColorBJ(udg_TmpPlayer, udg_TmpPlayerColor, true) - set udg_TmpString=(StringCase(PlayerColorUtils___PlayerColorNames[GetPlayerId((GetTriggerPlayer()))], false)) // INLINED!! + set udg_TmpString=(StringCase(PlayerColorUtils__PlayerColorNames[GetPlayerId((GetTriggerPlayer()))], false)) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), ( udg_TmpString + ( " changed color of player " + ( udg_TmpString2 + "." ) ) )) else call SimError(GetTriggerPlayer() , "Invalid player color: " + udg_TmpString) @@ -175495,8 +171650,8 @@ function Trig_Chat_Command_Player_Name_Actions takes nothing returns nothing if ( Trig_Chat_Command_Player_Name_Func004Func003C() ) then set udg_TmpString=(StringTokenEx((GetEventPlayerChatString() ) , ( 2) , " " , false)) // INLINED!! call SetPlayerName(udg_TmpPlayer, udg_TmpString) - set udg_TmpString=(StringCase(PlayerColorUtils___PlayerColorNames[GetPlayerId((GetTriggerPlayer()))], false)) // INLINED!! - set udg_TmpString2=(StringCase(PlayerColorUtils___PlayerColorNames[GetPlayerId((udg_TmpPlayer))], false)) // INLINED!! + set udg_TmpString=(StringCase(PlayerColorUtils__PlayerColorNames[GetPlayerId((GetTriggerPlayer()))], false)) // INLINED!! + set udg_TmpString2=(StringCase(PlayerColorUtils__PlayerColorNames[GetPlayerId((udg_TmpPlayer))], false)) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), ( udg_TmpString + ( " changed name of player " + ( udg_TmpString2 + "." ) ) )) else call SimError(GetTriggerPlayer() , "Only possible at maximum hero level or for VIP or for Computer players.") @@ -175727,7 +171882,7 @@ function Trig_Chat_Command_Team_Color_Actions takes nothing returns nothing set udg_TmpPlayerColor=c set bj_wantDestroyGroup=true call ForGroupBJ(GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_Chat_Command_Team_Color_Func002Func006Func003A) - set udg_TmpString=(StringCase(PlayerColorUtils___PlayerColorNames[GetPlayerId((GetTriggerPlayer()))], false)) // INLINED!! + set udg_TmpString=(StringCase(PlayerColorUtils__PlayerColorNames[GetPlayerId((GetTriggerPlayer()))], false)) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), ( "Changed player color of select player units to: " + udg_TmpString )) else call SimError(GetTriggerPlayer() , "Invalid player color: " + udg_TmpString) @@ -176000,7 +172155,7 @@ endfunction // Trigger: Chat Command UI On //=========================================================================== function Trig_Chat_Command_UI_On_Actions takes nothing returns nothing - set PagedButtonsUI___enabledForPlayer[GetPlayerId((GetTriggerPlayer() ))]=( true) // INLINED!! + set PagedButtonsUI__enabledForPlayer[GetPlayerId((GetTriggerPlayer() ))]=( true) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_5872") endfunction @@ -176014,7 +172169,7 @@ endfunction // Trigger: Chat Command UI Off //=========================================================================== function Trig_Chat_Command_UI_Off_Actions takes nothing returns nothing - set PagedButtonsUI___enabledForPlayer[GetPlayerId((GetTriggerPlayer() ))]=( false) // INLINED!! + set PagedButtonsUI__enabledForPlayer[GetPlayerId((GetTriggerPlayer() ))]=( false) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_5873") endfunction @@ -176056,8 +172211,8 @@ endfunction // Trigger: Chat Command UI Queue Clear //=========================================================================== function Trig_Chat_Command_UI_Queue_Clear_Actions takes nothing returns nothing - if ( (Queue___playerQueue[GetPlayerId((GetTriggerPlayer()))]) != 0 ) then // INLINED!! - call ClearQueue((Queue___playerQueue[GetPlayerId((GetTriggerPlayer()))])) // INLINED!! + if ( (Queue__playerQueue[GetPlayerId((GetTriggerPlayer()))]) != 0 ) then // INLINED!! + call ClearQueue((Queue__playerQueue[GetPlayerId((GetTriggerPlayer()))])) // INLINED!! endif call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_6369") endfunction @@ -177629,7 +173784,7 @@ endfunction //=========================================================================== function Trig_Votes_Weather_Actions takes nothing returns nothing call h__DisplayTextToForce(GetPlayersAll(), "TRIGSTR_57498") - call TimerStart(WoWReforgedCalendar__weatherTimer, 0.0, false, function WoWReforgedCalendar__TimerFunctionStartWeather) // INLINED!! + call TimerStart(WoWReforgedCalendar___weatherTimer, 0.0, false, function WoWReforgedCalendar___TimerFunctionStartWeather) // INLINED!! endfunction //=========================================================================== @@ -180218,7 +176373,7 @@ function Trig_Cinematics_Intro_Cleanup_Actions takes nothing returns nothing call ResetUnitAnimation(gg_unit_N011_0053) call StartTimerBJ(udg_MainQuest1Timer, false, 3.00) call BlzFrameSetVisible(NewsUI___BackgroundFrame, (true)) // INLINED!! - call ForForce(GetPlayersAll(), function WoWReforgedCinematic__ForForceSelectHero) // INLINED!! + call ForForce(GetPlayersAll(), function WoWReforgedCinematic___ForForceSelectHero) // INLINED!! endfunction //=========================================================================== @@ -180805,17 +176960,17 @@ function Trig_Cinematics_Sea_Battle_Actions takes nothing returns nothing call EnableCinematic() call ForForce(GetPlayersAll(), function Trig_Cinematics_Sea_Battle_Func007A) call CreateNUnitsAtLoc(1, 'h059', Player(PLAYER_NEUTRAL_PASSIVE), GetRectCenter(gg_rct_Cinematic_Sea_Battle_Pirate_Ship_1), bj_UNIT_FACING) - call GroupAddUnit(WoWReforgedCinematic__actors, (GetLastCreatedUnit())) // INLINED!! + call GroupAddUnit(WoWReforgedCinematic___actors, (GetLastCreatedUnit())) // INLINED!! call CreateNUnitsAtLoc(1, 'h059', Player(PLAYER_NEUTRAL_PASSIVE), GetRectCenter(gg_rct_Cinematic_Sea_Battle_Pirate_Ship_2), bj_UNIT_FACING) - call GroupAddUnit(WoWReforgedCinematic__actors, (GetLastCreatedUnit())) // INLINED!! + call GroupAddUnit(WoWReforgedCinematic___actors, (GetLastCreatedUnit())) // INLINED!! call CreateNUnitsAtLoc(1, 'h059', Player(PLAYER_NEUTRAL_PASSIVE), GetRectCenter(gg_rct_Cinematic_Sea_Battle_Pirate_Ship_3), bj_UNIT_FACING) - call GroupAddUnit(WoWReforgedCinematic__actors, (GetLastCreatedUnit())) // INLINED!! + call GroupAddUnit(WoWReforgedCinematic___actors, (GetLastCreatedUnit())) // INLINED!! call CreateNUnitsAtLoc(1, 'h05N', Player(PLAYER_NEUTRAL_PASSIVE), GetRectCenter(gg_rct_Cinematic_Sea_Battle_Kul_Tiras_Ship_1), bj_UNIT_FACING) - call GroupAddUnit(WoWReforgedCinematic__actors, (GetLastCreatedUnit())) // INLINED!! + call GroupAddUnit(WoWReforgedCinematic___actors, (GetLastCreatedUnit())) // INLINED!! call CreateNUnitsAtLoc(1, 'h05N', Player(PLAYER_NEUTRAL_PASSIVE), GetRectCenter(gg_rct_Cinematic_Sea_Battle_Kul_Tiras_Ship_2), bj_UNIT_FACING) - call GroupAddUnit(WoWReforgedCinematic__actors, (GetLastCreatedUnit())) // INLINED!! + call GroupAddUnit(WoWReforgedCinematic___actors, (GetLastCreatedUnit())) // INLINED!! call CreateNUnitsAtLoc(1, 'h05N', Player(PLAYER_NEUTRAL_PASSIVE), GetRectCenter(gg_rct_Cinematic_Sea_Battle_Kul_Tiras_Ship_3), bj_UNIT_FACING) - call GroupAddUnit(WoWReforgedCinematic__actors, (GetLastCreatedUnit())) // INLINED!! + call GroupAddUnit(WoWReforgedCinematic___actors, (GetLastCreatedUnit())) // INLINED!! call PolledWait(1.00) call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 2, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0) call PolledWait(1.50) @@ -181040,8 +177195,8 @@ endfunction //=========================================================================== function Trig_Map_Zones_Init_Actions takes nothing returns nothing // ########################### - set WoWReforgedZones__currentWorld=0 // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentWorld=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### set udg_TmpString="Player Selection" set udg_TmpRect=gg_rct_Player_Selection @@ -181051,7 +177206,7 @@ function Trig_Map_Zones_Init_Actions takes nothing returns nothing set udg_TmpString3="playerselection" set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="VIP Room" set udg_TmpRect=gg_rct_VIP_Room @@ -181080,7 +177235,7 @@ function Trig_Map_Zones_Init_Azeroth_Actions takes nothing returns nothing set udg_TmpString2="The world in which the majority of the Warcraft series is set." set udg_TmpString3="azeroth" call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### endfunction @@ -181121,7 +177276,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="freelancersteam1" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Freelancers Team 2" set udg_TmpRect=gg_rct_AI_Freelancer_Top_Right_No_Build_Area @@ -181131,7 +177286,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="freelancersteam2" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Freelancers Team 3" set udg_TmpRect=gg_rct_AI_Freelancer_Bottom_Left_No_Build_Area @@ -181141,7 +177296,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="freelancersteam3" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Freelancers Team 4" set udg_TmpRect=gg_rct_AI_Freelancer_Bottom_Right_No_Build_Area @@ -181151,7 +177306,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="freelancersteam4" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Demigod Temple" set udg_TmpRect=gg_rct_Sunken_Ruins_4 @@ -181179,7 +177334,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="dalaran" set udg_TmpDestructibleType='YTct' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Nazjatar" set udg_TmpRect=gg_rct_Zone_Nazjatar @@ -181190,10 +177345,10 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Nazjatar_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Nazjatar_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Tomb of Sargeras" set udg_TmpRect=gg_rct_Zone_Tomb_of_Sargeras @@ -181204,9 +177359,9 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Weather_Tomb_of_Sargeras - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Tomb_of_Sargeras_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! // ########################### set udg_TmpString="Prison of Sargeras" set udg_TmpRect=gg_rct_Boss_Guldan_Dungeon_Area_4 @@ -181217,9 +177372,9 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='DTsh' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Boss_Guldan_Dungeon_Area_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Boss_Guldan_Dungeon_Area_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! // ########################### set udg_TmpString="Echo Isles" set udg_TmpRect=gg_rct_Zone_Echo_Isles_1 @@ -181229,7 +177384,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="echoisles" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Azuremyst Isles" set udg_TmpRect=gg_rct_Zone_Azuremyst_Isles @@ -181239,7 +177394,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="azuremystisles" set udg_TmpDestructibleType='B00M' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Kezan" set udg_TmpRect=gg_rct_Zone_Kezan @@ -181250,8 +177405,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Kezan_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Elven Clan Island" set udg_TmpRect=gg_rct_Clan_Island_The_Elven_Clan @@ -181261,7 +177416,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="clanisland" set udg_TmpDestructibleType='FTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Murloc Sorcerer Island" set udg_TmpRect=gg_rct_Zone_Murloc_Sorceror_Island @@ -181271,7 +177426,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="murlocsorcererisland" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Spider Crab Behemoth Island" set udg_TmpRect=gg_rct_Zone_Spider_Crab_Behemoth @@ -181281,7 +177436,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="spidercrabbehemothisland" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Tortolla Island" set udg_TmpRect=gg_rct_Zone_Tortolla_Island @@ -181291,7 +177446,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="tortollaisland" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Water Base" set udg_TmpRect=gg_rct_Zone_Water_Base @@ -181301,7 +177456,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="waterbase" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="Sylvana's Castle" set udg_TmpRect=gg_rct_Zone_Sylvanas_Castle @@ -181311,7 +177466,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="sylvanascastle" set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Elune's Realm" set udg_TmpRect=gg_rct_Zone_Elunes_Realm @@ -181321,7 +177476,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="elunesrealm" set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Hidden Sunken Island" set udg_TmpRect=gg_rct_Hidden_Island_Sunken_West @@ -181331,7 +177486,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="hiddensunkenisland" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Hidden Island" set udg_TmpRect=gg_rct_Hidden_Island @@ -181341,7 +177496,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="hiddenisland" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! // ########################### set udg_TmpString="Dungeon" set udg_TmpRect=gg_rct_Zone_Dungeon @@ -181351,7 +177506,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="dungeon" set udg_TmpDestructibleType='DTsh' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! // ########################### set udg_TmpString="Underground" set udg_TmpRect=gg_rct_Zone_Underground @@ -181362,7 +177517,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="underground" set udg_TmpDestructibleType='GTsh' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! // ########################### endfunction @@ -181385,7 +177540,7 @@ function Trig_Map_Zones_Init_Sea_Actions takes nothing returns nothing set udg_TmpString3="maelstrom" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="North Sea" set udg_TmpRect=gg_rct_Zone_The_North_Sea_1 @@ -181395,7 +177550,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="northsea" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="Frozen Sea" set udg_TmpRect=gg_rct_Zone_The_Frozen_Sea @@ -181405,7 +177560,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="frozensea" set udg_TmpDestructibleType='B005' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="Veiled Sea" set udg_TmpRect=gg_rct_Zone_The_Veiled_Sea @@ -181415,7 +177570,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="veiledsea" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="Forbidding Sea" set udg_TmpRect=gg_rct_Zone_The_Forbidding_Sea @@ -181425,7 +177580,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="forbiddingsea" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="South Sea" set udg_TmpRect=gg_rct_Zone_South_Sea @@ -181435,7 +177590,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="southsea" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="Great Sea" set udg_TmpRect=gg_rct_Zone_Great_Sea_1 @@ -181445,7 +177600,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="greatsea" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### endfunction @@ -181484,8 +177639,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_New_Stormwind_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Kul Tiras" set udg_TmpRect=gg_rct_Zone_Kul_Tiras @@ -181495,9 +177650,9 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="kultiras" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SUNKEN_RUINS // INLINED!! set udg_TmpRect=gg_rct_Zone_Kul_Tiras_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! // ########################### set udg_TmpString="Elwynn Forest" set udg_TmpRect=gg_rct_Zone_Elwynn_Forest_1 @@ -181508,16 +177663,16 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Elwynn_Forest_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Elwynn_Forest_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Elwynn_Forest_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Elwynn_Forest_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Elwynn_Forest_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Redridge Mountains" set udg_TmpRect=gg_rct_Zone_Redridge_Mountains @@ -181527,7 +177682,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="redridgemountains" set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Dark Portal" set udg_TmpRect=gg_rct_Zone_Dark_Portal @@ -181537,7 +177692,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="darkportal" set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Dun Morogh" set udg_TmpRect=gg_rct_Zone_Dun_Morogh_1 @@ -181548,8 +177703,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Dun_Morogh_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Ironforge" set udg_TmpRect=gg_rct_Zone_Khaz_Modan_1 @@ -181560,16 +177715,16 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='GTsh' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Khaz_Modan_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Khaz_Modan_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Khaz_Modan_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Khaz_Modan_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Khaz_Modan_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! // ########################### set udg_TmpString="Badlands" set udg_TmpRect=gg_rct_Zone_Badlands_1 @@ -181580,10 +177735,10 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='FTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Badlands_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Badlands_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Dalaran Ruins" set udg_TmpRect=gg_rct_Zone_Dalaran_Ruins @@ -181594,8 +177749,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='JTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Dalaran_Ruins_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Dalaran Dungeons" set udg_TmpRect=gg_rct_Zone_Dalaran_Dungeons @@ -181606,10 +177761,10 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='JTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Dalaran_Dungeons_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Dalaran_Dungeons_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! // ########################### set udg_TmpString="Alterac Mountains" set udg_TmpRect=gg_rct_Zone_Alterac_Mountains @@ -181619,11 +177774,11 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="alteracmountains" set udg_TmpDestructibleType='CTtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! set udg_TmpRect=gg_rct_Zone_Alterac_Mountains_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Alterac_Mountains_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! // ########################### set udg_TmpString="Hinterlands" set udg_TmpRect=gg_rct_Zone_Hinterlands_1 @@ -181633,17 +177788,17 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="hinterlands" set udg_TmpDestructibleType='FTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! set udg_TmpRect=gg_rct_Zone_Hinterlands_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Hinterlands_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Hinterlands_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Hinterlands_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Hinterlands_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! // ########################### set udg_TmpString="Sunstrider Isle" set udg_TmpRect=gg_rct_Zone_Sunstrider_Isle @@ -181653,19 +177808,19 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="sunstriderisle" set udg_TmpDestructibleType='FTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! set udg_TmpRect=gg_rct_Zone_Sunstrider_Isle_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Sunstrider_Isle_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Sunstrider_Isle_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Sunstrider_Isle_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Sunstrider_Isle_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Sunstrider_Isle_7 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! // ########################### set udg_TmpString="Sunwell Grove" set udg_TmpRect=gg_rct_Zone_Sunwell_Grove @@ -181675,7 +177830,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="sunwellgrove" set udg_TmpDestructibleType='FTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Ghostlands" set udg_TmpRect=gg_rct_Zone_Ghostlands_1 @@ -181686,8 +177841,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='CTtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Ghostlands_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Eversong Woods" set udg_TmpRect=gg_rct_Zone_Eversong_Woods_1 @@ -181697,7 +177852,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="eversongwoods" set udg_TmpDestructibleType='LTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Trisfal Glades" set udg_TmpRect=gg_rct_Zone_Tirisfal_Glades @@ -181707,10 +177862,10 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="trisfalglades" set udg_TmpDestructibleType='CTtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! set udg_TmpRect=gg_rct_Zone_Tirisfal_Glades_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Silverpine Forest" set udg_TmpRect=gg_rct_Zone_Silverpine_Forest @@ -181720,14 +177875,14 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="silverpineforest" set udg_TmpDestructibleType='FTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! set udg_TmpRect=gg_rct_Zone_Silverpine_Forest_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Silverpine_Forest_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Silverpine_Forest_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Tol Barad" set udg_TmpRect=gg_rct_Zone_Tol_Barad @@ -181737,7 +177892,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="tolbarad" set udg_TmpDestructibleType='FTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Dalaran Ruins" set udg_TmpRect=gg_rct_Zone_Dalaran_Ruins @@ -181747,7 +177902,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="dalaranruins" set udg_TmpDestructibleType='YTct' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Village" set udg_TmpRect=gg_rct_Zone_Village @@ -181757,7 +177912,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="village" set udg_TmpDestructibleType='VTlt' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### endfunction @@ -181786,7 +177941,7 @@ call AddZoneContinentEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpSt set udg_TmpString3="cenariusgrave" set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Teldrassil" set udg_TmpRect=gg_rct_Zone_Teldrassil @@ -181797,16 +177952,16 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Teldrassil_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Teldrassil_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Teldrassil_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Teldrassil_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Teldrassil_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Moonglade" set udg_TmpRect=gg_rct_Zone_Moonglade_1 @@ -181817,8 +177972,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Moonglade_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Winterspring" set udg_TmpRect=gg_rct_Zone_Winterspring_1 @@ -181829,12 +177984,12 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Winterspring_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Winterspring_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Winterspring_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Hyjal" set udg_TmpRect=gg_rct_Zone_Hyjal_1 @@ -181845,8 +178000,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Hyjal_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Darkshore" set udg_TmpRect=gg_rct_Zone_Darkshore @@ -181856,7 +178011,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="darkshore" set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Ashenvale Forest" set udg_TmpRect=gg_rct_Zone_Ashenvale_Forest_1 @@ -181867,16 +178022,16 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Ashenvale_Forest_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Ashenvale_Forest_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Ashenvale_Forest_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Ashenvale_Forest_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Ashenvale_Forest_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Felwood" set udg_TmpRect=gg_rct_Zone_Felwood @@ -181886,7 +178041,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="felwood" set udg_TmpDestructibleType='CTtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Jadefire" set udg_TmpRect=gg_rct_Zone_Jadefire @@ -181896,7 +178051,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="jadefire" set udg_TmpDestructibleType='CTtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Azshara" set udg_TmpRect=gg_rct_Zone_Azshara_1 @@ -181907,10 +178062,10 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Azshara_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Azshara_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### set udg_TmpString="Durotar" set udg_TmpRect=gg_rct_Zone_Durotar_1 @@ -181921,8 +178076,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='BTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Durator_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### set udg_TmpString="Echo Isles" set udg_TmpRect=gg_rct_Zone_Echo_Isles_1 @@ -181932,7 +178087,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="echoisles" set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="Broken Isles" set udg_TmpRect=gg_rct_Zone_Broken_Isles_1 @@ -181943,8 +178098,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Broken_Isles_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_SEA // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_SEA // INLINED!! // ########################### set udg_TmpString="The Barrens" set udg_TmpRect=gg_rct_Zone_The_Barrens_1 @@ -181955,12 +178110,12 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='BTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_The_Barrens_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_The_Barrens_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_The_Barrens_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### set udg_TmpString="Dustwallow Marsh" set udg_TmpRect=gg_rct_Zone_Dustwallow_Marsh_1 @@ -181970,7 +178125,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="dustwallowmarsh" set udg_TmpDestructibleType='BTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### set udg_TmpString="Mulgore" set udg_TmpRect=gg_rct_Zone_Mulgore_1 @@ -181981,8 +178136,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='BTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Mulgore_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### set udg_TmpString="Stonetalon Mountains" set udg_TmpRect=gg_rct_Zone_Stonetalon_Mountains @@ -181992,7 +178147,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="stonetalonmountains" set udg_TmpDestructibleType='BTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### set udg_TmpString="Stonetalon Peak Caverns" set udg_TmpRect=gg_rct_Zone_Caverns_Of_Stonetalon_Peak @@ -182002,7 +178157,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="stonetalonpeakcaverns" set udg_TmpDestructibleType='DTsh' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! // ########################### set udg_TmpString="Thousand Needles" set udg_TmpRect=gg_rct_Zone_Thousand_Needles_1 @@ -182013,12 +178168,12 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='BTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Thousand_Needles_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Thousand_Needles_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Thousand_Needles_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### set udg_TmpString="Tanaris" set udg_TmpRect=gg_rct_Zone_Tanaris @@ -182029,8 +178184,8 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Tanaris_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### set udg_TmpString="Uldum" set udg_TmpRect=gg_rct_Zone_Uldum_1 @@ -182041,14 +178196,14 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ZTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Uldum_1 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Uldum_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Uldum_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Uldum_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_BARRENS // INLINED!! // ########################### endfunction @@ -182077,7 +178232,7 @@ call AddZoneContinentEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpSt set udg_TmpString3="zuldrak" set udg_TmpDestructibleType='NTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### set udg_TmpString="Azjol-Nerub" set udg_TmpRect=gg_rct_Weather_Neruben_Dungeon @@ -182087,7 +178242,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="azjolnerub" set udg_TmpDestructibleType='NTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_DUNGEON // INLINED!! // ########################### set udg_TmpString="The Storm Peak" set udg_TmpRect=gg_rct_Zone_The_Storm_Peaks @@ -182097,7 +178252,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="azjolnerub" set udg_TmpDestructibleType='NTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### set udg_TmpString="Icecrown" set udg_TmpRect=gg_rct_Zone_Icecrown_1 @@ -182108,20 +178263,20 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ITtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Icecrown_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Icecrown_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Icecrown_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Icecrown_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Icecrown_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Icecrown_7 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Icecrown_8 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### set udg_TmpString="Sholazar Basin" set udg_TmpRect=gg_rct_Zone_Sholazar_Basin_1 @@ -182131,7 +178286,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="sholazarbasin" set udg_TmpDestructibleType='ITtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### set udg_TmpString="Borean Tundra" set udg_TmpRect=gg_rct_Zone_Borean_Tundra @@ -182141,7 +178296,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="boreantundra" set udg_TmpDestructibleType='ITtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### set udg_TmpString="Wintergrasp" set udg_TmpRect=gg_rct_Zone_Wintergrasp_1 @@ -182152,18 +178307,18 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='ITtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Wintergrasp_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Wintergrasp_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Wintergrasp_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Wintergrasp_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Wintergrasp_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Wintergrasp_7 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### set udg_TmpString="Dragonblight" set udg_TmpRect=gg_rct_Zone_Dragonblight @@ -182174,12 +178329,12 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpDestructibleType='WTst' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Dragonblight_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Dragonblight_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Dragonblight_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### set udg_TmpString="Grizzly Hills" set udg_TmpRect=gg_rct_Zone_Grizzly_Hills @@ -182189,7 +178344,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="grizzlyhills" set udg_TmpDestructibleType='NTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_NORTHREND // INLINED!! // ########################### endfunction @@ -182219,8 +178374,8 @@ call AddZoneContinentEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpSt set udg_TmpDestructibleType='B009' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Pandaria_The_Jade_Forest_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Townlong Steppes" set udg_TmpRect=gg_rct_Zone_Pandaria_Townlong_Steppes @@ -182230,7 +178385,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="townlongsteppes" set udg_TmpDestructibleType='B009' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Dread Wastes" set udg_TmpRect=gg_rct_Zone_Pandaria_Dread_Wastes @@ -182240,7 +178395,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="dreadwastes" set udg_TmpDestructibleType='B009' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Kun-Lai Summit" set udg_TmpRect=gg_rct_Zone_Pandaria_Kunlai_Summit @@ -182250,7 +178405,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="kunlaisummit" set udg_TmpDestructibleType='B009' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Vale of Eternal Blossoms" set udg_TmpRect=gg_rct_Zone_Pandaria_Vale_of_Eternal_Blossoms @@ -182260,7 +178415,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="valeofeternalblossoms" set udg_TmpDestructibleType='B009' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Valley of the Four Winds" set udg_TmpRect=gg_rct_Zone_Pandaria_Valley_of_the_Four_Winds @@ -182270,7 +178425,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="valleyofthefourwinds" set udg_TmpDestructibleType='B009' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### set udg_TmpString="Krasarang Wilds" set udg_TmpRect=gg_rct_Zone_Pandaria_Krasarang_Wilds @@ -182280,7 +178435,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="krasarangwilds" set udg_TmpDestructibleType='B009' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_LORDAERON // INLINED!! // ########################### endfunction @@ -182306,7 +178461,7 @@ function Trig_Map_Zones_Init_Outland_Actions takes nothing returns nothing set udg_TmpString2="The shattered floating remnants of the destroyed world of Draenor, the homeworld of the Orcs and Ogres and refuge of the Draenei." set udg_TmpString3="outland" call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### set udg_TmpString="Archimonde's Realm" set udg_TmpRect=gg_rct_Zone_Archimondes_Realm_1 @@ -182317,18 +178472,18 @@ call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! set udg_TmpRect=gg_rct_Zone_Archimondes_Realm_2 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Archimondes_Realm_3 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Archimondes_Realm_4 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Archimondes_Realm_5 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Archimondes_Realm_6 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! set udg_TmpRect=gg_rct_Zone_Archimondes_Realm_7 - call WoWReforgedZones__AddZoneRectEx(WoWReforgedZones__currentZone , udg_TmpRect) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + call WoWReforgedZones___AddZoneRectEx(WoWReforgedZones___currentZone , udg_TmpRect) // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Outland Portals" set udg_TmpRect=gg_rct_Portal_Area_Outland @@ -182338,7 +178493,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="outlandportals" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="The New Citadel" set udg_TmpRect=gg_rct_Zone_The_New_Citadel @@ -182348,7 +178503,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="thenewcitadel" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Black Citadel" set udg_TmpRect=gg_rct_Zone_Black_Citadel @@ -182358,7 +178513,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="theblackcitadel" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Illidan's Camp" set udg_TmpRect=gg_rct_Zone_Black_Citadel @@ -182368,7 +178523,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="illidanscamp" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Draenei Camp" set udg_TmpRect=gg_rct_Zone_Draenei_Camp @@ -182378,7 +178533,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="draeneicamp" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Demon Gate" set udg_TmpRect=gg_rct_Zone_Demon_Gate @@ -182388,7 +178543,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="demongate" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Fel Orc Camp" set udg_TmpRect=gg_rct_Zone_Fel_Orc_Camp @@ -182398,7 +178553,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="felorccamp" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Gruul's Lair" set udg_TmpRect=gg_rct_Zone_Gruuls_Lair @@ -182408,7 +178563,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="gruulslair" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### set udg_TmpString="Blade's Edge Mountains" set udg_TmpRect=gg_rct_Zone_Blades_Edge_Mountains @@ -182418,7 +178573,7 @@ call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_ set udg_TmpString3="bladesedgemountains" set udg_TmpDestructibleType='OTtw' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_OUTLAND // INLINED!! // ########################### endfunction @@ -182438,7 +178593,7 @@ function Trig_Map_Zones_Init_Argus_Actions takes nothing returns nothing set udg_TmpString2="The original homeworld of the Eredar, now located within the Twisting Nether." set udg_TmpString3="argus" call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### set udg_TmpString="Eredath" set udg_TmpRect=gg_rct_Zone_Eredath @@ -182485,7 +178640,7 @@ function Trig_Map_Zones_Init_Emerald_Dream_Actions takes nothing returns nothing set udg_TmpString2="A vast, ever-changing spirit world that exists outside the boundaries of the physical world." set udg_TmpString3="emeralddream" call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### set udg_TmpString="Emerald Dream" set udg_TmpRect=gg_rct_Zone_Emerald_Dream @@ -182495,7 +178650,7 @@ call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString set udg_TmpString3="emeralddreamzone" set udg_TmpDestructibleType='ATtr' call AddZoneEx(udg_TmpString , udg_TmpRect , udg_TmpIcon , udg_TmpString2 , udg_TmpPlayerColor , udg_TmpString3 , udg_TmpDestructibleType) // INLINED!! - set s__Zone_terrainType[WoWReforgedZones__currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! + set s__Zone_terrainType[WoWReforgedZones___currentZone]=TERRAIN_TYPE_ASHENVALE // INLINED!! // ########################### endfunction @@ -182515,7 +178670,7 @@ function Trig_Map_Zones_Init_Elemental_Plane_Actions takes nothing returns nothi set udg_TmpString2="A pocket dimension created by the Keepers to imprison Azeroth's elementals." set udg_TmpString3="elementalplane" call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### set udg_TmpString="Skywall" set udg_TmpRect=gg_rct_Zone_Skywall @@ -182571,7 +178726,7 @@ function Trig_Map_Zones_Init_Shadowlands_Actions takes nothing returns nothing set udg_TmpString2="The realm of Death, an infinite plane where the souls of deceased mortals go to be reborn, serve, find peace, do battle, or endure endless torment." set udg_TmpString3="shadowlands" call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### set udg_TmpString="Maldraxxus" set udg_TmpRect=gg_rct_Zone_Maldraxxus @@ -182648,7 +178803,7 @@ function Trig_Map_Zones_Init_Nyalotha_Actions takes nothing returns nothing set udg_TmpString2="An alternate reality inhabited by the Old Gods and their minions." set udg_TmpString3="nyalotha" call AddZoneWorldEx(udg_TmpString , udg_TmpIcon , udg_TmpString2 , udg_TmpString3) // INLINED!! - set WoWReforgedZones__currentContinent=0 // INLINED!! + set WoWReforgedZones___currentContinent=0 // INLINED!! // ########################### set udg_TmpString="Ny'alotha" set udg_TmpRect=gg_rct_Zone_Ny_alotha @@ -184880,7 +181035,7 @@ function Trig_Boss_Init_Recipe_Boots_of_Teleportation_Actions takes nothing retu set udg_TmpInteger=udg_RecipeBootsOfTeleportation call AddRequirementsLegendaryItems() set udg_TmpInteger2=6 - set Crafting___recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! + set Crafting__recipesMinRequirements[(udg_TmpInteger )]=( udg_TmpInteger2) // INLINED!! endfunction //=========================================================================== @@ -189945,7 +186100,7 @@ function Trig_Player_Selection_Start_Game_Func006Func018Func006Func008Func002C t endfunction function Trig_Player_Selection_Start_Game_Func006Func018Func006Func008A takes nothing returns nothing - set udg_TmpBoolean=not (WoWReforgedProperties__GetPropertyIndexByUnitTypeId((GetUnitTypeId((GetEnumUnit())))) != - 1) // INLINED!! + set udg_TmpBoolean=not (WoWReforgedProperties___GetPropertyIndexByUnitTypeId((GetUnitTypeId((GetEnumUnit())))) != - 1) // INLINED!! if ( Trig_Player_Selection_Start_Game_Func006Func018Func006Func008Func002C() ) then if ( Trig_Player_Selection_Start_Game_Func006Func018Func006Func008Func002Func005C() ) then set udg_TmpBoolean=false @@ -191837,7 +187992,7 @@ function Trig_Player_Selection_Start_Location_Selection_Actions takes nothing re if ( Trig_Player_Selection_Start_Location_Selection_Func002C() ) then set udg_TmpPlayer=GetOwningPlayer(GetBuyingUnit()) set udg_TmpBoolean=(IsPlayerInForce((udg_TmpPlayer), prestoredElvenClanMembers)) // INLINED!! - set udg_TmpBoolean2=(WoWReforgedStartLocations__startLocationsIsClanArea[(udg_TmpInteger)]) // INLINED!! + set udg_TmpBoolean2=(WoWReforgedStartLocations___startLocationsIsClanArea[(udg_TmpInteger)]) // INLINED!! if ( Trig_Player_Selection_Start_Location_Selection_Func002Func006C() ) then set udg_PlayerSelectionStartLocation[GetConvertedPlayerId(udg_TmpPlayer)]=udg_TmpInteger call h__DisplayTextToForce(GetForceOfPlayer(udg_TmpPlayer), ( "Picked start location: " + GetItemName(GetSoldItem()) )) @@ -207215,8 +203370,8 @@ function Trig_GoblinQuest_4b_Func003C takes nothing returns boolean endfunction function Trig_GoblinQuest_4b_Actions takes nothing returns nothing - set udg_TmpUnit=(WoWReforgedAlchemistLab__triggerConverter) // INLINED!! - set udg_TmpUnit2=(WoWReforgedAlchemistLab__triggerReplacingUnit) // INLINED!! + set udg_TmpUnit=(WoWReforgedAlchemistLab___triggerConverter) // INLINED!! + set udg_TmpUnit2=(WoWReforgedAlchemistLab___triggerReplacingUnit) // INLINED!! if ( Trig_GoblinQuest_4b_Func003C() ) then call DisableTrigger(GetTriggeringTrigger()) call FlashQuestDialogButtonBJ() @@ -208746,7 +204901,7 @@ function Trig_Cheat_Max_Respawn_Groups_Conditions takes nothing returns boolean endfunction function Trig_Cheat_Max_Respawn_Groups_Actions takes nothing returns nothing - set udg_TmpInteger=(UnitGroupRespawnSystem___respawnUnitGroupCounter) // INLINED!! + set udg_TmpInteger=(UnitGroupRespawnSystem__respawnUnitGroupCounter) // INLINED!! call h__DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()), ( "Number of creep respawn groups: " + I2S(udg_TmpInteger) )) endfunction @@ -213361,161 +209516,160 @@ function main takes nothing returns nothing call CreateAllUnits() call InitBlizzard() -call ExecuteFunc("jasshelper__initstructs260435406") +call ExecuteFunc("jasshelper__initstructs263991484") call ExecuteFunc("BoundSentinel___init") -call ExecuteFunc("Corpse___Init") +call ExecuteFunc("Corpse__Init") call ExecuteFunc("CustomRaceSoundSystem__Init") -call ExecuteFunc("ForceUtils___Init") +call ExecuteFunc("ForceUtils__Init") call ExecuteFunc("FrameLoader___init_function") call ExecuteFunc("FrameSaver___Init") call ExecuteFunc("GroupUtils___Init") -call ExecuteFunc("HeroUtils___Init") -call ExecuteFunc("HostUtils___Init") +call ExecuteFunc("HeroUtils__Init") +call ExecuteFunc("HostUtils__Init") call ExecuteFunc("IdleWorkersSystem__Init") -call ExecuteFunc("ItemUtils___Init") +call ExecuteFunc("ItemUtils__Init") call ExecuteFunc("MaxItemStacks__Init") call ExecuteFunc("OnStartGame___Init") -call ExecuteFunc("QueueUIConfig___Init") +call ExecuteFunc("QueueUIConfig__Init") call ExecuteFunc("Reflection___Init") call ExecuteFunc("SimError___init") call ExecuteFunc("TerrainPathability___Init") call ExecuteFunc("TimerUtils__init") call ExecuteFunc("TreeUtils___Init") -call ExecuteFunc("UnitTypeUtils___Init") +call ExecuteFunc("UnitTypeUtils__Init") call ExecuteFunc("WallsSystem___Init") call ExecuteFunc("WallsSystemAir___Init") -call ExecuteFunc("WoWReforgedBarrage__Init") -call ExecuteFunc("WoWReforgedCages__Init") -call ExecuteFunc("WoWReforgedCarHorn__Init") -call ExecuteFunc("WoWReforgedDependencyEquivalents___Init") -call ExecuteFunc("WoWReforgedElevator__Init") -call ExecuteFunc("WoWReforgedFarmer__Init") -call ExecuteFunc("WoWReforgedFelOrcDemonGate__Init") -call ExecuteFunc("WoWReforgedGaia__Init") -call ExecuteFunc("WoWReforgedHunter__Init") -call ExecuteFunc("WoWReforgedObjectMappings___Init") -call ExecuteFunc("WoWReforgedRandomArtifacts__Init") -call ExecuteFunc("WoWReforgedUnlimitedBagOfFood__Init") +call ExecuteFunc("WoWReforgedBarrage___Init") +call ExecuteFunc("WoWReforgedCages___Init") +call ExecuteFunc("WoWReforgedCarHorn___Init") +call ExecuteFunc("WoWReforgedDependencyEquivalents__Init") +call ExecuteFunc("WoWReforgedElevator___Init") +call ExecuteFunc("WoWReforgedFarmer___Init") +call ExecuteFunc("WoWReforgedFelOrcDemonGate___Init") +call ExecuteFunc("WoWReforgedGaia___Init") +call ExecuteFunc("WoWReforgedHunter___Init") +call ExecuteFunc("WoWReforgedObjectMappings__Init") +call ExecuteFunc("WoWReforgedRandomArtifacts___Init") +call ExecuteFunc("WoWReforgedUnlimitedBagOfFood___Init") call ExecuteFunc("WoWReforgedUrlUi___Init") -call ExecuteFunc("Challenge___Init") -call ExecuteFunc("Decay___Init") -call ExecuteFunc("ForestWord___Init") -call ExecuteFunc("HeroReviveEvents___Init") +call ExecuteFunc("Challenge__Init") +call ExecuteFunc("Decay__Init") +call ExecuteFunc("ForestWord__Init") +call ExecuteFunc("HeroReviveEvents__Init") call ExecuteFunc("ItemUnstackSystem__Init") -call ExecuteFunc("MassSpell___Init") -call ExecuteFunc("MindControl___Init") +call ExecuteFunc("MassSpell__Init") +call ExecuteFunc("MindControl__Init") call ExecuteFunc("NewsUI___Init") -call ExecuteFunc("PagedButtonsConfig___Init") -call ExecuteFunc("PlayerColorUtils___Init") +call ExecuteFunc("PagedButtonsConfig__Init") +call ExecuteFunc("PlayerColorUtils__Init") call ExecuteFunc("Resources___Init") call ExecuteFunc("TinyBuildingsLimits___Init") -call ExecuteFunc("WoWReforgedAccount__Init") -call ExecuteFunc("WoWReforgedBan__Init") -call ExecuteFunc("WoWReforgedCombiner___Init") -call ExecuteFunc("WoWReforgedFel__Init") -call ExecuteFunc("WoWReforgedLearnableSkills___Init") -call ExecuteFunc("WoWReforgedLevers__Init") -call ExecuteFunc("WoWReforgedTreeUtils___Init") -call ExecuteFunc("DiplomacyUI___Init") -call ExecuteFunc("DrainResources___Init") +call ExecuteFunc("WoWReforgedAccount___Init") +call ExecuteFunc("WoWReforgedBan___Init") +call ExecuteFunc("WoWReforgedCombiner__Init") +call ExecuteFunc("WoWReforgedFel___Init") +call ExecuteFunc("WoWReforgedLearnableSkills__Init") +call ExecuteFunc("WoWReforgedLevers___Init") +call ExecuteFunc("WoWReforgedTreeUtils__Init") +call ExecuteFunc("DiplomacyUI__Init") +call ExecuteFunc("DrainResources__Init") call ExecuteFunc("Log___Init") -call ExecuteFunc("PagedButtons___Init") -call ExecuteFunc("Push___onInit") -call ExecuteFunc("Queue___Init") +call ExecuteFunc("PagedButtons__Init") +call ExecuteFunc("Push__onInit") +call ExecuteFunc("Queue__Init") call ExecuteFunc("ResourcesChatCommands___Init") call ExecuteFunc("ResourcesCosts___Init") call ExecuteFunc("ResourcesMultiboardGui___Init") call ExecuteFunc("ResourcesWarnings___Init") -call ExecuteFunc("Taunts___Init") -call ExecuteFunc("UnitGroupRespawnSystem___Init") +call ExecuteFunc("Taunts__Init") +call ExecuteFunc("UnitGroupRespawnSystem__Init") call ExecuteFunc("VoteSystem__Init") -call ExecuteFunc("WoWReforgedDayNightCycleEffects__Init") -call ExecuteFunc("WoWReforgedHeroSkills___Init") -call ExecuteFunc("WoWReforgedHousing__Init") -call ExecuteFunc("WoWReforgedPagedButtonsConfig___Init") -call ExecuteFunc("WoWReforgedProspector__Init") -call ExecuteFunc("Crafting___Init") +call ExecuteFunc("WoWReforgedDayNightCycleEffects___Init") +call ExecuteFunc("WoWReforgedHeroSkills__Init") +call ExecuteFunc("WoWReforgedHousing___Init") +call ExecuteFunc("WoWReforgedPagedButtonsConfig__Init") +call ExecuteFunc("WoWReforgedProspector___Init") +call ExecuteFunc("Crafting__Init") call ExecuteFunc("KeyMovementSystem__Init") call ExecuteFunc("LogUI___Init") -call ExecuteFunc("PagedButtonsUI___Init") -call ExecuteFunc("QueueUI___Init") +call ExecuteFunc("PagedButtonsUI__Init") +call ExecuteFunc("QueueUI__Init") call ExecuteFunc("ResourcesGui___Init") call ExecuteFunc("ResourcesLoadedMines___Init") -call ExecuteFunc("Tunnel___Init") -call ExecuteFunc("WoWReforgedCrates___Init") -call ExecuteFunc("WoWReforgedCritters___Init") -call ExecuteFunc("WoWReforgedRandomCorpse__Init") -call ExecuteFunc("Demoralize___Init") -call ExecuteFunc("HolyNova___Init") -call ExecuteFunc("MassDevour___Init") -call ExecuteFunc("Parry___Init") -call ExecuteFunc("PhoenixEgg___Init") +call ExecuteFunc("Tunnel__Init") +call ExecuteFunc("WoWReforgedCrates__Init") +call ExecuteFunc("WoWReforgedCritters__Init") +call ExecuteFunc("WoWReforgedRandomCorpse___Init") +call ExecuteFunc("Demoralize__Init") +call ExecuteFunc("HolyNova__Init") +call ExecuteFunc("MassDevour__Init") +call ExecuteFunc("Parry__Init") +call ExecuteFunc("PhoenixEgg__Init") call ExecuteFunc("Railway___Init") -call ExecuteFunc("SummonWall___Init") -call ExecuteFunc("TailSwipe___Init") -call ExecuteFunc("Telekinesis___Init") -call ExecuteFunc("WoWReforgedFelOrcPiggery__Init") -call ExecuteFunc("WoWReforgedProfessions___Init") -call ExecuteFunc("WoWReforgedTradingPosts__Init") +call ExecuteFunc("SummonWall__Init") +call ExecuteFunc("TailSwipe__Init") +call ExecuteFunc("Telekinesis__Init") +call ExecuteFunc("WoWReforgedFelOrcPiggery___Init") +call ExecuteFunc("WoWReforgedProfessions__Init") +call ExecuteFunc("WoWReforgedTradingPosts___Init") call ExecuteFunc("Ray___Init") -call ExecuteFunc("WoWReforgedProfessionBooksShop__Init") -call ExecuteFunc("AuraSystem___Init") -call ExecuteFunc("WowReforgedCook__Init") -call ExecuteFunc("WoWReforgedUtils___Init") -call ExecuteFunc("SpellsMeteorKnockbackType__Init") -call ExecuteFunc("SpellsSlideKnockbackType__Init") -call ExecuteFunc("WoWReforgedBanners___Init") -call ExecuteFunc("WoWReforgedBosses___Init") -call ExecuteFunc("WoWReforgedClanShop___Init") -call ExecuteFunc("WoWReforgedKnockbackSimple__Init") -call ExecuteFunc("WoWReforgedLearnableSkillsShop___Init") -call ExecuteFunc("WoWReforgedProfessionsTavern___Init") -call ExecuteFunc("WoWReforgedResurrectionStone__Init") -call ExecuteFunc("WoWReforgedSkins___Init") -call ExecuteFunc("WoWReforgedSummonedUnits__Init") -call ExecuteFunc("WoWReforgedVIPs___Init") -call ExecuteFunc("WoWReforgedAiPlayersUi__Init") -call ExecuteFunc("WoWReforgedArmorer__Init") +call ExecuteFunc("WoWReforgedProfessionBooksShop___Init") +call ExecuteFunc("AuraSystem__Init") +call ExecuteFunc("WowReforgedCook___Init") +call ExecuteFunc("WoWReforgedUtils__Init") +call ExecuteFunc("SpellsMeteorKnockbackType___Init") +call ExecuteFunc("SpellsSlideKnockbackType___Init") +call ExecuteFunc("WoWReforgedBanners__Init") +call ExecuteFunc("WoWReforgedBosses__Init") +call ExecuteFunc("WoWReforgedClanShop__Init") +call ExecuteFunc("WoWReforgedKnockbackSimple___Init") +call ExecuteFunc("WoWReforgedLearnableSkillsShop__Init") +call ExecuteFunc("WoWReforgedProfessionsTavern__Init") +call ExecuteFunc("WoWReforgedResurrectionStone___Init") +call ExecuteFunc("WoWReforgedSkins__Init") +call ExecuteFunc("WoWReforgedSummonedUnits___Init") +call ExecuteFunc("WoWReforgedVIPs__Init") +call ExecuteFunc("WoWReforgedAiPlayersUi___Init") +call ExecuteFunc("WoWReforgedArmorer___Init") call ExecuteFunc("WoWReforgedEnchanter__Init") -call ExecuteFunc("WoWReforgedHeroesTavern___Init") -call ExecuteFunc("WoWReforgedInscriptor__Init") -call ExecuteFunc("WoWReforgedMounts__Init") -call ExecuteFunc("WoWReforgedStandardHeroAbilities___Init") -call ExecuteFunc("WoWReforgedWeaponSmith__Init") -call ExecuteFunc("WoWReforgedAchievements__Init") -call ExecuteFunc("WoWReforgedAlchemistLab__Init") -call ExecuteFunc("WoWReforgedBuilder___Init") -call ExecuteFunc("WoWReforgedRacesTavern___Init") -call ExecuteFunc("WoWReforgedSaddle__Init") -call ExecuteFunc("WoWReforgedSceptersShop__Init") -call ExecuteFunc("WoWReforgedThievesGuild__Init") -call ExecuteFunc("WoWReforgedWitchHut__Init") -call ExecuteFunc("WoWReforgedWrapUp___Init") -call ExecuteFunc("WowReforgedMultiply__Init") -call ExecuteFunc("MaxHpResearch___Init") -call ExecuteFunc("WoWReforgedArena__Init") -call ExecuteFunc("WoWReforgedItemSets__Init") -call ExecuteFunc("WoWReforgedRacing__Init") -call ExecuteFunc("WoWReforgedZones__Init") -call ExecuteFunc("WoWReforgedCalendar__Init") -call ExecuteFunc("WoWReforgedMassForestation__Init") -call ExecuteFunc("WoWReforgedMaxHpResearch__Init") -call ExecuteFunc("WoWReforgedPortals__Init") -call ExecuteFunc("WoWReforgedCalendarMultiboard__Init") -call ExecuteFunc("WoWReforgedProperties__Init") -call ExecuteFunc("WoWReforgedBackpacks___Init") -call ExecuteFunc("WoWReforgedHeroTransformation__Init") -call ExecuteFunc("WoWReforgedEquipment___Init") -call ExecuteFunc("WoWReforgedSkillUI__Init") -call ExecuteFunc("WoWReforgedUpdateBackpackUI__Init") -call ExecuteFunc("WoWReforgedArmory___Init") -call ExecuteFunc("WoWReforgedUpdateSkillUI__Init") +call ExecuteFunc("WoWReforgedHeroesTavern__Init") +call ExecuteFunc("WoWReforgedInscriptor___Init") +call ExecuteFunc("WoWReforgedMounts___Init") +call ExecuteFunc("WoWReforgedStandardHeroAbilities__Init") +call ExecuteFunc("WoWReforgedWeaponSmith___Init") +call ExecuteFunc("WoWReforgedAchievements___Init") +call ExecuteFunc("WoWReforgedAlchemistLab___Init") +call ExecuteFunc("WoWReforgedBuilder__Init") +call ExecuteFunc("WoWReforgedRacesTavern__Init") +call ExecuteFunc("WoWReforgedSaddle___Init") +call ExecuteFunc("WoWReforgedSceptersShop___Init") +call ExecuteFunc("WoWReforgedThievesGuild___Init") +call ExecuteFunc("WoWReforgedWitchHut___Init") +call ExecuteFunc("WoWReforgedWrapUp__Init") +call ExecuteFunc("WowReforgedMultiply___Init") +call ExecuteFunc("MaxHpResearch__Init") +call ExecuteFunc("WoWReforgedArena___Init") +call ExecuteFunc("WoWReforgedItemSets___Init") +call ExecuteFunc("WoWReforgedRacing___Init") +call ExecuteFunc("WoWReforgedZones___Init") +call ExecuteFunc("WoWReforgedCalendar___Init") +call ExecuteFunc("WoWReforgedMassForestation___Init") +call ExecuteFunc("WoWReforgedMaxHpResearch___Init") +call ExecuteFunc("WoWReforgedPortals___Init") +call ExecuteFunc("WoWReforgedCalendarMultiboard___Init") +call ExecuteFunc("WoWReforgedProperties___Init") +call ExecuteFunc("WoWReforgedBackpacks__Init") +call ExecuteFunc("WoWReforgedHeroTransformation___Init") +call ExecuteFunc("WoWReforgedEquipment__Init") +call ExecuteFunc("WoWReforgedSkillUI___Init") +call ExecuteFunc("WoWReforgedUpdateBackpackUI___Init") +call ExecuteFunc("WoWReforgedArmory__Init") +call ExecuteFunc("WoWReforgedUpdateSkillUI___Init") call ExecuteFunc("WoWReforgedSaveCodesAll__Init") -call ExecuteFunc("WoWReforgedWebsite__Init") call ExecuteFunc("WoWReforgedSaveCodeUI___Init") -call ExecuteFunc("WoWReforgedStartLocationsTavern___Init") +call ExecuteFunc("WoWReforgedStartLocationsTavern__Init") call ExecuteFunc("WoWReforgedActionsBarUI___Init") -call ExecuteFunc("WoWReforgedCinematic__Init") +call ExecuteFunc("WoWReforgedCinematic___Init") call ExecuteFunc("WoWReforgedRacesUI___Init") call InitGlobals() @@ -213945,7 +210099,7 @@ function sa__ResetCooldown_reset takes nothing returns boolean call s__ResetCooldown_reset(f__arg_unit1,f__arg_integer1) return true endfunction -function sa__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer takes nothing returns boolean +function sa__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer takes nothing returns boolean set UnitEventEx__rezCheck=false call DestroyTimer(GetExpiredTimer()) @@ -214369,8 +210523,8 @@ function sa___prototype55_GroupUtils___HookDestroyBoolExpr takes nothing returns call GroupUtils___HookDestroyBoolExpr(f__arg_boolexpr1) return true endfunction -function sa___prototype10_HeroUtils___RemoveUnitHook takes nothing returns boolean - call FlushChildHashtable(HeroUtils___h, GetHandleId((f__arg_unit1))) // INLINED!! +function sa___prototype10_HeroUtils__RemoveUnitHook takes nothing returns boolean + call FlushChildHashtable(HeroUtils__h, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction function sa___prototype10_IdleWorkersSystem__RemoveUnitHook takes nothing returns boolean @@ -214401,16 +210555,16 @@ function sa___prototype104_DestroyQuestHook takes nothing returns boolean call DestroyQuestHook(f__arg_quest1) return true endfunction -function sa___prototype132_TextTagUtils___SetTextTagTextHook takes nothing returns boolean - call TextTagUtils___SetTextTagTextHook(f__arg_texttag1,f__arg_string1,f__arg_real1) +function sa___prototype132_TextTagUtils__SetTextTagTextHook takes nothing returns boolean + call TextTagUtils__SetTextTagTextHook(f__arg_texttag1,f__arg_string1,f__arg_real1) return true endfunction -function sa___prototype131_TextTagUtils___DestroyTextTagHook takes nothing returns boolean - call TextTagUtils___DestroyTextTagHook(f__arg_texttag1) +function sa___prototype131_TextTagUtils__DestroyTextTagHook takes nothing returns boolean + call TextTagUtils__DestroyTextTagHook(f__arg_texttag1) return true endfunction -function sa___prototype133_TextTagUtils___SetTextTagPermanentHook takes nothing returns boolean - call TextTagUtils___SetTextTagPermanentHook(f__arg_texttag1,f__arg_boolean1) +function sa___prototype133_TextTagUtils__SetTextTagPermanentHook takes nothing returns boolean + call TextTagUtils__SetTextTagPermanentHook(f__arg_texttag1,f__arg_boolean1) return true endfunction function sa___prototype17_TimerUtils__init takes nothing returns boolean @@ -214433,36 +210587,36 @@ function sa___prototype17_TimerUtils__init takes nothing returns boolean set TimerUtils__tN=TimerUtils__QUANTITY return true endfunction -function sa___prototype92_UnitTypeUtils___HookSetPlayerTechResearched takes nothing returns boolean +function sa___prototype92_UnitTypeUtils__HookSetPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer setToLevel=f__arg_integer2 - call UnitTypeUtils___InvalidatePlayerCache(whichPlayer) + call UnitTypeUtils__InvalidatePlayerCache(whichPlayer) return true endfunction -function sa___prototype92_UnitTypeUtils___HookAddPlayerTechResearched takes nothing returns boolean +function sa___prototype92_UnitTypeUtils__HookAddPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer levels=f__arg_integer2 - call UnitTypeUtils___InvalidatePlayerCache(whichPlayer) + call UnitTypeUtils__InvalidatePlayerCache(whichPlayer) return true endfunction -function sa___prototype92_UnitTypeUtils___HookBlzDecPlayerTechResearched takes nothing returns boolean +function sa___prototype92_UnitTypeUtils__HookBlzDecPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer levels=f__arg_integer2 - call UnitTypeUtils___InvalidatePlayerCache(whichPlayer) + call UnitTypeUtils__InvalidatePlayerCache(whichPlayer) return true endfunction -function sa___prototype10_WoWReforgedFelOrcDemonGate__RemoveUnitHook takes nothing returns boolean - call WoWReforgedFelOrcDemonGate__RemoveUnitHook(f__arg_unit1) +function sa___prototype10_WoWReforgedFelOrcDemonGate___RemoveUnitHook takes nothing returns boolean + call WoWReforgedFelOrcDemonGate___RemoveUnitHook(f__arg_unit1) return true endfunction -function sa___prototype10_WoWReforgedFlamethrower__RemoveUnitHook takes nothing returns boolean - call WoWReforgedFlamethrower__RemoveUnitHook(f__arg_unit1) +function sa___prototype10_WoWReforgedFlamethrower___RemoveUnitHook takes nothing returns boolean + call WoWReforgedFlamethrower___RemoveUnitHook(f__arg_unit1) return true endfunction function sa___prototype168_UpdateEachStockBuildingHook takes nothing returns boolean @@ -214473,14 +210627,14 @@ function sa___prototype168_UpdateEachStockBuildingHook takes nothing returns boo set bj_stockPickedItemType=iType set bj_stockPickedItemLevel=iLevel set g=CreateGroup() - call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedMarketplace__IsMarketplace)) + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedMarketplace___IsMarketplace)) call ForGroup(g, function UpdateEachStockBuildingEnum) call DestroyGroup(g) set g=null return true endfunction -function sa___prototype10_HeroReviveEvents___RemoveUnitHook takes nothing returns boolean - call HeroReviveEvents___RemoveUnitHook(f__arg_unit1) +function sa___prototype10_HeroReviveEvents__RemoveUnitHook takes nothing returns boolean + call HeroReviveEvents__RemoveUnitHook(f__arg_unit1) return true endfunction function sa___prototype10_Resources___RemoveUnitHook takes nothing returns boolean @@ -214491,12 +210645,12 @@ function sa___prototype16_TurretSystemRemoveVehicle takes nothing returns boolea set f__result_boolean=TurretSystemRemoveVehicle(f__arg_unit1) return true endfunction -function sa___prototype10_WoWReforgedCombiner___RemoveUnitHook takes nothing returns boolean - call FlushChildHashtable(WoWReforgedCombiner___h, GetHandleId((f__arg_unit1))) // INLINED!! +function sa___prototype10_WoWReforgedCombiner__RemoveUnitHook takes nothing returns boolean + call FlushChildHashtable(WoWReforgedCombiner__h, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction -function sa___prototype10_WoWReforgedFel__RemoveUnitHook takes nothing returns boolean - call WoWReforgedFel__RemoveUnitHook(f__arg_unit1) +function sa___prototype10_WoWReforgedFel___RemoveUnitHook takes nothing returns boolean + call WoWReforgedFel___RemoveUnitHook(f__arg_unit1) return true endfunction function sa___prototype261_WoWReforgedInfoQuests__CreateQuestBJHook takes nothing returns boolean @@ -214628,32 +210782,32 @@ function sa___prototype185_onUnitHit takes nothing returns boolean call onUnitHit(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype10_Queue___ClearSourceCounterExtended takes nothing returns boolean - call Queue___ClearSourceCounterExtended(f__arg_unit1) +function sa___prototype10_Queue__ClearSourceCounterExtended takes nothing returns boolean + call Queue__ClearSourceCounterExtended(f__arg_unit1) return true endfunction -function sa___prototype10_UnitGroupRespawnSystem___RemoveUnitCleanup takes nothing returns boolean - call UnitGroupRespawnSystem___RemoveUnitCleanup(f__arg_unit1) +function sa___prototype10_UnitGroupRespawnSystem__RemoveUnitCleanup takes nothing returns boolean + call UnitGroupRespawnSystem__RemoveUnitCleanup(f__arg_unit1) return true endfunction function sa___prototype10_ResourcesGui___RemoveUnitHook takes nothing returns boolean call ResourcesGui___RemoveUnitHook(f__arg_unit1) return true endfunction -function sa___prototype10_Tunnel___RemoveUnitHook takes nothing returns boolean - call Tunnel___RemoveUnitHook(f__arg_unit1) +function sa___prototype10_Tunnel__RemoveUnitHook takes nothing returns boolean + call Tunnel__RemoveUnitHook(f__arg_unit1) return true endfunction -function sa___prototype10_MassDevour___RemoveUnitMassDevour takes nothing returns boolean - call MassDevour___RemoveUnitMassDevour(f__arg_unit1) +function sa___prototype10_MassDevour__RemoveUnitMassDevour takes nothing returns boolean + call MassDevour__RemoveUnitMassDevour(f__arg_unit1) return true endfunction -function sa___prototype10_Parry___RemoveUnitHook takes nothing returns boolean - call Parry___RemoveUnitHook(f__arg_unit1) +function sa___prototype10_Parry__RemoveUnitHook takes nothing returns boolean + call Parry__RemoveUnitHook(f__arg_unit1) return true endfunction -function sa___prototype10_PhoenixEgg___RemoveUnitHook takes nothing returns boolean - call PhoenixEgg___RemoveUnitHook(f__arg_unit1) +function sa___prototype10_PhoenixEgg__RemoveUnitHook takes nothing returns boolean + call PhoenixEgg__RemoveUnitHook(f__arg_unit1) return true endfunction function sa___prototype10_Railway___RemoveUnitHook takes nothing returns boolean @@ -214664,20 +210818,20 @@ function sa___prototype10_RayConfig___RemoveUnitHook takes nothing returns boole call FlushChildHashtable(RayConfig___h, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction -function sa___prototype185_TailSwipe___onUnitHit takes nothing returns boolean - call TailSwipe___onUnitHit(f__arg_integer1,f__arg_unit1) +function sa___prototype185_TailSwipe__onUnitHit takes nothing returns boolean + call TailSwipe__onUnitHit(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype186_TailSwipe___onDestructableHit takes nothing returns boolean - call TailSwipe___onDestructableHit(f__arg_integer1,f__arg_destructable1) +function sa___prototype186_TailSwipe__onDestructableHit takes nothing returns boolean + call TailSwipe__onDestructableHit(f__arg_integer1,f__arg_destructable1) return true endfunction -function sa___prototype187_TailSwipe___filterFunction takes nothing returns boolean - set f__result_boolean=TailSwipe___filterFunction(f__arg_integer1,f__arg_unit1) +function sa___prototype187_TailSwipe__filterFunction takes nothing returns boolean + set f__result_boolean=TailSwipe__filterFunction(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype10_Telekinesis___RemoveUnitTelekinesis takes nothing returns boolean - call Telekinesis___RemoveUnitTelekinesis(f__arg_unit1) +function sa___prototype10_Telekinesis__RemoveUnitTelekinesis takes nothing returns boolean + call Telekinesis__RemoveUnitTelekinesis(f__arg_unit1) return true endfunction function sa___prototype10_Ray___RemoveUnitHook takes nothing returns boolean @@ -214716,62 +210870,62 @@ function sa___prototype387_FilterEnemyTargetsNonStructure takes nothing returns set f__result_boolean=FilterEnemyTargetsNonStructure(f__arg_unit1,f__arg_unit2,f__arg_integer1) return true endfunction -function sa___prototype185_SpellsMeteorKnockbackType__onUnitHit takes nothing returns boolean - call SpellsMeteorKnockbackType__onUnitHit(f__arg_integer1,f__arg_unit1) +function sa___prototype185_SpellsMeteorKnockbackType___onUnitHit takes nothing returns boolean + call SpellsMeteorKnockbackType___onUnitHit(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype186_SpellsMeteorKnockbackType__onDestructableHit takes nothing returns boolean - call SpellsMeteorKnockbackType__onDestructableHit(f__arg_integer1,f__arg_destructable1) +function sa___prototype186_SpellsMeteorKnockbackType___onDestructableHit takes nothing returns boolean + call SpellsMeteorKnockbackType___onDestructableHit(f__arg_integer1,f__arg_destructable1) return true endfunction -function sa___prototype187_SpellsMeteorKnockbackType__filterFunction takes nothing returns boolean - set f__result_boolean=SpellsMeteorKnockbackType__filterFunction(f__arg_integer1,f__arg_unit1) +function sa___prototype187_SpellsMeteorKnockbackType___filterFunction takes nothing returns boolean + set f__result_boolean=SpellsMeteorKnockbackType___filterFunction(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype185_SpellsSlideKnockbackType__onUnitHit takes nothing returns boolean - call SpellsSlideKnockbackType__onUnitHit(f__arg_integer1,f__arg_unit1) +function sa___prototype185_SpellsSlideKnockbackType___onUnitHit takes nothing returns boolean + call SpellsSlideKnockbackType___onUnitHit(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype186_SpellsSlideKnockbackType__onDestructableHit takes nothing returns boolean - call SpellsSlideKnockbackType__onDestructableHit(f__arg_integer1,f__arg_destructable1) +function sa___prototype186_SpellsSlideKnockbackType___onDestructableHit takes nothing returns boolean + call SpellsSlideKnockbackType___onDestructableHit(f__arg_integer1,f__arg_destructable1) return true endfunction -function sa___prototype187_SpellsSlideKnockbackType__filterFunction takes nothing returns boolean - set f__result_boolean=SpellsSlideKnockbackType__filterFunction(f__arg_integer1,f__arg_unit1) +function sa___prototype187_SpellsSlideKnockbackType___filterFunction takes nothing returns boolean + set f__result_boolean=SpellsSlideKnockbackType___filterFunction(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype92_WoWReforgedEvolution__HookSetPlayerTechResearched takes nothing returns boolean +function sa___prototype92_WoWReforgedEvolution___HookSetPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer setToLevel=f__arg_integer2 if ( techid == UPG_EVOLUTION ) then - call WoWReforgedEvolution__SetEvolutionLevel(whichPlayer , setToLevel - (GetPlayerTechCountSimple(UPG_EVOLUTION, (whichPlayer)))) // INLINED!! + call WoWReforgedEvolution___SetEvolutionLevel(whichPlayer , setToLevel - (GetPlayerTechCountSimple(UPG_EVOLUTION, (whichPlayer)))) // INLINED!! endif return true endfunction -function sa___prototype92_WoWReforgedEvolution__HookAddPlayerTechResearched takes nothing returns boolean +function sa___prototype92_WoWReforgedEvolution___HookAddPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer levels=f__arg_integer2 if ( techid == UPG_EVOLUTION ) then - call WoWReforgedEvolution__SetEvolutionLevel(whichPlayer , levels) + call WoWReforgedEvolution___SetEvolutionLevel(whichPlayer , levels) endif return true endfunction -function sa___prototype92_WoWReforgedEvolution__HookBlzDecPlayerTechResearched takes nothing returns boolean +function sa___prototype92_WoWReforgedEvolution___HookBlzDecPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer levels=f__arg_integer2 if ( techid == UPG_EVOLUTION ) then - call WoWReforgedEvolution__SetEvolutionLevel(whichPlayer , - levels) + call WoWReforgedEvolution___SetEvolutionLevel(whichPlayer , - levels) endif return true endfunction -function sa___prototype10_WoWReforgedSummonedUnits__RemoveUnitHook takes nothing returns boolean - call WoWReforgedSummonedUnits__RemoveUnitHook(f__arg_unit1) +function sa___prototype10_WoWReforgedSummonedUnits___RemoveUnitHook takes nothing returns boolean + call WoWReforgedSummonedUnits___RemoveUnitHook(f__arg_unit1) return true endfunction function sa___prototype212_HookAddUnitToGroup takes nothing returns boolean @@ -214782,27 +210936,27 @@ function sa___prototype10_WoWReforgedEnchanter__EnchanterSystemRemoveUnit takes call FlushChildHashtable(WoWReforgedEnchanter__EnchanterSystemHashTable, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction -function sa___prototype10_WoWReforgedInscriptor__InscriptorSystemRemoveUnit takes nothing returns boolean - call FlushChildHashtable(WoWReforgedInscriptor__h, GetHandleId((f__arg_unit1))) // INLINED!! +function sa___prototype10_WoWReforgedInscriptor___InscriptorSystemRemoveUnit takes nothing returns boolean + call FlushChildHashtable(WoWReforgedInscriptor___h, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction -function sa___prototype457_WoWReforgedAchievements__QuestSetCompletedBJHook takes nothing returns boolean - call WoWReforgedAchievements__QuestSetCompletedBJHook(f__arg_quest1,f__arg_boolean1) +function sa___prototype457_WoWReforgedAchievements___QuestSetCompletedBJHook takes nothing returns boolean + call WoWReforgedAchievements___QuestSetCompletedBJHook(f__arg_quest1,f__arg_boolean1) return true endfunction -function sa___prototype10_WoWReforgedThievesGuild__RemoveUnitHook takes nothing returns boolean - call WoWReforgedThievesGuild__RemoveUnitHook(f__arg_unit1) +function sa___prototype10_WoWReforgedThievesGuild___RemoveUnitHook takes nothing returns boolean + call WoWReforgedThievesGuild___RemoveUnitHook(f__arg_unit1) return true endfunction -function sa___prototype10_WoWReforgedWitchHut__HookRemoveUnit takes nothing returns boolean - call WoWReforgedWitchHut__HookRemoveUnit(f__arg_unit1) +function sa___prototype10_WoWReforgedWitchHut___HookRemoveUnit takes nothing returns boolean + call WoWReforgedWitchHut___HookRemoveUnit(f__arg_unit1) return true endfunction -function sa___prototype10_WoWReforgedWrapUp___HookRemoveConstructedBuilding takes nothing returns boolean - call WoWReforgedWrapUp___HookRemoveConstructedBuilding(f__arg_unit1) +function sa___prototype10_WoWReforgedWrapUp__HookRemoveConstructedBuilding takes nothing returns boolean + call WoWReforgedWrapUp__HookRemoveConstructedBuilding(f__arg_unit1) return true endfunction -function sa___prototype92_MaxHpResearch___HookSetPlayerTechResearched takes nothing returns boolean +function sa___prototype92_MaxHpResearch__HookSetPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer setToLevel=f__arg_integer2 @@ -214810,7 +210964,7 @@ function sa___prototype92_MaxHpResearch___HookSetPlayerTechResearched takes noth call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , setToLevel - GetPlayerTechCountSimple(techid, whichPlayer)) return true endfunction -function sa___prototype92_MaxHpResearch___HookAddPlayerTechResearched takes nothing returns boolean +function sa___prototype92_MaxHpResearch__HookAddPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer levels=f__arg_integer2 @@ -214818,7 +210972,7 @@ function sa___prototype92_MaxHpResearch___HookAddPlayerTechResearched takes noth call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , levels) return true endfunction -function sa___prototype92_MaxHpResearch___HookBlzDecPlayerTechResearched takes nothing returns boolean +function sa___prototype92_MaxHpResearch__HookBlzDecPlayerTechResearched takes nothing returns boolean local player whichPlayer=f__arg_player1 local integer techid=f__arg_integer1 local integer levels=f__arg_integer2 @@ -214826,91 +210980,91 @@ function sa___prototype92_MaxHpResearch___HookBlzDecPlayerTechResearched takes n call ApplyMaxHpResearchToAllUnits(whichPlayer , techid , - levels) return true endfunction -function sa___prototype10_WoWReforgedItemSets__ClearUnitHasItemSet takes nothing returns boolean - call FlushChildHashtable(WoWReforgedItemSets__h, GetHandleId((f__arg_unit1))) // INLINED!! +function sa___prototype10_WoWReforgedItemSets___ClearUnitHasItemSet takes nothing returns boolean + call FlushChildHashtable(WoWReforgedItemSets___h, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction -function sa___prototype145_WoWReforgedItemSets__OnCompleteHolySet takes nothing returns boolean - call WoWReforgedItemSets__OnCompleteHolySet(f__arg_unit1,f__arg_integer1) +function sa___prototype145_WoWReforgedItemSets___OnCompleteHolySet takes nothing returns boolean + call WoWReforgedItemSets___OnCompleteHolySet(f__arg_unit1,f__arg_integer1) return true endfunction -function sa___prototype145_WoWReforgedItemSets__OnUncompleteHolySet takes nothing returns boolean - call WoWReforgedItemSets__OnUncompleteHolySet(f__arg_unit1,f__arg_integer1) +function sa___prototype145_WoWReforgedItemSets___OnUncompleteHolySet takes nothing returns boolean + call WoWReforgedItemSets___OnUncompleteHolySet(f__arg_unit1,f__arg_integer1) return true endfunction -function sa___prototype26_WoWReforgedCalendar__StartEaster takes nothing returns boolean +function sa___prototype26_WoWReforgedCalendar___StartEaster takes nothing returns boolean local integer e=f__arg_integer1 - set WoWReforgedCalendar__easterTrees=true - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) + set WoWReforgedCalendar___easterTrees=true + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) call PlaySoundBJ(gg_snd_EasterIntro) return true endfunction -function sa___prototype26_WoWReforgedCalendar__EndEaster takes nothing returns boolean +function sa___prototype26_WoWReforgedCalendar___EndEaster takes nothing returns boolean local integer e=f__arg_integer1 - set WoWReforgedCalendar__easterTrees=false - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) + set WoWReforgedCalendar___easterTrees=false + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) return true endfunction -function sa___prototype26_WoWReforgedCalendar__StartChristmas takes nothing returns boolean +function sa___prototype26_WoWReforgedCalendar___StartChristmas takes nothing returns boolean local integer e=f__arg_integer1 - set WoWReforgedCalendar__christmasTrees=true - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) + set WoWReforgedCalendar___christmasTrees=true + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) return true endfunction -function sa___prototype26_WoWReforgedCalendar__EndChristmas takes nothing returns boolean +function sa___prototype26_WoWReforgedCalendar___EndChristmas takes nothing returns boolean local integer e=f__arg_integer1 - set WoWReforgedCalendar__christmasTrees=false - call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , WoWReforgedCalendar__season) + set WoWReforgedCalendar___christmasTrees=false + call WoWReforgedCalendar___ReplaceAffectedWithTrees(WoWReforgedCalendar___season , WoWReforgedCalendar___season) return true endfunction -function sa___prototype26_WoWReforgedCalendar__StartNewYear takes nothing returns boolean +function sa___prototype26_WoWReforgedCalendar___StartNewYear takes nothing returns boolean local integer e=f__arg_integer1 local integer index= 0 local integer zone= 0 local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! local integer j= 0 local integer max2= 0 loop exitwhen ( i == max ) - set zone=(WoWReforgedZones__zones[(i)]) // INLINED!! + set zone=(WoWReforgedZones___zones[(i)]) // INLINED!! set max2=(s__Zone_rectsCounter[(zone)]) // INLINED!! set j=0 loop exitwhen ( j == max2 ) set index=Index2D(i , j , MAX_ZONE_RECTS) - set WoWReforgedCalendar__newYearEffects[index]=AddSpecialEffect("war3mapImported\\Firework3.mdx", GetRectCenterX((s___Zone_rects[s__Zone_rects[(zone )]+( j)])), GetRectCenterY((s___Zone_rects[s__Zone_rects[(zone )]+( j)]))) // INLINED!! + set WoWReforgedCalendar___newYearEffects[index]=AddSpecialEffect("war3mapImported\\Firework3.mdx", GetRectCenterX((s___Zone_rects[s__Zone_rects[(zone )]+( j)])), GetRectCenterY((s___Zone_rects[s__Zone_rects[(zone )]+( j)]))) // INLINED!! set j=j + 1 endloop set i=i + 1 endloop return true endfunction -function sa___prototype26_WoWReforgedCalendar__EndNewYear takes nothing returns boolean +function sa___prototype26_WoWReforgedCalendar___EndNewYear takes nothing returns boolean local integer e=f__arg_integer1 local integer index= 0 local integer zone= 0 local integer i= 0 - local integer max= (WoWReforgedZones__zonesCounter) // INLINED!! + local integer max= (WoWReforgedZones___zonesCounter) // INLINED!! local integer j= 0 local integer max2= 0 loop exitwhen ( i == max ) - set zone=(WoWReforgedZones__zones[(i)]) // INLINED!! + set zone=(WoWReforgedZones___zones[(i)]) // INLINED!! set max2=(s__Zone_rectsCounter[(zone)]) // INLINED!! set j=0 loop exitwhen ( j == max2 ) set index=Index2D(i , j , MAX_ZONE_RECTS) - if ( WoWReforgedCalendar__newYearEffects[index] != null ) then - call DestroyEffect(WoWReforgedCalendar__newYearEffects[index]) - set WoWReforgedCalendar__newYearEffects[index]=null + if ( WoWReforgedCalendar___newYearEffects[index] != null ) then + call DestroyEffect(WoWReforgedCalendar___newYearEffects[index]) + set WoWReforgedCalendar___newYearEffects[index]=null endif set j=j + 1 endloop @@ -214918,28 +211072,28 @@ function sa___prototype26_WoWReforgedCalendar__EndNewYear takes nothing returns endloop return true endfunction -function sa___prototype147_WoWReforgedPortals__HookWaygateActivate takes nothing returns boolean - call WoWReforgedPortals__HookWaygateActivate(f__arg_unit1,f__arg_boolean1) +function sa___prototype147_WoWReforgedPortals___HookWaygateActivate takes nothing returns boolean + call WoWReforgedPortals___HookWaygateActivate(f__arg_unit1,f__arg_boolean1) return true endfunction -function sa___prototype480_WoWReforgedPortals__HookWaygateActivateBJ takes nothing returns boolean - call WoWReforgedPortals__HookWaygateActivateBJ(f__arg_boolean1,f__arg_unit1) +function sa___prototype480_WoWReforgedPortals___HookWaygateActivateBJ takes nothing returns boolean + call WoWReforgedPortals___HookWaygateActivateBJ(f__arg_boolean1,f__arg_unit1) return true endfunction -function sa___prototype244_WoWReforgedPortals__HookWaygateSetDestination takes nothing returns boolean - call WoWReforgedPortals__HookWaygateSetDestination(f__arg_unit1,f__arg_real1,f__arg_real2) +function sa___prototype244_WoWReforgedPortals___HookWaygateSetDestination takes nothing returns boolean + call WoWReforgedPortals___HookWaygateSetDestination(f__arg_unit1,f__arg_real1,f__arg_real2) return true endfunction -function sa___prototype481_WoWReforgedPortals__HookWaygateSetDestinationLocBJ takes nothing returns boolean - call WoWReforgedPortals__HookWaygateSetDestinationLocBJ(f__arg_unit1,f__arg_location1) +function sa___prototype481_WoWReforgedPortals___HookWaygateSetDestinationLocBJ takes nothing returns boolean + call WoWReforgedPortals___HookWaygateSetDestinationLocBJ(f__arg_unit1,f__arg_location1) return true endfunction -function sa___prototype10_WoWReforgedEquipment___RemoveUnitHook takes nothing returns boolean - call WoWReforgedEquipment___RemoveUnitHook(f__arg_unit1) +function sa___prototype10_WoWReforgedEquipment__RemoveUnitHook takes nothing returns boolean + call WoWReforgedEquipment__RemoveUnitHook(f__arg_unit1) return true endfunction -function jasshelper__initstructs260435406 takes nothing returns nothing +function jasshelper__initstructs263991484 takes nothing returns nothing set st__AbstractZone_onDestroy[181]=null set st__Aura_onDestroy=CreateTrigger() call TriggerAddCondition(st__Aura_onDestroy,Condition( function sa__Aura_onDestroy)) @@ -215071,8 +211225,8 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddCondition(st__TimedAbility_add,Condition( function sa__TimedAbility_add)) set st__ResetCooldown_reset=CreateTrigger() call TriggerAddCondition(st__ResetCooldown_reset,Condition( function sa__ResetCooldown_reset)) - set st__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer=CreateTrigger() - call TriggerAddCondition(st__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer,Condition( function sa__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___resurrectionTimer)) + set st__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer=CreateTrigger() + call TriggerAddCondition(st__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer,Condition( function sa__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__resurrectionTimer)) set st__SpellVamp_onDestroy[119]=null set st__SpellVamp_onDestroy[146]=null set st__SpellPower_onDestroy[118]=null @@ -215151,8 +211305,8 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddAction(st___prototype55[1],function sa___prototype55_GroupUtils___HookDestroyBoolExpr) call TriggerAddCondition(st___prototype55[1],Condition(function sa___prototype55_GroupUtils___HookDestroyBoolExpr)) set st___prototype10[2]=CreateTrigger() - call TriggerAddAction(st___prototype10[2],function sa___prototype10_HeroUtils___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[2],Condition(function sa___prototype10_HeroUtils___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[2],function sa___prototype10_HeroUtils__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[2],Condition(function sa___prototype10_HeroUtils__RemoveUnitHook)) set st___prototype10[3]=CreateTrigger() call TriggerAddAction(st___prototype10[3],function sa___prototype10_IdleWorkersSystem__RemoveUnitHook) call TriggerAddCondition(st___prototype10[3],Condition(function sa___prototype10_IdleWorkersSystem__RemoveUnitHook)) @@ -215175,38 +211329,38 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddAction(st___prototype104[1],function sa___prototype104_DestroyQuestHook) call TriggerAddCondition(st___prototype104[1],Condition(function sa___prototype104_DestroyQuestHook)) set st___prototype132[1]=CreateTrigger() - call TriggerAddAction(st___prototype132[1],function sa___prototype132_TextTagUtils___SetTextTagTextHook) - call TriggerAddCondition(st___prototype132[1],Condition(function sa___prototype132_TextTagUtils___SetTextTagTextHook)) + call TriggerAddAction(st___prototype132[1],function sa___prototype132_TextTagUtils__SetTextTagTextHook) + call TriggerAddCondition(st___prototype132[1],Condition(function sa___prototype132_TextTagUtils__SetTextTagTextHook)) set st___prototype131[1]=CreateTrigger() - call TriggerAddAction(st___prototype131[1],function sa___prototype131_TextTagUtils___DestroyTextTagHook) - call TriggerAddCondition(st___prototype131[1],Condition(function sa___prototype131_TextTagUtils___DestroyTextTagHook)) + call TriggerAddAction(st___prototype131[1],function sa___prototype131_TextTagUtils__DestroyTextTagHook) + call TriggerAddCondition(st___prototype131[1],Condition(function sa___prototype131_TextTagUtils__DestroyTextTagHook)) set st___prototype133[1]=CreateTrigger() - call TriggerAddAction(st___prototype133[1],function sa___prototype133_TextTagUtils___SetTextTagPermanentHook) - call TriggerAddCondition(st___prototype133[1],Condition(function sa___prototype133_TextTagUtils___SetTextTagPermanentHook)) + call TriggerAddAction(st___prototype133[1],function sa___prototype133_TextTagUtils__SetTextTagPermanentHook) + call TriggerAddCondition(st___prototype133[1],Condition(function sa___prototype133_TextTagUtils__SetTextTagPermanentHook)) set st___prototype17[1]=CreateTrigger() call TriggerAddAction(st___prototype17[1],function sa___prototype17_TimerUtils__init) call TriggerAddCondition(st___prototype17[1],Condition(function sa___prototype17_TimerUtils__init)) set st___prototype92[1]=CreateTrigger() - call TriggerAddAction(st___prototype92[1],function sa___prototype92_UnitTypeUtils___HookSetPlayerTechResearched) - call TriggerAddCondition(st___prototype92[1],Condition(function sa___prototype92_UnitTypeUtils___HookSetPlayerTechResearched)) + call TriggerAddAction(st___prototype92[1],function sa___prototype92_UnitTypeUtils__HookSetPlayerTechResearched) + call TriggerAddCondition(st___prototype92[1],Condition(function sa___prototype92_UnitTypeUtils__HookSetPlayerTechResearched)) set st___prototype92[2]=CreateTrigger() - call TriggerAddAction(st___prototype92[2],function sa___prototype92_UnitTypeUtils___HookAddPlayerTechResearched) - call TriggerAddCondition(st___prototype92[2],Condition(function sa___prototype92_UnitTypeUtils___HookAddPlayerTechResearched)) + call TriggerAddAction(st___prototype92[2],function sa___prototype92_UnitTypeUtils__HookAddPlayerTechResearched) + call TriggerAddCondition(st___prototype92[2],Condition(function sa___prototype92_UnitTypeUtils__HookAddPlayerTechResearched)) set st___prototype92[3]=CreateTrigger() - call TriggerAddAction(st___prototype92[3],function sa___prototype92_UnitTypeUtils___HookBlzDecPlayerTechResearched) - call TriggerAddCondition(st___prototype92[3],Condition(function sa___prototype92_UnitTypeUtils___HookBlzDecPlayerTechResearched)) + call TriggerAddAction(st___prototype92[3],function sa___prototype92_UnitTypeUtils__HookBlzDecPlayerTechResearched) + call TriggerAddCondition(st___prototype92[3],Condition(function sa___prototype92_UnitTypeUtils__HookBlzDecPlayerTechResearched)) set st___prototype10[5]=CreateTrigger() - call TriggerAddAction(st___prototype10[5],function sa___prototype10_WoWReforgedFelOrcDemonGate__RemoveUnitHook) - call TriggerAddCondition(st___prototype10[5],Condition(function sa___prototype10_WoWReforgedFelOrcDemonGate__RemoveUnitHook)) + call TriggerAddAction(st___prototype10[5],function sa___prototype10_WoWReforgedFelOrcDemonGate___RemoveUnitHook) + call TriggerAddCondition(st___prototype10[5],Condition(function sa___prototype10_WoWReforgedFelOrcDemonGate___RemoveUnitHook)) set st___prototype10[6]=CreateTrigger() - call TriggerAddAction(st___prototype10[6],function sa___prototype10_WoWReforgedFlamethrower__RemoveUnitHook) - call TriggerAddCondition(st___prototype10[6],Condition(function sa___prototype10_WoWReforgedFlamethrower__RemoveUnitHook)) + call TriggerAddAction(st___prototype10[6],function sa___prototype10_WoWReforgedFlamethrower___RemoveUnitHook) + call TriggerAddCondition(st___prototype10[6],Condition(function sa___prototype10_WoWReforgedFlamethrower___RemoveUnitHook)) set st___prototype168[1]=CreateTrigger() call TriggerAddAction(st___prototype168[1],function sa___prototype168_UpdateEachStockBuildingHook) call TriggerAddCondition(st___prototype168[1],Condition(function sa___prototype168_UpdateEachStockBuildingHook)) set st___prototype10[7]=CreateTrigger() - call TriggerAddAction(st___prototype10[7],function sa___prototype10_HeroReviveEvents___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[7],Condition(function sa___prototype10_HeroReviveEvents___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[7],function sa___prototype10_HeroReviveEvents__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[7],Condition(function sa___prototype10_HeroReviveEvents__RemoveUnitHook)) set st___prototype10[8]=CreateTrigger() call TriggerAddAction(st___prototype10[8],function sa___prototype10_Resources___RemoveUnitHook) call TriggerAddCondition(st___prototype10[8],Condition(function sa___prototype10_Resources___RemoveUnitHook)) @@ -215214,11 +211368,11 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddAction(st___prototype16[1],function sa___prototype16_TurretSystemRemoveVehicle) call TriggerAddCondition(st___prototype16[1],Condition(function sa___prototype16_TurretSystemRemoveVehicle)) set st___prototype10[9]=CreateTrigger() - call TriggerAddAction(st___prototype10[9],function sa___prototype10_WoWReforgedCombiner___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[9],Condition(function sa___prototype10_WoWReforgedCombiner___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[9],function sa___prototype10_WoWReforgedCombiner__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[9],Condition(function sa___prototype10_WoWReforgedCombiner__RemoveUnitHook)) set st___prototype10[10]=CreateTrigger() - call TriggerAddAction(st___prototype10[10],function sa___prototype10_WoWReforgedFel__RemoveUnitHook) - call TriggerAddCondition(st___prototype10[10],Condition(function sa___prototype10_WoWReforgedFel__RemoveUnitHook)) + call TriggerAddAction(st___prototype10[10],function sa___prototype10_WoWReforgedFel___RemoveUnitHook) + call TriggerAddCondition(st___prototype10[10],Condition(function sa___prototype10_WoWReforgedFel___RemoveUnitHook)) set st___prototype261[1]=CreateTrigger() call TriggerAddAction(st___prototype261[1],function sa___prototype261_WoWReforgedInfoQuests__CreateQuestBJHook) call TriggerAddCondition(st___prototype261[1],Condition(function sa___prototype261_WoWReforgedInfoQuests__CreateQuestBJHook)) @@ -215274,26 +211428,26 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddAction(st___prototype185[1],function sa___prototype185_onUnitHit) call TriggerAddCondition(st___prototype185[1],Condition(function sa___prototype185_onUnitHit)) set st___prototype10[11]=CreateTrigger() - call TriggerAddAction(st___prototype10[11],function sa___prototype10_Queue___ClearSourceCounterExtended) - call TriggerAddCondition(st___prototype10[11],Condition(function sa___prototype10_Queue___ClearSourceCounterExtended)) + call TriggerAddAction(st___prototype10[11],function sa___prototype10_Queue__ClearSourceCounterExtended) + call TriggerAddCondition(st___prototype10[11],Condition(function sa___prototype10_Queue__ClearSourceCounterExtended)) set st___prototype10[12]=CreateTrigger() - call TriggerAddAction(st___prototype10[12],function sa___prototype10_UnitGroupRespawnSystem___RemoveUnitCleanup) - call TriggerAddCondition(st___prototype10[12],Condition(function sa___prototype10_UnitGroupRespawnSystem___RemoveUnitCleanup)) + call TriggerAddAction(st___prototype10[12],function sa___prototype10_UnitGroupRespawnSystem__RemoveUnitCleanup) + call TriggerAddCondition(st___prototype10[12],Condition(function sa___prototype10_UnitGroupRespawnSystem__RemoveUnitCleanup)) set st___prototype10[13]=CreateTrigger() call TriggerAddAction(st___prototype10[13],function sa___prototype10_ResourcesGui___RemoveUnitHook) call TriggerAddCondition(st___prototype10[13],Condition(function sa___prototype10_ResourcesGui___RemoveUnitHook)) set st___prototype10[14]=CreateTrigger() - call TriggerAddAction(st___prototype10[14],function sa___prototype10_Tunnel___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[14],Condition(function sa___prototype10_Tunnel___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[14],function sa___prototype10_Tunnel__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[14],Condition(function sa___prototype10_Tunnel__RemoveUnitHook)) set st___prototype10[15]=CreateTrigger() - call TriggerAddAction(st___prototype10[15],function sa___prototype10_MassDevour___RemoveUnitMassDevour) - call TriggerAddCondition(st___prototype10[15],Condition(function sa___prototype10_MassDevour___RemoveUnitMassDevour)) + call TriggerAddAction(st___prototype10[15],function sa___prototype10_MassDevour__RemoveUnitMassDevour) + call TriggerAddCondition(st___prototype10[15],Condition(function sa___prototype10_MassDevour__RemoveUnitMassDevour)) set st___prototype10[16]=CreateTrigger() - call TriggerAddAction(st___prototype10[16],function sa___prototype10_Parry___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[16],Condition(function sa___prototype10_Parry___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[16],function sa___prototype10_Parry__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[16],Condition(function sa___prototype10_Parry__RemoveUnitHook)) set st___prototype10[17]=CreateTrigger() - call TriggerAddAction(st___prototype10[17],function sa___prototype10_PhoenixEgg___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[17],Condition(function sa___prototype10_PhoenixEgg___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[17],function sa___prototype10_PhoenixEgg__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[17],Condition(function sa___prototype10_PhoenixEgg__RemoveUnitHook)) set st___prototype10[18]=CreateTrigger() call TriggerAddAction(st___prototype10[18],function sa___prototype10_Railway___RemoveUnitHook) call TriggerAddCondition(st___prototype10[18],Condition(function sa___prototype10_Railway___RemoveUnitHook)) @@ -215301,17 +211455,17 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddAction(st___prototype10[19],function sa___prototype10_RayConfig___RemoveUnitHook) call TriggerAddCondition(st___prototype10[19],Condition(function sa___prototype10_RayConfig___RemoveUnitHook)) set st___prototype185[2]=CreateTrigger() - call TriggerAddAction(st___prototype185[2],function sa___prototype185_TailSwipe___onUnitHit) - call TriggerAddCondition(st___prototype185[2],Condition(function sa___prototype185_TailSwipe___onUnitHit)) + call TriggerAddAction(st___prototype185[2],function sa___prototype185_TailSwipe__onUnitHit) + call TriggerAddCondition(st___prototype185[2],Condition(function sa___prototype185_TailSwipe__onUnitHit)) set st___prototype186[2]=CreateTrigger() - call TriggerAddAction(st___prototype186[2],function sa___prototype186_TailSwipe___onDestructableHit) - call TriggerAddCondition(st___prototype186[2],Condition(function sa___prototype186_TailSwipe___onDestructableHit)) + call TriggerAddAction(st___prototype186[2],function sa___prototype186_TailSwipe__onDestructableHit) + call TriggerAddCondition(st___prototype186[2],Condition(function sa___prototype186_TailSwipe__onDestructableHit)) set st___prototype187[2]=CreateTrigger() - call TriggerAddAction(st___prototype187[2],function sa___prototype187_TailSwipe___filterFunction) - call TriggerAddCondition(st___prototype187[2],Condition(function sa___prototype187_TailSwipe___filterFunction)) + call TriggerAddAction(st___prototype187[2],function sa___prototype187_TailSwipe__filterFunction) + call TriggerAddCondition(st___prototype187[2],Condition(function sa___prototype187_TailSwipe__filterFunction)) set st___prototype10[20]=CreateTrigger() - call TriggerAddAction(st___prototype10[20],function sa___prototype10_Telekinesis___RemoveUnitTelekinesis) - call TriggerAddCondition(st___prototype10[20],Condition(function sa___prototype10_Telekinesis___RemoveUnitTelekinesis)) + call TriggerAddAction(st___prototype10[20],function sa___prototype10_Telekinesis__RemoveUnitTelekinesis) + call TriggerAddCondition(st___prototype10[20],Condition(function sa___prototype10_Telekinesis__RemoveUnitTelekinesis)) set st___prototype10[21]=CreateTrigger() call TriggerAddAction(st___prototype10[21],function sa___prototype10_Ray___RemoveUnitHook) call TriggerAddCondition(st___prototype10[21],Condition(function sa___prototype10_Ray___RemoveUnitHook)) @@ -215340,35 +211494,35 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddAction(st___prototype387[6],function sa___prototype387_FilterEnemyTargetsNonStructure) call TriggerAddCondition(st___prototype387[6],Condition(function sa___prototype387_FilterEnemyTargetsNonStructure)) set st___prototype185[3]=CreateTrigger() - call TriggerAddAction(st___prototype185[3],function sa___prototype185_SpellsMeteorKnockbackType__onUnitHit) - call TriggerAddCondition(st___prototype185[3],Condition(function sa___prototype185_SpellsMeteorKnockbackType__onUnitHit)) + call TriggerAddAction(st___prototype185[3],function sa___prototype185_SpellsMeteorKnockbackType___onUnitHit) + call TriggerAddCondition(st___prototype185[3],Condition(function sa___prototype185_SpellsMeteorKnockbackType___onUnitHit)) set st___prototype186[3]=CreateTrigger() - call TriggerAddAction(st___prototype186[3],function sa___prototype186_SpellsMeteorKnockbackType__onDestructableHit) - call TriggerAddCondition(st___prototype186[3],Condition(function sa___prototype186_SpellsMeteorKnockbackType__onDestructableHit)) + call TriggerAddAction(st___prototype186[3],function sa___prototype186_SpellsMeteorKnockbackType___onDestructableHit) + call TriggerAddCondition(st___prototype186[3],Condition(function sa___prototype186_SpellsMeteorKnockbackType___onDestructableHit)) set st___prototype187[3]=CreateTrigger() - call TriggerAddAction(st___prototype187[3],function sa___prototype187_SpellsMeteorKnockbackType__filterFunction) - call TriggerAddCondition(st___prototype187[3],Condition(function sa___prototype187_SpellsMeteorKnockbackType__filterFunction)) + call TriggerAddAction(st___prototype187[3],function sa___prototype187_SpellsMeteorKnockbackType___filterFunction) + call TriggerAddCondition(st___prototype187[3],Condition(function sa___prototype187_SpellsMeteorKnockbackType___filterFunction)) set st___prototype185[4]=CreateTrigger() - call TriggerAddAction(st___prototype185[4],function sa___prototype185_SpellsSlideKnockbackType__onUnitHit) - call TriggerAddCondition(st___prototype185[4],Condition(function sa___prototype185_SpellsSlideKnockbackType__onUnitHit)) + call TriggerAddAction(st___prototype185[4],function sa___prototype185_SpellsSlideKnockbackType___onUnitHit) + call TriggerAddCondition(st___prototype185[4],Condition(function sa___prototype185_SpellsSlideKnockbackType___onUnitHit)) set st___prototype186[4]=CreateTrigger() - call TriggerAddAction(st___prototype186[4],function sa___prototype186_SpellsSlideKnockbackType__onDestructableHit) - call TriggerAddCondition(st___prototype186[4],Condition(function sa___prototype186_SpellsSlideKnockbackType__onDestructableHit)) + call TriggerAddAction(st___prototype186[4],function sa___prototype186_SpellsSlideKnockbackType___onDestructableHit) + call TriggerAddCondition(st___prototype186[4],Condition(function sa___prototype186_SpellsSlideKnockbackType___onDestructableHit)) set st___prototype187[4]=CreateTrigger() - call TriggerAddAction(st___prototype187[4],function sa___prototype187_SpellsSlideKnockbackType__filterFunction) - call TriggerAddCondition(st___prototype187[4],Condition(function sa___prototype187_SpellsSlideKnockbackType__filterFunction)) + call TriggerAddAction(st___prototype187[4],function sa___prototype187_SpellsSlideKnockbackType___filterFunction) + call TriggerAddCondition(st___prototype187[4],Condition(function sa___prototype187_SpellsSlideKnockbackType___filterFunction)) set st___prototype92[4]=CreateTrigger() - call TriggerAddAction(st___prototype92[4],function sa___prototype92_WoWReforgedEvolution__HookSetPlayerTechResearched) - call TriggerAddCondition(st___prototype92[4],Condition(function sa___prototype92_WoWReforgedEvolution__HookSetPlayerTechResearched)) + call TriggerAddAction(st___prototype92[4],function sa___prototype92_WoWReforgedEvolution___HookSetPlayerTechResearched) + call TriggerAddCondition(st___prototype92[4],Condition(function sa___prototype92_WoWReforgedEvolution___HookSetPlayerTechResearched)) set st___prototype92[5]=CreateTrigger() - call TriggerAddAction(st___prototype92[5],function sa___prototype92_WoWReforgedEvolution__HookAddPlayerTechResearched) - call TriggerAddCondition(st___prototype92[5],Condition(function sa___prototype92_WoWReforgedEvolution__HookAddPlayerTechResearched)) + call TriggerAddAction(st___prototype92[5],function sa___prototype92_WoWReforgedEvolution___HookAddPlayerTechResearched) + call TriggerAddCondition(st___prototype92[5],Condition(function sa___prototype92_WoWReforgedEvolution___HookAddPlayerTechResearched)) set st___prototype92[6]=CreateTrigger() - call TriggerAddAction(st___prototype92[6],function sa___prototype92_WoWReforgedEvolution__HookBlzDecPlayerTechResearched) - call TriggerAddCondition(st___prototype92[6],Condition(function sa___prototype92_WoWReforgedEvolution__HookBlzDecPlayerTechResearched)) + call TriggerAddAction(st___prototype92[6],function sa___prototype92_WoWReforgedEvolution___HookBlzDecPlayerTechResearched) + call TriggerAddCondition(st___prototype92[6],Condition(function sa___prototype92_WoWReforgedEvolution___HookBlzDecPlayerTechResearched)) set st___prototype10[24]=CreateTrigger() - call TriggerAddAction(st___prototype10[24],function sa___prototype10_WoWReforgedSummonedUnits__RemoveUnitHook) - call TriggerAddCondition(st___prototype10[24],Condition(function sa___prototype10_WoWReforgedSummonedUnits__RemoveUnitHook)) + call TriggerAddAction(st___prototype10[24],function sa___prototype10_WoWReforgedSummonedUnits___RemoveUnitHook) + call TriggerAddCondition(st___prototype10[24],Condition(function sa___prototype10_WoWReforgedSummonedUnits___RemoveUnitHook)) set st___prototype212[1]=CreateTrigger() call TriggerAddAction(st___prototype212[1],function sa___prototype212_HookAddUnitToGroup) call TriggerAddCondition(st___prototype212[1],Condition(function sa___prototype212_HookAddUnitToGroup)) @@ -215376,93 +211530,93 @@ function jasshelper__initstructs260435406 takes nothing returns nothing call TriggerAddAction(st___prototype10[25],function sa___prototype10_WoWReforgedEnchanter__EnchanterSystemRemoveUnit) call TriggerAddCondition(st___prototype10[25],Condition(function sa___prototype10_WoWReforgedEnchanter__EnchanterSystemRemoveUnit)) set st___prototype10[26]=CreateTrigger() - call TriggerAddAction(st___prototype10[26],function sa___prototype10_WoWReforgedInscriptor__InscriptorSystemRemoveUnit) - call TriggerAddCondition(st___prototype10[26],Condition(function sa___prototype10_WoWReforgedInscriptor__InscriptorSystemRemoveUnit)) + call TriggerAddAction(st___prototype10[26],function sa___prototype10_WoWReforgedInscriptor___InscriptorSystemRemoveUnit) + call TriggerAddCondition(st___prototype10[26],Condition(function sa___prototype10_WoWReforgedInscriptor___InscriptorSystemRemoveUnit)) set st___prototype457[1]=CreateTrigger() - call TriggerAddAction(st___prototype457[1],function sa___prototype457_WoWReforgedAchievements__QuestSetCompletedBJHook) - call TriggerAddCondition(st___prototype457[1],Condition(function sa___prototype457_WoWReforgedAchievements__QuestSetCompletedBJHook)) + call TriggerAddAction(st___prototype457[1],function sa___prototype457_WoWReforgedAchievements___QuestSetCompletedBJHook) + call TriggerAddCondition(st___prototype457[1],Condition(function sa___prototype457_WoWReforgedAchievements___QuestSetCompletedBJHook)) set st___prototype10[27]=CreateTrigger() - call TriggerAddAction(st___prototype10[27],function sa___prototype10_WoWReforgedThievesGuild__RemoveUnitHook) - call TriggerAddCondition(st___prototype10[27],Condition(function sa___prototype10_WoWReforgedThievesGuild__RemoveUnitHook)) + call TriggerAddAction(st___prototype10[27],function sa___prototype10_WoWReforgedThievesGuild___RemoveUnitHook) + call TriggerAddCondition(st___prototype10[27],Condition(function sa___prototype10_WoWReforgedThievesGuild___RemoveUnitHook)) set st___prototype10[28]=CreateTrigger() - call TriggerAddAction(st___prototype10[28],function sa___prototype10_WoWReforgedWitchHut__HookRemoveUnit) - call TriggerAddCondition(st___prototype10[28],Condition(function sa___prototype10_WoWReforgedWitchHut__HookRemoveUnit)) + call TriggerAddAction(st___prototype10[28],function sa___prototype10_WoWReforgedWitchHut___HookRemoveUnit) + call TriggerAddCondition(st___prototype10[28],Condition(function sa___prototype10_WoWReforgedWitchHut___HookRemoveUnit)) set st___prototype10[29]=CreateTrigger() - call TriggerAddAction(st___prototype10[29],function sa___prototype10_WoWReforgedWrapUp___HookRemoveConstructedBuilding) - call TriggerAddCondition(st___prototype10[29],Condition(function sa___prototype10_WoWReforgedWrapUp___HookRemoveConstructedBuilding)) + call TriggerAddAction(st___prototype10[29],function sa___prototype10_WoWReforgedWrapUp__HookRemoveConstructedBuilding) + call TriggerAddCondition(st___prototype10[29],Condition(function sa___prototype10_WoWReforgedWrapUp__HookRemoveConstructedBuilding)) set st___prototype92[7]=CreateTrigger() - call TriggerAddAction(st___prototype92[7],function sa___prototype92_MaxHpResearch___HookSetPlayerTechResearched) - call TriggerAddCondition(st___prototype92[7],Condition(function sa___prototype92_MaxHpResearch___HookSetPlayerTechResearched)) + call TriggerAddAction(st___prototype92[7],function sa___prototype92_MaxHpResearch__HookSetPlayerTechResearched) + call TriggerAddCondition(st___prototype92[7],Condition(function sa___prototype92_MaxHpResearch__HookSetPlayerTechResearched)) set st___prototype92[8]=CreateTrigger() - call TriggerAddAction(st___prototype92[8],function sa___prototype92_MaxHpResearch___HookAddPlayerTechResearched) - call TriggerAddCondition(st___prototype92[8],Condition(function sa___prototype92_MaxHpResearch___HookAddPlayerTechResearched)) + call TriggerAddAction(st___prototype92[8],function sa___prototype92_MaxHpResearch__HookAddPlayerTechResearched) + call TriggerAddCondition(st___prototype92[8],Condition(function sa___prototype92_MaxHpResearch__HookAddPlayerTechResearched)) set st___prototype92[9]=CreateTrigger() - call TriggerAddAction(st___prototype92[9],function sa___prototype92_MaxHpResearch___HookBlzDecPlayerTechResearched) - call TriggerAddCondition(st___prototype92[9],Condition(function sa___prototype92_MaxHpResearch___HookBlzDecPlayerTechResearched)) + call TriggerAddAction(st___prototype92[9],function sa___prototype92_MaxHpResearch__HookBlzDecPlayerTechResearched) + call TriggerAddCondition(st___prototype92[9],Condition(function sa___prototype92_MaxHpResearch__HookBlzDecPlayerTechResearched)) set st___prototype10[30]=CreateTrigger() - call TriggerAddAction(st___prototype10[30],function sa___prototype10_WoWReforgedItemSets__ClearUnitHasItemSet) - call TriggerAddCondition(st___prototype10[30],Condition(function sa___prototype10_WoWReforgedItemSets__ClearUnitHasItemSet)) + call TriggerAddAction(st___prototype10[30],function sa___prototype10_WoWReforgedItemSets___ClearUnitHasItemSet) + call TriggerAddCondition(st___prototype10[30],Condition(function sa___prototype10_WoWReforgedItemSets___ClearUnitHasItemSet)) set st___prototype145[1]=CreateTrigger() - call TriggerAddAction(st___prototype145[1],function sa___prototype145_WoWReforgedItemSets__OnCompleteHolySet) - call TriggerAddCondition(st___prototype145[1],Condition(function sa___prototype145_WoWReforgedItemSets__OnCompleteHolySet)) + call TriggerAddAction(st___prototype145[1],function sa___prototype145_WoWReforgedItemSets___OnCompleteHolySet) + call TriggerAddCondition(st___prototype145[1],Condition(function sa___prototype145_WoWReforgedItemSets___OnCompleteHolySet)) set st___prototype145[2]=CreateTrigger() - call TriggerAddAction(st___prototype145[2],function sa___prototype145_WoWReforgedItemSets__OnUncompleteHolySet) - call TriggerAddCondition(st___prototype145[2],Condition(function sa___prototype145_WoWReforgedItemSets__OnUncompleteHolySet)) + call TriggerAddAction(st___prototype145[2],function sa___prototype145_WoWReforgedItemSets___OnUncompleteHolySet) + call TriggerAddCondition(st___prototype145[2],Condition(function sa___prototype145_WoWReforgedItemSets___OnUncompleteHolySet)) set st___prototype26[1]=CreateTrigger() - call TriggerAddAction(st___prototype26[1],function sa___prototype26_WoWReforgedCalendar__StartEaster) - call TriggerAddCondition(st___prototype26[1],Condition(function sa___prototype26_WoWReforgedCalendar__StartEaster)) + call TriggerAddAction(st___prototype26[1],function sa___prototype26_WoWReforgedCalendar___StartEaster) + call TriggerAddCondition(st___prototype26[1],Condition(function sa___prototype26_WoWReforgedCalendar___StartEaster)) set st___prototype26[2]=CreateTrigger() - call TriggerAddAction(st___prototype26[2],function sa___prototype26_WoWReforgedCalendar__EndEaster) - call TriggerAddCondition(st___prototype26[2],Condition(function sa___prototype26_WoWReforgedCalendar__EndEaster)) + call TriggerAddAction(st___prototype26[2],function sa___prototype26_WoWReforgedCalendar___EndEaster) + call TriggerAddCondition(st___prototype26[2],Condition(function sa___prototype26_WoWReforgedCalendar___EndEaster)) set st___prototype26[3]=CreateTrigger() - call TriggerAddAction(st___prototype26[3],function sa___prototype26_WoWReforgedCalendar__StartChristmas) - call TriggerAddCondition(st___prototype26[3],Condition(function sa___prototype26_WoWReforgedCalendar__StartChristmas)) + call TriggerAddAction(st___prototype26[3],function sa___prototype26_WoWReforgedCalendar___StartChristmas) + call TriggerAddCondition(st___prototype26[3],Condition(function sa___prototype26_WoWReforgedCalendar___StartChristmas)) set st___prototype26[4]=CreateTrigger() - call TriggerAddAction(st___prototype26[4],function sa___prototype26_WoWReforgedCalendar__EndChristmas) - call TriggerAddCondition(st___prototype26[4],Condition(function sa___prototype26_WoWReforgedCalendar__EndChristmas)) + call TriggerAddAction(st___prototype26[4],function sa___prototype26_WoWReforgedCalendar___EndChristmas) + call TriggerAddCondition(st___prototype26[4],Condition(function sa___prototype26_WoWReforgedCalendar___EndChristmas)) set st___prototype26[5]=CreateTrigger() - call TriggerAddAction(st___prototype26[5],function sa___prototype26_WoWReforgedCalendar__StartNewYear) - call TriggerAddCondition(st___prototype26[5],Condition(function sa___prototype26_WoWReforgedCalendar__StartNewYear)) + call TriggerAddAction(st___prototype26[5],function sa___prototype26_WoWReforgedCalendar___StartNewYear) + call TriggerAddCondition(st___prototype26[5],Condition(function sa___prototype26_WoWReforgedCalendar___StartNewYear)) set st___prototype26[6]=CreateTrigger() - call TriggerAddAction(st___prototype26[6],function sa___prototype26_WoWReforgedCalendar__EndNewYear) - call TriggerAddCondition(st___prototype26[6],Condition(function sa___prototype26_WoWReforgedCalendar__EndNewYear)) + call TriggerAddAction(st___prototype26[6],function sa___prototype26_WoWReforgedCalendar___EndNewYear) + call TriggerAddCondition(st___prototype26[6],Condition(function sa___prototype26_WoWReforgedCalendar___EndNewYear)) set st___prototype147[1]=CreateTrigger() - call TriggerAddAction(st___prototype147[1],function sa___prototype147_WoWReforgedPortals__HookWaygateActivate) - call TriggerAddCondition(st___prototype147[1],Condition(function sa___prototype147_WoWReforgedPortals__HookWaygateActivate)) + call TriggerAddAction(st___prototype147[1],function sa___prototype147_WoWReforgedPortals___HookWaygateActivate) + call TriggerAddCondition(st___prototype147[1],Condition(function sa___prototype147_WoWReforgedPortals___HookWaygateActivate)) set st___prototype480[1]=CreateTrigger() - call TriggerAddAction(st___prototype480[1],function sa___prototype480_WoWReforgedPortals__HookWaygateActivateBJ) - call TriggerAddCondition(st___prototype480[1],Condition(function sa___prototype480_WoWReforgedPortals__HookWaygateActivateBJ)) + call TriggerAddAction(st___prototype480[1],function sa___prototype480_WoWReforgedPortals___HookWaygateActivateBJ) + call TriggerAddCondition(st___prototype480[1],Condition(function sa___prototype480_WoWReforgedPortals___HookWaygateActivateBJ)) set st___prototype244[1]=CreateTrigger() - call TriggerAddAction(st___prototype244[1],function sa___prototype244_WoWReforgedPortals__HookWaygateSetDestination) - call TriggerAddCondition(st___prototype244[1],Condition(function sa___prototype244_WoWReforgedPortals__HookWaygateSetDestination)) + call TriggerAddAction(st___prototype244[1],function sa___prototype244_WoWReforgedPortals___HookWaygateSetDestination) + call TriggerAddCondition(st___prototype244[1],Condition(function sa___prototype244_WoWReforgedPortals___HookWaygateSetDestination)) set st___prototype481[1]=CreateTrigger() - call TriggerAddAction(st___prototype481[1],function sa___prototype481_WoWReforgedPortals__HookWaygateSetDestinationLocBJ) - call TriggerAddCondition(st___prototype481[1],Condition(function sa___prototype481_WoWReforgedPortals__HookWaygateSetDestinationLocBJ)) + call TriggerAddAction(st___prototype481[1],function sa___prototype481_WoWReforgedPortals___HookWaygateSetDestinationLocBJ) + call TriggerAddCondition(st___prototype481[1],Condition(function sa___prototype481_WoWReforgedPortals___HookWaygateSetDestinationLocBJ)) set st___prototype10[31]=CreateTrigger() - call TriggerAddAction(st___prototype10[31],function sa___prototype10_WoWReforgedEquipment___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[31],Condition(function sa___prototype10_WoWReforgedEquipment___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[31],function sa___prototype10_WoWReforgedEquipment__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[31],Condition(function sa___prototype10_WoWReforgedEquipment__RemoveUnitHook)) -call ExecuteFunc("s__Ascii___Inits_Ascii___Init___onInit") +call ExecuteFunc("s__Ascii___Inits_Ascii___Init__onInit") -call ExecuteFunc("s__BlackArrowSystem__S_BlackArrowSystem__Init___onInit") +call ExecuteFunc("s__BlackArrowSystem__S_BlackArrowSystem__Init__onInit") -call ExecuteFunc("s__File_FileIO___FileInit___onInit") +call ExecuteFunc("s__File_FileIO___FileInit__onInit") -call ExecuteFunc("s__GameStatus___GameStatus_GameStatus___GameStatusInit___onInit") +call ExecuteFunc("s__GameStatus___GameStatus_GameStatus___GameStatusInit__onInit") -call ExecuteFunc("s__ItemRespawnSystem__S_ItemRespawnSystem__Init___onInit") +call ExecuteFunc("s__ItemRespawnSystem__S_ItemRespawnSystem__Init__onInit") -call ExecuteFunc("s__UserMouse_MouseUtils___Init___onInit") +call ExecuteFunc("s__UserMouse_MouseUtils___Init__onInit") @@ -215515,13 +211669,13 @@ call ExecuteFunc("s__UserMouse_MouseUtils___Init___onInit") -call ExecuteFunc("s__WorldBounds_WorldBounds__WorldBoundInit___onInit") +call ExecuteFunc("s__WorldBounds_WorldBounds__WorldBoundInit__onInit") -call ExecuteFunc("s__Jump_CTLEnd___onInit") +call ExecuteFunc("s__Jump_CTLEnd__onInit") @@ -215531,15 +211685,15 @@ call ExecuteFunc("s__Jump_CTLEnd___onInit") -call ExecuteFunc("s__Spell_PluginSpellEffect__Event___onInit") +call ExecuteFunc("s__Spell_PluginSpellEffect__Event__onInit") -call ExecuteFunc("s__RegisterNativeEvent__NativeEvent_RegisterNativeEvent__NativeEventInit___onInit") +call ExecuteFunc("s__RegisterNativeEvent__NativeEvent_RegisterNativeEvent__NativeEventInit__onInit") -call ExecuteFunc("s__SpellEffectEvent__S_SpellEffectEvent__M___onInit") +call ExecuteFunc("s__SpellEffectEvent__S_SpellEffectEvent__M__onInit") @@ -215549,11 +211703,11 @@ call ExecuteFunc("s__SpellEffectEvent__S_SpellEffectEvent__M___onInit") -call ExecuteFunc("s__TurretSystem__S_TurretSystem__Init___onInit") +call ExecuteFunc("s__TurretSystem__S_TurretSystem__Init__onInit") -call ExecuteFunc("s__UnitDex_UnitDex___UnitDexCore___onInit") +call ExecuteFunc("s__UnitDex_UnitDex__UnitDexCore__onInit") -call ExecuteFunc("s__UnitGroupRespawnSystemConfig___S_UnitGroupRespawnSystemConfig___Init___onInit") +call ExecuteFunc("s__UnitGroupRespawnSystemConfig__S_UnitGroupRespawnSystemConfig__Init__onInit") @@ -215577,7 +211731,7 @@ call ExecuteFunc("s__UnitGroupRespawnSystemConfig___S_UnitGroupRespawnSystemConf -call ExecuteFunc("s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onInit") +call ExecuteFunc("s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore__onInit") diff --git a/wowr.w3x/war3map.w3i b/wowr.w3x/war3map.w3i index bf9076ee..3db71f6e 100644 Binary files a/wowr.w3x/war3map.w3i and b/wowr.w3x/war3map.w3i differ diff --git a/wowr.w3x/war3map.wct b/wowr.w3x/war3map.wct index 99d51a36..6a03238d 100644 Binary files a/wowr.w3x/war3map.wct and b/wowr.w3x/war3map.wct differ diff --git a/wowr.w3x/war3map.wtg b/wowr.w3x/war3map.wtg index 85db8d48..5f989156 100644 Binary files a/wowr.w3x/war3map.wtg and b/wowr.w3x/war3map.wtg differ diff --git a/wowr.w3x/war3mapMisc.txt b/wowr.w3x/war3mapMisc.txt index 8415ab28..3fd8c3db 100644 --- a/wowr.w3x/war3mapMisc.txt +++ b/wowr.w3x/war3mapMisc.txt @@ -43,19 +43,19 @@ ReviveTimeFactor=1.0 UpkeepUsage=150,250,10000,10000,10000,10000,10000,10000,10000,10000 [TALT] -DependencyOr=o08Q,o03U,o0AU,o0AG,o0A0,o09D,n0KD,h0UD,h0TN,o082,h0R1,o07B,e025,h0QM,n0FZ,o05O,h0J0,h0OF,u01U,h0ME,o052,o02P,h0A7,o02P,h05A,h01R,ndh2,u008,halt,oalt,eate,uaod,nnad,o00T,h033,h042,h0GH,h007,h00K,h00J +DependencyOr=h08J,o08Q,o03U,o0AU,o0AG,o0A0,o09D,n0KD,h0UD,h0TN,o082,h0R1,o07B,e025,h0QM,n0FZ,o05O,h0J0,h0OF,u01U,h0ME,o052,o02P,h0A7,o02P,h05A,h01R,ndh2,u008,halt,oalt,eate,uaod,nnad,o00T,h033,h042,h0GH,h007,h00K,h00J [TWN1] -DependencyOr=o08P,o03M,h05X,o071,o06V,o08R,o070,o08V,n0IO,h0S3,o07P,h0QY,o06C,n0GX,h0JX,n0FP,o05N,h0IU,h0IA,u01Q,h0LX,o029,o029,o02M,h06D,h051,h057,n05M,n026,ndh2,h00J,u005,htow,ogre,etol,unpl,o00O,h02R,h040 +DependencyOr=h08F,o08P,o03M,h05X,o071,o06V,o08R,o070,o08V,n0IO,h0S3,o07P,h0QY,o06C,n0GX,h0JX,n0FP,o05N,h0IU,h0IA,u01Q,h0LX,o029,o029,o02M,h06D,h051,h057,n05M,n026,ndh2,h00J,u005,htow,ogre,etol,unpl,o00O,h02R,h040 Name=Tier 1 Hall [TWN2] -DependencyOr=o041,o03R,h05Y,o0B0,o0AI,o09Y,o09A,o092,n0JJ,h0TE,o089,h0RC,o073,n0GY,h0KB,n0G6,o05Y,h0IZ,h0IB,u023,h0MC,o02A,o037,o02A,h0AC,h051,h05I,n026,ndh2,h00K,u00E,h00A,hkee,ostr,etoa,unp1,nntt,o022,h030,h03Z +DependencyOr=h08U,o041,o03R,h05Y,o0B0,o0AI,o09Y,o09A,o092,n0JJ,h0TE,o089,h0RC,o073,n0GY,h0KB,n0G6,o05Y,h0IZ,h0IB,u023,h0MC,o02A,o037,o02A,h0AC,h051,h05I,n026,ndh2,h00K,u00E,h00A,hkee,ostr,etoa,unp1,nntt,o022,h030,h03Z Name=Tier 2 Hall XPFactor=0 [TWN3] -DependencyOr=o044,o03S,h05Z,o0B1,o0AJ,o09Z,o09F,o093,n0JK,h0TF,o08A,h0RD,o074,n0GZ,h0KE,n0G5,o05Z,h0IV,h0IC,u024,h0MD,o02B,o038,o02B,h0AD,h051,h05J,n026,ndh2,h00L,u00F,h00B,hcas,ofrt,etoe,unp2,n05N,o023,h031,h041 +DependencyOr=h08V,o044,o03S,h05Z,o0B1,o0AJ,o09Z,o09F,o093,n0JK,h0TF,o08A,h0RD,o074,n0GZ,h0KE,n0G5,o05Z,h0IV,h0IC,u024,h0MD,o02B,o038,o02B,h0AD,h051,h05J,n026,ndh2,h00L,u00F,h00B,hcas,ofrt,etoe,unp2,n05N,o023,h031,h041 Name=Tier 3 Hall XPFactor=0