diff --git a/wowr.w3x/war3map.j b/wowr.w3x/war3map.j index 3377bbea..09bb29b9 100644 --- a/wowr.w3x/war3map.j +++ b/wowr.w3x/war3map.j @@ -7,10 +7,10 @@ constant boolean LIBRARY_Alloc=true //endglobals from Alloc //globals from Ascii: constant boolean LIBRARY_Ascii=true -integer array Ascii__i -integer array Ascii__h -integer array Ascii__y -string array Ascii__c +integer array Ascii___i +integer array Ascii___h +integer array Ascii___y +string array Ascii___c //endglobals from Ascii //globals from Attributes: constant boolean LIBRARY_Attributes=true @@ -27,39 +27,39 @@ constant string BlackArrowSystem_ORDER_OFF= "blackarrowoff" constant boolean BlackArrowSystem_ADD_STANDARD_OBJECT_DATA= true constant boolean BlackArrowSystem_ADD_ALL_UNITS_WITH_ORBS= true -integer array BlackArrowSystem___BlackArrowAbiliyId -integer array BlackArrowSystem___BlackArrowAbiliyLevel -integer array BlackArrowSystem___BlackArrowAbiliySummonedUnitTypeId -integer array BlackArrowSystem___BlackArrowAbiliySummonedUnitsCount -real array BlackArrowSystem___BlackArrowAbiliySummonedUnitDuration -real array BlackArrowSystem___BlackArrowAbiliyDurationHero -real array BlackArrowSystem___BlackArrowAbiliyDurationUnit -integer array BlackArrowSystem___BlackArrowAbiliyBuffId -integer BlackArrowSystem___BlackArrowAbilityCounter= 1 - -integer array BlackArrowSystem___BlackArrowItemTypeId -integer array BlackArrowSystem___BlackArrowItemTypeAbilityIndex -integer BlackArrowSystem___BlackArrowItemTypeCounter= 1 - -hashtable BlackArrowSystem___BlackArrowHashTable= InitHashtable() -group BlackArrowSystem___BlackArrowTargets= CreateGroup() -group BlackArrowSystem___BlackArrowAutoCasters= CreateGroup() -group BlackArrowSystem___BlackArrowItemUnits= CreateGroup() -trigger BlackArrowSystem___BlackArrowDamageTrigger= CreateTrigger() -trigger BlackArrowSystem___BlackArrowDeathTrigger= CreateTrigger() -trigger BlackArrowSystem___BlackArrowOrderTrigger= CreateTrigger() -trigger BlackArrowSystem___BlackArrowItemPickupTrigger= CreateTrigger() -trigger BlackArrowSystem___BlackArrowItemDropTrigger= CreateTrigger() +integer array BlackArrowSystem__BlackArrowAbiliyId +integer array BlackArrowSystem__BlackArrowAbiliyLevel +integer array BlackArrowSystem__BlackArrowAbiliySummonedUnitTypeId +integer array BlackArrowSystem__BlackArrowAbiliySummonedUnitsCount +real array BlackArrowSystem__BlackArrowAbiliySummonedUnitDuration +real array BlackArrowSystem__BlackArrowAbiliyDurationHero +real array BlackArrowSystem__BlackArrowAbiliyDurationUnit +integer array BlackArrowSystem__BlackArrowAbiliyBuffId +integer BlackArrowSystem__BlackArrowAbilityCounter= 1 + +integer array BlackArrowSystem__BlackArrowItemTypeId +integer array BlackArrowSystem__BlackArrowItemTypeAbilityIndex +integer BlackArrowSystem__BlackArrowItemTypeCounter= 1 + +hashtable BlackArrowSystem__BlackArrowHashTable= InitHashtable() +group BlackArrowSystem__BlackArrowTargets= CreateGroup() +group BlackArrowSystem__BlackArrowAutoCasters= CreateGroup() +group BlackArrowSystem__BlackArrowItemUnits= CreateGroup() +trigger BlackArrowSystem__BlackArrowDamageTrigger= CreateTrigger() +trigger BlackArrowSystem__BlackArrowDeathTrigger= CreateTrigger() +trigger BlackArrowSystem__BlackArrowOrderTrigger= CreateTrigger() +trigger BlackArrowSystem__BlackArrowItemPickupTrigger= CreateTrigger() +trigger BlackArrowSystem__BlackArrowItemDropTrigger= CreateTrigger() // callbacks -unit BlackArrowSystem___BlackArrowCaster= null -unit BlackArrowSystem___BlackArrowTarget= null -group BlackArrowSystem___BlackArrowSummonedUnits= null -integer BlackArrowSystem___BlackArrowAbilityId= 0 -trigger array BlackArrowSystem___BlackArrowCallbackTrigger -integer BlackArrowSystem___BlackArrowCallbackTriggerCounter= 0 - -boolean BlackArrowSystem___hookEnabled= true +unit BlackArrowSystem__BlackArrowCaster= null +unit BlackArrowSystem__BlackArrowTarget= null +group BlackArrowSystem__BlackArrowSummonedUnits= null +integer BlackArrowSystem__BlackArrowAbilityId= 0 +trigger array BlackArrowSystem__BlackArrowCallbackTrigger +integer BlackArrowSystem__BlackArrowCallbackTriggerCounter= 0 + +boolean BlackArrowSystem__hookEnabled= true //endglobals from BlackArrowSystem //globals from BookOfFastTravel: constant boolean LIBRARY_BookOfFastTravel=true @@ -73,34 +73,34 @@ constant boolean LIBRARY_BoundSentinel=true // // I think you need 0.0 or soemthing negative prior to patch 1.22 // -constant real BoundSentinel__EXTRA= 500.0 -real BoundSentinel__maxx -real BoundSentinel__maxy -real BoundSentinel__minx -real BoundSentinel__miny +constant real BoundSentinel___EXTRA= 500.0 +real BoundSentinel___maxx +real BoundSentinel___maxy +real BoundSentinel___minx +real BoundSentinel___miny //endglobals from BoundSentinel //globals from CTL: constant boolean LIBRARY_CTL=true -integer CTL__tgc= 0 -integer array CTL__tgr +integer CTL___tgc= 0 +integer array CTL___tgr -integer CTL__ic=0 -integer CTL__tc=0 -integer array CTL__rf -integer array CTL__n -integer array CTL__p -integer array CTL__th -integer array CTL__ns -trigger CTL__t=CreateTrigger() -timer CTL__m=CreateTimer() -triggercondition array CTL__ct -conditionfunc array CTL__rc +integer CTL___ic=0 +integer CTL___tc=0 +integer array CTL___rf +integer array CTL___n +integer array CTL___p +integer array CTL___th +integer array CTL___ns +trigger CTL___t=CreateTrigger() +timer CTL___m=CreateTimer() +triggercondition array CTL___ct +conditionfunc array CTL___rc -boolean array CTL__e32 -integer array CTL__i32r -integer CTL__i32cr= 0 -boolean array CTL__ir32 -boolean array CTL__id32 +boolean array CTL___e32 +integer array CTL___i32r +integer CTL___i32cr= 0 +boolean array CTL___ir32 +boolean array CTL___id32 //endglobals from CTL //globals from CopyGroup: constant boolean LIBRARY_CopyGroup=true @@ -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 @@ -136,17 +136,17 @@ constant integer SOUND_TYPE_RESEARCH_COMPLETE= 15 constant integer SOUND_TYPE_UPGRADE_COMPLETE= 16 constant integer MAX_SOUND_TYPES= 17 -sound array CustomRaceSoundSystem___customRaceSound -integer array CustomRaceSoundSystem___playerCustomRace +sound array CustomRaceSoundSystem__customRaceSound +integer array CustomRaceSoundSystem__playerCustomRace -trigger CustomRaceSoundSystem___researchTrigger= CreateTrigger() -trigger CustomRaceSoundSystem___upgradeTrigger= CreateTrigger() +trigger CustomRaceSoundSystem__researchTrigger= CreateTrigger() +trigger CustomRaceSoundSystem__upgradeTrigger= CreateTrigger() // TODO create sound handles for all default UI sounds. -sound CustomRaceSoundSystem___humanResearchCompleteSound= CreateSound("Sound\\Buildings\\Human\\KnightResearchComplete1.flac", false, false, true, 12700, 12700, "") -sound CustomRaceSoundSystem___orcResearchCompleteSound= CreateSound("Sound\\Buildings\\Orc\\GruntResearchComplete1.flac", false, false, true, 12700, 12700, "") -sound CustomRaceSoundSystem___undeadResearchCompleteSound= CreateSound("Sound\\Buildings\\Undead\\NecromancerResearchComplete1.flac", false, false, true, 12700, 12700, "") -sound CustomRaceSoundSystem___nightElfResearchCompleteSound= CreateSound("Sound\\Buildings\\NightElf\\SentinelResearchComplete1.flac", false, false, true, 12700, 12700, "") +sound CustomRaceSoundSystem__humanResearchCompleteSound= CreateSound("Sound\\Buildings\\Human\\KnightResearchComplete1.flac", false, false, true, 12700, 12700, "") +sound CustomRaceSoundSystem__orcResearchCompleteSound= CreateSound("Sound\\Buildings\\Orc\\GruntResearchComplete1.flac", false, false, true, 12700, 12700, "") +sound CustomRaceSoundSystem__undeadResearchCompleteSound= CreateSound("Sound\\Buildings\\Undead\\NecromancerResearchComplete1.flac", false, false, true, 12700, 12700, "") +sound CustomRaceSoundSystem__nightElfResearchCompleteSound= CreateSound("Sound\\Buildings\\NightElf\\SentinelResearchComplete1.flac", false, false, true, 12700, 12700, "") //endglobals from CustomRaceSoundSystem //globals from Dices: constant boolean LIBRARY_Dices=true @@ -167,24 +167,24 @@ constant boolean LIBRARY_FileIO=true // // This setting is really only intended for those who were already using the system in their map // prior to patch 1.31 and want to keep old files created with this system to still work. -constant boolean FileIO__BACKWARDS_COMPATABILITY= false +constant boolean FileIO___BACKWARDS_COMPATABILITY= false //endglobals from FileIO //globals from FileUtils: constant boolean LIBRARY_FileUtils=true //endglobals from FileUtils //globals from FloatingTextArc: constant boolean LIBRARY_FloatingTextArc=true -constant real FloatingTextArc__SIZE_MIN= 0.014 -constant real FloatingTextArc__SIZE_BONUS= 0.000 -constant real FloatingTextArc__TIME_LIFE= 1.0 -constant real FloatingTextArc__TIME_FADE= 0.3 -constant real FloatingTextArc__Z_OFFSET= 50 -constant real FloatingTextArc__Z_OFFSET_BON= 50 -constant real FloatingTextArc__VELOCITY= 2 -constant real FloatingTextArc__ANGLE= bj_PI / 2 +constant real FloatingTextArc___SIZE_MIN= 0.014 +constant real FloatingTextArc___SIZE_BONUS= 0.000 +constant real FloatingTextArc___TIME_LIFE= 1.0 +constant real FloatingTextArc___TIME_FADE= 0.3 +constant real FloatingTextArc___Z_OFFSET= 50 +constant real FloatingTextArc___Z_OFFSET_BON= 50 +constant real FloatingTextArc___VELOCITY= 2 +constant real FloatingTextArc___ANGLE= bj_PI / 2 // ANGLE_RND is true -constant boolean FloatingTextArc__ANGLE_RND= true -timer FloatingTextArc__TMR= CreateTimer() +constant boolean FloatingTextArc___ANGLE_RND= true +timer FloatingTextArc___TMR= CreateTimer() //endglobals from FloatingTextArc //globals from ForceUtils: constant boolean LIBRARY_ForceUtils=true @@ -200,21 +200,21 @@ timer FrameLoader___t= CreateTimer() //endglobals from FrameLoader //globals from FrameSaver: constant boolean LIBRARY_FrameSaver=true -constant real FrameSaver__DELAY= 5.0 -trigger FrameSaver__saveTrigger= CreateTrigger() -trigger FrameSaver__loadTrigger= CreateTrigger() -trigger FrameSaver__afterSaveTrigger= CreateTrigger() -timer FrameSaver__t= CreateTimer() +constant real FrameSaver___DELAY= 5.0 +trigger FrameSaver___saveTrigger= CreateTrigger() +trigger FrameSaver___loadTrigger= CreateTrigger() +trigger FrameSaver___afterSaveTrigger= CreateTrigger() +timer FrameSaver___t= CreateTimer() //endglobals from FrameSaver //globals from GameStatus: constant boolean LIBRARY_GameStatus=true // The dummy unit is only created once, and removed directly after. -constant integer GameStatus__DUMMY_UNIT_ID= 'hfoo' +constant integer GameStatus___DUMMY_UNIT_ID= 'hfoo' constant integer GAME_STATUS_OFFLINE= 0 constant integer GAME_STATUS_ONLINE= 1 constant integer GAME_STATUS_REPLAY= 2 -integer GameStatus__status= 0 +integer GameStatus___status= 0 //endglobals from GameStatus //globals from GenerateIds: constant boolean LIBRARY_GenerateIds=true @@ -232,27 +232,27 @@ constant boolean LIBRARY_GetSingleSelectedUnit=true constant boolean LIBRARY_GroupUtils=true //If you don't have xebasic in your map, this value will be used instead. //This value corresponds to the max collision size of a unit in your map. -constant real GroupUtils__MAX_COLLISION_SIZE= 197. +constant real GroupUtils___MAX_COLLISION_SIZE= 197. //If you are insane and don't care about any of the protection involved in //this library, but want this script to be really fast, set this to true. -constant boolean GroupUtils__LESS_SAFETY= false +constant boolean GroupUtils___LESS_SAFETY= false //* Constants that are available to the user group ENUM_GROUP= CreateGroup() boolexpr BOOLEXPR_TRUE= null boolexpr BOOLEXPR_FALSE= null //* Hashtable for debug purposes -hashtable GroupUtils__ht= InitHashtable() +hashtable GroupUtils___ht= InitHashtable() //* Temporary references for GroupRefresh -boolean GroupUtils__Flag= false -group GroupUtils__Refr= null +boolean GroupUtils___Flag= false +group GroupUtils___Refr= null //* Arrays and counter for the group stack -group array GroupUtils__Groups -integer GroupUtils__Count= 0 +group array GroupUtils___Groups +integer GroupUtils___Count= 0 //* Variables for use with the GroupUnitsInArea function -real GroupUtils__X= 0. -real GroupUtils__Y= 0. -real GroupUtils__R= 0. -hashtable GroupUtils__H= InitHashtable() +real GroupUtils___X= 0. +real GroupUtils___Y= 0. +real GroupUtils___R= 0. +hashtable GroupUtils___H= InitHashtable() //endglobals from GroupUtils //globals from HeroReviveCancelEvent: constant boolean LIBRARY_HeroReviveCancelEvent=true @@ -289,8 +289,8 @@ constant boolean IdleWorkersSystem_EXCLUDE_LOADED_TARGETS= true // Removes idle workers from the idle worker groups automatically when they are removed from the game. constant boolean IdleWorkersSystem_HOOK_REMOVE_UNIT= true -timer IdleWorkersSystem___orderDetectionTimer= CreateTimer() -group array IdleWorkersSystem___idleWorkers +timer IdleWorkersSystem__orderDetectionTimer= CreateTimer() +group array IdleWorkersSystem__idleWorkers //endglobals from IdleWorkersSystem //globals from Indexer: constant boolean LIBRARY_Indexer=true @@ -310,36 +310,36 @@ constant integer ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEMPOOL= 1 constant integer ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_LEVEL= 2 constant integer ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_TYPE_AND_LEVEL= 3 -integer ItemRespawnSystem___respawnItemCounter= 0 -integer ItemRespawnSystem___respawnItemFreeIndex= 0 -boolean array ItemRespawnSystem___respawnItemIsValid -integer array ItemRespawnSystem___respawnItemType -item array ItemRespawnSystem___respawnItemItem -integer array ItemRespawnSystem___respawnItemHandleId -integer array ItemRespawnSystem___respawnItemItemTypeId -itempool array ItemRespawnSystem___respawnItemPool -integer array ItemRespawnSystem___respawnItemRandomLevel -itemtype array ItemRespawnSystem___respawnItemRandomType -real array ItemRespawnSystem___respawnItemX -real array ItemRespawnSystem___respawnItemY -timer array ItemRespawnSystem___respawnItemTimer -real array ItemRespawnSystem___respawnItemTimeout -boolean array ItemRespawnSystem___respawnItemEnabled -trigger array ItemRespawnSystem___respawnItemDeathTrigger - -integer ItemRespawnSystem___callbackRespawnTriggersCounter= 0 -trigger array ItemRespawnSystem___callbackRespawnTriggers - -integer ItemRespawnSystem___callbackRespawnStartsTriggersCounter= 0 -trigger array ItemRespawnSystem___callbackRespawnStartsTriggers - -item ItemRespawnSystem___callbackItem= null -integer ItemRespawnSystem___callbackIndex= - 1 - -trigger ItemRespawnSystem___pickupItemTrigger= CreateTrigger() -hashtable ItemRespawnSystem___respawnItemHashTable= InitHashtable() -integer ItemRespawnSystem___evaluateIndex= - 1 -trigger ItemRespawnSystem___refreshEvaluateTrigger= CreateTrigger() +integer ItemRespawnSystem__respawnItemCounter= 0 +integer ItemRespawnSystem__respawnItemFreeIndex= 0 +boolean array ItemRespawnSystem__respawnItemIsValid +integer array ItemRespawnSystem__respawnItemType +item array ItemRespawnSystem__respawnItemItem +integer array ItemRespawnSystem__respawnItemHandleId +integer array ItemRespawnSystem__respawnItemItemTypeId +itempool array ItemRespawnSystem__respawnItemPool +integer array ItemRespawnSystem__respawnItemRandomLevel +itemtype array ItemRespawnSystem__respawnItemRandomType +real array ItemRespawnSystem__respawnItemX +real array ItemRespawnSystem__respawnItemY +timer array ItemRespawnSystem__respawnItemTimer +real array ItemRespawnSystem__respawnItemTimeout +boolean array ItemRespawnSystem__respawnItemEnabled +trigger array ItemRespawnSystem__respawnItemDeathTrigger + +integer ItemRespawnSystem__callbackRespawnTriggersCounter= 0 +trigger array ItemRespawnSystem__callbackRespawnTriggers + +integer ItemRespawnSystem__callbackRespawnStartsTriggersCounter= 0 +trigger array ItemRespawnSystem__callbackRespawnStartsTriggers + +item ItemRespawnSystem__callbackItem= null +integer ItemRespawnSystem__callbackIndex= - 1 + +trigger ItemRespawnSystem__pickupItemTrigger= CreateTrigger() +hashtable ItemRespawnSystem__respawnItemHashTable= InitHashtable() +integer ItemRespawnSystem__evaluateIndex= - 1 +trigger ItemRespawnSystem__refreshEvaluateTrigger= CreateTrigger() //endglobals from ItemRespawnSystem //globals from ItemTypeUtils: constant boolean LIBRARY_ItemTypeUtils=true @@ -366,7 +366,7 @@ constant boolean LIBRARY_LineSegmentEnumeration=true //endglobals from LineSegmentEnumeration //globals from LinkedList: constant boolean LIBRARY_LinkedList=true -constant boolean LinkedList__THROW_ERRORS= true +constant boolean LinkedList___THROW_ERRORS= true //endglobals from LinkedList //globals from ListModule: constant boolean LIBRARY_ListModule=true @@ -377,16 +377,16 @@ constant boolean LIBRARY_LocationUtils=true //globals from MaxItemStacks: constant boolean LIBRARY_MaxItemStacks=true // This dummy is created and hidden once only if CHECK_MAX_STACKS is set to true. It requires an inventory with at least 2 slots. -constant integer MaxItemStacks___DUMMY_UNIT_TYPE_MAX_CHECKS= 'Hpal' +constant integer MaxItemStacks__DUMMY_UNIT_TYPE_MAX_CHECKS= 'Hpal' // Warcraft III has a limit of number of stacks for the field "Stats - Max Stacks" ('ista'). -constant integer MaxItemStacks___MAX_STACKS_ALLOWED= 1000 -constant real MaxItemStacks___DUMMY_X= 0.0 -constant real MaxItemStacks___DUMMY_Y= 0.0 - -integer MaxItemStacks___stackCounter= 0 -hashtable MaxItemStacks___stackHashTable= InitHashtable() -unit MaxItemStacks___stackItemDummy= null -trigger MaxItemStacks___stackItemTrigger= CreateTrigger() +constant integer MaxItemStacks__MAX_STACKS_ALLOWED= 1000 +constant real MaxItemStacks__DUMMY_X= 0.0 +constant real MaxItemStacks__DUMMY_Y= 0.0 + +integer MaxItemStacks__stackCounter= 0 +hashtable MaxItemStacks__stackHashTable= InitHashtable() +unit MaxItemStacks__stackItemDummy= null +trigger MaxItemStacks__stackItemTrigger= CreateTrigger() //endglobals from MaxItemStacks //globals from MouseUtils: constant boolean LIBRARY_MouseUtils=true @@ -419,9 +419,9 @@ 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 @@ -435,11 +435,11 @@ trigger Reflection___damageTrigger= CreateTrigger() //endglobals from Reflection //globals from RegisterPlayerUnitEvent: constant boolean LIBRARY_RegisterPlayerUnitEvent=true -trigger array RegisterPlayerUnitEvent__t +trigger array RegisterPlayerUnitEvent___t //endglobals from RegisterPlayerUnitEvent //globals from SimError: constant boolean LIBRARY_SimError=true -sound SimError__error +sound SimError___error //endglobals from SimError //globals from SoundUtils: constant boolean LIBRARY_SoundUtils=true @@ -449,22 +449,22 @@ constant boolean LIBRARY_StringUtils=true //endglobals from StringUtils //globals from Table: constant boolean LIBRARY_Table=true -integer Table__less= 0 -integer Table__more= 8190 +integer Table___less= 0 +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=8 -constant integer Table__listK=10 +hashtable Table___ht= InitHashtable() +constant integer Table___sizeK=12 +constant integer Table___listK=14 //endglobals from Table //globals from TerrainPathability: constant boolean LIBRARY_TerrainPathability=true -constant real TerrainPathability__MAX_RANGE= 10. -constant integer TerrainPathability__DUMMY_ITEM_ID= 'wolg' -item TerrainPathability__Item= null -rect TerrainPathability__Find= null -item array TerrainPathability__Hid -integer TerrainPathability__HidMax= 0 +constant real TerrainPathability___MAX_RANGE= 10. +constant integer TerrainPathability___DUMMY_ITEM_ID= 'wolg' +item TerrainPathability___Item= null +rect TerrainPathability___Find= null +item array TerrainPathability___Hid +integer TerrainPathability___HidMax= 0 real TerrainPathability_X= 0. real TerrainPathability_Y= 0. //endglobals from TerrainPathability @@ -492,28 +492,28 @@ constant boolean LIBRARY_TimerUtils=true // * THE LEAST SAFE ( you may have to tweak OFSSET manually for it to // work) // -constant boolean TimerUtils__USE_HASH_TABLE= true -constant boolean TimerUtils__USE_FLEXIBLE_OFFSET= false +constant boolean TimerUtils___USE_HASH_TABLE= true +constant boolean TimerUtils___USE_FLEXIBLE_OFFSET= false -constant integer TimerUtils__OFFSET= 0x100000 -integer TimerUtils__VOFFSET= TimerUtils__OFFSET +constant integer TimerUtils___OFFSET= 0x100000 +integer TimerUtils___VOFFSET= TimerUtils___OFFSET //Timers to preload at map init: -constant integer TimerUtils__QUANTITY= 256 +constant integer TimerUtils___QUANTITY= 256 //Changing this to something big will allow you to keep recycling // timers even when there are already AN INCREDIBLE AMOUNT of timers in // the stack. But it will make things far slower so that's probably a bad idea... -constant integer TimerUtils__ARRAY_SIZE= 8190 +constant integer TimerUtils___ARRAY_SIZE= 8190 -// processed: integer array TimerUtils__data[TimerUtils__ARRAY_SIZE] -hashtable TimerUtils__ht -// processed: timer array TimerUtils__tT[TimerUtils__ARRAY_SIZE] -integer TimerUtils__tN= 0 -constant integer TimerUtils__HELD=0x28829022 +// processed: integer array TimerUtils___data[TimerUtils___ARRAY_SIZE] +hashtable TimerUtils___ht +// processed: timer array TimerUtils___tT[TimerUtils___ARRAY_SIZE] +integer TimerUtils___tN= 0 +constant integer TimerUtils___HELD=0x28829022 //use a totally random number here, the more improbable someone uses it, the better. -boolean TimerUtils__didinit= false +boolean TimerUtils___didinit= false //endglobals from TimerUtils //globals from TreeUtils: constant boolean LIBRARY_TreeUtils=true @@ -820,7 +820,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 @@ -843,7 +843,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 @@ -852,10 +852,10 @@ 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 @@ -870,78 +870,78 @@ 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 // The number of charges which are unstacked at maximum if available. -constant integer ItemUnstackSystem___MAX_UNSTACKED_CHARGES= 1 +constant integer ItemUnstackSystem__MAX_UNSTACKED_CHARGES= 1 // Overwrites the previous value if set to true. It always unstacks the half of charges. For uneven numbers it will unstack the lower value. For example, for 3 it will unstack 1 charge. -constant boolean ItemUnstackSystem___UNSTACK_HALF_CHARGES= false +constant boolean ItemUnstackSystem__UNSTACK_HALF_CHARGES= false // Unstacking an item can be moved to the next slot if it has the same item type and stack with it. -constant boolean ItemUnstackSystem___ALLOW_STACKING_NEXT_ITEM= true +constant boolean ItemUnstackSystem__ALLOW_STACKING_NEXT_ITEM= true // This option only has an effect is ALLOW_STACKING_NEXT_ITEM is true. The unstacked item might be stacked to an item in a previous slot in the inventory if this option is true. -constant boolean ItemUnstackSystem___STACKING_NEXT_ITEM_FROM_START= true +constant boolean ItemUnstackSystem__STACKING_NEXT_ITEM_FROM_START= true // Checks for the maximum possible stacks for every item type. Otherwise, ItemUnstackItemGetMaxStacks is used. -constant boolean ItemUnstackSystem___CHECK_MAX_STACKS= true +constant boolean ItemUnstackSystem__CHECK_MAX_STACKS= true -trigger ItemUnstackSystem___orderTrigger= CreateTrigger() -group ItemUnstackSystem___disabledUnits= CreateGroup() +trigger ItemUnstackSystem__orderTrigger= CreateTrigger() +group ItemUnstackSystem__disabledUnits= CreateGroup() //endglobals from ItemUnstackSystem //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 constant real Knockback_TIMER_INTERVAL= 0.03125 -constant real Knockback__STANDARD_DEST_RADIUS= 100.00 -constant real Knockback__STANDARD_UNIT_RADIUS= 75.00 -constant boolean Knockback__STOP_WHEN_IMPASSABLE= false -constant boolean Knockback__USE_KNOCKBACK_EFFECTS= true +constant real Knockback___STANDARD_DEST_RADIUS= 100.00 +constant real Knockback___STANDARD_UNIT_RADIUS= 75.00 +constant boolean Knockback___STOP_WHEN_IMPASSABLE= false +constant boolean Knockback___USE_KNOCKBACK_EFFECTS= true //will only be used, if USE_KNOCKBACK_EFFECTS is true -constant string Knockback__EARTH_EFFECT= "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" -constant string Knockback__WATER_EFFECT= "Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl" -constant string Knockback__KNOCKBACK_EFFECT_ATTACHPOINT= "origin" -constant boolean Knockback__IGNORE_FLYING_UNITS= true +constant string Knockback___EARTH_EFFECT= "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" +constant string Knockback___WATER_EFFECT= "Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl" +constant string Knockback___KNOCKBACK_EFFECT_ATTACHPOINT= "origin" +constant boolean Knockback___IGNORE_FLYING_UNITS= true //endglobals from Knockback //globals from MassSpell: @@ -949,18 +949,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 @@ -997,12 +997,12 @@ 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 -integer RegisterNativeEvent__eventIndex= 500 +integer RegisterNativeEvent___eventIndex= 500 //endglobals from RegisterNativeEvent //globals from Resources: constant boolean LIBRARY_Resources=true @@ -1086,8 +1086,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 @@ -1101,10 +1101,10 @@ constant real REAL_SECONDS_PER_DAY= 480.0 constant boolean LIBRARY_TimedHandles=true // If you don't want a timer to be ran each instance // set this to true. -constant boolean TimedHandles__SINGLE_TIMER= true +constant boolean TimedHandles___SINGLE_TIMER= true // If you chose a single timer then this will be the speed // at which the timer will update -constant real TimedHandles__UPDATE_PERIOD= 0.05 +constant real TimedHandles___UPDATE_PERIOD= 0.05 //endglobals from TimedHandles //globals from TinyBuildingsLimits: constant boolean LIBRARY_TinyBuildingsLimits=true @@ -1114,59 +1114,59 @@ hashtable TinyBuildingsLimits___h= InitHashtable() //globals from TurretSystem: constant boolean LIBRARY_TurretSystem=true // vehicle keys -constant integer TurretSystem___TURRET_SYSTEM_KEY_TURRETS= 0 -constant integer TurretSystem___TURRET_SYSTEM_KEY_TARGET= 1 +constant integer TurretSystem__TURRET_SYSTEM_KEY_TURRETS= 0 +constant integer TurretSystem__TURRET_SYSTEM_KEY_TARGET= 1 // turret keys -constant integer TurretSystem___TURRET_SYSTEM_KEY_VEHICLE= 0 -constant integer TurretSystem___TURRET_SYSTEM_KEY_OFFSET_X= 1 -constant integer TurretSystem___TURRET_SYSTEM_KEY_OFFSET_Y= 2 -constant integer TurretSystem___TURRET_SYSTEM_KEY_AUTO_ATTACK= 3 -constant integer TurretSystem___TURRET_SYSTEM_KEY_VEHICLE_DAMAGE= 4 -constant integer TurretSystem___TURRET_SYSTEM_KEY_ENABLED= 5 -constant integer TurretSystem___TURRET_SYSTEM_KEY_TURRET_TARGET= 6 -constant integer TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE= 7 -constant integer TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET= 8 +constant integer TurretSystem__TURRET_SYSTEM_KEY_VEHICLE= 0 +constant integer TurretSystem__TURRET_SYSTEM_KEY_OFFSET_X= 1 +constant integer TurretSystem__TURRET_SYSTEM_KEY_OFFSET_Y= 2 +constant integer TurretSystem__TURRET_SYSTEM_KEY_AUTO_ATTACK= 3 +constant integer TurretSystem__TURRET_SYSTEM_KEY_VEHICLE_DAMAGE= 4 +constant integer TurretSystem__TURRET_SYSTEM_KEY_ENABLED= 5 +constant integer TurretSystem__TURRET_SYSTEM_KEY_TURRET_TARGET= 6 +constant integer TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE= 7 +constant integer TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET= 8 // vehicle and turret keys -constant integer TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE= 9 -constant integer TurretSystem___TURRET_SYSTEM_KEY_ORDER= 10 -constant integer TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET= 11 -constant integer TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET_X= 12 -constant integer TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET_Y= 13 +constant integer TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE= 9 +constant integer TurretSystem__TURRET_SYSTEM_KEY_ORDER= 10 +constant integer TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET= 11 +constant integer TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET_X= 12 +constant integer TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET_Y= 13 // order types -constant integer TurretSystem___TURRET_SYSTEM_ORDER_TYPE_NO_TARGET= 0 -constant integer TurretSystem___TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET= 1 -constant integer TurretSystem___TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET= 2 -constant integer TurretSystem___TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET= 3 -constant integer TurretSystem___TURRET_SYSTEM_ORDER_TYPE_POINT_TARGET= 4 - -integer array TurretSystem___TurretSystemVehicleUnitTypeId -boolean array TurretSystem___TurretSystemVehicleCanAttack -boolean array TurretSystem___TurretSystemVehicleChangeFacing -string array TurretSystem___TurretSystemVehicleFacingBone -integer TurretSystem___TurretSystemVehicleCounter= 0 +constant integer TurretSystem__TURRET_SYSTEM_ORDER_TYPE_NO_TARGET= 0 +constant integer TurretSystem__TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET= 1 +constant integer TurretSystem__TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET= 2 +constant integer TurretSystem__TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET= 3 +constant integer TurretSystem__TURRET_SYSTEM_ORDER_TYPE_POINT_TARGET= 4 + +integer array TurretSystem__TurretSystemVehicleUnitTypeId +boolean array TurretSystem__TurretSystemVehicleCanAttack +boolean array TurretSystem__TurretSystemVehicleChangeFacing +string array TurretSystem__TurretSystemVehicleFacingBone +integer TurretSystem__TurretSystemVehicleCounter= 0 // callbacks -trigger array TurretSystem___TurretSystemCallbackAutoTargetTriggers -integer TurretSystem___TurretSystemCallbackAutoTargetTriggersCounter= 0 -unit TurretSystem___TurretSystemTriggerVehicle= null -unit TurretSystem___TurretSystemTriggerTurret= null -unit TurretSystem___TurretSystemTriggerTargetUnit= null -item TurretSystem___TurretSystemTriggerTargetItem= null -destructable TurretSystem___TurretSystemTriggerTargetDestructable= null - -hashtable TurretSystem___TurretSystemHashTable= InitHashtable() -group TurretSystem___TurretSystemAllVehicles= CreateGroup() -group TurretSystem___TurretSystemAllTurrets= CreateGroup() -timer TurretSystem___TurretSystemUpdateTimer= CreateTimer() -boolean TurretSystem___TurretSystemUpdatedTimerPaused= true -trigger TurretSystem___TurretSystemAttackTrigger= CreateTrigger() -trigger TurretSystem___TurretSystemDeathTrigger= CreateTrigger() -trigger TurretSystem___TurretSystemReviveTrigger= CreateTrigger() -trigger TurretSystem___TurretSystemOrderTrigger= CreateTrigger() -trigger TurretSystem___TurretSystemSelectionTrigger= CreateTrigger() +trigger array TurretSystem__TurretSystemCallbackAutoTargetTriggers +integer TurretSystem__TurretSystemCallbackAutoTargetTriggersCounter= 0 +unit TurretSystem__TurretSystemTriggerVehicle= null +unit TurretSystem__TurretSystemTriggerTurret= null +unit TurretSystem__TurretSystemTriggerTargetUnit= null +item TurretSystem__TurretSystemTriggerTargetItem= null +destructable TurretSystem__TurretSystemTriggerTargetDestructable= null + +hashtable TurretSystem__TurretSystemHashTable= InitHashtable() +group TurretSystem__TurretSystemAllVehicles= CreateGroup() +group TurretSystem__TurretSystemAllTurrets= CreateGroup() +timer TurretSystem__TurretSystemUpdateTimer= CreateTimer() +boolean TurretSystem__TurretSystemUpdatedTimerPaused= true +trigger TurretSystem__TurretSystemAttackTrigger= CreateTrigger() +trigger TurretSystem__TurretSystemDeathTrigger= CreateTrigger() +trigger TurretSystem__TurretSystemReviveTrigger= CreateTrigger() +trigger TurretSystem__TurretSystemOrderTrigger= CreateTrigger() +trigger TurretSystem__TurretSystemSelectionTrigger= CreateTrigger() //endglobals from TurretSystem //globals from UnitDex: constant boolean LIBRARY_UnitDex=true @@ -1175,10 +1175,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 @@ -1217,15 +1217,15 @@ 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 @@ -1269,16 +1269,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 @@ -1386,25 +1386,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 @@ -1412,11 +1412,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 @@ -1455,13 +1455,13 @@ constant real Missiles_PERIOD= 1. / 40. // process all missiles at once every period. constant real Missiles_SWEET_SPOT= 150 // the avarage collision size compensation when detecting collisions -constant real Missiles__COLLISION_SIZE= 128. +constant real Missiles___COLLISION_SIZE= 128. // item size used in z collision -constant real Missiles__ITEM_SIZE= 16. +constant real Missiles___ITEM_SIZE= 16. // Raw code of the dummy unit used for vision -constant integer Missiles__DUMMY= 'dumi' +constant integer Missiles___DUMMY= 'dumi' // Needed, don't touch. -location Missiles__LOC= Location(0., 0.) +location Missiles___LOC= Location(0., 0.) //endglobals from Missiles //globals from PagedButtons: constant boolean LIBRARY_PagedButtons=true @@ -1509,41 +1509,41 @@ 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 @@ -1619,19 +1619,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 @@ -1642,38 +1642,38 @@ constant boolean LIBRARY_UnitEventEx=true // CONFIGURATION // the transform detection ability. If DETECT_TRANSFORM is false, this is not needed. -constant integer UnitEventEx__DETECT_TRANSFORM_ABILITY= 'UEdt' +constant integer UnitEventEx___DETECT_TRANSFORM_ABILITY= 'UEdt' // toggles the detection of transform events. -constant boolean UnitEventEx__DETECT_TRANSFORM= false +constant boolean UnitEventEx___DETECT_TRANSFORM= false // toggles the detection of load/unload of cargo units, except for dead units (eg Meat Wagon's Exhume Corpse) -constant boolean UnitEventEx__DETECT_CARGO= true +constant boolean UnitEventEx___DETECT_CARGO= true // toggles the detection of unloading dead units in cargo (Exhume Corpse). Does nothing if DETECT_CARGO is false. -constant boolean UnitEventEx__DETECT_CARGO_DEAD= true +constant boolean UnitEventEx___DETECT_CARGO_DEAD= true // toggles the detection of when a unit begins and finishes reincarnating. -constant boolean UnitEventEx__DETECT_REINCARNATION= true +constant boolean UnitEventEx___DETECT_REINCARNATION= true // toggles the detection of when a unit is animated via animate dead. -constant boolean UnitEventEx__DETECT_ANIMATE_DEAD= true +constant boolean UnitEventEx___DETECT_ANIMATE_DEAD= true // toggles the detection of units that are brought back to life via resurrection. -constant boolean UnitEventEx__DETECT_RESURRECTION= false +constant boolean UnitEventEx___DETECT_RESURRECTION= false // this overrides reincarnation, animate dead and resurrection. Set to true if you want any of these events to work. // for some reason setting DETECT_REVIVES = (DETECT_REINCARNATION or DETECT_ANIMATE_DEAD or DETECT_RESURRECTION) does not work. -constant boolean UnitEventEx__DETECT_REVIVES= false +constant boolean UnitEventEx___DETECT_REVIVES= false // this particular event will run after a zero-second delay so that units are able to fully enter the creation scope. // it can be useful if you need something to run after both indexing and other events like EVENT_PLAYER_UNIT_CONSTRUCT_START -constant boolean UnitEventEx__DETECT_CREATION= false +constant boolean UnitEventEx___DETECT_CREATION= false // END CONFIGURATION -unit UnitEventEx__eventUnit= null -unit UnitEventEx__eventOther= null -integer UnitEventEx__eventPreType= 0 +unit UnitEventEx___eventUnit= null +unit UnitEventEx___eventOther= null +integer UnitEventEx___eventPreType= 0 integer EVENT_ON_TRANSFORM integer EVENT_ON_CARGO_LOAD @@ -1684,23 +1684,23 @@ integer EVENT_ON_REINCARNATION_START integer EVENT_ON_REINCARNATION_FINISH integer EVENT_ON_UNIT_CREATED -integer UnitEventEx__Stack= - 1 -unit array UnitEventEx__IndexedUnit -unit array UnitEventEx__CargoUnit -group array UnitEventEx__CargoGroup -unit array UnitEventEx__Transporter -integer array UnitEventEx__PreTransformType +integer UnitEventEx___Stack= - 1 +unit array UnitEventEx___IndexedUnit +unit array UnitEventEx___CargoUnit +group array UnitEventEx___CargoGroup +unit array UnitEventEx___Transporter +integer array UnitEventEx___PreTransformType -real UnitEventEx__MaxX -real UnitEventEx__MaxY +real UnitEventEx___MaxX +real UnitEventEx___MaxY -boolean array UnitEventEx__IsNew -boolean array UnitEventEx__IsAlive -boolean array UnitEventEx__IsReincarnating -boolean array UnitEventEx__IsTransforming +boolean array UnitEventEx___IsNew +boolean array UnitEventEx___IsAlive +boolean array UnitEventEx___IsReincarnating +boolean array UnitEventEx___IsTransforming -timer UnitEventEx__AfterIndexTimer= CreateTimer() -boolean UnitEventEx__rezCheck= true +timer UnitEventEx___AfterIndexTimer= CreateTimer() +boolean UnitEventEx___rezCheck= true //endglobals from UnitEventEx //globals from UnitGroupRespawnSystem: @@ -1758,13 +1758,13 @@ constant boolean LIBRARY_Utilities=true // The dummy caster unit id constant integer Utilities_DUMMY= 'dumi' // Update period -constant real Utilities__PERIOD= 0.031250000 +constant real Utilities___PERIOD= 0.031250000 // location z -location Utilities__LOCZ= Location(0, 0) +location Utilities___LOCZ= Location(0, 0) // One hashtable to rule them all -hashtable Utilities__table= InitHashtable() +hashtable Utilities___table= InitHashtable() // Closest Unit -unit Utilities__bj_closestUnitGroup +unit Utilities___bj_closestUnitGroup //endglobals from Utilities //globals from VoteSystem: constant boolean LIBRARY_VoteSystem=true @@ -1772,44 +1772,44 @@ constant real VOTE_SYSTEM_DEFAULT_TIMEOUT= 20.0 constant integer MAX_CHOICES= 12 // TODO introduce struct V and store it in a single array. -integer VoteSystem___VotesCounter= 0 -string array VoteSystem___VoteTitle -trigger array VoteSystem___VoteYesTrigger -string array VoteSystem___VoteStartChatCommand +integer VoteSystem__VotesCounter= 0 +string array VoteSystem__VoteTitle +trigger array VoteSystem__VoteYesTrigger +string array VoteSystem__VoteStartChatCommand //private dialog array VoteDialog //private trigger array VoteButtonClickTrigger -timer array VoteSystem___VoteTimer -real array VoteSystem___VoteTimeout -timerdialog array VoteSystem___VoteTimerDialog -force array VoteSystem___VotePlayers -boolean array VoteSystem___VoteIsRunning -integer array VoteSystem___VoteDefaultChoice -integer array VoteSystem___VoteChoices -string array VoteSystem___VoteChoicesNames -string array VoteSystem___VoteChoicesChatCommands -force array VoteSystem___VoteChoicesVotes +timer array VoteSystem__VoteTimer +real array VoteSystem__VoteTimeout +timerdialog array VoteSystem__VoteTimerDialog +force array VoteSystem__VotePlayers +boolean array VoteSystem__VoteIsRunning +integer array VoteSystem__VoteDefaultChoice +integer array VoteSystem__VoteChoices +string array VoteSystem__VoteChoicesNames +string array VoteSystem__VoteChoicesChatCommands +force array VoteSystem__VoteChoicesVotes // choices //private button array VoteSystemVoteDialogButton //private trigger array VoteSystemVoteChoiceCallbackTrigger -integer VoteSystem___callbackVote= 0 -integer VoteSystem___callbackChoice= 0 -integer VoteSystem___callbackVotes= 0 +integer VoteSystem__callbackVote= 0 +integer VoteSystem__callbackChoice= 0 +integer VoteSystem__callbackVotes= 0 -integer VoteSystem___CallbacksCounter= 0 -trigger array VoteSystem___CallbackTriggers +integer VoteSystem__CallbacksCounter= 0 +trigger array VoteSystem__CallbackTriggers -trigger VoteSystem___ChatCommandTrigger= CreateTrigger() -trigger VoteSystem___LeavesTrigger= CreateTrigger() -hashtable VoteSystem___timerHashTable= InitHashtable() +trigger VoteSystem__ChatCommandTrigger= CreateTrigger() +trigger VoteSystem__LeavesTrigger= CreateTrigger() +hashtable VoteSystem__timerHashTable= InitHashtable() //endglobals from VoteSystem //globals from WoWReforgedAutoSkill: 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 @@ -1831,11 +1831,11 @@ integer WoWReforgedDayNightCycleEffects__doodadIdsCounter= 0 //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 WoWReforgedMiner: constant boolean LIBRARY_WoWReforgedMiner=true @@ -2031,32 +2031,32 @@ constant real KeyMovementSystem_MOVEMENT_SYSTEM_ROTATION_PER_INTERVAL= 16.0 constant real KeyMovementSystem_MAX_HEIGHT= 1000.0 constant real KeyMovementSystem_MIN_HEIGHT= 100.0 -unit array KeyMovementSystem___Unit -boolean array KeyMovementSystem___MoveForward -boolean array KeyMovementSystem___MoveBackward -boolean array KeyMovementSystem___MoveUp -boolean array KeyMovementSystem___MoveDown -boolean array KeyMovementSystem___RotateRight -boolean array KeyMovementSystem___RotateLeft -boolean array KeyMovementSystem___MoveRight -boolean array KeyMovementSystem___MoveLeft -trigger KeyMovementSystem___ForwardTrigger= CreateTrigger() -trigger KeyMovementSystem___ForwardStopTrigger= CreateTrigger() -trigger KeyMovementSystem___BackwardTrigger= CreateTrigger() -trigger KeyMovementSystem___BackwardStopTrigger= CreateTrigger() -trigger KeyMovementSystem___UpTrigger= CreateTrigger() -trigger KeyMovementSystem___UpStopTrigger= CreateTrigger() -trigger KeyMovementSystem___DownTrigger= CreateTrigger() -trigger KeyMovementSystem___DownStopTrigger= CreateTrigger() -trigger KeyMovementSystem___RightRotateTrigger= CreateTrigger() -trigger KeyMovementSystem___RightRotateStopTrigger= CreateTrigger() -trigger KeyMovementSystem___LeftRotateTrigger= CreateTrigger() -trigger KeyMovementSystem___LeftRotateStopTrigger= CreateTrigger() -trigger KeyMovementSystem___RightTrigger= CreateTrigger() -trigger KeyMovementSystem___RightStopTrigger= CreateTrigger() -trigger KeyMovementSystem___LeftTrigger= CreateTrigger() -trigger KeyMovementSystem___LeftStopTrigger= CreateTrigger() -timer KeyMovementSystem___UpdateTimer= CreateTimer() +unit array KeyMovementSystem__Unit +boolean array KeyMovementSystem__MoveForward +boolean array KeyMovementSystem__MoveBackward +boolean array KeyMovementSystem__MoveUp +boolean array KeyMovementSystem__MoveDown +boolean array KeyMovementSystem__RotateRight +boolean array KeyMovementSystem__RotateLeft +boolean array KeyMovementSystem__MoveRight +boolean array KeyMovementSystem__MoveLeft +trigger KeyMovementSystem__ForwardTrigger= CreateTrigger() +trigger KeyMovementSystem__ForwardStopTrigger= CreateTrigger() +trigger KeyMovementSystem__BackwardTrigger= CreateTrigger() +trigger KeyMovementSystem__BackwardStopTrigger= CreateTrigger() +trigger KeyMovementSystem__UpTrigger= CreateTrigger() +trigger KeyMovementSystem__UpStopTrigger= CreateTrigger() +trigger KeyMovementSystem__DownTrigger= CreateTrigger() +trigger KeyMovementSystem__DownStopTrigger= CreateTrigger() +trigger KeyMovementSystem__RightRotateTrigger= CreateTrigger() +trigger KeyMovementSystem__RightRotateStopTrigger= CreateTrigger() +trigger KeyMovementSystem__LeftRotateTrigger= CreateTrigger() +trigger KeyMovementSystem__LeftRotateStopTrigger= CreateTrigger() +trigger KeyMovementSystem__RightTrigger= CreateTrigger() +trigger KeyMovementSystem__RightStopTrigger= CreateTrigger() +trigger KeyMovementSystem__LeftTrigger= CreateTrigger() +trigger KeyMovementSystem__LeftStopTrigger= CreateTrigger() +timer KeyMovementSystem__UpdateTimer= CreateTimer() //endglobals from KeyMovementSystem //globals from LogUI: constant boolean LIBRARY_LogUI=true @@ -2262,23 +2262,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 @@ -2337,18 +2337,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 WoWReforgedCritters: constant boolean LIBRARY_WoWReforgedCritters=true @@ -2359,12 +2359,12 @@ constant integer UNIT_TYPE_ID= 'h05T' //endglobals from WoWReforgedEnslave //globals from WoWReforgedLevels: constant boolean LIBRARY_WoWReforgedLevels=true -integer WoWReforgedLevels___levelCounter= 0 -string array WoWReforgedLevels___levelName -integer array WoWReforgedLevels___levelItemTypeId -string array WoWReforgedLevels___levelMapName +integer WoWReforgedLevels__levelCounter= 0 +string array WoWReforgedLevels__levelName +integer array WoWReforgedLevels__levelItemTypeId +string array WoWReforgedLevels__levelMapName -trigger WoWReforgedLevels___sellTrigger= CreateTrigger() +trigger WoWReforgedLevels__sellTrigger= CreateTrigger() //endglobals from WoWReforgedLevels //globals from WoWReforgedRandomCorpse: constant boolean LIBRARY_WoWReforgedRandomCorpse=true @@ -2382,48 +2382,48 @@ 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 constant integer HolyNova_ABILITY_ID= 'A1NH' constant integer HolyNova_ABILITY_ID_2= 'A1ON' -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 @@ -2434,7 +2434,7 @@ constant boolean NewBonus_EXTENDED= true // This is the maximum recursion limit allowed by the system. // It's value must be greater than or equal to 0. When equal to 0 // no recursion is allowed. Values too big can cause screen freezes. -constant integer NewBonus___RECURSION_LIMIT= 8 +constant integer NewBonus__RECURSION_LIMIT= 8 //The bonus types constant integer BONUS_DAMAGE= 1 @@ -2468,58 +2468,58 @@ constant integer BONUS_TENACITY_OFFSET= 27 //The abilities codes for each bonus //When pasting the abilities over to your map //their raw code should match the bonus here -constant integer NewBonus___DAMAGE_ABILITY= 'Z001' -constant integer NewBonus___ARMOR_ABILITY= 'Z002' -constant integer NewBonus___STATS_ABILITY= 'Z003' -constant integer NewBonus___HEALTH_ABILITY= 'Z004' -constant integer NewBonus___MANA_ABILITY= 'Z005' -constant integer NewBonus___HEALTHREGEN_ABILITY= 'Z006' -constant integer NewBonus___MANAREGEN_ABILITY= 'Z007' -constant integer NewBonus___ATTACKSPEED_ABILITY= 'Z008' -constant integer NewBonus___MOVEMENTSPEED_ABILITY= 'Z009' -constant integer NewBonus___SIGHT_RANGE_ABILITY= 'Z00A' -constant integer NewBonus___MAGIC_RESISTANCE_ABILITY= 'Z00B' -constant integer NewBonus___CRITICAL_STRIKE_ABILITY= 'Z00C' -constant integer NewBonus___EVASION_ABILITY= 'Z00D' -constant integer NewBonus___LIFE_STEAL_ABILITY= 'Z00E' +constant integer NewBonus__DAMAGE_ABILITY= 'Z001' +constant integer NewBonus__ARMOR_ABILITY= 'Z002' +constant integer NewBonus__STATS_ABILITY= 'Z003' +constant integer NewBonus__HEALTH_ABILITY= 'Z004' +constant integer NewBonus__MANA_ABILITY= 'Z005' +constant integer NewBonus__HEALTHREGEN_ABILITY= 'Z006' +constant integer NewBonus__MANAREGEN_ABILITY= 'Z007' +constant integer NewBonus__ATTACKSPEED_ABILITY= 'Z008' +constant integer NewBonus__MOVEMENTSPEED_ABILITY= 'Z009' +constant integer NewBonus__SIGHT_RANGE_ABILITY= 'Z00A' +constant integer NewBonus__MAGIC_RESISTANCE_ABILITY= 'Z00B' +constant integer NewBonus__CRITICAL_STRIKE_ABILITY= 'Z00C' +constant integer NewBonus__EVASION_ABILITY= 'Z00D' +constant integer NewBonus__LIFE_STEAL_ABILITY= 'Z00E' //The abilities fields that are modified. For the sake of readability -constant abilityintegerlevelfield NewBonus___DAMAGE_FIELD= ABILITY_ILF_ATTACK_BONUS -constant abilityintegerlevelfield NewBonus___ARMOR_FIELD= ABILITY_ILF_DEFENSE_BONUS_IDEF -constant abilityintegerlevelfield NewBonus___AGILITY_FIELD= ABILITY_ILF_AGILITY_BONUS -constant abilityintegerlevelfield NewBonus___STRENGTH_FIELD= ABILITY_ILF_STRENGTH_BONUS_ISTR -constant abilityintegerlevelfield NewBonus___INTELLIGENCE_FIELD= ABILITY_ILF_INTELLIGENCE_BONUS -constant abilityintegerlevelfield NewBonus___HEALTH_FIELD= ABILITY_ILF_MAX_LIFE_GAINED -constant abilityintegerlevelfield NewBonus___MANA_FIELD= ABILITY_ILF_MAX_MANA_GAINED -constant abilityintegerlevelfield NewBonus___MOVEMENTSPEED_FIELD= ABILITY_ILF_MOVEMENT_SPEED_BONUS -constant abilityintegerlevelfield NewBonus___SIGHT_RANGE_FIELD= ABILITY_ILF_SIGHT_RANGE_BONUS -constant abilityreallevelfield NewBonus___HEALTHREGEN_FIELD= ABILITY_RLF_AMOUNT_OF_HIT_POINTS_REGENERATED -constant abilityreallevelfield NewBonus___MANAREGEN_FIELD= ABILITY_RLF_AMOUNT_REGENERATED -constant abilityreallevelfield NewBonus___ATTACKSPEED_FIELD= ABILITY_RLF_ATTACK_SPEED_INCREASE_ISX1 -constant abilityreallevelfield NewBonus___MAGIC_RESISTANCE_FIELD= ABILITY_RLF_DAMAGE_REDUCTION_ISR2 -constant abilityreallevelfield NewBonus___CRITICAL_CHANCE_FIELD= ABILITY_RLF_CHANCE_TO_CRITICAL_STRIKE -constant abilityreallevelfield NewBonus___CRITICAL_DAMAGE_FIELD= ABILITY_RLF_DAMAGE_MULTIPLIER_OCR2 -constant abilityreallevelfield NewBonus___EVASION_FIELD= ABILITY_RLF_CHANCE_TO_EVADE_EEV1 -constant abilityreallevelfield NewBonus___LIFE_STEAL_FIELD= ABILITY_RLF_LIFE_STOLEN_PER_ATTACK +constant abilityintegerlevelfield NewBonus__DAMAGE_FIELD= ABILITY_ILF_ATTACK_BONUS +constant abilityintegerlevelfield NewBonus__ARMOR_FIELD= ABILITY_ILF_DEFENSE_BONUS_IDEF +constant abilityintegerlevelfield NewBonus__AGILITY_FIELD= ABILITY_ILF_AGILITY_BONUS +constant abilityintegerlevelfield NewBonus__STRENGTH_FIELD= ABILITY_ILF_STRENGTH_BONUS_ISTR +constant abilityintegerlevelfield NewBonus__INTELLIGENCE_FIELD= ABILITY_ILF_INTELLIGENCE_BONUS +constant abilityintegerlevelfield NewBonus__HEALTH_FIELD= ABILITY_ILF_MAX_LIFE_GAINED +constant abilityintegerlevelfield NewBonus__MANA_FIELD= ABILITY_ILF_MAX_MANA_GAINED +constant abilityintegerlevelfield NewBonus__MOVEMENTSPEED_FIELD= ABILITY_ILF_MOVEMENT_SPEED_BONUS +constant abilityintegerlevelfield NewBonus__SIGHT_RANGE_FIELD= ABILITY_ILF_SIGHT_RANGE_BONUS +constant abilityreallevelfield NewBonus__HEALTHREGEN_FIELD= ABILITY_RLF_AMOUNT_OF_HIT_POINTS_REGENERATED +constant abilityreallevelfield NewBonus__MANAREGEN_FIELD= ABILITY_RLF_AMOUNT_REGENERATED +constant abilityreallevelfield NewBonus__ATTACKSPEED_FIELD= ABILITY_RLF_ATTACK_SPEED_INCREASE_ISX1 +constant abilityreallevelfield NewBonus__MAGIC_RESISTANCE_FIELD= ABILITY_RLF_DAMAGE_REDUCTION_ISR2 +constant abilityreallevelfield NewBonus__CRITICAL_CHANCE_FIELD= ABILITY_RLF_CHANCE_TO_CRITICAL_STRIKE +constant abilityreallevelfield NewBonus__CRITICAL_DAMAGE_FIELD= ABILITY_RLF_DAMAGE_MULTIPLIER_OCR2 +constant abilityreallevelfield NewBonus__EVASION_FIELD= ABILITY_RLF_CHANCE_TO_EVADE_EEV1 +constant abilityreallevelfield NewBonus__LIFE_STEAL_FIELD= ABILITY_RLF_LIFE_STOLEN_PER_ATTACK //endglobals from NewBonus //globals from Parry: 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 @@ -2590,32 +2590,32 @@ 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 @@ -2701,12 +2701,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 @@ -2740,26 +2740,26 @@ 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 @@ -2782,13 +2782,13 @@ 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 @@ -2843,18 +2843,18 @@ 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 WoWReforgedMapChanger: constant boolean LIBRARY_WoWReforgedMapChanger=true //endglobals from WoWReforgedMapChanger //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 @@ -2875,14 +2875,14 @@ 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 @@ -3228,11 +3228,11 @@ 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 @@ -3389,33 +3389,33 @@ 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 @@ -3516,11 +3516,11 @@ 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 @@ -3536,7 +3536,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 @@ -3563,15 +3563,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 @@ -3628,17 +3628,17 @@ 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 @@ -3847,31 +3847,31 @@ 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 @@ -3980,19 +3980,19 @@ 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 @@ -4065,9 +4065,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 @@ -4135,36 +4135,6 @@ 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 @@ -4352,7 +4322,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 @@ -8855,7 +8825,7 @@ boolean array s__AArrowKeys_m_up boolean array s__AArrowKeys_m_down boolean array s__AArrowKeys_m_left boolean array s__AArrowKeys_m_right -constant integer si__Ascii__Inits=2 +constant integer si__Ascii___Inits=2 constant integer si__Attributes___A=3 integer si__Attributes___A_F=0 integer si__Attributes___A_I=0 @@ -8870,10 +8840,10 @@ integer array si__Attributes___V_V real array s__Attributes___V_value real array s__Attributes___V_max real array s__Attributes___V_regeneration -constant integer si__BlackArrowSystem___S=5 -integer si__BlackArrowSystem___S_F=0 -integer si__BlackArrowSystem___S_I=0 -integer array si__BlackArrowSystem___S_V +constant integer si__BlackArrowSystem__S=5 +integer si__BlackArrowSystem__S_F=0 +integer si__BlackArrowSystem__S_I=0 +integer array si__BlackArrowSystem__S_V constant integer si__TimerGroup32=6 constant integer si__DiceGroup=7 integer si__DiceGroup_F=0 @@ -8905,10 +8875,10 @@ integer array s__ArcingTextTag_next integer array s__ArcingTextTag_prev integer array s__ArcingTextTag_rn integer s__ArcingTextTag_ic= 0 -constant integer si__GameStatus__GameStatus=11 -integer si__GameStatus__GameStatus_F=0 -integer si__GameStatus__GameStatus_I=0 -integer array si__GameStatus__GameStatus_V +constant integer si__GameStatus___GameStatus=11 +integer si__GameStatus___GameStatus_F=0 +integer si__GameStatus___GameStatus_I=0 +integer array si__GameStatus___GameStatus_V constant integer si__HeroReviveCancelEvent=12 integer si__HeroReviveCancelEvent_F=0 integer si__HeroReviveCancelEvent_I=0 @@ -8936,10 +8906,10 @@ integer s__Indexer_id= - 1 unit s__Indexer_unit trigger s__Indexer_onIndex= CreateTrigger() trigger s__Indexer_onDeindex= CreateTrigger() -constant integer si__ItemRespawnSystem___S=14 -integer si__ItemRespawnSystem___S_F=0 -integer si__ItemRespawnSystem___S_I=0 -integer array si__ItemRespawnSystem___S_V +constant integer si__ItemRespawnSystem__S=14 +integer si__ItemRespawnSystem__S_F=0 +integer si__ItemRespawnSystem__S_I=0 +integer array si__ItemRespawnSystem__S_V constant integer si__LineSegment=15 constant real s__LineSegment_MAX_UNIT_COLLISION= 197.00 constant rect s__LineSegment_RECT= Rect(0, 0, 0, 0) @@ -8979,57 +8949,57 @@ 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__Table__dex=18 -constant integer si__Table__handles=19 -constant integer si__Table__agents=20 -constant integer si__Table__reals=21 -constant integer si__Table__booleans=22 -constant integer si__Table__strings=23 -constant integer si__Table__integers=24 -constant integer si__Table__players=25 -constant integer si__Table__widgets=26 -constant integer si__Table__destructables=27 -constant integer si__Table__items=28 -constant integer si__Table__units=29 -constant integer si__Table__abilitys=30 -constant integer si__Table__timers=31 -constant integer si__Table__triggers=32 -constant integer si__Table__triggerconditions=33 -constant integer si__Table__triggeractions=34 -constant integer si__Table__events=35 -constant integer si__Table__forces=36 -constant integer si__Table__groups=37 -constant integer si__Table__locations=38 -constant integer si__Table__rects=39 -constant integer si__Table__boolexprs=40 -constant integer si__Table__sounds=41 -constant integer si__Table__effects=42 -constant integer si__Table__unitpools=43 -constant integer si__Table__itempools=44 -constant integer si__Table__quests=45 -constant integer si__Table__questitems=46 -constant integer si__Table__defeatconditions=47 -constant integer si__Table__timerdialogs=48 -constant integer si__Table__leaderboards=49 -constant integer si__Table__multiboards=50 -constant integer si__Table__multiboarditems=51 -constant integer si__Table__trackables=52 -constant integer si__Table__dialogs=53 -constant integer si__Table__buttons=54 -constant integer si__Table__texttags=55 -constant integer si__Table__lightnings=56 -constant integer si__Table__images=57 -constant integer si__Table__ubersplats=58 -constant integer si__Table__regions=59 -constant integer si__Table__fogstates=60 -constant integer si__Table__fogmodifiers=61 -constant integer si__Table__hashtables=62 +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 +constant integer si__Table___reals=21 +constant integer si__Table___booleans=22 +constant integer si__Table___strings=23 +constant integer si__Table___integers=24 +constant integer si__Table___players=25 +constant integer si__Table___widgets=26 +constant integer si__Table___destructables=27 +constant integer si__Table___items=28 +constant integer si__Table___units=29 +constant integer si__Table___abilitys=30 +constant integer si__Table___timers=31 +constant integer si__Table___triggers=32 +constant integer si__Table___triggerconditions=33 +constant integer si__Table___triggeractions=34 +constant integer si__Table___events=35 +constant integer si__Table___forces=36 +constant integer si__Table___groups=37 +constant integer si__Table___locations=38 +constant integer si__Table___rects=39 +constant integer si__Table___boolexprs=40 +constant integer si__Table___sounds=41 +constant integer si__Table___effects=42 +constant integer si__Table___unitpools=43 +constant integer si__Table___itempools=44 +constant integer si__Table___quests=45 +constant integer si__Table___questitems=46 +constant integer si__Table___defeatconditions=47 +constant integer si__Table___timerdialogs=48 +constant integer si__Table___leaderboards=49 +constant integer si__Table___multiboards=50 +constant integer si__Table___multiboarditems=51 +constant integer si__Table___trackables=52 +constant integer si__Table___dialogs=53 +constant integer si__Table___buttons=54 +constant integer si__Table___texttags=55 +constant integer si__Table___lightnings=56 +constant integer si__Table___images=57 +constant integer si__Table___ubersplats=58 +constant integer si__Table___regions=59 +constant integer si__Table___fogstates=60 +constant integer si__Table___fogmodifiers=61 +constant integer si__Table___hashtables=62 constant integer si__Table=63 constant integer si__TableArray=64 integer s__TableArray_tempTable @@ -9053,16 +9023,16 @@ integer s__WorldBounds_centerX 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 array s__CooldownReduction___AbilityList_next -integer array s__CooldownReduction___AbilityList_prev -unit array s__CooldownReduction___AbilityList_unit -ability array s__CooldownReduction___AbilityList_ability -integer array s__CooldownReduction___AbilityList_defaults -integer array s__CooldownReduction___AbilityList_id -integer array s__CooldownReduction___AbilityList_levels +constant integer si__CooldownReduction__AbilityList=69 +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 +ability array s__CooldownReduction__AbilityList_ability +integer array s__CooldownReduction__AbilityList_defaults +integer array s__CooldownReduction__AbilityList_id +integer array s__CooldownReduction__AbilityList_levels constant integer si__CDR=70 integer si__CDR_F=0 integer si__CDR_I=0 @@ -9172,8 +9142,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 @@ -9184,20 +9154,20 @@ integer array si__MassSpell_V integer array s__MassSpell_dummyAbilityId string array s__MassSpell_dummyAbilityOrder 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 -real array s__MissileEffect__Effect_x -real array s__MissileEffect__Effect_y -real array s__MissileEffect__Effect_z -real array s__MissileEffect__Effect_size -real array s__MissileEffect__Effect_yaw -real array s__MissileEffect__Effect_pitch -real array s__MissileEffect__Effect_roll -string array s__MissileEffect__Effect_path -effect array s__MissileEffect__Effect_effect +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 +real array s__MissileEffect___Effect_x +real array s__MissileEffect___Effect_y +real array s__MissileEffect___Effect_z +real array s__MissileEffect___Effect_size +real array s__MissileEffect___Effect_yaw +real array s__MissileEffect___Effect_pitch +real array s__MissileEffect___Effect_roll +string array s__MissileEffect___Effect_path +effect array s__MissileEffect___Effect_effect constant integer si__MissileEffect=79 integer si__MissileEffect_F=0 integer si__MissileEffect_I=0 @@ -9227,19 +9197,19 @@ real array s__PagedButtonsConfig_modelX real array s__PagedButtonsConfig_modelY real array s__PagedButtonsConfig_modelScale string array s__PagedButtonsConfig_modelPath -constant integer si__PluginSpellEffect__SUnit=81 -integer si__PluginSpellEffect__SUnit_F=0 -integer si__PluginSpellEffect__SUnit_I=0 -integer array si__PluginSpellEffect__SUnit_V -unit array s__PluginSpellEffect__SUnit_unit -player array s__PluginSpellEffect__SUnit_player -integer array s__PluginSpellEffect__SUnit_handle -boolean array s__PluginSpellEffect__SUnit_isHero -boolean array s__PluginSpellEffect__SUnit_isStructure -integer array s__PluginSpellEffect__SUnit_id -real array s__PluginSpellEffect__SUnit_x -real array s__PluginSpellEffect__SUnit_y -real array s__PluginSpellEffect__SUnit_z +constant integer si__PluginSpellEffect___SUnit=81 +integer si__PluginSpellEffect___SUnit_F=0 +integer si__PluginSpellEffect___SUnit_I=0 +integer array si__PluginSpellEffect___SUnit_V +unit array s__PluginSpellEffect___SUnit_unit +player array s__PluginSpellEffect___SUnit_player +integer array s__PluginSpellEffect___SUnit_handle +boolean array s__PluginSpellEffect___SUnit_isHero +boolean array s__PluginSpellEffect___SUnit_isStructure +integer array s__PluginSpellEffect___SUnit_id +real array s__PluginSpellEffect___SUnit_x +real array s__PluginSpellEffect___SUnit_y +real array s__PluginSpellEffect___SUnit_z constant integer si__Spell=82 location s__Spell_location= Location(0, 0) integer s__Spell_source @@ -9250,8 +9220,8 @@ integer s__Spell_id real s__Spell_x real s__Spell_y real s__Spell_z -constant integer si__RegisterNativeEvent__NativeEvent=83 -integer s__RegisterNativeEvent__NativeEvent_table +constant integer si__RegisterNativeEvent___NativeEvent=83 +integer s__RegisterNativeEvent___NativeEvent_table constant integer si__Resource=84 integer si__Resource_F=0 integer si__Resource_I=0 @@ -9275,11 +9245,11 @@ constant integer s___Resource_playerUpkeepRate_size=28 integer array s__Resource_playerUpkeepRate integer array s__Resource_resources integer s__Resource_resourcesCount= 0 -constant integer si__SpellEffectEvent__S=88 -integer s__SpellEffectEvent__S_tb +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 @@ -9300,7 +9270,7 @@ integer array si__effectTimed_V effect array s__effectTimed_effect_var integer s__effectTimed_index= - 1 integer array s__effectTimed_instance -real s__effectTimed_REAL=TimedHandles__UPDATE_PERIOD +real s__effectTimed_REAL=TimedHandles___UPDATE_PERIOD timer s__effectTimed_timer= CreateTimer() real array s__effectTimed_duration real array s__effectTimed_elapsed @@ -9311,7 +9281,7 @@ integer array si__lightningTimed_V lightning array s__lightningTimed_lightning_var integer s__lightningTimed_index= - 1 integer array s__lightningTimed_instance -real s__lightningTimed_REAL=TimedHandles__UPDATE_PERIOD +real s__lightningTimed_REAL=TimedHandles___UPDATE_PERIOD timer s__lightningTimed_timer= CreateTimer() real array s__lightningTimed_duration real array s__lightningTimed_elapsed @@ -9322,7 +9292,7 @@ integer array si__weathereffectTimed_V weathereffect array s__weathereffectTimed_weathereffect_var integer s__weathereffectTimed_index= - 1 integer array s__weathereffectTimed_instance -real s__weathereffectTimed_REAL=TimedHandles__UPDATE_PERIOD +real s__weathereffectTimed_REAL=TimedHandles___UPDATE_PERIOD timer s__weathereffectTimed_timer= CreateTimer() real array s__weathereffectTimed_duration real array s__weathereffectTimed_elapsed @@ -9333,7 +9303,7 @@ integer array si__itemTimed_V item array s__itemTimed_item_var integer s__itemTimed_index= - 1 integer array s__itemTimed_instance -real s__itemTimed_REAL=TimedHandles__UPDATE_PERIOD +real s__itemTimed_REAL=TimedHandles___UPDATE_PERIOD timer s__itemTimed_timer= CreateTimer() real array s__itemTimed_duration real array s__itemTimed_elapsed @@ -9344,7 +9314,7 @@ integer array si__unitTimed_V unit array s__unitTimed_unit_var integer s__unitTimed_index= - 1 integer array s__unitTimed_instance -real s__unitTimed_REAL=TimedHandles__UPDATE_PERIOD +real s__unitTimed_REAL=TimedHandles___UPDATE_PERIOD timer s__unitTimed_timer= CreateTimer() real array s__unitTimed_duration real array s__unitTimed_elapsed @@ -9355,14 +9325,14 @@ integer array si__ubersplatTimed_V ubersplat array s__ubersplatTimed_ubersplat_var integer s__ubersplatTimed_index= - 1 integer array s__ubersplatTimed_instance -real s__ubersplatTimed_REAL=TimedHandles__UPDATE_PERIOD +real s__ubersplatTimed_REAL=TimedHandles___UPDATE_PERIOD timer s__ubersplatTimed_timer= CreateTimer() real array s__ubersplatTimed_duration real array s__ubersplatTimed_elapsed -constant integer si__TurretSystem___S=97 -integer si__TurretSystem___S_F=0 -integer si__TurretSystem___S_I=0 -integer array si__TurretSystem___S_V +constant integer si__TurretSystem__S=97 +integer si__TurretSystem__S_F=0 +integer si__TurretSystem__S_I=0 +integer array si__TurretSystem__S_V constant integer si__UnitDex=98 boolean s__UnitDex_Enabled= true integer s__UnitDex_LastIndex @@ -9391,14 +9361,14 @@ unit array s__Lever_targetPortal real array s__Lever_targetPortalX real array s__Lever_targetPortalY integer array s__Lever_leverType -constant integer si__CooldownReductionUtils___CDRUtils=101 -timer s__CooldownReductionUtils___CDRUtils_t= CreateTimer() -integer s__CooldownReductionUtils___CDRUtils_didx= - 1 -integer array s__CooldownReductionUtils___CDRUtils_data -unit array s__CooldownReductionUtils___CDRUtils_u -real array s__CooldownReductionUtils___CDRUtils_ticks -real array s__CooldownReductionUtils___CDRUtils_amount -integer array s__CooldownReductionUtils___CDRUtils_tipo +constant integer si__CooldownReductionUtils__CDRUtils=101 +timer s__CooldownReductionUtils__CDRUtils_t= CreateTimer() +integer s__CooldownReductionUtils__CDRUtils_didx= - 1 +integer array s__CooldownReductionUtils__CDRUtils_data +unit array s__CooldownReductionUtils__CDRUtils_u +real array s__CooldownReductionUtils__CDRUtils_ticks +real array s__CooldownReductionUtils__CDRUtils_amount +integer array s__CooldownReductionUtils__CDRUtils_tipo constant integer si__Evasion=102 integer si__Evasion_F=0 integer si__Evasion_I=0 @@ -9418,46 +9388,46 @@ integer si__LifeSteal_I=0 integer array si__LifeSteal_V string s__LifeSteal_effect= "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl" real array s__LifeSteal_amount -constant integer si__Missiles__MissileEvents=104 -integer si__Missiles__MissileEvents_F=0 -integer si__Missiles__MissileEvents_I=0 -integer array si__Missiles__MissileEvents_V -integer array si__Missiles__MissileEvents_type -trigger array st__Missiles__MissileEvents_onDestroy -trigger array st__Missiles__MissileEvents_onHit -trigger array st__Missiles__MissileEvents_onMissile -trigger array st__Missiles__MissileEvents_onDestructable -trigger array st__Missiles__MissileEvents_onItem -trigger array st__Missiles__MissileEvents_onCliff -trigger array st__Missiles__MissileEvents_onTerrain -trigger array st__Missiles__MissileEvents_onTileset -trigger array st__Missiles__MissileEvents_onPeriod -trigger array st__Missiles__MissileEvents_onFinish -trigger array st__Missiles__MissileEvents_onBoundaries -trigger array st__Missiles__MissileEvents_onPause -trigger array st__Missiles__MissileEvents_onResume -trigger array st__Missiles__MissileEvents_onRemove -constant integer si__Missiles__Pool=105 -integer si__Missiles__Pool_F=0 -integer si__Missiles__Pool_I=0 -integer array si__Missiles__Pool_V -player s__Missiles__Pool_player= Player(PLAYER_NEUTRAL_PASSIVE) -group s__Missiles__Pool_group= CreateGroup() -timer array s__Missiles__Pool_timer -unit array s__Missiles__Pool_unit -constant integer si__Missiles__Coordinates=106 -integer si__Missiles__Coordinates_F=0 -integer si__Missiles__Coordinates_I=0 -integer array si__Missiles__Coordinates_V -real array s__Missiles__Coordinates_x -real array s__Missiles__Coordinates_y -real array s__Missiles__Coordinates_z -real array s__Missiles__Coordinates_angle -real array s__Missiles__Coordinates_distance -real array s__Missiles__Coordinates_square -real array s__Missiles__Coordinates_slope -real array s__Missiles__Coordinates_alpha -integer array s__Missiles__Coordinates_ref +constant integer si__Missiles___MissileEvents=104 +integer si__Missiles___MissileEvents_F=0 +integer si__Missiles___MissileEvents_I=0 +integer array si__Missiles___MissileEvents_V +integer array si__Missiles___MissileEvents_type +trigger array st__Missiles___MissileEvents_onDestroy +trigger array st__Missiles___MissileEvents_onHit +trigger array st__Missiles___MissileEvents_onMissile +trigger array st__Missiles___MissileEvents_onDestructable +trigger array st__Missiles___MissileEvents_onItem +trigger array st__Missiles___MissileEvents_onCliff +trigger array st__Missiles___MissileEvents_onTerrain +trigger array st__Missiles___MissileEvents_onTileset +trigger array st__Missiles___MissileEvents_onPeriod +trigger array st__Missiles___MissileEvents_onFinish +trigger array st__Missiles___MissileEvents_onBoundaries +trigger array st__Missiles___MissileEvents_onPause +trigger array st__Missiles___MissileEvents_onResume +trigger array st__Missiles___MissileEvents_onRemove +constant integer si__Missiles___Pool=105 +integer si__Missiles___Pool_F=0 +integer si__Missiles___Pool_I=0 +integer array si__Missiles___Pool_V +player s__Missiles___Pool_player= Player(PLAYER_NEUTRAL_PASSIVE) +group s__Missiles___Pool_group= CreateGroup() +timer array s__Missiles___Pool_timer +unit array s__Missiles___Pool_unit +constant integer si__Missiles___Coordinates=106 +integer si__Missiles___Coordinates_F=0 +integer si__Missiles___Coordinates_I=0 +integer array si__Missiles___Coordinates_V +real array s__Missiles___Coordinates_x +real array s__Missiles___Coordinates_y +real array s__Missiles___Coordinates_z +real array s__Missiles___Coordinates_angle +real array s__Missiles___Coordinates_distance +real array s__Missiles___Coordinates_square +real array s__Missiles___Coordinates_slope +real array s__Missiles___Coordinates_alpha +integer array s__Missiles___Coordinates_ref constant integer si__Missiles=107 timer s__Missiles_timer= CreateTimer() group s__Missiles_group= CreateGroup() @@ -9919,14 +9889,14 @@ unit array s__TenacityUtils_unit real array s__TenacityUtils_value integer array s__TenacityUtils_type real array s__TenacityUtils_duration -constant integer si__UnitEventEx__Cargo=119 -integer si__UnitEventEx__Cargo_F=0 -integer si__UnitEventEx__Cargo_I=0 -integer array si__UnitEventEx__Cargo_V -constant integer si__UnitEventEx__UnitEventEx=120 -integer si__UnitEventEx__UnitEventEx_F=0 -integer si__UnitEventEx__UnitEventEx_I=0 -integer array si__UnitEventEx__UnitEventEx_V +constant integer si__UnitEventEx___Cargo=119 +integer si__UnitEventEx___Cargo_F=0 +integer si__UnitEventEx___Cargo_I=0 +integer array si__UnitEventEx___Cargo_V +constant integer si__UnitEventEx___UnitEventEx=120 +integer si__UnitEventEx___UnitEventEx_F=0 +integer si__UnitEventEx___UnitEventEx_I=0 +integer array si__UnitEventEx___UnitEventEx_V constant integer si__ResetCooldown=121 integer si__ResetCooldown_F=0 integer si__ResetCooldown_I=0 @@ -10174,57 +10144,57 @@ boolean array s__CrowdControl_cliff boolean array s__CrowdControl_destructable boolean array s__CrowdControl_agent integer array s__CrowdControl_type -constant integer si__MissileUtils__MGroup=137 -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 array s__MissileUtils__MGroup_missile +constant integer si__MissileUtils___MGroup=137 +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 array s__MissileUtils___MGroup_missile constant integer si__MissileGroup=138 integer si__MissileGroup_F=0 integer si__MissileGroup_I=0 integer array si__MissileGroup_V integer array s__MissileGroup_group integer array s__MissileGroup_size -constant integer si__DamageInterfaceUtils___EvasionUtils=139 -integer array s__DamageInterfaceUtils___EvasionUtils_data -integer s__DamageInterfaceUtils___EvasionUtils_didx= - 1 -timer s__DamageInterfaceUtils___EvasionUtils_timer= CreateTimer() -unit array s__DamageInterfaceUtils___EvasionUtils_unit -real array s__DamageInterfaceUtils___EvasionUtils_amount -real array s__DamageInterfaceUtils___EvasionUtils_ticks -boolean array s__DamageInterfaceUtils___EvasionUtils_type -constant integer si__DamageInterfaceUtils___CriticalUtils=140 -integer array s__DamageInterfaceUtils___CriticalUtils_data -integer s__DamageInterfaceUtils___CriticalUtils_didx= - 1 -timer s__DamageInterfaceUtils___CriticalUtils_timer= CreateTimer() -unit array s__DamageInterfaceUtils___CriticalUtils_unit -real array s__DamageInterfaceUtils___CriticalUtils_crit -real array s__DamageInterfaceUtils___CriticalUtils_multi -real array s__DamageInterfaceUtils___CriticalUtils_ticks -integer array s__DamageInterfaceUtils___CriticalUtils_type -constant integer si__DamageInterfaceUtils___SpellPowerUtils=141 -integer array s__DamageInterfaceUtils___SpellPowerUtils_data -integer s__DamageInterfaceUtils___SpellPowerUtils_didx= - 1 -timer s__DamageInterfaceUtils___SpellPowerUtils_timer= CreateTimer() -unit array s__DamageInterfaceUtils___SpellPowerUtils_unit -real array s__DamageInterfaceUtils___SpellPowerUtils_amount -real array s__DamageInterfaceUtils___SpellPowerUtils_ticks -boolean array s__DamageInterfaceUtils___SpellPowerUtils_isFlat -constant integer si__DamageInterfaceUtils___LifeStealUtils=142 -integer array s__DamageInterfaceUtils___LifeStealUtils_data -integer s__DamageInterfaceUtils___LifeStealUtils_didx= - 1 -timer s__DamageInterfaceUtils___LifeStealUtils_timer= CreateTimer() -unit array s__DamageInterfaceUtils___LifeStealUtils_unit -real array s__DamageInterfaceUtils___LifeStealUtils_lifeSteal -real array s__DamageInterfaceUtils___LifeStealUtils_ticks -constant integer si__DamageInterfaceUtils___SpellVampUtils=143 -integer array s__DamageInterfaceUtils___SpellVampUtils_data -integer s__DamageInterfaceUtils___SpellVampUtils_didx= - 1 -timer s__DamageInterfaceUtils___SpellVampUtils_timer= CreateTimer() -unit array s__DamageInterfaceUtils___SpellVampUtils_unit -real array s__DamageInterfaceUtils___SpellVampUtils_spellVamp -real array s__DamageInterfaceUtils___SpellVampUtils_ticks +constant integer si__DamageInterfaceUtils__EvasionUtils=139 +integer array s__DamageInterfaceUtils__EvasionUtils_data +integer s__DamageInterfaceUtils__EvasionUtils_didx= - 1 +timer s__DamageInterfaceUtils__EvasionUtils_timer= CreateTimer() +unit array s__DamageInterfaceUtils__EvasionUtils_unit +real array s__DamageInterfaceUtils__EvasionUtils_amount +real array s__DamageInterfaceUtils__EvasionUtils_ticks +boolean array s__DamageInterfaceUtils__EvasionUtils_type +constant integer si__DamageInterfaceUtils__CriticalUtils=140 +integer array s__DamageInterfaceUtils__CriticalUtils_data +integer s__DamageInterfaceUtils__CriticalUtils_didx= - 1 +timer s__DamageInterfaceUtils__CriticalUtils_timer= CreateTimer() +unit array s__DamageInterfaceUtils__CriticalUtils_unit +real array s__DamageInterfaceUtils__CriticalUtils_crit +real array s__DamageInterfaceUtils__CriticalUtils_multi +real array s__DamageInterfaceUtils__CriticalUtils_ticks +integer array s__DamageInterfaceUtils__CriticalUtils_type +constant integer si__DamageInterfaceUtils__SpellPowerUtils=141 +integer array s__DamageInterfaceUtils__SpellPowerUtils_data +integer s__DamageInterfaceUtils__SpellPowerUtils_didx= - 1 +timer s__DamageInterfaceUtils__SpellPowerUtils_timer= CreateTimer() +unit array s__DamageInterfaceUtils__SpellPowerUtils_unit +real array s__DamageInterfaceUtils__SpellPowerUtils_amount +real array s__DamageInterfaceUtils__SpellPowerUtils_ticks +boolean array s__DamageInterfaceUtils__SpellPowerUtils_isFlat +constant integer si__DamageInterfaceUtils__LifeStealUtils=142 +integer array s__DamageInterfaceUtils__LifeStealUtils_data +integer s__DamageInterfaceUtils__LifeStealUtils_didx= - 1 +timer s__DamageInterfaceUtils__LifeStealUtils_timer= CreateTimer() +unit array s__DamageInterfaceUtils__LifeStealUtils_unit +real array s__DamageInterfaceUtils__LifeStealUtils_lifeSteal +real array s__DamageInterfaceUtils__LifeStealUtils_ticks +constant integer si__DamageInterfaceUtils__SpellVampUtils=143 +integer array s__DamageInterfaceUtils__SpellVampUtils_data +integer s__DamageInterfaceUtils__SpellVampUtils_didx= - 1 +timer s__DamageInterfaceUtils__SpellVampUtils_timer= CreateTimer() +unit array s__DamageInterfaceUtils__SpellVampUtils_unit +real array s__DamageInterfaceUtils__SpellVampUtils_spellVamp +real array s__DamageInterfaceUtils__SpellVampUtils_ticks constant integer si__NewBonus=144 integer si__NewBonus_F=0 integer si__NewBonus_I=0 @@ -10392,17 +10362,17 @@ integer array s__WoWReforgedMounts__M_abilityId integer array s__WoWReforgedMounts__M_itemTypeId string array s__WoWReforgedMounts__M_accountNames boolean array s__WoWReforgedMounts__M_bonus -constant integer si__WoWReforgedStandardHeroAbilities___A=164 -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__WoWReforgedStandardHeroAbilities__A=164 +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=165 integer si__Achievement_F=0 integer si__Achievement_I=0 @@ -10547,8 +10517,8 @@ 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__TimerUtils___data +timer array s__TimerUtils___tT integer array s__s__AArrowKeys_m_playerArrowKeys integer array s__s__AThirdPersonCamera_m_playerThirdPersonCamera integer array s__s__Aura_allAuras @@ -10599,7 +10569,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 @@ -12936,32 +12906,32 @@ 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 @@ -13433,32 +13403,32 @@ function s__Attributes___V_deallocate takes integer this returns nothing set si__Attributes___V_F=this endfunction -//Generated allocator of BlackArrowSystem___S -function s__BlackArrowSystem___S__allocate takes nothing returns integer - local integer this=si__BlackArrowSystem___S_F +//Generated allocator of BlackArrowSystem__S +function s__BlackArrowSystem__S__allocate takes nothing returns integer + local integer this=si__BlackArrowSystem__S_F if (this!=0) then - set si__BlackArrowSystem___S_F=si__BlackArrowSystem___S_V[this] + set si__BlackArrowSystem__S_F=si__BlackArrowSystem__S_V[this] else - set si__BlackArrowSystem___S_I=si__BlackArrowSystem___S_I+1 - set this=si__BlackArrowSystem___S_I + set si__BlackArrowSystem__S_I=si__BlackArrowSystem__S_I+1 + set this=si__BlackArrowSystem__S_I endif if (this>8190) then return 0 endif - set si__BlackArrowSystem___S_V[this]=-1 + set si__BlackArrowSystem__S_V[this]=-1 return this endfunction -//Generated destructor of BlackArrowSystem___S -function s__BlackArrowSystem___S_deallocate takes integer this returns nothing +//Generated destructor of BlackArrowSystem__S +function s__BlackArrowSystem__S_deallocate takes integer this returns nothing if this==null then return - elseif (si__BlackArrowSystem___S_V[this]!=-1) then + elseif (si__BlackArrowSystem__S_V[this]!=-1) then return endif - set si__BlackArrowSystem___S_V[this]=si__BlackArrowSystem___S_F - set si__BlackArrowSystem___S_F=this + set si__BlackArrowSystem__S_V[this]=si__BlackArrowSystem__S_F + set si__BlackArrowSystem__S_F=this endfunction //Generated allocator of DiceGroup @@ -13497,17 +13467,17 @@ endfunction //Generated method caller for MissileGroup.missileAt function sc__MissileGroup_missileAt takes integer this,integer i returns integer - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + 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 node=s__MissileUtils___MGroup_next[node] set j=j + 1 endloop - return s__MissileUtils__MGroup_missile[node] + return s__MissileUtils___MGroup_missile[node] else return 0 endif @@ -13535,16 +13505,16 @@ endfunction //Generated method caller for MissileGroup.contains function sc__MissileGroup_contains takes integer this,integer missile returns boolean - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + 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 + if s__MissileUtils___MGroup_missile[node] == missile then set found=true exitwhen true endif - set node=s__MissileUtils__MGroup_next[node] + set node=s__MissileUtils___MGroup_next[node] endloop return found @@ -14445,66 +14415,66 @@ 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 - set UnitEventEx__rezCheck=false +//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 -//Generated allocator of UnitEventEx__UnitEventEx -function s__UnitEventEx__UnitEventEx__allocate takes nothing returns integer - local integer this=si__UnitEventEx__UnitEventEx_F +//Generated allocator of UnitEventEx___UnitEventEx +function s__UnitEventEx___UnitEventEx__allocate takes nothing returns integer + local integer this=si__UnitEventEx___UnitEventEx_F if (this!=0) then - set si__UnitEventEx__UnitEventEx_F=si__UnitEventEx__UnitEventEx_V[this] + set si__UnitEventEx___UnitEventEx_F=si__UnitEventEx___UnitEventEx_V[this] else - set si__UnitEventEx__UnitEventEx_I=si__UnitEventEx__UnitEventEx_I+1 - set this=si__UnitEventEx__UnitEventEx_I + set si__UnitEventEx___UnitEventEx_I=si__UnitEventEx___UnitEventEx_I+1 + set this=si__UnitEventEx___UnitEventEx_I endif if (this>8190) then return 0 endif - set si__UnitEventEx__UnitEventEx_V[this]=-1 + set si__UnitEventEx___UnitEventEx_V[this]=-1 return this endfunction -//Generated destructor of UnitEventEx__UnitEventEx -function s__UnitEventEx__UnitEventEx_deallocate takes integer this returns nothing +//Generated destructor of UnitEventEx___UnitEventEx +function s__UnitEventEx___UnitEventEx_deallocate takes integer this returns nothing if this==null then return - elseif (si__UnitEventEx__UnitEventEx_V[this]!=-1) then + elseif (si__UnitEventEx___UnitEventEx_V[this]!=-1) then return endif - set si__UnitEventEx__UnitEventEx_V[this]=si__UnitEventEx__UnitEventEx_F - set si__UnitEventEx__UnitEventEx_F=this + set si__UnitEventEx___UnitEventEx_V[this]=si__UnitEventEx___UnitEventEx_F + set si__UnitEventEx___UnitEventEx_F=this endfunction -//Generated allocator of UnitEventEx__Cargo -function s__UnitEventEx__Cargo__allocate takes nothing returns integer - local integer this=si__UnitEventEx__Cargo_F +//Generated allocator of UnitEventEx___Cargo +function s__UnitEventEx___Cargo__allocate takes nothing returns integer + local integer this=si__UnitEventEx___Cargo_F if (this!=0) then - set si__UnitEventEx__Cargo_F=si__UnitEventEx__Cargo_V[this] + set si__UnitEventEx___Cargo_F=si__UnitEventEx___Cargo_V[this] else - set si__UnitEventEx__Cargo_I=si__UnitEventEx__Cargo_I+1 - set this=si__UnitEventEx__Cargo_I + set si__UnitEventEx___Cargo_I=si__UnitEventEx___Cargo_I+1 + set this=si__UnitEventEx___Cargo_I endif if (this>8190) then return 0 endif - set si__UnitEventEx__Cargo_V[this]=-1 + set si__UnitEventEx___Cargo_V[this]=-1 return this endfunction -//Generated destructor of UnitEventEx__Cargo -function s__UnitEventEx__Cargo_deallocate takes integer this returns nothing +//Generated destructor of UnitEventEx___Cargo +function s__UnitEventEx___Cargo_deallocate takes integer this returns nothing if this==null then return - elseif (si__UnitEventEx__Cargo_V[this]!=-1) then + elseif (si__UnitEventEx___Cargo_V[this]!=-1) then return endif - set si__UnitEventEx__Cargo_V[this]=si__UnitEventEx__Cargo_F - set si__UnitEventEx__Cargo_F=this + set si__UnitEventEx___Cargo_V[this]=si__UnitEventEx___Cargo_F + set si__UnitEventEx___Cargo_F=this endfunction //Generated allocator of SpellVamp @@ -15066,32 +15036,32 @@ function s__PagedButtons_Page_deallocate takes integer this returns nothing set si__PagedButtons_Page_F=this endfunction -//Generated allocator of GameStatus__GameStatus -function s__GameStatus__GameStatus__allocate takes nothing returns integer - local integer this=si__GameStatus__GameStatus_F +//Generated allocator of GameStatus___GameStatus +function s__GameStatus___GameStatus__allocate takes nothing returns integer + local integer this=si__GameStatus___GameStatus_F if (this!=0) then - set si__GameStatus__GameStatus_F=si__GameStatus__GameStatus_V[this] + set si__GameStatus___GameStatus_F=si__GameStatus___GameStatus_V[this] else - set si__GameStatus__GameStatus_I=si__GameStatus__GameStatus_I+1 - set this=si__GameStatus__GameStatus_I + set si__GameStatus___GameStatus_I=si__GameStatus___GameStatus_I+1 + set this=si__GameStatus___GameStatus_I endif if (this>8190) then return 0 endif - set si__GameStatus__GameStatus_V[this]=-1 + set si__GameStatus___GameStatus_V[this]=-1 return this endfunction -//Generated destructor of GameStatus__GameStatus -function s__GameStatus__GameStatus_deallocate takes integer this returns nothing +//Generated destructor of GameStatus___GameStatus +function s__GameStatus___GameStatus_deallocate takes integer this returns nothing if this==null then return - elseif (si__GameStatus__GameStatus_V[this]!=-1) then + elseif (si__GameStatus___GameStatus_V[this]!=-1) then return endif - set si__GameStatus__GameStatus_V[this]=si__GameStatus__GameStatus_F - set si__GameStatus__GameStatus_F=this + set si__GameStatus___GameStatus_V[this]=si__GameStatus___GameStatus_F + set si__GameStatus___GameStatus_F=this endfunction //Generated allocator of PagedButtons_Type @@ -15395,274 +15365,274 @@ function s__HeroReviveCancelEvent_deallocate takes integer this returns nothing set si__HeroReviveCancelEvent_F=this endfunction -//Generated allocator of Missiles__Coordinates -function s__Missiles__Coordinates__allocate takes nothing returns integer - local integer this=si__Missiles__Coordinates_F +//Generated allocator of Missiles___Coordinates +function s__Missiles___Coordinates__allocate takes nothing returns integer + local integer this=si__Missiles___Coordinates_F if (this!=0) then - set si__Missiles__Coordinates_F=si__Missiles__Coordinates_V[this] + set si__Missiles___Coordinates_F=si__Missiles___Coordinates_V[this] else - set si__Missiles__Coordinates_I=si__Missiles__Coordinates_I+1 - set this=si__Missiles__Coordinates_I + set si__Missiles___Coordinates_I=si__Missiles___Coordinates_I+1 + set this=si__Missiles___Coordinates_I endif if (this>8190) then return 0 endif - set si__Missiles__Coordinates_V[this]=-1 + set si__Missiles___Coordinates_V[this]=-1 return this endfunction -//Generated destructor of Missiles__Coordinates -function s__Missiles__Coordinates_deallocate takes integer this returns nothing +//Generated destructor of Missiles___Coordinates +function s__Missiles___Coordinates_deallocate takes integer this returns nothing if this==null then return - elseif (si__Missiles__Coordinates_V[this]!=-1) then + elseif (si__Missiles___Coordinates_V[this]!=-1) then return endif - set si__Missiles__Coordinates_V[this]=si__Missiles__Coordinates_F - set si__Missiles__Coordinates_F=this + set si__Missiles___Coordinates_V[this]=si__Missiles___Coordinates_F + set si__Missiles___Coordinates_F=this endfunction -//Generated allocator of Missiles__Pool -function s__Missiles__Pool__allocate takes nothing returns integer - local integer this=si__Missiles__Pool_F +//Generated allocator of Missiles___Pool +function s__Missiles___Pool__allocate takes nothing returns integer + local integer this=si__Missiles___Pool_F if (this!=0) then - set si__Missiles__Pool_F=si__Missiles__Pool_V[this] + set si__Missiles___Pool_F=si__Missiles___Pool_V[this] else - set si__Missiles__Pool_I=si__Missiles__Pool_I+1 - set this=si__Missiles__Pool_I + set si__Missiles___Pool_I=si__Missiles___Pool_I+1 + set this=si__Missiles___Pool_I endif if (this>8190) then return 0 endif - set si__Missiles__Pool_V[this]=-1 + set si__Missiles___Pool_V[this]=-1 return this endfunction -//Generated destructor of Missiles__Pool -function s__Missiles__Pool_deallocate takes integer this returns nothing +//Generated destructor of Missiles___Pool +function s__Missiles___Pool_deallocate takes integer this returns nothing if this==null then return - elseif (si__Missiles__Pool_V[this]!=-1) then + elseif (si__Missiles___Pool_V[this]!=-1) then return endif - set si__Missiles__Pool_V[this]=si__Missiles__Pool_F - set si__Missiles__Pool_F=this + set si__Missiles___Pool_V[this]=si__Missiles___Pool_F + set si__Missiles___Pool_F=this endfunction -//Generated method caller for Missiles__MissileEvents.onHit -function sc__Missiles__MissileEvents_onHit takes integer this,unit hit returns boolean +//Generated method caller for Missiles___MissileEvents.onHit +function sc__Missiles___MissileEvents_onHit takes integer this,unit hit returns boolean set f__arg_this=this set f__arg_unit1=hit - //An error in the next line would mean declaration for Missiles__MissileEvents.onHit had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onHit had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onHit[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onHit[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onHit -function sx__Missiles__MissileEvents_onHit takes integer this,unit hit returns nothing +//Generated method executor for Missiles___MissileEvents.onHit +function sx__Missiles___MissileEvents_onHit takes integer this,unit hit returns nothing set f__arg_this=this set f__arg_unit1=hit - call TriggerExecute(st__Missiles__MissileEvents_onHit[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onHit[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onMissile -function sc__Missiles__MissileEvents_onMissile takes integer this,integer missile returns boolean +//Generated method caller for Missiles___MissileEvents.onMissile +function sc__Missiles___MissileEvents_onMissile takes integer this,integer missile returns boolean set f__arg_this=this set f__arg_integer1=missile - //An error in the next line would mean declaration for Missiles__MissileEvents.onMissile had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onMissile had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onMissile[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onMissile[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onMissile -function sx__Missiles__MissileEvents_onMissile takes integer this,integer missile returns nothing +//Generated method executor for Missiles___MissileEvents.onMissile +function sx__Missiles___MissileEvents_onMissile takes integer this,integer missile returns nothing set f__arg_this=this set f__arg_integer1=missile - call TriggerExecute(st__Missiles__MissileEvents_onMissile[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onMissile[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onDestructable -function sc__Missiles__MissileEvents_onDestructable takes integer this,destructable dest returns boolean +//Generated method caller for Missiles___MissileEvents.onDestructable +function sc__Missiles___MissileEvents_onDestructable takes integer this,destructable dest returns boolean set f__arg_this=this set f__arg_destructable1=dest - //An error in the next line would mean declaration for Missiles__MissileEvents.onDestructable had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onDestructable had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onDestructable[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onDestructable[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onDestructable -function sx__Missiles__MissileEvents_onDestructable takes integer this,destructable dest returns nothing +//Generated method executor for Missiles___MissileEvents.onDestructable +function sx__Missiles___MissileEvents_onDestructable takes integer this,destructable dest returns nothing set f__arg_this=this set f__arg_destructable1=dest - call TriggerExecute(st__Missiles__MissileEvents_onDestructable[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onDestructable[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onItem -function sc__Missiles__MissileEvents_onItem takes integer this,item i returns boolean +//Generated method caller for Missiles___MissileEvents.onItem +function sc__Missiles___MissileEvents_onItem takes integer this,item i returns boolean set f__arg_this=this set f__arg_item1=i - //An error in the next line would mean declaration for Missiles__MissileEvents.onItem had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onItem had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onItem[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onItem[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onItem -function sx__Missiles__MissileEvents_onItem takes integer this,item i returns nothing +//Generated method executor for Missiles___MissileEvents.onItem +function sx__Missiles___MissileEvents_onItem takes integer this,item i returns nothing set f__arg_this=this set f__arg_item1=i - call TriggerExecute(st__Missiles__MissileEvents_onItem[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onItem[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onCliff -function sc__Missiles__MissileEvents_onCliff takes integer this returns boolean +//Generated method caller for Missiles___MissileEvents.onCliff +function sc__Missiles___MissileEvents_onCliff takes integer this returns boolean set f__arg_this=this - //An error in the next line would mean declaration for Missiles__MissileEvents.onCliff had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onCliff had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onCliff[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onCliff[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onCliff -function sx__Missiles__MissileEvents_onCliff takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onCliff +function sx__Missiles___MissileEvents_onCliff takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onCliff[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onCliff[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onTerrain -function sc__Missiles__MissileEvents_onTerrain takes integer this returns boolean +//Generated method caller for Missiles___MissileEvents.onTerrain +function sc__Missiles___MissileEvents_onTerrain takes integer this returns boolean set f__arg_this=this - //An error in the next line would mean declaration for Missiles__MissileEvents.onTerrain had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onTerrain had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onTerrain[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onTerrain[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onTerrain -function sx__Missiles__MissileEvents_onTerrain takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onTerrain +function sx__Missiles___MissileEvents_onTerrain takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onTerrain[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onTerrain[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onTileset -function sc__Missiles__MissileEvents_onTileset takes integer this,integer tileset returns boolean +//Generated method caller for Missiles___MissileEvents.onTileset +function sc__Missiles___MissileEvents_onTileset takes integer this,integer tileset returns boolean set f__arg_this=this set f__arg_integer1=tileset - //An error in the next line would mean declaration for Missiles__MissileEvents.onTileset had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onTileset had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onTileset[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onTileset[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onTileset -function sx__Missiles__MissileEvents_onTileset takes integer this,integer tileset returns nothing +//Generated method executor for Missiles___MissileEvents.onTileset +function sx__Missiles___MissileEvents_onTileset takes integer this,integer tileset returns nothing set f__arg_this=this set f__arg_integer1=tileset - call TriggerExecute(st__Missiles__MissileEvents_onTileset[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onTileset[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onPeriod -function sc__Missiles__MissileEvents_onPeriod takes integer this returns boolean +//Generated method caller for Missiles___MissileEvents.onPeriod +function sc__Missiles___MissileEvents_onPeriod takes integer this returns boolean set f__arg_this=this - //An error in the next line would mean declaration for Missiles__MissileEvents.onPeriod had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onPeriod had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onPeriod[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onPeriod[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onPeriod -function sx__Missiles__MissileEvents_onPeriod takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onPeriod +function sx__Missiles___MissileEvents_onPeriod takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onPeriod[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onPeriod[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onFinish -function sc__Missiles__MissileEvents_onFinish takes integer this returns boolean +//Generated method caller for Missiles___MissileEvents.onFinish +function sc__Missiles___MissileEvents_onFinish takes integer this returns boolean set f__arg_this=this - //An error in the next line would mean declaration for Missiles__MissileEvents.onFinish had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onFinish had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onFinish[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onFinish[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onFinish -function sx__Missiles__MissileEvents_onFinish takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onFinish +function sx__Missiles___MissileEvents_onFinish takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onFinish[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onFinish[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onBoundaries -function sc__Missiles__MissileEvents_onBoundaries takes integer this returns boolean +//Generated method caller for Missiles___MissileEvents.onBoundaries +function sc__Missiles___MissileEvents_onBoundaries takes integer this returns boolean set f__arg_this=this - //An error in the next line would mean declaration for Missiles__MissileEvents.onBoundaries had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onBoundaries had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onBoundaries[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onBoundaries[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onBoundaries -function sx__Missiles__MissileEvents_onBoundaries takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onBoundaries +function sx__Missiles___MissileEvents_onBoundaries takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onBoundaries[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onBoundaries[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onPause -function sc__Missiles__MissileEvents_onPause takes integer this returns boolean +//Generated method caller for Missiles___MissileEvents.onPause +function sc__Missiles___MissileEvents_onPause takes integer this returns boolean set f__arg_this=this - //An error in the next line would mean declaration for Missiles__MissileEvents.onPause had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onPause had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onPause[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onPause[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onPause -function sx__Missiles__MissileEvents_onPause takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onPause +function sx__Missiles___MissileEvents_onPause takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onPause[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onPause[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onResume -function sc__Missiles__MissileEvents_onResume takes integer this returns boolean +//Generated method caller for Missiles___MissileEvents.onResume +function sc__Missiles___MissileEvents_onResume takes integer this returns boolean set f__arg_this=this - //An error in the next line would mean declaration for Missiles__MissileEvents.onResume had a wrong default (false) + //An error in the next line would mean declaration for Missiles___MissileEvents.onResume had a wrong default (false) set f__result_boolean=false - call TriggerEvaluate(st__Missiles__MissileEvents_onResume[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onResume[si__Missiles___MissileEvents_type[this]]) return f__result_boolean endfunction -//Generated method executor for Missiles__MissileEvents.onResume -function sx__Missiles__MissileEvents_onResume takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onResume +function sx__Missiles___MissileEvents_onResume takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onResume[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onResume[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method caller for Missiles__MissileEvents.onRemove -function sc__Missiles__MissileEvents_onRemove takes integer this returns nothing +//Generated method caller for Missiles___MissileEvents.onRemove +function sc__Missiles___MissileEvents_onRemove takes integer this returns nothing set f__arg_this=this - call TriggerEvaluate(st__Missiles__MissileEvents_onRemove[si__Missiles__MissileEvents_type[this]]) + call TriggerEvaluate(st__Missiles___MissileEvents_onRemove[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated method executor for Missiles__MissileEvents.onRemove -function sx__Missiles__MissileEvents_onRemove takes integer this returns nothing +//Generated method executor for Missiles___MissileEvents.onRemove +function sx__Missiles___MissileEvents_onRemove takes integer this returns nothing set f__arg_this=this - call TriggerExecute(st__Missiles__MissileEvents_onRemove[si__Missiles__MissileEvents_type[this]]) + call TriggerExecute(st__Missiles___MissileEvents_onRemove[si__Missiles___MissileEvents_type[this]]) endfunction -//Generated destructor of Missiles__MissileEvents -function sc__Missiles__MissileEvents_deallocate takes integer this returns nothing +//Generated destructor of Missiles___MissileEvents +function sc__Missiles___MissileEvents_deallocate takes integer this returns nothing if this==null then return - elseif (si__Missiles__MissileEvents_V[this]!=-1) then + elseif (si__Missiles___MissileEvents_V[this]!=-1) then return endif set f__arg_this=this - call TriggerEvaluate(st__Missiles__MissileEvents_onDestroy[si__Missiles__MissileEvents_type[this]]) - set si__Missiles__MissileEvents_V[this]=si__Missiles__MissileEvents_F - set si__Missiles__MissileEvents_F=this + call TriggerEvaluate(st__Missiles___MissileEvents_onDestroy[si__Missiles___MissileEvents_type[this]]) + set si__Missiles___MissileEvents_V[this]=si__Missiles___MissileEvents_F + set si__Missiles___MissileEvents_F=this endfunction //Generated allocator of LifeSteal @@ -15811,32 +15781,32 @@ function s__UnitGroupRespawnSystemConfig___S_deallocate takes integer this retur set si__UnitGroupRespawnSystemConfig___S_F=this endfunction -//Generated allocator of TurretSystem___S -function s__TurretSystem___S__allocate takes nothing returns integer - local integer this=si__TurretSystem___S_F +//Generated allocator of TurretSystem__S +function s__TurretSystem__S__allocate takes nothing returns integer + local integer this=si__TurretSystem__S_F if (this!=0) then - set si__TurretSystem___S_F=si__TurretSystem___S_V[this] + set si__TurretSystem__S_F=si__TurretSystem__S_V[this] else - set si__TurretSystem___S_I=si__TurretSystem___S_I+1 - set this=si__TurretSystem___S_I + set si__TurretSystem__S_I=si__TurretSystem__S_I+1 + set this=si__TurretSystem__S_I endif if (this>8190) then return 0 endif - set si__TurretSystem___S_V[this]=-1 + set si__TurretSystem__S_V[this]=-1 return this endfunction -//Generated destructor of TurretSystem___S -function s__TurretSystem___S_deallocate takes integer this returns nothing +//Generated destructor of TurretSystem__S +function s__TurretSystem__S_deallocate takes integer this returns nothing if this==null then return - elseif (si__TurretSystem___S_V[this]!=-1) then + elseif (si__TurretSystem__S_V[this]!=-1) then return endif - set si__TurretSystem___S_V[this]=si__TurretSystem___S_F - set si__TurretSystem___S_F=this + set si__TurretSystem__S_V[this]=si__TurretSystem__S_F + set si__TurretSystem__S_F=this endfunction //Generated allocator of ubersplatTimed @@ -16133,32 +16103,32 @@ function s__Resource_deallocate takes integer this returns nothing set si__Resource_F=this endfunction -//Generated allocator of PluginSpellEffect__SUnit -function s__PluginSpellEffect__SUnit__allocate takes nothing returns integer - local integer this=si__PluginSpellEffect__SUnit_F +//Generated allocator of PluginSpellEffect___SUnit +function s__PluginSpellEffect___SUnit__allocate takes nothing returns integer + local integer this=si__PluginSpellEffect___SUnit_F if (this!=0) then - set si__PluginSpellEffect__SUnit_F=si__PluginSpellEffect__SUnit_V[this] + set si__PluginSpellEffect___SUnit_F=si__PluginSpellEffect___SUnit_V[this] else - set si__PluginSpellEffect__SUnit_I=si__PluginSpellEffect__SUnit_I+1 - set this=si__PluginSpellEffect__SUnit_I + set si__PluginSpellEffect___SUnit_I=si__PluginSpellEffect___SUnit_I+1 + set this=si__PluginSpellEffect___SUnit_I endif if (this>8190) then return 0 endif - set si__PluginSpellEffect__SUnit_V[this]=-1 + set si__PluginSpellEffect___SUnit_V[this]=-1 return this endfunction -//Generated destructor of PluginSpellEffect__SUnit -function s__PluginSpellEffect__SUnit_deallocate takes integer this returns nothing +//Generated destructor of PluginSpellEffect___SUnit +function s__PluginSpellEffect___SUnit_deallocate takes integer this returns nothing if this==null then return - elseif (si__PluginSpellEffect__SUnit_V[this]!=-1) then + elseif (si__PluginSpellEffect___SUnit_V[this]!=-1) then return endif - set si__PluginSpellEffect__SUnit_V[this]=si__PluginSpellEffect__SUnit_F - set si__PluginSpellEffect__SUnit_F=this + set si__PluginSpellEffect___SUnit_V[this]=si__PluginSpellEffect___SUnit_F + set si__PluginSpellEffect___SUnit_F=this endfunction //Generated allocator of PagedButtonsConfig @@ -16272,8 +16242,8 @@ function s__Knockback__allocate takes nothing returns integer set s__Knockback_duration[this]= 0.00 set s__Knockback_distance[this]= 0.00 set s__Knockback_angle[this]= 0.00 - set s__Knockback_aoeUnit[this]= Knockback__STANDARD_UNIT_RADIUS - set s__Knockback_aoeDest[this]= Knockback__STANDARD_DEST_RADIUS + set s__Knockback_aoeUnit[this]= Knockback___STANDARD_UNIT_RADIUS + set s__Knockback_aoeDest[this]= Knockback___STANDARD_DEST_RADIUS set s__Knockback_deceleration[this]= 0.00 set s__Knockback_fx[this]= null set s__Knockback_kbEffect[this]= null @@ -16287,7 +16257,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 @@ -16430,60 +16400,60 @@ 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 -function s__ItemRespawnSystem___S__allocate takes nothing returns integer - local integer this=si__ItemRespawnSystem___S_F +//Generated allocator of ItemRespawnSystem__S +function s__ItemRespawnSystem__S__allocate takes nothing returns integer + local integer this=si__ItemRespawnSystem__S_F if (this!=0) then - set si__ItemRespawnSystem___S_F=si__ItemRespawnSystem___S_V[this] + set si__ItemRespawnSystem__S_F=si__ItemRespawnSystem__S_V[this] else - set si__ItemRespawnSystem___S_I=si__ItemRespawnSystem___S_I+1 - set this=si__ItemRespawnSystem___S_I + set si__ItemRespawnSystem__S_I=si__ItemRespawnSystem__S_I+1 + set this=si__ItemRespawnSystem__S_I endif if (this>8190) then return 0 endif - set si__ItemRespawnSystem___S_V[this]=-1 + set si__ItemRespawnSystem__S_V[this]=-1 return this endfunction -//Generated destructor of ItemRespawnSystem___S -function s__ItemRespawnSystem___S_deallocate takes integer this returns nothing +//Generated destructor of ItemRespawnSystem__S +function s__ItemRespawnSystem__S_deallocate takes integer this returns nothing if this==null then return - elseif (si__ItemRespawnSystem___S_V[this]!=-1) then + elseif (si__ItemRespawnSystem__S_V[this]!=-1) then return endif - set si__ItemRespawnSystem___S_V[this]=si__ItemRespawnSystem___S_F - set si__ItemRespawnSystem___S_F=this + set si__ItemRespawnSystem__S_V[this]=si__ItemRespawnSystem__S_F + set si__ItemRespawnSystem__S_F=this endfunction //Generated allocator of Zone @@ -16515,8 +16485,8 @@ function s__Zone__allocate takes nothing returns integer endfunction -//Generated allocator of CooldownReductionUtils___CDRUtils -function s__CooldownReductionUtils___CDRUtils__allocate takes nothing returns integer +//Generated allocator of CooldownReductionUtils__CDRUtils +function s__CooldownReductionUtils__CDRUtils__allocate takes nothing returns integer local integer this=s__CDR__allocate() local integer kthis if(this==0) then @@ -16571,21 +16541,21 @@ endfunction //Generated allocator of Missiles function s__Missiles__allocate takes nothing returns integer local integer kthis - local integer this=si__Missiles__MissileEvents_F + local integer this=si__Missiles___MissileEvents_F if (this!=0) then - set si__Missiles__MissileEvents_F=si__Missiles__MissileEvents_V[this] + set si__Missiles___MissileEvents_F=si__Missiles___MissileEvents_V[this] else - set si__Missiles__MissileEvents_I=si__Missiles__MissileEvents_I+1 - set this=si__Missiles__MissileEvents_I + set si__Missiles___MissileEvents_I=si__Missiles___MissileEvents_I+1 + set this=si__Missiles___MissileEvents_I endif if (this>8190) then return 0 endif - set si__Missiles__MissileEvents_type[this]=107 + set si__Missiles___MissileEvents_type[this]=107 set kthis=this - set si__Missiles__MissileEvents_V[this]=-1 + set si__Missiles___MissileEvents_V[this]=-1 return this endfunction @@ -16761,8 +16731,8 @@ function s__TenacityUtils__allocate takes nothing returns integer endfunction -//Generated allocator of DamageInterfaceUtils___EvasionUtils -function s__DamageInterfaceUtils___EvasionUtils__allocate takes nothing returns integer +//Generated allocator of DamageInterfaceUtils__EvasionUtils +function s__DamageInterfaceUtils__EvasionUtils__allocate takes nothing returns integer local integer this=s__Evasion__allocate() local integer kthis if(this==0) then @@ -16775,8 +16745,8 @@ function s__DamageInterfaceUtils___EvasionUtils__allocate takes nothing returns endfunction -//Generated allocator of DamageInterfaceUtils___CriticalUtils -function s__DamageInterfaceUtils___CriticalUtils__allocate takes nothing returns integer +//Generated allocator of DamageInterfaceUtils__CriticalUtils +function s__DamageInterfaceUtils__CriticalUtils__allocate takes nothing returns integer local integer this=s__Critical__allocate() local integer kthis if(this==0) then @@ -16789,8 +16759,8 @@ function s__DamageInterfaceUtils___CriticalUtils__allocate takes nothing returns endfunction -//Generated allocator of DamageInterfaceUtils___SpellPowerUtils -function s__DamageInterfaceUtils___SpellPowerUtils__allocate takes nothing returns integer +//Generated allocator of DamageInterfaceUtils__SpellPowerUtils +function s__DamageInterfaceUtils__SpellPowerUtils__allocate takes nothing returns integer local integer this=s__SpellPower__allocate() local integer kthis if(this==0) then @@ -16803,8 +16773,8 @@ function s__DamageInterfaceUtils___SpellPowerUtils__allocate takes nothing retur endfunction -//Generated allocator of DamageInterfaceUtils___LifeStealUtils -function s__DamageInterfaceUtils___LifeStealUtils__allocate takes nothing returns integer +//Generated allocator of DamageInterfaceUtils__LifeStealUtils +function s__DamageInterfaceUtils__LifeStealUtils__allocate takes nothing returns integer local integer this=s__LifeSteal__allocate() local integer kthis if(this==0) then @@ -16817,8 +16787,8 @@ function s__DamageInterfaceUtils___LifeStealUtils__allocate takes nothing return endfunction -//Generated allocator of DamageInterfaceUtils___SpellVampUtils -function s__DamageInterfaceUtils___SpellVampUtils__allocate takes nothing returns integer +//Generated allocator of DamageInterfaceUtils__SpellVampUtils +function s__DamageInterfaceUtils__SpellVampUtils__allocate takes nothing returns integer local integer this=s__SpellVamp__allocate() local integer kthis if(this==0) then @@ -17453,7 +17423,7 @@ function h__RemoveUnit takes unit a0 returns nothing call sc___prototype10_evaluate(1,a0) //hook: HeroUtils___RemoveUnitHook call sc___prototype10_evaluate(2,a0) - //hook: IdleWorkersSystem___RemoveUnitHook + //hook: IdleWorkersSystem__RemoveUnitHook call sc___prototype10_evaluate(3,a0) //hook: ItemOrbOfLight___RemoveUnitHook call sc___prototype10_evaluate(4,a0) @@ -17461,37 +17431,37 @@ function h__RemoveUnit takes unit a0 returns nothing call sc___prototype10_evaluate(5,a0) //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 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 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) @@ -17511,17 +17481,17 @@ function h__RemoveUnit takes unit a0 returns nothing call sc___prototype10_evaluate(28,a0) //hook: WoWReforgedWrapUp__HookRemoveConstructedBuilding call sc___prototype10_evaluate(29,a0) - //hook: WoWReforgedEquipment___RemoveUnitHook + //hook: WoWReforgedEquipment__RemoveUnitHook call sc___prototype10_evaluate(30,a0) call RemoveUnit(a0) endfunction function h__DestroyBoolExpr takes boolexpr a0 returns nothing - //hook: GroupUtils__HookDestroyBoolExpr + //hook: GroupUtils___HookDestroyBoolExpr call sc___prototype54_evaluate(1,a0) call DestroyBoolExpr(a0) endfunction function h__RemoveItem takes item a0 returns nothing - //hook: ItemRespawnSystem___RemoveItemCleanup + //hook: ItemRespawnSystem__RemoveItemCleanup call sc___prototype80_evaluate(1,a0) call RemoveItem(a0) endfunction @@ -18132,31 +18102,31 @@ endfunction //library Alloc ends //library Ascii: function Char2Ascii takes string p returns integer - local integer z= Ascii__i[StringHash(p) / 0x1F0748 + 0x40D] - if ( Ascii__c[z] != p ) then - if ( Ascii__c[z - 32] != p ) then - if ( Ascii__c[Ascii__h[z]] != p ) then - if ( Ascii__c[Ascii__y[z]] != p ) then - if ( Ascii__c[83] != p ) then + local integer z= Ascii___i[StringHash(p) / 0x1F0748 + 0x40D] + if ( Ascii___c[z] != p ) then + if ( Ascii___c[z - 32] != p ) then + if ( Ascii___c[Ascii___h[z]] != p ) then + if ( Ascii___c[Ascii___y[z]] != p ) then + if ( Ascii___c[83] != p ) then return 0 endif return 83 endif - return Ascii__y[z] + return Ascii___y[z] endif - return Ascii__h[z] + return Ascii___h[z] endif return z - 32 endif return z endfunction function Ascii2Char takes integer a returns string - return Ascii__c[a] + return Ascii___c[a] endfunction function A2S takes integer a returns string local string s="" loop - set s=Ascii__c[a - a / 256 * 256] + s + set s=Ascii___c[a - a / 256 * 256] + s set a=a / 256 exitwhen 0 == a endloop @@ -18167,7 +18137,7 @@ endfunction local integer l=StringLength(s) local integer j=0 local string m - local integer l__Ascii__h + local integer l__Ascii___h loop exitwhen j == l set a=a * 256 + Char2Ascii(SubString(s, j, j + 1)) @@ -18175,437 +18145,437 @@ endfunction endloop return a endfunction -//Implemented from module Ascii__Init: - 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 - set Ascii__i[1375]=12 - set Ascii__i[447]=13 - set Ascii__i[233]=32 - set Ascii__i[2014]=33 - set Ascii__i[1348]=34 - set Ascii__i[1038]=35 - set Ascii__i[1299]=36 - set Ascii__i[1018]=37 - set Ascii__i[1312]=38 - set Ascii__i[341]=39 - set Ascii__i[939]=40 - set Ascii__i[969]=41 - set Ascii__i[952]=42 - set Ascii__i[2007]=43 - set Ascii__i[1415]=44 - set Ascii__i[2020]=45 - set Ascii__i[904]=46 - set Ascii__i[1941]=47 - set Ascii__i[918]=48 - set Ascii__i[1593]=49 - set Ascii__i[719]=50 - set Ascii__i[617]=51 - set Ascii__i[703]=52 - set Ascii__i[573]=53 - set Ascii__i[707]=54 - set Ascii__i[1208]=55 - set Ascii__i[106]=56 - set Ascii__i[312]=57 - set Ascii__i[124]=58 - set Ascii__i[1176]=59 - set Ascii__i[74]=60 - set Ascii__i[1206]=61 - set Ascii__i[86]=62 - set Ascii__i[340]=63 - set Ascii__i[35]=64 - set Ascii__i[257]=65 - set Ascii__i[213]=66 - set Ascii__i[271]=67 - set Ascii__i[219]=68 - set Ascii__i[1330]=69 - set Ascii__i[1425]=70 - set Ascii__i[1311]=71 - set Ascii__i[238]=72 - set Ascii__i[1349]=73 - set Ascii__i[244]=74 - set Ascii__i[1350]=75 - set Ascii__i[205]=76 - set Ascii__i[1392]=77 - set Ascii__i[1378]=78 - set Ascii__i[1432]=79 - set Ascii__i[1455]=80 - set Ascii__i[1454]=81 - set Ascii__i[1431]=82 - set Ascii__i[1409]=83 - set Ascii__i[1442]=84 - set Ascii__i[534]=85 - set Ascii__i[1500]=86 - set Ascii__i[771]=87 - set Ascii__i[324]=88 - set Ascii__i[1021]=89 - set Ascii__i[73]=90 - set Ascii__i[1265]=91 - set Ascii__i[1941]=92 - set Ascii__i[1671]=93 - set Ascii__i[1451]=94 - set Ascii__i[1952]=95 - set Ascii__i[252]=96 - set Ascii__i[257]=97 - set Ascii__i[213]=98 - set Ascii__i[271]=99 - set Ascii__i[219]=100 - set Ascii__i[1330]=101 - set Ascii__i[1425]=102 - set Ascii__i[1311]=103 - set Ascii__i[238]=104 - set Ascii__i[1349]=105 - set Ascii__i[244]=106 - set Ascii__i[1350]=107 - set Ascii__i[205]=108 - set Ascii__i[1392]=109 - set Ascii__i[1378]=110 - set Ascii__i[1432]=111 - set Ascii__i[1455]=112 - set Ascii__i[1454]=113 - set Ascii__i[1431]=114 - set Ascii__i[1409]=115 - set Ascii__i[1442]=116 - set Ascii__i[534]=117 - set Ascii__i[1500]=118 - set Ascii__i[771]=119 - set Ascii__i[324]=120 - set Ascii__i[1021]=121 - set Ascii__i[73]=122 - set Ascii__i[868]=123 - set Ascii__i[1254]=124 - set Ascii__i[588]=125 - set Ascii__i[93]=126 - set Ascii__i[316]=161 - set Ascii__i[779]=162 - set Ascii__i[725]=163 - set Ascii__i[287]=164 - set Ascii__i[212]=165 - set Ascii__i[7]=166 - set Ascii__i[29]=167 - set Ascii__i[1958]=168 - set Ascii__i[1009]=169 - set Ascii__i[1580]=170 - set Ascii__i[1778]=171 - set Ascii__i[103]=172 - set Ascii__i[400]=174 - set Ascii__i[1904]=175 - set Ascii__i[135]=176 - set Ascii__i[1283]=177 - set Ascii__i[469]=178 - set Ascii__i[363]=179 - set Ascii__i[550]=180 - set Ascii__i[1831]=181 - set Ascii__i[1308]=182 - set Ascii__i[1234]=183 - set Ascii__i[1017]=184 - set Ascii__i[1093]=185 - set Ascii__i[1577]=186 - set Ascii__i[606]=187 - set Ascii__i[1585]=188 - set Ascii__i[1318]=189 - set Ascii__i[980]=190 - set Ascii__i[1699]=191 - set Ascii__i[1292]=192 - set Ascii__i[477]=193 - set Ascii__i[709]=194 - set Ascii__i[1600]=195 - set Ascii__i[2092]=196 - set Ascii__i[50]=197 - set Ascii__i[546]=198 - set Ascii__i[408]=199 - set Ascii__i[853]=200 - set Ascii__i[205]=201 - set Ascii__i[411]=202 - set Ascii__i[1311]=203 - set Ascii__i[1422]=204 - set Ascii__i[1808]=205 - set Ascii__i[457]=206 - set Ascii__i[1280]=207 - set Ascii__i[614]=208 - set Ascii__i[1037]=209 - set Ascii__i[237]=210 - set Ascii__i[1409]=211 - set Ascii__i[1023]=212 - set Ascii__i[1361]=213 - set Ascii__i[695]=214 - set Ascii__i[161]=215 - set Ascii__i[1645]=216 - set Ascii__i[1822]=217 - set Ascii__i[644]=218 - set Ascii__i[1395]=219 - set Ascii__i[677]=220 - set Ascii__i[1677]=221 - set Ascii__i[881]=222 - set Ascii__i[861]=223 - set Ascii__i[1408]=224 - set Ascii__i[1864]=225 - set Ascii__i[1467]=226 - set Ascii__i[1819]=227 - set Ascii__i[1971]=228 - set Ascii__i[949]=229 - set Ascii__i[774]=230 - set Ascii__i[1828]=231 - set Ascii__i[865]=232 - set Ascii__i[699]=233 - set Ascii__i[786]=234 - set Ascii__i[1806]=235 - set Ascii__i[1286]=236 - set Ascii__i[1128]=237 - set Ascii__i[1490]=238 - set Ascii__i[1720]=239 - set Ascii__i[1817]=240 - set Ascii__i[729]=241 - set Ascii__i[1191]=242 - set Ascii__i[1164]=243 - set Ascii__i[413]=244 - set Ascii__i[349]=245 - set Ascii__i[1409]=246 - set Ascii__i[660]=247 - set Ascii__i[2016]=248 - set Ascii__i[1087]=249 - set Ascii__i[1497]=250 - set Ascii__i[753]=251 - set Ascii__i[1579]=252 - set Ascii__i[1456]=253 - set Ascii__i[606]=254 - set Ascii__i[1625]=255 - set Ascii__h[92]=47 - set Ascii__h[201]=108 - set Ascii__h[201]=76 - set Ascii__h[203]=103 - set Ascii__h[203]=71 - set Ascii__h[246]=115 - set Ascii__h[246]=83 - set Ascii__h[246]=211 - set Ascii__h[254]=187 - set Ascii__y[201]=108 - set Ascii__y[203]=103 - set Ascii__y[246]=115 - - set Ascii__c[8]="\b" - set Ascii__c[9]="\t" - set Ascii__c[10]="\n" - set Ascii__c[12]="\f" - set Ascii__c[13]="\r" - set Ascii__c[32]=" " - set Ascii__c[33]="!" - set Ascii__c[34]="\"" - set Ascii__c[35]="#" - set Ascii__c[36]="$" - set Ascii__c[37]="" - set Ascii__c[38]="&" - set Ascii__c[39]="'" - set Ascii__c[40]="(" - set Ascii__c[41]=")" - set Ascii__c[42]="*" - set Ascii__c[43]="+" - set Ascii__c[44]="," - set Ascii__c[45]="-" - set Ascii__c[46]="." - set Ascii__c[47]="/" - set Ascii__c[48]="0" - set Ascii__c[49]="1" - set Ascii__c[50]="2" - set Ascii__c[51]="3" - set Ascii__c[52]="4" - set Ascii__c[53]="5" - set Ascii__c[54]="6" - set Ascii__c[55]="7" - set Ascii__c[56]="8" - set Ascii__c[57]="9" - set Ascii__c[58]=":" - set Ascii__c[59]=";" - set Ascii__c[60]="<" - set Ascii__c[61]="=" - set Ascii__c[62]=">" - set Ascii__c[63]="?" - set Ascii__c[64]="@" - set Ascii__c[65]="A" - set Ascii__c[66]="B" - set Ascii__c[67]="C" - set Ascii__c[68]="D" - set Ascii__c[69]="E" - set Ascii__c[70]="F" - set Ascii__c[71]="G" - set Ascii__c[72]="H" - set Ascii__c[73]="I" - set Ascii__c[74]="J" - set Ascii__c[75]="K" - set Ascii__c[76]="L" - set Ascii__c[77]="M" - set Ascii__c[78]="N" - set Ascii__c[79]="O" - set Ascii__c[80]="P" - set Ascii__c[81]="Q" - set Ascii__c[82]="R" - set Ascii__c[83]="S" - set Ascii__c[84]="T" - set Ascii__c[85]="U" - set Ascii__c[86]="V" - set Ascii__c[87]="W" - set Ascii__c[88]="X" - set Ascii__c[89]="Y" - set Ascii__c[90]="Z" - set Ascii__c[91]="[" - set Ascii__c[92]="\\" - set Ascii__c[93]="]" - set Ascii__c[94]="^" - set Ascii__c[95]="_" - set Ascii__c[96]="`" - set Ascii__c[97]="a" - set Ascii__c[98]="b" - set Ascii__c[99]="c" - set Ascii__c[100]="d" - set Ascii__c[101]="e" - set Ascii__c[102]="f" - set Ascii__c[103]="g" - set Ascii__c[104]="h" - set Ascii__c[105]="i" - set Ascii__c[106]="j" - set Ascii__c[107]="k" - set Ascii__c[108]="l" - set Ascii__c[109]="m" - set Ascii__c[110]="n" - set Ascii__c[111]="o" - set Ascii__c[112]="p" - set Ascii__c[113]="q" - set Ascii__c[114]="r" - set Ascii__c[115]="s" - set Ascii__c[116]="t" - set Ascii__c[117]="u" - set Ascii__c[118]="v" - set Ascii__c[119]="w" - set Ascii__c[120]="x" - set Ascii__c[121]="y" - set Ascii__c[122]="z" - set Ascii__c[123]="{" - set Ascii__c[124]="|" - set Ascii__c[125]="}" - set Ascii__c[126]="~" - set Ascii__c[128]="€" - set Ascii__c[130]="‚" - set Ascii__c[131]="ƒ" - set Ascii__c[132]="„" - set Ascii__c[133]="…" - set Ascii__c[134]="†" - set Ascii__c[135]="‡" - set Ascii__c[136]="ˆ" - set Ascii__c[137]="‰" - set Ascii__c[138]="Š" - set Ascii__c[139]="‹" - set Ascii__c[140]="Œ" - set Ascii__c[142]="Ž" - set Ascii__c[145]="‘" - set Ascii__c[146]="’" - set Ascii__c[147]="“" - set Ascii__c[148]="”" - set Ascii__c[149]="•" - set Ascii__c[150]="–" - set Ascii__c[151]="—" - set Ascii__c[152]="˜" - set Ascii__c[153]="™" - set Ascii__c[154]="š" - set Ascii__c[155]="›" - set Ascii__c[156]="œ" - set Ascii__c[158]="ž" - set Ascii__c[159]="Ÿ" - set Ascii__c[160]=" " - set Ascii__c[161]="¡" - set Ascii__c[162]="¢" - set Ascii__c[163]="£" - set Ascii__c[164]="¤" - set Ascii__c[165]="¥" - set Ascii__c[166]="¦" - set Ascii__c[167]="§" - set Ascii__c[168]="¨" - set Ascii__c[169]="©" - set Ascii__c[170]="ª" - set Ascii__c[171]="«" - set Ascii__c[172]="¬" - set Ascii__c[174]="®" - set Ascii__c[175]="¯" - set Ascii__c[176]="°" - set Ascii__c[177]="±" - set Ascii__c[178]="²" - set Ascii__c[179]="³" - set Ascii__c[180]="´" - set Ascii__c[181]="µ" - set Ascii__c[182]="¶" - set Ascii__c[183]="·" - set Ascii__c[184]="¸" - set Ascii__c[185]="¹" - set Ascii__c[186]="º" - set Ascii__c[187]="»" - set Ascii__c[188]="¼" - set Ascii__c[189]="½" - set Ascii__c[190]="¾" - set Ascii__c[191]="¿" - set Ascii__c[192]="À" - set Ascii__c[193]="Á" - set Ascii__c[194]="Â" - set Ascii__c[195]="Ã" - set Ascii__c[196]="Ä" - set Ascii__c[197]="Å" - set Ascii__c[198]="Æ" - set Ascii__c[199]="Ç" - set Ascii__c[200]="È" - set Ascii__c[201]="É" - set Ascii__c[202]="Ê" - set Ascii__c[203]="Ë" - set Ascii__c[204]="Ì" - set Ascii__c[205]="Í" - set Ascii__c[206]="Î" - set Ascii__c[207]="Ï" - set Ascii__c[208]="Ð" - set Ascii__c[209]="Ñ" - set Ascii__c[210]="Ò" - set Ascii__c[211]="Ó" - set Ascii__c[212]="Ô" - set Ascii__c[213]="Õ" - set Ascii__c[214]="Ö" - set Ascii__c[215]="×" - set Ascii__c[216]="Ø" - set Ascii__c[217]="Ù" - set Ascii__c[218]="Ú" - set Ascii__c[219]="Û" - set Ascii__c[220]="Ü" - set Ascii__c[221]="Ý" - set Ascii__c[222]="Þ" - set Ascii__c[223]="ß" - set Ascii__c[224]="à" - set Ascii__c[225]="á" - set Ascii__c[226]="â" - set Ascii__c[227]="ã" - set Ascii__c[228]="ä" - set Ascii__c[229]="å" - set Ascii__c[230]="æ" - set Ascii__c[231]="ç" - set Ascii__c[232]="è" - set Ascii__c[233]="é" - set Ascii__c[234]="ê" - set Ascii__c[235]="ë" - set Ascii__c[236]="ì" - set Ascii__c[237]="í" - set Ascii__c[238]="î" - set Ascii__c[239]="ï" - set Ascii__c[240]="ð" - set Ascii__c[241]="ñ" - set Ascii__c[242]="ò" - set Ascii__c[243]="ó" - set Ascii__c[244]="ô" - set Ascii__c[245]="õ" - set Ascii__c[246]="ö" - set Ascii__c[247]="÷" - set Ascii__c[248]="ø" - set Ascii__c[249]="ù" - set Ascii__c[250]="ú" - set Ascii__c[251]="û" - set Ascii__c[252]="ü" - set Ascii__c[253]="ý" - set Ascii__c[254]="þ" - set Ascii__c[255]="ÿ" +//Implemented from module Ascii___Init: + 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 + set Ascii___i[1375]=12 + set Ascii___i[447]=13 + set Ascii___i[233]=32 + set Ascii___i[2014]=33 + set Ascii___i[1348]=34 + set Ascii___i[1038]=35 + set Ascii___i[1299]=36 + set Ascii___i[1018]=37 + set Ascii___i[1312]=38 + set Ascii___i[341]=39 + set Ascii___i[939]=40 + set Ascii___i[969]=41 + set Ascii___i[952]=42 + set Ascii___i[2007]=43 + set Ascii___i[1415]=44 + set Ascii___i[2020]=45 + set Ascii___i[904]=46 + set Ascii___i[1941]=47 + set Ascii___i[918]=48 + set Ascii___i[1593]=49 + set Ascii___i[719]=50 + set Ascii___i[617]=51 + set Ascii___i[703]=52 + set Ascii___i[573]=53 + set Ascii___i[707]=54 + set Ascii___i[1208]=55 + set Ascii___i[106]=56 + set Ascii___i[312]=57 + set Ascii___i[124]=58 + set Ascii___i[1176]=59 + set Ascii___i[74]=60 + set Ascii___i[1206]=61 + set Ascii___i[86]=62 + set Ascii___i[340]=63 + set Ascii___i[35]=64 + set Ascii___i[257]=65 + set Ascii___i[213]=66 + set Ascii___i[271]=67 + set Ascii___i[219]=68 + set Ascii___i[1330]=69 + set Ascii___i[1425]=70 + set Ascii___i[1311]=71 + set Ascii___i[238]=72 + set Ascii___i[1349]=73 + set Ascii___i[244]=74 + set Ascii___i[1350]=75 + set Ascii___i[205]=76 + set Ascii___i[1392]=77 + set Ascii___i[1378]=78 + set Ascii___i[1432]=79 + set Ascii___i[1455]=80 + set Ascii___i[1454]=81 + set Ascii___i[1431]=82 + set Ascii___i[1409]=83 + set Ascii___i[1442]=84 + set Ascii___i[534]=85 + set Ascii___i[1500]=86 + set Ascii___i[771]=87 + set Ascii___i[324]=88 + set Ascii___i[1021]=89 + set Ascii___i[73]=90 + set Ascii___i[1265]=91 + set Ascii___i[1941]=92 + set Ascii___i[1671]=93 + set Ascii___i[1451]=94 + set Ascii___i[1952]=95 + set Ascii___i[252]=96 + set Ascii___i[257]=97 + set Ascii___i[213]=98 + set Ascii___i[271]=99 + set Ascii___i[219]=100 + set Ascii___i[1330]=101 + set Ascii___i[1425]=102 + set Ascii___i[1311]=103 + set Ascii___i[238]=104 + set Ascii___i[1349]=105 + set Ascii___i[244]=106 + set Ascii___i[1350]=107 + set Ascii___i[205]=108 + set Ascii___i[1392]=109 + set Ascii___i[1378]=110 + set Ascii___i[1432]=111 + set Ascii___i[1455]=112 + set Ascii___i[1454]=113 + set Ascii___i[1431]=114 + set Ascii___i[1409]=115 + set Ascii___i[1442]=116 + set Ascii___i[534]=117 + set Ascii___i[1500]=118 + set Ascii___i[771]=119 + set Ascii___i[324]=120 + set Ascii___i[1021]=121 + set Ascii___i[73]=122 + set Ascii___i[868]=123 + set Ascii___i[1254]=124 + set Ascii___i[588]=125 + set Ascii___i[93]=126 + set Ascii___i[316]=161 + set Ascii___i[779]=162 + set Ascii___i[725]=163 + set Ascii___i[287]=164 + set Ascii___i[212]=165 + set Ascii___i[7]=166 + set Ascii___i[29]=167 + set Ascii___i[1958]=168 + set Ascii___i[1009]=169 + set Ascii___i[1580]=170 + set Ascii___i[1778]=171 + set Ascii___i[103]=172 + set Ascii___i[400]=174 + set Ascii___i[1904]=175 + set Ascii___i[135]=176 + set Ascii___i[1283]=177 + set Ascii___i[469]=178 + set Ascii___i[363]=179 + set Ascii___i[550]=180 + set Ascii___i[1831]=181 + set Ascii___i[1308]=182 + set Ascii___i[1234]=183 + set Ascii___i[1017]=184 + set Ascii___i[1093]=185 + set Ascii___i[1577]=186 + set Ascii___i[606]=187 + set Ascii___i[1585]=188 + set Ascii___i[1318]=189 + set Ascii___i[980]=190 + set Ascii___i[1699]=191 + set Ascii___i[1292]=192 + set Ascii___i[477]=193 + set Ascii___i[709]=194 + set Ascii___i[1600]=195 + set Ascii___i[2092]=196 + set Ascii___i[50]=197 + set Ascii___i[546]=198 + set Ascii___i[408]=199 + set Ascii___i[853]=200 + set Ascii___i[205]=201 + set Ascii___i[411]=202 + set Ascii___i[1311]=203 + set Ascii___i[1422]=204 + set Ascii___i[1808]=205 + set Ascii___i[457]=206 + set Ascii___i[1280]=207 + set Ascii___i[614]=208 + set Ascii___i[1037]=209 + set Ascii___i[237]=210 + set Ascii___i[1409]=211 + set Ascii___i[1023]=212 + set Ascii___i[1361]=213 + set Ascii___i[695]=214 + set Ascii___i[161]=215 + set Ascii___i[1645]=216 + set Ascii___i[1822]=217 + set Ascii___i[644]=218 + set Ascii___i[1395]=219 + set Ascii___i[677]=220 + set Ascii___i[1677]=221 + set Ascii___i[881]=222 + set Ascii___i[861]=223 + set Ascii___i[1408]=224 + set Ascii___i[1864]=225 + set Ascii___i[1467]=226 + set Ascii___i[1819]=227 + set Ascii___i[1971]=228 + set Ascii___i[949]=229 + set Ascii___i[774]=230 + set Ascii___i[1828]=231 + set Ascii___i[865]=232 + set Ascii___i[699]=233 + set Ascii___i[786]=234 + set Ascii___i[1806]=235 + set Ascii___i[1286]=236 + set Ascii___i[1128]=237 + set Ascii___i[1490]=238 + set Ascii___i[1720]=239 + set Ascii___i[1817]=240 + set Ascii___i[729]=241 + set Ascii___i[1191]=242 + set Ascii___i[1164]=243 + set Ascii___i[413]=244 + set Ascii___i[349]=245 + set Ascii___i[1409]=246 + set Ascii___i[660]=247 + set Ascii___i[2016]=248 + set Ascii___i[1087]=249 + set Ascii___i[1497]=250 + set Ascii___i[753]=251 + set Ascii___i[1579]=252 + set Ascii___i[1456]=253 + set Ascii___i[606]=254 + set Ascii___i[1625]=255 + set Ascii___h[92]=47 + set Ascii___h[201]=108 + set Ascii___h[201]=76 + set Ascii___h[203]=103 + set Ascii___h[203]=71 + set Ascii___h[246]=115 + set Ascii___h[246]=83 + set Ascii___h[246]=211 + set Ascii___h[254]=187 + set Ascii___y[201]=108 + set Ascii___y[203]=103 + set Ascii___y[246]=115 + + set Ascii___c[8]="\b" + set Ascii___c[9]="\t" + set Ascii___c[10]="\n" + set Ascii___c[12]="\f" + set Ascii___c[13]="\r" + set Ascii___c[32]=" " + set Ascii___c[33]="!" + set Ascii___c[34]="\"" + set Ascii___c[35]="#" + set Ascii___c[36]="$" + set Ascii___c[37]="" + set Ascii___c[38]="&" + set Ascii___c[39]="'" + set Ascii___c[40]="(" + set Ascii___c[41]=")" + set Ascii___c[42]="*" + set Ascii___c[43]="+" + set Ascii___c[44]="," + set Ascii___c[45]="-" + set Ascii___c[46]="." + set Ascii___c[47]="/" + set Ascii___c[48]="0" + set Ascii___c[49]="1" + set Ascii___c[50]="2" + set Ascii___c[51]="3" + set Ascii___c[52]="4" + set Ascii___c[53]="5" + set Ascii___c[54]="6" + set Ascii___c[55]="7" + set Ascii___c[56]="8" + set Ascii___c[57]="9" + set Ascii___c[58]=":" + set Ascii___c[59]=";" + set Ascii___c[60]="<" + set Ascii___c[61]="=" + set Ascii___c[62]=">" + set Ascii___c[63]="?" + set Ascii___c[64]="@" + set Ascii___c[65]="A" + set Ascii___c[66]="B" + set Ascii___c[67]="C" + set Ascii___c[68]="D" + set Ascii___c[69]="E" + set Ascii___c[70]="F" + set Ascii___c[71]="G" + set Ascii___c[72]="H" + set Ascii___c[73]="I" + set Ascii___c[74]="J" + set Ascii___c[75]="K" + set Ascii___c[76]="L" + set Ascii___c[77]="M" + set Ascii___c[78]="N" + set Ascii___c[79]="O" + set Ascii___c[80]="P" + set Ascii___c[81]="Q" + set Ascii___c[82]="R" + set Ascii___c[83]="S" + set Ascii___c[84]="T" + set Ascii___c[85]="U" + set Ascii___c[86]="V" + set Ascii___c[87]="W" + set Ascii___c[88]="X" + set Ascii___c[89]="Y" + set Ascii___c[90]="Z" + set Ascii___c[91]="[" + set Ascii___c[92]="\\" + set Ascii___c[93]="]" + set Ascii___c[94]="^" + set Ascii___c[95]="_" + set Ascii___c[96]="`" + set Ascii___c[97]="a" + set Ascii___c[98]="b" + set Ascii___c[99]="c" + set Ascii___c[100]="d" + set Ascii___c[101]="e" + set Ascii___c[102]="f" + set Ascii___c[103]="g" + set Ascii___c[104]="h" + set Ascii___c[105]="i" + set Ascii___c[106]="j" + set Ascii___c[107]="k" + set Ascii___c[108]="l" + set Ascii___c[109]="m" + set Ascii___c[110]="n" + set Ascii___c[111]="o" + set Ascii___c[112]="p" + set Ascii___c[113]="q" + set Ascii___c[114]="r" + set Ascii___c[115]="s" + set Ascii___c[116]="t" + set Ascii___c[117]="u" + set Ascii___c[118]="v" + set Ascii___c[119]="w" + set Ascii___c[120]="x" + set Ascii___c[121]="y" + set Ascii___c[122]="z" + set Ascii___c[123]="{" + set Ascii___c[124]="|" + set Ascii___c[125]="}" + set Ascii___c[126]="~" + set Ascii___c[128]="€" + set Ascii___c[130]="‚" + set Ascii___c[131]="ƒ" + set Ascii___c[132]="„" + set Ascii___c[133]="…" + set Ascii___c[134]="†" + set Ascii___c[135]="‡" + set Ascii___c[136]="ˆ" + set Ascii___c[137]="‰" + set Ascii___c[138]="Š" + set Ascii___c[139]="‹" + set Ascii___c[140]="Œ" + set Ascii___c[142]="Ž" + set Ascii___c[145]="‘" + set Ascii___c[146]="’" + set Ascii___c[147]="“" + set Ascii___c[148]="”" + set Ascii___c[149]="•" + set Ascii___c[150]="–" + set Ascii___c[151]="—" + set Ascii___c[152]="˜" + set Ascii___c[153]="™" + set Ascii___c[154]="š" + set Ascii___c[155]="›" + set Ascii___c[156]="œ" + set Ascii___c[158]="ž" + set Ascii___c[159]="Ÿ" + set Ascii___c[160]=" " + set Ascii___c[161]="¡" + set Ascii___c[162]="¢" + set Ascii___c[163]="£" + set Ascii___c[164]="¤" + set Ascii___c[165]="¥" + set Ascii___c[166]="¦" + set Ascii___c[167]="§" + set Ascii___c[168]="¨" + set Ascii___c[169]="©" + set Ascii___c[170]="ª" + set Ascii___c[171]="«" + set Ascii___c[172]="¬" + set Ascii___c[174]="®" + set Ascii___c[175]="¯" + set Ascii___c[176]="°" + set Ascii___c[177]="±" + set Ascii___c[178]="²" + set Ascii___c[179]="³" + set Ascii___c[180]="´" + set Ascii___c[181]="µ" + set Ascii___c[182]="¶" + set Ascii___c[183]="·" + set Ascii___c[184]="¸" + set Ascii___c[185]="¹" + set Ascii___c[186]="º" + set Ascii___c[187]="»" + set Ascii___c[188]="¼" + set Ascii___c[189]="½" + set Ascii___c[190]="¾" + set Ascii___c[191]="¿" + set Ascii___c[192]="À" + set Ascii___c[193]="Á" + set Ascii___c[194]="Â" + set Ascii___c[195]="Ã" + set Ascii___c[196]="Ä" + set Ascii___c[197]="Å" + set Ascii___c[198]="Æ" + set Ascii___c[199]="Ç" + set Ascii___c[200]="È" + set Ascii___c[201]="É" + set Ascii___c[202]="Ê" + set Ascii___c[203]="Ë" + set Ascii___c[204]="Ì" + set Ascii___c[205]="Í" + set Ascii___c[206]="Î" + set Ascii___c[207]="Ï" + set Ascii___c[208]="Ð" + set Ascii___c[209]="Ñ" + set Ascii___c[210]="Ò" + set Ascii___c[211]="Ó" + set Ascii___c[212]="Ô" + set Ascii___c[213]="Õ" + set Ascii___c[214]="Ö" + set Ascii___c[215]="×" + set Ascii___c[216]="Ø" + set Ascii___c[217]="Ù" + set Ascii___c[218]="Ú" + set Ascii___c[219]="Û" + set Ascii___c[220]="Ü" + set Ascii___c[221]="Ý" + set Ascii___c[222]="Þ" + set Ascii___c[223]="ß" + set Ascii___c[224]="à" + set Ascii___c[225]="á" + set Ascii___c[226]="â" + set Ascii___c[227]="ã" + set Ascii___c[228]="ä" + set Ascii___c[229]="å" + set Ascii___c[230]="æ" + set Ascii___c[231]="ç" + set Ascii___c[232]="è" + set Ascii___c[233]="é" + set Ascii___c[234]="ê" + set Ascii___c[235]="ë" + set Ascii___c[236]="ì" + set Ascii___c[237]="í" + set Ascii___c[238]="î" + set Ascii___c[239]="ï" + set Ascii___c[240]="ð" + set Ascii___c[241]="ñ" + set Ascii___c[242]="ò" + set Ascii___c[243]="ó" + set Ascii___c[244]="ô" + set Ascii___c[245]="õ" + set Ascii___c[246]="ö" + set Ascii___c[247]="÷" + set Ascii___c[248]="ø" + set Ascii___c[249]="ù" + set Ascii___c[250]="ú" + set Ascii___c[251]="û" + set Ascii___c[252]="ü" + set Ascii___c[253]="ý" + set Ascii___c[254]="þ" + set Ascii___c[255]="ÿ" endfunction //library Ascii ends @@ -18694,74 +18664,74 @@ endfunction function GetTriggerBlackArrowCaster takes nothing returns unit - return BlackArrowSystem___BlackArrowCaster + return BlackArrowSystem__BlackArrowCaster endfunction function GetTriggerBlackArrowTarget takes nothing returns unit - return BlackArrowSystem___BlackArrowTarget + return BlackArrowSystem__BlackArrowTarget endfunction function GetTriggerBlackArrowSummonedUnits takes nothing returns group - return BlackArrowSystem___BlackArrowSummonedUnits + return BlackArrowSystem__BlackArrowSummonedUnits endfunction function GetTriggerBlackArrowAbilityId takes nothing returns integer - return BlackArrowSystem___BlackArrowAbilityId + return BlackArrowSystem__BlackArrowAbilityId endfunction function TriggerRegisterBlackArrowEvent takes trigger whichTrigger returns nothing - set BlackArrowSystem___BlackArrowCallbackTrigger[BlackArrowSystem___BlackArrowCallbackTriggerCounter]=whichTrigger - set BlackArrowSystem___BlackArrowCallbackTriggerCounter=BlackArrowSystem___BlackArrowCallbackTriggerCounter + 1 + set BlackArrowSystem__BlackArrowCallbackTrigger[BlackArrowSystem__BlackArrowCallbackTriggerCounter]=whichTrigger + set BlackArrowSystem__BlackArrowCallbackTriggerCounter=BlackArrowSystem__BlackArrowCallbackTriggerCounter + 1 endfunction function BlackArrowAddAbility takes integer abilityId,integer level,integer summonedUnitTypeId,integer summonedUnitsCount,real summonedUnitDuration,real durationHero,real durationUnit,integer buffId returns integer - set BlackArrowSystem___BlackArrowAbiliyId[BlackArrowSystem___BlackArrowAbilityCounter]=abilityId - set BlackArrowSystem___BlackArrowAbiliyLevel[BlackArrowSystem___BlackArrowAbilityCounter]=level - set BlackArrowSystem___BlackArrowAbiliySummonedUnitTypeId[BlackArrowSystem___BlackArrowAbilityCounter]=summonedUnitTypeId - set BlackArrowSystem___BlackArrowAbiliySummonedUnitsCount[BlackArrowSystem___BlackArrowAbilityCounter]=summonedUnitsCount - set BlackArrowSystem___BlackArrowAbiliySummonedUnitDuration[BlackArrowSystem___BlackArrowAbilityCounter]=summonedUnitDuration - set BlackArrowSystem___BlackArrowAbiliyDurationHero[BlackArrowSystem___BlackArrowAbilityCounter]=durationHero - set BlackArrowSystem___BlackArrowAbiliyDurationUnit[BlackArrowSystem___BlackArrowAbilityCounter]=durationUnit - set BlackArrowSystem___BlackArrowAbiliyBuffId[BlackArrowSystem___BlackArrowAbilityCounter]=buffId + set BlackArrowSystem__BlackArrowAbiliyId[BlackArrowSystem__BlackArrowAbilityCounter]=abilityId + set BlackArrowSystem__BlackArrowAbiliyLevel[BlackArrowSystem__BlackArrowAbilityCounter]=level + set BlackArrowSystem__BlackArrowAbiliySummonedUnitTypeId[BlackArrowSystem__BlackArrowAbilityCounter]=summonedUnitTypeId + set BlackArrowSystem__BlackArrowAbiliySummonedUnitsCount[BlackArrowSystem__BlackArrowAbilityCounter]=summonedUnitsCount + set BlackArrowSystem__BlackArrowAbiliySummonedUnitDuration[BlackArrowSystem__BlackArrowAbilityCounter]=summonedUnitDuration + set BlackArrowSystem__BlackArrowAbiliyDurationHero[BlackArrowSystem__BlackArrowAbilityCounter]=durationHero + set BlackArrowSystem__BlackArrowAbiliyDurationUnit[BlackArrowSystem__BlackArrowAbilityCounter]=durationUnit + set BlackArrowSystem__BlackArrowAbiliyBuffId[BlackArrowSystem__BlackArrowAbilityCounter]=buffId - set BlackArrowSystem___BlackArrowAbilityCounter=BlackArrowSystem___BlackArrowAbilityCounter + 1 + set BlackArrowSystem__BlackArrowAbilityCounter=BlackArrowSystem__BlackArrowAbilityCounter + 1 - return BlackArrowSystem___BlackArrowAbilityCounter - 1 + return BlackArrowSystem__BlackArrowAbilityCounter - 1 endfunction function BlackArrowAddItemTypeId takes integer itemTypeId,integer abilityIndex returns integer - set BlackArrowSystem___BlackArrowItemTypeId[BlackArrowSystem___BlackArrowItemTypeCounter]=itemTypeId - set BlackArrowSystem___BlackArrowItemTypeAbilityIndex[BlackArrowSystem___BlackArrowItemTypeCounter]=abilityIndex + set BlackArrowSystem__BlackArrowItemTypeId[BlackArrowSystem__BlackArrowItemTypeCounter]=itemTypeId + set BlackArrowSystem__BlackArrowItemTypeAbilityIndex[BlackArrowSystem__BlackArrowItemTypeCounter]=abilityIndex - set BlackArrowSystem___BlackArrowItemTypeCounter=BlackArrowSystem___BlackArrowItemTypeCounter + 1 + set BlackArrowSystem__BlackArrowItemTypeCounter=BlackArrowSystem__BlackArrowItemTypeCounter + 1 - return BlackArrowSystem___BlackArrowItemTypeCounter - 1 + return BlackArrowSystem__BlackArrowItemTypeCounter - 1 endfunction function BlackArrowAddAutoCaster takes unit whichUnit returns nothing - call GroupAddUnit(BlackArrowSystem___BlackArrowAutoCasters, whichUnit) + call GroupAddUnit(BlackArrowSystem__BlackArrowAutoCasters, whichUnit) endfunction function BlackArrowRemoveAutoCaster takes unit whichUnit returns nothing - call GroupRemoveUnit(BlackArrowSystem___BlackArrowAutoCasters, whichUnit) + call GroupRemoveUnit(BlackArrowSystem__BlackArrowAutoCasters, whichUnit) endfunction function BlackArrowIsAutoCaster takes unit which returns boolean - return IsUnitInGroup(which, BlackArrowSystem___BlackArrowAutoCasters) + return IsUnitInGroup(which, BlackArrowSystem__BlackArrowAutoCasters) endfunction function BlackArrowPrintDebug takes nothing returns nothing - call h__BJDebugMsg("Targets: " + I2S(CountUnitsInGroup(BlackArrowSystem___BlackArrowTargets))) - call h__BJDebugMsg("Auto Casters: " + I2S(CountUnitsInGroup(BlackArrowSystem___BlackArrowAutoCasters))) - call h__BJDebugMsg("Item Units: " + I2S(CountUnitsInGroup(BlackArrowSystem___BlackArrowItemUnits))) + call h__BJDebugMsg("Targets: " + I2S(CountUnitsInGroup(BlackArrowSystem__BlackArrowTargets))) + call h__BJDebugMsg("Auto Casters: " + I2S(CountUnitsInGroup(BlackArrowSystem__BlackArrowAutoCasters))) + call h__BJDebugMsg("Item Units: " + I2S(CountUnitsInGroup(BlackArrowSystem__BlackArrowItemUnits))) endfunction -function BlackArrowSystem___GetMatchingBlackArrowAbilityIndex takes unit caster returns integer +function BlackArrowSystem__GetMatchingBlackArrowAbilityIndex takes unit caster returns integer local integer result= 0 local integer i= 1 loop - exitwhen ( i >= BlackArrowSystem___BlackArrowAbilityCounter or result > 0 ) - if ( GetUnitAbilityLevel(caster, BlackArrowSystem___BlackArrowAbiliyId[i]) == BlackArrowSystem___BlackArrowAbiliyLevel[i] ) then + exitwhen ( i >= BlackArrowSystem__BlackArrowAbilityCounter or result > 0 ) + if ( GetUnitAbilityLevel(caster, BlackArrowSystem__BlackArrowAbiliyId[i]) == BlackArrowSystem__BlackArrowAbiliyLevel[i] ) then set result=i endif set i=i + 1 @@ -18770,12 +18740,12 @@ function BlackArrowSystem___GetMatchingBlackArrowAbilityIndex takes unit caster return result endfunction -function BlackArrowSystem___GetMatchingBlackArrowItemTypeIndex takes integer itemTypeId returns integer +function BlackArrowSystem__GetMatchingBlackArrowItemTypeIndex takes integer itemTypeId returns integer local integer result= 0 local integer i= 1 loop - exitwhen ( i >= BlackArrowSystem___BlackArrowItemTypeCounter or result > 0 ) - if ( BlackArrowSystem___BlackArrowItemTypeId[i] == itemTypeId ) then + exitwhen ( i >= BlackArrowSystem__BlackArrowItemTypeCounter or result > 0 ) + if ( BlackArrowSystem__BlackArrowItemTypeId[i] == itemTypeId ) then set result=i endif set i=i + 1 @@ -18784,92 +18754,92 @@ function BlackArrowSystem___GetMatchingBlackArrowItemTypeIndex takes integer ite return result endfunction -function BlackArrowSystem___TimerFunctionBlackArrowBuffExpires takes nothing returns nothing - local unit target= LoadUnitHandle(BlackArrowSystem___BlackArrowHashTable, GetHandleId(GetExpiredTimer()), 0) - call FlushChildHashtable(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target)) +function BlackArrowSystem__TimerFunctionBlackArrowBuffExpires takes nothing returns nothing + local unit target= LoadUnitHandle(BlackArrowSystem__BlackArrowHashTable, GetHandleId(GetExpiredTimer()), 0) + call FlushChildHashtable(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target)) call UnitRemoveAbility(target, BlackArrowSystem_BUFF_ABILITY_ID) - call GroupRemoveUnit(BlackArrowSystem___BlackArrowTargets, target) + call GroupRemoveUnit(BlackArrowSystem__BlackArrowTargets, target) set target=null endfunction -function BlackArrowSystem___MarkTarget takes integer abilityIndex,unit source,unit target returns nothing - local timer whichTimer= LoadTimerHandle(BlackArrowSystem___BlackArrowHashTable, 0, GetHandleId(target)) +function BlackArrowSystem__MarkTarget takes integer abilityIndex,unit source,unit target returns nothing + local timer whichTimer= LoadTimerHandle(BlackArrowSystem__BlackArrowHashTable, 0, GetHandleId(target)) //call BJDebugMsg("Marking Black Arrow target " + GetUnitName(GetTriggerUnit())) if ( whichTimer != null ) then - call FlushChildHashtable(BlackArrowSystem___BlackArrowHashTable, GetHandleId(whichTimer)) + call FlushChildHashtable(BlackArrowSystem__BlackArrowHashTable, GetHandleId(whichTimer)) call PauseTimer(whichTimer) call DestroyTimer(whichTimer) set whichTimer=null endif set whichTimer=CreateTimer() - call SaveUnitHandle(BlackArrowSystem___BlackArrowHashTable, GetHandleId(whichTimer), 0, target) - call SaveTimerHandle(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target), 0, whichTimer) - call SaveUnitHandle(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target), 1, source) - call SaveInteger(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target), 2, abilityIndex) + call SaveUnitHandle(BlackArrowSystem__BlackArrowHashTable, GetHandleId(whichTimer), 0, target) + call SaveTimerHandle(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target), 0, whichTimer) + call SaveUnitHandle(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target), 1, source) + call SaveInteger(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target), 2, abilityIndex) if ( IsUnitType(target, UNIT_TYPE_HERO) ) then - call TimerStart(whichTimer, BlackArrowSystem___BlackArrowAbiliyDurationHero[abilityIndex], false, function BlackArrowSystem___TimerFunctionBlackArrowBuffExpires) + call TimerStart(whichTimer, BlackArrowSystem__BlackArrowAbiliyDurationHero[abilityIndex], false, function BlackArrowSystem__TimerFunctionBlackArrowBuffExpires) else - call TimerStart(whichTimer, BlackArrowSystem___BlackArrowAbiliyDurationUnit[abilityIndex], false, function BlackArrowSystem___TimerFunctionBlackArrowBuffExpires) + call TimerStart(whichTimer, BlackArrowSystem__BlackArrowAbiliyDurationUnit[abilityIndex], false, function BlackArrowSystem__TimerFunctionBlackArrowBuffExpires) endif call UnitAddAbility(target, BlackArrowSystem_BUFF_ABILITY_ID) - if ( not IsUnitInGroup(target, BlackArrowSystem___BlackArrowTargets) ) then - call GroupAddUnit(BlackArrowSystem___BlackArrowTargets, target) + if ( not IsUnitInGroup(target, BlackArrowSystem__BlackArrowTargets) ) then + call GroupAddUnit(BlackArrowSystem__BlackArrowTargets, target) endif endfunction -function BlackArrowSystem___ExecuteCallbackTriggers takes unit source,unit target,group summonedUnits,integer abilityId returns nothing +function BlackArrowSystem__ExecuteCallbackTriggers takes unit source,unit target,group summonedUnits,integer abilityId returns nothing local integer i= 0 - set BlackArrowSystem___BlackArrowCaster=source - set BlackArrowSystem___BlackArrowTarget=target - set BlackArrowSystem___BlackArrowSummonedUnits=summonedUnits - set BlackArrowSystem___BlackArrowAbilityId=abilityId + set BlackArrowSystem__BlackArrowCaster=source + set BlackArrowSystem__BlackArrowTarget=target + set BlackArrowSystem__BlackArrowSummonedUnits=summonedUnits + set BlackArrowSystem__BlackArrowAbilityId=abilityId loop - exitwhen ( i == BlackArrowSystem___BlackArrowCallbackTriggerCounter ) - call TriggerExecute(BlackArrowSystem___BlackArrowCallbackTrigger[i]) + exitwhen ( i == BlackArrowSystem__BlackArrowCallbackTriggerCounter ) + call TriggerExecute(BlackArrowSystem__BlackArrowCallbackTrigger[i]) set i=i + 1 endloop endfunction -function BlackArrowSystem___SummonEffect takes integer abilityIndex,unit source,unit target returns group +function BlackArrowSystem__SummonEffect takes integer abilityIndex,unit source,unit target returns group local location tmpLocation= GetUnitLoc(target) // Does not leak since it uses bj_lastCreatedGroup: - local group summonedUnits= CreateNUnitsAtLoc(BlackArrowSystem___BlackArrowAbiliySummonedUnitsCount[abilityIndex], BlackArrowSystem___BlackArrowAbiliySummonedUnitTypeId[abilityIndex], GetOwningPlayer(source), tmpLocation, GetUnitFacing(target)) + local group summonedUnits= CreateNUnitsAtLoc(BlackArrowSystem__BlackArrowAbiliySummonedUnitsCount[abilityIndex], BlackArrowSystem__BlackArrowAbiliySummonedUnitTypeId[abilityIndex], GetOwningPlayer(source), tmpLocation, GetUnitFacing(target)) local integer i= 0 loop exitwhen ( i == BlzGroupGetSize(summonedUnits) ) call SetUnitAnimation(BlzGroupUnitAt(summonedUnits, i), "Birth") - call UnitApplyTimedLife(BlzGroupUnitAt(summonedUnits, i), BlackArrowSystem___BlackArrowAbiliyBuffId[abilityIndex], BlackArrowSystem___BlackArrowAbiliySummonedUnitDuration[abilityIndex]) + call UnitApplyTimedLife(BlzGroupUnitAt(summonedUnits, i), BlackArrowSystem__BlackArrowAbiliyBuffId[abilityIndex], BlackArrowSystem__BlackArrowAbiliySummonedUnitDuration[abilityIndex]) set i=i + 1 endloop - call BlackArrowSystem___ExecuteCallbackTriggers(source , target , summonedUnits , BlackArrowSystem___BlackArrowAbiliyId[abilityIndex]) + call BlackArrowSystem__ExecuteCallbackTriggers(source , target , summonedUnits , BlackArrowSystem__BlackArrowAbiliyId[abilityIndex]) return summonedUnits endfunction -function BlackArrowSystem___Effect takes unit target returns group - local timer whichTimer= LoadTimerHandle(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target), 0) - local unit source= LoadUnitHandle(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target), 1) - local integer abilityIndex= LoadInteger(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target), 2) - local group summonedUnits= BlackArrowSystem___SummonEffect(abilityIndex , source , target) +function BlackArrowSystem__Effect takes unit target returns group + local timer whichTimer= LoadTimerHandle(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target), 0) + local unit source= LoadUnitHandle(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target), 1) + local integer abilityIndex= LoadInteger(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target), 2) + local group summonedUnits= BlackArrowSystem__SummonEffect(abilityIndex , source , target) //call BJDebugMsg("Black Arrow effect on target " + GetUnitName(target) + " with ability level " + I2S(BlackArrowAbiliyLevel[abilityIndex]) + " summoning units of type " + GetObjectName(BlackArrowAbiliySummonedUnitTypeId[abilityIndex])) if ( whichTimer != null ) then - call FlushChildHashtable(BlackArrowSystem___BlackArrowHashTable, GetHandleId(whichTimer)) + call FlushChildHashtable(BlackArrowSystem__BlackArrowHashTable, GetHandleId(whichTimer)) call PauseTimer(whichTimer) call DestroyTimer(whichTimer) set whichTimer=null endif - call FlushChildHashtable(BlackArrowSystem___BlackArrowHashTable, GetHandleId(target)) + call FlushChildHashtable(BlackArrowSystem__BlackArrowHashTable, GetHandleId(target)) call UnitRemoveAbility(target, BlackArrowSystem_BUFF_ABILITY_ID) - call GroupRemoveUnit(BlackArrowSystem___BlackArrowTargets, target) + call GroupRemoveUnit(BlackArrowSystem__BlackArrowTargets, target) // remove the decaying corpse call h__RemoveUnit(target) @@ -18880,15 +18850,15 @@ function BlackArrowSystem___Effect takes unit target returns group return summonedUnits endfunction -function BlackArrowSystem___TriggerConditionDamage takes nothing returns boolean - return not IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_MECHANICAL) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_RESISTANT) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_MAGIC_IMMUNE) and GetUnitLevel(GetTriggerUnit()) > 5 and ( ( IsUnitInGroup(GetEventDamageSource(), BlackArrowSystem___BlackArrowAutoCasters) and BlackArrowSystem___GetMatchingBlackArrowAbilityIndex(GetEventDamageSource()) > 0 ) or IsUnitInGroup(GetEventDamageSource(), BlackArrowSystem___BlackArrowItemUnits) ) +function BlackArrowSystem__TriggerConditionDamage takes nothing returns boolean + return not IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_MECHANICAL) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_RESISTANT) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_MAGIC_IMMUNE) and GetUnitLevel(GetTriggerUnit()) > 5 and ( ( IsUnitInGroup(GetEventDamageSource(), BlackArrowSystem__BlackArrowAutoCasters) and BlackArrowSystem__GetMatchingBlackArrowAbilityIndex(GetEventDamageSource()) > 0 ) or IsUnitInGroup(GetEventDamageSource(), BlackArrowSystem__BlackArrowItemUnits) ) endfunction function BlackArrowUnitGetOrbItem takes unit whichUnit,item excludeItem returns integer local integer i= 0 loop exitwhen ( i >= UnitInventorySize(whichUnit) ) - if ( ( excludeItem == null or UnitItemInSlot(whichUnit, i) != excludeItem ) and BlackArrowSystem___GetMatchingBlackArrowItemTypeIndex(GetItemTypeId(UnitItemInSlot(whichUnit, i))) > 0 ) then + if ( ( excludeItem == null or UnitItemInSlot(whichUnit, i) != excludeItem ) and BlackArrowSystem__GetMatchingBlackArrowItemTypeIndex(GetItemTypeId(UnitItemInSlot(whichUnit, i))) > 0 ) then return i endif set i=i + 1 @@ -18896,53 +18866,53 @@ function BlackArrowUnitGetOrbItem takes unit whichUnit,item excludeItem returns return - 1 endfunction -function BlackArrowSystem___TriggerActionDamage takes nothing returns nothing +function BlackArrowSystem__TriggerActionDamage takes nothing returns nothing local integer itemIndex= BlackArrowUnitGetOrbItem(GetEventDamageSource() , null) - local integer abilityIndex= BlackArrowSystem___GetMatchingBlackArrowAbilityIndex(GetEventDamageSource()) + local integer abilityIndex= BlackArrowSystem__GetMatchingBlackArrowAbilityIndex(GetEventDamageSource()) if ( itemIndex != - 1 and abilityIndex == 0 ) then - call BlackArrowSystem___MarkTarget(BlackArrowSystem___BlackArrowItemTypeAbilityIndex[itemIndex] , GetEventDamageSource() , GetTriggerUnit()) + call BlackArrowSystem__MarkTarget(BlackArrowSystem__BlackArrowItemTypeAbilityIndex[itemIndex] , GetEventDamageSource() , GetTriggerUnit()) else - call BlackArrowSystem___MarkTarget(abilityIndex , GetEventDamageSource() , GetTriggerUnit()) + call BlackArrowSystem__MarkTarget(abilityIndex , GetEventDamageSource() , GetTriggerUnit()) endif endfunction -function BlackArrowSystem___TriggerConditionDeath takes nothing returns boolean - return IsUnitInGroup(GetTriggerUnit(), BlackArrowSystem___BlackArrowTargets) +function BlackArrowSystem__TriggerConditionDeath takes nothing returns boolean + return IsUnitInGroup(GetTriggerUnit(), BlackArrowSystem__BlackArrowTargets) endfunction -function BlackArrowSystem___TriggerActionDeath takes nothing returns nothing - call BlackArrowSystem___Effect(GetTriggerUnit()) +function BlackArrowSystem__TriggerActionDeath takes nothing returns nothing + call BlackArrowSystem__Effect(GetTriggerUnit()) endfunction -function BlackArrowSystem___TriggerConditionOrder takes nothing returns boolean +function BlackArrowSystem__TriggerConditionOrder takes nothing returns boolean return GetIssuedOrderId() == OrderId(BlackArrowSystem_ORDER_ON) or GetIssuedOrderId() == OrderId(BlackArrowSystem_ORDER_OFF) endfunction -function BlackArrowSystem___TriggerActionOrder takes nothing returns nothing +function BlackArrowSystem__TriggerActionOrder takes nothing returns nothing if ( GetIssuedOrderId() == OrderId(BlackArrowSystem_ORDER_ON) ) then - if ( not (IsUnitInGroup((GetTriggerUnit()), BlackArrowSystem___BlackArrowAutoCasters)) ) then // INLINED!! - call GroupAddUnit(BlackArrowSystem___BlackArrowAutoCasters, (GetTriggerUnit())) // INLINED!! + if ( not (IsUnitInGroup((GetTriggerUnit()), BlackArrowSystem__BlackArrowAutoCasters)) ) then // INLINED!! + call GroupAddUnit(BlackArrowSystem__BlackArrowAutoCasters, (GetTriggerUnit())) // INLINED!! //call BJDebugMsg("Adding unit " + GetUnitName(caster) + " to casters.") endif else - if ( (IsUnitInGroup((GetTriggerUnit()), BlackArrowSystem___BlackArrowAutoCasters)) ) then // INLINED!! - call GroupRemoveUnit(BlackArrowSystem___BlackArrowAutoCasters, (GetTriggerUnit())) // INLINED!! + if ( (IsUnitInGroup((GetTriggerUnit()), BlackArrowSystem__BlackArrowAutoCasters)) ) then // INLINED!! + call GroupRemoveUnit(BlackArrowSystem__BlackArrowAutoCasters, (GetTriggerUnit())) // INLINED!! //call BJDebugMsg("Removing unit " + GetUnitName(GetTriggerUnit()) + " from casters.") endif endif endfunction -function BlackArrowSystem___TriggerConditionPickupItem takes nothing returns boolean - return not IsUnitInGroup(GetTriggerUnit(), BlackArrowSystem___BlackArrowItemUnits) and BlackArrowSystem___GetMatchingBlackArrowItemTypeIndex(GetItemTypeId(GetManipulatedItem())) > 0 +function BlackArrowSystem__TriggerConditionPickupItem takes nothing returns boolean + return not IsUnitInGroup(GetTriggerUnit(), BlackArrowSystem__BlackArrowItemUnits) and BlackArrowSystem__GetMatchingBlackArrowItemTypeIndex(GetItemTypeId(GetManipulatedItem())) > 0 endfunction -function BlackArrowSystem___TriggerActionPickupItem takes nothing returns nothing - call GroupAddUnit(BlackArrowSystem___BlackArrowItemUnits, GetTriggerUnit()) +function BlackArrowSystem__TriggerActionPickupItem takes nothing returns nothing + call GroupAddUnit(BlackArrowSystem__BlackArrowItemUnits, GetTriggerUnit()) //call BJDebugMsg("Unit " + GetUnitName(GetTriggerUnit()) + " picked up a Black Arrow orb item.") endfunction -function BlackArrowSystem___TriggerConditionDropItem takes nothing returns boolean - local boolean result= IsUnitInGroup(GetTriggerUnit(), BlackArrowSystem___BlackArrowItemUnits) and BlackArrowSystem___GetMatchingBlackArrowItemTypeIndex(GetItemTypeId(GetManipulatedItem())) > 0 +function BlackArrowSystem__TriggerConditionDropItem takes nothing returns boolean + local boolean result= IsUnitInGroup(GetTriggerUnit(), BlackArrowSystem__BlackArrowItemUnits) and BlackArrowSystem__GetMatchingBlackArrowItemTypeIndex(GetItemTypeId(GetManipulatedItem())) > 0 if ( result ) then // we need to exclude the dropped item since it is not dropped yet @@ -18952,12 +18922,12 @@ function BlackArrowSystem___TriggerConditionDropItem takes nothing returns boole return result endfunction -function BlackArrowSystem___TriggerActionDropItem takes nothing returns nothing - call GroupRemoveUnit(BlackArrowSystem___BlackArrowItemUnits, GetTriggerUnit()) +function BlackArrowSystem__TriggerActionDropItem takes nothing returns nothing + call GroupRemoveUnit(BlackArrowSystem__BlackArrowItemUnits, GetTriggerUnit()) //call BJDebugMsg("Unit " + GetUnitName(GetTriggerUnit()) + " dropped the final Black Arrow orb item.") endfunction -function BlackArrowSystem___AddStandardObjectData takes nothing returns nothing +function BlackArrowSystem__AddStandardObjectData takes nothing returns nothing call BlackArrowAddAbility('ANba' , 1 , 'ndr1' , 1 , 80.0 , 0.0 , 2.0 , 'BNdm') call BlackArrowAddAbility('ANba' , 2 , 'ndr2' , 1 , 80.0 , 0.0 , 2.0 , 'BNdm') call BlackArrowAddAbility('ANba' , 3 , 'ndr3' , 1 , 80.0 , 0.0 , 2.0 , 'BNdm') @@ -18965,48 +18935,48 @@ function BlackArrowSystem___AddStandardObjectData takes nothing returns nothing call BlackArrowAddItemTypeId('odef' , BlackArrowAddAbility('ANbs' , 1 , 'ndr1' , 1 , 80.0 , 0.0 , 2.0 , 'BNdm')) endfunction -function BlackArrowSystem___FilterForUnitWithOrb takes nothing returns boolean +function BlackArrowSystem__FilterForUnitWithOrb takes nothing returns boolean return UnitInventorySize(GetFilterUnit()) > 0 and BlackArrowUnitGetOrbItem(GetFilterUnit() , null) != - 1 endfunction -function BlackArrowSystem___AddAllUnitsWithOrbs takes nothing returns nothing +function BlackArrowSystem__AddAllUnitsWithOrbs takes nothing returns nothing local group whichGroup= CreateGroup() - call GroupEnumUnitsInRect(whichGroup, GetPlayableMapRect(), Filter(function BlackArrowSystem___FilterForUnitWithOrb)) + call GroupEnumUnitsInRect(whichGroup, GetPlayableMapRect(), Filter(function BlackArrowSystem__FilterForUnitWithOrb)) set bj_wantDestroyGroup=true - call GroupAddGroup(whichGroup, BlackArrowSystem___BlackArrowItemUnits) + call GroupAddGroup(whichGroup, BlackArrowSystem__BlackArrowItemUnits) //call BJDebugMsg("Units with orbs size " + I2S(CountUnitsInGroup(BlackArrowItemUnits))) set whichGroup=null endfunction -//Implemented from module BlackArrowSystem___Init: +//Implemented from module BlackArrowSystem__Init: - 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) + 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) - call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem___BlackArrowDeathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(BlackArrowSystem___BlackArrowDeathTrigger, Condition(function BlackArrowSystem___TriggerConditionDeath)) - call TriggerAddAction(BlackArrowSystem___BlackArrowDeathTrigger, function BlackArrowSystem___TriggerActionDeath) + call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem__BlackArrowDeathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(BlackArrowSystem__BlackArrowDeathTrigger, Condition(function BlackArrowSystem__TriggerConditionDeath)) + call TriggerAddAction(BlackArrowSystem__BlackArrowDeathTrigger, function BlackArrowSystem__TriggerActionDeath) - call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem___BlackArrowOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) - call TriggerAddCondition(BlackArrowSystem___BlackArrowOrderTrigger, Condition(function BlackArrowSystem___TriggerConditionOrder)) - call TriggerAddAction(BlackArrowSystem___BlackArrowOrderTrigger, function BlackArrowSystem___TriggerActionOrder) + call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem__BlackArrowOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) + call TriggerAddCondition(BlackArrowSystem__BlackArrowOrderTrigger, Condition(function BlackArrowSystem__TriggerConditionOrder)) + call TriggerAddAction(BlackArrowSystem__BlackArrowOrderTrigger, function BlackArrowSystem__TriggerActionOrder) - call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem___BlackArrowItemPickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) - call TriggerAddCondition(BlackArrowSystem___BlackArrowItemPickupTrigger, Condition(function BlackArrowSystem___TriggerConditionPickupItem)) - call TriggerAddAction(BlackArrowSystem___BlackArrowItemPickupTrigger, function BlackArrowSystem___TriggerActionPickupItem) + call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem__BlackArrowItemPickupTrigger, EVENT_PLAYER_UNIT_PICKUP_ITEM) + call TriggerAddCondition(BlackArrowSystem__BlackArrowItemPickupTrigger, Condition(function BlackArrowSystem__TriggerConditionPickupItem)) + call TriggerAddAction(BlackArrowSystem__BlackArrowItemPickupTrigger, function BlackArrowSystem__TriggerActionPickupItem) - call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem___BlackArrowItemDropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddCondition(BlackArrowSystem___BlackArrowItemDropTrigger, Condition(function BlackArrowSystem___TriggerConditionDropItem)) - call TriggerAddAction(BlackArrowSystem___BlackArrowItemDropTrigger, function BlackArrowSystem___TriggerActionDropItem) + call TriggerRegisterAnyUnitEventBJ(BlackArrowSystem__BlackArrowItemDropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) + call TriggerAddCondition(BlackArrowSystem__BlackArrowItemDropTrigger, Condition(function BlackArrowSystem__TriggerConditionDropItem)) + call TriggerAddAction(BlackArrowSystem__BlackArrowItemDropTrigger, function BlackArrowSystem__TriggerActionDropItem) - call BlackArrowSystem___AddStandardObjectData() + call BlackArrowSystem__AddStandardObjectData() - call BlackArrowSystem___AddAllUnitsWithOrbs() + call BlackArrowSystem__AddAllUnitsWithOrbs() endfunction @@ -19065,41 +19035,41 @@ endfunction //========================================================================================= //======================================================================= - function BoundSentinel__dis takes nothing returns nothing + function BoundSentinel___dis takes nothing returns nothing local unit u=GetTriggerUnit() local real x=GetUnitX(u) local real y=GetUnitY(u) - if ( x > BoundSentinel__maxx ) then - set x=BoundSentinel__maxx - elseif ( x < BoundSentinel__minx ) then - set x=BoundSentinel__minx + if ( x > BoundSentinel___maxx ) then + set x=BoundSentinel___maxx + elseif ( x < BoundSentinel___minx ) then + set x=BoundSentinel___minx endif - if ( y > BoundSentinel__maxy ) then - set y=BoundSentinel__maxy - elseif ( y < BoundSentinel__miny ) then - set y=BoundSentinel__miny + if ( y > BoundSentinel___maxy ) then + set y=BoundSentinel___maxy + elseif ( y < BoundSentinel___miny ) then + set y=BoundSentinel___miny endif call SetUnitX(u, x) call SetUnitY(u, y) set u=null endfunction - function BoundSentinel__init takes nothing returns nothing + function BoundSentinel___init takes nothing returns nothing local trigger t=CreateTrigger() local region r=CreateRegion() local rect rc - set BoundSentinel__minx=GetCameraBoundMinX() - BoundSentinel__EXTRA - set BoundSentinel__miny=GetCameraBoundMinY() - BoundSentinel__EXTRA - set BoundSentinel__maxx=GetCameraBoundMaxX() + BoundSentinel__EXTRA - set BoundSentinel__maxy=GetCameraBoundMaxY() + BoundSentinel__EXTRA - set rc=Rect(BoundSentinel__minx, BoundSentinel__miny, BoundSentinel__maxx, BoundSentinel__maxy) + set BoundSentinel___minx=GetCameraBoundMinX() - BoundSentinel___EXTRA + set BoundSentinel___miny=GetCameraBoundMinY() - BoundSentinel___EXTRA + set BoundSentinel___maxx=GetCameraBoundMaxX() + BoundSentinel___EXTRA + set BoundSentinel___maxy=GetCameraBoundMaxY() + BoundSentinel___EXTRA + set rc=Rect(BoundSentinel___minx, BoundSentinel___miny, BoundSentinel___maxx, BoundSentinel___maxy) call RegionAddRect(r, rc) call RemoveRect(rc) call TriggerRegisterLeaveRegion(t, r, null) - call TriggerAddAction(t, function BoundSentinel__dis) + call TriggerAddAction(t, function BoundSentinel___dis) //this is not necessary but I'll do it anyway: set t=null @@ -19109,145 +19079,145 @@ endfunction //library BoundSentinel ends //library CTL: - function CTL__E takes nothing returns nothing - local integer i=CTL__ns[0] - set CTL__ns[0]=0 + function CTL___E takes nothing returns nothing + local integer i=CTL___ns[0] + set CTL___ns[0]=0 loop exitwhen 0 == i - if ( 0 == CTL__p[i] ) then - if ( 0 == CTL__n[i] ) then - call TriggerRemoveCondition(CTL__t, CTL__ct[CTL__th[i]]) - set CTL__ct[CTL__th[i]]=null - set CTL__tc=CTL__tc - 1 - set CTL__rf[CTL__th[i]]=0 + if ( 0 == CTL___p[i] ) then + if ( 0 == CTL___n[i] ) then + call TriggerRemoveCondition(CTL___t, CTL___ct[CTL___th[i]]) + set CTL___ct[CTL___th[i]]=null + set CTL___tc=CTL___tc - 1 + set CTL___rf[CTL___th[i]]=0 else - set CTL__rf[CTL__th[i]]=CTL__n[i] - set CTL__p[CTL__n[i]]=0 + set CTL___rf[CTL___th[i]]=CTL___n[i] + set CTL___p[CTL___n[i]]=0 endif else - set CTL__p[CTL__n[i]]=CTL__p[i] - set CTL__n[CTL__p[i]]=CTL__n[i] + set CTL___p[CTL___n[i]]=CTL___p[i] + set CTL___n[CTL___p[i]]=CTL___n[i] endif - set CTL__n[i]=CTL__n[0] - set CTL__n[0]=i - set i=CTL__ns[i] + set CTL___n[i]=CTL___n[0] + set CTL___n[0]=i + set i=CTL___ns[i] endloop loop - exitwhen 0 == CTL__i32cr - set CTL__i32cr=CTL__i32cr - 1 - set i=CTL__i32r[CTL__i32cr] - if ( not CTL__e32[i] ) then - call TriggerRemoveCondition(CTL__t, CTL__ct[i]) - set CTL__ct[i]=null + exitwhen 0 == CTL___i32cr + set CTL___i32cr=CTL___i32cr - 1 + set i=CTL___i32r[CTL___i32cr] + if ( not CTL___e32[i] ) then + call TriggerRemoveCondition(CTL___t, CTL___ct[i]) + set CTL___ct[i]=null - if ( CTL__id32[i] ) then - set CTL__tgr[i]=CTL__tgr[0] - set CTL__tgr[0]=i - set CTL__id32[i]=false - set CTL__e32[i]=false - set CTL__ir32[i]=false + if ( CTL___id32[i] ) then + set CTL___tgr[i]=CTL___tgr[0] + set CTL___tgr[0]=i + set CTL___id32[i]=false + set CTL___e32[i]=false + set CTL___ir32[i]=false endif endif endloop - if ( 0 == CTL__tc ) then - call PauseTimer(CTL__m) + if ( 0 == CTL___tc ) then + call PauseTimer(CTL___m) else - call TriggerEvaluate(CTL__t) + call TriggerEvaluate(CTL___t) endif endfunction - function CTL__CT takes integer r returns integer + function CTL___CT takes integer r returns integer local integer i local integer f - if ( 0 == CTL__n[0] ) then - set i=CTL__ic + 1 - set CTL__ic=i + if ( 0 == CTL___n[0] ) then + set i=CTL___ic + 1 + set CTL___ic=i else - set i=CTL__n[0] - set CTL__n[0]=CTL__n[i] + set i=CTL___n[0] + set CTL___n[0]=CTL___n[i] endif - set CTL__th[i]=r - set CTL__ns[i]=- 1 - set f=CTL__rf[r] + set CTL___th[i]=r + set CTL___ns[i]=- 1 + set f=CTL___rf[r] if ( 0 == f ) then - set CTL__n[i]=0 - set CTL__p[i]=0 - set CTL__rf[r]=i - set CTL__ct[r]=TriggerAddCondition(CTL__t, CTL__rc[r]) + set CTL___n[i]=0 + set CTL___p[i]=0 + set CTL___rf[r]=i + set CTL___ct[r]=TriggerAddCondition(CTL___t, CTL___rc[r]) //set ct[r] = null - if ( 0 == CTL__tc ) then - call TimerStart(CTL__m, .031250000, true, function CTL__E) + if ( 0 == CTL___tc ) then + call TimerStart(CTL___m, .031250000, true, function CTL___E) endif - set CTL__tc=CTL__tc + 1 + set CTL___tc=CTL___tc + 1 else - set CTL__n[i]=f - set CTL__p[i]=0 - set CTL__p[f]=i - set CTL__rf[r]=i + set CTL___n[i]=f + set CTL___p[i]=0 + set CTL___p[f]=i + set CTL___rf[r]=i endif return i endfunction -function CTL__DT takes integer l__CTL__t returns nothing - set CTL__ns[l__CTL__t]=CTL__ns[0] - set CTL__ns[0]=l__CTL__t +function CTL___DT takes integer l__CTL___t returns nothing + set CTL___ns[l__CTL___t]=CTL___ns[0] + set CTL___ns[0]=l__CTL___t endfunction - function CTL__A takes code c returns integer - local integer i= CTL__tgr[0] + function CTL___A takes code c returns integer + local integer i= CTL___tgr[0] if ( 0 == i ) then - set i=CTL__tgc + 1 - set CTL__tgc=i + set i=CTL___tgc + 1 + set CTL___tgc=i else - set CTL__tgr[0]=CTL__tgr[i] + set CTL___tgr[0]=CTL___tgr[i] endif - set CTL__rc[i]=Condition(c) + set CTL___rc[i]=Condition(c) return i endfunction - function CTL__A32 takes integer i returns nothing - if ( not CTL__e32[i] ) then - if ( not CTL__ir32[i] and not CTL__id32[i] ) then - set CTL__ct[i]=TriggerAddCondition(CTL__t, CTL__rc[i]) + function CTL___A32 takes integer i returns nothing + if ( not CTL___e32[i] ) then + if ( not CTL___ir32[i] and not CTL___id32[i] ) then + set CTL___ct[i]=TriggerAddCondition(CTL___t, CTL___rc[i]) endif - if ( 0 == CTL__tc ) then - call TimerStart(CTL__m, .031250000, true, function CTL__E) + if ( 0 == CTL___tc ) then + call TimerStart(CTL___m, .031250000, true, function CTL___E) endif - set CTL__tc=CTL__tc + 1 - set CTL__e32[i]=true + set CTL___tc=CTL___tc + 1 + set CTL___e32[i]=true endif endfunction - function CTL__SR32 takes integer i returns nothing - if ( CTL__e32[i] ) then - if ( not CTL__ir32[i] and not CTL__id32[i] ) then - set CTL__i32r[CTL__i32cr]=i - set CTL__i32cr=CTL__i32cr + 1 - set CTL__ir32[i]=true + function CTL___SR32 takes integer i returns nothing + if ( CTL___e32[i] ) then + if ( not CTL___ir32[i] and not CTL___id32[i] ) then + set CTL___i32r[CTL___i32cr]=i + set CTL___i32cr=CTL___i32cr + 1 + set CTL___ir32[i]=true endif - set CTL__e32[i]=false - set CTL__tc=CTL__tc - 1 + set CTL___e32[i]=false + set CTL___tc=CTL___tc - 1 endif endfunction - function CTL__DT32 takes integer i returns nothing - if ( not CTL__id32[i] ) then - if ( not CTL__ir32[i] ) then - set CTL__ir32[i]=true - set CTL__tc=CTL__tc - 1 - set CTL__i32r[CTL__i32cr]=i - set CTL__i32cr=CTL__i32cr + 1 - set CTL__e32[i]=false + function CTL___DT32 takes integer i returns nothing + if ( not CTL___id32[i] ) then + if ( not CTL___ir32[i] ) then + set CTL___ir32[i]=true + set CTL___tc=CTL___tc - 1 + set CTL___i32r[CTL___i32cr]=i + set CTL___i32cr=CTL___i32cr + 1 + set CTL___e32[i]=false endif - set CTL__id32[i]=true + set CTL___id32[i]=true endif endfunction function s__TimerGroup32_create takes code c returns integer - return CTL__A(c) + return CTL___A(c) endfunction function s__TimerGroup32_destroy takes integer this returns nothing - call CTL__DT32(this) + call CTL___DT32(this) endfunction function s__TimerGroup32_start takes integer this returns nothing - call CTL__A32(this) + call CTL___A32(this) endfunction function s__TimerGroup32_stop takes integer this returns nothing - call CTL__SR32(this) + call CTL___SR32(this) endfunction //library CTL ends @@ -19269,16 +19239,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 @@ -19295,16 +19265,16 @@ endfunction //library CustomRaceSoundSystem: -function CustomRaceSoundSystem___Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer +function CustomRaceSoundSystem__Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer return ( ( Value1 * MaxValue2 ) + Value2 ) endfunction function SetPlayerCustomRaceSoundSet takes player whichPlayer,integer soundSet returns nothing - set CustomRaceSoundSystem___playerCustomRace[GetPlayerId(whichPlayer)]=soundSet + set CustomRaceSoundSystem__playerCustomRace[GetPlayerId(whichPlayer)]=soundSet endfunction function GetPlayerCustomRaceSoundSet takes player whichPlayer returns integer - local integer result= CustomRaceSoundSystem___playerCustomRace[GetPlayerId(whichPlayer)] + local integer result= CustomRaceSoundSystem__playerCustomRace[GetPlayerId(whichPlayer)] if ( result == 0 ) then return GetHandleId(GetPlayerRace(whichPlayer)) endif @@ -19312,14 +19282,14 @@ function GetPlayerCustomRaceSoundSet takes player whichPlayer returns integer endfunction function AddCustomRaceSound takes integer soundSet,integer soundType,sound whichSound returns nothing - set CustomRaceSoundSystem___customRaceSound[CustomRaceSoundSystem___Index2D(soundSet , soundType , MAX_SOUND_TYPES)]=whichSound + set CustomRaceSoundSystem__customRaceSound[CustomRaceSoundSystem__Index2D(soundSet , soundType , MAX_SOUND_TYPES)]=whichSound endfunction function AddCustomRaceSoundsGeneric takes integer soundSet returns nothing endfunction function GetPlayerCustomRaceSound takes player whichPlayer,integer soundType returns sound - return CustomRaceSoundSystem___customRaceSound[CustomRaceSoundSystem___Index2D(GetPlayerCustomRaceSoundSet(whichPlayer) , soundType , MAX_SOUND_TYPES)] + return CustomRaceSoundSystem__customRaceSound[CustomRaceSoundSystem__Index2D(GetPlayerCustomRaceSoundSet(whichPlayer) , soundType , MAX_SOUND_TYPES)] endfunction function PlaySoundForPlayerAndAllies takes player whichPlayer,integer soundType returns nothing @@ -19343,24 +19313,24 @@ function PlaySoundForPlayerAndAllies takes player whichPlayer,integer soundType set allies=null endfunction -function CustomRaceSoundSystem___TriggerActionCompleteResearch takes nothing returns nothing +function CustomRaceSoundSystem__TriggerActionCompleteResearch takes nothing returns nothing call PlaySoundForPlayerAndAllies(GetOwningPlayer(GetTriggerUnit()) , SOUND_TYPE_RESEARCH_COMPLETE) endfunction -function CustomRaceSoundSystem___TriggerActionCompleteUpgrade takes nothing returns nothing +function CustomRaceSoundSystem__TriggerActionCompleteUpgrade takes nothing returns nothing call PlaySoundForPlayerAndAllies(GetOwningPlayer(GetTriggerUnit()) , SOUND_TYPE_UPGRADE_COMPLETE) endfunction -function CustomRaceSoundSystem___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(CustomRaceSoundSystem___researchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) - call TriggerAddAction(CustomRaceSoundSystem___researchTrigger, function CustomRaceSoundSystem___TriggerActionCompleteResearch) - call TriggerRegisterAnyUnitEventBJ(CustomRaceSoundSystem___upgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) - call TriggerAddAction(CustomRaceSoundSystem___upgradeTrigger, function CustomRaceSoundSystem___TriggerActionCompleteUpgrade) +function CustomRaceSoundSystem__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(CustomRaceSoundSystem__researchTrigger, EVENT_PLAYER_UNIT_RESEARCH_FINISH) + call TriggerAddAction(CustomRaceSoundSystem__researchTrigger, function CustomRaceSoundSystem__TriggerActionCompleteResearch) + call TriggerRegisterAnyUnitEventBJ(CustomRaceSoundSystem__upgradeTrigger, EVENT_PLAYER_UNIT_UPGRADE_FINISH) + call TriggerAddAction(CustomRaceSoundSystem__upgradeTrigger, function CustomRaceSoundSystem__TriggerActionCompleteUpgrade) - call AddCustomRaceSound(GetHandleId(RACE_HUMAN) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem___humanResearchCompleteSound) - call AddCustomRaceSound(GetHandleId(RACE_ORC) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem___orcResearchCompleteSound) - call AddCustomRaceSound(GetHandleId(RACE_UNDEAD) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem___undeadResearchCompleteSound) - call AddCustomRaceSound(GetHandleId(RACE_NIGHTELF) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem___nightElfResearchCompleteSound) + call AddCustomRaceSound(GetHandleId(RACE_HUMAN) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem__humanResearchCompleteSound) + call AddCustomRaceSound(GetHandleId(RACE_ORC) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem__orcResearchCompleteSound) + call AddCustomRaceSound(GetHandleId(RACE_UNDEAD) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem__undeadResearchCompleteSound) + call AddCustomRaceSound(GetHandleId(RACE_NIGHTELF) , SOUND_TYPE_RESEARCH_COMPLETE , CustomRaceSoundSystem__nightElfResearchCompleteSound) endfunction @@ -19666,8 +19636,8 @@ endfunction return s__File_write(s__File_open(filename),"") endfunction -//Implemented from module FileIO__FileInit: - function s__File_FileIO__FileInit___onInit takes nothing returns nothing +//Implemented from module FileIO___FileInit: + function s__File_FileIO___FileInit__onInit takes nothing returns nothing local string originalTooltip // We can't use a single ability with multiple levels because @@ -19735,8 +19705,8 @@ endfunction set s__ArcingTextTag_t[this]=s__ArcingTextTag_t[this] - 0.03125 set s__ArcingTextTag_x[this]=s__ArcingTextTag_x[this] + s__ArcingTextTag_ac[this] set s__ArcingTextTag_y[this]=s__ArcingTextTag_y[this] + s__ArcingTextTag_as[this] - call SetTextTagPos(s__ArcingTextTag_tt[this], s__ArcingTextTag_x[this], s__ArcingTextTag_y[this], FloatingTextArc__Z_OFFSET + FloatingTextArc__Z_OFFSET_BON * p) - call h__SetTextTagText(s__ArcingTextTag_tt[this], s__ArcingTextTag_s[this], FloatingTextArc__SIZE_MIN + FloatingTextArc__SIZE_BONUS * p) + call SetTextTagPos(s__ArcingTextTag_tt[this], s__ArcingTextTag_x[this], s__ArcingTextTag_y[this], FloatingTextArc___Z_OFFSET + FloatingTextArc___Z_OFFSET_BON * p) + call h__SetTextTagText(s__ArcingTextTag_tt[this], s__ArcingTextTag_s[this], FloatingTextArc___SIZE_MIN + FloatingTextArc___SIZE_BONUS * p) if s__ArcingTextTag_t[this] <= 0 then set s__ArcingTextTag_tt[this]=null set s__ArcingTextTag_next[s__ArcingTextTag_prev[this]]=s__ArcingTextTag_next[this] @@ -19744,7 +19714,7 @@ endfunction set s__ArcingTextTag_rn[this]=s__ArcingTextTag_rn[0] set s__ArcingTextTag_rn[0]=this if s__ArcingTextTag_next[0] == 0 then - call PauseTimer(FloatingTextArc__TMR) + call PauseTimer(FloatingTextArc___TMR) endif endif set this=s__ArcingTextTag_next[this] @@ -19774,22 +19744,22 @@ endfunction set s__ArcingTextTag_s[this]=s set s__ArcingTextTag_x[this]=GetUnitX(u) set s__ArcingTextTag_y[this]=GetUnitY(u) - set s__ArcingTextTag_t[this]=FloatingTextArc__TIME_LIFE - set s__ArcingTextTag_as[this]=Sin(a) * FloatingTextArc__VELOCITY - set s__ArcingTextTag_ac[this]=Cos(a) * FloatingTextArc__VELOCITY + set s__ArcingTextTag_t[this]=FloatingTextArc___TIME_LIFE + set s__ArcingTextTag_as[this]=Sin(a) * FloatingTextArc___VELOCITY + set s__ArcingTextTag_ac[this]=Cos(a) * FloatingTextArc___VELOCITY set s__ArcingTextTag_ah[this]=0. if IsUnitVisible(u, GetLocalPlayer()) then set s__ArcingTextTag_tt[this]=CreateTextTag() call h__SetTextTagPermanent(s__ArcingTextTag_tt[this], false) - call SetTextTagLifespan(s__ArcingTextTag_tt[this], FloatingTextArc__TIME_LIFE) - call SetTextTagFadepoint(s__ArcingTextTag_tt[this], FloatingTextArc__TIME_FADE) - call h__SetTextTagText(s__ArcingTextTag_tt[this], s, FloatingTextArc__SIZE_MIN) - call SetTextTagPos(s__ArcingTextTag_tt[this], s__ArcingTextTag_x[this], s__ArcingTextTag_y[this], FloatingTextArc__Z_OFFSET) + call SetTextTagLifespan(s__ArcingTextTag_tt[this], FloatingTextArc___TIME_LIFE) + call SetTextTagFadepoint(s__ArcingTextTag_tt[this], FloatingTextArc___TIME_FADE) + call h__SetTextTagText(s__ArcingTextTag_tt[this], s, FloatingTextArc___SIZE_MIN) + call SetTextTagPos(s__ArcingTextTag_tt[this], s__ArcingTextTag_x[this], s__ArcingTextTag_y[this], FloatingTextArc___Z_OFFSET) endif if s__ArcingTextTag_prev[this] == 0 then - call TimerStart(FloatingTextArc__TMR, 0.03125, true, function s__ArcingTextTag_update) + call TimerStart(FloatingTextArc___TMR, 0.03125, true, function s__ArcingTextTag_update) endif return this @@ -19961,32 +19931,32 @@ endfunction function FrameSaverAdd takes code func returns nothing - call TriggerAddAction(FrameSaver__saveTrigger, func) + call TriggerAddAction(FrameSaver___saveTrigger, func) endfunction function FrameSaverAddEx takes code func,code func2 returns nothing - call TriggerAddAction(FrameSaver__saveTrigger, (func)) // INLINED!! - call TriggerAddAction(FrameSaver__afterSaveTrigger, func2) + call TriggerAddAction(FrameSaver___saveTrigger, (func)) // INLINED!! + call TriggerAddAction(FrameSaver___afterSaveTrigger, func2) endfunction -function FrameSaver__TimerFunctionAfterSave takes nothing returns nothing - call TriggerExecute(FrameSaver__afterSaveTrigger) +function FrameSaver___TimerFunctionAfterSave takes nothing returns nothing + call TriggerExecute(FrameSaver___afterSaveTrigger) endfunction -function FrameSaver__TriggerActionStartAfterSaveTimer takes nothing returns nothing - call TimerStart(FrameSaver__t, FrameSaver__DELAY, false, function FrameSaver__TimerFunctionAfterSave) +function FrameSaver___TriggerActionStartAfterSaveTimer takes nothing returns nothing + call TimerStart(FrameSaver___t, FrameSaver___DELAY, false, function FrameSaver___TimerFunctionAfterSave) endfunction -function FrameSaver__TriggerActionCancelAfterSaveTimer takes nothing returns nothing - call PauseTimer(FrameSaver__t) +function FrameSaver___TriggerActionCancelAfterSaveTimer takes nothing returns nothing + call PauseTimer(FrameSaver___t) endfunction -function FrameSaver__Init takes nothing returns nothing - call TriggerRegisterGameEvent(FrameSaver__saveTrigger, EVENT_GAME_SAVE) - call TriggerAddAction(FrameSaver__saveTrigger, function FrameSaver__TriggerActionStartAfterSaveTimer) +function FrameSaver___Init takes nothing returns nothing + call TriggerRegisterGameEvent(FrameSaver___saveTrigger, EVENT_GAME_SAVE) + call TriggerAddAction(FrameSaver___saveTrigger, function FrameSaver___TriggerActionStartAfterSaveTimer) - call TriggerRegisterGameEvent(FrameSaver__loadTrigger, EVENT_GAME_LOADED) - call TriggerAddAction(FrameSaver__loadTrigger, function FrameSaver__TriggerActionCancelAfterSaveTimer) + call TriggerRegisterGameEvent(FrameSaver___loadTrigger, EVENT_GAME_LOADED) + call TriggerAddAction(FrameSaver___loadTrigger, function FrameSaver___TriggerActionCancelAfterSaveTimer) endfunction @@ -19999,13 +19969,13 @@ endfunction function GetGameStatus takes nothing returns integer - return GameStatus__status + return GameStatus___status endfunction -//Implemented from module GameStatus__GameStatusInit: +//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 @@ -20018,7 +19988,7 @@ endfunction endloop // force the player to select a dummy unit - set u=CreateUnit(firstPlayer, GameStatus__DUMMY_UNIT_ID, 0, 0, 0) + set u=CreateUnit(firstPlayer, GameStatus___DUMMY_UNIT_ID, 0, 0, 0) call SelectUnit(u, true) set selected=IsUnitSelected(u, firstPlayer) call h__RemoveUnit(u) @@ -20028,14 +19998,14 @@ endfunction // detect if replay or offline game if ( ReloadGameCachesFromDisk() ) then - set GameStatus__status=GAME_STATUS_OFFLINE + set GameStatus___status=GAME_STATUS_OFFLINE else - set GameStatus__status=GAME_STATUS_REPLAY + set GameStatus___status=GAME_STATUS_REPLAY endif else // if the unit wasn't selected instantly, the game is online - set GameStatus__status=GAME_STATUS_ONLINE + set GameStatus___status=GAME_STATUS_ONLINE endif endfunction @@ -20172,38 +20142,38 @@ endfunction -function GroupUtils__HookDestroyGroup takes group g returns nothing +function GroupUtils___HookDestroyGroup takes group g returns nothing if g == ENUM_GROUP then call h__BJDebugMsg("GroupUtils_Warning: ENUM_GROUP destroyed") endif endfunction -function GroupUtils__AddEx takes nothing returns nothing - if GroupUtils__Flag then - call GroupClear(GroupUtils__Refr) - set GroupUtils__Flag=false +function GroupUtils___AddEx takes nothing returns nothing + if GroupUtils___Flag then + call GroupClear(GroupUtils___Refr) + set GroupUtils___Flag=false endif - call GroupAddUnit(GroupUtils__Refr, GetEnumUnit()) + call GroupAddUnit(GroupUtils___Refr, GetEnumUnit()) endfunction function GroupRefresh takes group g returns nothing - set GroupUtils__Flag=true - set GroupUtils__Refr=g - call ForGroup(GroupUtils__Refr, function GroupUtils__AddEx) - if GroupUtils__Flag then + set GroupUtils___Flag=true + set GroupUtils___Refr=g + call ForGroup(GroupUtils___Refr, function GroupUtils___AddEx) + if GroupUtils___Flag then call GroupClear(g) endif endfunction function NewGroup takes nothing returns group - if GroupUtils__Count == 0 then - set GroupUtils__Groups[0]=CreateGroup() + if GroupUtils___Count == 0 then + set GroupUtils___Groups[0]=CreateGroup() else - set GroupUtils__Count=GroupUtils__Count - 1 + set GroupUtils___Count=GroupUtils___Count - 1 endif - call SaveInteger(GroupUtils__ht, 0, GetHandleId(GroupUtils__Groups[GroupUtils__Count]), 1) + call SaveInteger(GroupUtils___ht, 0, GetHandleId(GroupUtils___Groups[GroupUtils___Count]), 1) - return GroupUtils__Groups[GroupUtils__Count] + return GroupUtils___Groups[GroupUtils___Count] endfunction function ReleaseGroup takes group g returns boolean local integer id= GetHandleId(g) @@ -20217,104 +20187,104 @@ function ReleaseGroup takes group g returns boolean if g == null then return false - elseif not HaveSavedInteger(GroupUtils__ht, 0, id) then + elseif not HaveSavedInteger(GroupUtils___ht, 0, id) then return false - elseif LoadInteger(GroupUtils__ht, 0, id) == 2 then + elseif LoadInteger(GroupUtils___ht, 0, id) == 2 then return false - elseif GroupUtils__Count == 8191 then + elseif GroupUtils___Count == 8191 then call DestroyGroup(g) return false endif - call SaveInteger(GroupUtils__ht, 0, id, 2) + call SaveInteger(GroupUtils___ht, 0, id, 2) call GroupClear(g) - set GroupUtils__Groups[GroupUtils__Count]=g - set GroupUtils__Count=GroupUtils__Count + 1 + set GroupUtils___Groups[GroupUtils___Count]=g + set GroupUtils___Count=GroupUtils___Count + 1 return true endfunction -function GroupUtils__Filter takes nothing returns boolean - return IsUnitInRangeXY(GetFilterUnit(), GroupUtils__X, GroupUtils__Y, GroupUtils__R) +function GroupUtils___Filter takes nothing returns boolean + return IsUnitInRangeXY(GetFilterUnit(), GroupUtils___X, GroupUtils___Y, GroupUtils___R) endfunction -function GroupUtils__HookDestroyBoolExpr takes boolexpr b returns nothing +function GroupUtils___HookDestroyBoolExpr takes boolexpr b returns nothing local integer bid= GetHandleId(b) - if HaveSavedHandle(GroupUtils__H, 0, bid) then + if HaveSavedHandle(GroupUtils___H, 0, bid) then //Clear the saved boolexpr - call h__DestroyBoolExpr(LoadBooleanExprHandle(GroupUtils__H, 0, bid)) - call RemoveSavedHandle(GroupUtils__H, 0, bid) + call h__DestroyBoolExpr(LoadBooleanExprHandle(GroupUtils___H, 0, bid)) + call RemoveSavedHandle(GroupUtils___H, 0, bid) endif endfunction -//processed hook: hook DestroyBoolExpr GroupUtils__HookDestroyBoolExpr +//processed hook: hook DestroyBoolExpr GroupUtils___HookDestroyBoolExpr -constant function GroupUtils__GetRadius takes real radius returns real +constant function GroupUtils___GetRadius takes real radius returns real - return radius + GroupUtils__MAX_COLLISION_SIZE + return radius + GroupUtils___MAX_COLLISION_SIZE endfunction function GroupEnumUnitsInArea takes group whichGroup,real x,real y,real radius,boolexpr l__filter returns nothing - local real prevX= GroupUtils__X - local real prevY= GroupUtils__Y - local real prevR= GroupUtils__R + local real prevX= GroupUtils___X + local real prevY= GroupUtils___Y + local real prevR= GroupUtils___R local integer bid= 0 //Set variables to new values - set GroupUtils__X=x - set GroupUtils__Y=y - set GroupUtils__R=radius + set GroupUtils___X=x + set GroupUtils___Y=y + set GroupUtils___R=radius if l__filter == null then //Adjusts for null boolexprs passed to the function - set l__filter=Condition(function GroupUtils__Filter) + set l__filter=Condition(function GroupUtils___Filter) else //Check for a saved boolexpr set bid=GetHandleId(l__filter) - if HaveSavedHandle(GroupUtils__H, 0, bid) then + if HaveSavedHandle(GroupUtils___H, 0, bid) then //Set the filter to use to the saved one - set l__filter=LoadBooleanExprHandle(GroupUtils__H, 0, bid) + set l__filter=LoadBooleanExprHandle(GroupUtils___H, 0, bid) else //Create a new And() boolexpr for this filter - set l__filter=And(Condition(function GroupUtils__Filter), l__filter) - call SaveBooleanExprHandle(GroupUtils__H, 0, bid, l__filter) + set l__filter=And(Condition(function GroupUtils___Filter), l__filter) + call SaveBooleanExprHandle(GroupUtils___H, 0, bid, l__filter) endif endif //Enumerate, if they want to use the boolexpr, this lets them - call GroupEnumUnitsInRange(whichGroup, x, y, (((radius)*1.0) + GroupUtils__MAX_COLLISION_SIZE), l__filter) // INLINED!! + call GroupEnumUnitsInRange(whichGroup, x, y, (((radius)*1.0) + GroupUtils___MAX_COLLISION_SIZE), l__filter) // INLINED!! //Give back original settings so nested enumerations work - set GroupUtils__X=prevX - set GroupUtils__Y=prevY - set GroupUtils__R=prevR + set GroupUtils___X=prevX + set GroupUtils___Y=prevY + set GroupUtils___R=prevR endfunction function GroupUnitsInArea takes group whichGroup,real x,real y,real radius returns nothing - local real prevX= GroupUtils__X - local real prevY= GroupUtils__Y - local real prevR= GroupUtils__R + local real prevX= GroupUtils___X + local real prevY= GroupUtils___Y + local real prevR= GroupUtils___R //Set variables to new values - set GroupUtils__X=x - set GroupUtils__Y=y - set GroupUtils__R=radius + set GroupUtils___X=x + set GroupUtils___Y=y + set GroupUtils___R=radius //Enumerate - call GroupEnumUnitsInRange(whichGroup, x, y, (((radius)*1.0) + GroupUtils__MAX_COLLISION_SIZE), Condition(function GroupUtils__Filter)) // INLINED!! + call GroupEnumUnitsInRange(whichGroup, x, y, (((radius)*1.0) + GroupUtils___MAX_COLLISION_SIZE), Condition(function GroupUtils___Filter)) // INLINED!! //Give back original settings so nested enumerations work - set GroupUtils__X=prevX - set GroupUtils__Y=prevY - set GroupUtils__R=prevR + set GroupUtils___X=prevX + set GroupUtils___Y=prevY + set GroupUtils___R=prevR endfunction -function GroupUtils__True takes nothing returns boolean +function GroupUtils___True takes nothing returns boolean return true endfunction -function GroupUtils__False takes nothing returns boolean +function GroupUtils___False takes nothing returns boolean return false endfunction -function GroupUtils__Init takes nothing returns nothing - set BOOLEXPR_TRUE=Condition(function GroupUtils__True) - set BOOLEXPR_FALSE=Condition(function GroupUtils__False) +function GroupUtils___Init takes nothing returns nothing + set BOOLEXPR_TRUE=Condition(function GroupUtils___True) + set BOOLEXPR_FALSE=Condition(function GroupUtils___False) endfunction //library GroupUtils ends @@ -20630,7 +20600,7 @@ function IsOrderIdle takes integer orderId returns boolean return orderId == IdleWorkersSystem_ORDER_NONE or orderId == IdleWorkersSystem_ORDER_STOP or orderId == IdleWorkersSystem_ORDER_HOLD_POSITION or orderId == IdleWorkersSystem_ORDER_STAND_DOWN endfunction -function IdleWorkersSystem___FilterIsIdleLivingWorker takes nothing returns boolean +function IdleWorkersSystem__FilterIsIdleLivingWorker takes nothing returns boolean local boolean result= IsUnitType(GetFilterUnit(), UNIT_TYPE_PEON) and IsUnitAliveBJ(GetFilterUnit()) and IsOrderIdle(GetUnitCurrentOrder(GetFilterUnit())) if ( result ) then @@ -20647,8 +20617,8 @@ endfunction function RefreshIdleWorkers takes player whichPlayer returns nothing local integer playerId= GetPlayerId(whichPlayer) - call GroupClear(IdleWorkersSystem___idleWorkers[playerId]) - call GroupEnumUnitsOfPlayer(IdleWorkersSystem___idleWorkers[playerId], whichPlayer, Filter(function IdleWorkersSystem___FilterIsIdleLivingWorker)) + call GroupClear(IdleWorkersSystem__idleWorkers[playerId]) + call GroupEnumUnitsOfPlayer(IdleWorkersSystem__idleWorkers[playerId], whichPlayer, Filter(function IdleWorkersSystem__FilterIsIdleLivingWorker)) endfunction function RefreshAllIdleWorkers takes nothing returns nothing @@ -20660,44 +20630,44 @@ function RefreshAllIdleWorkers takes nothing returns nothing endloop endfunction -function IdleWorkersSystem___CopyGroup takes group whichGroup returns group +function IdleWorkersSystem__CopyGroup takes group whichGroup returns group local group copy= CreateGroup() call GroupAddGroup(whichGroup, copy) return copy endfunction function GetIdleWorkers takes player whichPlayer returns group - return IdleWorkersSystem___CopyGroup(IdleWorkersSystem___idleWorkers[GetPlayerId(whichPlayer)]) + return IdleWorkersSystem__CopyGroup(IdleWorkersSystem__idleWorkers[GetPlayerId(whichPlayer)]) endfunction function GetIdleWorkersSize takes player whichPlayer returns integer - return BlzGroupGetSize(IdleWorkersSystem___idleWorkers[GetPlayerId(whichPlayer)]) + return BlzGroupGetSize(IdleWorkersSystem__idleWorkers[GetPlayerId(whichPlayer)]) endfunction function IsUnitIdleWorker takes unit whichUnit returns boolean - return IsUnitInGroup(whichUnit, IdleWorkersSystem___idleWorkers[GetPlayerId(GetOwningPlayer(whichUnit))]) + return IsUnitInGroup(whichUnit, IdleWorkersSystem__idleWorkers[GetPlayerId(GetOwningPlayer(whichUnit))]) endfunction function GetIdleWorkersOrderDetectionTimerHandleId takes nothing returns integer - return GetHandleId(IdleWorkersSystem___orderDetectionTimer) + return GetHandleId(IdleWorkersSystem__orderDetectionTimer) endfunction function PauseIdleWorkerDetection takes nothing returns nothing - call PauseTimer(IdleWorkersSystem___orderDetectionTimer) + call PauseTimer(IdleWorkersSystem__orderDetectionTimer) endfunction function ResumeIdleWorkerDetection takes nothing returns nothing - call ResumeTimer(IdleWorkersSystem___orderDetectionTimer) + call ResumeTimer(IdleWorkersSystem__orderDetectionTimer) endfunction function StartIdleWorkerDetection takes nothing returns nothing - call TimerStart(IdleWorkersSystem___orderDetectionTimer, IdleWorkersSystem_ORDER_DETECTION_TIMEOUT, true, function RefreshAllIdleWorkers) + call TimerStart(IdleWorkersSystem__orderDetectionTimer, IdleWorkersSystem_ORDER_DETECTION_TIMEOUT, true, function RefreshAllIdleWorkers) endfunction -function IdleWorkersSystem___Init takes nothing returns nothing +function IdleWorkersSystem__Init takes nothing returns nothing local integer i= 0 loop - set IdleWorkersSystem___idleWorkers[i]=CreateGroup() + set IdleWorkersSystem__idleWorkers[i]=CreateGroup() set i=i + 1 exitwhen ( i >= bj_MAX_PLAYERS ) endloop @@ -20706,16 +20676,16 @@ function IdleWorkersSystem___Init takes nothing returns nothing endfunction -function IdleWorkersSystem___RemoveUnitHook takes unit whichUnit returns nothing +function IdleWorkersSystem__RemoveUnitHook takes unit whichUnit returns nothing if ( IsUnitIdleWorker(whichUnit) ) then - call GroupRemoveUnit(IdleWorkersSystem___idleWorkers[GetPlayerId(GetOwningPlayer(whichUnit))], whichUnit) + call GroupRemoveUnit(IdleWorkersSystem__idleWorkers[GetPlayerId(GetOwningPlayer(whichUnit))], whichUnit) endif endfunction -//processed hook: hook RemoveUnit IdleWorkersSystem___RemoveUnitHook +//processed hook: hook RemoveUnit IdleWorkersSystem__RemoveUnitHook @@ -20827,187 +20797,187 @@ endfunction function GetTriggerRespawnItem takes nothing returns item - return ItemRespawnSystem___callbackItem + return ItemRespawnSystem__callbackItem endfunction function GetTriggerRespawnItemIndex takes nothing returns integer - return ItemRespawnSystem___callbackIndex + return ItemRespawnSystem__callbackIndex endfunction function TriggerRegisterItemRespawnEvent takes trigger whichTrigger returns nothing - local integer index= ItemRespawnSystem___callbackRespawnTriggersCounter - set ItemRespawnSystem___callbackRespawnTriggers[index]=whichTrigger - set ItemRespawnSystem___callbackRespawnTriggersCounter=ItemRespawnSystem___callbackRespawnTriggersCounter + 1 + local integer index= ItemRespawnSystem__callbackRespawnTriggersCounter + set ItemRespawnSystem__callbackRespawnTriggers[index]=whichTrigger + set ItemRespawnSystem__callbackRespawnTriggersCounter=ItemRespawnSystem__callbackRespawnTriggersCounter + 1 endfunction -function ItemRespawnSystem___EvaluateAndExecuteCallbackRespawnTriggers takes integer index returns nothing +function ItemRespawnSystem__EvaluateAndExecuteCallbackRespawnTriggers takes integer index returns nothing local integer i= 0 loop - exitwhen ( i >= ItemRespawnSystem___callbackRespawnTriggersCounter ) - set ItemRespawnSystem___callbackItem=ItemRespawnSystem___respawnItemItem[index] - set ItemRespawnSystem___callbackIndex=index - call ConditionalTriggerExecute(ItemRespawnSystem___callbackRespawnTriggers[i]) + exitwhen ( i >= ItemRespawnSystem__callbackRespawnTriggersCounter ) + set ItemRespawnSystem__callbackItem=ItemRespawnSystem__respawnItemItem[index] + set ItemRespawnSystem__callbackIndex=index + call ConditionalTriggerExecute(ItemRespawnSystem__callbackRespawnTriggers[i]) set i=i + 1 endloop endfunction function TriggerRegisterItemRespawnStartsEvent takes trigger whichTrigger returns nothing - local integer index= ItemRespawnSystem___callbackRespawnStartsTriggersCounter - set ItemRespawnSystem___callbackRespawnStartsTriggers[index]=whichTrigger - set ItemRespawnSystem___callbackRespawnStartsTriggersCounter=ItemRespawnSystem___callbackRespawnStartsTriggersCounter + 1 + local integer index= ItemRespawnSystem__callbackRespawnStartsTriggersCounter + set ItemRespawnSystem__callbackRespawnStartsTriggers[index]=whichTrigger + set ItemRespawnSystem__callbackRespawnStartsTriggersCounter=ItemRespawnSystem__callbackRespawnStartsTriggersCounter + 1 endfunction -function ItemRespawnSystem___EvaluateAndExecuteCallbackRespawnStartsTriggers takes integer index returns nothing +function ItemRespawnSystem__EvaluateAndExecuteCallbackRespawnStartsTriggers takes integer index returns nothing local integer i= 0 loop - exitwhen ( i >= ItemRespawnSystem___callbackRespawnStartsTriggersCounter ) - set ItemRespawnSystem___callbackItem=ItemRespawnSystem___respawnItemItem[index] - set ItemRespawnSystem___callbackIndex=index - call ConditionalTriggerExecute(ItemRespawnSystem___callbackRespawnStartsTriggers[i]) + exitwhen ( i >= ItemRespawnSystem__callbackRespawnStartsTriggersCounter ) + set ItemRespawnSystem__callbackItem=ItemRespawnSystem__respawnItemItem[index] + set ItemRespawnSystem__callbackIndex=index + call ConditionalTriggerExecute(ItemRespawnSystem__callbackRespawnStartsTriggers[i]) set i=i + 1 endloop endfunction -function ItemRespawnSystem___ClearItemRespawnIndex takes integer handleID returns nothing - if ( HaveSavedInteger(ItemRespawnSystem___respawnItemHashTable, handleID, 0) ) then - call FlushChildHashtable(ItemRespawnSystem___respawnItemHashTable, handleID) +function ItemRespawnSystem__ClearItemRespawnIndex takes integer handleID returns nothing + if ( HaveSavedInteger(ItemRespawnSystem__respawnItemHashTable, handleID, 0) ) then + call FlushChildHashtable(ItemRespawnSystem__respawnItemHashTable, handleID) endif endfunction -function ItemRespawnSystem___GetItemRespawnIndexByHandleID takes integer handleID returns integer - if ( HaveSavedInteger(ItemRespawnSystem___respawnItemHashTable, handleID, 0) ) then - return LoadInteger(ItemRespawnSystem___respawnItemHashTable, handleID, 0) +function ItemRespawnSystem__GetItemRespawnIndexByHandleID takes integer handleID returns integer + if ( HaveSavedInteger(ItemRespawnSystem__respawnItemHashTable, handleID, 0) ) then + return LoadInteger(ItemRespawnSystem__respawnItemHashTable, handleID, 0) endif return - 1 endfunction function GetItemRespawnIndex takes item whichItem returns integer - return ItemRespawnSystem___GetItemRespawnIndexByHandleID(GetHandleId(whichItem)) + return ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId(whichItem)) endfunction function GetItemRespawnCounter takes nothing returns integer - return ItemRespawnSystem___respawnItemCounter + return ItemRespawnSystem__respawnItemCounter endfunction function IsRespawnItemValid takes integer index returns boolean if ( index < 0 ) then return false endif - return ItemRespawnSystem___respawnItemIsValid[index] + return ItemRespawnSystem__respawnItemIsValid[index] endfunction function RespawnItem takes integer index returns boolean - if ( not IsRespawnItemValid(index) or ItemRespawnSystem___respawnItemItem[index] != null ) then + if ( not IsRespawnItemValid(index) or ItemRespawnSystem__respawnItemItem[index] != null ) then return false endif - if ( ItemRespawnSystem___respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEM ) then - set ItemRespawnSystem___respawnItemItem[index]=CreateItem(ItemRespawnSystem___respawnItemItemTypeId[index], ItemRespawnSystem___respawnItemX[index], ItemRespawnSystem___respawnItemY[index]) - elseif ( ItemRespawnSystem___respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEMPOOL ) then - set ItemRespawnSystem___respawnItemItem[index]=PlaceRandomItem(ItemRespawnSystem___respawnItemPool[index], ItemRespawnSystem___respawnItemX[index], ItemRespawnSystem___respawnItemY[index]) - elseif ( ItemRespawnSystem___respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_LEVEL ) then - set ItemRespawnSystem___respawnItemItem[index]=CreateItem(ChooseRandomItem(ItemRespawnSystem___respawnItemRandomLevel[index]), ItemRespawnSystem___respawnItemX[index], ItemRespawnSystem___respawnItemY[index]) - elseif ( ItemRespawnSystem___respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_TYPE_AND_LEVEL ) then - set ItemRespawnSystem___respawnItemItem[index]=CreateItem(ChooseRandomItemEx(ItemRespawnSystem___respawnItemRandomType[index], ItemRespawnSystem___respawnItemRandomLevel[index]), ItemRespawnSystem___respawnItemX[index], ItemRespawnSystem___respawnItemY[index]) + if ( ItemRespawnSystem__respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEM ) then + set ItemRespawnSystem__respawnItemItem[index]=CreateItem(ItemRespawnSystem__respawnItemItemTypeId[index], ItemRespawnSystem__respawnItemX[index], ItemRespawnSystem__respawnItemY[index]) + elseif ( ItemRespawnSystem__respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEMPOOL ) then + set ItemRespawnSystem__respawnItemItem[index]=PlaceRandomItem(ItemRespawnSystem__respawnItemPool[index], ItemRespawnSystem__respawnItemX[index], ItemRespawnSystem__respawnItemY[index]) + elseif ( ItemRespawnSystem__respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_LEVEL ) then + set ItemRespawnSystem__respawnItemItem[index]=CreateItem(ChooseRandomItem(ItemRespawnSystem__respawnItemRandomLevel[index]), ItemRespawnSystem__respawnItemX[index], ItemRespawnSystem__respawnItemY[index]) + elseif ( ItemRespawnSystem__respawnItemType[index] == ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_TYPE_AND_LEVEL ) then + set ItemRespawnSystem__respawnItemItem[index]=CreateItem(ChooseRandomItemEx(ItemRespawnSystem__respawnItemRandomType[index], ItemRespawnSystem__respawnItemRandomLevel[index]), ItemRespawnSystem__respawnItemX[index], ItemRespawnSystem__respawnItemY[index]) endif - set ItemRespawnSystem___respawnItemHandleId[index]=GetHandleId(ItemRespawnSystem___respawnItemItem[index]) - call SaveInteger(ItemRespawnSystem___respawnItemHashTable, ItemRespawnSystem___respawnItemHandleId[index], 0, index) - set ItemRespawnSystem___evaluateIndex=index - call TriggerEvaluate(ItemRespawnSystem___refreshEvaluateTrigger) - call ItemRespawnSystem___EvaluateAndExecuteCallbackRespawnTriggers(index) + set ItemRespawnSystem__respawnItemHandleId[index]=GetHandleId(ItemRespawnSystem__respawnItemItem[index]) + call SaveInteger(ItemRespawnSystem__respawnItemHashTable, ItemRespawnSystem__respawnItemHandleId[index], 0, index) + set ItemRespawnSystem__evaluateIndex=index + call TriggerEvaluate(ItemRespawnSystem__refreshEvaluateTrigger) + call ItemRespawnSystem__EvaluateAndExecuteCallbackRespawnTriggers(index) return true endfunction function RespawnAllItems takes nothing returns nothing local integer i= 0 loop - exitwhen ( i >= ItemRespawnSystem___respawnItemCounter ) - if ( IsRespawnItemValid(i) and ItemRespawnSystem___respawnItemItem[i] == null ) then + exitwhen ( i >= ItemRespawnSystem__respawnItemCounter ) + if ( IsRespawnItemValid(i) and ItemRespawnSystem__respawnItemItem[i] == null ) then call RespawnItem(i) endif set i=i + 1 endloop endfunction -function ItemRespawnSystem___TimerFunctionRespawnItem takes nothing returns nothing - local integer index= LoadInteger(ItemRespawnSystem___respawnItemHashTable, GetHandleId(GetExpiredTimer()), 0) +function ItemRespawnSystem__TimerFunctionRespawnItem takes nothing returns nothing + local integer index= LoadInteger(ItemRespawnSystem__respawnItemHashTable, GetHandleId(GetExpiredTimer()), 0) call RespawnItem(index) endfunction function StartItemRespawn takes integer index returns nothing - call ItemRespawnSystem___EvaluateAndExecuteCallbackRespawnStartsTriggers(index) + call ItemRespawnSystem__EvaluateAndExecuteCallbackRespawnStartsTriggers(index) - if ( ItemRespawnSystem___respawnItemHandleId[index] != 0 ) then - call ItemRespawnSystem___ClearItemRespawnIndex(ItemRespawnSystem___respawnItemHandleId[index]) + if ( ItemRespawnSystem__respawnItemHandleId[index] != 0 ) then + call ItemRespawnSystem__ClearItemRespawnIndex(ItemRespawnSystem__respawnItemHandleId[index]) endif - set ItemRespawnSystem___respawnItemItem[index]=null - set ItemRespawnSystem___respawnItemHandleId[index]=0 - call TimerStart(ItemRespawnSystem___respawnItemTimer[index], ItemRespawnSystem___respawnItemTimeout[index], false, function ItemRespawnSystem___TimerFunctionRespawnItem) + set ItemRespawnSystem__respawnItemItem[index]=null + set ItemRespawnSystem__respawnItemHandleId[index]=0 + call TimerStart(ItemRespawnSystem__respawnItemTimer[index], ItemRespawnSystem__respawnItemTimeout[index], false, function ItemRespawnSystem__TimerFunctionRespawnItem) endfunction -function ItemRespawnSystem___TriggerActionDeath takes nothing returns nothing - local integer index= ItemRespawnSystem___GetItemRespawnIndexByHandleID(GetHandleId(GetTriggerWidget())) +function ItemRespawnSystem__TriggerActionDeath takes nothing returns nothing + local integer index= ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId(GetTriggerWidget())) call StartItemRespawn(index) endfunction -function ItemRespawnSystem___RefreshDeathTrigger takes integer index returns nothing - if ( ItemRespawnSystem___respawnItemDeathTrigger[index] != null ) then - call DestroyTrigger(ItemRespawnSystem___respawnItemDeathTrigger[index]) - set ItemRespawnSystem___respawnItemDeathTrigger[index]=null +function ItemRespawnSystem__RefreshDeathTrigger takes integer index returns nothing + if ( ItemRespawnSystem__respawnItemDeathTrigger[index] != null ) then + call DestroyTrigger(ItemRespawnSystem__respawnItemDeathTrigger[index]) + set ItemRespawnSystem__respawnItemDeathTrigger[index]=null endif - set ItemRespawnSystem___respawnItemDeathTrigger[index]=CreateTrigger() - call TriggerRegisterDeathEvent(ItemRespawnSystem___respawnItemDeathTrigger[index], ItemRespawnSystem___respawnItemItem[index]) - call TriggerAddAction(ItemRespawnSystem___respawnItemDeathTrigger[index], function ItemRespawnSystem___TriggerActionDeath) + set ItemRespawnSystem__respawnItemDeathTrigger[index]=CreateTrigger() + call TriggerRegisterDeathEvent(ItemRespawnSystem__respawnItemDeathTrigger[index], ItemRespawnSystem__respawnItemItem[index]) + call TriggerAddAction(ItemRespawnSystem__respawnItemDeathTrigger[index], function ItemRespawnSystem__TriggerActionDeath) endfunction -function ItemRespawnSystem___RefreshDeathTriggerEvaluate takes nothing returns boolean - call ItemRespawnSystem___RefreshDeathTrigger(ItemRespawnSystem___evaluateIndex) +function ItemRespawnSystem__RefreshDeathTriggerEvaluate takes nothing returns boolean + call ItemRespawnSystem__RefreshDeathTrigger(ItemRespawnSystem__evaluateIndex) return false endfunction -function ItemRespawnSystem___AddRespawnItemDefault takes integer index,real x,real y returns nothing - set ItemRespawnSystem___respawnItemIsValid[index]=true - set ItemRespawnSystem___respawnItemX[index]=x - set ItemRespawnSystem___respawnItemY[index]=y - set ItemRespawnSystem___respawnItemTimer[index]=CreateTimer() - set ItemRespawnSystem___respawnItemTimeout[index]=ItemRespawnSystem_DEFAULT_TIMEOUT - call SaveInteger(ItemRespawnSystem___respawnItemHashTable, GetHandleId(ItemRespawnSystem___respawnItemTimer[index]), 0, index) - set ItemRespawnSystem___respawnItemEnabled[index]=true - call ItemRespawnSystem___RefreshDeathTrigger(index) +function ItemRespawnSystem__AddRespawnItemDefault takes integer index,real x,real y returns nothing + set ItemRespawnSystem__respawnItemIsValid[index]=true + set ItemRespawnSystem__respawnItemX[index]=x + set ItemRespawnSystem__respawnItemY[index]=y + set ItemRespawnSystem__respawnItemTimer[index]=CreateTimer() + set ItemRespawnSystem__respawnItemTimeout[index]=ItemRespawnSystem_DEFAULT_TIMEOUT + call SaveInteger(ItemRespawnSystem__respawnItemHashTable, GetHandleId(ItemRespawnSystem__respawnItemTimer[index]), 0, index) + set ItemRespawnSystem__respawnItemEnabled[index]=true + call ItemRespawnSystem__RefreshDeathTrigger(index) loop - set ItemRespawnSystem___respawnItemFreeIndex=ItemRespawnSystem___respawnItemFreeIndex + 1 - exitwhen ( not IsRespawnItemValid(ItemRespawnSystem___respawnItemFreeIndex) ) + set ItemRespawnSystem__respawnItemFreeIndex=ItemRespawnSystem__respawnItemFreeIndex + 1 + exitwhen ( not IsRespawnItemValid(ItemRespawnSystem__respawnItemFreeIndex) ) endloop - if ( index >= ItemRespawnSystem___respawnItemCounter ) then - set ItemRespawnSystem___respawnItemCounter=index + 1 + if ( index >= ItemRespawnSystem__respawnItemCounter ) then + set ItemRespawnSystem__respawnItemCounter=index + 1 endif endfunction function AddRespawnItem takes item whichItem returns integer - local integer index= ItemRespawnSystem___respawnItemFreeIndex - set ItemRespawnSystem___respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEM - set ItemRespawnSystem___respawnItemItem[index]=whichItem - set ItemRespawnSystem___respawnItemHandleId[index]=GetHandleId(whichItem) - set ItemRespawnSystem___respawnItemItemTypeId[index]=GetItemTypeId(whichItem) - set ItemRespawnSystem___respawnItemPool[index]=null - call ItemRespawnSystem___AddRespawnItemDefault(index , GetItemX(whichItem) , GetItemY(whichItem)) + local integer index= ItemRespawnSystem__respawnItemFreeIndex + set ItemRespawnSystem__respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEM + set ItemRespawnSystem__respawnItemItem[index]=whichItem + set ItemRespawnSystem__respawnItemHandleId[index]=GetHandleId(whichItem) + set ItemRespawnSystem__respawnItemItemTypeId[index]=GetItemTypeId(whichItem) + set ItemRespawnSystem__respawnItemPool[index]=null + call ItemRespawnSystem__AddRespawnItemDefault(index , GetItemX(whichItem) , GetItemY(whichItem)) - call SaveInteger(ItemRespawnSystem___respawnItemHashTable, ItemRespawnSystem___respawnItemHandleId[index], 0, index) + call SaveInteger(ItemRespawnSystem__respawnItemHashTable, ItemRespawnSystem__respawnItemHandleId[index], 0, index) return index endfunction function AddRespawnItemPool takes itempool whichItemPool,real x,real y returns integer - local integer index= ItemRespawnSystem___respawnItemFreeIndex - set ItemRespawnSystem___respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEMPOOL - set ItemRespawnSystem___respawnItemItem[index]=null - set ItemRespawnSystem___respawnItemHandleId[index]=0 - set ItemRespawnSystem___respawnItemItemTypeId[index]=0 - set ItemRespawnSystem___respawnItemPool[index]=whichItemPool - call ItemRespawnSystem___AddRespawnItemDefault(index , x , y) + local integer index= ItemRespawnSystem__respawnItemFreeIndex + set ItemRespawnSystem__respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_ITEMPOOL + set ItemRespawnSystem__respawnItemItem[index]=null + set ItemRespawnSystem__respawnItemHandleId[index]=0 + set ItemRespawnSystem__respawnItemItemTypeId[index]=0 + set ItemRespawnSystem__respawnItemPool[index]=whichItemPool + call ItemRespawnSystem__AddRespawnItemDefault(index , x , y) call RespawnItem(index) @@ -21015,15 +20985,15 @@ function AddRespawnItemPool takes itempool whichItemPool,real x,real y returns i endfunction function AddRespawnItemRandom takes integer level,real x,real y returns integer - local integer index= ItemRespawnSystem___respawnItemFreeIndex - set ItemRespawnSystem___respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_LEVEL - set ItemRespawnSystem___respawnItemItem[index]=null - set ItemRespawnSystem___respawnItemHandleId[index]=0 - set ItemRespawnSystem___respawnItemItemTypeId[index]=0 - set ItemRespawnSystem___respawnItemPool[index]=null - set ItemRespawnSystem___respawnItemRandomLevel[index]=level - set ItemRespawnSystem___respawnItemRandomType[index]=null - call ItemRespawnSystem___AddRespawnItemDefault(index , x , y) + local integer index= ItemRespawnSystem__respawnItemFreeIndex + set ItemRespawnSystem__respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_LEVEL + set ItemRespawnSystem__respawnItemItem[index]=null + set ItemRespawnSystem__respawnItemHandleId[index]=0 + set ItemRespawnSystem__respawnItemItemTypeId[index]=0 + set ItemRespawnSystem__respawnItemPool[index]=null + set ItemRespawnSystem__respawnItemRandomLevel[index]=level + set ItemRespawnSystem__respawnItemRandomType[index]=null + call ItemRespawnSystem__AddRespawnItemDefault(index , x , y) call RespawnItem(index) @@ -21031,15 +21001,15 @@ function AddRespawnItemRandom takes integer level,real x,real y returns integer endfunction function AddRespawnItemRandomEx takes itemtype whichType,integer level,real x,real y returns integer - local integer index= ItemRespawnSystem___respawnItemFreeIndex - set ItemRespawnSystem___respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_TYPE_AND_LEVEL - set ItemRespawnSystem___respawnItemItem[index]=null - set ItemRespawnSystem___respawnItemHandleId[index]=0 - set ItemRespawnSystem___respawnItemItemTypeId[index]=0 - set ItemRespawnSystem___respawnItemPool[index]=null - set ItemRespawnSystem___respawnItemRandomLevel[index]=level - set ItemRespawnSystem___respawnItemRandomType[index]=whichType - call ItemRespawnSystem___AddRespawnItemDefault(index , x , y) + local integer index= ItemRespawnSystem__respawnItemFreeIndex + set ItemRespawnSystem__respawnItemType[index]=ItemRespawnSystem_ITEM_RESPAWN_TYPE_RANDOM_TYPE_AND_LEVEL + set ItemRespawnSystem__respawnItemItem[index]=null + set ItemRespawnSystem__respawnItemHandleId[index]=0 + set ItemRespawnSystem__respawnItemItemTypeId[index]=0 + set ItemRespawnSystem__respawnItemPool[index]=null + set ItemRespawnSystem__respawnItemRandomLevel[index]=level + set ItemRespawnSystem__respawnItemRandomType[index]=whichType + call ItemRespawnSystem__AddRespawnItemDefault(index , x , y) call RespawnItem(index) @@ -21048,29 +21018,29 @@ endfunction function RemoveRespawnItem takes integer index returns boolean if ( IsRespawnItemValid(index) ) then - set ItemRespawnSystem___respawnItemIsValid[index]=false + set ItemRespawnSystem__respawnItemIsValid[index]=false - if ( ItemRespawnSystem___respawnItemItem[index] != null ) then - call ItemRespawnSystem___ClearItemRespawnIndex(GetHandleId(ItemRespawnSystem___respawnItemItem[index])) + if ( ItemRespawnSystem__respawnItemItem[index] != null ) then + call ItemRespawnSystem__ClearItemRespawnIndex(GetHandleId(ItemRespawnSystem__respawnItemItem[index])) endif - set ItemRespawnSystem___respawnItemTimeout[index]=0 - set ItemRespawnSystem___respawnItemType[index]=0 - set ItemRespawnSystem___respawnItemItem[index]=null - set ItemRespawnSystem___respawnItemHandleId[index]=0 - set ItemRespawnSystem___respawnItemItemTypeId[index]=0 - set ItemRespawnSystem___respawnItemPool[index]=null - set ItemRespawnSystem___respawnItemRandomLevel[index]=0 - set ItemRespawnSystem___respawnItemRandomType[index]=null + set ItemRespawnSystem__respawnItemTimeout[index]=0 + set ItemRespawnSystem__respawnItemType[index]=0 + set ItemRespawnSystem__respawnItemItem[index]=null + set ItemRespawnSystem__respawnItemHandleId[index]=0 + set ItemRespawnSystem__respawnItemItemTypeId[index]=0 + set ItemRespawnSystem__respawnItemPool[index]=null + set ItemRespawnSystem__respawnItemRandomLevel[index]=0 + set ItemRespawnSystem__respawnItemRandomType[index]=null - call PauseTimer(ItemRespawnSystem___respawnItemTimer[index]) - call FlushChildHashtable(ItemRespawnSystem___respawnItemHashTable, GetHandleId(ItemRespawnSystem___respawnItemTimer[index])) - call DestroyTimer(ItemRespawnSystem___respawnItemTimer[index]) + call PauseTimer(ItemRespawnSystem__respawnItemTimer[index]) + call FlushChildHashtable(ItemRespawnSystem__respawnItemHashTable, GetHandleId(ItemRespawnSystem__respawnItemTimer[index])) + call DestroyTimer(ItemRespawnSystem__respawnItemTimer[index]) - set ItemRespawnSystem___respawnItemFreeIndex=index + set ItemRespawnSystem__respawnItemFreeIndex=index - if ( index == ItemRespawnSystem___respawnItemCounter - 1 ) then - set ItemRespawnSystem___respawnItemCounter=ItemRespawnSystem___respawnItemCounter - 1 + if ( index == ItemRespawnSystem__respawnItemCounter - 1 ) then + set ItemRespawnSystem__respawnItemCounter=ItemRespawnSystem__respawnItemCounter - 1 endif return true @@ -21080,112 +21050,112 @@ function RemoveRespawnItem takes integer index returns boolean endfunction function SetRespawnItemEnabled takes integer index,boolean enabled returns nothing - set ItemRespawnSystem___respawnItemEnabled[index]=enabled + set ItemRespawnSystem__respawnItemEnabled[index]=enabled endfunction function IsRespawnItemEnabled takes integer index returns boolean - return ItemRespawnSystem___respawnItemEnabled[index] + return ItemRespawnSystem__respawnItemEnabled[index] endfunction function GetRespawnItemTimer takes integer index returns timer - return ItemRespawnSystem___respawnItemTimer[index] + return ItemRespawnSystem__respawnItemTimer[index] endfunction function GetRespawnItemType takes integer index returns integer - return ItemRespawnSystem___respawnItemType[index] + return ItemRespawnSystem__respawnItemType[index] endfunction function SetRespawnItemTimeout takes integer index,real timeout returns nothing - set ItemRespawnSystem___respawnItemTimeout[index]=timeout + set ItemRespawnSystem__respawnItemTimeout[index]=timeout endfunction function GetRespawnItemTimeout takes integer index returns real - return ItemRespawnSystem___respawnItemTimeout[index] + return ItemRespawnSystem__respawnItemTimeout[index] endfunction function SetRespawnItemX takes integer index,real x returns nothing - set ItemRespawnSystem___respawnItemX[index]=x + set ItemRespawnSystem__respawnItemX[index]=x endfunction function GetRespawnItemX takes integer index returns real - return ItemRespawnSystem___respawnItemX[index] + return ItemRespawnSystem__respawnItemX[index] endfunction function SetRespawnItemY takes integer index,real y returns nothing - set ItemRespawnSystem___respawnItemX[index]=y + set ItemRespawnSystem__respawnItemX[index]=y endfunction function GetRespawnItemY takes integer index returns real - return ItemRespawnSystem___respawnItemY[index] + return ItemRespawnSystem__respawnItemY[index] endfunction function SetRespawnItem takes integer index,item whichItem returns nothing - set ItemRespawnSystem___respawnItemItem[index]=whichItem + set ItemRespawnSystem__respawnItemItem[index]=whichItem endfunction function GetRespawnItem takes integer index returns item - return ItemRespawnSystem___respawnItemItem[index] + return ItemRespawnSystem__respawnItemItem[index] endfunction function SetRespawnItemPool takes integer index,itempool whichItemPool returns nothing - set ItemRespawnSystem___respawnItemPool[index]=whichItemPool + set ItemRespawnSystem__respawnItemPool[index]=whichItemPool endfunction function GetRespawnItemPool takes integer index returns itempool - return ItemRespawnSystem___respawnItemPool[index] + return ItemRespawnSystem__respawnItemPool[index] endfunction function SetRespawnItemLevel takes integer index,integer level returns nothing - set ItemRespawnSystem___respawnItemRandomLevel[index]=level + set ItemRespawnSystem__respawnItemRandomLevel[index]=level endfunction function GetRespawnItemLevel takes integer index returns integer - return ItemRespawnSystem___respawnItemRandomLevel[index] + return ItemRespawnSystem__respawnItemRandomLevel[index] endfunction function SetRespawnItemItemType takes integer index,itemtype whichItemType returns nothing - set ItemRespawnSystem___respawnItemRandomType[index]=whichItemType + set ItemRespawnSystem__respawnItemRandomType[index]=whichItemType endfunction function GetRespawnItemItemType takes integer index returns itemtype - return ItemRespawnSystem___respawnItemRandomType[index] + return ItemRespawnSystem__respawnItemRandomType[index] endfunction -function ItemRespawnSystem___TriggerConditionRespawnItem takes nothing returns boolean - local integer index= (ItemRespawnSystem___GetItemRespawnIndexByHandleID(GetHandleId((GetManipulatedItem())))) // INLINED!! - return IsRespawnItemValid(index) and (ItemRespawnSystem___respawnItemEnabled[(index)]) // INLINED!! +function ItemRespawnSystem__TriggerConditionRespawnItem takes nothing returns boolean + local integer index= (ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId((GetManipulatedItem())))) // INLINED!! + return IsRespawnItemValid(index) and (ItemRespawnSystem__respawnItemEnabled[(index)]) // INLINED!! endfunction -function ItemRespawnSystem___TriggerActionRespawnItem takes nothing returns nothing - local integer index= (ItemRespawnSystem___GetItemRespawnIndexByHandleID(GetHandleId((GetManipulatedItem())))) // INLINED!! +function ItemRespawnSystem__TriggerActionRespawnItem takes nothing returns nothing + local integer index= (ItemRespawnSystem__GetItemRespawnIndexByHandleID(GetHandleId((GetManipulatedItem())))) // INLINED!! call StartItemRespawn(index) endfunction -function ItemRespawnSystem___AddEnumItem takes nothing returns nothing +function ItemRespawnSystem__AddEnumItem takes nothing returns nothing call AddRespawnItem(GetEnumItem()) endfunction -//Implemented from module ItemRespawnSystem___Init: +//Implemented from module ItemRespawnSystem__Init: - 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) + 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) - call TriggerAddCondition(ItemRespawnSystem___refreshEvaluateTrigger, Condition(function ItemRespawnSystem___RefreshDeathTriggerEvaluate)) + call TriggerAddCondition(ItemRespawnSystem__refreshEvaluateTrigger, Condition(function ItemRespawnSystem__RefreshDeathTriggerEvaluate)) - call EnumItemsInRect(GetPlayableMapRect(), null, function ItemRespawnSystem___AddEnumItem) + call EnumItemsInRect(GetPlayableMapRect(), null, function ItemRespawnSystem__AddEnumItem) endfunction -function ItemRespawnSystem___RemoveItemCleanup takes item whichItem returns nothing +function ItemRespawnSystem__RemoveItemCleanup takes item whichItem returns nothing local integer handleID= GetHandleId(whichItem) - call ItemRespawnSystem___ClearItemRespawnIndex(handleID) + call ItemRespawnSystem__ClearItemRespawnIndex(handleID) endfunction -//processed hook: hook RemoveItem ItemRespawnSystem___RemoveItemCleanup +//processed hook: hook RemoveItem ItemRespawnSystem__RemoveItemCleanup // Change Log: @@ -21689,61 +21659,61 @@ endfunction function MaxItemStacks_GetStackItemDummy takes nothing returns unit - return MaxItemStacks___stackItemDummy + return MaxItemStacks__stackItemDummy endfunction function GetMaxStacksByItemTypeIdFresh takes integer itemTypeId returns integer local integer i= 0 local item tmpItem= CreateItem(itemTypeId, 0.0, 0.0) - set MaxItemStacks___stackCounter=1 + set MaxItemStacks__stackCounter=1 call SetItemCharges(tmpItem, 1) - call UnitAddItem(MaxItemStacks___stackItemDummy, tmpItem) + call UnitAddItem(MaxItemStacks__stackItemDummy, tmpItem) set i=1 loop set tmpItem=CreateItem(itemTypeId, 0.0, 0.0) call SetItemCharges(tmpItem, 1) - call UnitAddItem(MaxItemStacks___stackItemDummy, tmpItem) - exitwhen ( MaxItemStacks___stackCounter <= i ) + call UnitAddItem(MaxItemStacks__stackItemDummy, tmpItem) + exitwhen ( MaxItemStacks__stackCounter <= i ) set i=i + 1 - exitwhen ( i >= MaxItemStacks___MAX_STACKS_ALLOWED ) + exitwhen ( i >= MaxItemStacks__MAX_STACKS_ALLOWED ) endloop - if ( UnitItemInSlot(MaxItemStacks___stackItemDummy, 0) != null ) then - call h__RemoveItem(UnitItemInSlot(MaxItemStacks___stackItemDummy, 0)) + if ( UnitItemInSlot(MaxItemStacks__stackItemDummy, 0) != null ) then + call h__RemoveItem(UnitItemInSlot(MaxItemStacks__stackItemDummy, 0)) endif - if ( UnitItemInSlot(MaxItemStacks___stackItemDummy, 1) != null ) then - call h__RemoveItem(UnitItemInSlot(MaxItemStacks___stackItemDummy, 1)) + if ( UnitItemInSlot(MaxItemStacks__stackItemDummy, 1) != null ) then + call h__RemoveItem(UnitItemInSlot(MaxItemStacks__stackItemDummy, 1)) endif - call SaveInteger(MaxItemStacks___stackHashTable, itemTypeId, 0, MaxItemStacks___stackCounter) - return MaxItemStacks___stackCounter + call SaveInteger(MaxItemStacks__stackHashTable, itemTypeId, 0, MaxItemStacks__stackCounter) + return MaxItemStacks__stackCounter endfunction function GetMaxStacksByItemTypeId takes integer itemTypeId returns integer - if ( HaveSavedInteger(MaxItemStacks___stackHashTable, itemTypeId, 0) ) then - return LoadInteger(MaxItemStacks___stackHashTable, itemTypeId, 0) + if ( HaveSavedInteger(MaxItemStacks__stackHashTable, itemTypeId, 0) ) then + return LoadInteger(MaxItemStacks__stackHashTable, itemTypeId, 0) endif return GetMaxStacksByItemTypeIdFresh(itemTypeId) endfunction -function MaxItemStacks___TriggerConditionStack takes nothing returns boolean - set MaxItemStacks___stackCounter=MaxItemStacks___stackCounter + 1 +function MaxItemStacks__TriggerConditionStack takes nothing returns boolean + set MaxItemStacks__stackCounter=MaxItemStacks__stackCounter + 1 return false endfunction -function MaxItemStacks___Init takes nothing returns nothing - set MaxItemStacks___stackItemDummy=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), MaxItemStacks___DUMMY_UNIT_TYPE_MAX_CHECKS, MaxItemStacks___DUMMY_X, MaxItemStacks___DUMMY_Y, 0.0) - call SetUnitInvulnerable(MaxItemStacks___stackItemDummy, true) - if ( IsUnitType(MaxItemStacks___stackItemDummy, UNIT_TYPE_HERO) ) then - call SuspendHeroXP(MaxItemStacks___stackItemDummy, true) +function MaxItemStacks__Init takes nothing returns nothing + set MaxItemStacks__stackItemDummy=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), MaxItemStacks__DUMMY_UNIT_TYPE_MAX_CHECKS, MaxItemStacks__DUMMY_X, MaxItemStacks__DUMMY_Y, 0.0) + call SetUnitInvulnerable(MaxItemStacks__stackItemDummy, true) + if ( IsUnitType(MaxItemStacks__stackItemDummy, UNIT_TYPE_HERO) ) then + call SuspendHeroXP(MaxItemStacks__stackItemDummy, true) endif - call SetUnitUseFood(MaxItemStacks___stackItemDummy, false) - call ShowUnit(MaxItemStacks___stackItemDummy, false) - call BlzSetUnitWeaponBooleanField(MaxItemStacks___stackItemDummy, UNIT_WEAPON_BF_ATTACKS_ENABLED, 0, false) - call BlzSetUnitWeaponBooleanField(MaxItemStacks___stackItemDummy, UNIT_WEAPON_BF_ATTACKS_ENABLED, 1, false) - call SetUnitPathing(MaxItemStacks___stackItemDummy, false) - call SetUnitMoveSpeed(MaxItemStacks___stackItemDummy, 0.0) - call TriggerRegisterUnitEvent(MaxItemStacks___stackItemTrigger, MaxItemStacks___stackItemDummy, EVENT_UNIT_STACK_ITEM) - call TriggerAddCondition(MaxItemStacks___stackItemTrigger, Condition(function MaxItemStacks___TriggerConditionStack)) + call SetUnitUseFood(MaxItemStacks__stackItemDummy, false) + call ShowUnit(MaxItemStacks__stackItemDummy, false) + call BlzSetUnitWeaponBooleanField(MaxItemStacks__stackItemDummy, UNIT_WEAPON_BF_ATTACKS_ENABLED, 0, false) + call BlzSetUnitWeaponBooleanField(MaxItemStacks__stackItemDummy, UNIT_WEAPON_BF_ATTACKS_ENABLED, 1, false) + call SetUnitPathing(MaxItemStacks__stackItemDummy, false) + call SetUnitMoveSpeed(MaxItemStacks__stackItemDummy, 0.0) + call TriggerRegisterUnitEvent(MaxItemStacks__stackItemTrigger, MaxItemStacks__stackItemDummy, EVENT_UNIT_STACK_ITEM) + call TriggerAddCondition(MaxItemStacks__stackItemTrigger, Condition(function MaxItemStacks__TriggerConditionStack)) endfunction // Change Log: @@ -21957,16 +21927,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)] @@ -22136,54 +22106,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 @@ -22254,28 +22224,28 @@ endfunction function RegisterPlayerUnitEvent takes playerunitevent p,code c returns nothing local integer i= GetHandleId(p) local integer k= 15 - if RegisterPlayerUnitEvent__t[i] == null then - set RegisterPlayerUnitEvent__t[i]=CreateTrigger() + if RegisterPlayerUnitEvent___t[i] == null then + set RegisterPlayerUnitEvent___t[i]=CreateTrigger() loop - call TriggerRegisterPlayerUnitEvent(RegisterPlayerUnitEvent__t[i], Player(k), p, null) + call TriggerRegisterPlayerUnitEvent(RegisterPlayerUnitEvent___t[i], Player(k), p, null) exitwhen k == 0 set k=k - 1 endloop endif - call TriggerAddCondition(RegisterPlayerUnitEvent__t[i], Filter(c)) + call TriggerAddCondition(RegisterPlayerUnitEvent___t[i], Filter(c)) endfunction function RegisterPlayerUnitEventForPlayer takes playerunitevent p,code c,player pl returns nothing local integer i= 16 * GetHandleId(p) + GetPlayerId(pl) - if RegisterPlayerUnitEvent__t[i] == null then - set RegisterPlayerUnitEvent__t[i]=CreateTrigger() - call TriggerRegisterPlayerUnitEvent(RegisterPlayerUnitEvent__t[i], pl, p, null) + if RegisterPlayerUnitEvent___t[i] == null then + set RegisterPlayerUnitEvent___t[i]=CreateTrigger() + call TriggerRegisterPlayerUnitEvent(RegisterPlayerUnitEvent___t[i], pl, p, null) endif - call TriggerAddCondition(RegisterPlayerUnitEvent__t[i], Filter(c)) + call TriggerAddCondition(RegisterPlayerUnitEvent___t[i], Filter(c)) endfunction function GetPlayerUnitEventTrigger takes playerunitevent p returns trigger - return RegisterPlayerUnitEvent__t[GetHandleId(p)] + return RegisterPlayerUnitEvent___t[GetHandleId(p)] endfunction //library RegisterPlayerUnitEvent ends @@ -22303,12 +22273,12 @@ endfunction if ( GetLocalPlayer() == ForPlayer ) then call ClearTextMessages() call h__DisplayTimedTextToPlayer(ForPlayer, 0.52, 0.96, 2.00, msg) - call StartSound(SimError__error) + call StartSound(SimError___error) endif endfunction - function SimError__init takes nothing returns nothing - set SimError__error=CreateSoundFromLabel("InterfaceError", false, false, false, 10, 10) + function SimError___init takes nothing returns nothing + set SimError___error=CreateSoundFromLabel("InterfaceError", false, false, false, 10, 10) //call StartSound( error ) //apparently the bug in which you play a sound for the first time //and it doesn't work is not there anymore in patch 1.22 endfunction @@ -22586,22 +22556,22 @@ endfunction //library Table: - function s__Table__dex__get_size takes nothing returns integer - return Table__sizeK + function s__Table___dex__get_size takes nothing returns integer + return Table___sizeK endfunction - function s__Table__dex__get_list takes nothing returns integer - return Table__listK + function s__Table___dex__get_list takes nothing returns integer + return Table___listK endfunction - function s__Table__handles_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___handles_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__handles_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___handles_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction - function s__Table__agents__setindex takes integer this,integer key,agent value returns nothing - call SaveAgentHandle(Table__ht, this, key, value) + function s__Table___agents__setindex takes integer this,integer key,agent value returns nothing + call SaveAgentHandle(Table___ht, this, key, value) endfunction @@ -22610,763 +22580,763 @@ endfunction //Don't be intimidated by the number of macros - Vexorian's map optimizer is //supposed to kill functions which inline (all of these functions inline). //textmacro instance: NEW_ARRAY_BASIC("Real", "Real", "real") - function s__Table__reals__getindex takes integer this,integer key returns real - return LoadReal(Table__ht, this, key) + function s__Table___reals__getindex takes integer this,integer key returns real + return LoadReal(Table___ht, this, key) endfunction - function s__Table__reals__setindex takes integer this,integer key,real value returns nothing - call SaveReal(Table__ht, this, key, value) + function s__Table___reals__setindex takes integer this,integer key,real value returns nothing + call SaveReal(Table___ht, this, key, value) endfunction - function s__Table__reals_has takes integer this,integer key returns boolean - return HaveSavedReal(Table__ht, this, key) + function s__Table___reals_has takes integer this,integer key returns boolean + return HaveSavedReal(Table___ht, this, key) endfunction - function s__Table__reals_remove takes integer this,integer key returns nothing - call RemoveSavedReal(Table__ht, this, key) + function s__Table___reals_remove takes integer this,integer key returns nothing + call RemoveSavedReal(Table___ht, this, key) endfunction //end of: NEW_ARRAY_BASIC("Real", "Real", "real") //textmacro instance: NEW_ARRAY_BASIC("Boolean", "Boolean", "boolean") - function s__Table__booleans__getindex takes integer this,integer key returns boolean - return LoadBoolean(Table__ht, this, key) + function s__Table___booleans__getindex takes integer this,integer key returns boolean + return LoadBoolean(Table___ht, this, key) endfunction - function s__Table__booleans__setindex takes integer this,integer key,boolean value returns nothing - call SaveBoolean(Table__ht, this, key, value) + function s__Table___booleans__setindex takes integer this,integer key,boolean value returns nothing + call SaveBoolean(Table___ht, this, key, value) endfunction - function s__Table__booleans_has takes integer this,integer key returns boolean - return HaveSavedBoolean(Table__ht, this, key) + function s__Table___booleans_has takes integer this,integer key returns boolean + return HaveSavedBoolean(Table___ht, this, key) endfunction - function s__Table__booleans_remove takes integer this,integer key returns nothing - call RemoveSavedBoolean(Table__ht, this, key) + function s__Table___booleans_remove takes integer this,integer key returns nothing + call RemoveSavedBoolean(Table___ht, this, key) endfunction //end of: NEW_ARRAY_BASIC("Boolean", "Boolean", "boolean") //textmacro instance: NEW_ARRAY_BASIC("String", "Str", "string") - function s__Table__strings__getindex takes integer this,integer key returns string - return LoadStr(Table__ht, this, key) + function s__Table___strings__getindex takes integer this,integer key returns string + return LoadStr(Table___ht, this, key) endfunction - function s__Table__strings__setindex takes integer this,integer key,string value returns nothing - call SaveStr(Table__ht, this, key, value) + function s__Table___strings__setindex takes integer this,integer key,string value returns nothing + call SaveStr(Table___ht, this, key, value) endfunction - function s__Table__strings_has takes integer this,integer key returns boolean - return HaveSavedString(Table__ht, this, key) + function s__Table___strings_has takes integer this,integer key returns boolean + return HaveSavedString(Table___ht, this, key) endfunction - function s__Table__strings_remove takes integer this,integer key returns nothing - call RemoveSavedString(Table__ht, this, key) + function s__Table___strings_remove takes integer this,integer key returns nothing + call RemoveSavedString(Table___ht, this, key) endfunction //end of: NEW_ARRAY_BASIC("String", "Str", "string") //New textmacro to allow table.integer[] syntax for compatibility with textmacros that might desire it. //textmacro instance: NEW_ARRAY_BASIC("Integer", "Integer", "integer") - function s__Table__integers__getindex takes integer this,integer key returns integer - return LoadInteger(Table__ht, this, key) + function s__Table___integers__getindex takes integer this,integer key returns integer + return LoadInteger(Table___ht, this, key) endfunction - function s__Table__integers__setindex takes integer this,integer key,integer value returns nothing - call SaveInteger(Table__ht, this, key, value) + function s__Table___integers__setindex takes integer this,integer key,integer value returns nothing + call SaveInteger(Table___ht, this, key, value) endfunction - function s__Table__integers_has takes integer this,integer key returns boolean - return HaveSavedInteger(Table__ht, this, key) + function s__Table___integers_has takes integer this,integer key returns boolean + return HaveSavedInteger(Table___ht, this, key) endfunction - function s__Table__integers_remove takes integer this,integer key returns nothing - call RemoveSavedInteger(Table__ht, this, key) + function s__Table___integers_remove takes integer this,integer key returns nothing + call RemoveSavedInteger(Table___ht, this, key) endfunction //end of: NEW_ARRAY_BASIC("Integer", "Integer", "integer") //textmacro instance: NEW_ARRAY("Player", "player") - function s__Table__players__getindex takes integer this,integer key returns player - return LoadPlayerHandle(Table__ht, this, key) + function s__Table___players__getindex takes integer this,integer key returns player + return LoadPlayerHandle(Table___ht, this, key) endfunction - function s__Table__players__setindex takes integer this,integer key,player value returns nothing - call SavePlayerHandle(Table__ht, this, key, value) + function s__Table___players__setindex takes integer this,integer key,player value returns nothing + call SavePlayerHandle(Table___ht, this, key, value) endfunction - function s__Table__players_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___players_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__players_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___players_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Player", "player") //textmacro instance: NEW_ARRAY("Widget", "widget") - function s__Table__widgets__getindex takes integer this,integer key returns widget - return LoadWidgetHandle(Table__ht, this, key) + function s__Table___widgets__getindex takes integer this,integer key returns widget + return LoadWidgetHandle(Table___ht, this, key) endfunction - function s__Table__widgets__setindex takes integer this,integer key,widget value returns nothing - call SaveWidgetHandle(Table__ht, this, key, value) + function s__Table___widgets__setindex takes integer this,integer key,widget value returns nothing + call SaveWidgetHandle(Table___ht, this, key, value) endfunction - function s__Table__widgets_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___widgets_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__widgets_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___widgets_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Widget", "widget") //textmacro instance: NEW_ARRAY("Destructable", "destructable") - function s__Table__destructables__getindex takes integer this,integer key returns destructable - return LoadDestructableHandle(Table__ht, this, key) + function s__Table___destructables__getindex takes integer this,integer key returns destructable + return LoadDestructableHandle(Table___ht, this, key) endfunction - function s__Table__destructables__setindex takes integer this,integer key,destructable value returns nothing - call SaveDestructableHandle(Table__ht, this, key, value) + function s__Table___destructables__setindex takes integer this,integer key,destructable value returns nothing + call SaveDestructableHandle(Table___ht, this, key, value) endfunction - function s__Table__destructables_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___destructables_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__destructables_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___destructables_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Destructable", "destructable") //textmacro instance: NEW_ARRAY("Item", "item") - function s__Table__items__getindex takes integer this,integer key returns item - return LoadItemHandle(Table__ht, this, key) + function s__Table___items__getindex takes integer this,integer key returns item + return LoadItemHandle(Table___ht, this, key) endfunction - function s__Table__items__setindex takes integer this,integer key,item value returns nothing - call SaveItemHandle(Table__ht, this, key, value) + function s__Table___items__setindex takes integer this,integer key,item value returns nothing + call SaveItemHandle(Table___ht, this, key, value) endfunction - function s__Table__items_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___items_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__items_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___items_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Item", "item") //textmacro instance: NEW_ARRAY("Unit", "unit") - function s__Table__units__getindex takes integer this,integer key returns unit - return LoadUnitHandle(Table__ht, this, key) + function s__Table___units__getindex takes integer this,integer key returns unit + return LoadUnitHandle(Table___ht, this, key) endfunction - function s__Table__units__setindex takes integer this,integer key,unit value returns nothing - call SaveUnitHandle(Table__ht, this, key, value) + function s__Table___units__setindex takes integer this,integer key,unit value returns nothing + call SaveUnitHandle(Table___ht, this, key, value) endfunction - function s__Table__units_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___units_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__units_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___units_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Unit", "unit") //textmacro instance: NEW_ARRAY("Ability", "ability") - function s__Table__abilitys__getindex takes integer this,integer key returns ability - return LoadAbilityHandle(Table__ht, this, key) + function s__Table___abilitys__getindex takes integer this,integer key returns ability + return LoadAbilityHandle(Table___ht, this, key) endfunction - function s__Table__abilitys__setindex takes integer this,integer key,ability value returns nothing - call SaveAbilityHandle(Table__ht, this, key, value) + function s__Table___abilitys__setindex takes integer this,integer key,ability value returns nothing + call SaveAbilityHandle(Table___ht, this, key, value) endfunction - function s__Table__abilitys_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___abilitys_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__abilitys_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___abilitys_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Ability", "ability") //textmacro instance: NEW_ARRAY("Timer", "timer") - function s__Table__timers__getindex takes integer this,integer key returns timer - return LoadTimerHandle(Table__ht, this, key) + function s__Table___timers__getindex takes integer this,integer key returns timer + return LoadTimerHandle(Table___ht, this, key) endfunction - function s__Table__timers__setindex takes integer this,integer key,timer value returns nothing - call SaveTimerHandle(Table__ht, this, key, value) + function s__Table___timers__setindex takes integer this,integer key,timer value returns nothing + call SaveTimerHandle(Table___ht, this, key, value) endfunction - function s__Table__timers_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___timers_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__timers_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___timers_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Timer", "timer") //textmacro instance: NEW_ARRAY("Trigger", "trigger") - function s__Table__triggers__getindex takes integer this,integer key returns trigger - return LoadTriggerHandle(Table__ht, this, key) + function s__Table___triggers__getindex takes integer this,integer key returns trigger + return LoadTriggerHandle(Table___ht, this, key) endfunction - function s__Table__triggers__setindex takes integer this,integer key,trigger value returns nothing - call SaveTriggerHandle(Table__ht, this, key, value) + function s__Table___triggers__setindex takes integer this,integer key,trigger value returns nothing + call SaveTriggerHandle(Table___ht, this, key, value) endfunction - function s__Table__triggers_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___triggers_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__triggers_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___triggers_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Trigger", "trigger") //textmacro instance: NEW_ARRAY("TriggerCondition", "triggercondition") - function s__Table__triggerconditions__getindex takes integer this,integer key returns triggercondition - return LoadTriggerConditionHandle(Table__ht, this, key) + function s__Table___triggerconditions__getindex takes integer this,integer key returns triggercondition + return LoadTriggerConditionHandle(Table___ht, this, key) endfunction - function s__Table__triggerconditions__setindex takes integer this,integer key,triggercondition value returns nothing - call SaveTriggerConditionHandle(Table__ht, this, key, value) + function s__Table___triggerconditions__setindex takes integer this,integer key,triggercondition value returns nothing + call SaveTriggerConditionHandle(Table___ht, this, key, value) endfunction - function s__Table__triggerconditions_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___triggerconditions_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__triggerconditions_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___triggerconditions_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("TriggerCondition", "triggercondition") //textmacro instance: NEW_ARRAY("TriggerAction", "triggeraction") - function s__Table__triggeractions__getindex takes integer this,integer key returns triggeraction - return LoadTriggerActionHandle(Table__ht, this, key) + function s__Table___triggeractions__getindex takes integer this,integer key returns triggeraction + return LoadTriggerActionHandle(Table___ht, this, key) endfunction - function s__Table__triggeractions__setindex takes integer this,integer key,triggeraction value returns nothing - call SaveTriggerActionHandle(Table__ht, this, key, value) + function s__Table___triggeractions__setindex takes integer this,integer key,triggeraction value returns nothing + call SaveTriggerActionHandle(Table___ht, this, key, value) endfunction - function s__Table__triggeractions_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___triggeractions_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__triggeractions_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___triggeractions_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("TriggerAction", "triggeraction") //textmacro instance: NEW_ARRAY("TriggerEvent", "event") - function s__Table__events__getindex takes integer this,integer key returns event - return LoadTriggerEventHandle(Table__ht, this, key) + function s__Table___events__getindex takes integer this,integer key returns event + return LoadTriggerEventHandle(Table___ht, this, key) endfunction - function s__Table__events__setindex takes integer this,integer key,event value returns nothing - call SaveTriggerEventHandle(Table__ht, this, key, value) + function s__Table___events__setindex takes integer this,integer key,event value returns nothing + call SaveTriggerEventHandle(Table___ht, this, key, value) endfunction - function s__Table__events_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___events_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__events_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___events_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("TriggerEvent", "event") //textmacro instance: NEW_ARRAY("Force", "force") - function s__Table__forces__getindex takes integer this,integer key returns force - return LoadForceHandle(Table__ht, this, key) + function s__Table___forces__getindex takes integer this,integer key returns force + return LoadForceHandle(Table___ht, this, key) endfunction - function s__Table__forces__setindex takes integer this,integer key,force value returns nothing - call SaveForceHandle(Table__ht, this, key, value) + function s__Table___forces__setindex takes integer this,integer key,force value returns nothing + call SaveForceHandle(Table___ht, this, key, value) endfunction - function s__Table__forces_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___forces_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__forces_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___forces_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Force", "force") //textmacro instance: NEW_ARRAY("Group", "group") - function s__Table__groups__getindex takes integer this,integer key returns group - return LoadGroupHandle(Table__ht, this, key) + function s__Table___groups__getindex takes integer this,integer key returns group + return LoadGroupHandle(Table___ht, this, key) endfunction - function s__Table__groups__setindex takes integer this,integer key,group value returns nothing - call SaveGroupHandle(Table__ht, this, key, value) + function s__Table___groups__setindex takes integer this,integer key,group value returns nothing + call SaveGroupHandle(Table___ht, this, key, value) endfunction - function s__Table__groups_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___groups_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__groups_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___groups_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Group", "group") //textmacro instance: NEW_ARRAY("Location", "location") - function s__Table__locations__getindex takes integer this,integer key returns location - return LoadLocationHandle(Table__ht, this, key) + function s__Table___locations__getindex takes integer this,integer key returns location + return LoadLocationHandle(Table___ht, this, key) endfunction - function s__Table__locations__setindex takes integer this,integer key,location value returns nothing - call SaveLocationHandle(Table__ht, this, key, value) + function s__Table___locations__setindex takes integer this,integer key,location value returns nothing + call SaveLocationHandle(Table___ht, this, key, value) endfunction - function s__Table__locations_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___locations_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__locations_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___locations_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Location", "location") //textmacro instance: NEW_ARRAY("Rect", "rect") - function s__Table__rects__getindex takes integer this,integer key returns rect - return LoadRectHandle(Table__ht, this, key) + function s__Table___rects__getindex takes integer this,integer key returns rect + return LoadRectHandle(Table___ht, this, key) endfunction - function s__Table__rects__setindex takes integer this,integer key,rect value returns nothing - call SaveRectHandle(Table__ht, this, key, value) + function s__Table___rects__setindex takes integer this,integer key,rect value returns nothing + call SaveRectHandle(Table___ht, this, key, value) endfunction - function s__Table__rects_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___rects_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__rects_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___rects_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Rect", "rect") //textmacro instance: NEW_ARRAY("BooleanExpr", "boolexpr") - function s__Table__boolexprs__getindex takes integer this,integer key returns boolexpr - return LoadBooleanExprHandle(Table__ht, this, key) + function s__Table___boolexprs__getindex takes integer this,integer key returns boolexpr + return LoadBooleanExprHandle(Table___ht, this, key) endfunction - function s__Table__boolexprs__setindex takes integer this,integer key,boolexpr value returns nothing - call SaveBooleanExprHandle(Table__ht, this, key, value) + function s__Table___boolexprs__setindex takes integer this,integer key,boolexpr value returns nothing + call SaveBooleanExprHandle(Table___ht, this, key, value) endfunction - function s__Table__boolexprs_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___boolexprs_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__boolexprs_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___boolexprs_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("BooleanExpr", "boolexpr") //textmacro instance: NEW_ARRAY("Sound", "sound") - function s__Table__sounds__getindex takes integer this,integer key returns sound - return LoadSoundHandle(Table__ht, this, key) + function s__Table___sounds__getindex takes integer this,integer key returns sound + return LoadSoundHandle(Table___ht, this, key) endfunction - function s__Table__sounds__setindex takes integer this,integer key,sound value returns nothing - call SaveSoundHandle(Table__ht, this, key, value) + function s__Table___sounds__setindex takes integer this,integer key,sound value returns nothing + call SaveSoundHandle(Table___ht, this, key, value) endfunction - function s__Table__sounds_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___sounds_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__sounds_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___sounds_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Sound", "sound") //textmacro instance: NEW_ARRAY("Effect", "effect") - function s__Table__effects__getindex takes integer this,integer key returns effect - return LoadEffectHandle(Table__ht, this, key) + function s__Table___effects__getindex takes integer this,integer key returns effect + return LoadEffectHandle(Table___ht, this, key) endfunction - function s__Table__effects__setindex takes integer this,integer key,effect value returns nothing - call SaveEffectHandle(Table__ht, this, key, value) + function s__Table___effects__setindex takes integer this,integer key,effect value returns nothing + call SaveEffectHandle(Table___ht, this, key, value) endfunction - function s__Table__effects_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___effects_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__effects_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___effects_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Effect", "effect") //textmacro instance: NEW_ARRAY("UnitPool", "unitpool") - function s__Table__unitpools__getindex takes integer this,integer key returns unitpool - return LoadUnitPoolHandle(Table__ht, this, key) + function s__Table___unitpools__getindex takes integer this,integer key returns unitpool + return LoadUnitPoolHandle(Table___ht, this, key) endfunction - function s__Table__unitpools__setindex takes integer this,integer key,unitpool value returns nothing - call SaveUnitPoolHandle(Table__ht, this, key, value) + function s__Table___unitpools__setindex takes integer this,integer key,unitpool value returns nothing + call SaveUnitPoolHandle(Table___ht, this, key, value) endfunction - function s__Table__unitpools_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___unitpools_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__unitpools_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___unitpools_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("UnitPool", "unitpool") //textmacro instance: NEW_ARRAY("ItemPool", "itempool") - function s__Table__itempools__getindex takes integer this,integer key returns itempool - return LoadItemPoolHandle(Table__ht, this, key) + function s__Table___itempools__getindex takes integer this,integer key returns itempool + return LoadItemPoolHandle(Table___ht, this, key) endfunction - function s__Table__itempools__setindex takes integer this,integer key,itempool value returns nothing - call SaveItemPoolHandle(Table__ht, this, key, value) + function s__Table___itempools__setindex takes integer this,integer key,itempool value returns nothing + call SaveItemPoolHandle(Table___ht, this, key, value) endfunction - function s__Table__itempools_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___itempools_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__itempools_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___itempools_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("ItemPool", "itempool") //textmacro instance: NEW_ARRAY("Quest", "quest") - function s__Table__quests__getindex takes integer this,integer key returns quest - return LoadQuestHandle(Table__ht, this, key) + function s__Table___quests__getindex takes integer this,integer key returns quest + return LoadQuestHandle(Table___ht, this, key) endfunction - function s__Table__quests__setindex takes integer this,integer key,quest value returns nothing - call SaveQuestHandle(Table__ht, this, key, value) + function s__Table___quests__setindex takes integer this,integer key,quest value returns nothing + call SaveQuestHandle(Table___ht, this, key, value) endfunction - function s__Table__quests_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___quests_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__quests_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___quests_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Quest", "quest") //textmacro instance: NEW_ARRAY("QuestItem", "questitem") - function s__Table__questitems__getindex takes integer this,integer key returns questitem - return LoadQuestItemHandle(Table__ht, this, key) + function s__Table___questitems__getindex takes integer this,integer key returns questitem + return LoadQuestItemHandle(Table___ht, this, key) endfunction - function s__Table__questitems__setindex takes integer this,integer key,questitem value returns nothing - call SaveQuestItemHandle(Table__ht, this, key, value) + function s__Table___questitems__setindex takes integer this,integer key,questitem value returns nothing + call SaveQuestItemHandle(Table___ht, this, key, value) endfunction - function s__Table__questitems_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___questitems_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__questitems_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___questitems_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("QuestItem", "questitem") //textmacro instance: NEW_ARRAY("DefeatCondition", "defeatcondition") - function s__Table__defeatconditions__getindex takes integer this,integer key returns defeatcondition - return LoadDefeatConditionHandle(Table__ht, this, key) + function s__Table___defeatconditions__getindex takes integer this,integer key returns defeatcondition + return LoadDefeatConditionHandle(Table___ht, this, key) endfunction - function s__Table__defeatconditions__setindex takes integer this,integer key,defeatcondition value returns nothing - call SaveDefeatConditionHandle(Table__ht, this, key, value) + function s__Table___defeatconditions__setindex takes integer this,integer key,defeatcondition value returns nothing + call SaveDefeatConditionHandle(Table___ht, this, key, value) endfunction - function s__Table__defeatconditions_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___defeatconditions_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__defeatconditions_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___defeatconditions_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("DefeatCondition", "defeatcondition") //textmacro instance: NEW_ARRAY("TimerDialog", "timerdialog") - function s__Table__timerdialogs__getindex takes integer this,integer key returns timerdialog - return LoadTimerDialogHandle(Table__ht, this, key) + function s__Table___timerdialogs__getindex takes integer this,integer key returns timerdialog + return LoadTimerDialogHandle(Table___ht, this, key) endfunction - function s__Table__timerdialogs__setindex takes integer this,integer key,timerdialog value returns nothing - call SaveTimerDialogHandle(Table__ht, this, key, value) + function s__Table___timerdialogs__setindex takes integer this,integer key,timerdialog value returns nothing + call SaveTimerDialogHandle(Table___ht, this, key, value) endfunction - function s__Table__timerdialogs_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___timerdialogs_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__timerdialogs_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___timerdialogs_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("TimerDialog", "timerdialog") //textmacro instance: NEW_ARRAY("Leaderboard", "leaderboard") - function s__Table__leaderboards__getindex takes integer this,integer key returns leaderboard - return LoadLeaderboardHandle(Table__ht, this, key) + function s__Table___leaderboards__getindex takes integer this,integer key returns leaderboard + return LoadLeaderboardHandle(Table___ht, this, key) endfunction - function s__Table__leaderboards__setindex takes integer this,integer key,leaderboard value returns nothing - call SaveLeaderboardHandle(Table__ht, this, key, value) + function s__Table___leaderboards__setindex takes integer this,integer key,leaderboard value returns nothing + call SaveLeaderboardHandle(Table___ht, this, key, value) endfunction - function s__Table__leaderboards_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___leaderboards_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__leaderboards_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___leaderboards_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Leaderboard", "leaderboard") //textmacro instance: NEW_ARRAY("Multiboard", "multiboard") - function s__Table__multiboards__getindex takes integer this,integer key returns multiboard - return LoadMultiboardHandle(Table__ht, this, key) + function s__Table___multiboards__getindex takes integer this,integer key returns multiboard + return LoadMultiboardHandle(Table___ht, this, key) endfunction - function s__Table__multiboards__setindex takes integer this,integer key,multiboard value returns nothing - call SaveMultiboardHandle(Table__ht, this, key, value) + function s__Table___multiboards__setindex takes integer this,integer key,multiboard value returns nothing + call SaveMultiboardHandle(Table___ht, this, key, value) endfunction - function s__Table__multiboards_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___multiboards_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__multiboards_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___multiboards_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Multiboard", "multiboard") //textmacro instance: NEW_ARRAY("MultiboardItem", "multiboarditem") - function s__Table__multiboarditems__getindex takes integer this,integer key returns multiboarditem - return LoadMultiboardItemHandle(Table__ht, this, key) + function s__Table___multiboarditems__getindex takes integer this,integer key returns multiboarditem + return LoadMultiboardItemHandle(Table___ht, this, key) endfunction - function s__Table__multiboarditems__setindex takes integer this,integer key,multiboarditem value returns nothing - call SaveMultiboardItemHandle(Table__ht, this, key, value) + function s__Table___multiboarditems__setindex takes integer this,integer key,multiboarditem value returns nothing + call SaveMultiboardItemHandle(Table___ht, this, key, value) endfunction - function s__Table__multiboarditems_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___multiboarditems_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__multiboarditems_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___multiboarditems_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("MultiboardItem", "multiboarditem") //textmacro instance: NEW_ARRAY("Trackable", "trackable") - function s__Table__trackables__getindex takes integer this,integer key returns trackable - return LoadTrackableHandle(Table__ht, this, key) + function s__Table___trackables__getindex takes integer this,integer key returns trackable + return LoadTrackableHandle(Table___ht, this, key) endfunction - function s__Table__trackables__setindex takes integer this,integer key,trackable value returns nothing - call SaveTrackableHandle(Table__ht, this, key, value) + function s__Table___trackables__setindex takes integer this,integer key,trackable value returns nothing + call SaveTrackableHandle(Table___ht, this, key, value) endfunction - function s__Table__trackables_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___trackables_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__trackables_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___trackables_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Trackable", "trackable") //textmacro instance: NEW_ARRAY("Dialog", "dialog") - function s__Table__dialogs__getindex takes integer this,integer key returns dialog - return LoadDialogHandle(Table__ht, this, key) + function s__Table___dialogs__getindex takes integer this,integer key returns dialog + return LoadDialogHandle(Table___ht, this, key) endfunction - function s__Table__dialogs__setindex takes integer this,integer key,dialog value returns nothing - call SaveDialogHandle(Table__ht, this, key, value) + function s__Table___dialogs__setindex takes integer this,integer key,dialog value returns nothing + call SaveDialogHandle(Table___ht, this, key, value) endfunction - function s__Table__dialogs_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___dialogs_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__dialogs_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___dialogs_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Dialog", "dialog") //textmacro instance: NEW_ARRAY("Button", "button") - function s__Table__buttons__getindex takes integer this,integer key returns button - return LoadButtonHandle(Table__ht, this, key) + function s__Table___buttons__getindex takes integer this,integer key returns button + return LoadButtonHandle(Table___ht, this, key) endfunction - function s__Table__buttons__setindex takes integer this,integer key,button value returns nothing - call SaveButtonHandle(Table__ht, this, key, value) + function s__Table___buttons__setindex takes integer this,integer key,button value returns nothing + call SaveButtonHandle(Table___ht, this, key, value) endfunction - function s__Table__buttons_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___buttons_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__buttons_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___buttons_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Button", "button") //textmacro instance: NEW_ARRAY("TextTag", "texttag") - function s__Table__texttags__getindex takes integer this,integer key returns texttag - return LoadTextTagHandle(Table__ht, this, key) + function s__Table___texttags__getindex takes integer this,integer key returns texttag + return LoadTextTagHandle(Table___ht, this, key) endfunction - function s__Table__texttags__setindex takes integer this,integer key,texttag value returns nothing - call SaveTextTagHandle(Table__ht, this, key, value) + function s__Table___texttags__setindex takes integer this,integer key,texttag value returns nothing + call SaveTextTagHandle(Table___ht, this, key, value) endfunction - function s__Table__texttags_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___texttags_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__texttags_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___texttags_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("TextTag", "texttag") //textmacro instance: NEW_ARRAY("Lightning", "lightning") - function s__Table__lightnings__getindex takes integer this,integer key returns lightning - return LoadLightningHandle(Table__ht, this, key) + function s__Table___lightnings__getindex takes integer this,integer key returns lightning + return LoadLightningHandle(Table___ht, this, key) endfunction - function s__Table__lightnings__setindex takes integer this,integer key,lightning value returns nothing - call SaveLightningHandle(Table__ht, this, key, value) + function s__Table___lightnings__setindex takes integer this,integer key,lightning value returns nothing + call SaveLightningHandle(Table___ht, this, key, value) endfunction - function s__Table__lightnings_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___lightnings_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__lightnings_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___lightnings_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Lightning", "lightning") //textmacro instance: NEW_ARRAY("Image", "image") - function s__Table__images__getindex takes integer this,integer key returns image - return LoadImageHandle(Table__ht, this, key) + function s__Table___images__getindex takes integer this,integer key returns image + return LoadImageHandle(Table___ht, this, key) endfunction - function s__Table__images__setindex takes integer this,integer key,image value returns nothing - call SaveImageHandle(Table__ht, this, key, value) + function s__Table___images__setindex takes integer this,integer key,image value returns nothing + call SaveImageHandle(Table___ht, this, key, value) endfunction - function s__Table__images_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___images_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__images_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___images_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Image", "image") //textmacro instance: NEW_ARRAY("Ubersplat", "ubersplat") - function s__Table__ubersplats__getindex takes integer this,integer key returns ubersplat - return LoadUbersplatHandle(Table__ht, this, key) + function s__Table___ubersplats__getindex takes integer this,integer key returns ubersplat + return LoadUbersplatHandle(Table___ht, this, key) endfunction - function s__Table__ubersplats__setindex takes integer this,integer key,ubersplat value returns nothing - call SaveUbersplatHandle(Table__ht, this, key, value) + function s__Table___ubersplats__setindex takes integer this,integer key,ubersplat value returns nothing + call SaveUbersplatHandle(Table___ht, this, key, value) endfunction - function s__Table__ubersplats_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___ubersplats_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__ubersplats_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___ubersplats_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Ubersplat", "ubersplat") //textmacro instance: NEW_ARRAY("Region", "region") - function s__Table__regions__getindex takes integer this,integer key returns region - return LoadRegionHandle(Table__ht, this, key) + function s__Table___regions__getindex takes integer this,integer key returns region + return LoadRegionHandle(Table___ht, this, key) endfunction - function s__Table__regions__setindex takes integer this,integer key,region value returns nothing - call SaveRegionHandle(Table__ht, this, key, value) + function s__Table___regions__setindex takes integer this,integer key,region value returns nothing + call SaveRegionHandle(Table___ht, this, key, value) endfunction - function s__Table__regions_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___regions_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__regions_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___regions_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Region", "region") //textmacro instance: NEW_ARRAY("FogState", "fogstate") - function s__Table__fogstates__getindex takes integer this,integer key returns fogstate - return LoadFogStateHandle(Table__ht, this, key) + function s__Table___fogstates__getindex takes integer this,integer key returns fogstate + return LoadFogStateHandle(Table___ht, this, key) endfunction - function s__Table__fogstates__setindex takes integer this,integer key,fogstate value returns nothing - call SaveFogStateHandle(Table__ht, this, key, value) + function s__Table___fogstates__setindex takes integer this,integer key,fogstate value returns nothing + call SaveFogStateHandle(Table___ht, this, key, value) endfunction - function s__Table__fogstates_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___fogstates_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__fogstates_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___fogstates_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("FogState", "fogstate") //textmacro instance: NEW_ARRAY("FogModifier", "fogmodifier") - function s__Table__fogmodifiers__getindex takes integer this,integer key returns fogmodifier - return LoadFogModifierHandle(Table__ht, this, key) + function s__Table___fogmodifiers__getindex takes integer this,integer key returns fogmodifier + return LoadFogModifierHandle(Table___ht, this, key) endfunction - function s__Table__fogmodifiers__setindex takes integer this,integer key,fogmodifier value returns nothing - call SaveFogModifierHandle(Table__ht, this, key, value) + function s__Table___fogmodifiers__setindex takes integer this,integer key,fogmodifier value returns nothing + call SaveFogModifierHandle(Table___ht, this, key, value) endfunction - function s__Table__fogmodifiers_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___fogmodifiers_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__fogmodifiers_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___fogmodifiers_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("FogModifier", "fogmodifier") //textmacro instance: NEW_ARRAY("Hashtable", "hashtable") - function s__Table__hashtables__getindex takes integer this,integer key returns hashtable - return LoadHashtableHandle(Table__ht, this, key) + function s__Table___hashtables__getindex takes integer this,integer key returns hashtable + return LoadHashtableHandle(Table___ht, this, key) endfunction - function s__Table__hashtables__setindex takes integer this,integer key,hashtable value returns nothing - call SaveHashtableHandle(Table__ht, this, key, value) + function s__Table___hashtables__setindex takes integer this,integer key,hashtable value returns nothing + call SaveHashtableHandle(Table___ht, this, key, value) endfunction - function s__Table__hashtables_has takes integer this,integer key returns boolean - return HaveSavedHandle(Table__ht, this, key) + function s__Table___hashtables_has takes integer this,integer key returns boolean + return HaveSavedHandle(Table___ht, this, key) endfunction - function s__Table__hashtables_remove takes integer this,integer key returns nothing - call RemoveSavedHandle(Table__ht, this, key) + function s__Table___hashtables_remove takes integer this,integer key returns nothing + call RemoveSavedHandle(Table___ht, this, key) endfunction //end of: NEW_ARRAY("Hashtable", "hashtable") // Implement modules for intuitive syntax (tb.handle; tb.unit; etc.) -//Implemented from module Table__realm: +//Implemented from module Table___realm: function s__Table__get_real takes integer this returns integer return this endfunction -//Implemented from module Table__integerm: +//Implemented from module Table___integerm: function s__Table__get_integer takes integer this returns integer return this endfunction -//Implemented from module Table__booleanm: +//Implemented from module Table___booleanm: function s__Table__get_boolean takes integer this returns integer return this endfunction -//Implemented from module Table__stringm: +//Implemented from module Table___stringm: function s__Table__get_string takes integer this returns integer return this endfunction -//Implemented from module Table__playerm: +//Implemented from module Table___playerm: function s__Table__get_player takes integer this returns integer return this endfunction -//Implemented from module Table__widgetm: +//Implemented from module Table___widgetm: function s__Table__get_widget takes integer this returns integer return this endfunction -//Implemented from module Table__destructablem: +//Implemented from module Table___destructablem: function s__Table__get_destructable takes integer this returns integer return this endfunction -//Implemented from module Table__itemm: +//Implemented from module Table___itemm: function s__Table__get_item takes integer this returns integer return this endfunction -//Implemented from module Table__unitm: +//Implemented from module Table___unitm: function s__Table__get_unit takes integer this returns integer return this endfunction -//Implemented from module Table__abilitym: +//Implemented from module Table___abilitym: function s__Table__get_ability takes integer this returns integer return this endfunction -//Implemented from module Table__timerm: +//Implemented from module Table___timerm: function s__Table__get_timer takes integer this returns integer return this endfunction -//Implemented from module Table__triggerm: +//Implemented from module Table___triggerm: function s__Table__get_trigger takes integer this returns integer return this endfunction -//Implemented from module Table__triggerconditionm: +//Implemented from module Table___triggerconditionm: function s__Table__get_triggercondition takes integer this returns integer return this endfunction -//Implemented from module Table__triggeractionm: +//Implemented from module Table___triggeractionm: function s__Table__get_triggeraction takes integer this returns integer return this endfunction -//Implemented from module Table__eventm: +//Implemented from module Table___eventm: function s__Table__get_event takes integer this returns integer return this endfunction -//Implemented from module Table__forcem: +//Implemented from module Table___forcem: function s__Table__get_force takes integer this returns integer return this endfunction -//Implemented from module Table__groupm: +//Implemented from module Table___groupm: function s__Table__get_group takes integer this returns integer return this endfunction -//Implemented from module Table__locationm: +//Implemented from module Table___locationm: function s__Table__get_location takes integer this returns integer return this endfunction -//Implemented from module Table__rectm: +//Implemented from module Table___rectm: function s__Table__get_rect takes integer this returns integer return this endfunction -//Implemented from module Table__boolexprm: +//Implemented from module Table___boolexprm: function s__Table__get_boolexpr takes integer this returns integer return this endfunction -//Implemented from module Table__soundm: +//Implemented from module Table___soundm: function s__Table__get_sound takes integer this returns integer return this endfunction -//Implemented from module Table__effectm: +//Implemented from module Table___effectm: function s__Table__get_effect takes integer this returns integer return this endfunction -//Implemented from module Table__unitpoolm: +//Implemented from module Table___unitpoolm: function s__Table__get_unitpool takes integer this returns integer return this endfunction -//Implemented from module Table__itempoolm: +//Implemented from module Table___itempoolm: function s__Table__get_itempool takes integer this returns integer return this endfunction -//Implemented from module Table__questm: +//Implemented from module Table___questm: function s__Table__get_quest takes integer this returns integer return this endfunction -//Implemented from module Table__questitemm: +//Implemented from module Table___questitemm: function s__Table__get_questitem takes integer this returns integer return this endfunction -//Implemented from module Table__defeatconditionm: +//Implemented from module Table___defeatconditionm: function s__Table__get_defeatcondition takes integer this returns integer return this endfunction -//Implemented from module Table__timerdialogm: +//Implemented from module Table___timerdialogm: function s__Table__get_timerdialog takes integer this returns integer return this endfunction -//Implemented from module Table__leaderboardm: +//Implemented from module Table___leaderboardm: function s__Table__get_leaderboard takes integer this returns integer return this endfunction -//Implemented from module Table__multiboardm: +//Implemented from module Table___multiboardm: function s__Table__get_multiboard takes integer this returns integer return this endfunction -//Implemented from module Table__multiboarditemm: +//Implemented from module Table___multiboarditemm: function s__Table__get_multiboarditem takes integer this returns integer return this endfunction -//Implemented from module Table__trackablem: +//Implemented from module Table___trackablem: function s__Table__get_trackable takes integer this returns integer return this endfunction -//Implemented from module Table__dialogm: +//Implemented from module Table___dialogm: function s__Table__get_dialog takes integer this returns integer return this endfunction -//Implemented from module Table__buttonm: +//Implemented from module Table___buttonm: function s__Table__get_button takes integer this returns integer return this endfunction -//Implemented from module Table__texttagm: +//Implemented from module Table___texttagm: function s__Table__get_texttag takes integer this returns integer return this endfunction -//Implemented from module Table__lightningm: +//Implemented from module Table___lightningm: function s__Table__get_lightning takes integer this returns integer return this endfunction -//Implemented from module Table__imagem: +//Implemented from module Table___imagem: function s__Table__get_image takes integer this returns integer return this endfunction -//Implemented from module Table__ubersplatm: +//Implemented from module Table___ubersplatm: function s__Table__get_ubersplat takes integer this returns integer return this endfunction -//Implemented from module Table__regionm: +//Implemented from module Table___regionm: function s__Table__get_region takes integer this returns integer return this endfunction -//Implemented from module Table__fogstatem: +//Implemented from module Table___fogstatem: function s__Table__get_fogstate takes integer this returns integer return this endfunction -//Implemented from module Table__fogmodifierm: +//Implemented from module Table___fogmodifierm: function s__Table__get_fogmodifier takes integer this returns integer return this endfunction -//Implemented from module Table__hashtablem: +//Implemented from module Table___hashtablem: function s__Table__get_hashtable takes integer this returns integer return this endfunction @@ -23381,39 +23351,39 @@ endfunction //set this = tb[GetSpellAbilityId()] function s__Table__getindex takes integer this,integer key returns integer - return LoadInteger(Table__ht, this, key) //return this.integer[key] + return LoadInteger(Table___ht, this, key) //return this.integer[key] endfunction //set tb[389034] = 8192 function s__Table__setindex takes integer this,integer key,integer tb returns nothing - call SaveInteger(Table__ht, this, key, tb) //set this.integer[key] = tb + call SaveInteger(Table___ht, this, key, tb) //set this.integer[key] = tb endfunction //set b = tb.has(2493223) function s__Table_has takes integer this,integer key returns boolean - return HaveSavedInteger(Table__ht, this, key) //return this.integer.has(key) + return HaveSavedInteger(Table___ht, this, key) //return this.integer.has(key) endfunction //call tb.remove(294080) function s__Table_remove takes integer this,integer key returns nothing - call RemoveSavedInteger(Table__ht, this, key) //call this.integer.remove(key) + call RemoveSavedInteger(Table___ht, this, key) //call this.integer.remove(key) endfunction //Remove all data from a Table instance function s__Table_flush takes integer this returns nothing - call FlushChildHashtable(Table__ht, this) + call FlushChildHashtable(Table___ht, this) endfunction //local Table tb = Table.create() function s__Table_create takes nothing returns integer - local integer this= (LoadInteger(Table__ht, ((Table__listK)), (0))) // INLINED!! + local integer this= (LoadInteger(Table___ht, ((Table___listK)), (0))) // INLINED!! if this == 0 then - set this=Table__more + 1 - set Table__more=this + set this=Table___more + 1 + set Table___more=this else - call SaveInteger(Table__ht, ((Table__listK)), (0), ( (LoadInteger(Table__ht, ((Table__listK)), (this))))) // INLINED!! - call RemoveSavedInteger(Table__ht, ((Table__listK)), (this)) //Clear hashed memory // INLINED!! + call SaveInteger(Table___ht, ((Table___listK)), (0), ( (LoadInteger(Table___ht, ((Table___listK)), (this))))) // INLINED!! + call RemoveSavedInteger(Table___ht, ((Table___listK)), (this)) //Clear hashed memory // INLINED!! endif return this @@ -23424,10 +23394,10 @@ endfunction // call tb.destroy() // function s__Table_destroy takes integer this returns nothing - call FlushChildHashtable(Table__ht, (this)) // INLINED!! + call FlushChildHashtable(Table___ht, (this)) // INLINED!! - call SaveInteger(Table__ht, ((Table__listK)), (this), ( (LoadInteger(Table__ht, ((Table__listK)), (0))))) // INLINED!! - call SaveInteger(Table__ht, ((Table__listK)), (0), ( this)) // INLINED!! + call SaveInteger(Table___ht, ((Table___listK)), (this), ( (LoadInteger(Table___ht, ((Table___listK)), (0))))) // INLINED!! + call SaveInteger(Table___ht, ((Table___listK)), (0), ( this)) // INLINED!! endfunction //ignored textmacro command: TABLE_BC_METHODS() @@ -23440,25 +23410,25 @@ endfunction // local TableArray ta = TableArray[array_size] // function s__TableArray__staticgetindex takes integer array_size returns integer - local integer tb= (LoadInteger(Table__ht, ((Table__sizeK)), (array_size))) // INLINED!! - local integer this= (LoadInteger(Table__ht, (tb), (0))) // INLINED!! + local integer tb= (LoadInteger(Table___ht, ((Table___sizeK)), (array_size))) // INLINED!! + local integer this= (LoadInteger(Table___ht, (tb), (0))) // INLINED!! if this == 0 then - set this=Table__less - array_size - set Table__less=this + set this=Table___less - array_size + set Table___less=this else - call SaveInteger(Table__ht, (tb), (0), ( (LoadInteger(Table__ht, (tb), (this))))) //Set the last destroyed to the last-last destroyed // INLINED!! - call RemoveSavedInteger(Table__ht, (tb), (this)) //Clear hashed memory // INLINED!! + call SaveInteger(Table___ht, (tb), (0), ( (LoadInteger(Table___ht, (tb), (this))))) //Set the last destroyed to the last-last destroyed // INLINED!! + call RemoveSavedInteger(Table___ht, (tb), (this)) //Clear hashed memory // INLINED!! endif - call SaveInteger(Table__ht, ((Table__sizeK)), (this), ( array_size)) //This remembers the array size // INLINED!! + call SaveInteger(Table___ht, ((Table___sizeK)), (this), ( array_size)) //This remembers the array size // INLINED!! return this endfunction //Returns the size of the TableArray function s__TableArray__get_size takes integer this returns integer - return (LoadInteger(Table__ht, ((Table__sizeK)), (this))) // INLINED!! + return (LoadInteger(Table___ht, ((Table___sizeK)), (this))) // INLINED!! endfunction //This magic method enables two-dimensional[array][syntax] for Tables, @@ -23490,19 +23460,19 @@ endfunction //need to (ie. if you were flushing all child-keys as you used them). // function s__TableArray_destroy takes integer this returns nothing - local integer tb= (LoadInteger(Table__ht, ((Table__sizeK)), ((LoadInteger(Table__ht, ((Table__sizeK)), ((this))))))) // INLINED!! + local integer tb= (LoadInteger(Table___ht, ((Table___sizeK)), ((LoadInteger(Table___ht, ((Table___sizeK)), ((this))))))) // INLINED!! if tb == 0 then //Create a Table to index recycled instances with their array size set tb=s__Table_create() - call SaveInteger(Table__ht, ((Table__sizeK)), ((LoadInteger(Table__ht, ((Table__sizeK)), ((this))))), ( tb)) // INLINED!! + call SaveInteger(Table___ht, ((Table___sizeK)), ((LoadInteger(Table___ht, ((Table___sizeK)), ((this))))), ( tb)) // INLINED!! endif - call RemoveSavedInteger(Table__ht, ((Table__sizeK)), (this)) //Clear the array size from hash memory // INLINED!! + call RemoveSavedInteger(Table___ht, ((Table___sizeK)), (this)) //Clear the array size from hash memory // INLINED!! - call SaveInteger(Table__ht, (tb), (this), ( (LoadInteger(Table__ht, (tb), (0))))) // INLINED!! - call SaveInteger(Table__ht, (tb), (0), ( this)) // INLINED!! + call SaveInteger(Table___ht, (tb), (this), ( (LoadInteger(Table___ht, (tb), (0))))) // INLINED!! + call SaveInteger(Table___ht, (tb), (0), ( this)) // INLINED!! endfunction @@ -23517,7 +23487,7 @@ endfunction set end=s__TableArray_tempEnd endif loop - call FlushChildHashtable(Table__ht, (tb)) // INLINED!! + call FlushChildHashtable(Table___ht, (tb)) // INLINED!! set tb=tb + 1 exitwhen tb == end endloop @@ -23528,7 +23498,7 @@ endfunction // function s__TableArray_flush takes integer this returns nothing set s__TableArray_tempTable=this - set s__TableArray_tempEnd=this + (LoadInteger(Table__ht, ((Table__sizeK)), ((this)))) // INLINED!! + set s__TableArray_tempEnd=this + (LoadInteger(Table___ht, ((Table___sizeK)), ((this)))) // INLINED!! call ForForce(bj_FORCE_PLAYER[0], function s__TableArray_clean) call s__TableArray_destroy(this) endfunction @@ -23541,10 +23511,10 @@ endfunction //Basically, it creates a Table in the place of the parent key if //it didn't already get created earlier. function s__HashTable__getindex takes integer this,integer index returns integer - local integer t= (LoadInteger(Table__ht, ((this)), (index))) // INLINED!! + local integer t= (LoadInteger(Table___ht, ((this)), (index))) // INLINED!! if t == 0 then set t=s__Table_create() - call SaveInteger(Table__ht, ((this)), (index), ( t)) //whoops! Forgot that line. I'm out of practice! // INLINED!! + call SaveInteger(Table___ht, ((this)), (index), ( t)) //whoops! Forgot that line. I'm out of practice! // INLINED!! endif return t endfunction @@ -23552,16 +23522,16 @@ endfunction //You need to call this on each parent key that you used if you //intend to destroy the HashTable or simply no longer need that key. function s__HashTable_remove takes integer this,integer index returns nothing - local integer t= (LoadInteger(Table__ht, ((this)), (index))) // INLINED!! + local integer t= (LoadInteger(Table___ht, ((this)), (index))) // INLINED!! if t != 0 then call s__Table_destroy(t) - call RemoveSavedInteger(Table__ht, ((this)), (index)) // INLINED!! + call RemoveSavedInteger(Table___ht, ((this)), (index)) // INLINED!! endif endfunction //Added in version 4.1 function s__HashTable_has takes integer this,integer index returns boolean - return (HaveSavedInteger(Table__ht, ((this)), (index))) // INLINED!! + return (HaveSavedInteger(Table___ht, ((this)), (index))) // INLINED!! endfunction //HashTables are just fancy Table indices. @@ -23631,42 +23601,42 @@ function IsTerrainPlatform takes real x,real y returns boolean return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_BUILDABILITY) endfunction -function TerrainPathability__HideItem takes nothing returns nothing +function TerrainPathability___HideItem takes nothing returns nothing if IsItemVisible(GetEnumItem()) then - set TerrainPathability__Hid[TerrainPathability__HidMax]=GetEnumItem() - call SetItemVisible(TerrainPathability__Hid[TerrainPathability__HidMax], false) - set TerrainPathability__HidMax=TerrainPathability__HidMax + 1 + set TerrainPathability___Hid[TerrainPathability___HidMax]=GetEnumItem() + call SetItemVisible(TerrainPathability___Hid[TerrainPathability___HidMax], false) + set TerrainPathability___HidMax=TerrainPathability___HidMax + 1 endif endfunction function IsTerrainWalkable takes real x,real y returns boolean //Hide any items in the area to avoid conflicts with our item - call MoveRectTo(TerrainPathability__Find, x, y) - call EnumItemsInRect(TerrainPathability__Find, null, function TerrainPathability__HideItem) + call MoveRectTo(TerrainPathability___Find, x, y) + call EnumItemsInRect(TerrainPathability___Find, null, function TerrainPathability___HideItem) //Try to move the test item and get its coords - call SetItemPosition(TerrainPathability__Item, x, y) //Unhides the item - set TerrainPathability_X=GetItemX(TerrainPathability__Item) - set TerrainPathability_Y=GetItemY(TerrainPathability__Item) + call SetItemPosition(TerrainPathability___Item, x, y) //Unhides the item + set TerrainPathability_X=GetItemX(TerrainPathability___Item) + set TerrainPathability_Y=GetItemY(TerrainPathability___Item) - call SetItemVisible(TerrainPathability__Item, false) //Hide it again + call SetItemVisible(TerrainPathability___Item, false) //Hide it again //Unhide any items hidden at the start loop - exitwhen TerrainPathability__HidMax <= 0 - set TerrainPathability__HidMax=TerrainPathability__HidMax - 1 - call SetItemVisible(TerrainPathability__Hid[TerrainPathability__HidMax], true) - set TerrainPathability__Hid[TerrainPathability__HidMax]=null + exitwhen TerrainPathability___HidMax <= 0 + set TerrainPathability___HidMax=TerrainPathability___HidMax - 1 + call SetItemVisible(TerrainPathability___Hid[TerrainPathability___HidMax], true) + set TerrainPathability___Hid[TerrainPathability___HidMax]=null endloop //Return walkability - return ( TerrainPathability_X - x ) * ( TerrainPathability_X - x ) + ( TerrainPathability_Y - y ) * ( TerrainPathability_Y - y ) <= TerrainPathability__MAX_RANGE * TerrainPathability__MAX_RANGE and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) + return ( TerrainPathability_X - x ) * ( TerrainPathability_X - x ) + ( TerrainPathability_Y - y ) * ( TerrainPathability_Y - y ) <= TerrainPathability___MAX_RANGE * TerrainPathability___MAX_RANGE and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) endfunction -function TerrainPathability__Init takes nothing returns nothing - set TerrainPathability__Find=Rect(0., 0., 128., 128.) - set TerrainPathability__Item=CreateItem(TerrainPathability__DUMMY_ITEM_ID, 0, 0) - call SetItemVisible(TerrainPathability__Item, false) +function TerrainPathability___Init takes nothing returns nothing + set TerrainPathability___Find=Rect(0., 0., 128., 128.) + set TerrainPathability___Item=CreateItem(TerrainPathability___DUMMY_ITEM_ID, 0, 0) + call SetItemVisible(TerrainPathability___Item, false) endfunction //library TerrainPathability ends @@ -23884,7 +23854,7 @@ endfunction function SetTimerData takes timer t,integer value returns nothing // new blue - call SaveInteger(TimerUtils__ht, 0, GetHandleId(t), value) + call SaveInteger(TimerUtils___ht, 0, GetHandleId(t), value) @@ -23908,7 +23878,7 @@ endfunction function GetTimerData takes timer t returns integer // new blue - return LoadInteger(TimerUtils__ht, 0, GetHandleId(t)) + return LoadInteger(TimerUtils___ht, 0, GetHandleId(t)) @@ -23937,16 +23907,16 @@ endfunction // function NewTimerEx takes integer value returns timer - if ( TimerUtils__tN == 0 ) then - if ( not TimerUtils__didinit ) then + if ( TimerUtils___tN == 0 ) then + if ( not TimerUtils___didinit ) then //This extra if shouldn't represent a major performance drawback //because QUANTITY rule is not supposed to be broken every day. call TriggerEvaluate(st___prototype17[(1)]) // INLINED!! - set TimerUtils__tN=TimerUtils__tN - 1 + set TimerUtils___tN=TimerUtils___tN - 1 else //If this happens then the QUANTITY rule has already been broken, try to fix the // issue, else fail. - set s__TimerUtils__tT[0]= CreateTimer() + set s__TimerUtils___tT[0]= CreateTimer() @@ -23964,10 +23934,10 @@ endfunction endif else - set TimerUtils__tN=TimerUtils__tN - 1 + set TimerUtils___tN=TimerUtils___tN - 1 endif - call SaveInteger(TimerUtils__ht, 0, GetHandleId((s__TimerUtils__tT[TimerUtils__tN] )), ( value)) // INLINED!! - return s__TimerUtils__tT[TimerUtils__tN] + call SaveInteger(TimerUtils___ht, 0, GetHandleId((s__TimerUtils___tT[TimerUtils___tN] )), ( value)) // INLINED!! + return s__TimerUtils___tT[TimerUtils___tN] endfunction function NewTimer takes nothing returns timer @@ -23980,39 +23950,39 @@ endfunction if ( t == null ) then return endif - if ( TimerUtils__tN == TimerUtils__ARRAY_SIZE ) then + if ( TimerUtils___tN == TimerUtils___ARRAY_SIZE ) then //stack is full, the map already has much more troubles than the chance of bug call DestroyTimer(t) else call PauseTimer(t) - if ( (LoadInteger(TimerUtils__ht, 0, GetHandleId((t)))) == TimerUtils__HELD ) then // INLINED!! + if ( (LoadInteger(TimerUtils___ht, 0, GetHandleId((t)))) == TimerUtils___HELD ) then // INLINED!! return endif - call SaveInteger(TimerUtils__ht, 0, GetHandleId((t )), ( TimerUtils__HELD)) // INLINED!! - set s__TimerUtils__tT[TimerUtils__tN]= t - set TimerUtils__tN=TimerUtils__tN + 1 + call SaveInteger(TimerUtils___ht, 0, GetHandleId((t )), ( TimerUtils___HELD)) // INLINED!! + set s__TimerUtils___tT[TimerUtils___tN]= t + set TimerUtils___tN=TimerUtils___tN + 1 endif endfunction - function TimerUtils__init takes nothing returns nothing + function TimerUtils___init takes nothing returns nothing local integer i=0 local integer o=- 1 local boolean oops= false - if ( TimerUtils__didinit ) then + if ( TimerUtils___didinit ) then return else - set TimerUtils__didinit=true + set TimerUtils___didinit=true endif - set TimerUtils__ht=InitHashtable() + set TimerUtils___ht=InitHashtable() loop - exitwhen ( i == TimerUtils__QUANTITY ) - set s__TimerUtils__tT[i]= CreateTimer() - call SaveInteger(TimerUtils__ht, 0, GetHandleId((s__TimerUtils__tT[i] )), ( TimerUtils__HELD)) // INLINED!! + exitwhen ( i == TimerUtils___QUANTITY ) + set s__TimerUtils___tT[i]= CreateTimer() + call SaveInteger(TimerUtils___ht, 0, GetHandleId((s__TimerUtils___tT[i] )), ( TimerUtils___HELD)) // INLINED!! set i=i + 1 endloop - set TimerUtils__tN=TimerUtils__QUANTITY + set TimerUtils___tN=TimerUtils___QUANTITY @@ -26561,8 +26531,8 @@ endfunction -//Implemented from module WorldBounds__WorldBoundInit: - function s__WorldBounds_WorldBounds__WorldBoundInit___onInit takes nothing returns nothing +//Implemented from module WorldBounds___WorldBoundInit: + function s__WorldBounds_WorldBounds___WorldBoundInit__onInit takes nothing returns nothing set s__WorldBounds_world=GetWorldBounds() set s__WorldBounds_maxX=R2I(GetRectMaxX(s__WorldBounds_world)) @@ -26593,7 +26563,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 @@ -26612,9 +26582,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 @@ -26659,7 +26629,7 @@ endfunction // Use this function to filter out units you dont want to have abilities registered. // By default dummy units do not trigger the system. - function CooldownReduction___UnitFilter takes unit source returns boolean + function CooldownReduction__UnitFilter takes unit source returns boolean return GetUnitAbilityLevel(source, 'Aloc') == 0 endfunction @@ -26669,85 +26639,85 @@ endfunction //Implemented from module Alloc: - function s__CooldownReduction___AbilityList_allocate takes nothing returns integer + 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 return this 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 + 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 endfunction -//Implemented from module CooldownReduction___List: +//Implemented from module CooldownReduction__List: - function s__CooldownReduction___AbilityList_init takes integer this returns integer - set s__CooldownReduction___AbilityList_next[this]=this - set s__CooldownReduction___AbilityList_prev[this]=this + function s__CooldownReduction__AbilityList_init takes integer this returns integer + set s__CooldownReduction__AbilityList_next[this]=this + set s__CooldownReduction__AbilityList_prev[this]=this return this endfunction - function s__CooldownReduction___AbilityList_push takes integer this,integer node returns integer - set s__CooldownReduction___AbilityList_prev[node]=s__CooldownReduction___AbilityList_prev[this] - set s__CooldownReduction___AbilityList_next[node]=this - set s__CooldownReduction___AbilityList_next[s__CooldownReduction___AbilityList_prev[this]]=node - set s__CooldownReduction___AbilityList_prev[this]=node + function s__CooldownReduction__AbilityList_push takes integer this,integer node returns integer + set s__CooldownReduction__AbilityList_prev[node]=s__CooldownReduction__AbilityList_prev[this] + set s__CooldownReduction__AbilityList_next[node]=this + set s__CooldownReduction__AbilityList_next[s__CooldownReduction__AbilityList_prev[this]]=node + set s__CooldownReduction__AbilityList_prev[this]=node return node endfunction - function s__CooldownReduction___AbilityList_pop takes integer this returns nothing - set s__CooldownReduction___AbilityList_next[s__CooldownReduction___AbilityList_prev[this]]=s__CooldownReduction___AbilityList_next[this] - set s__CooldownReduction___AbilityList_prev[s__CooldownReduction___AbilityList_next[this]]=s__CooldownReduction___AbilityList_prev[this] + function s__CooldownReduction__AbilityList_pop takes integer this returns nothing + set s__CooldownReduction__AbilityList_next[s__CooldownReduction__AbilityList_prev[this]]=s__CooldownReduction__AbilityList_next[this] + set s__CooldownReduction__AbilityList_prev[s__CooldownReduction__AbilityList_next[this]]=s__CooldownReduction__AbilityList_prev[this] endfunction - function s__CooldownReduction___AbilityList_destroy takes integer this returns nothing - local integer node= s__CooldownReduction___AbilityList_next[this] + function s__CooldownReduction__AbilityList_destroy takes integer this returns nothing + local integer node= s__CooldownReduction__AbilityList_next[this] loop exitwhen node == this - set s__CooldownReduction___AbilityList_ability[node]=null - call s__Table_destroy(s__CooldownReduction___AbilityList_defaults[node]) - call s__CooldownReduction___AbilityList_pop(node) - call s__CooldownReduction___AbilityList_deallocate(node) - set node=s__CooldownReduction___AbilityList_next[node] + set s__CooldownReduction__AbilityList_ability[node]=null + call s__Table_destroy(s__CooldownReduction__AbilityList_defaults[node]) + call s__CooldownReduction__AbilityList_pop(node) + call s__CooldownReduction__AbilityList_deallocate(node) + set node=s__CooldownReduction__AbilityList_next[node] endloop - call s__CooldownReduction___AbilityList_deallocate(this) + call s__CooldownReduction__AbilityList_deallocate(this) - set s__CooldownReduction___AbilityList_unit[this]=null + set s__CooldownReduction__AbilityList_unit[this]=null endfunction - function s__CooldownReduction___AbilityList_insert takes integer this,integer id returns integer - local integer node= s__CooldownReduction___AbilityList_push(this,s__CooldownReduction___AbilityList_allocate()) + function s__CooldownReduction__AbilityList_insert takes integer this,integer id returns integer + local integer node= s__CooldownReduction__AbilityList_push(this,s__CooldownReduction__AbilityList_allocate()) local integer i= 0 - set s__CooldownReduction___AbilityList_id[node]=id - set s__CooldownReduction___AbilityList_ability[node]=BlzGetUnitAbility(s__CooldownReduction___AbilityList_unit[this], id) - set s__CooldownReduction___AbilityList_levels[node]=BlzGetAbilityIntegerField(s__CooldownReduction___AbilityList_ability[node], ABILITY_IF_LEVELS) - set s__CooldownReduction___AbilityList_defaults[node]=s__Table_create() + set s__CooldownReduction__AbilityList_id[node]=id + set s__CooldownReduction__AbilityList_ability[node]=BlzGetUnitAbility(s__CooldownReduction__AbilityList_unit[this], id) + set s__CooldownReduction__AbilityList_levels[node]=BlzGetAbilityIntegerField(s__CooldownReduction__AbilityList_ability[node], ABILITY_IF_LEVELS) + set s__CooldownReduction__AbilityList_defaults[node]=s__Table_create() loop - exitwhen i >= s__CooldownReduction___AbilityList_levels[node] - call SaveReal(Table__ht, (((s__CooldownReduction___AbilityList_defaults[node]))), (i), (( BlzGetAbilityRealLevelField(s__CooldownReduction___AbilityList_ability[node], ABILITY_RLF_COOLDOWN, i))*1.0)) // INLINED!! + exitwhen i >= s__CooldownReduction__AbilityList_levels[node] + call SaveReal(Table___ht, (((s__CooldownReduction__AbilityList_defaults[node]))), (i), (( BlzGetAbilityRealLevelField(s__CooldownReduction__AbilityList_ability[node], ABILITY_RLF_COOLDOWN, i))*1.0)) // INLINED!! set i=i + 1 endloop return node endfunction - function s__CooldownReduction___AbilityList_update takes integer this,integer count,real normal,real flat,real offset returns nothing - local integer node= s__CooldownReduction___AbilityList_next[this] + function s__CooldownReduction__AbilityList_update takes integer this,integer count,real normal,real flat,real offset returns nothing + local integer node= s__CooldownReduction__AbilityList_next[this] local real cooldown local integer i @@ -26755,32 +26725,32 @@ endfunction exitwhen node == this set i=0 loop - exitwhen i >= s__CooldownReduction___AbilityList_levels[node] + exitwhen i >= s__CooldownReduction__AbilityList_levels[node] if count > 0 then - set cooldown=( ( (LoadReal(Table__ht, (((s__CooldownReduction___AbilityList_defaults[node]))), (i))) - offset ) * normal * ( 1 - flat ) ) // INLINED!! + set cooldown=( ( (LoadReal(Table___ht, (((s__CooldownReduction__AbilityList_defaults[node]))), (i))) - offset ) * normal * ( 1 - flat ) ) // INLINED!! else - set cooldown=( ( (LoadReal(Table__ht, (((s__CooldownReduction___AbilityList_defaults[node]))), (i))) - offset ) * ( 1 - flat ) ) // INLINED!! + set cooldown=( ( (LoadReal(Table___ht, (((s__CooldownReduction__AbilityList_defaults[node]))), (i))) - offset ) * ( 1 - flat ) ) // INLINED!! endif - call BlzSetAbilityRealLevelField(s__CooldownReduction___AbilityList_ability[node], ABILITY_RLF_COOLDOWN, i, cooldown) - call IncUnitAbilityLevel(s__CooldownReduction___AbilityList_unit[this], s__CooldownReduction___AbilityList_id[node]) - call DecUnitAbilityLevel(s__CooldownReduction___AbilityList_unit[this], s__CooldownReduction___AbilityList_id[node]) + call BlzSetAbilityRealLevelField(s__CooldownReduction__AbilityList_ability[node], ABILITY_RLF_COOLDOWN, i, cooldown) + call IncUnitAbilityLevel(s__CooldownReduction__AbilityList_unit[this], s__CooldownReduction__AbilityList_id[node]) + call DecUnitAbilityLevel(s__CooldownReduction__AbilityList_unit[this], s__CooldownReduction__AbilityList_id[node]) set i=i + 1 endloop - set node=s__CooldownReduction___AbilityList_next[node] + set node=s__CooldownReduction__AbilityList_next[node] endloop endfunction - function s__CooldownReduction___AbilityList_calculate takes integer this,integer id,integer level,real cooldown,integer count,real normal,real flat,real offset returns nothing + function s__CooldownReduction__AbilityList_calculate takes integer this,integer id,integer level,real cooldown,integer count,real normal,real flat,real offset returns nothing if count > 0 then - call BlzSetAbilityRealLevelField(BlzGetUnitAbility(s__CooldownReduction___AbilityList_unit[this], id), ABILITY_RLF_COOLDOWN, level, ( ( cooldown - offset ) * normal * ( 1 - flat ) )) + call BlzSetAbilityRealLevelField(BlzGetUnitAbility(s__CooldownReduction__AbilityList_unit[this], id), ABILITY_RLF_COOLDOWN, level, ( ( cooldown - offset ) * normal * ( 1 - flat ) )) else - call BlzSetAbilityRealLevelField(BlzGetUnitAbility(s__CooldownReduction___AbilityList_unit[this], id), ABILITY_RLF_COOLDOWN, level, ( ( cooldown - offset ) * ( 1 - flat ) )) + call BlzSetAbilityRealLevelField(BlzGetUnitAbility(s__CooldownReduction__AbilityList_unit[this], id), ABILITY_RLF_COOLDOWN, level, ( ( cooldown - offset ) * ( 1 - flat ) )) endif - call IncUnitAbilityLevel(s__CooldownReduction___AbilityList_unit[this], id) - call DecUnitAbilityLevel(s__CooldownReduction___AbilityList_unit[this], id) + call IncUnitAbilityLevel(s__CooldownReduction__AbilityList_unit[this], id) + call DecUnitAbilityLevel(s__CooldownReduction__AbilityList_unit[this], id) endfunction - function s__CooldownReduction___AbilityList_simulate takes integer this,real cooldown,integer count,real normal,real flat,real offset returns real + function s__CooldownReduction__AbilityList_simulate takes integer this,real cooldown,integer count,real normal,real flat,real offset returns real local real cd if count > 0 then @@ -26792,10 +26762,10 @@ endfunction return cd endfunction - function s__CooldownReduction___AbilityList_create takes unit source returns integer - local integer this= s__CooldownReduction___AbilityList_init((s__CooldownReduction___AbilityList_allocate())) + function s__CooldownReduction__AbilityList_create takes unit source returns integer + local integer this= s__CooldownReduction__AbilityList_init((s__CooldownReduction__AbilityList_allocate())) - set s__CooldownReduction___AbilityList_unit[this]=source + set s__CooldownReduction__AbilityList_unit[this]=source return this endfunction @@ -26805,7 +26775,7 @@ endfunction local integer i= GetUnitUserData(source) if s__CDR_n[i] == 0 then - set s__CDR_n[i]=s__CooldownReduction___AbilityList_create(source) + set s__CDR_n[i]=s__CooldownReduction__AbilityList_create(source) endif return s__CDR_n[i] @@ -26815,7 +26785,7 @@ endfunction local integer id= GetUnitUserData(u) local integer list= s__CDR_getInstance(u) - call s__CooldownReduction___AbilityList_update(list,s__CDR_count[id] , s__CDR_normal[id] , s__CDR_flat[id] , s__CDR_offset[id]) + call s__CooldownReduction__AbilityList_update(list,s__CDR_count[id] , s__CDR_normal[id] , s__CDR_flat[id] , s__CDR_offset[id]) endfunction function s__CDR_calculate takes unit u returns real @@ -26908,14 +26878,14 @@ endfunction local integer i= GetUnitUserData(u) local integer list= s__CDR_getInstance(u) - call s__CooldownReduction___AbilityList_calculate(list,id , level - 1 , cooldown , s__CDR_count[i] , s__CDR_normal[i] , s__CDR_flat[i] , s__CDR_offset[i]) + call s__CooldownReduction__AbilityList_calculate(list,id , level - 1 , cooldown , s__CDR_count[i] , s__CDR_normal[i] , s__CDR_flat[i] , s__CDR_offset[i]) endfunction function s__CDR_simulateCooldown takes unit u,real cooldown returns real local integer i= GetUnitUserData(u) local integer list= s__CDR_getInstance(u) - return s__CooldownReduction___AbilityList_simulate(list,cooldown , s__CDR_count[i] , s__CDR_normal[i] , s__CDR_flat[i] , s__CDR_offset[i]) + return s__CooldownReduction__AbilityList_simulate(list,cooldown , s__CDR_count[i] , s__CDR_normal[i] , s__CDR_flat[i] , s__CDR_offset[i]) endfunction function s__CDR_register takes unit u,integer id returns nothing @@ -26927,7 +26897,7 @@ endfunction set i=GetUnitUserData(u) if not LoadBoolean(s__CDR_hashtable, list, id) then - call s__CooldownReduction___AbilityList_insert(list,id) + call s__CooldownReduction__AbilityList_insert(list,id) call SaveBoolean(s__CDR_hashtable, list, id, true) if s__CDR_count[i] > 0 or s__CDR_normal[i] != 0 or s__CDR_flat[i] != 0 or s__CDR_offset[i] != 0 then @@ -26957,7 +26927,7 @@ endfunction set s__CDR_count[i]=0 if list != 0 then - call s__CooldownReduction___AbilityList_destroy(list) + call s__CooldownReduction__AbilityList_destroy(list) call FlushChildHashtable(s__CDR_hashtable, list) endif call FlushChildHashtable(s__CDR_hashtable, GetHandleId(source)) @@ -27274,7 +27244,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 @@ -27287,7 +27257,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) @@ -27314,7 +27284,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()))) @@ -27324,9 +27294,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 @@ -27360,20 +27330,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 @@ -27383,7 +27353,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 @@ -27392,16 +27362,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 @@ -27430,18 +27400,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 @@ -27615,86 +27585,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() @@ -27702,12 +27672,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 @@ -27715,50 +27685,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 @@ -27791,21 +27761,21 @@ endfunction function SetItemUnstackEnabled takes unit whichUnit,boolean enabled returns nothing if ( enabled ) then - if ( IsUnitInGroup(whichUnit, ItemUnstackSystem___disabledUnits) ) then - call GroupRemoveUnit(ItemUnstackSystem___disabledUnits, whichUnit) + if ( IsUnitInGroup(whichUnit, ItemUnstackSystem__disabledUnits) ) then + call GroupRemoveUnit(ItemUnstackSystem__disabledUnits, whichUnit) endif else - if ( not IsUnitInGroup(whichUnit, ItemUnstackSystem___disabledUnits) ) then - call GroupAddUnit(ItemUnstackSystem___disabledUnits, whichUnit) + if ( not IsUnitInGroup(whichUnit, ItemUnstackSystem__disabledUnits) ) then + call GroupAddUnit(ItemUnstackSystem__disabledUnits, whichUnit) endif endif endfunction function IsItemUnstackEnabled takes unit whichUnit returns boolean - return not IsUnitInGroup(whichUnit, ItemUnstackSystem___disabledUnits) + return not IsUnitInGroup(whichUnit, ItemUnstackSystem__disabledUnits) endfunction -function ItemUnstackSystem___GetMaxStacksByItemTypeIdIntern takes integer itemTypeId returns integer +function ItemUnstackSystem__GetMaxStacksByItemTypeIdIntern takes integer itemTypeId returns integer return GetMaxStacksByItemTypeId(itemTypeId) @@ -27813,7 +27783,7 @@ function ItemUnstackSystem___GetMaxStacksByItemTypeIdIntern takes integer itemTy endfunction -function ItemUnstackSystem___CopyItemProps takes item sourceItem,item targetItem returns nothing +function ItemUnstackSystem__CopyItemProps takes item sourceItem,item targetItem returns nothing // some seem broken //call BlzSetItemName(targetItem, GetItemName(sourceItem)) call BlzSetItemDescription(targetItem, BlzGetItemDescription(sourceItem)) @@ -27827,7 +27797,7 @@ function ItemUnstackSystem___CopyItemProps takes item sourceItem,item targetItem endif endfunction -function ItemUnstackSystem___GetItemSlot takes unit hero,item whichItem returns integer +function ItemUnstackSystem__GetItemSlot takes unit hero,item whichItem returns integer local integer sourceSlot= - 1 local integer i= 0 loop @@ -27840,7 +27810,7 @@ function ItemUnstackSystem___GetItemSlot takes unit hero,item whichItem returns return sourceSlot endfunction -function ItemUnstackSystem___AddUnstackedItem takes unit hero,integer itemTypeId,integer charges,integer sourceSlot,item sourceItem returns nothing +function ItemUnstackSystem__AddUnstackedItem takes unit hero,integer itemTypeId,integer charges,integer sourceSlot,item sourceItem returns nothing local item itemInNextSlot= null local item itemInPreviousSlot= null local integer inventorySize= UnitInventorySize(hero) @@ -27855,7 +27825,7 @@ function ItemUnstackSystem___AddUnstackedItem takes unit hero,integer itemTypeId local integer i= sourceSlot + 1 local integer j= sourceSlot - 1 // check for a slot with an item with the same type and free stacks - if ( ItemUnstackSystem___ALLOW_STACKING_NEXT_ITEM ) then + if ( ItemUnstackSystem__ALLOW_STACKING_NEXT_ITEM ) then set maxCharges=(GetMaxStacksByItemTypeId((itemTypeId))) // INLINED!! loop set itemInNextSlot=UnitItemInSlot(hero, i) @@ -27880,7 +27850,7 @@ function ItemUnstackSystem___AddUnstackedItem takes unit hero,integer itemTypeId set i=i + 1 exitwhen ( remainingCharges == 0 or i >= inventorySize ) endloop - if ( ItemUnstackSystem___STACKING_NEXT_ITEM_FROM_START and remainingCharges > 0 and sourceSlot > 0 ) then + if ( ItemUnstackSystem__STACKING_NEXT_ITEM_FROM_START and remainingCharges > 0 and sourceSlot > 0 ) then set i=0 loop set itemInNextSlot=UnitItemInSlot(hero, i) @@ -27919,7 +27889,7 @@ function ItemUnstackSystem___AddUnstackedItem takes unit hero,integer itemTypeId set addedToFreeSlot=true call UnitAddItemToSlotById(hero, itemTypeId, i) set unstackedItem=UnitItemInSlot(hero, i) - call ItemUnstackSystem___CopyItemProps(sourceItem , unstackedItem) + call ItemUnstackSystem__CopyItemProps(sourceItem , unstackedItem) set unstackedCharges=IMinBJ(maxCharges, remainingCharges) call SetItemCharges(unstackedItem, unstackedCharges) set remainingCharges=remainingCharges - unstackedCharges @@ -27927,7 +27897,7 @@ function ItemUnstackSystem___AddUnstackedItem takes unit hero,integer itemTypeId set addedToFreeSlot=true call UnitAddItemToSlotById(hero, itemTypeId, j) set unstackedItem=UnitItemInSlot(hero, j) - call ItemUnstackSystem___CopyItemProps(sourceItem , unstackedItem) + call ItemUnstackSystem__CopyItemProps(sourceItem , unstackedItem) set unstackedCharges=IMinBJ(maxCharges, remainingCharges) call SetItemCharges(unstackedItem, unstackedCharges) set remainingCharges=remainingCharges - unstackedCharges @@ -27944,43 +27914,43 @@ function ItemUnstackSystem___AddUnstackedItem takes unit hero,integer itemTypeId set unstackedItem=CreateItem(itemTypeId, GetUnitX(hero), GetUnitY(hero)) set unstackedCharges=IMinBJ(maxCharges, remainingCharges) call SetItemCharges(unstackedItem, unstackedCharges) - call ItemUnstackSystem___CopyItemProps(sourceItem , unstackedItem) + call ItemUnstackSystem__CopyItemProps(sourceItem , unstackedItem) set remainingCharges=remainingCharges - unstackedCharges endloop set unstackedItem=null endfunction -function ItemUnstackSystem___TriggerConditionOrderUnstack takes nothing returns boolean - local boolean isEnabled= (not IsUnitInGroup((GetTriggerUnit()), ItemUnstackSystem___disabledUnits)) // INLINED!! +function ItemUnstackSystem__TriggerConditionOrderUnstack takes nothing returns boolean + local boolean isEnabled= (not IsUnitInGroup((GetTriggerUnit()), ItemUnstackSystem__disabledUnits)) // INLINED!! local integer orderId= GetIssuedOrderId() local item targetItem= GetOrderTargetItem() local integer maxStacks= (GetMaxStacksByItemTypeId((GetItemTypeId(targetItem)))) // INLINED!! local integer charges= GetItemCharges(targetItem) - local boolean result= isEnabled and orderId >= 852002 and orderId <= 852007 and targetItem != null and maxStacks > 0 and charges > 1 and ItemUnstackSystem___GetItemSlot(GetTriggerUnit() , targetItem) == orderId - 852002 + local boolean result= isEnabled and orderId >= 852002 and orderId <= 852007 and targetItem != null and maxStacks > 0 and charges > 1 and ItemUnstackSystem__GetItemSlot(GetTriggerUnit() , targetItem) == orderId - 852002 set targetItem=null return result endfunction -function ItemUnstackSystem___TriggerActionOrderUnstack takes nothing returns nothing +function ItemUnstackSystem__TriggerActionOrderUnstack takes nothing returns nothing local unit hero= GetTriggerUnit() local item sourceItem= GetOrderTargetItem() local integer sourceItemTypeId= GetItemTypeId(sourceItem) - local integer sourceSlot= ItemUnstackSystem___GetItemSlot(hero , sourceItem) + local integer sourceSlot= ItemUnstackSystem__GetItemSlot(hero , sourceItem) local integer charges= 1 // wait for completing the order or the item is not at the target slot call TriggerSleepAction(0.0) // item does still exist and was dropped on its previous slot // we are not sure if this works when the item is removed via triggers since the value of the variable becomes an invalid reference if ( sourceItem != null and GetWidgetLife(sourceItem) > 0.0 and GetItemCharges(sourceItem) > 0 and UnitItemInSlot(hero, sourceSlot) == sourceItem ) then - if ( ItemUnstackSystem___UNSTACK_HALF_CHARGES ) then + if ( ItemUnstackSystem__UNSTACK_HALF_CHARGES ) then set charges=IMaxBJ(GetItemCharges(sourceItem) / 2, 1) else - set charges=IMinBJ(GetItemCharges(sourceItem) - 1, ItemUnstackSystem___MAX_UNSTACKED_CHARGES) + set charges=IMinBJ(GetItemCharges(sourceItem) - 1, ItemUnstackSystem__MAX_UNSTACKED_CHARGES) endif if ( charges > 0 ) then call SetItemCharges(sourceItem, GetItemCharges(sourceItem) - charges) - call ItemUnstackSystem___AddUnstackedItem(hero , sourceItemTypeId , charges , sourceSlot , sourceItem) + call ItemUnstackSystem__AddUnstackedItem(hero , sourceItemTypeId , charges , sourceSlot , sourceItem) endif endif @@ -27988,12 +27958,12 @@ function ItemUnstackSystem___TriggerActionOrderUnstack takes nothing returns not set sourceItem=null endfunction -function ItemUnstackSystem___Init takes nothing returns nothing - call TriggerRegisterAnyUnitEventBJ(ItemUnstackSystem___orderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) - call TriggerAddCondition(ItemUnstackSystem___orderTrigger, Condition(function ItemUnstackSystem___TriggerConditionOrderUnstack)) - call TriggerAddAction(ItemUnstackSystem___orderTrigger, function ItemUnstackSystem___TriggerActionOrderUnstack) +function ItemUnstackSystem__Init takes nothing returns nothing + call TriggerRegisterAnyUnitEventBJ(ItemUnstackSystem__orderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) + call TriggerAddCondition(ItemUnstackSystem__orderTrigger, Condition(function ItemUnstackSystem__TriggerConditionOrderUnstack)) + call TriggerAddAction(ItemUnstackSystem__orderTrigger, function ItemUnstackSystem__TriggerActionOrderUnstack) - call SetItemUnstackEnabled((MaxItemStacks___stackItemDummy) , false) // INLINED!! + call SetItemUnstackEnabled((MaxItemStacks__stackItemDummy) , false) // INLINED!! endfunction // Change Log: @@ -28049,14 +28019,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 @@ -28079,13 +28049,13 @@ endfunction //Implemented from module CTL: function s__Jump_create takes nothing returns integer - return CTL__CT(s__Jump_rctl32) + return CTL___CT(s__Jump_rctl32) endfunction function s__Jump_destroy takes integer this returns nothing - call CTL__DT(this) + call CTL___DT(this) endfunction function s__Jump_ectl32 takes nothing returns boolean - local integer this=CTL__rf[s__Jump_rctl32] + local integer this=CTL___rf[s__Jump_rctl32] local real x local real y local real z @@ -28096,39 +28066,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 @@ -28155,33 +28125,33 @@ endfunction set EVENT_JUMP_FINISH=1 set EVENT_JUMP_UNIT=null set s__Jump_u[this]=null - call CTL__DT((this)) // INLINED!! + call CTL___DT((this)) // INLINED!! endif //Implemented from module CTLNull: - set this=CTL__n[this] + set this=CTL___n[this] endloop //Implemented from module CTLEnd: return false endfunction - function s__Jump_CTLEnd___onInit takes nothing returns nothing - set s__Jump_rctl32=CTL__A(function s__Jump_ectl32) + function s__Jump_CTLEnd__onInit takes nothing returns nothing + set s__Jump_rctl32=CTL___A(function s__Jump_ectl32) endfunction function s__Jump_start takes unit un,real x1,real y1,real maxZ,real time,real gravity returns integer - local integer this= (CTL__CT(s__Jump_rctl32)) // INLINED!! + local integer this= (CTL___CT(s__Jump_rctl32)) // INLINED!! local real x0= GetUnitX(un) local real y0= GetUnitY(un) 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) @@ -28189,10 +28159,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] @@ -28220,13 +28190,13 @@ endfunction //The Action Respones -//processed: function interface Knockback__onStart takes Knockback kb returns nothing -//processed: function interface Knockback__onLoop takes Knockback kb returns nothing -//processed: function interface Knockback__onUnitHit takes Knockback kb, unit hit returns nothing -//processed: function interface Knockback__onDestructableHit takes Knockback kb, destructable hit returns nothing -//processed: function interface Knockback__onTargetDeath takes Knockback kb returns nothing -//processed: function interface Knockback__onEnd takes Knockback kb returns nothing -//processed: function interface Knockback__filterFunction takes Knockback kb, unit enum returns boolean +//processed: function interface Knockback___onStart takes Knockback kb returns nothing +//processed: function interface Knockback___onLoop takes Knockback kb returns nothing +//processed: function interface Knockback___onUnitHit takes Knockback kb, unit hit returns nothing +//processed: function interface Knockback___onDestructableHit takes Knockback kb, destructable hit returns nothing +//processed: function interface Knockback___onTargetDeath takes Knockback kb returns nothing +//processed: function interface Knockback___onEnd takes Knockback kb returns nothing +//processed: function interface Knockback___filterFunction takes Knockback kb, unit enum returns boolean //The KnockbackType Struct @@ -28256,20 +28226,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 @@ -28278,13 +28248,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 @@ -28406,13 +28376,13 @@ endfunction //change the knockback effect if the user want to use it - if s__Knockback_isGround[this] or not Knockback__IGNORE_FLYING_UNITS then + if s__Knockback_isGround[this] or not Knockback___IGNORE_FLYING_UNITS then if s__Knockback_kbEffectMode[this] == 2 and (IsTerrainPathable(((x )*1.0), (( y)*1.0), PATHING_TYPE_FLOATABILITY)) then // INLINED!! call DestroyEffect(s__Knockback_kbEffect[this]) - set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback__EARTH_EFFECT, s__Knockback_target[this], Knockback__KNOCKBACK_EFFECT_ATTACHPOINT) + set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback___EARTH_EFFECT, s__Knockback_target[this], Knockback___KNOCKBACK_EFFECT_ATTACHPOINT) elseif s__Knockback_kbEffectMode[this] == 1 and IsTerrainShallowWater(x , y) then call DestroyEffect(s__Knockback_kbEffect[this]) - set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback__WATER_EFFECT, s__Knockback_target[this], Knockback__KNOCKBACK_EFFECT_ATTACHPOINT) + set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback___WATER_EFFECT, s__Knockback_target[this], Knockback___KNOCKBACK_EFFECT_ATTACHPOINT) endif endif @@ -28494,12 +28464,12 @@ endfunction //Adds the knockback effect when USE_KNOCKBACK_EFFECTS is set to true - if s__Knockback_isGround[this] or not Knockback__IGNORE_FLYING_UNITS then + if s__Knockback_isGround[this] or not Knockback___IGNORE_FLYING_UNITS then if (IsTerrainPathable(((GetUnitX(s__Knockback_target[this]) )*1.0), (( GetUnitY(s__Knockback_target[this]))*1.0), PATHING_TYPE_FLOATABILITY)) then // INLINED!! - set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback__EARTH_EFFECT, s__Knockback_target[this], Knockback__KNOCKBACK_EFFECT_ATTACHPOINT) + set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback___EARTH_EFFECT, s__Knockback_target[this], Knockback___KNOCKBACK_EFFECT_ATTACHPOINT) set s__Knockback_kbEffectMode[this]=1 elseif IsTerrainShallowWater(GetUnitX(s__Knockback_target[this]) , GetUnitY(s__Knockback_target[this])) then - set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback__WATER_EFFECT, s__Knockback_target[this], Knockback__KNOCKBACK_EFFECT_ATTACHPOINT) + set s__Knockback_kbEffect[this]=AddSpecialEffectTarget(Knockback___WATER_EFFECT, s__Knockback_target[this], Knockback___KNOCKBACK_EFFECT_ATTACHPOINT) set s__Knockback_kbEffectMode[this]=2 endif endif @@ -28560,33 +28530,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 @@ -28598,8 +28568,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 @@ -28625,7 +28595,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) @@ -28634,10 +28604,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 @@ -28646,43 +28616,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 @@ -28691,8 +28661,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") @@ -28705,16 +28675,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 @@ -28732,87 +28702,87 @@ endfunction -//Implemented from module MissileEffect__LinkedList: +//Implemented from module MissileEffect___LinkedList: - function s__MissileEffect__Effect_init takes integer this returns integer - set s__MissileEffect__Effect_next[this]=this - set s__MissileEffect__Effect_prev[this]=this + function s__MissileEffect___Effect_init takes integer this returns integer + set s__MissileEffect___Effect_next[this]=this + set s__MissileEffect___Effect_prev[this]=this return this endfunction - function s__MissileEffect__Effect_pushBack takes integer this,integer node returns integer - set s__MissileEffect__Effect_prev[node]=s__MissileEffect__Effect_prev[this] - set s__MissileEffect__Effect_next[node]=this - set s__MissileEffect__Effect_next[s__MissileEffect__Effect_prev[this]]=node - set s__MissileEffect__Effect_prev[this]=node + function s__MissileEffect___Effect_pushBack takes integer this,integer node returns integer + set s__MissileEffect___Effect_prev[node]=s__MissileEffect___Effect_prev[this] + set s__MissileEffect___Effect_next[node]=this + set s__MissileEffect___Effect_next[s__MissileEffect___Effect_prev[this]]=node + set s__MissileEffect___Effect_prev[this]=node return node endfunction - function s__MissileEffect__Effect_pushFront takes integer this,integer node returns integer - set s__MissileEffect__Effect_prev[node]=this - set s__MissileEffect__Effect_next[node]=s__MissileEffect__Effect_next[this] - set s__MissileEffect__Effect_prev[s__MissileEffect__Effect_next[this]]=node - set s__MissileEffect__Effect_next[this]=node + function s__MissileEffect___Effect_pushFront takes integer this,integer node returns integer + set s__MissileEffect___Effect_prev[node]=this + set s__MissileEffect___Effect_next[node]=s__MissileEffect___Effect_next[this] + set s__MissileEffect___Effect_prev[s__MissileEffect___Effect_next[this]]=node + set s__MissileEffect___Effect_next[this]=node return node endfunction - function s__MissileEffect__Effect_pop takes integer this returns nothing - set s__MissileEffect__Effect_next[s__MissileEffect__Effect_prev[this]]=s__MissileEffect__Effect_next[this] - set s__MissileEffect__Effect_prev[s__MissileEffect__Effect_next[this]]=s__MissileEffect__Effect_prev[this] + function s__MissileEffect___Effect_pop takes integer this returns nothing + set s__MissileEffect___Effect_next[s__MissileEffect___Effect_prev[this]]=s__MissileEffect___Effect_next[this] + set s__MissileEffect___Effect_prev[s__MissileEffect___Effect_next[this]]=s__MissileEffect___Effect_prev[this] endfunction //Implemented from module Alloc: - function s__MissileEffect__Effect_allocate takes nothing returns integer + 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 return this 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 + 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 endfunction - function s__MissileEffect__Effect_remove takes integer this returns nothing - call DestroyEffect(s__MissileEffect__Effect_effect[this]) - call s__MissileEffect__Effect_pop(this) - call s__MissileEffect__Effect_deallocate(this) - set s__MissileEffect__Effect_effect[this]=null + function s__MissileEffect___Effect_remove takes integer this returns nothing + call DestroyEffect(s__MissileEffect___Effect_effect[this]) + call s__MissileEffect___Effect_pop(this) + call s__MissileEffect___Effect_deallocate(this) + set s__MissileEffect___Effect_effect[this]=null endfunction - function s__MissileEffect__Effect_insert takes integer this,string fxpath,real x,real y,real z,real scale returns integer - local integer node= s__MissileEffect__Effect_pushBack(this,s__MissileEffect__Effect_allocate()) - - set s__MissileEffect__Effect_x[node]=x - set s__MissileEffect__Effect_y[node]=y - set s__MissileEffect__Effect_z[node]=z - set s__MissileEffect__Effect_yaw[node]=0. - set s__MissileEffect__Effect_pitch[node]=0. - set s__MissileEffect__Effect_roll[node]=0. - set s__MissileEffect__Effect_path[node]=fxpath - set s__MissileEffect__Effect_size[node]=scale - set s__MissileEffect__Effect_effect[node]=AddSpecialEffect(fxpath, x, y) - call BlzSetSpecialEffectZ(s__MissileEffect__Effect_effect[node], z) - call BlzSetSpecialEffectScale(s__MissileEffect__Effect_effect[node], scale) + function s__MissileEffect___Effect_insert takes integer this,string fxpath,real x,real y,real z,real scale returns integer + local integer node= s__MissileEffect___Effect_pushBack(this,s__MissileEffect___Effect_allocate()) + + set s__MissileEffect___Effect_x[node]=x + set s__MissileEffect___Effect_y[node]=y + set s__MissileEffect___Effect_z[node]=z + set s__MissileEffect___Effect_yaw[node]=0. + set s__MissileEffect___Effect_pitch[node]=0. + set s__MissileEffect___Effect_roll[node]=0. + set s__MissileEffect___Effect_path[node]=fxpath + set s__MissileEffect___Effect_size[node]=scale + set s__MissileEffect___Effect_effect[node]=AddSpecialEffect(fxpath, x, y) + call BlzSetSpecialEffectZ(s__MissileEffect___Effect_effect[node], z) + call BlzSetSpecialEffectScale(s__MissileEffect___Effect_effect[node], scale) return node endfunction - function s__MissileEffect__Effect_create takes nothing returns integer - return s__MissileEffect__Effect_init((s__MissileEffect__Effect_allocate())) + function s__MissileEffect___Effect_create takes nothing returns integer + return s__MissileEffect___Effect_init((s__MissileEffect___Effect_allocate())) endfunction @@ -28860,7 +28830,7 @@ endfunction endfunction function s__MissileEffect_orient takes integer this,real yaw,real pitch,real roll returns nothing - local integer node= s__MissileEffect__Effect_next[s__MissileEffect_attachments[this]] + local integer node= s__MissileEffect___Effect_next[s__MissileEffect_attachments[this]] set s__MissileEffect_yaw[this]=yaw set s__MissileEffect_pitch[this]=pitch @@ -28869,23 +28839,23 @@ endfunction loop exitwhen node == s__MissileEffect_attachments[this] - set s__MissileEffect__Effect_yaw[node]=yaw - set s__MissileEffect__Effect_pitch[node]=pitch - set s__MissileEffect__Effect_roll[node]=roll - call BlzSetSpecialEffectOrientation(s__MissileEffect__Effect_effect[node], yaw, pitch, roll) - set node=s__MissileEffect__Effect_next[node] + set s__MissileEffect___Effect_yaw[node]=yaw + set s__MissileEffect___Effect_pitch[node]=pitch + set s__MissileEffect___Effect_roll[node]=roll + call BlzSetSpecialEffectOrientation(s__MissileEffect___Effect_effect[node], yaw, pitch, roll) + set node=s__MissileEffect___Effect_next[node] endloop endfunction function s__MissileEffect_move takes integer this,real x,real y,real z returns boolean - local integer node= s__MissileEffect__Effect_next[s__MissileEffect_attachments[this]] + local integer node= s__MissileEffect___Effect_next[s__MissileEffect_attachments[this]] if not ( x > s__WorldBounds_maxX or x < s__WorldBounds_minX or y > s__WorldBounds_maxY or y < s__WorldBounds_minY ) then call BlzSetSpecialEffectPosition(s__MissileEffect_effect[this], x, y, z) loop exitwhen node == s__MissileEffect_attachments[this] - call BlzSetSpecialEffectPosition(s__MissileEffect__Effect_effect[node], x - s__MissileEffect__Effect_x[node], y - s__MissileEffect__Effect_y[node], z - s__MissileEffect__Effect_z[node]) - set node=s__MissileEffect__Effect_next[node] + call BlzSetSpecialEffectPosition(s__MissileEffect___Effect_effect[node], x - s__MissileEffect___Effect_x[node], y - s__MissileEffect___Effect_y[node], z - s__MissileEffect___Effect_z[node]) + set node=s__MissileEffect___Effect_next[node] endloop return true endif @@ -28893,23 +28863,23 @@ endfunction endfunction function s__MissileEffect_attach takes integer this,string fxpath,real dx,real dy,real dz,real scale returns effect - local integer node= s__MissileEffect__Effect_insert(s__MissileEffect_attachments[this],fxpath , dx , dy , dz , scale) + local integer node= s__MissileEffect___Effect_insert(s__MissileEffect_attachments[this],fxpath , dx , dy , dz , scale) - call BlzSetSpecialEffectPosition(s__MissileEffect__Effect_effect[node], BlzGetLocalSpecialEffectX(s__MissileEffect_effect[this]) - dx, BlzGetLocalSpecialEffectY(s__MissileEffect_effect[this]) - dy, BlzGetLocalSpecialEffectZ(s__MissileEffect_effect[this]) - dz) + call BlzSetSpecialEffectPosition(s__MissileEffect___Effect_effect[node], BlzGetLocalSpecialEffectX(s__MissileEffect_effect[this]) - dx, BlzGetLocalSpecialEffectY(s__MissileEffect_effect[this]) - dy, BlzGetLocalSpecialEffectZ(s__MissileEffect_effect[this]) - dz) - return s__MissileEffect__Effect_effect[node] + return s__MissileEffect___Effect_effect[node] endfunction function s__MissileEffect_detach takes integer this,effect sfx returns nothing - local integer node= s__MissileEffect__Effect_next[s__MissileEffect_attachments[this]] + local integer node= s__MissileEffect___Effect_next[s__MissileEffect_attachments[this]] loop exitwhen node == s__MissileEffect_attachments[this] - if GetHandleId(s__MissileEffect__Effect_effect[node]) == GetHandleId(sfx) then - call s__MissileEffect__Effect_remove(node) + if GetHandleId(s__MissileEffect___Effect_effect[node]) == GetHandleId(sfx) then + call s__MissileEffect___Effect_remove(node) exitwhen true endif - set node=s__MissileEffect__Effect_next[node] + set node=s__MissileEffect___Effect_next[node] endloop endfunction @@ -28919,15 +28889,15 @@ endfunction function s__MissileEffect_destroy takes integer this returns nothing - local integer node= s__MissileEffect__Effect_next[s__MissileEffect_attachments[this]] + local integer node= s__MissileEffect___Effect_next[s__MissileEffect_attachments[this]] loop exitwhen node == s__MissileEffect_attachments[this] - call s__MissileEffect__Effect_remove(node) - set node=s__MissileEffect__Effect_next[node] + call s__MissileEffect___Effect_remove(node) + set node=s__MissileEffect___Effect_next[node] endloop call DestroyEffect(s__MissileEffect_effect[this]) - call s__MissileEffect__Effect_deallocate(s__MissileEffect_attachments[this]) + call s__MissileEffect___Effect_deallocate(s__MissileEffect_attachments[this]) set s__MissileEffect_effect[this]=null set s__MissileEffect_path[this]=null @@ -28945,7 +28915,7 @@ endfunction set s__MissileEffect_transparency[this]=0 set s__MissileEffect_animtype[this]=0 set s__MissileEffect_playercolor[this]=0 - set s__MissileEffect_attachments[this]=(s__MissileEffect__Effect_init((s__MissileEffect__Effect_allocate()))) // INLINED!! + set s__MissileEffect_attachments[this]=(s__MissileEffect___Effect_init((s__MissileEffect___Effect_allocate()))) // INLINED!! call BlzSetSpecialEffectZ(s__MissileEffect_effect[this], z) return this @@ -29353,80 +29323,80 @@ endfunction // Credits to Bribe and Magtheridon96 - function s__PluginSpellEffect__SUnit_create takes nothing returns integer - return s__PluginSpellEffect__SUnit__allocate() + function s__PluginSpellEffect___SUnit_create takes nothing returns integer + return s__PluginSpellEffect___SUnit__allocate() endfunction -//Implemented from module PluginSpellEffect__Event: +//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]) + if s__PluginSpellEffect___SUnit_unit[s__Spell_target] != null then + 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 - 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_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) + 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_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) - set s__PluginSpellEffect__SUnit_unit[s__Spell_target]=GetSpellTargetUnit() - set s__PluginSpellEffect__SUnit_player[s__Spell_target]=GetOwningPlayer(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) - set s__PluginSpellEffect__SUnit_handle[s__Spell_target]=GetHandleId(s__PluginSpellEffect__SUnit_unit[s__Spell_target]) - 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_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__PluginSpellEffect___SUnit_unit[s__Spell_target]=GetSpellTargetUnit() + set s__PluginSpellEffect___SUnit_player[s__Spell_target]=GetOwningPlayer(s__PluginSpellEffect___SUnit_unit[s__Spell_target]) + set s__PluginSpellEffect___SUnit_handle[s__Spell_target]=GetHandleId(s__PluginSpellEffect___SUnit_unit[s__Spell_target]) + 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_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) + 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 - set s__Spell_source=(s__PluginSpellEffect__SUnit__allocate()) // INLINED!! - set s__Spell_target=(s__PluginSpellEffect__SUnit__allocate()) // INLINED!! + 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 @@ -29437,18 +29407,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.") @@ -29456,7 +29426,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.") @@ -29479,16 +29449,16 @@ endfunction -//Implemented from module RegisterNativeEvent__NativeEventInit: - function s__RegisterNativeEvent__NativeEvent_RegisterNativeEvent__NativeEventInit___onInit takes nothing returns nothing +//Implemented from module RegisterNativeEvent___NativeEventInit: + function s__RegisterNativeEvent___NativeEvent_RegisterNativeEvent___NativeEventInit__onInit takes nothing returns nothing - set s__RegisterNativeEvent__NativeEvent_table=s__TableArray__staticgetindex(0x2000) + set s__RegisterNativeEvent___NativeEvent_table=s__TableArray__staticgetindex(0x2000) endfunction function IsNativeEventRegistered takes integer whichIndex,integer whichEvent returns boolean - return (HaveSavedHandle(Table__ht, (((((s__RegisterNativeEvent__NativeEvent_table) + (whichEvent))))), (whichIndex))) // INLINED!! + return (HaveSavedHandle(Table___ht, (((((s__RegisterNativeEvent___NativeEvent_table) + (whichEvent))))), (whichIndex))) // INLINED!! @@ -29497,7 +29467,7 @@ endfunction function RegisterNativeEventTrigger takes integer whichIndex,integer whichEvent returns boolean if not IsNativeEventRegistered(whichIndex , whichEvent) then - call SaveTriggerHandle(Table__ht, (((((s__RegisterNativeEvent__NativeEvent_table) + (whichEvent))))), (whichIndex), ( CreateTrigger())) // INLINED!! + call SaveTriggerHandle(Table___ht, (((((s__RegisterNativeEvent___NativeEvent_table) + (whichEvent))))), (whichIndex), ( CreateTrigger())) // INLINED!! @@ -29508,7 +29478,7 @@ endfunction function GetIndexNativeEventTrigger takes integer whichIndex,integer whichEvent returns trigger - return (LoadTriggerHandle(Table__ht, (((((s__RegisterNativeEvent__NativeEvent_table) + (whichEvent))))), (whichIndex))) // INLINED!! + return (LoadTriggerHandle(Table___ht, (((((s__RegisterNativeEvent___NativeEvent_table) + (whichEvent))))), (whichIndex))) // INLINED!! @@ -29519,9 +29489,9 @@ function GetNativeEventTrigger takes integer whichEvent returns trigger endfunction function CreateNativeEvent takes nothing returns integer - local integer eventId= RegisterNativeEvent__eventIndex + local integer eventId= RegisterNativeEvent___eventIndex call RegisterNativeEventTrigger(bj_MAX_PLAYER_SLOTS , eventId) - set RegisterNativeEvent__eventIndex=RegisterNativeEvent__eventIndex + 1 + set RegisterNativeEvent___eventIndex=RegisterNativeEvent___eventIndex + 1 return eventId endfunction @@ -31065,35 +31035,35 @@ endfunction //============================================================================ //============================================================================ -//Implemented from module SpellEffectEvent__M: +//Implemented from module SpellEffectEvent___M: - function s__SpellEffectEvent__S_onCast takes nothing returns nothing + function s__SpellEffectEvent___S_onCast takes nothing returns nothing - call TriggerEvaluate((LoadTriggerHandle(Table__ht, (((s__SpellEffectEvent__S_tb))), (GetSpellAbilityId())))) // INLINED!! + call TriggerEvaluate((LoadTriggerHandle(Table___ht, (((s__SpellEffectEvent___S_tb))), (GetSpellAbilityId())))) // INLINED!! 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() + set s__SpellEffectEvent___S_tb=s__Table_create() - call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT , function s__SpellEffectEvent__S_onCast) + call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT , function s__SpellEffectEvent___S_onCast) endfunction //============================================================================ function RegisterSpellEffectEvent takes integer abil,code onCast returns nothing - if not (HaveSavedHandle(Table__ht, (((s__SpellEffectEvent__S_tb))), (abil))) then // INLINED!! - call SaveTriggerHandle(Table__ht, (((s__SpellEffectEvent__S_tb))), (abil), ( CreateTrigger())) // INLINED!! + if not (HaveSavedHandle(Table___ht, (((s__SpellEffectEvent___S_tb))), (abil))) then // INLINED!! + call SaveTriggerHandle(Table___ht, (((s__SpellEffectEvent___S_tb))), (abil), ( CreateTrigger())) // INLINED!! endif - call TriggerAddCondition((LoadTriggerHandle(Table__ht, (((s__SpellEffectEvent__S_tb))), (abil))), Filter(onCast)) // INLINED!! + call TriggerAddCondition((LoadTriggerHandle(Table___ht, (((s__SpellEffectEvent___S_tb))), (abil))), Filter(onCast)) // INLINED!! @@ -31178,19 +31148,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 @@ -31202,18 +31172,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.") @@ -31319,12 +31289,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 @@ -31332,8 +31302,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: @@ -31671,7 +31641,7 @@ endfunction loop exitwhen i > s__effectTimed_index set this=s__effectTimed_instance[i] - set s__effectTimed_elapsed[this]=s__effectTimed_elapsed[this] + TimedHandles__UPDATE_PERIOD + set s__effectTimed_elapsed[this]=s__effectTimed_elapsed[this] + TimedHandles___UPDATE_PERIOD if ( s__effectTimed_elapsed[this] >= s__effectTimed_duration[this] ) then set s__effectTimed_instance[i]=s__effectTimed_instance[s__effectTimed_index] set i=i - 1 @@ -31705,7 +31675,7 @@ endfunction set s__effectTimed_index=s__effectTimed_index + 1 set s__effectTimed_instance[s__effectTimed_index]=this if ( s__effectTimed_index == 0 ) then - call TimerStart(s__effectTimed_timer, TimedHandles__UPDATE_PERIOD, true, function s__effectTimed_remove) + call TimerStart(s__effectTimed_timer, TimedHandles___UPDATE_PERIOD, true, function s__effectTimed_remove) endif set s__effectTimed_duration[this]=timeout @@ -31757,7 +31727,7 @@ endfunction loop exitwhen i > s__lightningTimed_index set this=s__lightningTimed_instance[i] - set s__lightningTimed_elapsed[this]=s__lightningTimed_elapsed[this] + TimedHandles__UPDATE_PERIOD + set s__lightningTimed_elapsed[this]=s__lightningTimed_elapsed[this] + TimedHandles___UPDATE_PERIOD if ( s__lightningTimed_elapsed[this] >= s__lightningTimed_duration[this] ) then set s__lightningTimed_instance[i]=s__lightningTimed_instance[s__lightningTimed_index] set i=i - 1 @@ -31791,7 +31761,7 @@ endfunction set s__lightningTimed_index=s__lightningTimed_index + 1 set s__lightningTimed_instance[s__lightningTimed_index]=this if ( s__lightningTimed_index == 0 ) then - call TimerStart(s__lightningTimed_timer, TimedHandles__UPDATE_PERIOD, true, function s__lightningTimed_remove) + call TimerStart(s__lightningTimed_timer, TimedHandles___UPDATE_PERIOD, true, function s__lightningTimed_remove) endif set s__lightningTimed_duration[this]=timeout @@ -31843,7 +31813,7 @@ endfunction loop exitwhen i > s__weathereffectTimed_index set this=s__weathereffectTimed_instance[i] - set s__weathereffectTimed_elapsed[this]=s__weathereffectTimed_elapsed[this] + TimedHandles__UPDATE_PERIOD + set s__weathereffectTimed_elapsed[this]=s__weathereffectTimed_elapsed[this] + TimedHandles___UPDATE_PERIOD if ( s__weathereffectTimed_elapsed[this] >= s__weathereffectTimed_duration[this] ) then set s__weathereffectTimed_instance[i]=s__weathereffectTimed_instance[s__weathereffectTimed_index] set i=i - 1 @@ -31877,7 +31847,7 @@ endfunction set s__weathereffectTimed_index=s__weathereffectTimed_index + 1 set s__weathereffectTimed_instance[s__weathereffectTimed_index]=this if ( s__weathereffectTimed_index == 0 ) then - call TimerStart(s__weathereffectTimed_timer, TimedHandles__UPDATE_PERIOD, true, function s__weathereffectTimed_remove) + call TimerStart(s__weathereffectTimed_timer, TimedHandles___UPDATE_PERIOD, true, function s__weathereffectTimed_remove) endif set s__weathereffectTimed_duration[this]=timeout @@ -31929,7 +31899,7 @@ endfunction loop exitwhen i > s__itemTimed_index set this=s__itemTimed_instance[i] - set s__itemTimed_elapsed[this]=s__itemTimed_elapsed[this] + TimedHandles__UPDATE_PERIOD + set s__itemTimed_elapsed[this]=s__itemTimed_elapsed[this] + TimedHandles___UPDATE_PERIOD if ( s__itemTimed_elapsed[this] >= s__itemTimed_duration[this] ) then set s__itemTimed_instance[i]=s__itemTimed_instance[s__itemTimed_index] set i=i - 1 @@ -31963,7 +31933,7 @@ endfunction set s__itemTimed_index=s__itemTimed_index + 1 set s__itemTimed_instance[s__itemTimed_index]=this if ( s__itemTimed_index == 0 ) then - call TimerStart(s__itemTimed_timer, TimedHandles__UPDATE_PERIOD, true, function s__itemTimed_remove) + call TimerStart(s__itemTimed_timer, TimedHandles___UPDATE_PERIOD, true, function s__itemTimed_remove) endif set s__itemTimed_duration[this]=timeout @@ -32015,7 +31985,7 @@ endfunction loop exitwhen i > s__unitTimed_index set this=s__unitTimed_instance[i] - set s__unitTimed_elapsed[this]=s__unitTimed_elapsed[this] + TimedHandles__UPDATE_PERIOD + set s__unitTimed_elapsed[this]=s__unitTimed_elapsed[this] + TimedHandles___UPDATE_PERIOD if ( s__unitTimed_elapsed[this] >= s__unitTimed_duration[this] ) then set s__unitTimed_instance[i]=s__unitTimed_instance[s__unitTimed_index] set i=i - 1 @@ -32049,7 +32019,7 @@ endfunction set s__unitTimed_index=s__unitTimed_index + 1 set s__unitTimed_instance[s__unitTimed_index]=this if ( s__unitTimed_index == 0 ) then - call TimerStart(s__unitTimed_timer, TimedHandles__UPDATE_PERIOD, true, function s__unitTimed_remove) + call TimerStart(s__unitTimed_timer, TimedHandles___UPDATE_PERIOD, true, function s__unitTimed_remove) endif set s__unitTimed_duration[this]=timeout @@ -32101,7 +32071,7 @@ endfunction loop exitwhen i > s__ubersplatTimed_index set this=s__ubersplatTimed_instance[i] - set s__ubersplatTimed_elapsed[this]=s__ubersplatTimed_elapsed[this] + TimedHandles__UPDATE_PERIOD + set s__ubersplatTimed_elapsed[this]=s__ubersplatTimed_elapsed[this] + TimedHandles___UPDATE_PERIOD if ( s__ubersplatTimed_elapsed[this] >= s__ubersplatTimed_duration[this] ) then set s__ubersplatTimed_instance[i]=s__ubersplatTimed_instance[s__ubersplatTimed_index] set i=i - 1 @@ -32135,7 +32105,7 @@ endfunction set s__ubersplatTimed_index=s__ubersplatTimed_index + 1 set s__ubersplatTimed_instance[s__ubersplatTimed_index]=this if ( s__ubersplatTimed_index == 0 ) then - call TimerStart(s__ubersplatTimed_timer, TimedHandles__UPDATE_PERIOD, true, function s__ubersplatTimed_remove) + call TimerStart(s__ubersplatTimed_timer, TimedHandles___UPDATE_PERIOD, true, function s__ubersplatTimed_remove) endif set s__ubersplatTimed_duration[this]=timeout @@ -32305,20 +32275,20 @@ endfunction function TurretSystemAddVehicleUnitType takes integer unitTypeId,boolean canAttack,boolean changeFacing,string facingBone returns integer - local integer index= TurretSystem___TurretSystemVehicleCounter - set TurretSystem___TurretSystemVehicleUnitTypeId[index]=unitTypeId - set TurretSystem___TurretSystemVehicleCanAttack[index]=canAttack - set TurretSystem___TurretSystemVehicleChangeFacing[index]=changeFacing - set TurretSystem___TurretSystemVehicleFacingBone[index]=facingBone - set TurretSystem___TurretSystemVehicleCounter=TurretSystem___TurretSystemVehicleCounter + 1 + local integer index= TurretSystem__TurretSystemVehicleCounter + set TurretSystem__TurretSystemVehicleUnitTypeId[index]=unitTypeId + set TurretSystem__TurretSystemVehicleCanAttack[index]=canAttack + set TurretSystem__TurretSystemVehicleChangeFacing[index]=changeFacing + set TurretSystem__TurretSystemVehicleFacingBone[index]=facingBone + set TurretSystem__TurretSystemVehicleCounter=TurretSystem__TurretSystemVehicleCounter + 1 return index endfunction function TurretSystemGetIndex takes integer unitTypeId returns integer local integer i= 0 loop - exitwhen ( i == TurretSystem___TurretSystemVehicleCounter ) - if ( TurretSystem___TurretSystemVehicleUnitTypeId[i] == unitTypeId ) then + exitwhen ( i == TurretSystem__TurretSystemVehicleCounter ) + if ( TurretSystem__TurretSystemVehicleUnitTypeId[i] == unitTypeId ) then return i endif set i=i + 1 @@ -32327,39 +32297,39 @@ function TurretSystemGetIndex takes integer unitTypeId returns integer endfunction function TurretSystemGetAllVehicles takes nothing returns group - return TurretSystem___TurretSystemAllVehicles + return TurretSystem__TurretSystemAllVehicles endfunction function TurretSystemGetAllTurrets takes nothing returns group - return TurretSystem___TurretSystemAllTurrets + return TurretSystem__TurretSystemAllTurrets endfunction function TurretSystemIsVehicle takes unit vehicle returns boolean - return IsUnitInGroup(vehicle, TurretSystem___TurretSystemAllVehicles) + return IsUnitInGroup(vehicle, TurretSystem__TurretSystemAllVehicles) endfunction function TurretSystemIsTurret takes unit turret returns boolean - return IsUnitInGroup(turret, TurretSystem___TurretSystemAllTurrets) + return IsUnitInGroup(turret, TurretSystem__TurretSystemAllTurrets) endfunction function TurretSystemGetVehicleTarget takes unit vehicle returns unit - return LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TARGET) + return LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TARGET) endfunction function TurretSystemGetTurretTarget takes unit vehicle returns unit - return LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TURRET_TARGET) + return LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TURRET_TARGET) endfunction function TurretSystemVehicleHasTurrets takes unit vehicle returns boolean - return HaveSavedHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TURRETS) + return HaveSavedHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TURRETS) endfunction function TurretSystemGetTurrets takes unit vehicle returns group - return LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TURRETS) + return LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TURRETS) endfunction function TurretSystemTurretsCountUnitTypeId takes unit vehicle,integer unitTypeId returns integer - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! local integer count= 0 local integer i= 0 if ( turrets != null ) then @@ -32377,12 +32347,12 @@ function TurretSystemTurretsCountUnitTypeId takes unit vehicle,integer unitTypeI return count endfunction -function TurretSystem___TurretSystemUnselectGroupEnum takes nothing returns nothing +function TurretSystem__TurretSystemUnselectGroupEnum takes nothing returns nothing call SelectUnit(GetEnumUnit(), false) endfunction function TurretSystemSelectionAddTurrets takes player whichPlayer,unit vehicle returns nothing - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! if ( turrets != null ) then if ( GetLocalPlayer() == whichPlayer ) then // Use only local code (no net traffic) within this block to avoid desyncs. @@ -32393,124 +32363,124 @@ function TurretSystemSelectionAddTurrets takes player whichPlayer,unit vehicle r endfunction function TurretSystemSelectionRemoveTurrets takes player whichPlayer,unit vehicle returns nothing - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! if ( turrets != null ) then if ( GetLocalPlayer() == whichPlayer ) then // Use only local code (no net traffic) within this block to avoid desyncs. - call ForGroup(turrets, function TurretSystem___TurretSystemUnselectGroupEnum) + call ForGroup(turrets, function TurretSystem__TurretSystemUnselectGroupEnum) endif endif set turrets=null endfunction function TurretSystemGetVehicle takes unit turret returns unit - return LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_VEHICLE) + return LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_VEHICLE) endfunction -function TurretSystem___TurretSystemFlushVehicle takes unit vehicle returns nothing - if ( (HaveSavedHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) ) then // INLINED!! - call GroupClear(LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) - call DestroyGroup(LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) +function TurretSystem__TurretSystemFlushVehicle takes unit vehicle returns nothing + if ( (HaveSavedHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) ) then // INLINED!! + call GroupClear(LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) + call DestroyGroup(LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) endif - call FlushChildHashtable(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle)) + call FlushChildHashtable(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle)) endfunction -function TurretSystem___TurretSystemFlushTurret takes unit turret returns nothing - call FlushChildHashtable(TurretSystem___TurretSystemHashTable, GetHandleId(turret)) +function TurretSystem__TurretSystemFlushTurret takes unit turret returns nothing + call FlushChildHashtable(TurretSystem__TurretSystemHashTable, GetHandleId(turret)) endfunction function TurretSystemIsTurretEnabled takes unit turret returns boolean - return LoadBoolean(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_ENABLED) + return LoadBoolean(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_ENABLED) endfunction function TurretSystemSetTurretEnabled takes unit turret,boolean enabled returns nothing - call SaveBoolean(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_ENABLED, enabled) + call SaveBoolean(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_ENABLED, enabled) call PauseUnit(turret, not enabled) //call SetUnitInvulnerable(turret, true) endfunction -function TurretSystem___TurretSystemPolarProjectionX takes real x,real angle,real distance returns real +function TurretSystem__TurretSystemPolarProjectionX takes real x,real angle,real distance returns real return x + distance * Cos(angle * bj_DEGTORAD) endfunction -function TurretSystem___TurretSystemPolarProjectionY takes real y,real angle,real distance returns real +function TurretSystem__TurretSystemPolarProjectionY takes real y,real angle,real distance returns real return y + distance * Sin(angle * bj_DEGTORAD) endfunction -function TurretSystem___TurretSystemAngleBetweenCoordinates takes real x1,real y1,real x2,real y2 returns real +function TurretSystem__TurretSystemAngleBetweenCoordinates takes real x1,real y1,real x2,real y2 returns real return bj_RADTODEG * Atan2(y2 - y1, x2 - x1) endfunction -function TurretSystem___TurretSystemDistanceBetweenCoordinates takes real x1,real y1,real x2,real y2 returns real +function TurretSystem__TurretSystemDistanceBetweenCoordinates 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 TurretSystemGetTurretPriorityTargetUnit takes unit turret returns unit - local integer targetType= LoadInteger(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE) - if ( targetType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET ) then - return LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET) + local integer targetType= LoadInteger(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE) + if ( targetType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET ) then + return LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET) endif return null endfunction function TurretSystemGetTurretPriorityTargetItem takes unit turret returns item - local integer targetType= LoadInteger(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE) - if ( targetType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET ) then - return LoadItemHandle(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET) + local integer targetType= LoadInteger(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE) + if ( targetType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET ) then + return LoadItemHandle(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET) endif return null endfunction function TurretSystemGetTurretPriorityTargetDestructable takes unit turret returns destructable - local integer targetType= LoadInteger(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE) - if ( targetType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET ) then - return LoadDestructableHandle(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET) + local integer targetType= LoadInteger(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE) + if ( targetType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET ) then + return LoadDestructableHandle(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET) endif return null endfunction function TurretSystemRegisterTurretAutoTargetEvent takes trigger whichTrigger returns nothing - set TurretSystem___TurretSystemCallbackAutoTargetTriggers[TurretSystem___TurretSystemCallbackAutoTargetTriggersCounter]=whichTrigger - set TurretSystem___TurretSystemCallbackAutoTargetTriggersCounter=TurretSystem___TurretSystemCallbackAutoTargetTriggersCounter + 1 + set TurretSystem__TurretSystemCallbackAutoTargetTriggers[TurretSystem__TurretSystemCallbackAutoTargetTriggersCounter]=whichTrigger + set TurretSystem__TurretSystemCallbackAutoTargetTriggersCounter=TurretSystem__TurretSystemCallbackAutoTargetTriggersCounter + 1 endfunction function TurretSystemGetTriggerVehicle takes nothing returns unit - return TurretSystem___TurretSystemTriggerVehicle + return TurretSystem__TurretSystemTriggerVehicle endfunction function TurretSystemGetTriggerTurret takes nothing returns unit - return TurretSystem___TurretSystemTriggerTurret + return TurretSystem__TurretSystemTriggerTurret endfunction function TurretSystemGetTriggerTargetUnit takes nothing returns unit - return TurretSystem___TurretSystemTriggerTargetUnit + return TurretSystem__TurretSystemTriggerTargetUnit endfunction function TurretSystemGetTriggerTargetItem takes nothing returns item - return TurretSystem___TurretSystemTriggerTargetItem + return TurretSystem__TurretSystemTriggerTargetItem endfunction function TurretSystemGetTriggerTargetDestructable takes nothing returns destructable - return TurretSystem___TurretSystemTriggerTargetDestructable + return TurretSystem__TurretSystemTriggerTargetDestructable endfunction -function TurretSystem___TurretSystemExecuteCallbackTurretAutoTarget takes unit vehicle,unit turret,unit targetUnit,item targetItem,destructable targetDestructable returns nothing +function TurretSystem__TurretSystemExecuteCallbackTurretAutoTarget takes unit vehicle,unit turret,unit targetUnit,item targetItem,destructable targetDestructable returns nothing local integer i= 0 - set TurretSystem___TurretSystemTriggerVehicle=vehicle - set TurretSystem___TurretSystemTriggerTurret=turret - set TurretSystem___TurretSystemTriggerTargetUnit=targetUnit - set TurretSystem___TurretSystemTriggerTargetItem=targetItem - set TurretSystem___TurretSystemTriggerTargetDestructable=targetDestructable + set TurretSystem__TurretSystemTriggerVehicle=vehicle + set TurretSystem__TurretSystemTriggerTurret=turret + set TurretSystem__TurretSystemTriggerTargetUnit=targetUnit + set TurretSystem__TurretSystemTriggerTargetItem=targetItem + set TurretSystem__TurretSystemTriggerTargetDestructable=targetDestructable loop - exitwhen ( i == TurretSystem___TurretSystemCallbackAutoTargetTriggersCounter ) - call ConditionalTriggerExecute(TurretSystem___TurretSystemCallbackAutoTargetTriggers[i]) + exitwhen ( i == TurretSystem__TurretSystemCallbackAutoTargetTriggersCounter ) + call ConditionalTriggerExecute(TurretSystem__TurretSystemCallbackAutoTargetTriggers[i]) set i=i + 1 endloop endfunction -function TurretSystem___TurretSystemApplyWeaponStats takes unit sourceUnit,unit targetUnit returns nothing +function TurretSystem__TurretSystemApplyWeaponStats takes unit sourceUnit,unit targetUnit returns nothing call BlzSetUnitWeaponIntegerField(targetUnit, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0, BlzGetUnitWeaponIntegerField(sourceUnit, UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE, 0)) call BlzSetUnitWeaponIntegerField(targetUnit, UNIT_WEAPON_IF_ATTACK_DAMAGE_BASE, 0, BlzGetUnitWeaponIntegerField(sourceUnit, UNIT_WEAPON_IF_ATTACK_DAMAGE_BASE, 0)) call BlzSetUnitWeaponIntegerField(targetUnit, UNIT_WEAPON_IF_ATTACK_DAMAGE_NUMBER_OF_DICE, 0, BlzGetUnitWeaponIntegerField(sourceUnit, UNIT_WEAPON_IF_ATTACK_DAMAGE_NUMBER_OF_DICE, 0)) @@ -32522,11 +32492,11 @@ function TurretSystem___TurretSystemApplyWeaponStats takes unit sourceUnit,unit call BlzSetUnitAttackCooldown(targetUnit, BlzGetUnitAttackCooldown(sourceUnit, 0), 0) endfunction -function TurretSystem___TurretSystemApplyMovementSettings takes unit sourceUnit,unit targetUnit returns nothing +function TurretSystem__TurretSystemApplyMovementSettings takes unit sourceUnit,unit targetUnit returns nothing call SetUnitMoveSpeed(targetUnit, GetUnitMoveSpeed(sourceUnit)) endfunction -function TurretSystem___TurretSystemUpdate takes nothing returns nothing +function TurretSystem__TurretSystemUpdate takes nothing returns nothing local unit turret= null local unit vehicle= null local unit target= null @@ -32545,46 +32515,46 @@ function TurretSystem___TurretSystemUpdate takes nothing returns nothing local boolean turretUsesVehicleDamage= false local boolean turretHasAttack= false local real turretRange= 0.0 - local integer turretOrderType= TurretSystem___TURRET_SYSTEM_ORDER_TYPE_NO_TARGET + local integer turretOrderType= TurretSystem__TURRET_SYSTEM_ORDER_TYPE_NO_TARGET local integer turretOrderId= 0 local integer i= 0 // TODO go through vehicles and then through turrets per vehicles since some settings apply to all turrets per vehicle! loop - exitwhen ( i == BlzGroupGetSize(TurretSystem___TurretSystemAllTurrets) ) - set turret=BlzGroupUnitAt(TurretSystem___TurretSystemAllTurrets, i) - if ( (LoadBoolean(TurretSystem___TurretSystemHashTable, GetHandleId((turret)), TurretSystem___TURRET_SYSTEM_KEY_ENABLED)) and not IsUnitDeadBJ(turret) and not IsUnitPaused(turret) and not IsUnitLoaded(turret) ) then // INLINED!! - set vehicle=(LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId((turret)), TurretSystem___TURRET_SYSTEM_KEY_VEHICLE)) // INLINED!! + exitwhen ( i == BlzGroupGetSize(TurretSystem__TurretSystemAllTurrets) ) + set turret=BlzGroupUnitAt(TurretSystem__TurretSystemAllTurrets, i) + if ( (LoadBoolean(TurretSystem__TurretSystemHashTable, GetHandleId((turret)), TurretSystem__TURRET_SYSTEM_KEY_ENABLED)) and not IsUnitDeadBJ(turret) and not IsUnitPaused(turret) and not IsUnitLoaded(turret) ) then // INLINED!! + set vehicle=(LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId((turret)), TurretSystem__TURRET_SYSTEM_KEY_VEHICLE)) // INLINED!! if ( not IsUnitDeadBJ(vehicle) and not IsUnitPaused(vehicle) and not IsUnitLoaded(vehicle) ) then - set target=(LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId((turret)), TurretSystem___TURRET_SYSTEM_KEY_TURRET_TARGET)) // INLINED!! - set offsetX=LoadReal(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_OFFSET_X) - set offsetY=LoadReal(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_OFFSET_Y) + set target=(LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId((turret)), TurretSystem__TURRET_SYSTEM_KEY_TURRET_TARGET)) // INLINED!! + set offsetX=LoadReal(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_OFFSET_X) + set offsetY=LoadReal(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_OFFSET_Y) set vehicleFacing=GetUnitFacing(vehicle) if ( target == null ) then set turretFacing=vehicleFacing else - set turretFacing=TurretSystem___TurretSystemAngleBetweenCoordinates(GetUnitX(vehicle) , GetUnitY(vehicle) , GetUnitX(target) , GetUnitY(target)) + set turretFacing=TurretSystem__TurretSystemAngleBetweenCoordinates(GetUnitX(vehicle) , GetUnitY(vehicle) , GetUnitX(target) , GetUnitY(target)) endif // apply offset X - set x=TurretSystem___TurretSystemPolarProjectionX(GetUnitX(vehicle) , turretFacing , offsetX) - set y=TurretSystem___TurretSystemPolarProjectionY(GetUnitY(vehicle) , turretFacing , offsetX) + set x=TurretSystem__TurretSystemPolarProjectionX(GetUnitX(vehicle) , turretFacing , offsetX) + set y=TurretSystem__TurretSystemPolarProjectionY(GetUnitY(vehicle) , turretFacing , offsetX) // apply offset Y set rotationForY=ModuloReal(turretFacing + 90, 360.0) - set x=TurretSystem___TurretSystemPolarProjectionX(x , rotationForY , offsetY) - set y=TurretSystem___TurretSystemPolarProjectionY(y , rotationForY , offsetY) + set x=TurretSystem__TurretSystemPolarProjectionX(x , rotationForY , offsetY) + set y=TurretSystem__TurretSystemPolarProjectionY(y , rotationForY , offsetY) // do not use SetUnitPosition since it would interrupt the attack call SetUnitX(turret, x) call SetUnitY(turret, y) - call TurretSystem___TurretSystemApplyMovementSettings(vehicle , target) + call TurretSystem__TurretSystemApplyMovementSettings(vehicle , target) - set turretUsesVehicleDamage=LoadBoolean(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_VEHICLE_DAMAGE) + set turretUsesVehicleDamage=LoadBoolean(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_VEHICLE_DAMAGE) if ( turretUsesVehicleDamage ) then call TurretSystemApplyWeaponStatsBefore(vehicle , target) - call TurretSystem___TurretSystemApplyWeaponStats(vehicle , target) + call TurretSystem__TurretSystemApplyWeaponStats(vehicle , target) call TurretSystemApplyWeaponStatsAfter(vehicle , target) endif @@ -32596,7 +32566,7 @@ function TurretSystem___TurretSystemUpdate takes nothing returns nothing set priorityTargetUnit=TurretSystemGetTurretPriorityTargetUnit(turret) set priorityTargetItem=TurretSystemGetTurretPriorityTargetItem(turret) set priorityTargetDestructable=TurretSystemGetTurretPriorityTargetDestructable(turret) - set turretHasAttack=LoadBoolean(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_AUTO_ATTACK) and BlzGetUnitWeaponBooleanField(turret, UNIT_WEAPON_BF_ATTACKS_ENABLED, 0) + set turretHasAttack=LoadBoolean(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_AUTO_ATTACK) and BlzGetUnitWeaponBooleanField(turret, UNIT_WEAPON_BF_ATTACKS_ENABLED, 0) if ( turretHasAttack ) then set turretRange=BlzGetUnitWeaponRealField(turret, UNIT_WEAPON_RF_ATTACK_RANGE, 0) // TODO Support both attack types and check targets? @@ -32612,14 +32582,14 @@ function TurretSystem___TurretSystemUpdate takes nothing returns nothing set priorityTargetY=GetDestructableY(priorityTargetDestructable) endif - set turretOrderType=LoadInteger(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE) - set turretOrderId=LoadInteger(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_ORDER) + set turretOrderType=LoadInteger(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE) + set turretOrderId=LoadInteger(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_ORDER) - if ( priorityTargetUnit != null and ( turretOrderId != OrderId("attack") or turretOrderType != TurretSystem___TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET or LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET) != priorityTargetUnit ) and IsUnitAliveBJ(priorityTargetUnit) and IsUnitVisible(priorityTargetUnit, GetOwningPlayer(turret)) and turretRange >= TurretSystem___TurretSystemDistanceBetweenCoordinates(x , y , priorityTargetX , priorityTargetY) ) then + if ( priorityTargetUnit != null and ( turretOrderId != OrderId("attack") or turretOrderType != TurretSystem__TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET or LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET) != priorityTargetUnit ) and IsUnitAliveBJ(priorityTargetUnit) and IsUnitVisible(priorityTargetUnit, GetOwningPlayer(turret)) and turretRange >= TurretSystem__TurretSystemDistanceBetweenCoordinates(x , y , priorityTargetX , priorityTargetY) ) then call IssueTargetOrder(turret, "attack", priorityTargetUnit) - elseif ( priorityTargetItem != null and not IsItemInvulnerable(priorityTargetItem) and GetWidgetLife(priorityTargetItem) > 0.0 and IsItemVisible(priorityTargetItem) and turretRange >= TurretSystem___TurretSystemDistanceBetweenCoordinates(x , y , priorityTargetX , priorityTargetY) ) then + elseif ( priorityTargetItem != null and not IsItemInvulnerable(priorityTargetItem) and GetWidgetLife(priorityTargetItem) > 0.0 and IsItemVisible(priorityTargetItem) and turretRange >= TurretSystem__TurretSystemDistanceBetweenCoordinates(x , y , priorityTargetX , priorityTargetY) ) then call IssueTargetOrder(turret, "attack", priorityTargetItem) - elseif ( priorityTargetDestructable != null and not IsDestructableInvulnerable(priorityTargetDestructable) and turretRange >= TurretSystem___TurretSystemDistanceBetweenCoordinates(x , y , priorityTargetX , priorityTargetY) ) then + elseif ( priorityTargetDestructable != null and not IsDestructableInvulnerable(priorityTargetDestructable) and turretRange >= TurretSystem__TurretSystemDistanceBetweenCoordinates(x , y , priorityTargetX , priorityTargetY) ) then call IssueTargetOrder(turret, "attack", priorityTargetDestructable) elseif ( GetUnitCurrentOrder(turret) == OrderId("move") or GetUnitCurrentOrder(turret) == OrderId("patrol") and GetUnitCurrentOrder(vehicle) != OrderId("stop") ) then call IssuePointOrder(turret, "attack", GetUnitX(turret), GetUnitY(turret)) @@ -32629,7 +32599,7 @@ function TurretSystem___TurretSystemUpdate takes nothing returns nothing elseif ( GetUnitCurrentOrder(vehicle) == OrderId("stop") ) then call IssueImmediateOrder(turret, "stop") endif - call TurretSystem___TurretSystemExecuteCallbackTurretAutoTarget(vehicle , turret , priorityTargetUnit , priorityTargetItem , priorityTargetDestructable) + call TurretSystem__TurretSystemExecuteCallbackTurretAutoTarget(vehicle , turret , priorityTargetUnit , priorityTargetItem , priorityTargetDestructable) set vehicle=null set target=null else @@ -32644,21 +32614,21 @@ function TurretSystem___TurretSystemUpdate takes nothing returns nothing endfunction function TurretSystemGetUpdateTimerHandleId takes nothing returns integer - return GetHandleId(TurretSystem___TurretSystemUpdateTimer) + return GetHandleId(TurretSystem__TurretSystemUpdateTimer) endfunction function TurretSystemStart takes nothing returns nothing - set TurretSystem___TurretSystemUpdatedTimerPaused=false - call TimerStart(TurretSystem___TurretSystemUpdateTimer, TURRET_SYSTEM_UPDATE_INTERVAL, true, function TurretSystem___TurretSystemUpdate) + set TurretSystem__TurretSystemUpdatedTimerPaused=false + call TimerStart(TurretSystem__TurretSystemUpdateTimer, TURRET_SYSTEM_UPDATE_INTERVAL, true, function TurretSystem__TurretSystemUpdate) endfunction function TurretSystemPause takes boolean pause returns nothing if ( pause ) then - set TurretSystem___TurretSystemUpdatedTimerPaused=true - call PauseTimer(TurretSystem___TurretSystemUpdateTimer) + set TurretSystem__TurretSystemUpdatedTimerPaused=true + call PauseTimer(TurretSystem__TurretSystemUpdateTimer) else - set TurretSystem___TurretSystemUpdatedTimerPaused=false - call TimerStart(TurretSystem___TurretSystemUpdateTimer, TURRET_SYSTEM_UPDATE_INTERVAL, true, function TurretSystem___TurretSystemUpdate) + set TurretSystem__TurretSystemUpdatedTimerPaused=false + call TimerStart(TurretSystem__TurretSystemUpdateTimer, TURRET_SYSTEM_UPDATE_INTERVAL, true, function TurretSystem__TurretSystemUpdate) endif endfunction @@ -32667,8 +32637,8 @@ function TurretSystemAddTurret takes unit vehicle,integer turretUnitTypeId,real local unit turret= CreateUnit(GetOwningPlayer(vehicle), turretUnitTypeId, GetUnitX(vehicle), GetUnitY(vehicle), GetUnitFacing(vehicle)) local integer turretHandleId= GetHandleId(turret) - if ( (HaveSavedHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) ) then // INLINED!! - set turrets=(LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + if ( (HaveSavedHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) ) then // INLINED!! + set turrets=(LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! endif if ( turrets == null ) then @@ -32676,23 +32646,23 @@ function TurretSystemAddTurret takes unit vehicle,integer turretUnitTypeId,real endif call GroupAddUnit(turrets, turret) - call GroupAddUnit(TurretSystem___TurretSystemAllTurrets, turret) + call GroupAddUnit(TurretSystem__TurretSystemAllTurrets, turret) - if ( not IsUnitInGroup(vehicle, TurretSystem___TurretSystemAllVehicles) ) then - call GroupAddUnit(TurretSystem___TurretSystemAllVehicles, vehicle) + if ( not IsUnitInGroup(vehicle, TurretSystem__TurretSystemAllVehicles) ) then + call GroupAddUnit(TurretSystem__TurretSystemAllVehicles, vehicle) endif - call SaveGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TURRETS, turrets) + call SaveGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TURRETS, turrets) set turrets=null - call SaveUnitHandle(TurretSystem___TurretSystemHashTable, turretHandleId, TurretSystem___TURRET_SYSTEM_KEY_VEHICLE, vehicle) - call SaveReal(TurretSystem___TurretSystemHashTable, turretHandleId, TurretSystem___TURRET_SYSTEM_KEY_OFFSET_X, offsetX) - call SaveReal(TurretSystem___TurretSystemHashTable, turretHandleId, TurretSystem___TURRET_SYSTEM_KEY_OFFSET_Y, offsetY) - call SaveBoolean(TurretSystem___TurretSystemHashTable, turretHandleId, TurretSystem___TURRET_SYSTEM_KEY_AUTO_ATTACK, autoAttack) - call SaveBoolean(TurretSystem___TurretSystemHashTable, turretHandleId, TurretSystem___TURRET_SYSTEM_KEY_VEHICLE_DAMAGE, vehicleDamage) - call SaveBoolean(TurretSystem___TurretSystemHashTable, turretHandleId, TurretSystem___TURRET_SYSTEM_KEY_ENABLED, true) + call SaveUnitHandle(TurretSystem__TurretSystemHashTable, turretHandleId, TurretSystem__TURRET_SYSTEM_KEY_VEHICLE, vehicle) + call SaveReal(TurretSystem__TurretSystemHashTable, turretHandleId, TurretSystem__TURRET_SYSTEM_KEY_OFFSET_X, offsetX) + call SaveReal(TurretSystem__TurretSystemHashTable, turretHandleId, TurretSystem__TURRET_SYSTEM_KEY_OFFSET_Y, offsetY) + call SaveBoolean(TurretSystem__TurretSystemHashTable, turretHandleId, TurretSystem__TURRET_SYSTEM_KEY_AUTO_ATTACK, autoAttack) + call SaveBoolean(TurretSystem__TurretSystemHashTable, turretHandleId, TurretSystem__TURRET_SYSTEM_KEY_VEHICLE_DAMAGE, vehicleDamage) + call SaveBoolean(TurretSystem__TurretSystemHashTable, turretHandleId, TurretSystem__TURRET_SYSTEM_KEY_ENABLED, true) set turret=null - if ( TurretSystem___TurretSystemUpdatedTimerPaused ) then + if ( TurretSystem__TurretSystemUpdatedTimerPaused ) then call TurretSystemPause(false) endif @@ -32700,70 +32670,70 @@ function TurretSystemAddTurret takes unit vehicle,integer turretUnitTypeId,real endfunction function TurretSystemRemoveTurret takes unit vehicle,unit turret returns nothing - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! - call FlushChildHashtable(TurretSystem___TurretSystemHashTable, GetHandleId((turret))) // INLINED!! + call FlushChildHashtable(TurretSystem__TurretSystemHashTable, GetHandleId((turret))) // INLINED!! if ( turrets != null ) then call GroupRemoveUnit(turrets, turret) endif - call GroupRemoveUnit(TurretSystem___TurretSystemAllTurrets, turret) + call GroupRemoveUnit(TurretSystem__TurretSystemAllTurrets, turret) call h__RemoveUnit(turret) set turret=null - if ( (IsUnitInGroup((vehicle), TurretSystem___TurretSystemAllVehicles)) and turrets != null ) then // INLINED!! - call SaveGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TURRETS, turrets) + if ( (IsUnitInGroup((vehicle), TurretSystem__TurretSystemAllVehicles)) and turrets != null ) then // INLINED!! + call SaveGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TURRETS, turrets) endif - if ( BlzGroupGetSize(TurretSystem___TurretSystemAllTurrets) == 0 ) then + if ( BlzGroupGetSize(TurretSystem__TurretSystemAllTurrets) == 0 ) then call TurretSystemPause(true) endif endfunction function TurretSystemRemoveTurretUnit takes nothing returns nothing - call FlushChildHashtable(TurretSystem___TurretSystemHashTable, GetHandleId((GetEnumUnit()))) // INLINED!! - call GroupRemoveUnit(TurretSystem___TurretSystemAllTurrets, GetEnumUnit()) + call FlushChildHashtable(TurretSystem__TurretSystemHashTable, GetHandleId((GetEnumUnit()))) // INLINED!! + call GroupRemoveUnit(TurretSystem__TurretSystemAllTurrets, GetEnumUnit()) call h__RemoveUnit(GetEnumUnit()) endfunction function TurretSystemRemoveAllTurrets takes unit vehicle returns nothing - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! if ( turrets != null ) then call ForGroup(turrets, function TurretSystemRemoveTurretUnit) endif - call TurretSystem___TurretSystemFlushVehicle(vehicle) - call GroupRemoveUnit(TurretSystem___TurretSystemAllVehicles, vehicle) + call TurretSystem__TurretSystemFlushVehicle(vehicle) + call GroupRemoveUnit(TurretSystem__TurretSystemAllVehicles, vehicle) - if ( BlzGroupGetSize(TurretSystem___TurretSystemAllTurrets) == 0 ) then + if ( BlzGroupGetSize(TurretSystem__TurretSystemAllTurrets) == 0 ) then call TurretSystemPause(true) endif endfunction function TurretSystemRemoveVehicle takes unit vehicle returns boolean - if ( (IsUnitInGroup((vehicle), TurretSystem___TurretSystemAllVehicles)) ) then // INLINED!! + if ( (IsUnitInGroup((vehicle), TurretSystem__TurretSystemAllVehicles)) ) then // INLINED!! call TurretSystemRemoveAllTurrets(vehicle) - call TurretSystem___TurretSystemFlushVehicle(vehicle) - call GroupRemoveUnit(TurretSystem___TurretSystemAllVehicles, vehicle) + call TurretSystem__TurretSystemFlushVehicle(vehicle) + call GroupRemoveUnit(TurretSystem__TurretSystemAllVehicles, vehicle) return true endif return false endfunction -function TurretSystem___TurretSystemTriggerConditionAttack takes nothing returns boolean - return (IsUnitInGroup((GetAttacker()), TurretSystem___TurretSystemAllTurrets)) or (IsUnitInGroup((GetAttacker()), TurretSystem___TurretSystemAllVehicles)) // INLINED!! +function TurretSystem__TurretSystemTriggerConditionAttack takes nothing returns boolean + return (IsUnitInGroup((GetAttacker()), TurretSystem__TurretSystemAllTurrets)) or (IsUnitInGroup((GetAttacker()), TurretSystem__TurretSystemAllVehicles)) // INLINED!! endfunction -function TurretSystem___TurretSystemTurretAttacksTarget takes nothing returns nothing - local unit vehicle= (LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId((GetAttacker())), TurretSystem___TURRET_SYSTEM_KEY_VEHICLE)) // INLINED!! +function TurretSystem__TurretSystemTurretAttacksTarget takes nothing returns nothing + local unit vehicle= (LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId((GetAttacker())), TurretSystem__TURRET_SYSTEM_KEY_VEHICLE)) // INLINED!! local integer index= TurretSystemGetIndex(GetUnitTypeId(vehicle)) local string attackAnimation= null //call BJDebugMsg("Turret " + GetUnitName(GetAttacker()) + " attacks from vehicle " + GetUnitName(vehicle) + " target " + GetUnitName(GetTriggerUnit())) if ( index != - 1 ) then - if ( TurretSystem___TurretSystemVehicleChangeFacing[index] ) then - call SetUnitLookAt(vehicle, TurretSystem___TurretSystemVehicleFacingBone[index], GetTriggerUnit(), 0, 0, 90) + if ( TurretSystem__TurretSystemVehicleChangeFacing[index] ) then + call SetUnitLookAt(vehicle, TurretSystem__TurretSystemVehicleFacingBone[index], GetTriggerUnit(), 0, 0, 90) endif //call BJDebugMsg("Turret " + GetUnitName(GetAttacker()) + "adjust facing of " + GetUnitName(vehicle)) else @@ -32775,15 +32745,15 @@ function TurretSystem___TurretSystemTurretAttacksTarget takes nothing returns no call SetUnitAnimation(vehicle, attackAnimation) endif - call SaveUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(GetAttacker()), TurretSystem___TURRET_SYSTEM_KEY_TURRET_TARGET, GetTriggerUnit()) - call SaveUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_TARGET, GetTriggerUnit()) + call SaveUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(GetAttacker()), TurretSystem__TURRET_SYSTEM_KEY_TURRET_TARGET, GetTriggerUnit()) + call SaveUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_TARGET, GetTriggerUnit()) set vehicle=null endfunction -function TurretSystem___TurretSystemTriggerActionAttack takes nothing returns nothing - if ( (IsUnitInGroup((GetAttacker()), TurretSystem___TurretSystemAllTurrets)) ) then // INLINED!! - call TurretSystem___TurretSystemTurretAttacksTarget() +function TurretSystem__TurretSystemTriggerActionAttack takes nothing returns nothing + if ( (IsUnitInGroup((GetAttacker()), TurretSystem__TurretSystemAllTurrets)) ) then // INLINED!! + call TurretSystem__TurretSystemTurretAttacksTarget() else // vehicles should never cause real damage call BlzUnitInterruptAttack(GetAttacker()) @@ -32792,29 +32762,29 @@ function TurretSystem___TurretSystemTriggerActionAttack takes nothing returns no endif endfunction -function TurretSystem___TurretSystemTriggerConditionIsVehicle takes nothing returns boolean - return (IsUnitInGroup((GetTriggerUnit()), TurretSystem___TurretSystemAllVehicles)) // INLINED!! +function TurretSystem__TurretSystemTriggerConditionIsVehicle takes nothing returns boolean + return (IsUnitInGroup((GetTriggerUnit()), TurretSystem__TurretSystemAllVehicles)) // INLINED!! endfunction -function TurretSystem___TurretSystemDisableTurretUnit takes nothing returns nothing +function TurretSystem__TurretSystemDisableTurretUnit takes nothing returns nothing call TurretSystemSetTurretEnabled(GetEnumUnit() , false) endfunction -function TurretSystem___TurretSystemEnableTurretUnit takes nothing returns nothing +function TurretSystem__TurretSystemEnableTurretUnit takes nothing returns nothing call TurretSystemSetTurretEnabled(GetEnumUnit() , true) endfunction -function TurretSystem___TurretSystemTriggerActionDeath takes nothing returns nothing +function TurretSystem__TurretSystemTriggerActionDeath takes nothing returns nothing local unit triggerUnit= GetTriggerUnit() - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((triggerUnit)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((triggerUnit)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! if ( turrets != null ) then if ( IsUnitType(triggerUnit, UNIT_TYPE_HERO) ) then - call ForGroup(turrets, function TurretSystem___TurretSystemDisableTurretUnit) + call ForGroup(turrets, function TurretSystem__TurretSystemDisableTurretUnit) else call ForGroup(turrets, function TurretSystemRemoveTurretUnit) - call TurretSystem___TurretSystemFlushVehicle(triggerUnit) - call GroupRemoveUnit(TurretSystem___TurretSystemAllVehicles, triggerUnit) + call TurretSystem__TurretSystemFlushVehicle(triggerUnit) + call GroupRemoveUnit(TurretSystem__TurretSystemAllVehicles, triggerUnit) endif set turrets=null @@ -32824,22 +32794,22 @@ function TurretSystem___TurretSystemTriggerActionDeath takes nothing returns not endfunction function TurretSystemTriggerActionRevive takes nothing returns nothing - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((GetTriggerUnit())), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((GetTriggerUnit())), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! if ( turrets != null ) then - call ForGroup(turrets, function TurretSystem___TurretSystemEnableTurretUnit) + call ForGroup(turrets, function TurretSystem__TurretSystemEnableTurretUnit) endif endfunction function TurretSystemSaveOrderUnit takes unit vehicle,unit target returns nothing - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET) - call SaveUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET, target) + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET) + call SaveUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET, target) endfunction function TurretSystemStopTurrets takes unit vehicle returns nothing local integer vehicleIndex= TurretSystemGetIndex(GetUnitTypeId(vehicle)) - local boolean resetBone= vehicleIndex != - 1 and TurretSystem___TurretSystemVehicleChangeFacing[vehicleIndex] - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! + local boolean resetBone= vehicleIndex != - 1 and TurretSystem__TurretSystemVehicleChangeFacing[vehicleIndex] + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! local unit turret= null local boolean result= false local integer i= 0 @@ -32848,7 +32818,7 @@ function TurretSystemStopTurrets takes unit vehicle returns nothing exitwhen ( i == BlzGroupGetSize(turrets) ) set turret=BlzGroupUnitAt(turrets, i) call IssueImmediateOrder(turret, "stop") - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) set turret=null set i=i + 1 endloop @@ -32859,8 +32829,8 @@ function TurretSystemStopTurrets takes unit vehicle returns nothing endif endfunction -function TurretSystem___TurretSystemPriorityTargetUnit takes unit vehicle,integer orderId,unit target returns boolean - local group turrets= (LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! +function TurretSystem__TurretSystemPriorityTargetUnit takes unit vehicle,integer orderId,unit target returns boolean + local group turrets= (LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((vehicle)), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)) // INLINED!! local unit turret= null local boolean result= false local integer i= 0 @@ -32870,8 +32840,8 @@ function TurretSystem___TurretSystemPriorityTargetUnit takes unit vehicle,intege set turret=BlzGroupUnitAt(turrets, i) // TODO Detect if it is a valid order for each turret, for example if the turret can only attack air units check if it is an air unit etc. if ( orderId == OrderId("attack") or ( orderId == OrderId("smart") and not IsUnitAlly(target, GetOwningPlayer(vehicle)) ) ) then - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET) - call SaveUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(turret), TurretSystem___TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET, target) + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET) + call SaveUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(turret), TurretSystem__TURRET_SYSTEM_KEY_TURRET_PRIORITY_TARGET, target) set result=true endif set turret=null @@ -32882,61 +32852,61 @@ function TurretSystem___TurretSystemPriorityTargetUnit takes unit vehicle,intege return result endfunction -function TurretSystem___TurretSystemSaveOrderItem takes unit vehicle,item target returns nothing - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET) - call SaveItemHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET, target) +function TurretSystem__TurretSystemSaveOrderItem takes unit vehicle,item target returns nothing + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET) + call SaveItemHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET, target) endfunction -function TurretSystem___TurretSystemSaveOrderDestructable takes unit vehicle,destructable target returns nothing - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET) - call SaveDestructableHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET, target) +function TurretSystem__TurretSystemSaveOrderDestructable takes unit vehicle,destructable target returns nothing + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET) + call SaveDestructableHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET, target) endfunction -function TurretSystem___TurretSystemSaveOrderPoint takes unit vehicle,real x,real y returns nothing - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_POINT_TARGET) - call SaveReal(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET_X, x) - call SaveReal(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET_Y, y) +function TurretSystem__TurretSystemSaveOrderPoint takes unit vehicle,real x,real y returns nothing + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_POINT_TARGET) + call SaveReal(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET_X, x) + call SaveReal(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET_Y, y) endfunction -function TurretSystem___TurretSystemSaveOrder takes unit vehicle returns nothing - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) +function TurretSystem__TurretSystemSaveOrder takes unit vehicle returns nothing + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) endfunction -function TurretSystem___TurretSystemRestorePreviousOrder takes unit vehicle returns nothing - local integer orderType= LoadInteger(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE) - local integer orderId= LoadInteger(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER) - if ( orderType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_NO_TARGET ) then +function TurretSystem__TurretSystemRestorePreviousOrder takes unit vehicle returns nothing + local integer orderType= LoadInteger(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE) + local integer orderId= LoadInteger(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER) + if ( orderType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_NO_TARGET ) then call IssueImmediateOrderById(vehicle, orderId) - elseif ( orderType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET ) then - call IssueTargetOrderById(vehicle, orderId, LoadUnitHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET)) - elseif ( orderType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET ) then - call IssueTargetOrderById(vehicle, orderId, LoadItemHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET)) - elseif ( orderType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET ) then - call IssueTargetOrderById(vehicle, orderId, LoadDestructableHandle(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET)) - elseif ( orderType == TurretSystem___TURRET_SYSTEM_ORDER_TYPE_POINT_TARGET ) then + elseif ( orderType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_UNIT_TARGET ) then + call IssueTargetOrderById(vehicle, orderId, LoadUnitHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET)) + elseif ( orderType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_ITEM_TARGET ) then + call IssueTargetOrderById(vehicle, orderId, LoadItemHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET)) + elseif ( orderType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_DESTRUCTABLE_TARGET ) then + call IssueTargetOrderById(vehicle, orderId, LoadDestructableHandle(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET)) + elseif ( orderType == TurretSystem__TURRET_SYSTEM_ORDER_TYPE_POINT_TARGET ) then //call BJDebugMsg("Restore previous point order for " + GetUnitName(vehicle)) - call IssuePointOrderById(vehicle, orderId, LoadReal(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET_X), LoadReal(TurretSystem___TurretSystemHashTable, GetHandleId(vehicle), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TARGET_Y)) + call IssuePointOrderById(vehicle, orderId, LoadReal(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET_X), LoadReal(TurretSystem__TurretSystemHashTable, GetHandleId(vehicle), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TARGET_Y)) endif endfunction -function TurretSystem___TurretSystemTriggerConditionIsVehicleOrTurret takes nothing returns boolean +function TurretSystem__TurretSystemTriggerConditionIsVehicleOrTurret takes nothing returns boolean local unit triggerUnit= GetTriggerUnit() - local boolean result= (IsUnitInGroup((triggerUnit), TurretSystem___TurretSystemAllVehicles)) or (IsUnitInGroup((triggerUnit), TurretSystem___TurretSystemAllTurrets)) // INLINED!! + local boolean result= (IsUnitInGroup((triggerUnit), TurretSystem__TurretSystemAllVehicles)) or (IsUnitInGroup((triggerUnit), TurretSystem__TurretSystemAllTurrets)) // INLINED!! set triggerUnit=null return result endfunction // TURRET_SYSTEM_KEY_TURRET_CURRENT_TARGET -function TurretSystem___TurretSystemTriggerActionIssueOrder takes nothing returns nothing +function TurretSystem__TurretSystemTriggerActionIssueOrder takes nothing returns nothing local boolean matchingTarget= false local integer vehicleTypeIndex= - 1 - if ( (IsUnitInGroup((GetOrderedUnit()), TurretSystem___TurretSystemAllVehicles)) ) then // INLINED!! + if ( (IsUnitInGroup((GetOrderedUnit()), TurretSystem__TurretSystemAllVehicles)) ) then // INLINED!! if ( GetIssuedOrderId() == OrderId("stop") ) then call TurretSystemStopTurrets(GetOrderedUnit()) else if ( GetOrderTargetUnit() != null ) then - set matchingTarget=TurretSystem___TurretSystemPriorityTargetUnit(GetOrderedUnit() , GetIssuedOrderId() , GetOrderTargetUnit()) + set matchingTarget=TurretSystem__TurretSystemPriorityTargetUnit(GetOrderedUnit() , GetIssuedOrderId() , GetOrderTargetUnit()) elseif ( GetOrderTargetItem() != null ) then elseif ( GetOrderTargetDestructable() != null ) then elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER ) then @@ -32951,9 +32921,9 @@ function TurretSystem___TurretSystemTriggerActionIssueOrder takes nothing return set vehicleTypeIndex=TurretSystemGetIndex(GetUnitTypeId(GetOrderedUnit())) - if ( vehicleTypeIndex == - 1 or not TurretSystem___TurretSystemVehicleCanAttack[vehicleTypeIndex] ) then + if ( vehicleTypeIndex == - 1 or not TurretSystem__TurretSystemVehicleCanAttack[vehicleTypeIndex] ) then //call BJDebugMsg("Resume previous order for " + GetUnitName(GetOrderedUnit()) + " with vehicle type index " + I2S(vehicleTypeIndex)) - call TurretSystem___TurretSystemRestorePreviousOrder(GetOrderedUnit()) + call TurretSystem__TurretSystemRestorePreviousOrder(GetOrderedUnit()) else //call BJDebugMsg("Do not previous order for " + GetUnitName(GetOrderedUnit()) + " with vehicle type index " + I2S(vehicleTypeIndex)) endif @@ -32963,15 +32933,15 @@ function TurretSystem___TurretSystemTriggerActionIssueOrder takes nothing return if ( GetOrderTargetUnit() != null ) then call TurretSystemSaveOrderUnit(GetOrderedUnit() , GetOrderTargetUnit()) elseif ( GetOrderTargetItem() != null ) then - call TurretSystem___TurretSystemSaveOrderItem(GetOrderedUnit() , GetOrderTargetItem()) + call TurretSystem__TurretSystemSaveOrderItem(GetOrderedUnit() , GetOrderTargetItem()) elseif ( GetOrderTargetDestructable() != null ) then - call TurretSystem___TurretSystemSaveOrderDestructable(GetOrderedUnit() , GetOrderTargetDestructable()) + call TurretSystem__TurretSystemSaveOrderDestructable(GetOrderedUnit() , GetOrderTargetDestructable()) elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER ) then - call TurretSystem___TurretSystemSaveOrderPoint(GetOrderedUnit() , GetOrderPointX() , GetOrderPointY()) + call TurretSystem__TurretSystemSaveOrderPoint(GetOrderedUnit() , GetOrderPointX() , GetOrderPointY()) elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_ORDER ) then - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId((GetOrderedUnit())), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) // INLINED!! + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId((GetOrderedUnit())), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) // INLINED!! endif - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(GetOrderedUnit()), TurretSystem___TURRET_SYSTEM_KEY_ORDER, GetIssuedOrderId()) + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(GetOrderedUnit()), TurretSystem__TURRET_SYSTEM_KEY_ORDER, GetIssuedOrderId()) endif endif // turret @@ -32979,29 +32949,29 @@ function TurretSystem___TurretSystemTriggerActionIssueOrder takes nothing return if ( GetOrderTargetUnit() != null ) then call TurretSystemSaveOrderUnit(GetOrderedUnit() , GetOrderTargetUnit()) elseif ( GetOrderTargetItem() != null ) then - call TurretSystem___TurretSystemSaveOrderItem(GetOrderedUnit() , GetOrderTargetItem()) + call TurretSystem__TurretSystemSaveOrderItem(GetOrderedUnit() , GetOrderTargetItem()) elseif ( GetOrderTargetDestructable() != null ) then - call TurretSystem___TurretSystemSaveOrderDestructable(GetOrderedUnit() , GetOrderTargetDestructable()) + call TurretSystem__TurretSystemSaveOrderDestructable(GetOrderedUnit() , GetOrderTargetDestructable()) elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER ) then - call TurretSystem___TurretSystemSaveOrderPoint(GetOrderedUnit() , GetOrderPointX() , GetOrderPointY()) + call TurretSystem__TurretSystemSaveOrderPoint(GetOrderedUnit() , GetOrderPointX() , GetOrderPointY()) elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_ORDER ) then // prevents slow movement when the turrets and the vehicle are selected together if ( GetIssuedOrderId() == OrderId("move") ) then - call TurretSystem___TurretSystemRestorePreviousOrder(GetOrderedUnit()) + call TurretSystem__TurretSystemRestorePreviousOrder(GetOrderedUnit()) else - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId((GetOrderedUnit())), TurretSystem___TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem___TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) // INLINED!! + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId((GetOrderedUnit())), TurretSystem__TURRET_SYSTEM_KEY_ORDER_TYPE, TurretSystem__TURRET_SYSTEM_ORDER_TYPE_NO_TARGET) // INLINED!! endif endif - call SaveInteger(TurretSystem___TurretSystemHashTable, GetHandleId(GetOrderedUnit()), TurretSystem___TURRET_SYSTEM_KEY_ORDER, GetIssuedOrderId()) + call SaveInteger(TurretSystem__TurretSystemHashTable, GetHandleId(GetOrderedUnit()), TurretSystem__TURRET_SYSTEM_KEY_ORDER, GetIssuedOrderId()) endif endfunction -function TurretSystem___TurretSystemTriggerConditionIsSelectionAbility takes nothing returns boolean - return GetSpellAbilityId() == TURRET_SYSTEM_SELECT_TURRETS_ABILITY_ID and (IsUnitInGroup((GetTriggerUnit()), TurretSystem___TurretSystemAllVehicles)) // INLINED!! +function TurretSystem__TurretSystemTriggerConditionIsSelectionAbility takes nothing returns boolean + return GetSpellAbilityId() == TURRET_SYSTEM_SELECT_TURRETS_ABILITY_ID and (IsUnitInGroup((GetTriggerUnit()), TurretSystem__TurretSystemAllVehicles)) // INLINED!! endfunction -function TurretSystem___TurretSystemTriggerActionSelectAllTurrets takes nothing returns nothing +function TurretSystem__TurretSystemTriggerActionSelectAllTurrets takes nothing returns nothing local unit vehicle= GetTriggerUnit() call TurretSystemSelectionAddTurrets(GetOwningPlayer(vehicle) , vehicle) set vehicle=null @@ -33009,31 +32979,31 @@ endfunction -//Implemented from module TurretSystem___Init: +//Implemented from module TurretSystem__Init: - 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) + 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) - call TriggerRegisterAnyUnitEventBJ(TurretSystem___TurretSystemDeathTrigger, EVENT_PLAYER_UNIT_DEATH) - call TriggerAddCondition(TurretSystem___TurretSystemDeathTrigger, Condition(function TurretSystem___TurretSystemTriggerConditionIsVehicle)) - call TriggerAddAction(TurretSystem___TurretSystemDeathTrigger, function TurretSystem___TurretSystemTriggerActionDeath) + call TriggerRegisterAnyUnitEventBJ(TurretSystem__TurretSystemDeathTrigger, EVENT_PLAYER_UNIT_DEATH) + call TriggerAddCondition(TurretSystem__TurretSystemDeathTrigger, Condition(function TurretSystem__TurretSystemTriggerConditionIsVehicle)) + call TriggerAddAction(TurretSystem__TurretSystemDeathTrigger, function TurretSystem__TurretSystemTriggerActionDeath) - call TriggerRegisterAnyUnitEventBJ(TurretSystem___TurretSystemReviveTrigger, EVENT_PLAYER_HERO_REVIVE_FINISH) - call TriggerAddCondition(TurretSystem___TurretSystemReviveTrigger, Condition(function TurretSystem___TurretSystemTriggerConditionIsVehicle)) - call TriggerAddAction(TurretSystem___TurretSystemReviveTrigger, function TurretSystemTriggerActionRevive) + call TriggerRegisterAnyUnitEventBJ(TurretSystem__TurretSystemReviveTrigger, EVENT_PLAYER_HERO_REVIVE_FINISH) + call TriggerAddCondition(TurretSystem__TurretSystemReviveTrigger, Condition(function TurretSystem__TurretSystemTriggerConditionIsVehicle)) + call TriggerAddAction(TurretSystem__TurretSystemReviveTrigger, function TurretSystemTriggerActionRevive) - call TriggerRegisterAnyUnitEventBJ(TurretSystem___TurretSystemOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) - call TriggerRegisterAnyUnitEventBJ(TurretSystem___TurretSystemOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) - call TriggerRegisterAnyUnitEventBJ(TurretSystem___TurretSystemOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) - call TriggerAddCondition(TurretSystem___TurretSystemOrderTrigger, Condition(function TurretSystem___TurretSystemTriggerConditionIsVehicleOrTurret)) - call TriggerAddAction(TurretSystem___TurretSystemOrderTrigger, function TurretSystem___TurretSystemTriggerActionIssueOrder) + call TriggerRegisterAnyUnitEventBJ(TurretSystem__TurretSystemOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER) + call TriggerRegisterAnyUnitEventBJ(TurretSystem__TurretSystemOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER) + call TriggerRegisterAnyUnitEventBJ(TurretSystem__TurretSystemOrderTrigger, EVENT_PLAYER_UNIT_ISSUED_ORDER) + call TriggerAddCondition(TurretSystem__TurretSystemOrderTrigger, Condition(function TurretSystem__TurretSystemTriggerConditionIsVehicleOrTurret)) + call TriggerAddAction(TurretSystem__TurretSystemOrderTrigger, function TurretSystem__TurretSystemTriggerActionIssueOrder) - call TriggerRegisterAnyUnitEventBJ(TurretSystem___TurretSystemSelectionTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) - call TriggerAddCondition(TurretSystem___TurretSystemSelectionTrigger, Condition(function TurretSystem___TurretSystemTriggerConditionIsSelectionAbility)) - call TriggerAddAction(TurretSystem___TurretSystemSelectionTrigger, function TurretSystem___TurretSystemTriggerActionSelectAllTurrets) + call TriggerRegisterAnyUnitEventBJ(TurretSystem__TurretSystemSelectionTrigger, EVENT_PLAYER_UNIT_SPELL_CAST) + call TriggerAddCondition(TurretSystem__TurretSystemSelectionTrigger, Condition(function TurretSystem__TurretSystemTriggerConditionIsSelectionAbility)) + call TriggerAddAction(TurretSystem__TurretSystemSelectionTrigger, function TurretSystem__TurretSystemTriggerActionSelectAllTurrets) endfunction @@ -33077,23 +33047,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 @@ -33101,7 +33071,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' @@ -33115,24 +33085,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 @@ -33144,7 +33114,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 @@ -33152,24 +33122,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 @@ -33198,8 +33168,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 @@ -33215,13 +33185,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 @@ -33230,7 +33200,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 @@ -33251,18 +33221,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) @@ -33272,7 +33242,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 @@ -33281,7 +33251,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 @@ -33296,11 +33266,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) @@ -33308,10 +33278,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) @@ -33329,7 +33299,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 @@ -33344,7 +33314,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 @@ -33458,7 +33428,7 @@ endfunction //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 @@ -33689,7 +33659,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 @@ -33702,7 +33672,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 @@ -33715,7 +33685,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 @@ -33739,13 +33709,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) + ".") @@ -33758,12 +33728,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) @@ -33785,47 +33755,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 @@ -35757,45 +35727,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 @@ -35809,14 +35779,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 @@ -35828,7 +35798,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) @@ -35839,8 +35809,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 @@ -35851,8 +35821,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 @@ -35863,9 +35833,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 @@ -35874,8 +35844,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 @@ -35884,8 +35854,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 @@ -35897,10 +35867,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 @@ -35915,15 +35885,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 @@ -35941,15 +35911,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 @@ -35959,7 +35929,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) @@ -35971,27 +35941,27 @@ function WoWReforgedLearnableSkills___TriggerActionLearn takes nothing returns n set hero=null endfunction -function WoWReforgedLearnableSkills___TriggerConditionUnlearn takes nothing returns boolean +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 @@ -36000,15 +35970,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 @@ -36326,7 +36296,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) @@ -36453,52 +36423,52 @@ endfunction //---------------------------------------------- - function s__CooldownReductionUtils___CDRUtils_destroy takes integer this returns nothing - if s__CooldownReductionUtils___CDRUtils_didx == - 1 then - call PauseTimer(s__CooldownReductionUtils___CDRUtils_t) + function s__CooldownReductionUtils__CDRUtils_destroy takes integer this returns nothing + if s__CooldownReductionUtils__CDRUtils_didx == - 1 then + call PauseTimer(s__CooldownReductionUtils__CDRUtils_t) endif - set s__CooldownReductionUtils___CDRUtils_u[this]=null - set s__CooldownReductionUtils___CDRUtils_ticks[this]=0 + set s__CooldownReductionUtils__CDRUtils_u[this]=null + set s__CooldownReductionUtils__CDRUtils_ticks[this]=0 call sc__CDR_deallocate(this) endfunction - function s__CooldownReductionUtils___CDRUtils_onPeriod takes nothing returns nothing + function s__CooldownReductionUtils__CDRUtils_onPeriod takes nothing returns nothing local integer i= 0 local integer this loop - exitwhen i > s__CooldownReductionUtils___CDRUtils_didx - set this=s__CooldownReductionUtils___CDRUtils_data[i] - set s__CooldownReductionUtils___CDRUtils_ticks[this]=s__CooldownReductionUtils___CDRUtils_ticks[this] - 1 - - if s__CooldownReductionUtils___CDRUtils_ticks[this] <= 0 then - if s__CooldownReductionUtils___CDRUtils_tipo[this] == 0 then - call s__CDR_remove(s__CooldownReductionUtils___CDRUtils_u[this] , s__CooldownReductionUtils___CDRUtils_amount[this]) - elseif s__CooldownReductionUtils___CDRUtils_tipo[this] == 1 then - call s__CDR_Set(s__CooldownReductionUtils___CDRUtils_u[this] , s__CDR_get(s__CooldownReductionUtils___CDRUtils_u[this] , 1) - s__CooldownReductionUtils___CDRUtils_amount[this] , 1) + exitwhen i > s__CooldownReductionUtils__CDRUtils_didx + set this=s__CooldownReductionUtils__CDRUtils_data[i] + set s__CooldownReductionUtils__CDRUtils_ticks[this]=s__CooldownReductionUtils__CDRUtils_ticks[this] - 1 + + if s__CooldownReductionUtils__CDRUtils_ticks[this] <= 0 then + if s__CooldownReductionUtils__CDRUtils_tipo[this] == 0 then + call s__CDR_remove(s__CooldownReductionUtils__CDRUtils_u[this] , s__CooldownReductionUtils__CDRUtils_amount[this]) + elseif s__CooldownReductionUtils__CDRUtils_tipo[this] == 1 then + call s__CDR_Set(s__CooldownReductionUtils__CDRUtils_u[this] , s__CDR_get(s__CooldownReductionUtils__CDRUtils_u[this] , 1) - s__CooldownReductionUtils__CDRUtils_amount[this] , 1) else - call s__CDR_Set(s__CooldownReductionUtils___CDRUtils_u[this] , s__CDR_get(s__CooldownReductionUtils___CDRUtils_u[this] , 2) - s__CooldownReductionUtils___CDRUtils_amount[this] , 2) + call s__CDR_Set(s__CooldownReductionUtils__CDRUtils_u[this] , s__CDR_get(s__CooldownReductionUtils__CDRUtils_u[this] , 2) - s__CooldownReductionUtils__CDRUtils_amount[this] , 2) endif - set s__CooldownReductionUtils___CDRUtils_data[i]=s__CooldownReductionUtils___CDRUtils_data[s__CooldownReductionUtils___CDRUtils_didx] - set s__CooldownReductionUtils___CDRUtils_didx=s__CooldownReductionUtils___CDRUtils_didx - 1 + set s__CooldownReductionUtils__CDRUtils_data[i]=s__CooldownReductionUtils__CDRUtils_data[s__CooldownReductionUtils__CDRUtils_didx] + set s__CooldownReductionUtils__CDRUtils_didx=s__CooldownReductionUtils__CDRUtils_didx - 1 set i=i - 1 - call s__CooldownReductionUtils___CDRUtils_destroy(this) + call s__CooldownReductionUtils__CDRUtils_destroy(this) endif set i=i + 1 endloop endfunction - function s__CooldownReductionUtils___CDRUtils_addTimed takes unit u,real amount,real duration,integer tipo returns nothing - local integer this= s__CooldownReductionUtils___CDRUtils__allocate() + function s__CooldownReductionUtils__CDRUtils_addTimed takes unit u,real amount,real duration,integer tipo returns nothing + local integer this= s__CooldownReductionUtils__CDRUtils__allocate() - set s__CooldownReductionUtils___CDRUtils_u[this]=u - set s__CooldownReductionUtils___CDRUtils_amount[this]=amount - set s__CooldownReductionUtils___CDRUtils_tipo[this]=tipo - set s__CooldownReductionUtils___CDRUtils_ticks[this]=duration / 0.03125000 - set s__CooldownReductionUtils___CDRUtils_didx=s__CooldownReductionUtils___CDRUtils_didx + 1 - set s__CooldownReductionUtils___CDRUtils_data[s__CooldownReductionUtils___CDRUtils_didx]=this + set s__CooldownReductionUtils__CDRUtils_u[this]=u + set s__CooldownReductionUtils__CDRUtils_amount[this]=amount + set s__CooldownReductionUtils__CDRUtils_tipo[this]=tipo + set s__CooldownReductionUtils__CDRUtils_ticks[this]=duration / 0.03125000 + set s__CooldownReductionUtils__CDRUtils_didx=s__CooldownReductionUtils__CDRUtils_didx + 1 + set s__CooldownReductionUtils__CDRUtils_data[s__CooldownReductionUtils__CDRUtils_didx]=this if tipo == 0 then call s__CDR_add(u , amount) @@ -36508,8 +36478,8 @@ endfunction call s__CDR_Set(u , s__CDR_get(u , 2) + amount , 2) endif - if s__CooldownReductionUtils___CDRUtils_didx == 0 then - call TimerStart(s__CooldownReductionUtils___CDRUtils_t, 0.03125000, true, function s__CooldownReductionUtils___CDRUtils_onPeriod) + if s__CooldownReductionUtils__CDRUtils_didx == 0 then + call TimerStart(s__CooldownReductionUtils__CDRUtils_t, 0.03125000, true, function s__CooldownReductionUtils__CDRUtils_onPeriod) endif endfunction @@ -36517,15 +36487,15 @@ endfunction function UnitAddCooldownReductionTimed takes unit u,real value,real duration returns nothing - call s__CooldownReductionUtils___CDRUtils_addTimed(u , value , duration , 0) + call s__CooldownReductionUtils__CDRUtils_addTimed(u , value , duration , 0) endfunction function UnitAddCooldownReductionFlatTimed takes unit u,real value,real duration returns nothing - call s__CooldownReductionUtils___CDRUtils_addTimed(u , value , duration , 1) + call s__CooldownReductionUtils__CDRUtils_addTimed(u , value , duration , 1) endfunction function UnitAddCooldownOffsetTimed takes unit u,real value,real duration returns nothing - call s__CooldownReductionUtils___CDRUtils_addTimed(u , value , duration , 2) + call s__CooldownReductionUtils__CDRUtils_addTimed(u , value , duration , 2) endfunction function GetUnitCooldownReductionEx takes unit u returns string @@ -36548,7 +36518,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 @@ -36578,7 +36548,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 @@ -36597,7 +36567,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 @@ -36607,16 +36577,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 @@ -36629,7 +36599,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 @@ -36639,19 +36609,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 @@ -36661,7 +36631,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 @@ -36670,30 +36640,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 @@ -36707,7 +36677,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 @@ -36715,7 +36685,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() @@ -36731,7 +36701,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() @@ -36741,7 +36711,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 @@ -36750,16 +36720,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 @@ -36773,7 +36743,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 @@ -36783,81 +36753,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 @@ -36873,29 +36843,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 @@ -36904,28 +36874,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 @@ -36936,13 +36906,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 @@ -36950,19 +36920,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) @@ -36975,26 +36945,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 @@ -37005,13 +36975,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 @@ -37019,17 +36989,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 @@ -37044,17 +37014,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) @@ -37067,7 +37037,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 @@ -37075,13 +37045,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 @@ -37092,7 +37062,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 @@ -37109,7 +37079,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 @@ -37126,14 +37096,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") @@ -37144,13 +37114,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") @@ -37158,7 +37128,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()) @@ -37171,22 +37141,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 @@ -37692,88 +37662,88 @@ endfunction - function Missiles__GetLocZ takes real x,real y returns real - call MoveLocation(Missiles__LOC, x, y) - return GetLocationZ(Missiles__LOC) + function Missiles___GetLocZ takes real x,real y returns real + call MoveLocation(Missiles___LOC, x, y) + return GetLocationZ(Missiles___LOC) endfunction - function Missiles__GetUnitZ takes unit u returns real - return Missiles__GetLocZ(GetUnitX(u) , GetUnitY(u)) + GetUnitFlyHeight(u) + function Missiles___GetUnitZ takes unit u returns real + return Missiles___GetLocZ(GetUnitX(u) , GetUnitY(u)) + GetUnitFlyHeight(u) endfunction - function Missiles__SetUnitZ takes unit u,real z returns nothing - call SetUnitFlyHeight(u, z - Missiles__GetLocZ(GetUnitX(u) , GetUnitY(u)), 0) + function Missiles___SetUnitZ takes unit u,real z returns nothing + call SetUnitFlyHeight(u, z - Missiles___GetLocZ(GetUnitX(u) , GetUnitY(u)), 0) endfunction - function Missiles__GetMapCliffLevel takes nothing returns integer + function Missiles___GetMapCliffLevel takes nothing returns integer return GetTerrainCliffLevel(s__WorldBounds_maxX, s__WorldBounds_maxY) endfunction - function s__Missiles__Pool_recycle takes unit dummy returns nothing - if GetUnitTypeId(dummy) == Missiles__DUMMY then - call GroupAddUnit(s__Missiles__Pool_group, dummy) + function s__Missiles___Pool_recycle takes unit dummy returns nothing + if GetUnitTypeId(dummy) == Missiles___DUMMY then + call GroupAddUnit(s__Missiles___Pool_group, dummy) call SetUnitX(dummy, s__WorldBounds_maxX) call SetUnitY(dummy, s__WorldBounds_maxY) - call SetUnitOwner(dummy, s__Missiles__Pool_player, false) + call SetUnitOwner(dummy, s__Missiles___Pool_player, false) call PauseUnit(dummy, true) endif endfunction - function s__Missiles__Pool_retrieve takes real x,real y,real z,real face returns unit - if BlzGroupGetSize(s__Missiles__Pool_group) > 0 then - set bj_lastCreatedUnit=FirstOfGroup(s__Missiles__Pool_group) + function s__Missiles___Pool_retrieve takes real x,real y,real z,real face returns unit + if BlzGroupGetSize(s__Missiles___Pool_group) > 0 then + set bj_lastCreatedUnit=FirstOfGroup(s__Missiles___Pool_group) call PauseUnit(bj_lastCreatedUnit, false) - call GroupRemoveUnit(s__Missiles__Pool_group, bj_lastCreatedUnit) + call GroupRemoveUnit(s__Missiles___Pool_group, bj_lastCreatedUnit) call SetUnitX(bj_lastCreatedUnit, x) call SetUnitY(bj_lastCreatedUnit, y) - call Missiles__SetUnitZ(bj_lastCreatedUnit , z) + call Missiles___SetUnitZ(bj_lastCreatedUnit , z) call BlzSetUnitFacingEx(bj_lastCreatedUnit, face) else - set bj_lastCreatedUnit=CreateUnit(s__Missiles__Pool_player, Missiles__DUMMY, x, y, face) - call Missiles__SetUnitZ(bj_lastCreatedUnit , z) + set bj_lastCreatedUnit=CreateUnit(s__Missiles___Pool_player, Missiles___DUMMY, x, y, face) + call Missiles___SetUnitZ(bj_lastCreatedUnit , z) call UnitRemoveAbility(bj_lastCreatedUnit, 'Amrf') endif return bj_lastCreatedUnit endfunction - function s__Missiles__Pool_onExpire takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + function s__Missiles___Pool_onExpire takes nothing returns nothing + local integer this= (LoadInteger(TimerUtils___ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! - call s__Missiles__Pool_recycle(s__Missiles__Pool_unit[this]) - call ReleaseTimer(s__Missiles__Pool_timer[this]) + call s__Missiles___Pool_recycle(s__Missiles___Pool_unit[this]) + call ReleaseTimer(s__Missiles___Pool_timer[this]) - set s__Missiles__Pool_timer[this]=null - set s__Missiles__Pool_unit[this]=null + set s__Missiles___Pool_timer[this]=null + set s__Missiles___Pool_unit[this]=null - call s__Missiles__Pool_deallocate(this) + call s__Missiles___Pool_deallocate(this) endfunction - function s__Missiles__Pool_recycleTimed takes unit dummy,real delay returns nothing + function s__Missiles___Pool_recycleTimed takes unit dummy,real delay returns nothing local integer this - if GetUnitTypeId(dummy) != Missiles__DUMMY then + if GetUnitTypeId(dummy) != Missiles___DUMMY then else - set this=s__Missiles__Pool__allocate() + set this=s__Missiles___Pool__allocate() - set s__Missiles__Pool_timer[this]=NewTimerEx(this) - set s__Missiles__Pool_unit[this]=dummy + set s__Missiles___Pool_timer[this]=NewTimerEx(this) + set s__Missiles___Pool_unit[this]=dummy - call TimerStart(s__Missiles__Pool_timer[this], delay, false, function s__Missiles__Pool_onExpire) + call TimerStart(s__Missiles___Pool_timer[this], delay, false, function s__Missiles___Pool_onExpire) endif endfunction - function s__Missiles__Pool_onInit takes nothing returns nothing + function s__Missiles___Pool_onInit takes nothing returns nothing local integer i= 0 local unit u loop exitwhen i == Missiles_SWEET_SPOT - set u=CreateUnit(s__Missiles__Pool_player, Missiles__DUMMY, s__WorldBounds_maxX, s__WorldBounds_maxY, 0) + set u=CreateUnit(s__Missiles___Pool_player, Missiles___DUMMY, s__WorldBounds_maxX, s__WorldBounds_maxY, 0) call PauseUnit(u, false) - call GroupAddUnit(s__Missiles__Pool_group, u) + call GroupAddUnit(s__Missiles___Pool_group, u) call UnitRemoveAbility(u, 'Amrf') set i=i + 1 endloop @@ -37784,57 +37754,57 @@ endfunction // Creates an origin - impact link. - function s__Missiles__Coordinates_math takes integer a,integer b returns nothing + function s__Missiles___Coordinates_math takes integer a,integer b returns nothing local real dx local real dy loop - set dx=s__Missiles__Coordinates_x[b] - s__Missiles__Coordinates_x[a] - set dy=s__Missiles__Coordinates_y[b] - s__Missiles__Coordinates_y[a] + set dx=s__Missiles___Coordinates_x[b] - s__Missiles___Coordinates_x[a] + set dy=s__Missiles___Coordinates_y[b] - s__Missiles___Coordinates_y[a] set dx=dx * dx + dy * dy set dy=SquareRoot(dx) exitwhen dx != 0. and dy != 0. - set s__Missiles__Coordinates_x[b]=s__Missiles__Coordinates_x[b] + .01 - set s__Missiles__Coordinates_z[b]=s__Missiles__Coordinates_z[b] - Missiles__GetLocZ(s__Missiles__Coordinates_x[b] - .01 , s__Missiles__Coordinates_y[b]) + Missiles__GetLocZ(s__Missiles__Coordinates_x[b] , s__Missiles__Coordinates_y[b]) + set s__Missiles___Coordinates_x[b]=s__Missiles___Coordinates_x[b] + .01 + set s__Missiles___Coordinates_z[b]=s__Missiles___Coordinates_z[b] - Missiles___GetLocZ(s__Missiles___Coordinates_x[b] - .01 , s__Missiles___Coordinates_y[b]) + Missiles___GetLocZ(s__Missiles___Coordinates_x[b] , s__Missiles___Coordinates_y[b]) endloop - set s__Missiles__Coordinates_square[a]=dx - set s__Missiles__Coordinates_distance[a]=dy - set s__Missiles__Coordinates_angle[a]=Atan2(s__Missiles__Coordinates_y[b] - s__Missiles__Coordinates_y[a], s__Missiles__Coordinates_x[b] - s__Missiles__Coordinates_x[a]) - set s__Missiles__Coordinates_slope[a]=( s__Missiles__Coordinates_z[b] - s__Missiles__Coordinates_z[a] ) / dy - set s__Missiles__Coordinates_alpha[a]=Atan(s__Missiles__Coordinates_slope[a]) + set s__Missiles___Coordinates_square[a]=dx + set s__Missiles___Coordinates_distance[a]=dy + set s__Missiles___Coordinates_angle[a]=Atan2(s__Missiles___Coordinates_y[b] - s__Missiles___Coordinates_y[a], s__Missiles___Coordinates_x[b] - s__Missiles___Coordinates_x[a]) + set s__Missiles___Coordinates_slope[a]=( s__Missiles___Coordinates_z[b] - s__Missiles___Coordinates_z[a] ) / dy + set s__Missiles___Coordinates_alpha[a]=Atan(s__Missiles___Coordinates_slope[a]) // Set b. - if s__Missiles__Coordinates_ref[b] == a then - set s__Missiles__Coordinates_angle[b]=s__Missiles__Coordinates_angle[a] + bj_PI - set s__Missiles__Coordinates_distance[b]=dy - set s__Missiles__Coordinates_slope[b]=- s__Missiles__Coordinates_slope[a] - set s__Missiles__Coordinates_alpha[b]=- s__Missiles__Coordinates_alpha[a] - set s__Missiles__Coordinates_square[b]=dx + if s__Missiles___Coordinates_ref[b] == a then + set s__Missiles___Coordinates_angle[b]=s__Missiles___Coordinates_angle[a] + bj_PI + set s__Missiles___Coordinates_distance[b]=dy + set s__Missiles___Coordinates_slope[b]=- s__Missiles___Coordinates_slope[a] + set s__Missiles___Coordinates_alpha[b]=- s__Missiles___Coordinates_alpha[a] + set s__Missiles___Coordinates_square[b]=dx endif endfunction - function s__Missiles__Coordinates_link takes integer a,integer b returns nothing - set s__Missiles__Coordinates_ref[a]=b - set s__Missiles__Coordinates_ref[b]=a - call s__Missiles__Coordinates_math(a , b) + function s__Missiles___Coordinates_link takes integer a,integer b returns nothing + set s__Missiles___Coordinates_ref[a]=b + set s__Missiles___Coordinates_ref[b]=a + call s__Missiles___Coordinates_math(a , b) endfunction - function s__Missiles__Coordinates_move takes integer this,real toX,real toY,real toZ returns nothing - set s__Missiles__Coordinates_x[this]=toX - set s__Missiles__Coordinates_y[this]=toY - set s__Missiles__Coordinates_z[this]=toZ + Missiles__GetLocZ(toX , toY) - if s__Missiles__Coordinates_ref[this] != this then - call s__Missiles__Coordinates_math(this , s__Missiles__Coordinates_ref[this]) + function s__Missiles___Coordinates_move takes integer this,real toX,real toY,real toZ returns nothing + set s__Missiles___Coordinates_x[this]=toX + set s__Missiles___Coordinates_y[this]=toY + set s__Missiles___Coordinates_z[this]=toZ + Missiles___GetLocZ(toX , toY) + if s__Missiles___Coordinates_ref[this] != this then + call s__Missiles___Coordinates_math(this , s__Missiles___Coordinates_ref[this]) endif endfunction - function s__Missiles__Coordinates_destroy takes integer this returns nothing - call s__Missiles__Coordinates_deallocate(this) + function s__Missiles___Coordinates_destroy takes integer this returns nothing + call s__Missiles___Coordinates_deallocate(this) endfunction - function s__Missiles__Coordinates_create takes real x,real y,real z returns integer - local integer this= s__Missiles__Coordinates__allocate() - set s__Missiles__Coordinates_ref[this]=this - call s__Missiles__Coordinates_move(this,x , y , z) + function s__Missiles___Coordinates_create takes real x,real y,real z returns integer + local integer this= s__Missiles___Coordinates__allocate() + set s__Missiles___Coordinates_ref[this]=this + call s__Missiles___Coordinates_move(this,x , y , z) return this endfunction @@ -37863,13 +37833,13 @@ endfunction -//Implemented from module Missiles__Operators: +//Implemented from module Missiles___Operators: function s__Missiles__set_model takes integer this,string fx returns nothing call DestroyEffect(s__MissileEffect_effect[s__Missiles_effect[this]]) set s__MissileEffect_path[s__Missiles_effect[this]]=fx - set s__MissileEffect_effect[s__Missiles_effect[this]]=AddSpecialEffect(fx, s__Missiles__Coordinates_x[s__Missiles_origin[this]], s__Missiles__Coordinates_y[s__Missiles_origin[this]]) - call BlzSetSpecialEffectZ(s__MissileEffect_effect[s__Missiles_effect[this]], s__Missiles__Coordinates_z[s__Missiles_origin[this]]) + set s__MissileEffect_effect[s__Missiles_effect[this]]=AddSpecialEffect(fx, s__Missiles___Coordinates_x[s__Missiles_origin[this]], s__Missiles___Coordinates_y[s__Missiles_origin[this]]) + call BlzSetSpecialEffectZ(s__MissileEffect_effect[s__Missiles_effect[this]], s__Missiles___Coordinates_z[s__Missiles_origin[this]]) call BlzSetSpecialEffectYaw(s__MissileEffect_effect[s__Missiles_effect[this]], s__Missiles_cA[this]) endfunction @@ -37879,20 +37849,20 @@ endfunction function s__Missiles__set_curve takes integer this,real value returns nothing - set s__Missiles_open[this]=Tan(value * bj_DEGTORAD) * s__Missiles__Coordinates_distance[s__Missiles_origin[this]] + set s__Missiles_open[this]=Tan(value * bj_DEGTORAD) * s__Missiles___Coordinates_distance[s__Missiles_origin[this]] endfunction function s__Missiles__get_curve takes integer this returns real - return Atan(s__Missiles_open[this] / s__Missiles__Coordinates_distance[s__Missiles_origin[this]]) * bj_RADTODEG + return Atan(s__Missiles_open[this] / s__Missiles___Coordinates_distance[s__Missiles_origin[this]]) * bj_RADTODEG endfunction function s__Missiles__set_arc takes integer this,real value returns nothing - set s__Missiles_height[this]=Tan(value * bj_DEGTORAD) * s__Missiles__Coordinates_distance[s__Missiles_origin[this]] / 4 + set s__Missiles_height[this]=Tan(value * bj_DEGTORAD) * s__Missiles___Coordinates_distance[s__Missiles_origin[this]] / 4 endfunction function s__Missiles__get_arc takes integer this returns real - return Atan(4 * s__Missiles_height[this] / s__Missiles__Coordinates_distance[s__Missiles_origin[this]]) * bj_RADTODEG + return Atan(4 * s__Missiles_height[this] / s__Missiles___Coordinates_distance[s__Missiles_origin[this]]) * bj_RADTODEG endfunction @@ -37907,7 +37877,7 @@ endfunction function s__Missiles__set_speed takes integer this,real newspeed returns nothing - local real d= s__Missiles__Coordinates_distance[s__Missiles_origin[this]] + local real d= s__Missiles___Coordinates_distance[s__Missiles_origin[this]] local real s local real vel @@ -37917,8 +37887,8 @@ endfunction set s__Missiles_nextX[this]=s__Missiles_x[this] + vel * Cos(s__Missiles_cA[this]) set s__Missiles_nextY[this]=s__Missiles_y[this] + vel * Sin(s__Missiles_cA[this]) - if s__Missiles_height[this] != 0 or s__Missiles__Coordinates_slope[s__Missiles_origin[this]] != 0 then - set s__Missiles_nextZ[this]=4 * s__Missiles_height[this] * s * ( d - s ) / ( d * d ) + s__Missiles__Coordinates_slope[s__Missiles_origin[this]] * s + s__Missiles__Coordinates_z[s__Missiles_origin[this]] + if s__Missiles_height[this] != 0 or s__Missiles___Coordinates_slope[s__Missiles_origin[this]] != 0 then + set s__Missiles_nextZ[this]=4 * s__Missiles_height[this] * s * ( d - s ) / ( d * d ) + s__Missiles___Coordinates_slope[s__Missiles_origin[this]] * s + s__Missiles___Coordinates_z[s__Missiles_origin[this]] set s__Missiles_z[this]=s__Missiles_nextZ[this] endif endfunction @@ -37929,19 +37899,19 @@ endfunction function s__Missiles__set_duration takes integer this,real flightTime returns nothing - local real d= s__Missiles__Coordinates_distance[s__Missiles_origin[this]] + local real d= s__Missiles___Coordinates_distance[s__Missiles_origin[this]] local real s local real vel - set s__Missiles_veloc[this]=RMaxBJ(0.00000001, ( s__Missiles__Coordinates_distance[s__Missiles_origin[this]] - s__Missiles_travel[this] ) * Missiles_PERIOD / RMaxBJ(0.00000001, flightTime)) + set s__Missiles_veloc[this]=RMaxBJ(0.00000001, ( s__Missiles___Coordinates_distance[s__Missiles_origin[this]] - s__Missiles_travel[this] ) * Missiles_PERIOD / RMaxBJ(0.00000001, flightTime)) set s__Missiles_time[this]=flightTime set vel=s__Missiles_veloc[this] * s__Missiles_dilation set s=s__Missiles_travel[this] + vel set s__Missiles_nextX[this]=s__Missiles_x[this] + vel * Cos(s__Missiles_cA[this]) set s__Missiles_nextY[this]=s__Missiles_y[this] + vel * Sin(s__Missiles_cA[this]) - if s__Missiles_height[this] != 0 or s__Missiles__Coordinates_slope[s__Missiles_origin[this]] != 0 then - set s__Missiles_nextZ[this]=4 * s__Missiles_height[this] * s * ( d - s ) / ( d * d ) + s__Missiles__Coordinates_slope[s__Missiles_origin[this]] * s + s__Missiles__Coordinates_z[s__Missiles_origin[this]] + if s__Missiles_height[this] != 0 or s__Missiles___Coordinates_slope[s__Missiles_origin[this]] != 0 then + set s__Missiles_nextZ[this]=4 * s__Missiles_height[this] * s * ( d - s ) / ( d * d ) + s__Missiles___Coordinates_slope[s__Missiles_origin[this]] * s + s__Missiles___Coordinates_z[s__Missiles_origin[this]] set s__Missiles_z[this]=s__Missiles_nextZ[this] endif endfunction @@ -37957,12 +37927,12 @@ endfunction if s__Missiles_dummy[this] == null then if s__Missiles_owner[this] == null then if s__Missiles_source[this] != null then - set s__Missiles_dummy[this]=s__Missiles__Pool_retrieve(s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] , 0) + set s__Missiles_dummy[this]=s__Missiles___Pool_retrieve(s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] , 0) call SetUnitOwner(s__Missiles_dummy[this], GetOwningPlayer(s__Missiles_source[this]), false) call BlzSetUnitRealField(s__Missiles_dummy[this], UNIT_RF_SIGHT_RADIUS, sightRange) endif else - set s__Missiles_dummy[this]=s__Missiles__Pool_retrieve(s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] , 0) + set s__Missiles_dummy[this]=s__Missiles___Pool_retrieve(s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] , 0) call SetUnitOwner(s__Missiles_dummy[this], s__Missiles_owner[this], false) call BlzSetUnitRealField(s__Missiles_dummy[this], UNIT_RF_SIGHT_RADIUS, sightRange) endif @@ -38011,17 +37981,17 @@ endfunction function s__Missiles__get_animation takes integer this returns integer return (s__MissileEffect_animtype[(s__Missiles_effect[this])]) // INLINED!! endfunction -//Implemented from module Missiles__Methods: +//Implemented from module Missiles___Methods: function s__Missiles_bounce takes integer this returns nothing - call s__Missiles__Coordinates_move(s__Missiles_origin[this],s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] - Missiles__GetLocZ(s__Missiles_x[this] , s__Missiles_y[this])) + call s__Missiles___Coordinates_move(s__Missiles_origin[this],s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] - Missiles___GetLocZ(s__Missiles_x[this] , s__Missiles_y[this])) set s__Missiles_travel[this]=0 set s__Missiles_finished[this]=false endfunction function s__Missiles_deflect takes integer this,real tx,real ty,real tz returns nothing - local real locZ= Missiles__GetLocZ(s__Missiles_x[this] , s__Missiles_y[this]) + local real locZ= Missiles___GetLocZ(s__Missiles_x[this] , s__Missiles_y[this]) set s__Missiles_target[this]=null set s__Missiles_toZ[this]=tz @@ -38032,8 +38002,8 @@ endfunction set s__Missiles_nextZ[this]=s__Missiles_prevZ[this] endif - call s__Missiles__Coordinates_move(s__Missiles_impact[this],tx , ty , tz) - call s__Missiles__Coordinates_move(s__Missiles_origin[this],s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] - locZ) + call s__Missiles___Coordinates_move(s__Missiles_impact[this],tx , ty , tz) + call s__Missiles___Coordinates_move(s__Missiles_origin[this],s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this] - locZ) set s__Missiles_travel[this]=0 set s__Missiles_finished[this]=false @@ -38094,8 +38064,8 @@ endfunction call TimerStart(s__Missiles_timer, Missiles_PERIOD, true, function sc__Missiles_move) endif - if (st__Missiles__MissileEvents_onResume[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onResume(this) then + if (st__Missiles___MissileEvents_onResume[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onResume(this) then call sc__Missiles_terminate(this) else if s__Missiles_finished[this] then @@ -38124,11 +38094,11 @@ endfunction if not HaveSavedBoolean(s__Missiles_table, this, GetHandleId(d)) then if s__Missiles_collideZ[this] then - set dz=Missiles__GetLocZ(GetWidgetX(d) , GetWidgetY(d)) + set dz=Missiles___GetLocZ(GetWidgetX(d) , GetWidgetY(d)) set tz=GetDestructableOccluderHeight(d) if dz + tz >= s__Missiles_z[this] - s__Missiles_collision[this] and dz <= s__Missiles_z[this] + s__Missiles_collision[this] then call SaveBoolean(s__Missiles_table, this, GetHandleId(d), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onDestructable(this,d) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onDestructable(this,d) then set d=null call sc__Missiles_terminate(this) return @@ -38136,7 +38106,7 @@ endfunction endif else call SaveBoolean(s__Missiles_table, this, GetHandleId(d), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onDestructable(this,d) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onDestructable(this,d) then set d=null call sc__Missiles_terminate(this) return @@ -38155,10 +38125,10 @@ endfunction if not HaveSavedBoolean(s__Missiles_table, this, GetHandleId(i)) then if s__Missiles_collideZ[this] then - set dz=Missiles__GetLocZ(GetItemX(i) , GetItemY(i)) - if dz + Missiles__ITEM_SIZE >= s__Missiles_z[this] - s__Missiles_collision[this] and dz <= s__Missiles_z[this] + s__Missiles_collision[this] then + set dz=Missiles___GetLocZ(GetItemX(i) , GetItemY(i)) + if dz + Missiles___ITEM_SIZE >= s__Missiles_z[this] - s__Missiles_collision[this] and dz <= s__Missiles_z[this] + s__Missiles_collision[this] then call SaveBoolean(s__Missiles_table, this, GetHandleId(i), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onItem(this,i) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onItem(this,i) then set i=null call sc__Missiles_terminate(this) return @@ -38166,7 +38136,7 @@ endfunction endif else call SaveBoolean(s__Missiles_table, this, GetHandleId(i), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onItem(this,i) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onItem(this,i) then set i=null call sc__Missiles_terminate(this) return @@ -38192,12 +38162,12 @@ endfunction set s__Missiles_pkey[this]=- 1 endif - if (st__Missiles__MissileEvents_onRemove[si__Missiles__MissileEvents_type[this]]!=null) then - call sc__Missiles__MissileEvents_onRemove(this) + if (st__Missiles___MissileEvents_onRemove[si__Missiles___MissileEvents_type[this]]!=null) then + call sc__Missiles___MissileEvents_onRemove(this) endif if s__Missiles_dummy[this] != null then - call s__Missiles__Pool_recycle(s__Missiles_dummy[this]) + call s__Missiles___Pool_recycle(s__Missiles_dummy[this]) endif set aux=s__Missiles_collection[s__Missiles_count] @@ -38206,8 +38176,8 @@ endfunction set s__Missiles_count=s__Missiles_count - 1 set s__Missiles_index[this]=- 1 - call s__Missiles__Coordinates_deallocate((s__Missiles_origin[this])) // INLINED!! - call s__Missiles__Coordinates_deallocate((s__Missiles_impact[this])) // INLINED!! + call s__Missiles___Coordinates_deallocate((s__Missiles_origin[this])) // INLINED!! + call s__Missiles___Coordinates_deallocate((s__Missiles_impact[this])) // INLINED!! call s__MissileEffect_destroy(s__Missiles_effect[this]) call sc__Missiles_reset(this) call FlushChildHashtable(s__Missiles_table, this) @@ -38245,18 +38215,18 @@ endfunction function s__Missiles_remove takes integer this,integer i returns integer if s__Missiles_paused[this] then -//Implemented from module Missiles__OnPause: +//Implemented from module Missiles___OnPause: set s__Missiles_pid=s__Missiles_pid + 1 set s__Missiles_pkey[this]=s__Missiles_pid set s__Missiles_frozen[s__Missiles_pid]=this - if (st__Missiles__MissileEvents_onPause[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onPause(this) then + if (st__Missiles___MissileEvents_onPause[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onPause(this) then call s__Missiles_terminate(this) endif endif else -//Implemented from module Missiles__OnRemove: +//Implemented from module Missiles___OnRemove: endif set s__Missiles_missiles[i]=s__Missiles_missiles[s__Missiles_id] @@ -38273,7 +38243,7 @@ endfunction endif if not s__Missiles_allocated[this] then - call sc__Missiles__MissileEvents_deallocate(this) + call sc__Missiles___MissileEvents_deallocate(this) endif return i - 1 @@ -38310,33 +38280,33 @@ endfunction set this=s__Missiles_missiles[i] set s__Missiles_temp=this if s__Missiles_allocated[this] and not s__Missiles_paused[this] then -//Implemented from module Missiles__OnHit: +//Implemented from module Missiles___OnHit: set o=s__Missiles_origin[this] set h=s__Missiles_height[this] set c=s__Missiles_open[this] - set d=s__Missiles__Coordinates_distance[o] + set d=s__Missiles___Coordinates_distance[o] - if (st__Missiles__MissileEvents_onHit[si__Missiles__MissileEvents_type[this]]!=null) then + if (st__Missiles___MissileEvents_onHit[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then - call GroupEnumUnitsInRange(s__Missiles_group, s__Missiles_x[this], s__Missiles_y[this], s__Missiles_collision[this] + Missiles__COLLISION_SIZE, null) + call GroupEnumUnitsInRange(s__Missiles_group, s__Missiles_x[this], s__Missiles_y[this], s__Missiles_collision[this] + Missiles___COLLISION_SIZE, null) loop set u=FirstOfGroup(s__Missiles_group) exitwhen u == null if not HaveSavedBoolean(s__Missiles_table, this, GetHandleId(u)) then if IsUnitInRangeXY(u, s__Missiles_x[this], s__Missiles_y[this], s__Missiles_collision[this]) then if s__Missiles_collideZ[this] then - set dx=Missiles__GetLocZ(GetUnitX(u) , GetUnitY(u)) + GetUnitFlyHeight(u) + set dx=Missiles___GetLocZ(GetUnitX(u) , GetUnitY(u)) + GetUnitFlyHeight(u) set dy=BlzGetUnitCollisionSize(u) if dx + dy >= s__Missiles_z[this] - s__Missiles_collision[this] and dx <= s__Missiles_z[this] + s__Missiles_collision[this] then call SaveBoolean(s__Missiles_table, this, GetHandleId(u), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onHit(this,u) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onHit(this,u) then call s__Missiles_terminate(this) exitwhen true endif endif else call SaveBoolean(s__Missiles_table, this, GetHandleId(u), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onHit(this,u) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onHit(this,u) then call s__Missiles_terminate(this) exitwhen true endif @@ -38347,8 +38317,8 @@ endfunction endloop endif endif -//Implemented from module Missiles__OnMissile: - if (st__Missiles__MissileEvents_onMissile[si__Missiles__MissileEvents_type[this]]!=null) then +//Implemented from module Missiles___OnMissile: + if (st__Missiles___MissileEvents_onMissile[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then set k=0 loop @@ -38360,7 +38330,7 @@ endfunction set dy=s__Missiles_y[missile] - s__Missiles_y[this] if SquareRoot(dx * dx + dy * dy) <= s__Missiles_collision[this] then call SaveBoolean(s__Missiles_table, this, missile, true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onMissile(this,missile) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onMissile(this,missile) then call s__Missiles_terminate(this) exitwhen true endif @@ -38371,67 +38341,67 @@ endfunction endloop endif endif -//Implemented from module Missiles__OnDestructable: - if (st__Missiles__MissileEvents_onDestructable[si__Missiles__MissileEvents_type[this]]!=null) then +//Implemented from module Missiles___OnDestructable: + if (st__Missiles___MissileEvents_onDestructable[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then set dx=s__Missiles_collision[this] call SetRect(s__Missiles_rect, s__Missiles_x[this] - dx, s__Missiles_y[this] - dx, s__Missiles_x[this] + dx, s__Missiles_y[this] + dx) call EnumDestructablesInRect(s__Missiles_rect, null, function s__Missiles_onDest) endif endif -//Implemented from module Missiles__OnItem: - if (st__Missiles__MissileEvents_onItem[si__Missiles__MissileEvents_type[this]]!=null) then +//Implemented from module Missiles___OnItem: + if (st__Missiles___MissileEvents_onItem[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then set dx=s__Missiles_collision[this] call SetRect(s__Missiles_rect, s__Missiles_x[this] - dx, s__Missiles_y[this] - dx, s__Missiles_x[this] + dx, s__Missiles_y[this] + dx) call EnumItemsInRect(s__Missiles_rect, null, function s__Missiles_onItems) endif endif -//Implemented from module Missiles__OnCliff: - if (st__Missiles__MissileEvents_onCliff[si__Missiles__MissileEvents_type[this]]!=null) then +//Implemented from module Missiles___OnCliff: + if (st__Missiles___MissileEvents_onCliff[si__Missiles___MissileEvents_type[this]]!=null) then set dx=GetTerrainCliffLevel(s__Missiles_nextX[this], s__Missiles_nextY[this]) set dy=GetTerrainCliffLevel(s__Missiles_x[this], s__Missiles_y[this]) if dy < dx and s__Missiles_z[this] < ( dx - (GetTerrainCliffLevel(s__WorldBounds_maxX, s__WorldBounds_maxY)) ) * bj_CLIFFHEIGHT then // INLINED!! - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onCliff(this) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onCliff(this) then call s__Missiles_terminate(this) endif endif endif -//Implemented from module Missiles__OnTerrain: - if (st__Missiles__MissileEvents_onTerrain[si__Missiles__MissileEvents_type[this]]!=null) then - if Missiles__GetLocZ(s__Missiles_x[this] , s__Missiles_y[this]) > s__Missiles_z[this] then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onTerrain(this) then +//Implemented from module Missiles___OnTerrain: + if (st__Missiles___MissileEvents_onTerrain[si__Missiles___MissileEvents_type[this]]!=null) then + if Missiles___GetLocZ(s__Missiles_x[this] , s__Missiles_y[this]) > s__Missiles_z[this] then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onTerrain(this) then call s__Missiles_terminate(this) endif endif endif -//Implemented from module Missiles__OnTileset: - if (st__Missiles__MissileEvents_onTileset[si__Missiles__MissileEvents_type[this]]!=null) then +//Implemented from module Missiles___OnTileset: + if (st__Missiles___MissileEvents_onTileset[si__Missiles___MissileEvents_type[this]]!=null) then set k=GetTerrainType(s__Missiles_x[this], s__Missiles_y[this]) if k != s__Missiles_tileset[this] then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onTileset(this,k) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onTileset(this,k) then call s__Missiles_terminate(this) endif endif set s__Missiles_tileset[this]=k endif -//Implemented from module Missiles__OnPeriod: - if (st__Missiles__MissileEvents_onPeriod[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onPeriod(this) then +//Implemented from module Missiles___OnPeriod: + if (st__Missiles___MissileEvents_onPeriod[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onPeriod(this) then call s__Missiles_terminate(this) endif endif -//Implemented from module Missiles__OnOrient: +//Implemented from module Missiles___OnOrient: // Homing or not set u=s__Missiles_target[this] if u != null and GetUnitTypeId(u) != 0 then - call s__Missiles__Coordinates_move(s__Missiles_impact[this],GetUnitX(u) , GetUnitY(u) , GetUnitFlyHeight(u) + s__Missiles_toZ[this]) - set dx=s__Missiles__Coordinates_x[s__Missiles_impact[this]] - s__Missiles_nextX[this] - set dy=s__Missiles__Coordinates_y[s__Missiles_impact[this]] - s__Missiles_nextY[this] + call s__Missiles___Coordinates_move(s__Missiles_impact[this],GetUnitX(u) , GetUnitY(u) , GetUnitFlyHeight(u) + s__Missiles_toZ[this]) + set dx=s__Missiles___Coordinates_x[s__Missiles_impact[this]] - s__Missiles_nextX[this] + set dy=s__Missiles___Coordinates_y[s__Missiles_impact[this]] - s__Missiles_nextY[this] set a=Atan2(dy, dx) - set s__Missiles_travel[this]=s__Missiles__Coordinates_distance[o] - SquareRoot(dx * dx + dy * dy) + set s__Missiles_travel[this]=s__Missiles___Coordinates_distance[o] - SquareRoot(dx * dx + dy * dy) else - set a=s__Missiles__Coordinates_angle[o] + set a=s__Missiles___Coordinates_angle[o] set s__Missiles_target[this]=null endif @@ -38451,7 +38421,7 @@ endfunction set s=s__Missiles_travel[this] + vel set s__Missiles_veloc[this]=s__Missiles_veloc[this] + s__Missiles_acceleration[this] set s__Missiles_travel[this]=s - set pitch=s__Missiles__Coordinates_alpha[o] + set pitch=s__Missiles___Coordinates_alpha[o] set s__Missiles_prevX[this]=s__Missiles_x[this] set s__Missiles_prevY[this]=s__Missiles_y[this] set s__Missiles_prevZ[this]=s__Missiles_z[this] @@ -38462,8 +38432,8 @@ endfunction set s__Missiles_nextY[this]=s__Missiles_y[this] + vel * Sin(yaw) // arc calculation - if h != 0 or s__Missiles__Coordinates_slope[o] != 0 then - set s__Missiles_nextZ[this]=4 * h * s * ( d - s ) / ( d * d ) + s__Missiles__Coordinates_slope[o] * s + s__Missiles__Coordinates_z[o] + if h != 0 or s__Missiles___Coordinates_slope[o] != 0 then + set s__Missiles_nextZ[this]=4 * h * s * ( d - s ) / ( d * d ) + s__Missiles___Coordinates_slope[o] * s + s__Missiles___Coordinates_z[o] set pitch=pitch - Atan(( ( 4 * h ) * ( 2 * s - d ) ) / ( d * d )) endif @@ -38475,11 +38445,11 @@ endfunction set s__Missiles_y[this]=s__Missiles_y[this] + dx * Sin(a) set yaw=yaw + Atan(- ( ( 4 * c ) * ( 2 * s - d ) ) / ( d * d )) endif -//Implemented from module Missiles__OnFinish: +//Implemented from module Missiles___OnFinish: if s >= d - 0.0001 then set s__Missiles_finished[this]=true - if (st__Missiles__MissileEvents_onFinish[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onFinish(this) then + if (st__Missiles___MissileEvents_onFinish[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onFinish(this) then call s__Missiles_terminate(this) else if s__Missiles_travel[this] > 0 and not s__Missiles_paused[this] then @@ -38496,10 +38466,10 @@ endfunction call s__MissileEffect_orient(s__Missiles_effect[this],yaw , - pitch , Atan2(c, h)) endif endif -//Implemented from module Missiles__OnBoundaries: +//Implemented from module Missiles___OnBoundaries: if not s__MissileEffect_move(s__Missiles_effect[this],s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this]) then - if (st__Missiles__MissileEvents_onBoundaries[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onBoundaries(this) then + if (st__Missiles___MissileEvents_onBoundaries[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onBoundaries(this) then call s__Missiles_terminate(this) endif endif @@ -38552,21 +38522,21 @@ endfunction local integer this= s__Missiles__allocate() call s__Missiles_reset(this) - set s__Missiles_origin[this]=s__Missiles__Coordinates_create(x , y , z) - set s__Missiles_impact[this]=s__Missiles__Coordinates_create(toX , toY , toZ) - set s__Missiles_effect[this]=s__MissileEffect_create(x , y , s__Missiles__Coordinates_z[s__Missiles_origin[this]]) - call s__Missiles__Coordinates_link(s__Missiles_origin[this] , s__Missiles_impact[this]) + set s__Missiles_origin[this]=s__Missiles___Coordinates_create(x , y , z) + set s__Missiles_impact[this]=s__Missiles___Coordinates_create(toX , toY , toZ) + set s__Missiles_effect[this]=s__MissileEffect_create(x , y , s__Missiles___Coordinates_z[s__Missiles_origin[this]]) + call s__Missiles___Coordinates_link(s__Missiles_origin[this] , s__Missiles_impact[this]) set s__Missiles_allocated[this]=true - set s__Missiles_cA[this]=s__Missiles__Coordinates_angle[s__Missiles_origin[this]] + set s__Missiles_cA[this]=s__Missiles___Coordinates_angle[s__Missiles_origin[this]] set s__Missiles_x[this]=x set s__Missiles_y[this]=y - set s__Missiles_z[this]=s__Missiles__Coordinates_z[s__Missiles_impact[this]] + set s__Missiles_z[this]=s__Missiles___Coordinates_z[s__Missiles_impact[this]] set s__Missiles_prevX[this]=x set s__Missiles_prevY[this]=y - set s__Missiles_prevZ[this]=s__Missiles__Coordinates_z[s__Missiles_impact[this]] + set s__Missiles_prevZ[this]=s__Missiles___Coordinates_z[s__Missiles_impact[this]] set s__Missiles_nextX[this]=x set s__Missiles_nextY[this]=y - set s__Missiles_nextZ[this]=s__Missiles__Coordinates_z[s__Missiles_impact[this]] + set s__Missiles_nextZ[this]=s__Missiles___Coordinates_z[s__Missiles_impact[this]] set s__Missiles_toZ[this]=toZ return this @@ -39547,7 +39517,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) @@ -39566,11 +39536,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 @@ -39584,14 +39554,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 @@ -39612,11 +39582,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 @@ -39653,57 +39623,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 ) @@ -39727,7 +39697,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 @@ -39737,7 +39707,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 @@ -39757,8 +39727,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 @@ -39771,16 +39741,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 @@ -39796,126 +39766,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 @@ -39928,13 +39898,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 @@ -39943,79 +39913,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 @@ -41350,36 +41320,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 @@ -41391,9 +41361,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 @@ -41401,29 +41371,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!! @@ -41434,7 +41404,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!! @@ -41442,27 +41412,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() @@ -41470,19 +41440,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 @@ -41567,17 +41537,17 @@ endfunction //library UnitEventEx: //ignored textmacro command: DEFINE_LIST("", "UEExList", "unit") -function UnitEventEx__FireEvent takes integer ev,unit u,unit other returns nothing +function UnitEventEx___FireEvent takes integer ev,unit u,unit other returns nothing local integer playerId= GetPlayerId(GetOwningPlayer(u)) local integer handleId= GetHandleId(u) local integer id= (GetUnitUserData((u))) // INLINED!! - local unit prevUnit= UnitEventEx__eventUnit - local unit prevOther= UnitEventEx__eventOther - local integer prevType= UnitEventEx__eventPreType + local unit prevUnit= UnitEventEx___eventUnit + local unit prevOther= UnitEventEx___eventOther + local integer prevType= UnitEventEx___eventPreType - set UnitEventEx__eventUnit=u - set UnitEventEx__eventOther=other - set UnitEventEx__eventPreType=UnitEventEx__PreTransformType[id] + set UnitEventEx___eventUnit=u + set UnitEventEx___eventOther=other + set UnitEventEx___eventPreType=UnitEventEx___PreTransformType[id] call TriggerEvaluate((GetIndexNativeEventTrigger(bj_MAX_PLAYER_SLOTS , (ev)))) // INLINED!! if IsNativeEventRegistered(playerId , ev) then @@ -41586,9 +41556,9 @@ function UnitEventEx__FireEvent takes integer ev,unit u,unit other returns nothi call TriggerEvaluate(GetIndexNativeEventTrigger(handleId , ev)) endif - set UnitEventEx__eventUnit=prevUnit - set UnitEventEx__eventOther=prevOther - set UnitEventEx__eventPreType=prevType + set UnitEventEx___eventUnit=prevUnit + set UnitEventEx___eventOther=prevOther + set UnitEventEx___eventPreType=prevType set prevUnit=null set prevOther=null @@ -41598,52 +41568,52 @@ endfunction - function s__UnitEventEx__Cargo_delete takes integer transport_id returns nothing + function s__UnitEventEx___Cargo_delete takes integer transport_id returns nothing - call DestroyGroup(UnitEventEx__CargoGroup[transport_id]) + call DestroyGroup(UnitEventEx___CargoGroup[transport_id]) endfunction - function s__UnitEventEx__Cargo_remove takes unit u,unit transport returns nothing + function s__UnitEventEx___Cargo_remove takes unit u,unit transport returns nothing local integer transport_id= (GetUnitUserData((transport))) // INLINED!! - call GroupRemoveUnit(UnitEventEx__CargoGroup[transport_id], u) + call GroupRemoveUnit(UnitEventEx___CargoGroup[transport_id], u) - set UnitEventEx__Transporter[(GetUnitUserData((u)))]=null // INLINED!! - call UnitEventEx__FireEvent(EVENT_ON_CARGO_UNLOAD , u , transport) + set UnitEventEx___Transporter[(GetUnitUserData((u)))]=null // INLINED!! + call UnitEventEx___FireEvent(EVENT_ON_CARGO_UNLOAD , u , transport) endfunction - function s__UnitEventEx__Cargo_add takes unit u,unit transport returns nothing + function s__UnitEventEx___Cargo_add takes unit u,unit transport returns nothing local integer transport_id= (GetUnitUserData((transport))) // INLINED!! - call GroupAddUnit(UnitEventEx__CargoGroup[transport_id], u) + call GroupAddUnit(UnitEventEx___CargoGroup[transport_id], u) - set UnitEventEx__Transporter[(GetUnitUserData((u)))]=transport // INLINED!! - call UnitEventEx__FireEvent(EVENT_ON_CARGO_LOAD , u , transport) + set UnitEventEx___Transporter[(GetUnitUserData((u)))]=transport // INLINED!! + call UnitEventEx___FireEvent(EVENT_ON_CARGO_LOAD , u , transport) endfunction - function s__UnitEventEx__Cargo_size takes integer transport_id returns integer + function s__UnitEventEx___Cargo_size takes integer transport_id returns integer - return CountUnitsInGroup(UnitEventEx__CargoGroup[transport_id]) + return CountUnitsInGroup(UnitEventEx___CargoGroup[transport_id]) endfunction - function s__UnitEventEx__Cargo_exists takes integer transport_id returns boolean + function s__UnitEventEx___Cargo_exists takes integer transport_id returns boolean - return ( UnitEventEx__CargoGroup[transport_id] != null ) + return ( UnitEventEx___CargoGroup[transport_id] != null ) endfunction - function s__UnitEventEx__Cargo_copyGroup takes integer transport_id returns group + function s__UnitEventEx___Cargo_copyGroup takes integer transport_id returns group local group g= CreateGroup() @@ -41654,7 +41624,7 @@ endfunction //call BlzGroupAddGroupFast(g, CargoGroup[transport_id]) - call GroupAddGroup(UnitEventEx__CargoGroup[transport_id], g) + call GroupAddGroup(UnitEventEx___CargoGroup[transport_id], g) return g endfunction @@ -41671,33 +41641,33 @@ endfunction - function s__UnitEventEx__Cargo_create takes integer transport_id returns integer + function s__UnitEventEx___Cargo_create takes integer transport_id returns integer - set UnitEventEx__CargoGroup[transport_id]=CreateGroup() + set UnitEventEx___CargoGroup[transport_id]=CreateGroup() return 0 endfunction // these functions are here so that they don't call functions below them. function GetEventUnit takes nothing returns unit - return UnitEventEx__eventUnit + return UnitEventEx___eventUnit endfunction function GetCargoUnit takes nothing returns unit - return UnitEventEx__eventOther + return UnitEventEx___eventOther endfunction function GetCargoSize takes unit transport returns integer - return (CountUnitsInGroup(UnitEventEx__CargoGroup[((GetUnitUserData((transport))))])) // INLINED!! + return (CountUnitsInGroup(UnitEventEx___CargoGroup[((GetUnitUserData((transport))))])) // INLINED!! endfunction function IsUnitInTransporter takes unit whichUnit returns boolean - return UnitEventEx__Transporter[(GetUnitUserData((whichUnit)))] != null // INLINED!! + return UnitEventEx___Transporter[(GetUnitUserData((whichUnit)))] != null // INLINED!! endfunction function GetUnitTransporter takes unit whichUnit returns unit - return UnitEventEx__Transporter[(GetUnitUserData((whichUnit)))] // INLINED!! + return UnitEventEx___Transporter[(GetUnitUserData((whichUnit)))] // INLINED!! endfunction function GetCargoTransportedUnitGroup takes unit transporter returns group - return s__UnitEventEx__Cargo_copyGroup((GetUnitUserData((transporter)))) // INLINED!! + return s__UnitEventEx___Cargo_copyGroup((GetUnitUserData((transporter)))) // INLINED!! endfunction @@ -41705,26 +41675,26 @@ endfunction -//Implemented from module UnitEventEx__UnitEventExCore: +//Implemented from module UnitEventEx___UnitEventExCore: - function s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___afterIndex takes nothing returns nothing - local integer i= UnitEventEx__Stack + function s__UnitEventEx___UnitEventEx_UnitEventEx___UnitEventExCore__afterIndex takes nothing returns nothing + local integer i= UnitEventEx___Stack local integer id local unit u loop exitwhen i < 0 - set u=UnitEventEx__IndexedUnit[i] + set u=UnitEventEx___IndexedUnit[i] set id=(GetUnitUserData((u))) // INLINED!! - if UnitEventEx__IsNew[id] then - set UnitEventEx__IsNew[id]=false + if UnitEventEx___IsNew[id] then + set UnitEventEx___IsNew[id]=false - elseif UnitEventEx__IsTransforming[id] then + elseif UnitEventEx___IsTransforming[id] then @@ -41734,48 +41704,48 @@ endfunction - elseif UnitEventEx__IsAlive[id] then + elseif UnitEventEx___IsAlive[id] then - set UnitEventEx__IsReincarnating[id]=true - set UnitEventEx__IsAlive[id]=false - call UnitEventEx__FireEvent(EVENT_ON_REINCARNATION_START , u , null) + set UnitEventEx___IsReincarnating[id]=true + set UnitEventEx___IsAlive[id]=false + call UnitEventEx___FireEvent(EVENT_ON_REINCARNATION_START , u , null) endif - set UnitEventEx__IndexedUnit[i]=null + set UnitEventEx___IndexedUnit[i]=null set i=i - 1 endloop - set UnitEventEx__Stack=- 1 + set UnitEventEx___Stack=- 1 set u=null endfunction - 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) + 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) 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!! + local integer cargo_id= (GetUnitUserData((UnitEventEx___CargoUnit[id]))) // INLINED!! - call s__UnitEventEx__Cargo_remove(u , UnitEventEx__CargoUnit[id]) + call s__UnitEventEx___Cargo_remove(u , UnitEventEx___CargoUnit[id]) - if not IsUnitLoaded(u) or not UnitAlive(UnitEventEx__CargoUnit[id]) then - set UnitEventEx__CargoUnit[id]=null + if not IsUnitLoaded(u) or not UnitAlive(UnitEventEx___CargoUnit[id]) then + set UnitEventEx___CargoUnit[id]=null endif 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!! @@ -41792,8 +41762,8 @@ endfunction if GetIssuedOrderId() == 851972 then // order stop // 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) + if UnitEventEx___CargoUnit[id] != null and not IsUnitLoaded(u) or UnitAlive(u) then + call s__UnitEventEx___UnitEventEx_UnitEventEx___UnitEventExCore__unload(u) endif set u=null @@ -41876,19 +41846,19 @@ 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!! // This checks if the unit has been indexed. if id > 0 then - set UnitEventEx__IsAlive[id]=false + set UnitEventEx___IsAlive[id]=false endif - if UnitEventEx__CargoUnit[id] != null then - call UnitEventEx__FireEvent(EVENT_ON_CARGO_UNLOAD , u , UnitEventEx__CargoUnit[id]) - set UnitEventEx__CargoUnit[id]=null + if UnitEventEx___CargoUnit[id] != null then + call UnitEventEx___FireEvent(EVENT_ON_CARGO_UNLOAD , u , UnitEventEx___CargoUnit[id]) + set UnitEventEx___CargoUnit[id]=null endif @@ -41897,14 +41867,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) + if UnitEventEx___CargoUnit[id] != null then + call s__UnitEventEx___UnitEventEx_UnitEventEx___UnitEventExCore__unload(u) endif @@ -41917,36 +41887,36 @@ endfunction call SetUnitX(u, s__WorldBounds_maxX) call SetUnitY(u, s__WorldBounds_maxY) else - call SetUnitX(u, UnitEventEx__MaxX) - call SetUnitY(u, UnitEventEx__MaxY) + call SetUnitX(u, UnitEventEx___MaxX) + call SetUnitY(u, UnitEventEx___MaxY) endif endif - set UnitEventEx__CargoUnit[id]=GetTransportUnit() - set cargo_id=(GetUnitUserData((UnitEventEx__CargoUnit[id]))) // INLINED!! + set UnitEventEx___CargoUnit[id]=GetTransportUnit() + set cargo_id=(GetUnitUserData((UnitEventEx___CargoUnit[id]))) // INLINED!! - if not (UnitEventEx__CargoGroup[(cargo_id)] != null) then // INLINED!! - call s__UnitEventEx__Cargo_create(cargo_id) + if not (UnitEventEx___CargoGroup[(cargo_id)] != null) then // INLINED!! + call s__UnitEventEx___Cargo_create(cargo_id) endif - call s__UnitEventEx__Cargo_add(u , UnitEventEx__CargoUnit[id]) + call s__UnitEventEx___Cargo_add(u , UnitEventEx___CargoUnit[id]) set u=null 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!! + local integer cargo_id= (GetUnitUserData((UnitEventEx___CargoUnit[id]))) // INLINED!! // onEnter occurs AFTER onIndex // 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) + if not IsUnitLoaded(u) and UnitEventEx___CargoUnit[id] != null then + call s__UnitEventEx___UnitEventEx_UnitEventEx___UnitEventExCore__unload(u) endif endif @@ -41955,13 +41925,13 @@ 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!! // onIndex occurs BEFORE onEnter - set UnitEventEx__IsNew[id]=true + set UnitEventEx___IsNew[id]=true @@ -41974,32 +41944,32 @@ endfunction if UnitAlive(u) then - set UnitEventEx__IsAlive[id]=true + set UnitEventEx___IsAlive[id]=true else - set UnitEventEx__IsAlive[id]=false + set UnitEventEx___IsAlive[id]=false 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!! - if (UnitEventEx__CargoGroup[(id)] != null) then // INLINED!! - call DestroyGroup(UnitEventEx__CargoGroup[(id)]) // INLINED!! + if (UnitEventEx___CargoGroup[(id)] != null) then // INLINED!! + call DestroyGroup(UnitEventEx___CargoGroup[(id)]) // INLINED!! endif set u=null 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 @@ -42020,8 +41990,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) @@ -42034,16 +42004,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) @@ -42055,15 +42025,15 @@ 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 - set UnitEventEx__rezCheck=false + function s__UnitEventEx___UnitEventEx_UnitEventEx___UnitEventExCore__resurrectionTimer takes nothing returns nothing + set UnitEventEx___rezCheck=false call DestroyTimer(GetExpiredTimer()) endfunction @@ -43030,8 +43000,8 @@ endfunction // Returns the terrain Z value (Desync safe) function GetLocZ takes real x,real y returns real - call MoveLocation(Utilities__LOCZ, x, y) - return GetLocationZ(Utilities__LOCZ) + call MoveLocation(Utilities___LOCZ, x, y) + return GetLocationZ(Utilities___LOCZ) endfunction // Similar to GetUnitX and GetUnitY but for Z axis @@ -43120,7 +43090,7 @@ endfunction local integer i= 0 local integer size= BlzGroupGetSize(g) - set Utilities__bj_closestUnitGroup=null + set Utilities___bj_closestUnitGroup=null loop exitwhen i == size set u=BlzGroupUnitAt(g, i) @@ -43129,14 +43099,14 @@ endfunction set dy=GetUnitY(u) - y if ( dx * dx + dy * dy ) / 100000 < md then - set Utilities__bj_closestUnitGroup=u + set Utilities___bj_closestUnitGroup=u set md=( dx * dx + dy * dy ) / 100000 endif endif set i=i + 1 endloop - return Utilities__bj_closestUnitGroup + return Utilities___bj_closestUnitGroup endfunction // Removes a destructable after a period of time @@ -43381,7 +43351,7 @@ endfunction local real dx local real dy - set Utilities__bj_closestUnitGroup=null + set Utilities___bj_closestUnitGroup=null call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, e) loop @@ -43392,7 +43362,7 @@ endfunction set dy=GetUnitY(u) - y if ( dx * dx + dy * dy ) / 100000 < md then - set Utilities__bj_closestUnitGroup=u + set Utilities___bj_closestUnitGroup=u set md=( dx * dx + dy * dy ) / 100000 endif endif @@ -43402,7 +43372,7 @@ endfunction call h__DestroyBoolExpr(e) set g=null - return Utilities__bj_closestUnitGroup + return Utilities___bj_closestUnitGroup endfunction // Creates a chain lightning with the specified ligihtning effect with the amount of bounces @@ -43677,7 +43647,7 @@ endfunction function s__ResetCooldown_onExpire takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + local integer this= (LoadInteger(TimerUtils___ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! call BlzEndUnitAbilityCooldown(s__ResetCooldown_unit[this], s__ResetCooldown_ability[this]) call ReleaseTimer(s__ResetCooldown_timer[this]) @@ -43702,7 +43672,7 @@ endfunction function s__TimedAbility_remove takes integer this,integer i returns integer call UnitRemoveAbility(s__TimedAbility_unit[this], s__TimedAbility_ability[this]) - call RemoveSavedInteger(Utilities__table, GetHandleId(s__TimedAbility_unit[this]), s__TimedAbility_ability[this]) + call RemoveSavedInteger(Utilities___table, GetHandleId(s__TimedAbility_unit[this]), s__TimedAbility_ability[this]) set s__TimedAbility_array[i]=s__TimedAbility_array[s__TimedAbility_key] set s__TimedAbility_key=s__TimedAbility_key - 1 @@ -43735,7 +43705,7 @@ endfunction function s__TimedAbility_add takes unit u,integer id,real duration,integer level,boolean hide returns nothing - local integer this= LoadInteger(Utilities__table, GetHandleId(u), id) + local integer this= LoadInteger(Utilities___table, GetHandleId(u), id) if this == 0 then set this=s__TimedAbility__allocate() @@ -43744,7 +43714,7 @@ endfunction set s__TimedAbility_key=s__TimedAbility_key + 1 set s__TimedAbility_array[s__TimedAbility_key]=this - call SaveInteger(Utilities__table, GetHandleId(s__TimedAbility_unit[this]), s__TimedAbility_ability[this], this) + call SaveInteger(Utilities___table, GetHandleId(s__TimedAbility_unit[this]), s__TimedAbility_ability[this], this) if s__TimedAbility_key == 0 then call TimerStart(s__TimedAbility_timer, 0.1, true, function s__TimedAbility_onPeriod) @@ -43764,7 +43734,7 @@ endfunction function s__EffectSpam_onPeriod takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + local integer this= (LoadInteger(TimerUtils___ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! if s__EffectSpam_i[this] > 0 then if s__EffectSpam_unit[this] == null then @@ -43819,7 +43789,7 @@ endfunction endfunction function s__ChainLightning_onPeriod takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + local integer this= (LoadInteger(TimerUtils___ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! call DestroyGroup(s__ChainLightning_group[this]) if s__ChainLightning_bounces[this] > 0 then @@ -43936,7 +43906,7 @@ call s__lightningTimed_create((AddLightningEx(lightningType, true, GetUnitX(sour endfunction function s__DummyPool_onExpire takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + local integer this= (LoadInteger(TimerUtils___ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! call s__DummyPool_recycle(s__DummyPool_unit[this]) call ReleaseTimer(s__DummyPool_timer[this]) @@ -44068,7 +44038,7 @@ call s__lightningTimed_create((AddLightningEx(lightningType, true, GetUnitX(sour function s__AbilityCooldown_onExpire takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + local integer this= (LoadInteger(TimerUtils___ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! call BlzStartUnitAbilityCooldown(s__AbilityCooldown_unit[this], s__AbilityCooldown_ability[this], s__AbilityCooldown_newCd[this]) call ReleaseTimer(s__AbilityCooldown_timer[this]) @@ -44143,7 +44113,7 @@ call s__lightningTimed_create((AddLightningEx(lightningType, true, GetUnitX(sour function s__TimedPause_onExpire takes nothing returns nothing - local integer this= (LoadInteger(TimerUtils__ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! + local integer this= (LoadInteger(TimerUtils___ht, 0, GetHandleId((GetExpiredTimer())))) // INLINED!! set s__TimedPause_array[s__TimedPause_key[this]]=s__TimedPause_array[s__TimedPause_key[this]] - 1 if s__TimedPause_array[s__TimedPause_key[this]] == 0 then @@ -44180,76 +44150,76 @@ call s__lightningTimed_create((AddLightningEx(lightningType, true, GetUnitX(sour -function VoteSystem___Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer +function VoteSystem__Index2D takes integer Value1,integer Value2,integer MaxValue2 returns integer return ( ( Value1 * MaxValue2 ) + Value2 ) endfunction -function VoteSystem___VoteChoiceIndex takes integer choice,integer vote returns integer - return VoteSystem___Index2D(choice , vote , MAX_CHOICES) +function VoteSystem__VoteChoiceIndex takes integer choice,integer vote returns integer + return VoteSystem__Index2D(choice , vote , MAX_CHOICES) endfunction function VoteGetTitle takes integer vote returns string - return VoteSystem___VoteTitle[vote] + return VoteSystem__VoteTitle[vote] endfunction function VoteGetDefaultChoiceChatCommand takes integer vote returns string - return VoteSystem___VoteChoicesChatCommands[VoteSystem___VoteDefaultChoice[vote]] + return VoteSystem__VoteChoicesChatCommands[VoteSystem__VoteDefaultChoice[vote]] endfunction -function VoteSystem___TimerDialogDisplayForForce takes boolean show,timerdialog whichDialog,force whichForce returns nothing +function VoteSystem__TimerDialogDisplayForForce takes boolean show,timerdialog whichDialog,force whichForce returns nothing if ( IsPlayerInForce(GetLocalPlayer(), whichForce) ) then call TimerDialogDisplay(whichDialog, show) endif endfunction function GetTriggerVote takes nothing returns integer - return VoteSystem___callbackVote + return VoteSystem__callbackVote endfunction function GetTriggerChoice takes nothing returns integer - return VoteSystem___callbackChoice + return VoteSystem__callbackChoice endfunction function GetTriggerVotesCount takes nothing returns integer - return VoteSystem___callbackVotes + return VoteSystem__callbackVotes endfunction function TriggerRegisterVoteEvent takes trigger whichTrigger returns integer - local integer t= VoteSystem___CallbacksCounter - set VoteSystem___CallbackTriggers[t]=whichTrigger - set VoteSystem___CallbacksCounter=VoteSystem___CallbacksCounter + 1 + local integer t= VoteSystem__CallbacksCounter + set VoteSystem__CallbackTriggers[t]=whichTrigger + set VoteSystem__CallbacksCounter=VoteSystem__CallbacksCounter + 1 return t endfunction function VoteCreate takes string title returns integer - local integer vote= VoteSystem___VotesCounter - set VoteSystem___VoteTitle[vote]=title - set VoteSystem___VoteTimer[vote]=CreateTimer() - call SaveInteger(VoteSystem___timerHashTable, GetHandleId(VoteSystem___VoteTimer[vote]), 0, vote) - set VoteSystem___VoteTimeout[vote]=VOTE_SYSTEM_DEFAULT_TIMEOUT - set VoteSystem___VoteTimerDialog[vote]=CreateTimerDialog(VoteSystem___VoteTimer[vote]) - set VoteSystem___VotePlayers[vote]=CreateForce() - set VoteSystem___VoteIsRunning[vote]=false - set VoteSystem___VoteDefaultChoice[vote]=- 1 - set VoteSystem___VoteChoices[vote]=0 - set VoteSystem___VotesCounter=VoteSystem___VotesCounter + 1 + local integer vote= VoteSystem__VotesCounter + set VoteSystem__VoteTitle[vote]=title + set VoteSystem__VoteTimer[vote]=CreateTimer() + call SaveInteger(VoteSystem__timerHashTable, GetHandleId(VoteSystem__VoteTimer[vote]), 0, vote) + set VoteSystem__VoteTimeout[vote]=VOTE_SYSTEM_DEFAULT_TIMEOUT + set VoteSystem__VoteTimerDialog[vote]=CreateTimerDialog(VoteSystem__VoteTimer[vote]) + set VoteSystem__VotePlayers[vote]=CreateForce() + set VoteSystem__VoteIsRunning[vote]=false + set VoteSystem__VoteDefaultChoice[vote]=- 1 + set VoteSystem__VoteChoices[vote]=0 + set VoteSystem__VotesCounter=VoteSystem__VotesCounter + 1 return vote endfunction function VoteAddChoice takes integer vote,boolean default,string name,string chatCommand returns integer - local integer choice= VoteSystem___VoteChoices[vote] - local integer index= (VoteSystem___Index2D((choice ) , ( vote) , MAX_CHOICES)) // INLINED!! + local integer choice= VoteSystem__VoteChoices[vote] + local integer index= (VoteSystem__Index2D((choice ) , ( vote) , MAX_CHOICES)) // INLINED!! - set VoteSystem___VoteChoicesNames[index]=name - set VoteSystem___VoteChoicesChatCommands[index]=chatCommand - set VoteSystem___VoteChoicesVotes[index]=CreateForce() + set VoteSystem__VoteChoicesNames[index]=name + set VoteSystem__VoteChoicesChatCommands[index]=chatCommand + set VoteSystem__VoteChoicesVotes[index]=CreateForce() if ( default ) then - set VoteSystem___VoteDefaultChoice[vote]=choice + set VoteSystem__VoteDefaultChoice[vote]=choice endif - set VoteSystem___VoteChoices[vote]=VoteSystem___VoteChoices[vote] + 1 + set VoteSystem__VoteChoices[vote]=VoteSystem__VoteChoices[vote] + 1 return choice endfunction @@ -44259,48 +44229,48 @@ function VoteAddYesChoice takes integer vote returns integer endfunction function IsVoteRunning takes integer vote returns boolean - return VoteSystem___VoteIsRunning[vote] + return VoteSystem__VoteIsRunning[vote] endfunction function IsPlayerInVote takes integer vote,player whichPlayer returns boolean - return IsPlayerInForce(whichPlayer, VoteSystem___VotePlayers[vote]) + return IsPlayerInForce(whichPlayer, VoteSystem__VotePlayers[vote]) endfunction -function VoteSystem___ExecuteCallbacks takes integer vote,integer choice,integer votes returns nothing +function VoteSystem__ExecuteCallbacks takes integer vote,integer choice,integer votes returns nothing local integer i= 0 loop - exitwhen ( i >= VoteSystem___CallbacksCounter ) - set VoteSystem___callbackVote=vote - set VoteSystem___callbackChoice=choice - set VoteSystem___callbackVotes=votes - call ConditionalTriggerExecute(VoteSystem___CallbackTriggers[i]) + exitwhen ( i >= VoteSystem__CallbacksCounter ) + set VoteSystem__callbackVote=vote + set VoteSystem__callbackChoice=choice + set VoteSystem__callbackVotes=votes + call ConditionalTriggerExecute(VoteSystem__CallbackTriggers[i]) set i=i + 1 endloop - if ( VoteSystem___VoteYesTrigger[vote] != null and choice == 0 ) then - set VoteSystem___callbackVote=vote - set VoteSystem___callbackChoice=choice - set VoteSystem___callbackVotes=votes - call ConditionalTriggerExecute(VoteSystem___VoteYesTrigger[vote]) + if ( VoteSystem__VoteYesTrigger[vote] != null and choice == 0 ) then + set VoteSystem__callbackVote=vote + set VoteSystem__callbackChoice=choice + set VoteSystem__callbackVotes=votes + call ConditionalTriggerExecute(VoteSystem__VoteYesTrigger[vote]) endif endfunction -function VoteSystem___GetVoteChoiceVotes takes integer index returns integer - return CountPlayersInForceBJ(VoteSystem___VoteChoicesVotes[index]) +function VoteSystem__GetVoteChoiceVotes takes integer index returns integer + return CountPlayersInForceBJ(VoteSystem__VoteChoicesVotes[index]) endfunction -function VoteSystem___VoteResetVotes takes integer vote returns nothing +function VoteSystem__VoteResetVotes takes integer vote returns nothing local integer i= 0 local integer index= 0 loop - exitwhen ( i >= VoteSystem___VoteChoices[vote] ) - set index=(VoteSystem___Index2D((i ) , ( vote) , MAX_CHOICES)) // INLINED!! - call ForceClear(VoteSystem___VoteChoicesVotes[index]) + exitwhen ( i >= VoteSystem__VoteChoices[vote] ) + set index=(VoteSystem__Index2D((i ) , ( vote) , MAX_CHOICES)) // INLINED!! + call ForceClear(VoteSystem__VoteChoicesVotes[index]) set i=i + 1 endloop endfunction -function VoteSystem___VoteRecalculateAllChoices takes integer vote,boolean expired returns integer - local integer availableVotes= CountPlayersInForceBJ(VoteSystem___VotePlayers[vote]) +function VoteSystem__VoteRecalculateAllChoices takes integer vote,boolean expired returns integer + local integer availableVotes= CountPlayersInForceBJ(VoteSystem__VotePlayers[vote]) local integer choiceVotes= 0 local integer totalVotes= 0 local integer notVoted= 0 @@ -44312,9 +44282,9 @@ function VoteSystem___VoteRecalculateAllChoices takes integer vote,boolean expir local integer i= 0 //call BJDebugMsg("Recalculate votes for " + I2S(VoteChoices[vote]) + " choices.") loop - exitwhen ( i >= VoteSystem___VoteChoices[vote] ) - set index=(VoteSystem___Index2D((i ) , ( vote) , MAX_CHOICES)) // INLINED!! - set choiceVotes=(CountPlayersInForceBJ(VoteSystem___VoteChoicesVotes[(index)])) // INLINED!! + exitwhen ( i >= VoteSystem__VoteChoices[vote] ) + set index=(VoteSystem__Index2D((i ) , ( vote) , MAX_CHOICES)) // INLINED!! + set choiceVotes=(CountPlayersInForceBJ(VoteSystem__VoteChoicesVotes[(index)])) // INLINED!! set totalVotes=totalVotes + choiceVotes if ( choiceVotes > maxChoiceVotes ) then set maxChoice=i @@ -44327,60 +44297,60 @@ function VoteSystem___VoteRecalculateAllChoices takes integer vote,boolean expir if ( maxChoiceVotes > notVoted ) then set votedChoice=maxChoice set votedVotes=maxChoiceVotes - elseif ( expired and VoteSystem___VoteDefaultChoice[vote] != - 1 ) then - set votedChoice=VoteSystem___VoteDefaultChoice[vote] - set index=(VoteSystem___Index2D((votedChoice ) , ( vote) , MAX_CHOICES)) // INLINED!! - set votedVotes=(CountPlayersInForceBJ(VoteSystem___VoteChoicesVotes[(index)])) // INLINED!! + elseif ( expired and VoteSystem__VoteDefaultChoice[vote] != - 1 ) then + set votedChoice=VoteSystem__VoteDefaultChoice[vote] + set index=(VoteSystem__Index2D((votedChoice ) , ( vote) , MAX_CHOICES)) // INLINED!! + set votedVotes=(CountPlayersInForceBJ(VoteSystem__VoteChoicesVotes[(index)])) // INLINED!! endif if ( votedChoice != - 1 ) then - call PauseTimer(VoteSystem___VoteTimer[vote]) - call VoteSystem___TimerDialogDisplayForForce(false , VoteSystem___VoteTimerDialog[vote] , VoteSystem___VotePlayers[vote]) - call VoteSystem___ExecuteCallbacks(vote , votedChoice , maxChoiceVotes) - call VoteSystem___VoteResetVotes(vote) - set VoteSystem___VoteIsRunning[vote]=false + call PauseTimer(VoteSystem__VoteTimer[vote]) + call VoteSystem__TimerDialogDisplayForForce(false , VoteSystem__VoteTimerDialog[vote] , VoteSystem__VotePlayers[vote]) + call VoteSystem__ExecuteCallbacks(vote , votedChoice , maxChoiceVotes) + call VoteSystem__VoteResetVotes(vote) + set VoteSystem__VoteIsRunning[vote]=false endif return votedChoice endfunction function VoteRecalculate takes integer vote,boolean expired returns integer - if ( not (VoteSystem___VoteIsRunning[(vote)]) ) then // INLINED!! + if ( not (VoteSystem__VoteIsRunning[(vote)]) ) then // INLINED!! return - 1 endif - return VoteSystem___VoteRecalculateAllChoices(vote , expired) + return VoteSystem__VoteRecalculateAllChoices(vote , expired) endfunction -function VoteSystem___TimerFunctionVoteExpires takes nothing returns nothing - local integer vote= LoadInteger(VoteSystem___timerHashTable, GetHandleId(GetExpiredTimer()), 0) +function VoteSystem__TimerFunctionVoteExpires takes nothing returns nothing + local integer vote= LoadInteger(VoteSystem__timerHashTable, GetHandleId(GetExpiredTimer()), 0) //call BJDebugMsg("Timer has expired for vote: " + I2S(vote)) call VoteRecalculate(vote , true) endfunction function VoteStart takes integer vote,force whichForce returns boolean - if ( (VoteSystem___VoteIsRunning[(vote)]) ) then // INLINED!! + if ( (VoteSystem__VoteIsRunning[(vote)]) ) then // INLINED!! return false endif - set VoteSystem___VoteIsRunning[vote]=true - call ForceClear(VoteSystem___VotePlayers[vote]) - call ForceAddForce(whichForce , VoteSystem___VotePlayers[vote]) - call TimerStart(VoteSystem___VoteTimer[vote], VoteSystem___VoteTimeout[vote], false, function VoteSystem___TimerFunctionVoteExpires) - call TimerDialogSetTitle(VoteSystem___VoteTimerDialog[vote], VoteSystem___VoteTitle[vote]) - call VoteSystem___TimerDialogDisplayForForce(true , VoteSystem___VoteTimerDialog[vote] , VoteSystem___VotePlayers[vote]) - call VoteSystem___VoteResetVotes(vote) + set VoteSystem__VoteIsRunning[vote]=true + call ForceClear(VoteSystem__VotePlayers[vote]) + call ForceAddForce(whichForce , VoteSystem__VotePlayers[vote]) + call TimerStart(VoteSystem__VoteTimer[vote], VoteSystem__VoteTimeout[vote], false, function VoteSystem__TimerFunctionVoteExpires) + call TimerDialogSetTitle(VoteSystem__VoteTimerDialog[vote], VoteSystem__VoteTitle[vote]) + call VoteSystem__TimerDialogDisplayForForce(true , VoteSystem__VoteTimerDialog[vote] , VoteSystem__VotePlayers[vote]) + call VoteSystem__VoteResetVotes(vote) return true endfunction -function VoteSystem___VoteCheckChatCommandChoices takes integer vote,string command returns integer +function VoteSystem__VoteCheckChatCommandChoices takes integer vote,string command returns integer local integer index= 0 local integer i= 0 loop - exitwhen ( i >= VoteSystem___VoteChoices[vote] ) - set index=(VoteSystem___Index2D((i ) , ( vote) , MAX_CHOICES)) // INLINED!! - if ( VoteSystem___VoteChoicesChatCommands[index] == command ) then + exitwhen ( i >= VoteSystem__VoteChoices[vote] ) + set index=(VoteSystem__Index2D((i ) , ( vote) , MAX_CHOICES)) // INLINED!! + if ( VoteSystem__VoteChoicesChatCommands[index] == command ) then return i endif set i=i + 1 @@ -44390,11 +44360,11 @@ function VoteSystem___VoteCheckChatCommandChoices takes integer vote,string comm endfunction function VoteAddVote takes integer vote,integer choice,player whichPlayer returns nothing - local integer index= (VoteSystem___Index2D((choice ) , ( vote) , MAX_CHOICES)) // INLINED!! + local integer index= (VoteSystem__Index2D((choice ) , ( vote) , MAX_CHOICES)) // INLINED!! - if ( not IsPlayerInForce(whichPlayer, VoteSystem___VoteChoicesVotes[index]) ) then + if ( not IsPlayerInForce(whichPlayer, VoteSystem__VoteChoicesVotes[index]) ) then //call BJDebugMsg("Add vote to choice " + I2S(choice)) - call ForceAddPlayer(VoteSystem___VoteChoicesVotes[index], whichPlayer) + call ForceAddPlayer(VoteSystem__VoteChoicesVotes[index], whichPlayer) call VoteRecalculate(vote , false) else @@ -44403,15 +44373,15 @@ function VoteAddVote takes integer vote,integer choice,player whichPlayer return endfunction function VoteSetStartChatCommand takes integer vote,string chatCommand returns nothing - set VoteSystem___VoteStartChatCommand[vote]=chatCommand + set VoteSystem__VoteStartChatCommand[vote]=chatCommand endfunction function VoteSetYesTrigger takes integer vote,trigger whichTrigger returns nothing - set VoteSystem___VoteYesTrigger[vote]=whichTrigger + set VoteSystem__VoteYesTrigger[vote]=whichTrigger endfunction function VoteRemovePlayer takes integer vote,player whichPlayer returns nothing - call ForceRemovePlayer(VoteSystem___VotePlayers[vote], whichPlayer) + call ForceRemovePlayer(VoteSystem__VotePlayers[vote], whichPlayer) endfunction function VoteStartForAllPlayingUsers takes integer vote returns boolean @@ -44429,22 +44399,22 @@ function VoteStartForAllPlayingUsersWithInitialVote takes integer vote,player wh endfunction function StartGlobalVote takes integer vote,player whichPlayer returns nothing - local string message= GetPlayerNameColored(whichPlayer) + " has started a vote " + (VoteSystem___VoteTitle[(vote)]) + ". Accept with \"" + VoteSystem___VoteStartChatCommand[vote] + "\" or ignore." // INLINED!! + local string message= GetPlayerNameColored(whichPlayer) + " has started a vote " + (VoteSystem__VoteTitle[(vote)]) + ". Accept with \"" + VoteSystem__VoteStartChatCommand[vote] + "\" or ignore." // INLINED!! call h__DisplayTextToForce(GetPlayersAll(), message) call VoteStartForAllPlayingUsersWithInitialVote(vote , whichPlayer) endfunction -function VoteSystem___TriggerActionChatCommand takes nothing returns nothing +function VoteSystem__TriggerActionChatCommand takes nothing returns nothing local string chatCommand= GetEventPlayerChatString() local player triggerPlayer= GetTriggerPlayer() local integer matchingChoice= - 1 local integer i= 0 loop - exitwhen ( i >= VoteSystem___VotesCounter ) - if ( VoteSystem___VoteYesTrigger[i] != null and VoteSystem___VoteStartChatCommand[i] == chatCommand ) then + exitwhen ( i >= VoteSystem__VotesCounter ) + if ( VoteSystem__VoteYesTrigger[i] != null and VoteSystem__VoteStartChatCommand[i] == chatCommand ) then call StartGlobalVote(i , triggerPlayer) - elseif ( (VoteSystem___VoteIsRunning[(i)]) ) then // INLINED!! - set matchingChoice=VoteSystem___VoteCheckChatCommandChoices(i , chatCommand) + elseif ( (VoteSystem__VoteIsRunning[(i)]) ) then // INLINED!! + set matchingChoice=VoteSystem__VoteCheckChatCommandChoices(i , chatCommand) if ( matchingChoice != - 1 ) then call VoteAddVote(i , matchingChoice , triggerPlayer) @@ -44455,33 +44425,33 @@ function VoteSystem___TriggerActionChatCommand takes nothing returns nothing set triggerPlayer=null endfunction -function VoteSystem___TriggerActionPlayerLeaves takes nothing returns nothing +function VoteSystem__TriggerActionPlayerLeaves takes nothing returns nothing local integer i= 0 loop - exitwhen ( i >= VoteSystem___VotesCounter ) - if ( (VoteSystem___VoteIsRunning[(i)]) ) then // INLINED!! - call ForceRemovePlayer(VoteSystem___VotePlayers[(i )], ( GetTriggerPlayer())) // INLINED!! + exitwhen ( i >= VoteSystem__VotesCounter ) + if ( (VoteSystem__VoteIsRunning[(i)]) ) then // INLINED!! + call ForceRemovePlayer(VoteSystem__VotePlayers[(i )], ( GetTriggerPlayer())) // INLINED!! call VoteRecalculate(i , false) endif set i=i + 1 endloop endfunction -function VoteSystem___Init takes nothing returns nothing +function VoteSystem__Init takes nothing returns nothing local player whichPlayer= null local integer i= 0 loop exitwhen ( i >= bj_MAX_PLAYERS ) set whichPlayer=Player(i) if ( GetPlayerController(whichPlayer) == MAP_CONTROL_USER ) then - call TriggerRegisterPlayerChatEvent(VoteSystem___ChatCommandTrigger, whichPlayer, "", false) - call TriggerRegisterPlayerEvent(VoteSystem___LeavesTrigger, whichPlayer, EVENT_PLAYER_LEAVE) + call TriggerRegisterPlayerChatEvent(VoteSystem__ChatCommandTrigger, whichPlayer, "", false) + call TriggerRegisterPlayerEvent(VoteSystem__LeavesTrigger, whichPlayer, EVENT_PLAYER_LEAVE) endif set whichPlayer=null set i=i + 1 endloop - call TriggerAddAction(VoteSystem___ChatCommandTrigger, function VoteSystem___TriggerActionChatCommand) - call TriggerAddAction(VoteSystem___LeavesTrigger, function VoteSystem___TriggerActionPlayerLeaves) + call TriggerAddAction(VoteSystem__ChatCommandTrigger, function VoteSystem__TriggerActionChatCommand) + call TriggerAddAction(VoteSystem__LeavesTrigger, function VoteSystem__TriggerActionPlayerLeaves) endfunction @@ -44499,21 +44469,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 @@ -44584,8799 +44554,574 @@ function AddAllChanges takes nothing returns nothing call CreateQuestItem(bj_lastCreatedQuest , (("Fix removing killed or cancelled constructions from the queue UI."))) // 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__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 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___prototype353_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") - 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 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(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -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!! - call TriggerAddAction(FrameLoader___actionTrigger, (function EnableLogUI)) // INLINED!! - call TriggerAddAction(FrameSaver__saveTrigger, (function HideLogUI)) // INLINED!! - call FrameSaverAddEx(function DisableLogUI , function EnableLogUI) -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: @@ -53403,433 +45148,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 - @@ -53857,2641 +45227,366 @@ 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 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 WoWReforgedLevels: -function AddLevel takes string name,integer itemTypeId,string mapName returns integer - local integer index= WoWReforgedLevels___levelCounter - set WoWReforgedLevels___levelName[index]=name - set WoWReforgedLevels___levelItemTypeId[index]=itemTypeId - set WoWReforgedLevels___levelMapName[index]=mapName - set WoWReforgedLevels___levelCounter=WoWReforgedLevels___levelCounter + 1 - return index -endfunction -function GetLevelName takes integer level returns string - return WoWReforgedLevels___levelName[level] -endfunction -function GetLevelItemTypeId takes integer level returns integer - return WoWReforgedLevels___levelItemTypeId[level] -endfunction -function GetLevelMapName takes integer level returns string - return WoWReforgedLevels___levelMapName[level] -endfunction -function GetMaxLevels takes nothing returns integer - return WoWReforgedLevels___levelCounter -endfunction -function GetLevelByItemTypeId takes integer itemTypeId returns integer - local integer i= 0 - loop - exitwhen ( i >= (WoWReforgedLevels___levelCounter) ) // INLINED!! - if ( (WoWReforgedLevels___levelItemTypeId[(i)]) == itemTypeId ) then // INLINED!! - return i - endif - set i=i + 1 - endloop - return - 1 -endfunction -function ChangeToLevel takes player whichPlayer,integer level returns nothing - if ( (WoWReforgedLevels___levelName[(level)]) != ("AZ") ) then // INLINED!! - call sc__MapChanger_changeMap((WoWReforgedLevels___levelMapName[(level)])) // INLINED!! - else - call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "You are in this level.") - endif -endfunction -function AddLevelPortal takes unit portal returns nothing - local integer i= 0 - call EnablePagedButtons(portal) - set i=0 - loop - exitwhen ( i >= (WoWReforgedLevels___levelCounter) ) // INLINED!! -call AddPagedButtonsId((portal ) , ( (WoWReforgedLevels___levelItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! - set i=i + 1 - endloop -endfunction -function WoWReforgedLevels___TriggerConditionSell takes nothing returns boolean - local integer level= GetLevelByItemTypeId(GetItemTypeId(GetSoldItem())) - if ( level != - 1 ) then - call ChangeToLevel(GetOwningPlayer(GetBuyingUnit()) , level) - endif - return false -endfunction -function WoWReforgedLevels___ForGroupAddLevelPortal takes nothing returns nothing - call AddLevelPortal(GetEnumUnit()) -endfunction -function WoWReforgedLevels___TimerFunctionAddLevelPortals takes nothing returns nothing - local group g= GetUnitsOfTypeIdAll(LEVEL_PORTAL) - call ForGroupBJ(g, function WoWReforgedLevels___ForGroupAddLevelPortal) - call GroupClear(g) - call DestroyGroup(g) - set g=null - - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) -endfunction -function WoWReforgedLevels___Init takes nothing returns nothing - call AddLevel("AZ" , 'I0T0' , "wowr") // Azeroth - call AddLevel("EC" , 'I0SZ' , "wowr_elvenclan") // Elven Clan - call AddLevel("OT" , 'I12N' , "wowr_orgrimmar_tunnels") // Orgrimmar Tunnels - call AddLevel("FW" , 'I148' , "wowr_felwood") // Felwood - call AddLevel("AV" , 'I14B' , "wowr_ashenvale") // Ashenvale - - call TriggerRegisterAnyUnitEventBJ(WoWReforgedLevels___sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) - call TriggerAddCondition(WoWReforgedLevels___sellTrigger, Condition(function WoWReforgedLevels___TriggerConditionSell)) - - call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedLevels___TimerFunctionAddLevelPortals) -endfunction -//library WoWReforgedLevels 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 - return GetSpellAbilityId() == HolyNova_ABILITY_ID or GetSpellAbilityId() == HolyNova_ABILITY_ID_2 -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 @@ -56503,140 +45598,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 @@ -56648,22661 +45620,30591 @@ 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_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_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_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___prototype385_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' ) 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 GetHeroAccountNames takes integer index returns string - return udg_HeroAccountNames[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 AccountCanBuyHero takes string accountName,integer index returns boolean - local string names= (udg_HeroAccountNames[(index)]) // INLINED!! - local integer tokenIndex= 0 - local string name= "" - if ( StringLength(names) > 0 ) then - loop - set name=StringSplit(names , tokenIndex , ",") - exitwhen ( name == "" or name == null ) - if ( accountName == name ) then - return true - endif - set tokenIndex=tokenIndex + 1 - endloop - - return false - endif - - return true -endfunction -function PlayerCanBuyHeroEx takes player whichPlayer,integer unitTypeId returns boolean - local integer index= GetHeroIndexByUnitTypeId(unitTypeId) - if ( index > - 1 ) then - return AccountCanBuyHero(GetPlayerName(whichPlayer) , 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 AccountCanBuyHero(GetPlayerName(whichPlayer) , index) ) then - return "Hero is restricted to account." - 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 WoWReforgedMapChanger: - /// The name of the gamecache which is used for storing all character data. - /// In a custom campaign no subfolder is used for maps. - /// All map change save games will be saved into this folder. - /// All zone save games come to this folder which do not belong to a savegame name. This folder has to be cleared whenever the game ends or is started newly. Since the ending event cannot be captured the temporary folder is cleared whenever a new campaign is started from the first chapter. - /// Stores the savegame name whenever the user saves the game. A directory is created with the same name which has a backup of all the zone savegames. - - - function s__MapChanger_mapPath takes string mapName returns string - local string folder= "" - if ( StringLength(s__MapChanger_mapFolder) > 0 ) then - set folder=s__MapChanger_mapFolder + "\\" - endif - return folder + mapName + MAP_VERSION + ".w3x" - endfunction - function s__MapChanger_saveGameFolder takes string currentSaveGame returns string - if ( currentSaveGame != null and StringLength(currentSaveGame) > 0 ) then - return s__MapChanger_zonesFolder + "\\" + currentSaveGame - endif - // use another folder if these are temporary zone files - return s__MapChanger_temporaryFolder - endfunction - - function s__MapChanger_saveGamePath takes string currentSaveGame,string mapName returns string - return s__MapChanger_saveGameFolder(currentSaveGame) + "\\" + mapName + MAP_VERSION + ".w3z" - endfunction - - function s__MapChanger_currentSaveGamePath takes string mapName returns string - return s__MapChanger_saveGamePath(s__MapChanger_m_currentSaveGame , mapName) - endfunction - function s__MapChanger_temporarySaveGamePath takes string mapName returns string - return s__MapChanger_saveGamePath("" , mapName) - endfunction - function s__MapChanger_playerMissionKey takes player whichPlayer returns string - return GetPlayerName(whichPlayer) - endfunction - - function s__MapChanger_heroMissionKey takes unit hero returns string - local player owner= GetOwningPlayer(hero) - local string index= "0" - if ( (udg_Hero2[GetPlayerId((owner))]) == hero ) then // INLINED!! - set index="1" - elseif ( (udg_Hero3[GetPlayerId((owner))]) == hero ) then // INLINED!! - set index="2" - endif - return (GetPlayerName((owner))) + index // INLINED!! - endfunction - - function s__MapChanger_storeHeroSinglePlayer takes gamecache cache,unit hero returns nothing - local string missionKey= s__MapChanger_heroMissionKey(hero) - call FlushStoredMission(cache, missionKey) // flush old data, otherwise old inventory might be loaded - call StoreUnit(cache, missionKey, "Hero", hero) - // Store all skill points since they are used to reskill the spells on restoration! They restored character starts with all spells with level 0. - //call StoreInteger(cache, missionKey, "SkillPoints", character.grimoire().totalSkillPoints()) - call StoreInteger(cache, missionKey, "Gold", GetPlayerState(GetOwningPlayer(hero), PLAYER_STATE_RESOURCE_GOLD)) - call StoreInteger(cache, missionKey, "Lumber", GetPlayerState(GetOwningPlayer(hero), PLAYER_STATE_RESOURCE_LUMBER)) - endfunction - function s__MapChanger_filterUnit takes nothing returns boolean - return not IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) - endfunction - - function s__MapChanger_storeUnitsSinglePlayer takes gamecache cache,player whichPlayer,real x,real y returns nothing - local string missionKey= (GetPlayerName((whichPlayer))) + "Units" // INLINED!! - local integer i= 0 - local group whichGroup= CreateGroup() - call GroupEnumUnitsInRange(whichGroup, x, y, 900.0, Filter(function s__MapChanger_filterUnit)) - call StoreInteger(cache, missionKey, "Count", BlzGroupGetSize(whichGroup)) - set i=0 - loop - exitwhen ( i == BlzGroupGetSize(whichGroup) ) - if ( StoreUnit(cache, missionKey, I2S(i), BlzGroupUnitAt(whichGroup, i)) ) then - call h__RemoveUnit(BlzGroupUnitAt(whichGroup, i)) - endif - set i=i + 1 - endloop - call GroupClear(whichGroup) - call DestroyGroup(whichGroup) - set whichGroup=null - endfunction - function s__MapChanger_setupMapTransition takes nothing returns nothing - // Hide transition delay. - call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0) - call ShowInterface(false, 1.0) - call EnableUserControl(false) - call ClearTextMessages() - call ClearSelection() - endfunction - function s__MapChanger_clearMapTransition takes nothing returns nothing - // Disable the transition mode. NOTE don't play any video in onRestoreCharacter() before. - call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 1.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0) - call ShowInterface(true, 1.0) - call EnableUserControl(true) - endfunction - - function s__MapChanger_getZoneNameIndex takes string levelName returns integer - local integer i= 0 - loop - exitwhen ( i == s__MapChanger_m_saveGamesCounter ) - if ( s__MapChanger_m_saveGames[i] == levelName ) then - return i - endif - set i=i + 1 - endloop - - return - 1 - endfunction - - function s__MapChanger_addZoneName takes string levelName returns nothing - set s__MapChanger_m_saveGames[s__MapChanger_m_saveGamesCounter]=levelName - set s__MapChanger_m_saveGamesCounter=s__MapChanger_m_saveGamesCounter + 1 - endfunction - - - function s__MapChanger_markCurrentSaveGame takes nothing returns boolean - local string levelName= ("AZ") // INLINED!! - local integer index= s__MapChanger_getZoneNameIndex(levelName) - if ( index == - 1 ) then - call s__MapChanger_addZoneName(levelName) - endif - return true - endfunction - - function s__MapChanger_zoneHasSaveGame takes string targetZoneName returns boolean - return s__MapChanger_getZoneNameIndex(targetZoneName) != - 1 - endfunction - - function s__MapChanger_storeSaveGames takes gamecache cache returns nothing - local integer i= 0 - call FlushStoredMission(cache, "ZoneSaveGames") - loop - exitwhen ( i == s__MapChanger_m_saveGamesCounter ) - call StoreBoolean(cache, "ZoneSaveGames", s__MapChanger_m_saveGames[i], true) - set i=i + 1 - endloop - endfunction - - function s__MapChanger_restoreSaveGames takes gamecache cache returns nothing - local string levelName= null - local integer i= 0 - // clear all old entries before - set s__MapChanger_m_saveGamesCounter=0 - loop - exitwhen ( i == (WoWReforgedLevels___levelCounter) ) // INLINED!! - set levelName=(WoWReforgedLevels___levelName[(i)]) // INLINED!! - if ( HaveStoredBoolean(cache, "ZoneSaveGames", levelName) ) then - if ( s__MapChanger_getZoneNameIndex(levelName) == - 1 ) then - call s__MapChanger_addZoneName(levelName) - endif - endif - set i=i + 1 - endloop - endfunction - - function s__MapChanger_storeHeroesSinglePlayer takes string zone returns boolean - local gamecache cache= InitGameCache(s__MapChanger_gameCacheName) - local unit hero= null - local integer i= 0 - call s__MapChanger_setupMapTransition() - // Store all characters. - set i=0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set hero=(udg_Hero[GetPlayerId((Player(i)))]) // INLINED!! - if ( hero != null ) then - call s__MapChanger_storeHeroSinglePlayer(cache , hero) - call SetUnitInvulnerable(hero, true) // Protect from any damage during the delay, but after saving the character in the game cache. - call s__MapChanger_storeUnitsSinglePlayer(cache , Player(i) , GetUnitX(hero) , GetUnitY(hero)) - endif - set i=i + 1 - endloop - call StoreBoolean(cache, "Stored", "Stored", true) - // the current save game name has to be stored to know from where the save games have to be copied - call StoreString(cache, "CurrentSaveGame", "CurrentSaveGame", s__MapChanger_m_currentSaveGame) - call StoreString(cache, "Zone", "Zone", zone) - // Store all save game flags - call s__MapChanger_storeSaveGames(cache) - call SaveGameCache(cache) - set cache=null - return true - endfunction - - function s__MapChanger_heroesExistSinglePlayer takes nothing returns boolean - local gamecache cache= null - local boolean result= false - if ( ReloadGameCachesFromDisk() ) then - set cache=InitGameCache(s__MapChanger_gameCacheName) - set result=HaveStoredBoolean(cache, "Stored", "Stored") - set cache=null - endif - return result - endfunction - function s__MapChanger_restoreUnitsSinglePlayer takes gamecache cache,player whichPlayer,real x,real y,real facing,string levelFrom returns nothing - local string missionKey= (GetPlayerName((whichPlayer))) + "Units" // INLINED!! - local integer count= GetStoredInteger(cache, missionKey, "Count") - local integer i= 0 - loop - exitwhen ( i >= count ) - call OnRestoreUnit(whichPlayer , RestoreUnit(cache, missionKey, I2S(i), whichPlayer, x, y, facing) , levelFrom) - set i=i + 1 - endloop - endfunction - function s__MapChanger_selectAndMoveCamera takes unit restoredUnit,player whichPlayer returns nothing - call SelectUnitForPlayerSingle(restoredUnit, whichPlayer) - //debug call BJDebugMsg("After selecting character " + GetUnitName(restoredUnit) + " for player " + GetPlayerName(whichPlayer)) - call SetCameraPositionForPlayer(whichPlayer, GetUnitX(restoredUnit), GetUnitY(restoredUnit)) - endfunction - - function s__MapChanger_restoreHeroSinglePlayer takes gamecache cache,player whichPlayer,real x,real y,real facing,string levelFrom returns nothing - local string missionKey= (GetPlayerName((whichPlayer))) // INLINED!! - local unit restoredUnit= RestoreUnit(cache, missionKey, "Hero", whichPlayer, x, y, facing) - if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! - call h__RemoveUnit((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! - endif - call SetPlayerHero1(whichPlayer , restoredUnit) - call OnRestoreUnit(whichPlayer , restoredUnit , levelFrom) - call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_GOLD, GetStoredInteger(cache, missionKey, "Gold")) - call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER, GetStoredInteger(cache, missionKey, "Lumber")) - call s__MapChanger_restoreUnitsSinglePlayer(cache , whichPlayer , x , y , facing , levelFrom) - // Since the character traveled for some time fill stats. - call SetUnitLifePercentBJ(restoredUnit, 100.0) - call SetUnitManaPercentBJ(restoredUnit, 100.0) - // NOTE works not on the load event. - call s__MapChanger_selectAndMoveCamera(restoredUnit , whichPlayer) - endfunction - function s__MapChanger_restoreHeroesSinglePlayer takes nothing returns nothing - local gamecache cache= null - local string zone= null - local real x= 0.0 - local real y= 0.0 - local real facing= 0.0 - local integer i= 0 - if ( ReloadGameCachesFromDisk() ) then - set cache=InitGameCache(s__MapChanger_gameCacheName) - // the zone from which they come, this helps to place the character at the correct position - set zone=GetStoredString(cache, "Zone", "Zone") - // the current save game which is used as folder name for all zone savegames - set s__MapChanger_m_currentSaveGame=GetStoredString(cache, "CurrentSaveGame", "CurrentSaveGame") - // Restore all save game flags - call s__MapChanger_restoreSaveGames(cache) - set i=0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then - // Do not restore at (0 | 0). The region will be discovered otherwise. - set x=GetMapStartX(Player(i) , zone) - set y=GetMapStartY(Player(i) , zone) - set facing=GetMapStartFacing(Player(i) , zone) - call s__MapChanger_restoreHeroSinglePlayer(cache , Player(i) , x , y , facing , zone) - endif - set i=i + 1 - endloop - call s__MapChanger_clearMapTransition() - set cache=null - endif - endfunction - function s__MapChanger_forGroupBanMagic takes nothing returns nothing - if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_SUMMONED) ) then - call h__RemoveUnit(GetEnumUnit()) - else - call UnitRemoveBuffsBJ(bj_REMOVEBUFFS_ALL, GetEnumUnit()) - endif - endfunction - function s__MapChanger_removeBuffsAndSummonedUnits takes nothing returns nothing - local group whichGroup= CreateGroup() - call GroupEnumUnitsInRect(whichGroup, GetPlayableMapRect(), null) - call ForGroup(whichGroup, function s__MapChanger_forGroupBanMagic) - call GroupClear(whichGroup) - call DestroyGroup(whichGroup) - set whichGroup=null - endfunction - - function s__MapChanger_changeMapSinglePlayer takes string oldMap,string newMap returns nothing - local string savePath= (s__MapChanger_saveGamePath("" , (oldMap))) // INLINED!! - local string loadPath= (s__MapChanger_saveGamePath("" , (newMap))) // INLINED!! - local string nextLevelPath= s__MapChanger_mapPath(newMap) - // removing buffs and summoned units is also done in the Bonus Campaign, probably it indicates the elapsed time after a transition - call ForForce(bj_FORCE_PLAYER[0], (function s__MapChanger_removeBuffsAndSummonedUnits)) // New Op Limit // INLINED!! - - if ( not s__MapChanger_markCurrentSaveGame() ) then - return - endif - if ( not sc__MapChanger_storeHeroesSinglePlayerNewOpLimit(oldMap) ) then // New Op Limit - return - endif - call SaveGame(savePath) - if ( (s__MapChanger_getZoneNameIndex((newMap)) != - 1) and SaveGameExists(loadPath) ) then // INLINED!! - call LoadGame(loadPath, false) - else - call ChangeLevel(nextLevelPath, false) - endif - endfunction - function s__MapChanger_storeHeroesSinglePlayerNewOpLimit takes string zone returns boolean - return s__MapChanger_storeHeroesSinglePlayer(zone) - endfunction - function s__MapChanger_changeMap takes string newMap returns nothing - if ( udg_LevelsEnabled ) then - // changing map with saving the game does only work in campaign mode - if ( IsInSinglePlayer() ) then - if ( StringLength(("wowr" + MAP_VERSION + ".w3x")) > 0 ) then // INLINED!! - // TODO Generate savecodes before. - call s__MapChanger_changeMapSinglePlayer(("wowr" + MAP_VERSION + ".w3x") , newMap) // INLINED!! - else - call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_WARNING, "The zone name of this map has not been specified.") - endif - else - call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_HINT, "The map can only be changed singleplayer.") - endif - else - call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_HINT, "Level changes are disabled and only work in singleplayer. Use the chat command \"-levels\" to enable them.") - endif - endfunction - function s__MapChanger_triggerConditionLoadTransition takes nothing returns boolean - return IsMapFlagSet(MAP_RELOADED) and IsInSinglePlayer() - endfunction - function s__MapChanger_timerFunctionSelectAndMoveCamera takes nothing returns nothing - local player slotPlayer= null - local integer i= 0 - loop - exitwhen ( i == bj_MAX_PLAYERS ) - set slotPlayer=Player(i) - if ( (udg_Hero[GetPlayerId((slotPlayer))]) != null ) then // INLINED!! - call s__MapChanger_selectAndMoveCamera((udg_Hero[GetPlayerId((slotPlayer))]) , slotPlayer) // INLINED!! - endif - set slotPlayer=null - set i=i + 1 - endloop - call PauseTimer(GetExpiredTimer()) - call DestroyTimer(GetExpiredTimer()) - endfunction - function s__MapChanger_triggerActionLoadTransition takes nothing returns nothing - local timer tmpTimer= null - call s__MapChanger_restoreHeroesSinglePlayer() - // start temporary 0 timer for selection and camera position, since it cannot be done without a delay on initialization - set tmpTimer=CreateTimer() - call TimerStart(tmpTimer, 0.0, false, function s__MapChanger_timerFunctionSelectAndMoveCamera) - endfunction - function s__MapChanger_triggerConditionLoadUser takes nothing returns boolean - return not IsMapFlagSet(MAP_RELOADED) and IsInSinglePlayer() - endfunction - /// Copy all to the temporary folder. - function s__MapChanger_triggerActionLoadUser takes nothing returns nothing - local string levelName= null - local string zoneSaveGame= null - local string zoneTargetSaveGame= null - local integer i= 0 - call RemoveSaveDirectory(s__MapChanger_temporaryFolder) - set i=0 - loop - exitwhen ( i == (WoWReforgedLevels___levelCounter) ) // INLINED!! - set levelName=(WoWReforgedLevels___levelName[(i)]) // INLINED!! - set zoneSaveGame=(s__MapChanger_saveGamePath(s__MapChanger_m_currentSaveGame , (levelName))) // INLINED!! - if ( (s__MapChanger_getZoneNameIndex((levelName)) != - 1) and SaveGameExists(zoneSaveGame) ) then // INLINED!! - set zoneTargetSaveGame=(s__MapChanger_saveGamePath("" , (levelName))) // INLINED!! - call CopySaveGame(zoneSaveGame, zoneTargetSaveGame) - endif - set i=i + 1 - endloop - endfunction - function s__MapChanger_triggerConditionSaveUser takes nothing returns boolean - return IsInSinglePlayer() - endfunction - - function s__MapChanger_triggerActionSaveUser takes nothing returns nothing - local string levelName= null - local string zoneSaveGame= null - local string zoneTargetSaveGame= null - local integer i= 0 - // Remove existing zones directory if a savegame already existed with the same name, otherwise old zone save games will remain. - call RemoveSaveDirectory(s__MapChanger_saveGameFolder(GetSaveBasicFilename())) - // Copy savegames for all zones into the new directory. Consider that every map needs ALL zones therefore. Disable unused zones in the map. - loop - exitwhen ( i == (WoWReforgedLevels___levelCounter) ) // INLINED!! - set levelName=(WoWReforgedLevels___levelName[(i)]) // INLINED!! - set zoneSaveGame=(s__MapChanger_saveGamePath("" , (levelName))) // INLINED!! - if ( (s__MapChanger_getZoneNameIndex((levelName)) != - 1) and SaveGameExists(zoneSaveGame) ) then // INLINED!! - set zoneTargetSaveGame=s__MapChanger_saveGamePath(GetSaveBasicFilename() , levelName) - call CopySaveGame(zoneSaveGame, zoneTargetSaveGame) - endif - set i=i + 1 - endloop - set s__MapChanger_m_currentSaveGame=GetSaveBasicFilename() - endfunction - function s__MapChanger_onInit takes nothing returns nothing - - set s__MapChanger_m_loadTriggerTransition=CreateTrigger() - call TriggerRegisterGameEvent(s__MapChanger_m_loadTriggerTransition, EVENT_GAME_LOADED) - call TriggerAddCondition(s__MapChanger_m_loadTriggerTransition, Condition(function s__MapChanger_triggerConditionLoadTransition)) - call TriggerAddAction(s__MapChanger_m_loadTriggerTransition, function s__MapChanger_triggerActionLoadTransition) - - set s__MapChanger_m_loadTriggerUser=CreateTrigger() - call TriggerRegisterGameEvent(s__MapChanger_m_loadTriggerUser, EVENT_GAME_LOADED) - call TriggerAddCondition(s__MapChanger_m_loadTriggerUser, Condition(function s__MapChanger_triggerConditionLoadUser)) - call TriggerAddAction(s__MapChanger_m_loadTriggerUser, function s__MapChanger_triggerActionLoadUser) - - set s__MapChanger_m_saveTriggerUser=CreateTrigger() - call TriggerRegisterGameEvent(s__MapChanger_m_saveTriggerUser, EVENT_GAME_SAVE) - call TriggerAddCondition(s__MapChanger_m_saveTriggerUser, Condition(function s__MapChanger_triggerConditionSaveUser)) - call TriggerAddAction(s__MapChanger_m_saveTriggerUser, function s__MapChanger_triggerActionSaveUser) - set s__MapChanger_m_currentSaveGame=null - set s__MapChanger_m_saveGamesCounter=0 - // If the campaign is started completely new without loading it, the temporary folder should be cleared. Otherwise wrong zone save games from the last game might be used. - if ( IsInSinglePlayer() and not IsMapFlagSet(MAP_RELOADED) ) then - call RemoveSaveDirectory(s__MapChanger_temporaryFolder) - endif - endfunction -function ChangeMap takes string newMap returns nothing - call s__MapChanger_changeMap(newMap) -endfunction -function ChangeMapWoWReforged takes nothing returns nothing - call s__MapChanger_changeMap((udg_TmpString)) // INLINED!! -endfunction -//library WoWReforgedMapChanger 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 RandomizeHeroSkin takes unit hero returns boolean - local integer unitTypeId= GetUnitTypeId(hero) - local player owner= GetOwningPlayer(hero) - if ( IsCustomizableHero(unitTypeId) ) then - call BlzSetUnitSkin(hero, (WoWReforgedSkins___skinUnitTypeId[(GetRandomInt(0, WoWReforgedSkins___skinCounter - 1))])) // INLINED!! - - 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 integer itemTypeId= GetItemTypeId(GetSoldItem()) - local integer shopUnitTypeId= GetUnitTypeId(shop) - local integer index= GetSkinByItemTypeId(itemTypeId) - if ( index != - 1 ) then - if ( IsCustomizableHero(unitTypeId) ) then - 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 , "Only customizable heroes can change their skin.") - endif - endif - 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,string accountNames,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_accountNames[this]=accountNames - 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 AccountCanBuyMount takes string accountName,integer mount returns boolean - local string names= s__WoWReforgedMounts__M_accountNames[mount] - local integer tokenIndex= 0 - local string name= "" - if ( StringLength(names) > 0 ) then - loop - set name=StringSplit(names , tokenIndex , ",") - exitwhen ( name == "" or name == null ) - if ( accountName == name ) then - return true - endif - set tokenIndex=tokenIndex + 1 - endloop - - return false - endif - - return true -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_TmpString , udg_TmpBoolean) - set WoWReforgedMounts__mountTypes[index]=m - set WoWReforgedMounts__mountTypesCounter=WoWReforgedMounts__mountTypesCounter + 1 - call WoWReforgedMounts__MakeMountTypesNotAvailable(udg_TmpAbilityCode) - set udg_TmpBoolean=false - set udg_TmpString="" - 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) >= 55 or (IsPlayerInForce((owner), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! - if ( AccountCanBuyMount(GetPlayerName(owner) , 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 20 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: " + s__WoWReforgedMounts__M_accountNames[m]) - endif - else - call SimError(owner , "Bonus mounts require VIPs, hero level 55 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 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 - // all races - if ( buildingID == POWER_GENERATOR ) then - return ITEM_TINY_POWER_GENERATOR - elseif ( buildingID == PORTAL ) then - return ITEM_TINY_PORTAL - elseif ( buildingID == RESEARCH_TENT ) then - return ITEM_TINY_RESEARCH_TENT - elseif ( buildingID == CRAFTING_STASH ) then - return ITEM_TINY_CRAFTING_STASH - elseif ( buildingID == ARMORY ) then - return ITEM_TINY_ARMORY - elseif ( ((buildingID) == WALL) ) then // INLINED!! - return ITEM_TINY_WALL - elseif ( buildingID == TRADING_POST ) then - return ITEM_TINY_TRADING_POST - elseif ( buildingID == WITCH_HUT ) then - return ITEM_TINY_WITCH_HUT - elseif ( buildingID == HERO_ABILITIES ) then - return ITEM_TINY_HERO_ABILITIES - elseif ( buildingID == SKINS ) then - return ITEM_TINY_SKINS - elseif ( buildingID == FRUIT_STAND_ALL_RACES ) then - return ITEM_TINY_FRUIT_STAND_ALL_RACES - elseif ( buildingID == THIEVES_GUILD ) then - return ITEM_TINY_THIEVES_GUILD - elseif ( buildingID == MOUNTS_CAGE ) then - return ITEM_TINY_MOUNTS_CAGE - elseif ( buildingID == DRAGON_ROOST ) then - return ITEM_TINY_DRAGON_ROOST - // clans - elseif ( buildingID == CLAN_HALL ) then - return ITEM_TINY_CLAN_HALL - elseif ( buildingID == CLAN_TOWER ) then - return ITEM_TINY_CLAN_TOWER - elseif ( buildingID == ADVANCED_CLAN_TOWER ) then - return ITEM_TINY_CLAN_TOWER - // Engineer - elseif ( buildingID == CHEST ) then - return ITEM_TINY_CHEST - // Profession Engineer - elseif ( buildingID == FLAME_TOWER ) then - return ITEM_TINY_FLAME_TOWER - elseif ( buildingID == ADVANCED_FLAME_TOWER ) then - return ITEM_TINY_FLAME_TOWER - elseif ( buildingID == COLD_TOWER ) then - return ITEM_TINY_COLD_TOWER - elseif ( buildingID == ADVANCED_COLD_TOWER ) then - return ITEM_TINY_COLD_TOWER - elseif ( buildingID == DEATH_TOWER ) then - return ITEM_TINY_DEATH_TOWER - elseif ( buildingID == ADVANCED_DEATH_TOWER ) then - return ITEM_TINY_DEATH_TOWER - // Profession Farmer - elseif ( buildingID == GRANARY ) then - return ITEM_TINY_GRANARY - // Profession Prospector - elseif ( buildingID == GOLD_PANNING ) then - return ITEM_TINY_GOLD_PANNING - // Profession Lumberjack - elseif ( buildingID == SAWMILL ) then - return ITEM_TINY_SAWMILL - // Profession Thief - elseif ( buildingID == SAFE ) then - return ITEM_TINY_SAFE - elseif ( buildingID == THIEVES_GUILD_THIEF ) then - return ITEM_TINY_THIEVES_GUILD_THIEF - // Profession Astromancer - elseif ( buildingID == ARCANE_OBSERVATORY_ASTROMANCER ) then - return ITEM_TINY_ARCANE_OBSERVATORY_ASTROMANCER - // Profession Warlock - elseif ( buildingID == FEL_FOUNTAIN_WARLOCK ) then - return ITEM_TINY_FEL_FOUNTAIN - // Archaeologist - elseif ( buildingID == EXCAVATION_SITE ) then - return ITEM_EXCAVATION_SITE - // Banners - elseif ( (GetBannerByUnitTypeId((buildingID)) != - 1) ) then // INLINED!! - return MapBannerToItem(buildingID) - endif - return 0 -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,player previousOwner returns nothing - local player owner= GetOwningPlayer(whichUnit) - local integer level= 0 - if ( UnitHasMaxHpResearch(whichUnit , s__R_id[r]) ) then - set level=GetPlayerTechCount(owner, s__R_id[r], false) - if ( previousOwner != null ) then - set level=level - GetPlayerTechCount(previousOwner, s__R_id[r], false) - endif - if ( level > 0 ) then - call ApplyMaxHpResearchEffect(whichUnit , level , r) - endif - endif - set owner=null -endfunction -function ApplyAllMaxHpResearches takes unit whichUnit,player previousOwner returns nothing - local integer i= 0 - loop - exitwhen ( i == MaxHpResearch___researchesCounter ) - call ApplyMaxHpResearch(whichUnit , MaxHpResearch___researches[i] , previousOwner) - 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 ApplyMaxHpResearchesToAllUnits takes player whichPlayer,integer research 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 , null) - set i=i + 1 - endloop - call GroupClear(g) - call DestroyGroup(g) - set g=null -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 - local integer r= GetMaxHpResearch(GetResearched()) - if ( r != 0 ) then - call ApplyMaxHpResearchesToAllUnits(GetOwningPlayer(GetTriggerUnit()) , r) - endif - 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 -//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 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 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_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 InitRaces takes nothing returns nothing - call InitRaceFreelancer() - call InitRaceOldHorde() - call InitRaceAllianceOfLordaeron() - call InitRaceHuman() - call InitRaceOrc() - call InitRaceUndead() - call InitRaceNightElf() - call InitRaceDalaran() - call InitRaceCentaur() - call InitRaceGnoll() - call InitRaceKobold() - call InitRaceQuillboar() - call InitRaceBandit() - call InitRaceDungeon() - call InitRaceDragonkin() -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(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 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +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__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 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___prototype353_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") + + 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 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(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +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!! + call TriggerAddAction(FrameLoader___actionTrigger, (function EnableLogUI)) // INLINED!! + call TriggerAddAction(FrameSaver___saveTrigger, (function HideLogUI)) // INLINED!! + call FrameSaverAddEx(function DisableLogUI , function EnableLogUI) +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 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 WoWReforgedLevels: + + +function AddLevel takes string name,integer itemTypeId,string mapName returns integer + local integer index= WoWReforgedLevels__levelCounter + set WoWReforgedLevels__levelName[index]=name + set WoWReforgedLevels__levelItemTypeId[index]=itemTypeId + set WoWReforgedLevels__levelMapName[index]=mapName + set WoWReforgedLevels__levelCounter=WoWReforgedLevels__levelCounter + 1 + return index +endfunction + +function GetLevelName takes integer level returns string + return WoWReforgedLevels__levelName[level] +endfunction + +function GetLevelItemTypeId takes integer level returns integer + return WoWReforgedLevels__levelItemTypeId[level] +endfunction + +function GetLevelMapName takes integer level returns string + return WoWReforgedLevels__levelMapName[level] +endfunction + +function GetMaxLevels takes nothing returns integer + return WoWReforgedLevels__levelCounter +endfunction + +function GetLevelByItemTypeId takes integer itemTypeId returns integer + local integer i= 0 + loop + exitwhen ( i >= (WoWReforgedLevels__levelCounter) ) // INLINED!! + if ( (WoWReforgedLevels__levelItemTypeId[(i)]) == itemTypeId ) then // INLINED!! + return i + endif + set i=i + 1 + endloop + return - 1 +endfunction + +function ChangeToLevel takes player whichPlayer,integer level returns nothing + if ( (WoWReforgedLevels__levelName[(level)]) != ("AZ") ) then // INLINED!! + call sc__MapChanger_changeMap((WoWReforgedLevels__levelMapName[(level)])) // INLINED!! + else + call h__QuestMessageBJ(bj_FORCE_PLAYER[GetPlayerId(whichPlayer)], bj_QUESTMESSAGE_HINT, "You are in this level.") + endif +endfunction + +function AddLevelPortal takes unit portal returns nothing + local integer i= 0 + call EnablePagedButtons(portal) + set i=0 + loop + exitwhen ( i >= (WoWReforgedLevels__levelCounter) ) // INLINED!! +call AddPagedButtonsId((portal ) , ( (WoWReforgedLevels__levelItemTypeId[(i)])) , PagedButtons_BUTTON_TYPE_ITEM) // INLINED!! + set i=i + 1 + endloop +endfunction + +function WoWReforgedLevels__TriggerConditionSell takes nothing returns boolean + local integer level= GetLevelByItemTypeId(GetItemTypeId(GetSoldItem())) + if ( level != - 1 ) then + call ChangeToLevel(GetOwningPlayer(GetBuyingUnit()) , level) + endif + return false +endfunction + +function WoWReforgedLevels__ForGroupAddLevelPortal takes nothing returns nothing + call AddLevelPortal(GetEnumUnit()) +endfunction + +function WoWReforgedLevels__TimerFunctionAddLevelPortals takes nothing returns nothing + local group g= GetUnitsOfTypeIdAll(LEVEL_PORTAL) + call ForGroupBJ(g, function WoWReforgedLevels__ForGroupAddLevelPortal) + call GroupClear(g) + call DestroyGroup(g) + set g=null + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) +endfunction + +function WoWReforgedLevels__Init takes nothing returns nothing + call AddLevel("AZ" , 'I0T0' , "wowr") // Azeroth + call AddLevel("EC" , 'I0SZ' , "wowr_elvenclan") // Elven Clan + call AddLevel("OT" , 'I12N' , "wowr_orgrimmar_tunnels") // Orgrimmar Tunnels + call AddLevel("FW" , 'I148' , "wowr_felwood") // Felwood + call AddLevel("AV" , 'I14B' , "wowr_ashenvale") // Ashenvale + + call TriggerRegisterAnyUnitEventBJ(WoWReforgedLevels__sellTrigger, EVENT_PLAYER_UNIT_SELL_ITEM) + call TriggerAddCondition(WoWReforgedLevels__sellTrigger, Condition(function WoWReforgedLevels__TriggerConditionSell)) + + call TimerStart(CreateTimer(), 0.0, false, function WoWReforgedLevels__TimerFunctionAddLevelPortals) +endfunction + + +//library WoWReforgedLevels 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 + return GetSpellAbilityId() == HolyNova_ABILITY_ID or GetSpellAbilityId() == HolyNova_ABILITY_ID_2 +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_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_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_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___prototype385_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' ) 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 GetHeroAccountNames takes integer index returns string + return udg_HeroAccountNames[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 AccountCanBuyHero takes string accountName,integer index returns boolean + local string names= (udg_HeroAccountNames[(index)]) // INLINED!! + local integer tokenIndex= 0 + local string name= "" + + if ( StringLength(names) > 0 ) then + loop + set name=StringSplit(names , tokenIndex , ",") + exitwhen ( name == "" or name == null ) + if ( accountName == name ) then + return true + endif + set tokenIndex=tokenIndex + 1 + endloop + + return false + endif + + return true +endfunction + +function PlayerCanBuyHeroEx takes player whichPlayer,integer unitTypeId returns boolean + local integer index= GetHeroIndexByUnitTypeId(unitTypeId) + if ( index > - 1 ) then + return AccountCanBuyHero(GetPlayerName(whichPlayer) , 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 AccountCanBuyHero(GetPlayerName(whichPlayer) , index) ) then + return "Hero is restricted to account." + 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 WoWReforgedMapChanger: + + + /// The name of the gamecache which is used for storing all character data. + /// In a custom campaign no subfolder is used for maps. + /// All map change save games will be saved into this folder. + /// All zone save games come to this folder which do not belong to a savegame name. This folder has to be cleared whenever the game ends or is started newly. Since the ending event cannot be captured the temporary folder is cleared whenever a new campaign is started from the first chapter. + /// Stores the savegame name whenever the user saves the game. A directory is created with the same name which has a backup of all the zone savegames. + + + + function s__MapChanger_mapPath takes string mapName returns string + local string folder= "" + if ( StringLength(s__MapChanger_mapFolder) > 0 ) then + set folder=s__MapChanger_mapFolder + "\\" + endif + return folder + mapName + MAP_VERSION + ".w3x" + endfunction + + function s__MapChanger_saveGameFolder takes string currentSaveGame returns string + if ( currentSaveGame != null and StringLength(currentSaveGame) > 0 ) then + return s__MapChanger_zonesFolder + "\\" + currentSaveGame + endif + // use another folder if these are temporary zone files + return s__MapChanger_temporaryFolder + endfunction + + + + function s__MapChanger_saveGamePath takes string currentSaveGame,string mapName returns string + return s__MapChanger_saveGameFolder(currentSaveGame) + "\\" + mapName + MAP_VERSION + ".w3z" + endfunction + + + function s__MapChanger_currentSaveGamePath takes string mapName returns string + return s__MapChanger_saveGamePath(s__MapChanger_m_currentSaveGame , mapName) + endfunction + + function s__MapChanger_temporarySaveGamePath takes string mapName returns string + return s__MapChanger_saveGamePath("" , mapName) + endfunction + + function s__MapChanger_playerMissionKey takes player whichPlayer returns string + return GetPlayerName(whichPlayer) + endfunction + + + function s__MapChanger_heroMissionKey takes unit hero returns string + local player owner= GetOwningPlayer(hero) + local string index= "0" + if ( (udg_Hero2[GetPlayerId((owner))]) == hero ) then // INLINED!! + set index="1" + elseif ( (udg_Hero3[GetPlayerId((owner))]) == hero ) then // INLINED!! + set index="2" + endif + return (GetPlayerName((owner))) + index // INLINED!! + endfunction + + + function s__MapChanger_storeHeroSinglePlayer takes gamecache cache,unit hero returns nothing + local string missionKey= s__MapChanger_heroMissionKey(hero) + call FlushStoredMission(cache, missionKey) // flush old data, otherwise old inventory might be loaded + call StoreUnit(cache, missionKey, "Hero", hero) + // Store all skill points since they are used to reskill the spells on restoration! They restored character starts with all spells with level 0. + //call StoreInteger(cache, missionKey, "SkillPoints", character.grimoire().totalSkillPoints()) + call StoreInteger(cache, missionKey, "Gold", GetPlayerState(GetOwningPlayer(hero), PLAYER_STATE_RESOURCE_GOLD)) + call StoreInteger(cache, missionKey, "Lumber", GetPlayerState(GetOwningPlayer(hero), PLAYER_STATE_RESOURCE_LUMBER)) + endfunction + + function s__MapChanger_filterUnit takes nothing returns boolean + return not IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) + endfunction + + + function s__MapChanger_storeUnitsSinglePlayer takes gamecache cache,player whichPlayer,real x,real y returns nothing + local string missionKey= (GetPlayerName((whichPlayer))) + "Units" // INLINED!! + local integer i= 0 + local group whichGroup= CreateGroup() + call GroupEnumUnitsInRange(whichGroup, x, y, 900.0, Filter(function s__MapChanger_filterUnit)) + call StoreInteger(cache, missionKey, "Count", BlzGroupGetSize(whichGroup)) + set i=0 + loop + exitwhen ( i == BlzGroupGetSize(whichGroup) ) + if ( StoreUnit(cache, missionKey, I2S(i), BlzGroupUnitAt(whichGroup, i)) ) then + call h__RemoveUnit(BlzGroupUnitAt(whichGroup, i)) + endif + set i=i + 1 + endloop + call GroupClear(whichGroup) + call DestroyGroup(whichGroup) + set whichGroup=null + endfunction + + function s__MapChanger_setupMapTransition takes nothing returns nothing + // Hide transition delay. + call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0) + call ShowInterface(false, 1.0) + call EnableUserControl(false) + call ClearTextMessages() + call ClearSelection() + endfunction + + function s__MapChanger_clearMapTransition takes nothing returns nothing + // Disable the transition mode. NOTE don't play any video in onRestoreCharacter() before. + call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 1.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0) + call ShowInterface(true, 1.0) + call EnableUserControl(true) + endfunction + + function s__MapChanger_getZoneNameIndex takes string levelName returns integer + local integer i= 0 + loop + exitwhen ( i == s__MapChanger_m_saveGamesCounter ) + if ( s__MapChanger_m_saveGames[i] == levelName ) then + return i + endif + set i=i + 1 + endloop + + return - 1 + endfunction + + function s__MapChanger_addZoneName takes string levelName returns nothing + set s__MapChanger_m_saveGames[s__MapChanger_m_saveGamesCounter]=levelName + set s__MapChanger_m_saveGamesCounter=s__MapChanger_m_saveGamesCounter + 1 + endfunction + + + function s__MapChanger_markCurrentSaveGame takes nothing returns boolean + local string levelName= ("AZ") // INLINED!! + local integer index= s__MapChanger_getZoneNameIndex(levelName) + + if ( index == - 1 ) then + call s__MapChanger_addZoneName(levelName) + endif + + return true + endfunction + + + function s__MapChanger_zoneHasSaveGame takes string targetZoneName returns boolean + return s__MapChanger_getZoneNameIndex(targetZoneName) != - 1 + endfunction + + + function s__MapChanger_storeSaveGames takes gamecache cache returns nothing + local integer i= 0 + call FlushStoredMission(cache, "ZoneSaveGames") + loop + exitwhen ( i == s__MapChanger_m_saveGamesCounter ) + call StoreBoolean(cache, "ZoneSaveGames", s__MapChanger_m_saveGames[i], true) + set i=i + 1 + endloop + endfunction + + + function s__MapChanger_restoreSaveGames takes gamecache cache returns nothing + local string levelName= null + local integer i= 0 + // clear all old entries before + set s__MapChanger_m_saveGamesCounter=0 + loop + exitwhen ( i == (WoWReforgedLevels__levelCounter) ) // INLINED!! + set levelName=(WoWReforgedLevels__levelName[(i)]) // INLINED!! + if ( HaveStoredBoolean(cache, "ZoneSaveGames", levelName) ) then + if ( s__MapChanger_getZoneNameIndex(levelName) == - 1 ) then + call s__MapChanger_addZoneName(levelName) + endif + endif + set i=i + 1 + endloop + endfunction + + + function s__MapChanger_storeHeroesSinglePlayer takes string zone returns boolean + local gamecache cache= InitGameCache(s__MapChanger_gameCacheName) + local unit hero= null + local integer i= 0 + call s__MapChanger_setupMapTransition() + // Store all characters. + set i=0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set hero=(udg_Hero[GetPlayerId((Player(i)))]) // INLINED!! + if ( hero != null ) then + call s__MapChanger_storeHeroSinglePlayer(cache , hero) + call SetUnitInvulnerable(hero, true) // Protect from any damage during the delay, but after saving the character in the game cache. + call s__MapChanger_storeUnitsSinglePlayer(cache , Player(i) , GetUnitX(hero) , GetUnitY(hero)) + endif + set i=i + 1 + endloop + call StoreBoolean(cache, "Stored", "Stored", true) + // the current save game name has to be stored to know from where the save games have to be copied + call StoreString(cache, "CurrentSaveGame", "CurrentSaveGame", s__MapChanger_m_currentSaveGame) + call StoreString(cache, "Zone", "Zone", zone) + + // Store all save game flags + call s__MapChanger_storeSaveGames(cache) + + call SaveGameCache(cache) + set cache=null + + return true + endfunction + + + function s__MapChanger_heroesExistSinglePlayer takes nothing returns boolean + local gamecache cache= null + local boolean result= false + if ( ReloadGameCachesFromDisk() ) then + set cache=InitGameCache(s__MapChanger_gameCacheName) + set result=HaveStoredBoolean(cache, "Stored", "Stored") + set cache=null + endif + + return result + endfunction + + function s__MapChanger_restoreUnitsSinglePlayer takes gamecache cache,player whichPlayer,real x,real y,real facing,string levelFrom returns nothing + local string missionKey= (GetPlayerName((whichPlayer))) + "Units" // INLINED!! + local integer count= GetStoredInteger(cache, missionKey, "Count") + local integer i= 0 + loop + exitwhen ( i >= count ) + call OnRestoreUnit(whichPlayer , RestoreUnit(cache, missionKey, I2S(i), whichPlayer, x, y, facing) , levelFrom) + set i=i + 1 + endloop + endfunction + + function s__MapChanger_selectAndMoveCamera takes unit restoredUnit,player whichPlayer returns nothing + call SelectUnitForPlayerSingle(restoredUnit, whichPlayer) + //debug call BJDebugMsg("After selecting character " + GetUnitName(restoredUnit) + " for player " + GetPlayerName(whichPlayer)) + call SetCameraPositionForPlayer(whichPlayer, GetUnitX(restoredUnit), GetUnitY(restoredUnit)) + endfunction + + + function s__MapChanger_restoreHeroSinglePlayer takes gamecache cache,player whichPlayer,real x,real y,real facing,string levelFrom returns nothing + local string missionKey= (GetPlayerName((whichPlayer))) // INLINED!! + local unit restoredUnit= RestoreUnit(cache, missionKey, "Hero", whichPlayer, x, y, facing) + + if ( (udg_Hero[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call h__RemoveUnit((udg_Hero[GetPlayerId((whichPlayer))])) // INLINED!! + endif + + call SetPlayerHero1(whichPlayer , restoredUnit) + call OnRestoreUnit(whichPlayer , restoredUnit , levelFrom) + + call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_GOLD, GetStoredInteger(cache, missionKey, "Gold")) + call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_LUMBER, GetStoredInteger(cache, missionKey, "Lumber")) + + call s__MapChanger_restoreUnitsSinglePlayer(cache , whichPlayer , x , y , facing , levelFrom) + + // Since the character traveled for some time fill stats. + call SetUnitLifePercentBJ(restoredUnit, 100.0) + call SetUnitManaPercentBJ(restoredUnit, 100.0) + + // NOTE works not on the load event. + call s__MapChanger_selectAndMoveCamera(restoredUnit , whichPlayer) + endfunction + + function s__MapChanger_restoreHeroesSinglePlayer takes nothing returns nothing + local gamecache cache= null + local string zone= null + local real x= 0.0 + local real y= 0.0 + local real facing= 0.0 + local integer i= 0 + if ( ReloadGameCachesFromDisk() ) then + set cache=InitGameCache(s__MapChanger_gameCacheName) + // the zone from which they come, this helps to place the character at the correct position + set zone=GetStoredString(cache, "Zone", "Zone") + // the current save game which is used as folder name for all zone savegames + set s__MapChanger_m_currentSaveGame=GetStoredString(cache, "CurrentSaveGame", "CurrentSaveGame") + + // Restore all save game flags + call s__MapChanger_restoreSaveGames(cache) + + set i=0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then + // Do not restore at (0 | 0). The region will be discovered otherwise. + set x=GetMapStartX(Player(i) , zone) + set y=GetMapStartY(Player(i) , zone) + set facing=GetMapStartFacing(Player(i) , zone) + call s__MapChanger_restoreHeroSinglePlayer(cache , Player(i) , x , y , facing , zone) + endif + set i=i + 1 + endloop + + call s__MapChanger_clearMapTransition() + set cache=null + endif + endfunction + + function s__MapChanger_forGroupBanMagic takes nothing returns nothing + if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_SUMMONED) ) then + call h__RemoveUnit(GetEnumUnit()) + else + call UnitRemoveBuffsBJ(bj_REMOVEBUFFS_ALL, GetEnumUnit()) + endif + endfunction + + function s__MapChanger_removeBuffsAndSummonedUnits takes nothing returns nothing + local group whichGroup= CreateGroup() + call GroupEnumUnitsInRect(whichGroup, GetPlayableMapRect(), null) + call ForGroup(whichGroup, function s__MapChanger_forGroupBanMagic) + call GroupClear(whichGroup) + call DestroyGroup(whichGroup) + set whichGroup=null + endfunction + + + function s__MapChanger_changeMapSinglePlayer takes string oldMap,string newMap returns nothing + local string savePath= (s__MapChanger_saveGamePath("" , (oldMap))) // INLINED!! + local string loadPath= (s__MapChanger_saveGamePath("" , (newMap))) // INLINED!! + local string nextLevelPath= s__MapChanger_mapPath(newMap) + // removing buffs and summoned units is also done in the Bonus Campaign, probably it indicates the elapsed time after a transition + call ForForce(bj_FORCE_PLAYER[0], (function s__MapChanger_removeBuffsAndSummonedUnits)) // New Op Limit // INLINED!! + + + if ( not s__MapChanger_markCurrentSaveGame() ) then + return + endif + + if ( not sc__MapChanger_storeHeroesSinglePlayerNewOpLimit(oldMap) ) then // New Op Limit + return + endif + + call SaveGame(savePath) + + if ( (s__MapChanger_getZoneNameIndex((newMap)) != - 1) and SaveGameExists(loadPath) ) then // INLINED!! + call LoadGame(loadPath, false) + else + call ChangeLevel(nextLevelPath, false) + endif + endfunction + + function s__MapChanger_storeHeroesSinglePlayerNewOpLimit takes string zone returns boolean + return s__MapChanger_storeHeroesSinglePlayer(zone) + endfunction + + function s__MapChanger_changeMap takes string newMap returns nothing + if ( udg_LevelsEnabled ) then + // changing map with saving the game does only work in campaign mode + if ( IsInSinglePlayer() ) then + if ( StringLength(("wowr" + MAP_VERSION + ".w3x")) > 0 ) then // INLINED!! + // TODO Generate savecodes before. + call s__MapChanger_changeMapSinglePlayer(("wowr" + MAP_VERSION + ".w3x") , newMap) // INLINED!! + else + call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_WARNING, "The zone name of this map has not been specified.") + endif + else + call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_HINT, "The map can only be changed singleplayer.") + endif + else + call h__QuestMessageBJ(GetPlayersAll(), bj_QUESTMESSAGE_HINT, "Level changes are disabled and only work in singleplayer. Use the chat command \"-levels\" to enable them.") + endif + endfunction + + function s__MapChanger_triggerConditionLoadTransition takes nothing returns boolean + return IsMapFlagSet(MAP_RELOADED) and IsInSinglePlayer() + endfunction + + function s__MapChanger_timerFunctionSelectAndMoveCamera takes nothing returns nothing + local player slotPlayer= null + local integer i= 0 + loop + exitwhen ( i == bj_MAX_PLAYERS ) + set slotPlayer=Player(i) + if ( (udg_Hero[GetPlayerId((slotPlayer))]) != null ) then // INLINED!! + call s__MapChanger_selectAndMoveCamera((udg_Hero[GetPlayerId((slotPlayer))]) , slotPlayer) // INLINED!! + endif + set slotPlayer=null + set i=i + 1 + endloop + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) + endfunction + + function s__MapChanger_triggerActionLoadTransition takes nothing returns nothing + local timer tmpTimer= null + call s__MapChanger_restoreHeroesSinglePlayer() + // start temporary 0 timer for selection and camera position, since it cannot be done without a delay on initialization + set tmpTimer=CreateTimer() + call TimerStart(tmpTimer, 0.0, false, function s__MapChanger_timerFunctionSelectAndMoveCamera) + endfunction + + function s__MapChanger_triggerConditionLoadUser takes nothing returns boolean + return not IsMapFlagSet(MAP_RELOADED) and IsInSinglePlayer() + endfunction + + /// Copy all to the temporary folder. + function s__MapChanger_triggerActionLoadUser takes nothing returns nothing + local string levelName= null + local string zoneSaveGame= null + local string zoneTargetSaveGame= null + local integer i= 0 + call RemoveSaveDirectory(s__MapChanger_temporaryFolder) + set i=0 + loop + exitwhen ( i == (WoWReforgedLevels__levelCounter) ) // INLINED!! + set levelName=(WoWReforgedLevels__levelName[(i)]) // INLINED!! + set zoneSaveGame=(s__MapChanger_saveGamePath(s__MapChanger_m_currentSaveGame , (levelName))) // INLINED!! + if ( (s__MapChanger_getZoneNameIndex((levelName)) != - 1) and SaveGameExists(zoneSaveGame) ) then // INLINED!! + set zoneTargetSaveGame=(s__MapChanger_saveGamePath("" , (levelName))) // INLINED!! + call CopySaveGame(zoneSaveGame, zoneTargetSaveGame) + endif + set i=i + 1 + endloop + endfunction + + function s__MapChanger_triggerConditionSaveUser takes nothing returns boolean + return IsInSinglePlayer() + endfunction + + + function s__MapChanger_triggerActionSaveUser takes nothing returns nothing + local string levelName= null + local string zoneSaveGame= null + local string zoneTargetSaveGame= null + local integer i= 0 + // Remove existing zones directory if a savegame already existed with the same name, otherwise old zone save games will remain. + call RemoveSaveDirectory(s__MapChanger_saveGameFolder(GetSaveBasicFilename())) + // Copy savegames for all zones into the new directory. Consider that every map needs ALL zones therefore. Disable unused zones in the map. + loop + exitwhen ( i == (WoWReforgedLevels__levelCounter) ) // INLINED!! + set levelName=(WoWReforgedLevels__levelName[(i)]) // INLINED!! + set zoneSaveGame=(s__MapChanger_saveGamePath("" , (levelName))) // INLINED!! + if ( (s__MapChanger_getZoneNameIndex((levelName)) != - 1) and SaveGameExists(zoneSaveGame) ) then // INLINED!! + set zoneTargetSaveGame=s__MapChanger_saveGamePath(GetSaveBasicFilename() , levelName) + call CopySaveGame(zoneSaveGame, zoneTargetSaveGame) + endif + set i=i + 1 + endloop + + set s__MapChanger_m_currentSaveGame=GetSaveBasicFilename() + endfunction + + function s__MapChanger_onInit takes nothing returns nothing + + set s__MapChanger_m_loadTriggerTransition=CreateTrigger() + call TriggerRegisterGameEvent(s__MapChanger_m_loadTriggerTransition, EVENT_GAME_LOADED) + call TriggerAddCondition(s__MapChanger_m_loadTriggerTransition, Condition(function s__MapChanger_triggerConditionLoadTransition)) + call TriggerAddAction(s__MapChanger_m_loadTriggerTransition, function s__MapChanger_triggerActionLoadTransition) + + + set s__MapChanger_m_loadTriggerUser=CreateTrigger() + call TriggerRegisterGameEvent(s__MapChanger_m_loadTriggerUser, EVENT_GAME_LOADED) + call TriggerAddCondition(s__MapChanger_m_loadTriggerUser, Condition(function s__MapChanger_triggerConditionLoadUser)) + call TriggerAddAction(s__MapChanger_m_loadTriggerUser, function s__MapChanger_triggerActionLoadUser) + + + set s__MapChanger_m_saveTriggerUser=CreateTrigger() + call TriggerRegisterGameEvent(s__MapChanger_m_saveTriggerUser, EVENT_GAME_SAVE) + call TriggerAddCondition(s__MapChanger_m_saveTriggerUser, Condition(function s__MapChanger_triggerConditionSaveUser)) + call TriggerAddAction(s__MapChanger_m_saveTriggerUser, function s__MapChanger_triggerActionSaveUser) + + set s__MapChanger_m_currentSaveGame=null + set s__MapChanger_m_saveGamesCounter=0 + + // If the campaign is started completely new without loading it, the temporary folder should be cleared. Otherwise wrong zone save games from the last game might be used. + if ( IsInSinglePlayer() and not IsMapFlagSet(MAP_RELOADED) ) then + call RemoveSaveDirectory(s__MapChanger_temporaryFolder) + endif + endfunction + +function ChangeMap takes string newMap returns nothing + call s__MapChanger_changeMap(newMap) +endfunction + +function ChangeMapWoWReforged takes nothing returns nothing + call s__MapChanger_changeMap((udg_TmpString)) // INLINED!! +endfunction + + +//library WoWReforgedMapChanger 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 RandomizeHeroSkin takes unit hero returns boolean + local integer unitTypeId= GetUnitTypeId(hero) + local player owner= GetOwningPlayer(hero) + if ( IsCustomizableHero(unitTypeId) ) then + call BlzSetUnitSkin(hero, (WoWReforgedSkins__skinUnitTypeId[(GetRandomInt(0, WoWReforgedSkins__skinCounter - 1))])) // INLINED!! + + 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 integer itemTypeId= GetItemTypeId(GetSoldItem()) + local integer shopUnitTypeId= GetUnitTypeId(shop) + local integer index= GetSkinByItemTypeId(itemTypeId) + if ( index != - 1 ) then + if ( IsCustomizableHero(unitTypeId) ) then + 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 , "Only customizable heroes can change their skin.") + endif + endif + 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,string accountNames,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_accountNames[this]=accountNames + 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 AccountCanBuyMount takes string accountName,integer mount returns boolean + local string names= s__WoWReforgedMounts__M_accountNames[mount] + local integer tokenIndex= 0 + local string name= "" + + if ( StringLength(names) > 0 ) then + loop + set name=StringSplit(names , tokenIndex , ",") + exitwhen ( name == "" or name == null ) + if ( accountName == name ) then + return true + endif + set tokenIndex=tokenIndex + 1 + endloop + + return false + endif + + return true +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_TmpString , udg_TmpBoolean) + set WoWReforgedMounts__mountTypes[index]=m + set WoWReforgedMounts__mountTypesCounter=WoWReforgedMounts__mountTypesCounter + 1 + call WoWReforgedMounts__MakeMountTypesNotAvailable(udg_TmpAbilityCode) + set udg_TmpBoolean=false + set udg_TmpString="" + 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) >= 55 or (IsPlayerInForce((owner), WoWReforgedVIPs__vipPlayers)) ) then // INLINED!! + if ( AccountCanBuyMount(GetPlayerName(owner) , 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 20 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: " + s__WoWReforgedMounts__M_accountNames[m]) + endif + else + call SimError(owner , "Bonus mounts require VIPs, hero level 55 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 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 + // all races + if ( buildingID == POWER_GENERATOR ) then + return ITEM_TINY_POWER_GENERATOR + elseif ( buildingID == PORTAL ) then + return ITEM_TINY_PORTAL + elseif ( buildingID == RESEARCH_TENT ) then + return ITEM_TINY_RESEARCH_TENT + elseif ( buildingID == CRAFTING_STASH ) then + return ITEM_TINY_CRAFTING_STASH + elseif ( buildingID == ARMORY ) then + return ITEM_TINY_ARMORY + elseif ( ((buildingID) == WALL) ) then // INLINED!! + return ITEM_TINY_WALL + elseif ( buildingID == TRADING_POST ) then + return ITEM_TINY_TRADING_POST + elseif ( buildingID == WITCH_HUT ) then + return ITEM_TINY_WITCH_HUT + elseif ( buildingID == HERO_ABILITIES ) then + return ITEM_TINY_HERO_ABILITIES + elseif ( buildingID == SKINS ) then + return ITEM_TINY_SKINS + elseif ( buildingID == FRUIT_STAND_ALL_RACES ) then + return ITEM_TINY_FRUIT_STAND_ALL_RACES + elseif ( buildingID == THIEVES_GUILD ) then + return ITEM_TINY_THIEVES_GUILD + elseif ( buildingID == MOUNTS_CAGE ) then + return ITEM_TINY_MOUNTS_CAGE + elseif ( buildingID == DRAGON_ROOST ) then + return ITEM_TINY_DRAGON_ROOST + // clans + elseif ( buildingID == CLAN_HALL ) then + return ITEM_TINY_CLAN_HALL + elseif ( buildingID == CLAN_TOWER ) then + return ITEM_TINY_CLAN_TOWER + elseif ( buildingID == ADVANCED_CLAN_TOWER ) then + return ITEM_TINY_CLAN_TOWER + // Engineer + elseif ( buildingID == CHEST ) then + return ITEM_TINY_CHEST + // Profession Engineer + elseif ( buildingID == FLAME_TOWER ) then + return ITEM_TINY_FLAME_TOWER + elseif ( buildingID == ADVANCED_FLAME_TOWER ) then + return ITEM_TINY_FLAME_TOWER + elseif ( buildingID == COLD_TOWER ) then + return ITEM_TINY_COLD_TOWER + elseif ( buildingID == ADVANCED_COLD_TOWER ) then + return ITEM_TINY_COLD_TOWER + elseif ( buildingID == DEATH_TOWER ) then + return ITEM_TINY_DEATH_TOWER + elseif ( buildingID == ADVANCED_DEATH_TOWER ) then + return ITEM_TINY_DEATH_TOWER + // Profession Farmer + elseif ( buildingID == GRANARY ) then + return ITEM_TINY_GRANARY + // Profession Prospector + elseif ( buildingID == GOLD_PANNING ) then + return ITEM_TINY_GOLD_PANNING + // Profession Lumberjack + elseif ( buildingID == SAWMILL ) then + return ITEM_TINY_SAWMILL + // Profession Thief + elseif ( buildingID == SAFE ) then + return ITEM_TINY_SAFE + elseif ( buildingID == THIEVES_GUILD_THIEF ) then + return ITEM_TINY_THIEVES_GUILD_THIEF + // Profession Astromancer + elseif ( buildingID == ARCANE_OBSERVATORY_ASTROMANCER ) then + return ITEM_TINY_ARCANE_OBSERVATORY_ASTROMANCER + // Profession Warlock + elseif ( buildingID == FEL_FOUNTAIN_WARLOCK ) then + return ITEM_TINY_FEL_FOUNTAIN + // Archaeologist + elseif ( buildingID == EXCAVATION_SITE ) then + return ITEM_EXCAVATION_SITE + // Banners + elseif ( (GetBannerByUnitTypeId((buildingID)) != - 1) ) then // INLINED!! + return MapBannerToItem(buildingID) + endif + + return 0 +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,player previousOwner returns nothing + local player owner= GetOwningPlayer(whichUnit) + local integer level= 0 + if ( UnitHasMaxHpResearch(whichUnit , s__R_id[r]) ) then + set level=GetPlayerTechCount(owner, s__R_id[r], false) + if ( previousOwner != null ) then + set level=level - GetPlayerTechCount(previousOwner, s__R_id[r], false) + endif + if ( level > 0 ) then + call ApplyMaxHpResearchEffect(whichUnit , level , r) + endif + endif + set owner=null +endfunction + +function ApplyAllMaxHpResearches takes unit whichUnit,player previousOwner returns nothing + local integer i= 0 + loop + exitwhen ( i == MaxHpResearch__researchesCounter ) + call ApplyMaxHpResearch(whichUnit , MaxHpResearch__researches[i] , previousOwner) + 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 ApplyMaxHpResearchesToAllUnits takes player whichPlayer,integer research 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 , null) + set i=i + 1 + endloop + call GroupClear(g) + call DestroyGroup(g) + set g=null +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 + local integer r= GetMaxHpResearch(GetResearched()) + if ( r != 0 ) then + call ApplyMaxHpResearchesToAllUnits(GetOwningPlayer(GetTriggerUnit()) , r) + endif + 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 + + +//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 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 - 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 +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 - set hero1=null - set slotPlayer=null 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 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_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 GetBackpackUpdateLocatiomTimerHandleId takes nothing returns integer - return GetHandleId(WoWReforgedBackpacks___BackpackUpdateLocationTimer) -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) -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 + // 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 -//library WoWReforgedBackpacks ends -//library WoWReforgedBackpackUI: +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) -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 + // 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 BackpackUIExists takes nothing returns boolean - return WoWReforgedBackpackUI___BackpackBackgroundFrame != null -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) -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 + // 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 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 +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 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 +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 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 +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 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 +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 BackpackClickItemFunction takes nothing returns nothing - if ( GetLocalPlayer() == GetTriggerPlayer() ) then - call WoWReforgedBackpackUI___SyncBag() - endif +function InitRaces takes nothing returns nothing + call InitRaceFreelancer() + call InitRaceOldHorde() + call InitRaceAllianceOfLordaeron() + call InitRaceHuman() + call InitRaceOrc() + call InitRaceUndead() + call InitRaceNightElf() + call InitRaceDalaran() + call InitRaceCentaur() + call InitRaceGnoll() + call InitRaceKobold() + call InitRaceQuillboar() + call InitRaceBandit() + call InitRaceDungeon() + call InitRaceDragonkin() 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" +//library WoWReforgedAllRaces ends +//library WoWReforgedCalendar: - 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 +//processed: function interface CalendarEventFunction takes CalendarEvent e returns nothing - 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 +function GetCalendarChangeSecondTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedCalendar__changeSecondTimer) 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 +function GetCalendarThunderTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedCalendar__thunderTimer) 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()) +function GetCalendarWeatherTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedCalendar__weatherTimer) endfunction -function WoWReforgedBackpackUI___CheckboxEnterItemFunction takes nothing returns nothing - local integer playerId= GetPlayerId(GetTriggerPlayer()) - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "Hide bag numbers.") +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 WoWReforgedBackpackUI___CheckboxLeaveItemFunction takes nothing returns nothing - local integer playerId= GetPlayerId(GetTriggerPlayer()) - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "") +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 WoWReforgedBackpackUI___CloseFunction takes nothing returns nothing - call HideBackpackUI(GetTriggerPlayer()) +function GetCalendarEventsMax takes nothing returns integer + return WoWReforgedCalendar__calendarEventsCounter 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) +function GetCalendarEvent takes integer index returns integer + return WoWReforgedCalendar__calendarEvents[index] +endfunction - 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) +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 x=x + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SPACE + set udg_TmpString=name + set udg_TmpString2=vote + set udg_TmpTrigger=s__CalendarEvent_voteTrigger[e] + call AddWowReforgedVote() + + return e +endfunction - set j=j + 1 - endloop +// 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 - // 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 +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 - 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) +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) - 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) + return t +endfunction - 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) +function GetTreeMappingById takes integer id returns integer + if ( HaveSavedInteger(WoWReforgedCalendar__h, id, 0) ) then + return LoadInteger(WoWReforgedCalendar__h, id, 0) + endif + return 0 +endfunction - 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) +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 - 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 SaveInteger(WoWReforgedCalendar__h, summerId, 0, t) + call SaveInteger(WoWReforgedCalendar__h, fallId, 0, t) + call SaveInteger(WoWReforgedCalendar__h, winterId, 0, t) - //call FrameSaverAdd(function HideBackpackUIForAllPlayers) + return t endfunction +function GetTileMappingById takes integer id returns integer + return LoadInteger(WoWReforgedCalendar__h, id, 0) +endfunction -//library WoWReforgedBackpackUI ends -//library WoWReforgedComputer: +function GetCurrentWeatherIcon takes nothing returns string + if ( WoWReforgedCalendar__weatherRunning ) then + return "ReplaceableTextures\\CommandButtons\\BTNRainyWeather.blp" + endif + return "ReplaceableTextures\\CommandButtons\\BTNOrbOfTheSun.blp" +endfunction -function GetComputerAINavy takes player whichPlayer returns group - return udg_ComputerNavy[GetPlayerId(whichPlayer)] +function GetCurrentWeatherName takes nothing returns string + if ( WoWReforgedCalendar__weatherRunning ) then + return "Bad" + endif + return "Good" 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) +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 - set targetRect=null + return "Winter" endfunction -function ComputerAINavyIsReadyForAttack takes player whichPlayer returns boolean - return BlzGroupGetSize((udg_ComputerNavy[GetPlayerId((whichPlayer))])) >= 5 // INLINED!! +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 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 +function GetCurrentSeason takes nothing returns integer + return WoWReforgedCalendar__season 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!! +function GetPassedTime takes nothing returns integer + return udg_GameTime endfunction -function WoWReforgedComputer__IsRaceWorker takes integer r,integer unitTypeId returns boolean - return r != udg_RaceNone and unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_WORKER)) // INLINED!! +function GetCurrentDay takes nothing returns integer + return WoWReforgedCalendar__days 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 +function GetCurrentYear takes nothing returns integer + return WoWReforgedCalendar__years 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 +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 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 +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 WoWReforgedComputer__ForGroupAutoLoadMine takes nothing returns nothing - call WoWReforgedComputer__AutoLoadMineAI(GetEnumUnit()) +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 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 - call h__DisplayTimedTextToForce(GetPlayersAll(), 4.0, "Auto loaded " + I2S(WoWReforgedComputer__autoLoadMineCounter) + " workers for player " + GetPlayerNameColored(whichPlayer)) - set mines=null +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 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) + +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 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) +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 WoWReforgedComputer__FilterFunctionIsMine takes nothing returns boolean - return GetUnitTypeId(GetFilterUnit()) == GOLD_MINE +function WoWReforgedCalendar__ReplaceTreeNewOpLimit takes nothing returns nothing + call ForForce(bj_FORCE_PLAYER[0], (function WoWReforgedCalendar__ReplaceTree)) // INLINED!! 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 +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 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) +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 ) - call StartingUnitsReplaceMine(whichPlayer , BlzGroupUnitAt(mines, i) , whichRace) + 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 - 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 +function WoWReforgedCalendar__ReplaceWithWinterTrees takes nothing returns nothing + call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , SEASON_WINTER) 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 +function WoWReforgedCalendar__ReplaceWithSummerTrees takes nothing returns nothing + call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , SEASON_SUMMER) endfunction -function StartingUnitsAndPickAI takes player whichPlayer,location l,integer whichRace returns nothing - call StartingUnitsAndPickAIEx(whichPlayer , l , whichRace , false) +function WoWReforgedCalendar__ReplaceWithFallTrees takes nothing returns nothing + call WoWReforgedCalendar__ReplaceAffectedWithTrees(WoWReforgedCalendar__season , SEASON_FALL) 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 +function WoWReforgedCalendar__GetEffectIndex takes integer zoneIndex,integer rectIndex returns integer + return Index2D(zoneIndex , rectIndex , MAX_ZONE_RECTS) 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) +function WoWReforgedCalendar__HasWeather takes integer t returns boolean + return t != TERRAIN_TYPE_NONE endfunction -function WoWReforgedComputer__ForGroupRemoveUnit takes nothing returns nothing - call DropItemsFromHero(GetEnumUnit()) - call h__RemoveUnit(GetEnumUnit()) +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 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 +function WoWReforgedCalendar__ForForceAddWeatherResourceBonus takes nothing returns nothing + call AddPlayerResourceBonus(GetEnumPlayer() , udg_ResourceWater , 20) 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 +function WoWReforgedCalendar__ForForceRemoveWeatherResourceBonus takes nothing returns nothing + call RemovePlayerResourceBonus(GetEnumPlayer() , udg_ResourceWater , 20) endfunction -function BecomeDemigodLight takes unit hero returns unit - return BecomeDemigod(hero , DEMIGOD_LIGHT) +function WoWReforgedCalendar__AddWeatherResourceBonus takes nothing returns nothing + call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceAddWeatherResourceBonus) endfunction -function BecomeDemigodDark takes unit hero returns unit - return BecomeDemigod(hero , DEMIGOD_DARK) +function WoWReforgedCalendar__RemoveWeatherResourceBonus takes nothing returns nothing + call ForForce(GetPlayersAll(), function WoWReforgedCalendar__ForForceRemoveWeatherResourceBonus) endfunction -function GetUnitsInRectOfPlayerAndTypeFilter takes nothing returns boolean - return GetOwningPlayer(GetFilterUnit()) == bj_groupEnumOwningPlayer and GetUnitTypeId(GetFilterUnit()) == bj_groupEnumTypeId +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 CountDemigodDragonsEx takes player whichPlayer,integer unitTypeId,rect whichRect returns integer +function WoWReforgedCalendar__RainAddResourceBonus takes rect r returns nothing 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 GroupEnumUnitsInRect(g, r, WoWReforgedCalendar__filterIsMineWithResourceWaterNotFull) + call ForGroup(g, function WoWReforgedCalendar__EnumUnitFillWater) 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) +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 -//library WoWReforgedDemigod ends -//library WoWReforgedHeroTransformation: +function IsCameraInRainyArea takes nothing returns boolean + return IsPointInRegion(WoWReforgedCalendar__rainyRegion, GetCameraTargetPositionX(), GetCameraTargetPositionY()) // async +endfunction -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!! +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 - if ( IsPlayerInForce(GetLocalPlayer(), selectedForce) ) then - // Use only local code (no net traffic) within this block to avoid desyncs. - call SelectUnit(replacedUnit, true) +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 - 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 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 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 +function WoWReforgedCalendar__StartThunder takes nothing returns nothing + call TimerStart(WoWReforgedCalendar__thunderTimer, GetRandomReal(MIN_THUNDER_DURATION, MAX_THUNDER_DURATION), true, function WoWReforgedCalendar__TimerFunctionThunder) endfunction -function AddHeroTransformationItemTypeId takes nothing returns integer - return AddHeroTransformationItemTypeIdEx(udg_TmpItemTypeId , udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpUnitType3) +function WoWReforgedCalendar__TimerFunctionEndWeather takes nothing returns nothing + //call NewOpLimit(function RemoveWeatherEffects) + call PauseTimer(WoWReforgedCalendar__thunderTimer) // INLINED!! endfunction -function AddHeroTransformationAbilityId takes nothing returns integer - return AddHeroTransformationItemTypeIdEx(udg_TmpAbilityCode , udg_TmpUnitType , udg_TmpUnitType2 , udg_TmpUnitType3) +function WoWReforgedCalendar__EndWeather takes nothing returns nothing + call TimerStart(WoWReforgedCalendar__weatherTimer, GetRandomReal(MIN_WEATHER_DURATION, MAX_WEATHER_DURATION), false, function WoWReforgedCalendar__TimerFunctionEndWeather) endfunction -function SetHeroOriginalUnitType takes player owner,integer heroIndex,integer unitTypeId returns nothing - set WoWReforgedHeroTransformation__playerHeroOriginalUnitTypeId[Index2D(GetPlayerId(owner) , 0 , WoWReforgedHeroTransformation__MAX_HEROES)]=unitTypeId +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 GetHeroOriginalUnitType takes player owner,integer heroIndex returns integer - return WoWReforgedHeroTransformation__playerHeroOriginalUnitTypeId[Index2D(GetPlayerId(owner) , 0 , WoWReforgedHeroTransformation__MAX_HEROES)] +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 IsOriginalUnitTypeCustomizableAttributesHero takes unit hero returns boolean - local integer heroIndex= GetPlayerHeroIndex(GetOwningPlayer(hero) , hero) - return heroIndex != - 1 and IsCustomizableAttributesHero(GetHeroOriginalUnitType(GetOwningPlayer(hero) , heroIndex)) +function StartWeatherImmediately takes nothing returns nothing + call TimerStart(WoWReforgedCalendar__weatherTimer, 0.0, false, function WoWReforgedCalendar__TimerFunctionStartWeather) endfunction -function WoWReforgedHeroTransformation__FindMatchingType takes integer id returns integer - local integer i= 0 +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 ( i >= WoWReforgedHeroTransformation__typesCounter ) - if ( s__WoWReforgedHeroTransformation__HeroTransformationItemType_id[(WoWReforgedHeroTransformation__types[i])] == id ) then - return (WoWReforgedHeroTransformation__types[i]) - endif - set i=i + 1 + 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 - 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 +function WoWReforgedCalendar__ReplaceWithTerrainNewOpLmit takes nothing returns nothing + call WoWReforgedCalendar__ReplaceWithTerrain(udg_TmpRect , WoWReforgedCalendar__sourceSeason , WoWReforgedCalendar__targetSeason) endfunction -function WoWReforgedHeroTransformation__TransformByHeroInventory takes unit hero returns nothing - local item slotItem= null +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 - 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 ) + 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 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 +function WoWReforgedCalendar__ReplaceWithWinterTerrain takes nothing returns nothing + call WoWReforgedCalendar__ReplaceAffectedWithTerrain((WoWReforgedCalendar__season) , SEASON_WINTER) // INLINED!! 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 +function WoWReforgedCalendar__ReplaceWithSummerTerrain takes nothing returns nothing + call WoWReforgedCalendar__ReplaceAffectedWithTerrain((WoWReforgedCalendar__season) , SEASON_SUMMER) // INLINED!! 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 +function WoWReforgedCalendar__ReplaceWithFallTerrain takes nothing returns nothing + call WoWReforgedCalendar__ReplaceAffectedWithTerrain((WoWReforgedCalendar__season) , SEASON_FALL) // INLINED!! endfunction -function WoWReforgedHeroTransformation__TriggerConditionDrop takes nothing returns boolean - return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetPlayerHeroIndex(GetOwningPlayer(GetTriggerUnit()) , GetTriggerUnit()) != - 1 +function WoWReforgedCalendar__ForForceAddFallResourceBonus takes nothing returns nothing + call AddPlayerResourceBonus(GetEnumPlayer() , udg_ResourceGrain , 20) 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 +function WoWReforgedCalendar__ForForceRemoveFallResourceBonus takes nothing returns nothing + call RemovePlayerResourceBonus(GetEnumPlayer() , udg_ResourceGrain , 20) endfunction -function WoWReforgedHeroTransformation__TriggerConditionCast takes nothing returns boolean - return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetPlayerHeroIndex(GetOwningPlayer(GetTriggerUnit()) , GetTriggerUnit()) != - 1 +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 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 +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 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) +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 -//library WoWReforgedHeroTransformation ends -//library WoWReforgedItemUtils: +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 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 +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 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.") +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 - call h__DisplayTextToPlayer(GetOwningPlayer(hero), 0, 0, "Picked up " + I2S(WoWReforgedItemUtils__pickedupItemsCounter) + " items.") + set msg="Next Snowfall/Storm/Rain in " + FormatTime(TimerGetRemaining(WoWReforgedCalendar__weatherTimer)) endif - call RemoveRect(tmpRect) - set tmpRect=null - call RemoveLocation(tmpLocation) - set tmpLocation=null - return WoWReforgedItemUtils__pickedupItemsCounter + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, msg) 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 +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 - call SimError(whichPlayer , "No hero picked.") + set WoWReforgedCalendar__days=WoWReforgedCalendar__days + 1 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 + + 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 - set owner=null + + return false 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.") +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 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 +function EnableCalendar takes nothing returns nothing + call EnableTrigger(WoWReforgedCalendar__changeDayTrigger) + call TimerStart(WoWReforgedCalendar__changeSecondTimer, 0.01, true, function WoWReforgedCalendar__CheckCalendarEvents) + call StartCurrentSeason() 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 +function DisableCalendar takes nothing returns nothing + call DisableTrigger(WoWReforgedCalendar__changeDayTrigger) + call PauseTimer(WoWReforgedCalendar__changeSecondTimer) + call PauseTimer(WoWReforgedCalendar__weatherTimer) + call PauseTimer(WoWReforgedCalendar__thunderTimer) 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 +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 -//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) +function WoWReforgedCalendar__TimerFunctionStartSeason takes nothing returns nothing + call StartCurrentSeason() + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) 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) +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 -//library WoWReforgedNeutralZone ends -//library WoWReforgedPickpocketing: +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 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 +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 == bountyNumberOfDice ) - set bounty=bounty + GetRandomInt(0, bountySidesPerDice) + 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 - - 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 +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 == bountyNumberOfDice ) - set bounty=bounty + GetRandomInt(0, bountySidesPerDice) + 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() - return bounty + 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(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 -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) + +//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 - if ( bountyLumber > 0 ) then - call BountyLumber(whichForce , GetUnitX(whichUnit) - 200.0 , GetUnitY(whichUnit) , bountyLumber) + + 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 - call ForceClear(whichForce) - call DestroyForce(whichForce) - set whichForce=null + + return true 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 +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 - 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 + + call DestroyGroup(g) + set g=null + + return result +endfunction - return stolenItem - endif +function WoWReforgedMassForestation__TriggerConditionCast takes nothing returns boolean + if ( GetSpellAbilityId() == WoWReforgedMassForestation_ABILITY_ID and not MassForestation(GetTriggerUnit() , GetSpellAbilityId() , GetSpellTargetX() , GetSpellTargetY()) ) then + call IssueImmediateOrder(GetTriggerUnit(), "stop") + call SimError(GetOwningPlayer(GetTriggerUnit()) , "No valid targets.") endif + return false +endfunction - call ShowThiefBounty(hero , target) +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 - return null + +//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 WoWReforgedPickpocketing ends -//library WoWReforgedEquipment: +//library WoWReforgedMaxHpResearch ends +//library WoWReforgedPings: -function GetEquipmentItemTypeId takes integer index returns integer - return WoWReforgedEquipment___equipmentItemTypeId[index] +// Non leaking ping functions: + +function PingUnitForPlayer takes unit whichUnit,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetUnitX(whichUnit), GetUnitY(whichUnit), PING_DURATION) endfunction -function GetEquipmentItemTypeCategoryName takes integer index returns string - return WoWReforgedEquipment___equipmentItemTypeCategoryName[index] +function PingUnitForPlayerWoWReforged takes nothing returns nothing + call PingUnitForPlayer(udg_TmpUnit , udg_TmpPlayer) endfunction -function GetEquipmentItemTypeCategory takes integer index returns integer - return WoWReforgedEquipment___equipmentItemTypeCategory[index] +function PingItemForPlayer takes item whichItem,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetItemX(whichItem), GetItemY(whichItem), PING_DURATION) endfunction -function GetEquipmentItemTypeCategoryType takes integer index,integer category returns boolean - local integer i= Index2D(index , category , WoWReforgedEquipment_CATEGORY_TYPE_MAX) - return WoWReforgedEquipment___equipmentItemTypeCategoryType[i] +function PingItemForPlayerWoWReforged takes nothing returns nothing + call PingItemForPlayer(udg_TmpItem , udg_TmpPlayer) 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 +function PingRectForPlayer takes rect whichRect,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetRectCenterX(whichRect), GetRectCenterY(whichRect), PING_DURATION) endfunction -function GetEquipmentTypeAnimation takes integer index returns integer - return WoWReforgedEquipment___equipmentItemTypeAnimation[index] +function PingRectForPlayerWoWReforged takes nothing returns nothing + call PingRectForPlayer(udg_TmpRect , udg_TmpPlayer) endfunction -function SetEquipmentTypeAnimation takes integer index,integer animation returns nothing - set WoWReforgedEquipment___equipmentItemTypeAnimation[index]=animation +function PingDestructableForPlayer takes destructable whichDestructable,player whichPlayer returns nothing + call PingMinimapForPlayer(whichPlayer, GetDestructableX(whichDestructable), GetDestructableY(whichDestructable), PING_DURATION) 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 +function PingDestructableForPlayerWoWReforged takes nothing returns nothing + call PingDestructableForPlayer(udg_TmpDestructible , udg_TmpPlayer) 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 +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 EquipmentCategoryTwoHanded takes nothing returns nothing - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) +function GetBossPingGreen takes unit boss returns integer + if ( GetHeroLevel(boss) >= 65 ) then + return 0 + endif + + return 255 endfunction -function EquipmentCategoryRange takes nothing returns nothing - call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment___equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) +function GetBossPingBlue takes unit boss returns integer + return 0 endfunction -function EquipmentCategoryHead takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_HEAD +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 EquipmentCategoryLeftHand takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_LEFT_HAND +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 EquipmentCategoryRightHand takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND +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 EquipmentCategoryBody takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_BODY +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 EquipmentCategoryFoot takes nothing returns nothing - set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_FOOT +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 EquipmentAnimationShield takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHIELD +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 EquipmentAnimationNoWeapon takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON +function GetAltars takes player whichPlayer returns group + local group g= CreateGroup() + call GroupEnumUnitsOfPlayer(g, whichPlayer, Filter(function IsAltarFilter)) + return g endfunction -function EquipmentAnimationLeftHandWeapon takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON +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 EquipmentAnimationTwoHandHammer takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND_HAMMER +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 EquipmentAnimationTwoWeapons takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_WEAPONS +function WoWReforgedPings__IsResurrectionStoneFilter takes nothing returns boolean + return (IsResurrectionStone(GetUnitTypeId((GetFilterUnit())))) // INLINED!! endfunction -function EquipmentAnimationBow takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_BOW +function GetResurrectionStones takes player whichPlayer returns group + local group g= CreateGroup() + call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function WoWReforgedPings__IsResurrectionStoneFilter)) + return g endfunction -function EquipmentAnimationMinigun takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_MINIGUN +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 EquipmentAnimationTwoHand takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND +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 EquipmentAnimationGun takes nothing returns nothing - set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN +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 GetMaxEquipmentItemTypes takes nothing returns integer - return WoWReforgedEquipment___equipmentTypesCounter +function WoWReforgedPings__IsNpcFilter takes nothing returns boolean + return (GetNpcIndexByUnitTypeId((GetUnitTypeId((GetFilterUnit())))) != - 1) // INLINED!! endfunction -function GetEquipmentItemTypeByItemTypeId takes integer itemTypeId returns integer +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 >= WoWReforgedEquipment___equipmentTypesCounter ) - if ( WoWReforgedEquipment___equipmentItemTypeId[i] == itemTypeId ) then - return i - endif + exitwhen ( i == max ) + call PingNpcForPlayer(BlzGroupUnitAt(g, i) , whichPlayer) set i=i + 1 endloop - return 0 + call GroupClear(g) + call DestroyGroup(g) + set g=null endfunction -function WoWReforgedEquipment___SetUnitEquipmentType takes unit hero,integer c,integer index returns nothing - call SaveInteger(WoWReforgedEquipment___h, GetHandleId(hero), c, index) + +//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 WoWReforgedEquipment___SetUnitEquipmentTypeItem takes unit hero,integer c,item whichItem returns nothing - call SaveItemHandle(WoWReforgedEquipment___h2, GetHandleId(hero), c, whichItem) +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 GetUnitEquipmentType takes unit hero,integer c returns integer - return LoadInteger(WoWReforgedEquipment___h, GetHandleId(hero), c) +function UpdatePortalNameByItself takes unit whichUnit returns nothing + call UpdatePortalName(whichUnit , WaygateIsActive(whichUnit) , WaygateGetDestinationX(whichUnit) , WaygateGetDestinationY(whichUnit)) endfunction -function GetUnitEquipmentTypeItem takes unit hero,integer c returns item - return LoadItemHandle(WoWReforgedEquipment___h2, GetHandleId(hero), c) +function WoWReforgedPortals__FilterIsPortal takes nothing returns boolean + return IsPortal(GetUnitTypeId(GetFilterUnit())) endfunction -function GetUnitEquipmentTypeByHandleId takes integer handleId,integer c returns integer - return LoadInteger(WoWReforgedEquipment___h, handleId, c) +function WoWReforgedPortals__ForGroupUpdateName takes nothing returns nothing + call UpdatePortalNameByItself(GetEnumUnit()) endfunction -function GetUnitEquipmentTypeItemByHandleId takes integer handleId,integer c returns item - return LoadItemHandle(WoWReforgedEquipment___h2, handleId, c) +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 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") +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 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 +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 - - 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 +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 - - 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) +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 - 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 +//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 WoWReforgedEquipment___TriggerConditionIsCustomizableAttriburesHero takes nothing returns boolean - local integer unitTypeId= GetUnitTypeId(GetTriggerUnit()) - return IsCustomizableAttributesHero(unitTypeId) or unitTypeId == ITEM_VALUES_DUMMY_HERO +function ShowCalendarMultiboard takes nothing returns nothing + call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, true) 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 +function HideCalendarMultiboard takes nothing returns nothing + call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, false) 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) +function ShowCalendarMultiboardForPlayer takes player whichPlayer returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, true) // INLINED!! endif - set hero=null endfunction -function WoWReforgedEquipment___TriggerConditionAttack takes nothing returns boolean - return IsCustomizableAttributesHero(BlzGetUnitSkin(GetAttacker())) +function HideCalendarMultiboardForPlayer takes player whichPlayer returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call MultiboardDisplay(WoWReforgedCalendarMultiboard__m, false) // INLINED!! + endif 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!! +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 SetVillager255Animation(hero , VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON) + call MultiboardSetItemIcon(mbitem, "ReplaceableTextures\\CommandButtons\\BTNDay Time2.blp") endif - set hero=null + 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 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) +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) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment___dropTrigger, EVENT_PLAYER_UNIT_DROP_ITEM) - call TriggerAddCondition(WoWReforgedEquipment___dropTrigger, Condition(function WoWReforgedEquipment___TriggerConditionIsCustomizableAttriburesHero)) - call TriggerAddAction(WoWReforgedEquipment___dropTrigger, function WoWReforgedEquipment___TriggerActionDropItem) + set mbitem=MultiboardGetItem(WoWReforgedCalendarMultiboard__m, 5, 1) + call MultiboardSetItemStyle(mbitem, true, true) + call MultiboardSetItemWidth(mbitem, WoWReforgedCalendarMultiboard__SIZE) + call MultiboardReleaseItem(mbitem) - call TriggerRegisterAnyUnitEventBJ(WoWReforgedEquipment___attackTrigger, EVENT_PLAYER_UNIT_ATTACKED) - call TriggerAddCondition(WoWReforgedEquipment___attackTrigger, Condition(function WoWReforgedEquipment___TriggerConditionAttack)) - call TriggerAddAction(WoWReforgedEquipment___attackTrigger, function WoWReforgedEquipment___TriggerActionAttack) + call TimerStart(WoWReforgedCalendarMultiboard__t, 0.3, true, function WoWReforgedCalendarMultiboard__UpdateMultiboard) + + call PauseTimer(GetExpiredTimer()) + call DestroyTimer(GetExpiredTimer()) endfunction -function AddSaveObjectItemTypesFromEquipment takes nothing returns nothing +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= (WoWReforgedEquipment___equipmentTypesCounter) // INLINED!! + 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 ) - if ( (WoWReforgedEquipment___equipmentItemTypeId[(i)]) != 0 ) then // INLINED!! - set udg_TmpItemTypeId=(WoWReforgedEquipment___equipmentItemTypeId[(i)]) // INLINED!! -call AddSaveObjectItemTypeEx(GetObjectName(udg_TmpItemTypeId) , udg_TmpItemTypeId) // INLINED!! + 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 WoWReforgedEquipment___RemoveUnitHook takes unit whichUnit returns nothing - local integer handleId= GetHandleId(whichUnit) - call FlushChildHashtable(WoWReforgedEquipment___h, handleId) - call FlushChildHashtable(WoWReforgedEquipment___h2, handleId) +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 -//processed hook: hook RemoveUnit WoWReforgedEquipment___RemoveUnitHook - +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 -//library WoWReforgedEquipment ends -//library WoWReforgedSaveCodes: +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 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" +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 GetSinglePlayerStatus takes boolean isSinglePlayer returns string - if ( isSinglePlayer ) then - return "S" - endif +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 - return "M" +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 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" +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 - return "N" +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 -// 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 +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) - 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= "" +function PingProperties takes player whichPlayer returns nothing local integer i= 0 + local integer max= BlzGroupGetSize(WoWReforgedProperties__properiesGroup) 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 + exitwhen ( i >= max ) + call PingUnitForPlayer(BlzGroupUnitAt(WoWReforgedProperties__properiesGroup, i) , whichPlayer) 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 +function WoWReforgedProperties__GetPropertyIndexByPurchaseUnitTypeId takes integer unitTypeId returns integer local integer i= 0 + local integer max= (WoWReforgedProperties__propertiesCounter) // INLINED!! loop - exitwhen ( i >= generatedSaveCodesCounter ) - if ( saveCode == generatedSaveCodes[i] ) then + exitwhen ( i >= max ) + if ( s__Property_purchaseUnitTypeId[(WoWReforgedProperties__properties[(i)])] == unitTypeId ) then // INLINED!! return i endif set i=i + 1 @@ -79310,3456 +76212,3464 @@ function GetGeneratedSaveCode takes string saveCode returns integer 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 +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 - 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" +function WoWReforgedProperties__FilterIsProperty takes nothing returns boolean + return (WoWReforgedProperties__GetPropertyIndexByUnitTypeId((GetUnitTypeId(GetFilterUnit()))) != - 1) // INLINED!! endfunction -function GetChecksumStatus takes integer checksum,string checkedSaveCode returns string - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - return "|cffff0000Invalid|r" +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 - return "|cff00ff00Valid|r" + set p=null 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" +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 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!! +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 -// 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 +//library WoWReforgedProperties ends +//library WoWReforgedItemCheck: -function GetSinglePlayerFromSaveCodeSegment takes integer saveCodeSegment returns boolean - if ( saveCodeSegment == 0 ) then - //call BJDebugMsg("Save code single player and mode 0") +function IsTome takes integer itemTypeId returns boolean + if ( itemTypeId == TOME_OF_AGILITY ) then return true - elseif ( saveCodeSegment == 1 ) then + elseif ( itemTypeId == TOME_OF_AGILITY_2 ) 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") + elseif ( itemTypeId == TOME_OF_EXPERIENCE ) then return true - elseif ( saveCodeSegment == 1 ) then - return false - elseif ( saveCodeSegment == 2 ) then + 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 - 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= "" +// 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 - 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) + if ( result and not udg_Tomes and unitTypeId != BACKPACK ) then + set result=not IsTome(itemTypeId) + endif + + set heroOwner=null + return result +endfunction - // upgrades - set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedNavyLevel) - set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedCreepHunterLevel) +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 - // demigod - set result=result + ConvertDecimalNumberToSaveCodeSegment(demigodValue) + 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 - set result=result + ConvertDecimalNumberToSaveCodeSegment(equipmentBags) + return null +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) +function IsUniqueScepterOrProfessionBook takes item whichItem,unit hero returns boolean + local integer itemTypeId= GetItemTypeId(whichItem) + if ( GetUnitTypeId(hero) == BACKPACK ) then + return true 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) + if ( GetBookItemProfession(itemTypeId) != udg_ProfessionNone or GetObjectRaceType(itemTypeId) == RACE_OBJECT_TYPE_SCEPTER_ITEM ) then + return CountItemsOfItemTypeId(hero , itemTypeId) <= 1 endif + return true +endfunction - call AddGeneratedSaveCode(result) - +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 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 +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 - - return 0 + set heroOwner=null + set itemOwner=null + return result 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]) +//library WoWReforgedItemCheck ends +//library WoWReforgedBackpacks: - 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 +function SetPlayerBagInfo takes player whichPlayer,boolean info returns nothing + set WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId(whichPlayer)]=info +endfunction - //call BJDebugMsg("Just returning!") +function GetPlayerBagInfo takes player whichPlayer returns boolean + return WoWReforgedBackpacks__BackpackPlayerBagInfo[GetPlayerId(whichPlayer)] +endfunction - return saveCode +function GetPlayerBackpack takes player whichPlayer returns unit + return WoWReforgedBackpacks__Backpack[GetPlayerId(whichPlayer)] 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 +function PlayerHasBackpack takes player whichPlayer returns boolean + return (WoWReforgedBackpacks__Backpack[GetPlayerId((whichPlayer))]) != null // INLINED!! +endfunction - //call BJDebugMsg("Just returning!") +function GetBackpackItemIndex takes integer playerId,integer page,integer slot returns integer + return Index3D(playerId , page , slot , BACKPACK_MAX_PAGES , bj_MAX_INVENTORY) +endfunction - return saveCode +function GetBackpackItemTypeId takes integer index returns integer + return WoWReforgedBackpacks__BackpackItemType[index] 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 +function GetBackpackItemCharges takes integer index returns integer + return WoWReforgedBackpacks__BackpackItemCharges[index] +endfunction - return false +function GetBackpackItemIsPawnable takes integer index returns boolean + return WoWReforgedBackpacks__BackpackItemPawnable[index] 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 +function GetBackpackItemTooltipExtended takes integer index returns string + return WoWReforgedBackpacks__BackpackItemTooltipExtended[index] +endfunction - return false +function GetBackpackItemPlayer takes integer index returns player + return WoWReforgedBackpacks__BackpackItemPlayer[index] endfunction -function DisplaySaveCodeError takes player whichPlayer,string message returns nothing - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, message) +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 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 +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 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!! +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 DisplaySaveCodeErrorSameGame takes player whichPlayer returns nothing - call h__DisplayTimedTextToPlayer((whichPlayer ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! +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 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) +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 - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) +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 - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) +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 - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) + return result +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[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!! +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 - 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 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 - 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 + return null +endfunction - if ( udg_Held[convertedPlayerId] != null and xp > GetHeroXP(udg_Held[convertedPlayerId]) ) then - call SetHeroXP(udg_Held[convertedPlayerId], xp, true) +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 - 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) +// 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 - if ( udg_Held2[convertedPlayerId] != null and xp2 > GetHeroXP(udg_Held2[convertedPlayerId]) ) then - call SetHeroXP(udg_Held2[convertedPlayerId], xp2, true) - endif + call ApplyBackpackItem(whichItem , index) - if ( udg_Held2[convertedPlayerId] == null and xp2 > udg_Held2XP[convertedPlayerId] ) then - set udg_Held2XP[convertedPlayerId]=xp2 + 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 - if ( udg_Held3[convertedPlayerId] != null and xp3 > GetHeroXP(udg_Held3[convertedPlayerId]) ) then - call SetHeroXP(udg_Held3[convertedPlayerId], xp3, true) - endif +function DropBackpackForPlayer takes player whichPlayer,rect whichRect returns nothing + call DropBackpackForPlayerTo(whichPlayer , GetRectCenterX(whichRect) , GetRectCenterY(whichRect)) +endfunction - if ( udg_Held3[convertedPlayerId] == null and xp3 > udg_Held3XP[convertedPlayerId] ) then - set udg_Held3XP[convertedPlayerId]=xp3 +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) - call RecreateEquipmentBags(whichPlayer , equipmentBags) - - call AddGeneratedSaveCode(s) + return result +endfunction - return true +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 - else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + 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 false + return whichItem 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) +function DropQuestItemFromHeroAtRectByDyingUnit takes integer itemTypeId,rect whichRect returns item + return DropQuestItemFromHeroAtRect(GetOwningPlayer(GetDyingUnit()) , itemTypeId , whichRect) +endfunction - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) +function DropQuestItemFromDyingUnit takes nothing returns item + return DropQuestItemFromHeroAtRectByDyingUnit(udg_TmpItemTypeId , udg_TmpRect) +endfunction - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) +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 - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) +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 - 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!! +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 - 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 + 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 - if ( udg_Held3[convertedPlayerId] != null and xp3 > GetHeroXP(udg_Held3[convertedPlayerId]) ) then - call SetHeroXP(udg_Held3[convertedPlayerId], xp3, true) - 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 - if ( udg_Held3[convertedPlayerId] == null and xp3 > udg_Held3XP[convertedPlayerId] ) then - set udg_Held3XP[convertedPlayerId]=xp3 + return true endif + set j=j + 1 + endloop + set i=i + 1 + endloop + + call UpdateItemsForBackpackUIEvaluate(whichPlayer) - call RecreateEquipmentBags(whichPlayer , equipmentBags) - - call AddGeneratedSaveCode(s) + return false +endfunction - return true - endif - else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! +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 - - return false + call ClearBackpackForPlayer(whichPlayer) endfunction -function ApplySaveCode takes player whichPlayer,string s returns boolean - return ApplySaveCode3_14(whichPlayer , s) or ApplySaveCodePre3_14(whichPlayer , s) +function DisableItemPickupTriggers takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + call DisableTrigger(WoWReforgedBackpacks__BackpackTriggerPickup[playerId]) + call DisableTrigger(WoWReforgedBackpacks__BackpackTriggerDrop[playerId]) 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!! +function EnableItemPickupTriggers takes player whichPlayer returns nothing + local integer playerId= GetPlayerId(whichPlayer) + call EnableTrigger(WoWReforgedBackpacks__BackpackTriggerPickup[playerId]) + call EnableTrigger(WoWReforgedBackpacks__BackpackTriggerDrop[playerId]) +endfunction - if ( (GetGeneratedSaveCode((s)) != - 1) ) then // INLINED!! - set result=result + "Is from the same game!" - endif +function GetBackpackPageNumber takes player whichPlayer returns integer + local integer playerId= GetPlayerId(whichPlayer) + return WoWReforgedBackpacks__BackpackPageNumber[playerId] +endfunction - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " +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 result=result + "Expected different checksum!" - endif + set i=i + 1 + endloop + call EnableItemPickupTriggers(whichPlayer) +endfunction - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " +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 - set result=result + "Expected different player name!" +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 ( 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 + + if ( result != - 1 ) then + call ChangeBackpackPageEx(whichPlayer , result) endif + + return result +endfunction - if ( gameType != udg_GameType ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif +function ChangeToFirstBagInBackpack takes player whichPlayer returns nothing + call ChangeBackpackPageEx(whichPlayer , 0) +endfunction - set result=result + "Expected game type: " + I2S(gameType) - endif +function ChangeToLastBagInBackpack takes player whichPlayer returns nothing + call ChangeBackpackPageEx(whichPlayer , BACKPACK_MAX_PAGES - 1) +endfunction - if ( isWarlord != udg_PlayerIsWarlord[convertedPlayerId] ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " +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 - - if ( isWarlord ) then - set result=result + "Expected game mode Warlord!" + else + if ( page != 0 ) then + set newPage=page - 1 else - set result=result + "Expected game mode Freelancer!" + set newPage=BACKPACK_MAX_PAGES - 1 endif endif + call ChangeBackpackPageEx(whichPlayer , newPage) +endfunction - if ( xpRate != R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " +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 - set result=result + "Expected XP rate: " + I2S(xpRate) - endif +// 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 ( xp < GetHeroXP(udg_Held[convertedPlayerId]) ) then - if ( StringLength(result) > 0 ) then - set result=result + ", " - endif + if ( stackedCharges == charges2 ) then + call ClearBackpackItem(index2) + set countEmptySlotsAfter=countEmptySlotsAfter + 1 + else + set WoWReforgedBackpacks__BackpackItemCharges[index2]=charges2 - stackedCharges + endif - set result=result + "Expected more XP than your current!" - 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) - 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 + 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 - return result +function WoWReforgedBackpacks__TriggerConditionChangeBackpackPage takes nothing returns boolean + return GetSpellAbilityId() == BACKPACK_NEXT_PAGE_ABILITY_ID or GetSpellAbilityId() == BACKPACK_PREVIOUS_PAGE_ABILITY_ID endfunction -function AppendSaveCodeInfo takes string result,string appended returns string - if ( StringLength(result) > 0 ) then - set result=result + "|n" +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 result + appended + call UpdateItemsForBackpackUIEvaluate(GetOwningPlayer(GetTriggerUnit())) 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" +function WoWReforgedBackpacks__TriggerConditionPickupBackpackItem takes nothing returns boolean + local integer playerId= GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + return GetTriggerUnit() == WoWReforgedBackpacks__Backpack[playerId] +endfunction - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - 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 +function WoWReforgedBackpacks__TriggerConditionDropBackpackItem takes nothing returns boolean + return GetTriggerUnit() == WoWReforgedBackpacks__Backpack[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] +endfunction - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif +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 - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif +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 - if ( isWarlord ) then - set warlordStatus="Warlord" - endif +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 - 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)) +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 - return result +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 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" +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 - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif +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 ( playerNameHash != CompressedAbsStringHash(playerName) ) then - set playerName="Not yours" - endif + 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 ( isSinglePlayer ) then - set singlePlayerStatus="S" + 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 - if ( isWarlord ) then - set warlordStatus="W" +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 - - 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) + call IssuePointOrder(GetTriggerUnit(), "move", GetItemX(whichItem), GetItemY(whichItem)) + set hero=null + set owner=null + set whichItem=null 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 +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 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 +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 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 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 -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 + if ( WoWReforgedBackpacks__Backpack[i] != null ) then + set bag=WoWReforgedBackpacks__Backpack[i] + call SetUnitX(bag, x) + call SetUnitY(bag, y) + set bag=null + endif -function GetSaveCodeLumber takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - - return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 7) , SAVE_CODE_DIGITS)) // INLINED!! + 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 GetSaveCodeHeroKills takes string name,string s returns integer - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - - return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 13) , SAVE_CODE_DIGITS)) // INLINED!! +function GetBackpackUpdateLocatiomTimerHandleId takes nothing returns integer + return GetHandleId(WoWReforgedBackpacks__BackpackUpdateLocationTimer) 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!! +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 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 WoWReforgedBackpacks ends +//library WoWReforgedBackpackUI: -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!! - if ( xp2 > xp and xp2 > xp3 ) then - return GetHeroLevelByXP(xp2) - elseif ( xp3 > xp and xp3 > xp2 ) then - return GetHeroLevelByXP(xp3) - endif +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 - return GetHeroLevelByXP(xp) +function BackpackUIExists takes nothing returns boolean + return WoWReforgedBackpackUI___BackpackBackgroundFrame != null endfunction -function GetSaveCodeBuildingsMax takes nothing returns integer - return 8 +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 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= "" +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 - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" +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 - if ( isWarlord ) then - set gameMode="Warlord" +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 - 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 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 - call FileStart() +function BackpackClickItemFunction takes nothing returns nothing + if ( GetLocalPlayer() == GetTriggerPlayer() ) then + call WoWReforgedBackpackUI___SyncBag() + endif +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 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)) - // The line below creates the log - call Preload((content)) // INLINED!! + 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" - // 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 + 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 -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 + 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 - set first=null - set i=i + 1 - endloop - //call BJDebugMsg("Count unit type " + GetObjectName(unitTypeId) + " with count " + I2S(i)) - - return count -endfunction -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 - 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") + 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 - set first=null - set i=i + 1 - endloop - - if ( bj_wantDestroyGroup ) then - call GroupClear(whichGroup) - call DestroyGroup(whichGroup) - set whichGroup=null - set bj_wantDestroyGroup=false endif - return result -endfunction - + set tooltip=tooltip + "|n|n|cff808080Click to open the bag.|R|n" -function WoWReforgedSaveCodes__FilterIsUnitType takes nothing returns boolean - return GetPrimaryDependencyEquivalent(GetUnitTypeId(GetFilterUnit())) == WoWReforgedSaveCodes__tmpFilterId + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, tooltip) + endif 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 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 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 WoWReforgedBackpackUI___CheckedFunction takes nothing returns nothing + set WoWReforgedBackpackUI___Checked[GetPlayerId(GetTriggerPlayer())]=true + call ShowBackpackUI(GetTriggerPlayer()) endfunction - -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 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 - 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 - - call GroupClear(buildingsToBeSaved) - call DestroyGroup(buildingsToBeSaved) - set buildingsToBeSaved=null - - return whichGroup + +function WoWReforgedBackpackUI___UncheckedFunction takes nothing returns nothing + set WoWReforgedBackpackUI___Checked[GetPlayerId(GetTriggerPlayer())]=false + call ShowBackpackUI(GetTriggerPlayer()) endfunction -function GetAbsCoordinate takes real coordinate,real min returns real - return RAbsBJ(min) + coordinate +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 GetAbsCoordinateX takes real coordinate returns real - local rect worldBounds= GetWorldBounds() - local real x= GetAbsCoordinate(coordinate , GetRectMinX(worldBounds)) - call RemoveRect(worldBounds) - set worldBounds=null +function WoWReforgedBackpackUI___CheckboxLeaveItemFunction takes nothing returns nothing + local integer playerId= GetPlayerId(GetTriggerPlayer()) + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzFrameSetText(WoWReforgedBackpackUI___BackpackTooltipText, "") + endif +endfunction - return x +function WoWReforgedBackpackUI___CloseFunction takes nothing returns nothing + call HideBackpackUI(GetTriggerPlayer()) 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 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 - return y -endfunction + set WoWReforgedBackpackUI___BackpackBackgroundFrame=CreateFullScreenFrame() + set WoWReforgedBackpackUI___BackpackTitleFrame=CreateFullScreenTitle("BackpackTitle" , "Backpack") + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackTitleFrame, false) -function ConvertAbsCoordinate takes real coordinate,real min returns real - return coordinate - RAbsBJ(min) -endfunction + 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) -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 + 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) - return x -endfunction + 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!! -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 + 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!! - return y -endfunction + 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!! -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= "" + // 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) - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) + 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) - //call BJDebugMsg("Size of buildings: " + I2S(CountUnitsInGroup(buildings))) + 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 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) + set x=x + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SIZE + WoWReforgedBackpackUI___BACKPACK_UI_BUTTON_SPACE - // 5 buildings with their locations - 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 + "," - 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 + set j=j + 1 + endloop - // fill rest - loop - 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 - - //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)) + // 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 - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) - endif + 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) - if ( buildingsCounter > 0 ) then - if ( writeFile ) then - call CreateSaveCodeBuildingsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , buildingsCounter , buildingNames , result) - endif + 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) - call AddGeneratedSaveCode(result) - endif + 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) - return result -endfunction + 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) -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) + 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) - call GroupClear(buildings) - call DestroyGroup(buildings) - set buildings=null + 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() - return result -endfunction + set WoWReforgedBackpackUI___BackpackCloseTrigger=CreateTrigger() + call BlzTriggerRegisterFrameEvent(WoWReforgedBackpackUI___BackpackCloseTrigger, WoWReforgedBackpackUI___BackpackCloseButton, FRAMEEVENT_CONTROL_CLICK) + call TriggerAddAction(WoWReforgedBackpackUI___BackpackCloseTrigger, function WoWReforgedBackpackUI___CloseFunction) -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 WoWReforgedBackpackUI___BackpackSyncTrigger=CreateTrigger() + call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedBackpackUI___BackpackSyncTrigger , "BackpackUI" , false) + call TriggerAddAction(WoWReforgedBackpackUI___BackpackSyncTrigger, function WoWReforgedBackpackUI___TriggerActionSyncData) - return GetSaveCodeBuildingsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackBackgroundFrame, false) + call BlzFrameSetVisible(WoWReforgedBackpackUI___BackpackCloseButton, false) + + //call FrameSaverAdd(function HideBackpackUIForAllPlayers) endfunction -function GetSaveCodeBuildings takes player whichPlayer returns string - return GetSaveCodeBuildingsForIndex(whichPlayer , true , 0) -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 -endfunction +//library WoWReforgedBackpackUI ends +//library WoWReforgedComputer: -function IsObjectFromPlayerRace takes integer objectID,player whichPlayer returns boolean - local integer objectRace= GetObjectRace(objectID) - return PlayerHasUnlockedRace(whichPlayer , GetObjectRace(objectID)) +function GetComputerAINavy takes player whichPlayer returns group + return udg_ComputerNavy[GetPlayerId(whichPlayer)] 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 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 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 ComputerAINavyIsReadyForAttack takes player whichPlayer returns boolean + return BlzGroupGetSize((udg_ComputerNavy[GetPlayerId((whichPlayer))])) >= 5 // INLINED!! 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 - - //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_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 - - 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!! +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 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 +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 - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif +function WoWReforgedComputer__IsRaceWorker takes integer r,integer unitTypeId returns boolean + return r != udg_RaceNone and unitTypeId == (GetRaceObjectTypeId((r) , RACE_OBJECT_TYPE_WORKER)) // INLINED!! +endfunction - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif +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 - if ( isWarlord ) then - set warlordStatus="Warlord" - endif +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 + call h__DisplayTimedTextToForce(GetPlayersAll(), 4.0, "Auto loaded " + I2S(WoWReforgedComputer__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 + call GroupClear(mines) + call DestroyGroup(mines) + set mines=null 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= "" - - 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 ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" + 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 ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" +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 ( isSinglePlayer ) then - set singlePlayerStatus="S" + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + set result=true + call DropAllItemsNotFromRaceForHero((udg_Hero2[GetPlayerId((whichPlayer))])) // INLINED!! endif - - if ( isWarlord ) then - set warlordStatus="W" + 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 - 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) + ")" +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 - 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 + set slotItem=null + set i=i + 1 + endloop + endif + set owner=null 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 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 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 - 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 - - //call BJDebugMsg("Size of units before distinct: " + I2S(CountUnitsInGroup(whichGroup))) - //call BJDebugMsg("Size of units after distinct: " + I2S(CountUnitsInGroup(result))) +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 - call GroupClear(livingUnitsToBeSaved) - call DestroyGroup(livingUnitsToBeSaved) - set livingUnitsToBeSaved=null - - //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(whichGroup))) - return whichGroup -endfunction +//library WoWReforgedItemUtils ends +//library WoWReforgedNeutralZone: -function GetSaveCodeUnitsMax takes nothing returns integer - return 8 +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 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 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 ( isWarlord ) then - set gameMode="Warlord" + if ( (udg_Hero2[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call ResetHeroToNeutralZone((udg_Hero2[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! 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" + if ( (udg_Hero3[GetPlayerId((whichPlayer))]) != null ) then // INLINED!! + call ResetHeroToNeutralZone((udg_Hero3[GetPlayerId((whichPlayer))]) , x , y , facing) // INLINED!! endif - - - 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!! + call DropBackpackForPlayerTo(whichPlayer , x , y) 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= "" - - //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) +//library WoWReforgedNeutralZone ends +//library WoWReforgedPickpocketing: - 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 - // fill rest +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 >= SAVE_CODE_MAX_UNITS ) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) - set result=result + ConvertDecimalNumberToSaveCodeSegment(0) + exitwhen ( i == bountyNumberOfDice ) + set bounty=bounty + GetRandomInt(0, bountySidesPerDice) 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)) - - 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 - - call AddGeneratedSaveCode(result) - endif - - return result -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) - - call GroupClear(units) - call DestroyGroup(units) - set units=null - - return result -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)) - - return GetSaveCodeUnitsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) -endfunction - -function GetSaveCodeUnits takes player whichPlayer returns string - return GetSaveCodeUnitsForIndex(whichPlayer , true , 0) + return bounty endfunction -function GetAllSaveCodeUnits takes player whichPlayer returns nothing +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 - local integer max= (8) // INLINED!! loop - exitwhen ( i == max ) - call GetSaveCodeUnitsForIndex(whichPlayer , true , i) + exitwhen ( i == bountyNumberOfDice ) + set bounty=bounty + GetRandomInt(0, bountySidesPerDice) set i=i + 1 endloop + + return bounty endfunction -function ForGroupApplyLoadedUnitEvolution takes nothing returns nothing - call AddEvolution(GetEnumUnit()) +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 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 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_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) +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 atLeastOne + return stolenItem 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 - - call ForGroupBJ(createdUnits, function ForGroupApplyLoadedUnitEvolution) - call GroupClear(createdUnits) - call DestroyGroup(createdUnits) - set createdUnits=null + call ShowThiefBounty(hero , target) - return false + return null 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= "" - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif +//library WoWReforgedPickpocketing ends +//library WoWReforgedEquipment: - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif +function GetEquipmentItemTypeId takes integer index returns integer + return WoWReforgedEquipment__equipmentItemTypeId[index] +endfunction - if ( isWarlord ) then - set warlordStatus="Warlord" - endif +function GetEquipmentItemTypeCategoryName takes integer index returns string + return WoWReforgedEquipment__equipmentItemTypeCategoryName[index] +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 GetEquipmentItemTypeCategory takes integer index returns integer + return WoWReforgedEquipment__equipmentItemTypeCategory[index] +endfunction - 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 +function GetEquipmentItemTypeCategoryType takes integer index,integer category returns boolean + local integer i= Index2D(index , category , WoWReforgedEquipment_CATEGORY_TYPE_MAX) + return WoWReforgedEquipment__equipmentItemTypeCategoryType[i] +endfunction - return result +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 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= "" +function GetEquipmentTypeAnimation takes integer index returns integer + return WoWReforgedEquipment__equipmentItemTypeAnimation[index] +endfunction - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif +function SetEquipmentTypeAnimation takes integer index,integer animation returns nothing + set WoWReforgedEquipment__equipmentItemTypeAnimation[index]=animation +endfunction - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" - endif +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 - if ( isSinglePlayer ) then - set singlePlayerStatus="S" - endif +// 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 - if ( isWarlord ) then - set warlordStatus="W" - endif +function EquipmentCategoryTwoHanded takes nothing returns nothing + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_TWO_HANDED , true) +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 EquipmentCategoryRange takes nothing returns nothing + call SetEquipmentItemTypeCategoryType(WoWReforgedEquipment__equipmentTypesCounter , WoWReforgedEquipment_CATEGORY_TYPE_RANGE , true) +endfunction - return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result +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 GetSaveCodeResearchesMax takes nothing returns integer - return 8 +function EquipmentCategoryRightHand takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_RIGHT_HAND endfunction -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= "" +function EquipmentCategoryBody takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_BODY +endfunction - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" - endif +function EquipmentCategoryFoot takes nothing returns nothing + set udg_TmpInteger=WoWReforgedEquipment_CATEGORY_FOOT +endfunction - if ( isWarlord ) then - set gameMode="Warlord" - endif +function EquipmentAnimationShield takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHIELD +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 EquipmentAnimationNoWeapon takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_NO_WEAPON +endfunction - call FileStart() +function EquipmentAnimationLeftHandWeapon takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_LEFT_HAND_WEAPON +endfunction - 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!! +function EquipmentAnimationTwoHandHammer takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND_HAMMER +endfunction - // The line below creates the log - call Preload((content)) // INLINED!! +function EquipmentAnimationTwoWeapons takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_WEAPONS +endfunction - // 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!! +function EquipmentAnimationBow takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_BOW 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= "" +function EquipmentAnimationMinigun takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_MINIGUN +endfunction - //call BJDebugMsg("Size of units: " + I2S(CountUnitsInGroup(units))) +function EquipmentAnimationTwoHand takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_TWO_HAND +endfunction - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) +function EquipmentAnimationGun takes nothing returns nothing + set udg_TmpInteger2=VILLAGER_255_ANIMATION_ATTACK_SHOOT_GUN +endfunction - 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) +function GetMaxEquipmentItemTypes takes nothing returns integer + return WoWReforgedEquipment__equipmentTypesCounter +endfunction - set i=0 +function GetEquipmentItemTypeByItemTypeId takes integer itemTypeId returns integer + local integer 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 + exitwhen ( i >= WoWReforgedEquipment__equipmentTypesCounter ) + if ( WoWReforgedEquipment__equipmentItemTypeId[i] == itemTypeId ) then + return i endif set i=i + 1 endloop + return 0 +endfunction - // 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) +function WoWReforgedEquipment__SetUnitEquipmentType takes unit hero,integer c,integer index returns nothing + call SaveInteger(WoWReforgedEquipment__h, GetHandleId(hero), c, index) +endfunction - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) +function WoWReforgedEquipment__SetUnitEquipmentTypeItem takes unit hero,integer c,item whichItem returns nothing + call SaveItemHandle(WoWReforgedEquipment__h2, GetHandleId(hero), c, whichItem) +endfunction - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) - endif +function GetUnitEquipmentType takes unit hero,integer c returns integer + return LoadInteger(WoWReforgedEquipment__h, GetHandleId(hero), c) +endfunction - if ( researchesCounter > 0 ) then - if ( writeFile ) then - call CreateSaveCodeResearchesTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , researchesCounter , researchNames , result) - endif +function GetUnitEquipmentTypeItem takes unit hero,integer c returns item + return LoadItemHandle(WoWReforgedEquipment__h2, GetHandleId(hero), c) +endfunction - call AddGeneratedSaveCode(result) - endif +function GetUnitEquipmentTypeByHandleId takes integer handleId,integer c returns integer + return LoadInteger(WoWReforgedEquipment__h, handleId, c) +endfunction - return result +function GetUnitEquipmentTypeItemByHandleId takes integer handleId,integer c returns item + return LoadItemHandle(WoWReforgedEquipment__h2, handleId, c) 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)) +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 - return GetSaveCodeResearchesEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) +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 GetSaveCodeResearches takes player whichPlayer returns string - return GetSaveCodeResearchesForIndex(whichPlayer , true , 0) +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 GetAllSaveCodeResearches takes player whichPlayer returns nothing +function ReplaceHeroForEquipment takes unit hero,integer unitTypeId returns unit local integer i= 0 - local integer max= (8) // INLINED!! + 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 == max ) - call GetSaveCodeResearchesForIndex(whichPlayer , true , i) + 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 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!! +function WoWReforgedEquipment__UpdateEquipmentFromInventory takes unit hero returns nothing + local item slotItem= null + local integer c= 0 + local integer index= 0 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)) + 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 - 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 +function WoWReforgedEquipment__TriggerConditionIsCustomizableAttriburesHero takes nothing returns boolean + local integer unitTypeId= GetUnitTypeId(GetTriggerUnit()) + return IsCustomizableAttributesHero(unitTypeId) or unitTypeId == ITEM_VALUES_DUMMY_HERO +endfunction - call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) +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) - 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) + 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 - - return atLeastOne + + //call BJDebugMsg("Drop current weapon from category " + I2S(c)) + // always drop the replaced equipment + call DropEquipment(hero , c) endif - else - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + + 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 - - return false + set whichItem=null + set hero=null 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" - local string result= "" - - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif - - if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then - set playerName="Not yours" +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 - if ( isSinglePlayer ) then - set singlePlayerStatus="Singleplayer" - endif +function WoWReforgedEquipment__TriggerConditionAttack takes nothing returns boolean + return IsCustomizableAttributesHero(BlzGetUnitSkin(GetAttacker())) +endfunction - if ( isWarlord ) then - set warlordStatus="Warlord" +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 - 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 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 - set i=0 +function AddSaveObjectItemTypesFromEquipment takes nothing returns nothing + local integer i= 0 + local integer max= (WoWReforgedEquipment__equipmentTypesCounter) // INLINED!! 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)) + 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 - set pos=pos + 2 endloop +endfunction - return result +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 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= "" +//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="S" + return "S" endif - if ( isWarlord ) then - set warlordStatus="W" + 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 i=0 + 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 >= 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) + 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 singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result + return result + "-" + I2S(playerCounter) + "-" + FormatTimeString(R2I(duration)) + "-S_" + I2S(WoWReforgedSaveCodes__gameSeed) 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 + ", " +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 - return members + playerName + "_" + GetClanRankName(playerRank) - endif - return members +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 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= "" +function IsGeneratedSaveCode takes string saveCode returns boolean + return GetGeneratedSaveCode(saveCode) != - 1 +endfunction - if ( isSinglePlayer ) then - set singleplayer="yes" - set singlePlayerFileName="Singleplayer" +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 members=AppendClanSaveCodeMember(members , playerName0 , playerRank0) +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 - if ( playerRank0 == udg_ClanRankLeader ) then - set leader=playerName0 +function GetGeneratedStatus takes boolean generated returns string + if ( generated ) then + return "|cffff0000Yes|r" endif + return "|cff00ff00No|r" +endfunction - set members=AppendClanSaveCodeMember(members , playerName1 , playerRank1) - - if ( playerRank1 == udg_ClanRankLeader ) then - set leader=playerName1 +function GetChecksumStatus takes integer checksum,string checkedSaveCode returns string + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + return "|cffff0000Invalid|r" endif + return "|cff00ff00Valid|r" +endfunction - set members=AppendClanSaveCodeMember(members , playerName2 , playerRank2) - - if ( playerRank2 == udg_ClanRankLeader ) then - set leader=playerName2 +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 - set members=AppendClanSaveCodeMember(members , playerName3 , playerRank3) - - if ( playerRank3 == udg_ClanRankLeader ) then - set leader=playerName3 - endif + return "No Demigod" +endfunction - set members=AppendClanSaveCodeMember(members , playerName4 , playerRank4) +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 ( playerRank4 == udg_ClanRankLeader ) then - set leader=playerName4 + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" endif - set members=AppendClanSaveCodeMember(members , playerName5 , playerRank5) - - if ( playerRank5 == udg_ClanRankLeader ) then - set leader=playerName5 + if ( isWarlord ) then + set gameMode="Warlord" endif - - set members=AppendClanSaveCodeMember(members , playerName6 , playerRank6) - - if ( playerRank6 == udg_ClanRankLeader ) then - set leader=playerName6 + 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: -loadc " + saveCode + " " + clanName)) // 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" + ("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" + ("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" + ("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" + ("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" + ("Improved Clan Hall Level: " + I2S(improvedClanHallLevel))) // INLINED!! - set content=content + ("\r\n" + ("Improved Clan Level: " + I2S(improvedClanLevel))) // INLINED!! - set content=content + ("\r\n" + ("")) // INLINED!! + 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-Clan-" + clanName + "-" + playerName0 + "-" + singlePlayerFileName + "-gold-" + I2S(gold) + "-lumber-" + I2S(lumber) + "-members-" + I2S(memberCounter) + ".txt")) // INLINED!! + 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 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 +// 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 - 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)) + //call BJDebugMsg("Save code single player and mode 3") + return 3 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) + return 0 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 +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 - call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! + return false 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 +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 "Unknown" + return false endfunction -function GetSaveCodeInfosClan takes string name,string s returns string +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= "" - 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)) + + 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)) - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - 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 ( clanHasAIPlayer == 1 ) then - set clanHasAIPlayerText="Has AI player" - 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 , "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) + ")") + // 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) - return result -endfunction + // hero 2 + set result=result + ConvertDecimalNumberToSaveCodeSegment(xp2) -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 + // hero 3 + set result=result + ConvertDecimalNumberToSaveCodeSegment(xp3) - //call BJDebugMsg("Obfuscated save code: " + s) - //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) + //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) - //call BJDebugMsg("Checked save code part: " + checkedSaveCode) - //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) - //call BJDebugMsg("Checksum: " + I2S(checksum)) + // upgrades + set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedNavyLevel) + set result=result + ConvertDecimalNumberToSaveCodeSegment(improvedCreepHunterLevel) - //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) - //call BJDebugMsg("Save code XP " + I2S(xp)) + // demigod + set result=result + ConvertDecimalNumberToSaveCodeSegment(demigodValue) - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - endif + set result=result + ConvertDecimalNumberToSaveCodeSegment(equipmentBags) - if ( isSinglePlayer ) then - set singlePlayerStatus="S" + // 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 ( clanHasAIPlayer == 1 ) then - set clanHasAIPlayerText="Has AI player" + // 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 - return name + "-" + singlePlayerStatus + "-gold_" + I2S(gold) + "-lumber_" + I2S(lumber) + "-p1_" + GetClanPlayerName(playerNameHash0) + "-p2_" + GetClanPlayerName(playerNameHash1) + "-p3_" + GetClanPlayerName(playerNameHash2) -endfunction + call AddGeneratedSaveCode(result) -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" + return result +endfunction - if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" +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 gold + + return 0 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 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]) -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 + 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 -// Mailbox System +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 -function CreateSaveCodeLetterTextFile takes string playerNameFrom,string playerNameTo,string message,string saveCode returns nothing - local string content= "" + //call BJDebugMsg("Just returning!") - call FileStart() + return saveCode +endfunction - 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!! +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 - // The line below creates the log - call Preload((content)) // INLINED!! + //call BJDebugMsg("Just returning!") - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-letter-from_" + playerNameFrom + "-to_" + playerNameTo + "-messageLength_" + I2S(StringLength(message)) + ".txt")) // INLINED!! + return saveCode 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 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 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) +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 - // checksum - set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) + return false +endfunction - if ( SAVE_CODE_OBFUSCATE ) then - //call BJDebugMsg("Non-obfuscated save code: " + result) - set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameToHash) - endif +function DisplaySaveCodeError takes player whichPlayer,string message returns nothing + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 6.0, message) +endfunction - call CreateSaveCodeLetterTextFile(playerNameFrom , playerNameTo , message , result) +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 AddGeneratedSaveCode(result) - call AddGeneratedSaveCodeLetter(playerNameFrom , playerNameTo , message) +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 - return result +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 GetSaveCodeInfosLetter takes string playerNameTo,string s returns string - local string result= "" - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerNameTo)) +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 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 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 string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" + 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) @@ -82771,35 +79681,117 @@ function GetSaveCodeInfosLetter takes string playerNameTo,string s returns strin //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) //call BJDebugMsg("Save code XP " + I2S(xp)) - if ( playerNameToHash != CompressedAbsStringHash(playerNameTo) ) then - set playerNameToText="Invalid" - endif + 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 ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - 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 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) + 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 - return result + 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 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) +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 string saveCodeTypeName= GetSaveCodeTypeName(saveCodeType) - local string checksumStatus= "Valid" + 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) @@ -82811,57 +79803,116 @@ function GetSaveCodeShortInfosLetter takes string playerNameTo,string s returns //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) //call BJDebugMsg("Save code XP " + I2S(xp)) - if ( playerNameToHash != CompressedAbsStringHash(playerNameTo) ) then - set playerNameToText="Invalid" - endif + 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 ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then - set checksumStatus="Invalid" - 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) - return "f_" + playerNameFrom + "-t_" + playerNameToText + "-m_" + I2S(StringLength(message)) -endfunction + 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 -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 ( udg_Held[convertedPlayerId] != null and xp > GetHeroXP(udg_Held[convertedPlayerId]) ) then + call SetHeroXP(udg_Held[convertedPlayerId], xp, true) + endif - if ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameToHash == CompressedAbsStringHash(playerName) ) then - call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 120.0, "Letter from " + playerNameFrom + ": " + message) + 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 - return true + 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 ApplySaveCodeLetter takes player whichPlayer,string playerName,string s returns boolean - return ApplySaveCodeLetterEx(whichPlayer , "all" , s) or ApplySaveCodeLetterEx(whichPlayer , playerName , s) +function ApplySaveCode takes player whichPlayer,string s returns boolean + return ApplySaveCode3_14(whichPlayer , s) or ApplySaveCodePre3_14(whichPlayer , s) endfunction -function GetSaveCodeErrorsLetter takes player whichPlayer,string playerName,string s returns string - local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(playerName)) +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 playerNameToHash= (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 1) , SAVE_CODE_DIGITS)) // INLINED!! - 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 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!! - local string result= "" + 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 ( playerNameToHash != CompressedAbsStringHash(playerName) ) then + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then if ( StringLength(result) > 0 ) then set result=result + ", " endif @@ -82869,1256 +79920,1818 @@ function GetSaveCodeErrorsLetter takes player whichPlayer,string playerName,stri set result=result + "Expected different player name!" endif - if ( StringLength(result) == 0 ) then - set result="None errors detected." + 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 - return result -endfunction + if ( gameType != udg_GameType ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif -// Save and Load Auto + set result=result + "Expected game type: " + I2S(gameType) + endif + if ( isWarlord != udg_PlayerIsWarlord[convertedPlayerId] ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif -function SaveAndLoadAutoGetPlayerFromSyncData takes string source returns player - return Player(S2I((StringTokenEx((source ) , ( 0) , " " , false)))) // INLINED!! -endfunction + if ( isWarlord ) then + set result=result + "Expected game mode Warlord!" + else + set result=result + "Expected game mode Freelancer!" + endif + endif -function SaveAndLoadAutoGetContentFromSyncData takes string source returns string - return (StringTokenEx((source ) , ( 1) , " " , false)) // INLINED!! -endfunction + if ( xpRate != R2I(GetPlayerHandicapXPBJ(whichPlayer)) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif -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 + set result=result + "Expected XP rate: " + I2S(xpRate) + endif -function SaveAndLoadAutoInit takes nothing returns nothing - call TriggerRegisterAnyPlayerSyncEvent(SaveAndLoadAutoSyncTrigger , SAVE_AND_LOAD_AUTO_PREFIX , false) - call TriggerAddAction(SaveAndLoadAutoSyncTrigger, function SaveAndLoadAutoTriggerAction) -endfunction + if ( xp < GetHeroXP(udg_Held[convertedPlayerId]) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif -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) + set result=result + "Expected more XP than your current!" endif - 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 ( 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 - if ( synced ) then - return content + return result +endfunction + +function AppendSaveCodeInfo takes string result,string appended returns string + if ( StringLength(result) > 0 ) then + set result=result + "|n" endif - return null + 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 -//library WoWReforgedSaveCodes ends -//library WoWReforgedSkillUI: + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif -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 + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif -// 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 + if ( isWarlord ) then + set warlordStatus="Warlord" endif -endfunction -function WoWReforgedSkillUI___TriggerActionUpdateSkillPointsUI takes nothing returns nothing - call UpdateSkillPointsUI(WoWReforgedSkillUI___tmpPlayer) -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 , "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)) -function WoWReforgedSkillUI___UpdateSkillPointsUIExec takes player whichPlayer returns nothing - set WoWReforgedSkillUI___tmpPlayer=whichPlayer - call TriggerExecute(WoWReforgedSkillUI___tmpTrigger) + return result endfunction -function WoWReforgedSkillUI___SetSkillUIVisible takes player whichPlayer,boolean visible returns nothing - if ( whichPlayer == GetLocalPlayer() ) then - call WoWReforgedSkillUI___SetSkillUIVisibleAll(visible) +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 - call UpdateSkillPointsUI(whichPlayer) -endfunction -function WoWReforgedSkillUI___TriggerActionUp takes nothing returns nothing - local integer a= LoadInteger(WoWReforgedSkillUI___h, GetHandleId(GetTriggeringTrigger()), 0) - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzSendSyncData(WoWReforgedSkillUI___PREFIX, "Up" + I2S(a)) + 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 WoWReforgedSkillUI___TriggerActionDown takes nothing returns nothing - local integer a= LoadInteger(WoWReforgedSkillUI___h, GetHandleId(GetTriggeringTrigger()), 0) +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!! - if ( GetTriggerPlayer() == GetLocalPlayer() ) then - call BlzSendSyncData(WoWReforgedSkillUI___PREFIX, "Down" + I2S(a)) - endif + return xp endfunction -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.") +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 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) +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!! - 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) + return xp3 +endfunction + +function GetSaveCodeGold takes string name,string s returns integer + local string saveCode= ReadSaveCode(s , CompressedAbsStringHash(name)) - 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) + 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)) - 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) + 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)) - 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) + 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)) - 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) + return (ConvertSaveCodeSegmentIntoDecimalNumberFromSaveCodeEx((saveCode ) , ( 14) , SAVE_CODE_DIGITS)) // INLINED!! endfunction -function WoWReforgedSkillUI___HideSkillUI takes nothing returns nothing - call WoWReforgedSkillUI___SetSkillUIVisibleAll(false) - call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameToggle, false) - call BlzFrameSetVisible(WoWReforgedSkillUI___IconFrameAttributePoints, false) +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 -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 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!! - 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) + if ( xp2 > xp and xp2 > xp3 ) then + return GetHeroLevelByXP(xp2) + elseif ( xp3 > xp and xp3 > xp2 ) then + return GetHeroLevelByXP(xp3) + endif - // hide for all players - call WoWReforgedSkillUI___HideSkillUI() + return GetHeroLevelByXP(xp) 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 +function GetSaveCodeBuildingsMax takes nothing returns integer + return 8 endfunction -function WoWReforgedSkillUI___TriggerConditionSelected takes nothing returns boolean - local integer playerId= GetPlayerId(GetTriggerPlayer()) - set WoWReforgedSkillUI___currentHero[playerId]=GetTriggerUnit() - - call WoWReforgedSkillUI___UpdateSkillPointsUIExec(GetTriggerPlayer()) +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= "" - return false -endfunction + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" + endif -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 + if ( isWarlord ) then + set gameMode="Warlord" endif - - call WoWReforgedSkillUI___UpdateSkillPointsUIExec(GetTriggerPlayer()) - - return false + + 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: -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!! + + // 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 WoWReforgedSkillUI___UpdateSkillPointsUIForAllPlayersForHero takes unit hero returns nothing + +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 == bj_MAX_PLAYERS ) - if ( WoWReforgedSkillUI___currentHero[i] == hero ) then - call WoWReforgedSkillUI___UpdateSkillPointsUIExec(Player(i)) + 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)) + + return count endfunction -function UpdateSkillPointsUIForAllPlayers takes nothing returns nothing +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 - exitwhen ( i == bj_MAX_PLAYERS ) - call WoWReforgedSkillUI___UpdateSkillPointsUIExec(Player(i)) + 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 -endfunction - -function WoWReforgedSkillUI___TriggerConditioLoaded takes nothing returns boolean - call WoWReforgedSkillUI___UpdateSkillPointsUIForAllPlayersForHero(GetTriggerUnit()) - return false + if ( bj_wantDestroyGroup ) then + call GroupClear(whichGroup) + call DestroyGroup(whichGroup) + set whichGroup=null + set bj_wantDestroyGroup=false + endif + + return result endfunction -function EnableSkillUITriggers takes nothing returns nothing - call EnableTrigger(WoWReforgedSkillUI___selectionTrigger) - call EnableTrigger(WoWReforgedSkillUI___deselectionTrigger) - call EnableTrigger(WoWReforgedSkillUI___loadTrigger) + +function WoWReforgedSaveCodes__FilterIsUnitType takes nothing returns boolean + return GetPrimaryDependencyEquivalent(GetUnitTypeId(GetFilterUnit())) == WoWReforgedSaveCodes__tmpFilterId endfunction -function DisableSkillUITriggers takes nothing returns nothing - call DisableTrigger(WoWReforgedSkillUI___selectionTrigger) - call DisableTrigger(WoWReforgedSkillUI___deselectionTrigger) - call DisableTrigger(WoWReforgedSkillUI___loadTrigger) +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 CreateAndEnableSkillUI takes nothing returns nothing - call WoWReforgedSkillUI___CreateSkillUI() - - call EnableSkillUITriggers() +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___AboutToSave takes nothing returns nothing - call DisableSkillUITriggers() - call WoWReforgedSkillUI___HideSkillUI() +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 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 + 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 + + call GroupClear(buildingsToBeSaved) + call DestroyGroup(buildingsToBeSaved) + set buildingsToBeSaved=null + + return whichGroup endfunction -function WoWReforgedSkillUI___AfterSaving takes nothing returns nothing - call EnableSkillUITriggers() - call UpdateSkillPointsUIForAllPlayers() +function GetAbsCoordinate takes real coordinate,real min returns real + return RAbsBJ(min) + coordinate endfunction -function WoWReforgedSkillUI___Init takes nothing returns nothing - call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedSkillUI___syncTrigger , WoWReforgedSkillUI___PREFIX , false) - call TriggerAddCondition(WoWReforgedSkillUI___syncTrigger, Condition(function WoWReforgedSkillUI___TriggerConditionSync)) +function GetAbsCoordinateX takes real coordinate returns real + local rect worldBounds= GetWorldBounds() + local real x= GetAbsCoordinate(coordinate , GetRectMinX(worldBounds)) + call RemoveRect(worldBounds) + set worldBounds=null - 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) + return x 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 + + return y +endfunction -//library WoWReforgedSkillUI ends -//library WoWReforgedUpdateBackpackUI: +function ConvertAbsCoordinate takes real coordinate,real min returns real + return coordinate - RAbsBJ(min) +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 WoWReforgedUpdateBackpackUI___TriggerActionUpdateBackpackUI takes nothing returns nothing - call UpdateItemsForBackpackUI(updateBackpackUIPlayer) + return x endfunction -function WoWReforgedUpdateBackpackUI___Init takes nothing returns nothing - call TriggerAddAction(updateBackpackUITrigger, function WoWReforgedUpdateBackpackUI___TriggerActionUpdateBackpackUI) +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 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= "" + + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) -//library WoWReforgedUpdateBackpackUI ends -//library WoWReforgedArmory: + //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) -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) + // 5 buildings with their locations + set i=0 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) + 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 - - //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 + // fill rest + loop + 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 -function IsUnitArmory takes unit whichUnit returns boolean - return IsArmory(GetUnitTypeId(whichUnit)) -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 WoWReforgedArmory___TriggerConditionSellItem takes nothing returns boolean - return (IsArmory(GetUnitTypeId((GetTriggerUnit())))) // INLINED!! -endfunction + // checksum + set result=result + ConvertDecimalNumberToSaveCodeSegment(CompressedAbsStringHash(result)) -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.") + if ( SAVE_CODE_OBFUSCATE ) then + //call BJDebugMsg("Non-obfuscated save code: " + result) + set result=ConvertSaveCodeToObfuscatedVersion(result , playerNameHash) + endif + + if ( buildingsCounter > 0 ) then + if ( writeFile ) then + call CreateSaveCodeBuildingsTextFile(playerName , isSinglePlayer , isWarlord , gameType , index , buildingsCounter , buildingNames , result) endif - //else - //call BJDebugMsg("No matching learnable skill for item " + GetItemName(GetSoldItem())) + + call AddGeneratedSaveCode(result) endif - set hero=null - set owner=null + + return result endfunction -function WoWReforgedArmory___TriggerConditionConstructed takes nothing returns boolean - if ( (IsArmory(GetUnitTypeId((GetTriggerUnit())))) ) then // INLINED!! - call WoWReforgedArmory___AddEquipmentItemsToShop(GetConstructedStructure()) - endif - return false +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 + + return result endfunction -function WoWReforgedArmory___TriggerConditionSummoned takes nothing returns boolean - if ( (IsArmory(GetUnitTypeId((GetSummonedUnit())))) ) then // INLINED!! - call WoWReforgedArmory___AddEquipmentItemsToShop(GetSummonedUnit()) - endif - return false +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)) + + return GetSaveCodeBuildingsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , writeFile , index , whichPlayer) endfunction -function WoWReforgedArmory___ForGroupEnableArmory takes nothing returns nothing - call WoWReforgedArmory___AddEquipmentItemsToShop(GetEnumUnit()) +function GetSaveCodeBuildings takes player whichPlayer returns string + return GetSaveCodeBuildingsForIndex(whichPlayer , true , 0) endfunction -function WoWReforgedArmory___FilterBuilding takes nothing returns boolean - return (IsArmory(GetUnitTypeId((GetFilterUnit())))) // INLINED!! +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 endfunction -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()) +function IsObjectFromPlayerRace takes integer objectID,player whichPlayer returns boolean + local integer objectRace= GetObjectRace(objectID) + return PlayerHasUnlockedRace(whichPlayer , GetObjectRace(objectID)) endfunction -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) +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 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 -//library WoWReforgedArmory ends -//library WoWReforgedCheatsSaveCodes: +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 -// Generated Save Codes + //call BJDebugMsg("Obfuscated save code: " + s) + //call BJDebugMsg("Non-Obfuscated save code: " + saveCode) -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 + //call BJDebugMsg("Checked save code part: " + checkedSaveCode) + //call BJDebugMsg("Checked save code part length: " + I2S(StringLength(checkedSaveCode))) + //call BJDebugMsg("Checksum: " + I2S(checksum)) -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 + //call BJDebugMsg("Save code playerNameHash " + I2S(playerNameHash)) + //call BJDebugMsg("Save code XP " + I2S(xp)) -function ForGroupRemoveUnit takes nothing returns nothing - call h__RemoveUnit(GetEnumUnit()) + 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 + + 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 + + return false 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)) +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= "" - set result=GetSaveCodeBuildingsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer , allBuildings) + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif - call ForGroupBJ(allBuildings, function ForGroupRemoveUnit) + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif - call GroupClear(allBuildings) - call DestroyGroup(allBuildings) - set allBuildings=null + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif - call RemoveLocation(tmpLocation) - set tmpLocation=null + 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_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) +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= "" - call RemoveLocation(tmpLocation) - set tmpLocation=null + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif - return allDragons -endfunction + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif -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 ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif - call ForGroupBJ(allDragons, function ForGroupRemoveUnit) + if ( isWarlord ) then + set warlordStatus="W" + endif - call GroupClear(allDragons) - call DestroyGroup(allDragons) - set allDragons=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 - call GroupClear(allDragonsDistinct) - call DestroyGroup(allDragonsDistinct) - set allDragonsDistinct=null + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result +endfunction - call RemoveLocation(tmpLocation) - set tmpLocation=null +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= "" - return result -endfunction + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" + endif -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 + if ( isWarlord ) then + set gameMode="Warlord" + endif - 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 ( 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=GetSaveCodeItemsEx2(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , item0 , item1 , item2 , item3 , item4 , item5) + call FileStart() - call h__RemoveItem(item0) - set item0=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(item1) - set item1=null + // The line below creates the log + call Preload((content)) // INLINED!! - call h__RemoveItem(item2) - set item2=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(item3) - set item3=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= "" - call h__RemoveItem(item4) - set item4=null + //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) - call h__RemoveItem(item5) - set item5=null + 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 - return result -endfunction + 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 GetSaveCodeHumanUpgrades takes player whichPlayer,string playerName,boolean singlePlayer,boolean warlord returns string - local integer ironForgedSwordsLevel= GetPlayerTechCountSimple('Rhme', whichPlayer) - local string result + 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', 3) + 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 - set result=GetSaveCodeResearchesEx(playerName , singlePlayer , warlord , udg_GameTypeNormal , 100 , true , 0 , whichPlayer) + 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 - call h__SetPlayerTechResearched(whichPlayer, 'Rhme', ironForgedSwordsLevel) + 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 - 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 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!! + // 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 ( 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 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 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!") +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 -function GenerateSaveCodeNewOpLimit takes nothing returns nothing - call GenerateSaveCode(WoWReforgedCheatsSaveCodes___generateSaveCodePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodePlayerName , WoWReforgedCheatsSaveCodes___generateSaveCodeSinglePlayer , WoWReforgedCheatsSaveCodes___generateSaveCodeWarlord , WoWReforgedCheatsSaveCodes___generateSaveCodeXpRate) +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 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") +function GetSaveCodeItems takes player whichPlayer returns string + return GetSaveCodeItemsForIndex(whichPlayer , true , 0) 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 +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 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 + 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 >= 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 + 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 set i=i + 1 endloop + + return result endfunction +function GetSaveCodeItemsMax takes nothing returns integer + return 3 + BACKPACK_MAX_PAGES + 3 +endfunction -//library WoWReforgedCheatsSaveCodes ends -//library WoWReforgedPrestoredSaveCodes: - +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 PlayerIsInElvenClan takes player whichPlayer returns boolean - return IsPlayerInForce(whichPlayer, prestoredElvenClanMembers) + return GetSaveCodeItemsEx(GetPlayerName(whichPlayer) , isSinglePlayer , isWarlord , gameType , xpRate , hero , true , index) endfunction -function GetPrestoredClanSaveCodeMatchingPlayer takes integer saveCodeIndex returns player - local player result= null - local integer playerRank= - 1 - local integer index= 0 +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 j= 0 - 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 + 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) + + //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 ( 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] + 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 j=j + 1 + set i=i + 1 + set pos=pos + 2 endloop - endif - 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 - 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 + call DisplaySaveCodeErrorAtLeastOne(whichPlayer , atLeastOne) + + if ( atLeastOne ) then + call AddGeneratedSaveCode(s) endif + + return atLeastOne endif - 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") + else + call h__DisplayTimedTextToPlayer(((whichPlayer) ), 0.0, 0.0, 6.0, ( "Savecode from the same game!")) // INLINED!! endif -endfunction -function GetPrestoredSaveCodesMax takes nothing returns integer - return PrestoredSaveCodeCounter + return false 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 +function ApplySaveCodeItems takes player whichPlayer,string s returns boolean + local unit hero= udg_Hero[GetPlayerId(whichPlayer)] + return ApplySaveCodeItemsEx(whichPlayer , s , hero) endfunction -function AddPrestoredSaveCode takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_HEROES , playerName , saveCode) -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 AddPrestoredSaveCodeItems takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_ITEMS , playerName , saveCode) -endfunction + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif -function AddPrestoredSaveCodeUnits takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_UNITS , playerName , saveCode) -endfunction + if ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif -function AddPrestoredSaveCodeBuildings takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_BUILDINGS , playerName , saveCode) -endfunction + if ( isWarlord ) then + set warlordStatus="Warlord" + endif -function AddPrestoredSaveCodeResearches takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_RESEARCHES , playerName , saveCode) -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 AddPrestoredSaveCodeLetter takes string playerName,string saveCode returns integer - return AddPrestoredSaveCodeEx(PRESTORED_SAVECODE_TYPE_LETTER , playerName , saveCode) -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") + else + set result=AppendSaveCodeInfo(result , I2S(i + 1) + " - |cffff0000" + GetObjectName(saveObjectId) + "|r") + endif -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 + 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 -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 + return result endfunction -function GetPrestoredSaveCodePlayerNameByIndex takes integer index returns string - return PrestoredSaveCodePlayerName[index] -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!! + 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= "" -function GetPrestoredSaveCodeByIndex takes integer index returns string - return PrestoredSaveCode[index] -endfunction + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set checksumStatus="Invalid" + endif -function GetPrestoredSaveCodeTypeByIndex takes integer index returns integer - return PrestoredSaveCodeType[index] -endfunction + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif -function GetPrestoredSaveCodeMemberPlayerName takes integer index returns string - return PrestoredSaveCodePlayerNames[index] -endfunction + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif -function GetPrestoredSaveCodeMemberPlayerRank takes integer index returns integer - return PrestoredSaveCodePlayerRanks[index] -endfunction + if ( isWarlord ) then + set warlordStatus="W" + endif -function GetPrestoredSaveCodeCounter takes string playerName returns integer - local integer counter= 0 - local integer i= 0 + set i=0 loop - exitwhen ( i >= PrestoredSaveCodeCounter ) - if ( PrestoredSaveCodePlayerName[i] == playerName ) then - set counter=counter + 1 + 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 counter + + return singlePlayerStatus + "-" + gameTypeName + "-" + warlordStatus + "-" + I2S(index) + result endfunction -function GetPrestoredSaveCodeIndices takes string playerName returns string - local string result= "" - local integer counter= 0 - local integer i= 0 - loop - 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 - 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 -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 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 ( 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 + 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 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 + //call BJDebugMsg("Size of units before distinct: " + I2S(CountUnitsInGroup(whichGroup))) + //call BJDebugMsg("Size of units after distinct: " + I2S(CountUnitsInGroup(result))) - 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 + call GroupClear(livingUnitsToBeSaved) + call DestroyGroup(livingUnitsToBeSaved) + set livingUnitsToBeSaved=null + + //call BJDebugMsg("Size of units: " + I2S(BlzGroupGetSize(whichGroup))) - return result + return whichGroup 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 - 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 - - set result=result + "-loadp " + I2S(i) + ": " + GetSaveCodeShortInfos(playerName , PrestoredSaveCode[i]) +function GetSaveCodeUnitsMax takes nothing returns integer + return 8 +endfunction - set counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_ITEMS ) then - if ( counter > 0 ) then - set result=result + "\n" - endif +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 result=result + "-loadpi " + I2S(i) + ": " + GetSaveCodeShortInfosItems(whichPlayer , PrestoredSaveCode[i]) + if ( isSinglePlayer ) then + set singleplayer="yes" + set singlePlayerFileName="Singleplayer" + endif - set counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_UNITS ) then - if ( counter > 0 ) then - set result=result + "\n" - endif + if ( isWarlord ) then + set gameMode="Warlord" + endif - set result=result + "-loadpu " + I2S(i) + ": " + GetSaveCodeShortInfosUnits(whichPlayer , PrestoredSaveCode[i]) + 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 counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_BUILDINGS ) then - if ( counter > 0 ) then - set result=result + "\n" - endif - set result=result + "-loadpb " + I2S(i) + ": " + GetSaveCodeShortInfosBuildings(whichPlayer , PrestoredSaveCode[i]) + call FileStart() - set counter=counter + 1 - elseif ( PrestoredSaveCodeType[i] == PRESTORED_SAVECODE_TYPE_RESEARCHES ) then - if ( counter > 0 ) then - set result=result + "\n" - endif + 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!! - set result=result + "-loadpr " + I2S(i) + ": " + GetSaveCodeShortInfosResearches(whichPlayer , PrestoredSaveCode[i]) + // The line below creates the log + call Preload((content)) // 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 + // 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 - - call ShowUrlUi(whichPlayer , title , saveCode) +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 + if ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + endif -endfunction + if ( isSinglePlayer ) then + set singlePlayerStatus="S" + endif -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!! + 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 + + 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" @@ -84139,59 +81752,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)) @@ -84200,39 +81826,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) @@ -84248,15 +81895,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!! @@ -84265,7 +81934,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!! @@ -84274,6 +81943,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) @@ -84281,9 +81951,11 @@ 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= "" @@ -84311,21 +81983,33 @@ function GetSaveCodeInfosResources takes player whichPlayer,string s returns str 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 >= 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 + 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 GetSaveCodeShortInfosResources takes player whichPlayer,string s returns string +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!! @@ -84334,6 +82018,7 @@ function GetSaveCodeShortInfosResources takes player whichPlayer,string s return 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) @@ -84341,9 +82026,11 @@ function GetSaveCodeShortInfosResources takes player whichPlayer,string s return 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= "" @@ -84366,4472 +82053,2968 @@ function GetSaveCodeShortInfosResources takes player whichPlayer,string s return 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 + 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 + result + 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 -//library WoWReforgedSaveCodesResources ends -//library WoWReforgedStandardObjectFields: + return members + playerName + "_" + GetClanRankName(playerRank) + endif -function AddRaceStandardObjectIdFields takes nothing returns nothing + 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)) -//library WoWReforgedStandardObjectFields ends -//library WoWReforgedUpdateSkillUI: + //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 + + return "f_" + playerNameFrom + "-t_" + playerNameToText + "-m_" + I2S(StringLength(message)) +endfunction + +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 ( checksum == CompressedAbsStringHash(checkedSaveCode) and playerNameToHash == CompressedAbsStringHash(playerName) ) then + call h__DisplayTimedTextToPlayer(whichPlayer, 0.0, 0.0, 120.0, "Letter from " + playerNameFrom + ": " + message) + + return true + endif + + return false +endfunction + +function ApplySaveCodeLetter takes player whichPlayer,string playerName,string s returns boolean + return ApplySaveCodeLetterEx(whichPlayer , "all" , s) or ApplySaveCodeLetterEx(whichPlayer , playerName , s) +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= "" + + + if ( checksum != CompressedAbsStringHash(checkedSaveCode) ) then + set result=result + "Expected different checksum!" + endif + + if ( playerNameToHash != CompressedAbsStringHash(playerName) ) then + if ( StringLength(result) > 0 ) then + set result=result + ", " + endif + + set result=result + "Expected different player name!" + endif + + if ( StringLength(result) == 0 ) then + set result="None errors detected." + endif + + return result +endfunction + +// Save and Load Auto + + +function SaveAndLoadAutoGetPlayerFromSyncData takes string source returns player + return Player(S2I((StringTokenEx((source ) , ( 0) , " " , false)))) // 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 SaveAndLoadAutoInit takes nothing returns nothing + call TriggerRegisterAnyPlayerSyncEvent(SaveAndLoadAutoSyncTrigger , SAVE_AND_LOAD_AUTO_PREFIX , false) + call TriggerAddAction(SaveAndLoadAutoSyncTrigger, function SaveAndLoadAutoTriggerAction) +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 + + 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 -function WoWReforgedUpdateSkillUI___Init takes nothing returns nothing - call TriggerAddAction(updateSkillUITrigger, function UpdateSkillPointsUIForAllPlayers) + return null endfunction -//library WoWReforgedUpdateSkillUI ends -//library WoWReforgedSaveCodesAll: +//library WoWReforgedSaveCodes ends +//library WoWReforgedSkillUI: -function ResetSaveCodeAllTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__loadedAllOnce[GetPlayerId(whichPlayer)]=true +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 GetModeSuffix takes nothing returns string - if ( IsInSinglePlayer() ) then - return "Singleplayer" +// 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 - 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" - endif - - return "Normal" +function WoWReforgedSkillUI___TriggerActionUpdateSkillPointsUI takes nothing returns nothing + call UpdateSkillPointsUI(WoWReforgedSkillUI___tmpPlayer) endfunction -function GetGameTypeSuffix takes nothing returns string - return GetGameTypeSuffixEx(udg_GameType) +function WoWReforgedSkillUI___UpdateSkillPointsUIExec takes player whichPlayer returns nothing + set WoWReforgedSkillUI___tmpPlayer=whichPlayer + call TriggerExecute(WoWReforgedSkillUI___tmpTrigger) endfunction -function GetGameModeSuffix takes boolean isWarlord returns string - if ( isWarlord ) then - return "Warlord" +function WoWReforgedSkillUI___SetSkillUIVisible takes player whichPlayer,boolean visible returns nothing + if ( whichPlayer == GetLocalPlayer() ) then + call WoWReforgedSkillUI___SetSkillUIVisibleAll(visible) 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 - -function GetSaveCodeAllItemsFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Items.txt" // INLINED!! + call UpdateSkillPointsUI(whichPlayer) endfunction -function GetSaveCodeAllUnitsFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Units.txt" // INLINED!! -endfunction +function WoWReforgedSkillUI___TriggerActionUp takes nothing returns nothing + local integer a= LoadInteger(WoWReforgedSkillUI___h, GetHandleId(GetTriggeringTrigger()), 0) -function GetSaveCodeAllBuildingsFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Buildings.txt" // INLINED!! + if ( GetTriggerPlayer() == GetLocalPlayer() ) then + call BlzSendSyncData(WoWReforgedSkillUI___PREFIX, "Up" + I2S(a)) + 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___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 GetSaveCodeAllResourcesFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Resources.txt" // INLINED!! +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 GetSaveCodeAllClanFileName takes string playerName,boolean isWarlord returns string - return "WoWR-" + playerName + "-" + GetModeSuffix() + "-" + (GetGameTypeSuffixEx(udg_GameType)) + "-" + GetGameModeSuffix(isWarlord) + "-Clan.txt" // INLINED!! +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 GetSaveCodeAllFileNameForPlayer takes player whichPlayer returns string - return GetSaveCodeAllFileName(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 GetSaveCodeAllFileNameItemsForPlayer takes player whichPlayer returns string - return GetSaveCodeAllItemsFileName(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 GetSaveCodeAllFileNameUnitsForPlayer takes player whichPlayer returns string - return GetSaveCodeAllUnitsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) -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 GetSaveCodeAllFileNameBuildingsForPlayer takes player whichPlayer returns string - return GetSaveCodeAllBuildingsFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) + // hide for all players + call WoWReforgedSkillUI___HideSkillUI() endfunction -function GetSaveCodeAllFileNameResearchesForPlayer takes player whichPlayer returns string - return GetSaveCodeAllResearchesFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) +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 GetSaveCodeAllFileNameResourcesForPlayer takes player whichPlayer returns string - return GetSaveCodeAllResourcesFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) -endfunction +function WoWReforgedSkillUI___TriggerConditionSelected takes nothing returns boolean + local integer playerId= GetPlayerId(GetTriggerPlayer()) + set WoWReforgedSkillUI___currentHero[playerId]=GetTriggerUnit() + + call WoWReforgedSkillUI___UpdateSkillPointsUIExec(GetTriggerPlayer()) -function GetSaveCodeAllFileNameClanForPlayer takes player whichPlayer returns string - return GetSaveCodeAllClanFileName(GetPlayerName(whichPlayer) , IsPlayerWarlord(whichPlayer)) + return false endfunction -function CreateSaveCodeAllHeroesTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= GetSaveCode(whichPlayer) - local string content= "" +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 - set content=content + " -load " + saveCode - set content=content + " " + call WoWReforgedSkillUI___UpdateSkillPointsUIExec(GetTriggerPlayer()) - call FileIO_Write(GetSaveCodeAllFileNameForPlayer(whichPlayer) , content) -endfunction - -function CreateSaveCodeAllHeroesTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllHeroesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) -endfunction - -function CreateSaveCodeAllHeroesTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllHeroesTextFileNewOpLimit)) // INLINED!! + return false endfunction -function CreateSaveCodeAllItemsTextFileEx 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= (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 + " " + 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(GetSaveCodeAllFileNameItemsForPlayer(whichPlayer) , content) -endfunction - -function CreateSaveCodeAllItemsTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllItemsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) -endfunction - -function CreateSaveCodeAllItemsTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllItemsTextFileNewOpLimit)) // INLINED!! endfunction -function CreateSaveCodeAllUnitsTextFileEx 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 units") - set saveCode=GetSaveCodeUnitsForIndex(whichPlayer , false , i) - if ( saveCode != null and saveCode != "" ) then - set content=content + " -loadu " + saveCode - set content=content + " " - endif + exitwhen ( i == bj_MAX_PLAYERS ) + call WoWReforgedSkillUI___UpdateSkillPointsUIExec(Player(i)) set i=i + 1 endloop - - call FileIO_Write(GetSaveCodeAllFileNameUnitsForPlayer(whichPlayer) , content) endfunction -function CreateSaveCodeAllUnitsTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllUnitsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +function WoWReforgedSkillUI___TriggerConditioLoaded takes nothing returns boolean + call WoWReforgedSkillUI___UpdateSkillPointsUIForAllPlayersForHero(GetTriggerUnit()) + + return false endfunction -function CreateSaveCodeAllUnitsTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllUnitsTextFileNewOpLimit)) // INLINED!! +function EnableSkillUITriggers takes nothing returns nothing + call EnableTrigger(WoWReforgedSkillUI___selectionTrigger) + call EnableTrigger(WoWReforgedSkillUI___deselectionTrigger) + call EnableTrigger(WoWReforgedSkillUI___loadTrigger) endfunction -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= (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 - set i=i + 1 - endloop - - set content=content + " " - - call FileIO_Write(GetSaveCodeAllFileNameBuildingsForPlayer(whichPlayer) , content) +function DisableSkillUITriggers takes nothing returns nothing + call DisableTrigger(WoWReforgedSkillUI___selectionTrigger) + call DisableTrigger(WoWReforgedSkillUI___deselectionTrigger) + call DisableTrigger(WoWReforgedSkillUI___loadTrigger) endfunction -function CreateSaveCodeAllBuildingsTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllBuildingsTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) +function CreateAndEnableSkillUI takes nothing returns nothing + call WoWReforgedSkillUI___CreateSkillUI() + + call EnableSkillUITriggers() endfunction -function CreateSaveCodeAllBuildingsTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllBuildingsTextFileNewOpLimit)) // INLINED!! +function WoWReforgedSkillUI___AboutToSave takes nothing returns nothing + call DisableSkillUITriggers() + call WoWReforgedSkillUI___HideSkillUI() 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 WoWReforgedSkillUI___AfterSaving takes nothing returns nothing + call EnableSkillUITriggers() + call UpdateSkillPointsUIForAllPlayers() endfunction -function CreateSaveCodeAllResearchesTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllResearchesTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer) -endfunction +function WoWReforgedSkillUI___Init takes nothing returns nothing + call TriggerRegisterAnyPlayerSyncEvent(WoWReforgedSkillUI___syncTrigger , WoWReforgedSkillUI___PREFIX , false) + call TriggerAddCondition(WoWReforgedSkillUI___syncTrigger, Condition(function WoWReforgedSkillUI___TriggerConditionSync)) -function CreateSaveCodeAllResearchesTextFile takes player whichPlayer returns nothing - set WoWReforgedSaveCodesAll__tmpPlayer=whichPlayer - call ForForce(bj_FORCE_PLAYER[0], (function CreateSaveCodeAllResearchesTextFileNewOpLimit)) // INLINED!! + 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 CreateSaveCodeAllResourcesTextFileEx takes player whichPlayer returns nothing - local string playerName= GetPlayerName(whichPlayer) - local string saveCode= GetSaveCodeResources(whichPlayer) - local string content= "" - - set content=content + " -loadres " + saveCode - set content=content + " " - call FileIO_Write(GetSaveCodeAllFileNameResourcesForPlayer(whichPlayer) , content) -endfunction +//library WoWReforgedSkillUI ends +//library WoWReforgedUpdateBackpackUI: -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!! +function WoWReforgedUpdateBackpackUI___TriggerActionUpdateBackpackUI takes nothing returns nothing + call UpdateItemsForBackpackUI(updateBackpackUIPlayer) endfunction -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___Init takes nothing returns nothing + call TriggerAddAction(updateBackpackUITrigger, function WoWReforgedUpdateBackpackUI___TriggerActionUpdateBackpackUI) endfunction -function CreateSaveCodeAllClanTextFileNewOpLimit takes nothing returns nothing - call CreateSaveCodeAllClanTextFileEx(WoWReforgedSaveCodesAll__tmpPlayer , WoWReforgedSaveCodesAll__tmpString) -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 +//library WoWReforgedUpdateBackpackUI ends +//library WoWReforgedArmory: -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 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!! - - // 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!! - // 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!! - - // 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)) - 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)) + 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 - - 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 ( playerNameHash != CompressedAbsStringHash(GetPlayerName(whichPlayer)) ) then + set playerName="Not yours" + 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 ( isSinglePlayer ) then + set singlePlayerStatus="Singleplayer" + endif -function WoWReforgedWebsite__GenerateRaces takes nothing returns nothing - local integer i= 0 - local integer max= udg_MaxRaces + if ( isWarlord ) then + set warlordStatus="Warlord" + endif - call FileStart() - call Preload(("")) // INLINED!! - set i=0 - loop - exitwhen ( i == max ) - call WoWReforgedWebsite__GenerateRace(i) - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! + 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)) - // 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!! + 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 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!! +//library WoWReforgedSaveCodesResources ends +//library WoWReforgedStandardObjectFields: - call Preload(("")) // INLINED!! - endif - set i=i + 1 - endloop +function AddRaceStandardObjectIdFields takes nothing returns nothing - call Preload(("")) // INLINED!! - - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Players.txt")) // INLINED!! endfunction -function WoWReforgedWebsite__GenerateClans takes nothing returns nothing - local integer i= 0 - local integer max= (PrestoredSaveCodeCounter) // INLINED!! - local string name= "" - local string saveCode= "" - 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 - 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!! +//library WoWReforgedStandardObjectFields ends +//library WoWReforgedUpdateSkillUI: - call Preload(("")) // INLINED!! - endif - endif - set i=i + 1 - endloop - - call Preload(("")) // INLINED!! - // The line below creates the file at the specified location - call PreloadGenEnd(("WorldOfWarcraftReforged-Clans.txt")) // INLINED!! +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(("")) // INLINED!! - if ( not isRunningWild ) then - call WoWReforgedWebsite__IconToHtmlEx((GetUnitTypeId(mount)) , "") // INLINED!! - else - call WoWReforgedWebsite__IconToHtmlEx((s__WoWReforgedMounts__M_itemTypeId[(WoWReforgedMounts__mountTypes[(i)])]) , "") // INLINED!! - endif - 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 @@ -90550,7 +86733,7 @@ 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) @@ -90564,12 +86747,12 @@ call AddPagedButtonsId((tavern ) , ( (WoWReforgedStartLocations__startLocationsI 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()) @@ -90608,7 +86791,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()) @@ -90617,11 +86800,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 @@ -91340,8 +87523,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.") @@ -91441,7 +87624,7 @@ function WoWReforgedCinematic__StorePlayerQueueUI takes nothing returns nothing 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 @@ -91563,7 +87746,7 @@ endfunction function WoWReforgedRacesUI___ForForceUpdateIdleWorkerIcons takes nothing returns nothing local player slotPlayer= GetEnumPlayer() - local integer size= (BlzGroupGetSize(IdleWorkersSystem___idleWorkers[GetPlayerId((slotPlayer))])) // INLINED!! + local integer size= (BlzGroupGetSize(IdleWorkersSystem__idleWorkers[GetPlayerId((slotPlayer))])) // INLINED!! call RefreshIdleWorkers(slotPlayer) @@ -94241,8 +90424,6 @@ endfunction //*************************************************************************** //* WoW Reforged Cages //*************************************************************************** -//* WoW Reforged Website -//*************************************************************************** //* WoW Reforged Fel //*************************************************************************** //* WoW Reforged Fel Orc Piggery @@ -108451,39 +104632,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 @@ -110812,7 +106993,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() // ########################### @@ -110838,7 +107019,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() // ########################### @@ -110864,7 +107045,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() // ########################### @@ -110875,43 +107056,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() // ########################### @@ -110926,13 +107107,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() // ########################### @@ -110940,84 +107121,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() // ########################### @@ -113385,8 +109566,8 @@ function Trig_Turrets_Auto_Target_Func003C takes nothing returns boolean endfunction function Trig_Turrets_Auto_Target_Actions takes nothing returns nothing - set udg_TmpUnit=(TurretSystem___TurretSystemTriggerTurret) // INLINED!! - set udg_TmpUnit2=(TurretSystem___TurretSystemTriggerTargetUnit) // INLINED!! + set udg_TmpUnit=(TurretSystem__TurretSystemTriggerTurret) // INLINED!! + set udg_TmpUnit2=(TurretSystem__TurretSystemTriggerTargetUnit) // INLINED!! if ( Trig_Turrets_Auto_Target_Func003C() ) then call IssueTargetOrderBJ(udg_TmpUnit, "web", udg_TmpUnit2) else @@ -113432,7 +109613,7 @@ function Trig_Turret_Learn_Increase_Stats_Actions takes nothing returns nothing set udg_TmpInteger=GetUnitAbilityLevelSwapped(udg_TmpAbilityCode, GetTriggerUnit()) call GroupClear(udg_TmpGroup) set bj_wantDestroyGroup=true - call GroupAddGroup((LoadGroupHandle(TurretSystem___TurretSystemHashTable, GetHandleId((GetTriggerUnit())), TurretSystem___TURRET_SYSTEM_KEY_TURRETS)), udg_TmpGroup) // INLINED!! + call GroupAddGroup((LoadGroupHandle(TurretSystem__TurretSystemHashTable, GetHandleId((GetTriggerUnit())), TurretSystem__TURRET_SYSTEM_KEY_TURRETS)), udg_TmpGroup) // INLINED!! call ForGroupBJ(udg_TmpGroup, function Trig_Turret_Learn_Increase_Stats_Func006A) endfunction @@ -114150,8 +110331,8 @@ function Trig_Chat_Command_Cam_RPG_On_Actions takes nothing returns nothing if ( Trig_Chat_Command_Cam_RPG_On_Func003Func004C() ) then call h__QuestMessageBJ(GetForceOfPlayer(udg_TmpPlayer), bj_QUESTMESSAGE_ALWAYSHINT, "TRIGSTR_4645") call s__AThirdPersonCamera_enable(s__AThirdPersonCamera_playerThirdPersonCamera(udg_TmpPlayer),udg_Hero[GetPlayerId(udg_TmpPlayer)] , 0.0) - set KeyMovementSystem___Unit[GetPlayerId((udg_TmpPlayer ))]=( udg_Hero[GetPlayerId(udg_TmpPlayer)]) // INLINED!! - call TimerStart(KeyMovementSystem___UpdateTimer, KeyMovementSystem_TIMER_INTERVAL, true, function KeyMovementSystem___TimerFunctionUpdate) // INLINED!! + set KeyMovementSystem__Unit[GetPlayerId((udg_TmpPlayer ))]=( udg_Hero[GetPlayerId(udg_TmpPlayer)]) // INLINED!! + call TimerStart(KeyMovementSystem__UpdateTimer, KeyMovementSystem_TIMER_INTERVAL, true, function KeyMovementSystem__TimerFunctionUpdate) // INLINED!! call UnitAddTypeBJ(UNIT_TYPE_PEON, udg_Held[GetConvertedPlayerId(udg_TmpPlayer)]) call FogEnableOff() call FogMaskEnableOff() @@ -114186,7 +110367,7 @@ function Trig_Chat_Command_Cam_RPG_Off_Actions takes nothing returns nothing set udg_CamRPGPlayerEnabled[GetConvertedPlayerId(udg_TmpPlayer)]=false set udg_CamLockPlayerEnabled[GetConvertedPlayerId(udg_TmpPlayer)]=false call s__AThirdPersonCamera_disable(s__AThirdPersonCamera_playerThirdPersonCamera(udg_TmpPlayer)) - set KeyMovementSystem___Unit[GetPlayerId((udg_TmpPlayer))]=null // INLINED!! + set KeyMovementSystem__Unit[GetPlayerId((udg_TmpPlayer))]=null // INLINED!! call ResetToGameCameraForPlayer(udg_TmpPlayer, 0) call UnitRemoveTypeBJ(UNIT_TYPE_PEON, udg_Held[GetConvertedPlayerId(udg_TmpPlayer)]) call FogEnableOn() @@ -116088,7 +112269,7 @@ function Trig_Summon_Unit_Summon_Black_Arrow_Func006A takes nothing returns noth endfunction function Trig_Summon_Unit_Summon_Black_Arrow_Actions takes nothing returns nothing - set udg_TmpUnit=(BlackArrowSystem___BlackArrowCaster) // INLINED!! + set udg_TmpUnit=(BlackArrowSystem__BlackArrowCaster) // INLINED!! if ( Trig_Summon_Unit_Summon_Black_Arrow_Func002C() ) then set udg_TmpAbilityCode='A1Y3' else @@ -116096,7 +112277,7 @@ function Trig_Summon_Unit_Summon_Black_Arrow_Actions takes nothing returns nothi endif set udg_TmpInteger2=4 call GroupClear(udg_TmpGroup) - call GroupAddGroup((BlackArrowSystem___BlackArrowSummonedUnits), udg_TmpGroup) // INLINED!! + call GroupAddGroup((BlackArrowSystem__BlackArrowSummonedUnits), udg_TmpGroup) // INLINED!! call ForGroupBJ(udg_TmpGroup, function Trig_Summon_Unit_Summon_Black_Arrow_Func006A) endfunction @@ -117732,7 +113913,7 @@ endfunction // Trigger: Item Respawns Respawn //=========================================================================== function Trig_Item_Respawns_Respawn_Actions takes nothing returns nothing - local location tmpLocation= GetItemLoc((ItemRespawnSystem___callbackItem)) // INLINED!! + local location tmpLocation= GetItemLoc((ItemRespawnSystem__callbackItem)) // INLINED!! call DestroyEffect(AddSpecialEffectLocBJ(tmpLocation, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl")) call RemoveLocation(tmpLocation) set tmpLocation=null @@ -126367,9 +122548,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 //=========================================================================== @@ -132575,7 +128756,7 @@ endfunction // Trigger: Miner Item Start Respawn //=========================================================================== function Trig_Miner_Item_Start_Respawn_Actions takes nothing returns nothing - set udg_TmpItem=(ItemRespawnSystem___callbackItem) // INLINED!! + set udg_TmpItem=(ItemRespawnSystem__callbackItem) // INLINED!! set udg_TmpUnit=GetTriggerUnit() call MinerPickup(udg_TmpUnit , udg_TmpItem) endfunction @@ -132603,7 +128784,7 @@ endfunction // Trigger: Prospector Item Start Respawn //=========================================================================== function Trig_Prospector_Item_Start_Respawn_Actions takes nothing returns nothing - set udg_TmpItem=(ItemRespawnSystem___callbackItem) // INLINED!! + set udg_TmpItem=(ItemRespawnSystem__callbackItem) // INLINED!! set udg_TmpUnit=GetTriggerUnit() call ProspectorPickup(udg_TmpUnit , udg_TmpItem) endfunction @@ -173768,7 +169949,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 @@ -173782,7 +169963,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 @@ -174574,8 +170755,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 @@ -209505,25 +205686,25 @@ function main takes nothing returns nothing call CreateAllUnits() call InitBlizzard() -call ExecuteFunc("jasshelper__initstructs109402859") -call ExecuteFunc("BoundSentinel__init") -call ExecuteFunc("Corpse___Init") -call ExecuteFunc("CustomRaceSoundSystem___Init") +call ExecuteFunc("jasshelper__initstructs109830953") +call ExecuteFunc("BoundSentinel___init") +call ExecuteFunc("Corpse__Init") +call ExecuteFunc("CustomRaceSoundSystem__Init") call ExecuteFunc("ForceUtils___Init") call ExecuteFunc("FrameLoader___init_function") -call ExecuteFunc("FrameSaver__Init") -call ExecuteFunc("GroupUtils__Init") +call ExecuteFunc("FrameSaver___Init") +call ExecuteFunc("GroupUtils___Init") call ExecuteFunc("HeroUtils___Init") call ExecuteFunc("HostUtils___Init") -call ExecuteFunc("IdleWorkersSystem___Init") +call ExecuteFunc("IdleWorkersSystem__Init") call ExecuteFunc("ItemUtils___Init") -call ExecuteFunc("MaxItemStacks___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("SimError___init") +call ExecuteFunc("TerrainPathability___Init") +call ExecuteFunc("TimerUtils___init") call ExecuteFunc("TreeUtils___Init") call ExecuteFunc("UnitTypeUtils___Init") call ExecuteFunc("WallsSystem___Init") @@ -209539,99 +205720,99 @@ call ExecuteFunc("WoWReforgedGaia__Init") call ExecuteFunc("WoWReforgedHunter__Init") call ExecuteFunc("WoWReforgedRandomArtifacts__Init") call ExecuteFunc("WoWReforgedUrlUi___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("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("PagedButtonsConfig___Init") call ExecuteFunc("PlayerColorUtils___Init") call ExecuteFunc("Resources___Init") call ExecuteFunc("TinyBuildingsLimits___Init") call ExecuteFunc("WoWReforgedBan__Init") -call ExecuteFunc("WoWReforgedCombiner___Init") +call ExecuteFunc("WoWReforgedCombiner__Init") call ExecuteFunc("WoWReforgedFel__Init") -call ExecuteFunc("WoWReforgedLearnableSkills___Init") +call ExecuteFunc("WoWReforgedLearnableSkills__Init") call ExecuteFunc("WoWReforgedLevers__Init") -call ExecuteFunc("WoWReforgedTreeUtils___Init") -call ExecuteFunc("DiplomacyUI___Init") -call ExecuteFunc("DrainResources___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("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("Taunts__Init") call ExecuteFunc("UnitGroupRespawnSystem___Init") -call ExecuteFunc("VoteSystem___Init") +call ExecuteFunc("VoteSystem__Init") call ExecuteFunc("WoWReforgedDayNightCycleEffects__Init") -call ExecuteFunc("WoWReforgedHeroSkills___Init") -call ExecuteFunc("WoWReforgedPagedButtonsConfig___Init") +call ExecuteFunc("WoWReforgedHeroSkills__Init") +call ExecuteFunc("WoWReforgedPagedButtonsConfig__Init") call ExecuteFunc("WoWReforgedProspector__Init") call ExecuteFunc("Crafting___Init") -call ExecuteFunc("KeyMovementSystem___Init") +call ExecuteFunc("KeyMovementSystem__Init") call ExecuteFunc("LogUI___Init") call ExecuteFunc("PagedButtonsUI___Init") -call ExecuteFunc("QueueUI___Init") +call ExecuteFunc("QueueUI__Init") call ExecuteFunc("ResourcesGui___Init") call ExecuteFunc("ResourcesLoadedMines___Init") -call ExecuteFunc("Tunnel___Init") -call ExecuteFunc("WoWReforgedCritters___Init") -call ExecuteFunc("WoWReforgedLevels___Init") +call ExecuteFunc("Tunnel__Init") +call ExecuteFunc("WoWReforgedCritters__Init") +call ExecuteFunc("WoWReforgedLevels__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("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("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("AuraSystem__Init") call ExecuteFunc("WowReforgedCook__Init") -call ExecuteFunc("WoWReforgedUtils___Init") +call ExecuteFunc("WoWReforgedUtils__Init") call ExecuteFunc("SpellsMeteorKnockbackType___Init") -call ExecuteFunc("SpellsSlideKnockbackType__Init") -call ExecuteFunc("WoWReforgedBanners___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("WoWReforgedLearnableSkillsShop__Init") +call ExecuteFunc("WoWReforgedProfessionsTavern__Init") call ExecuteFunc("WoWReforgedResurrectionStone__Init") -call ExecuteFunc("WoWReforgedSkins___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("WoWReforgedHeroesTavern__Init") call ExecuteFunc("WoWReforgedInscriptor__Init") call ExecuteFunc("WoWReforgedMounts__Init") -call ExecuteFunc("WoWReforgedStandardHeroAbilities___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("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("MaxHpResearch__Init") call ExecuteFunc("WoWReforgedArena__Init") call ExecuteFunc("WoWReforgedRacing__Init") call ExecuteFunc("WoWReforgedZones__Init") @@ -209641,17 +205822,16 @@ call ExecuteFunc("WoWReforgedMaxHpResearch__Init") call ExecuteFunc("WoWReforgedPortals__Init") call ExecuteFunc("WoWReforgedCalendarMultiboard__Init") call ExecuteFunc("WoWReforgedProperties__Init") -call ExecuteFunc("WoWReforgedBackpacks___Init") +call ExecuteFunc("WoWReforgedBackpacks__Init") call ExecuteFunc("WoWReforgedHeroTransformation__Init") -call ExecuteFunc("WoWReforgedEquipment___Init") +call ExecuteFunc("WoWReforgedEquipment__Init") call ExecuteFunc("WoWReforgedSkillUI___Init") call ExecuteFunc("WoWReforgedUpdateBackpackUI___Init") -call ExecuteFunc("WoWReforgedArmory___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("WoWReforgedRacesUI___Init") @@ -209770,22 +205950,22 @@ local integer bonus=f__arg_integer1 endfunction function sa__MissileGroup_destroy takes nothing returns boolean local integer this=f__arg_this - call s__MissileUtils__MGroup_deallocate(s__MissileGroup_group[this]) + call s__MissileUtils___MGroup_deallocate(s__MissileGroup_group[this]) call s__MissileGroup_deallocate(this) return true endfunction function sa__MissileGroup_missileAt takes nothing returns boolean local integer this=f__arg_this local integer i=f__arg_integer1 - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + 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 node=s__MissileUtils___MGroup_next[node] set j=j + 1 endloop -set f__result_integer= s__MissileUtils__MGroup_missile[node] +set f__result_integer= s__MissileUtils___MGroup_missile[node] return true else set f__result_integer= 0 @@ -209796,15 +205976,15 @@ endfunction function sa__MissileGroup_remove takes nothing returns boolean local integer this=f__arg_this local integer missile=f__arg_integer1 - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + 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 + if s__MissileUtils___MGroup_missile[node] == missile then set s__MissileGroup_size[this]=s__MissileGroup_size[this] - 1 - call s__MissileUtils__MGroup_remove(node) + call s__MissileUtils___MGroup_remove(node) exitwhen true endif - set node=s__MissileUtils__MGroup_next[node] + set node=s__MissileUtils___MGroup_next[node] endloop return true endfunction @@ -209812,16 +205992,16 @@ function sa__MissileGroup_insert takes nothing returns boolean local integer this=f__arg_this local integer missile=f__arg_integer1 set s__MissileGroup_size[this]=s__MissileGroup_size[this] + 1 - call s__MissileUtils__MGroup_insert(s__MissileGroup_group[this],missile) + call s__MissileUtils___MGroup_insert(s__MissileGroup_group[this],missile) return true endfunction function sa__MissileGroup_clear takes nothing returns boolean local integer this=f__arg_this - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + 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] + call s__MissileUtils___MGroup_remove(node) + set node=s__MissileUtils___MGroup_next[node] endloop set s__MissileGroup_size[this]=0 return true @@ -209829,15 +206009,15 @@ endfunction function sa__MissileGroup_contains takes nothing returns boolean local integer this=f__arg_this local integer missile=f__arg_integer1 - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[this]] + 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 + if s__MissileUtils___MGroup_missile[node] == missile then set found=true exitwhen true endif - set node=s__MissileUtils__MGroup_next[node] + set node=s__MissileUtils___MGroup_next[node] endloop set f__result_boolean= found return true @@ -209845,33 +206025,33 @@ endfunction function sa__MissileGroup_addGroup takes nothing returns boolean local integer this=f__arg_this local integer source=f__arg_integer1 - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[source]] + 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]) + 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] + set node=s__MissileUtils___MGroup_next[node] endloop return true endfunction function sa__MissileGroup_removeGroup takes nothing returns boolean local integer this=f__arg_this local integer source=f__arg_integer1 - local integer node= s__MissileUtils__MGroup_next[s__MissileGroup_group[source]] + 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]) + 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] + set node=s__MissileUtils___MGroup_next[node] endloop return true endfunction function sa__MissileGroup_create takes nothing returns boolean local integer this= s__MissileGroup__allocate() - set s__MissileGroup_group[this]=(s__MissileUtils__MGroup_init((s__MissileUtils__MGroup_allocate()))) // INLINED!! + set s__MissileGroup_group[this]=(s__MissileUtils___MGroup_init((s__MissileUtils___MGroup_allocate()))) // INLINED!! set s__MissileGroup_size[this]=0 set f__result_integer= this return true @@ -210105,9 +206285,9 @@ 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 + set UnitEventEx___rezCheck=false call DestroyTimer(GetExpiredTimer()) return true endfunction @@ -210202,19 +206382,19 @@ local integer this=f__arg_this set s__Missiles_pid=s__Missiles_pid - 1 set s__Missiles_pkey[this]=- 1 endif - if (st__Missiles__MissileEvents_onRemove[si__Missiles__MissileEvents_type[this]]!=null) then - call sc__Missiles__MissileEvents_onRemove(this) + if (st__Missiles___MissileEvents_onRemove[si__Missiles___MissileEvents_type[this]]!=null) then + call sc__Missiles___MissileEvents_onRemove(this) endif if s__Missiles_dummy[this] != null then - call s__Missiles__Pool_recycle(s__Missiles_dummy[this]) + call s__Missiles___Pool_recycle(s__Missiles_dummy[this]) endif set aux=s__Missiles_collection[s__Missiles_count] set s__Missiles_index[aux]=s__Missiles_index[this] set s__Missiles_collection[s__Missiles_index[this]]=s__Missiles_collection[s__Missiles_count] set s__Missiles_count=s__Missiles_count - 1 set s__Missiles_index[this]=- 1 - call s__Missiles__Coordinates_deallocate((s__Missiles_origin[this])) // INLINED!! - call s__Missiles__Coordinates_deallocate((s__Missiles_impact[this])) // INLINED!! + call s__Missiles___Coordinates_deallocate((s__Missiles_origin[this])) // INLINED!! + call s__Missiles___Coordinates_deallocate((s__Missiles_impact[this])) // INLINED!! call s__MissileEffect_destroy(s__Missiles_effect[this]) call sc__Missiles_reset(this) call FlushChildHashtable(s__Missiles_table, this) @@ -210281,28 +206461,28 @@ function sa__Missiles_move takes nothing returns boolean set o=s__Missiles_origin[this] set h=s__Missiles_height[this] set c=s__Missiles_open[this] - set d=s__Missiles__Coordinates_distance[o] - if (st__Missiles__MissileEvents_onHit[si__Missiles__MissileEvents_type[this]]!=null) then + set d=s__Missiles___Coordinates_distance[o] + if (st__Missiles___MissileEvents_onHit[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then - call GroupEnumUnitsInRange(s__Missiles_group, s__Missiles_x[this], s__Missiles_y[this], s__Missiles_collision[this] + Missiles__COLLISION_SIZE, null) + call GroupEnumUnitsInRange(s__Missiles_group, s__Missiles_x[this], s__Missiles_y[this], s__Missiles_collision[this] + Missiles___COLLISION_SIZE, null) loop set u=FirstOfGroup(s__Missiles_group) exitwhen u == null if not HaveSavedBoolean(s__Missiles_table, this, GetHandleId(u)) then if IsUnitInRangeXY(u, s__Missiles_x[this], s__Missiles_y[this], s__Missiles_collision[this]) then if s__Missiles_collideZ[this] then - set dx=Missiles__GetLocZ(GetUnitX(u) , GetUnitY(u)) + GetUnitFlyHeight(u) + set dx=Missiles___GetLocZ(GetUnitX(u) , GetUnitY(u)) + GetUnitFlyHeight(u) set dy=BlzGetUnitCollisionSize(u) if dx + dy >= s__Missiles_z[this] - s__Missiles_collision[this] and dx <= s__Missiles_z[this] + s__Missiles_collision[this] then call SaveBoolean(s__Missiles_table, this, GetHandleId(u), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onHit(this,u) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onHit(this,u) then call s__Missiles_terminate(this) exitwhen true endif endif else call SaveBoolean(s__Missiles_table, this, GetHandleId(u), true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onHit(this,u) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onHit(this,u) then call s__Missiles_terminate(this) exitwhen true endif @@ -210313,7 +206493,7 @@ function sa__Missiles_move takes nothing returns boolean endloop endif endif - if (st__Missiles__MissileEvents_onMissile[si__Missiles__MissileEvents_type[this]]!=null) then + if (st__Missiles___MissileEvents_onMissile[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then set k=0 loop @@ -210325,7 +206505,7 @@ function sa__Missiles_move takes nothing returns boolean set dy=s__Missiles_y[missile] - s__Missiles_y[this] if SquareRoot(dx * dx + dy * dy) <= s__Missiles_collision[this] then call SaveBoolean(s__Missiles_table, this, missile, true) - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onMissile(this,missile) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onMissile(this,missile) then call s__Missiles_terminate(this) exitwhen true endif @@ -210336,59 +206516,59 @@ function sa__Missiles_move takes nothing returns boolean endloop endif endif - if (st__Missiles__MissileEvents_onDestructable[si__Missiles__MissileEvents_type[this]]!=null) then + if (st__Missiles___MissileEvents_onDestructable[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then set dx=s__Missiles_collision[this] call SetRect(s__Missiles_rect, s__Missiles_x[this] - dx, s__Missiles_y[this] - dx, s__Missiles_x[this] + dx, s__Missiles_y[this] + dx) call EnumDestructablesInRect(s__Missiles_rect, null, function s__Missiles_onDest) endif endif - if (st__Missiles__MissileEvents_onItem[si__Missiles__MissileEvents_type[this]]!=null) then + if (st__Missiles___MissileEvents_onItem[si__Missiles___MissileEvents_type[this]]!=null) then if s__Missiles_allocated[this] and s__Missiles_collision[this] > 0 then set dx=s__Missiles_collision[this] call SetRect(s__Missiles_rect, s__Missiles_x[this] - dx, s__Missiles_y[this] - dx, s__Missiles_x[this] + dx, s__Missiles_y[this] + dx) call EnumItemsInRect(s__Missiles_rect, null, function s__Missiles_onItems) endif endif - if (st__Missiles__MissileEvents_onCliff[si__Missiles__MissileEvents_type[this]]!=null) then + if (st__Missiles___MissileEvents_onCliff[si__Missiles___MissileEvents_type[this]]!=null) then set dx=GetTerrainCliffLevel(s__Missiles_nextX[this], s__Missiles_nextY[this]) set dy=GetTerrainCliffLevel(s__Missiles_x[this], s__Missiles_y[this]) if dy < dx and s__Missiles_z[this] < ( dx - (GetTerrainCliffLevel(s__WorldBounds_maxX, s__WorldBounds_maxY)) ) * bj_CLIFFHEIGHT then // INLINED!! - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onCliff(this) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onCliff(this) then call s__Missiles_terminate(this) endif endif endif - if (st__Missiles__MissileEvents_onTerrain[si__Missiles__MissileEvents_type[this]]!=null) then - if Missiles__GetLocZ(s__Missiles_x[this] , s__Missiles_y[this]) > s__Missiles_z[this] then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onTerrain(this) then + if (st__Missiles___MissileEvents_onTerrain[si__Missiles___MissileEvents_type[this]]!=null) then + if Missiles___GetLocZ(s__Missiles_x[this] , s__Missiles_y[this]) > s__Missiles_z[this] then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onTerrain(this) then call s__Missiles_terminate(this) endif endif endif - if (st__Missiles__MissileEvents_onTileset[si__Missiles__MissileEvents_type[this]]!=null) then + if (st__Missiles___MissileEvents_onTileset[si__Missiles___MissileEvents_type[this]]!=null) then set k=GetTerrainType(s__Missiles_x[this], s__Missiles_y[this]) if k != s__Missiles_tileset[this] then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onTileset(this,k) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onTileset(this,k) then call s__Missiles_terminate(this) endif endif set s__Missiles_tileset[this]=k endif - if (st__Missiles__MissileEvents_onPeriod[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onPeriod(this) then + if (st__Missiles___MissileEvents_onPeriod[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onPeriod(this) then call s__Missiles_terminate(this) endif endif set u=s__Missiles_target[this] if u != null and GetUnitTypeId(u) != 0 then - call s__Missiles__Coordinates_move(s__Missiles_impact[this],GetUnitX(u) , GetUnitY(u) , GetUnitFlyHeight(u) + s__Missiles_toZ[this]) - set dx=s__Missiles__Coordinates_x[s__Missiles_impact[this]] - s__Missiles_nextX[this] - set dy=s__Missiles__Coordinates_y[s__Missiles_impact[this]] - s__Missiles_nextY[this] + call s__Missiles___Coordinates_move(s__Missiles_impact[this],GetUnitX(u) , GetUnitY(u) , GetUnitFlyHeight(u) + s__Missiles_toZ[this]) + set dx=s__Missiles___Coordinates_x[s__Missiles_impact[this]] - s__Missiles_nextX[this] + set dy=s__Missiles___Coordinates_y[s__Missiles_impact[this]] - s__Missiles_nextY[this] set a=Atan2(dy, dx) - set s__Missiles_travel[this]=s__Missiles__Coordinates_distance[o] - SquareRoot(dx * dx + dy * dy) + set s__Missiles_travel[this]=s__Missiles___Coordinates_distance[o] - SquareRoot(dx * dx + dy * dy) else - set a=s__Missiles__Coordinates_angle[o] + set a=s__Missiles___Coordinates_angle[o] set s__Missiles_target[this]=null endif if s__Missiles_turn[this] != 0 and not ( Cos(s__Missiles_cA[this] - a) >= Cos(s__Missiles_turn[this]) ) then @@ -210405,7 +206585,7 @@ function sa__Missiles_move takes nothing returns boolean set s=s__Missiles_travel[this] + vel set s__Missiles_veloc[this]=s__Missiles_veloc[this] + s__Missiles_acceleration[this] set s__Missiles_travel[this]=s - set pitch=s__Missiles__Coordinates_alpha[o] + set pitch=s__Missiles___Coordinates_alpha[o] set s__Missiles_prevX[this]=s__Missiles_x[this] set s__Missiles_prevY[this]=s__Missiles_y[this] set s__Missiles_prevZ[this]=s__Missiles_z[this] @@ -210414,8 +206594,8 @@ function sa__Missiles_move takes nothing returns boolean set s__Missiles_z[this]=s__Missiles_nextZ[this] set s__Missiles_nextX[this]=s__Missiles_x[this] + vel * Cos(yaw) set s__Missiles_nextY[this]=s__Missiles_y[this] + vel * Sin(yaw) - if h != 0 or s__Missiles__Coordinates_slope[o] != 0 then - set s__Missiles_nextZ[this]=4 * h * s * ( d - s ) / ( d * d ) + s__Missiles__Coordinates_slope[o] * s + s__Missiles__Coordinates_z[o] + if h != 0 or s__Missiles___Coordinates_slope[o] != 0 then + set s__Missiles_nextZ[this]=4 * h * s * ( d - s ) / ( d * d ) + s__Missiles___Coordinates_slope[o] * s + s__Missiles___Coordinates_z[o] set pitch=pitch - Atan(( ( 4 * h ) * ( 2 * s - d ) ) / ( d * d )) endif if c != 0 then @@ -210427,8 +206607,8 @@ function sa__Missiles_move takes nothing returns boolean endif if s >= d - 0.0001 then set s__Missiles_finished[this]=true - if (st__Missiles__MissileEvents_onFinish[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onFinish(this) then + if (st__Missiles___MissileEvents_onFinish[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onFinish(this) then call s__Missiles_terminate(this) else if s__Missiles_travel[this] > 0 and not s__Missiles_paused[this] then @@ -210446,8 +206626,8 @@ function sa__Missiles_move takes nothing returns boolean endif endif if not s__MissileEffect_move(s__Missiles_effect[this],s__Missiles_x[this] , s__Missiles_y[this] , s__Missiles_z[this]) then - if (st__Missiles__MissileEvents_onBoundaries[si__Missiles__MissileEvents_type[this]]!=null) then - if s__Missiles_allocated[this] and sc__Missiles__MissileEvents_onBoundaries(this) then + if (st__Missiles___MissileEvents_onBoundaries[si__Missiles___MissileEvents_type[this]]!=null) then + if s__Missiles_allocated[this] and sc__Missiles___MissileEvents_onBoundaries(this) then call s__Missiles_terminate(this) endif endif @@ -210525,24 +206705,24 @@ function sa___prototype10_Attributes___HookRemoveUnit takes nothing returns bool call FlushChildHashtable(Attributes___h, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction -function sa___prototype54_GroupUtils__HookDestroyBoolExpr takes nothing returns boolean - call GroupUtils__HookDestroyBoolExpr(f__arg_boolexpr1) +function sa___prototype54_GroupUtils___HookDestroyBoolExpr takes nothing returns boolean + 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!! return true endfunction -function sa___prototype10_IdleWorkersSystem___RemoveUnitHook takes nothing returns boolean - call IdleWorkersSystem___RemoveUnitHook(f__arg_unit1) +function sa___prototype10_IdleWorkersSystem__RemoveUnitHook takes nothing returns boolean + call IdleWorkersSystem__RemoveUnitHook(f__arg_unit1) return true endfunction function sa___prototype10_ItemOrbOfLight___RemoveUnitHook takes nothing returns boolean call ItemOrbOfLight___RemoveUnitHook(f__arg_unit1) return true endfunction -function sa___prototype80_ItemRespawnSystem___RemoveItemCleanup takes nothing returns boolean - call ItemRespawnSystem___RemoveItemCleanup(f__arg_item1) +function sa___prototype80_ItemRespawnSystem__RemoveItemCleanup takes nothing returns boolean + call ItemRespawnSystem__RemoveItemCleanup(f__arg_item1) return true endfunction function sa___prototype101_QuestSetTitleHook takes nothing returns boolean @@ -210573,24 +206753,24 @@ function sa___prototype132_TextTagUtils___SetTextTagPermanentHook takes nothing call TextTagUtils___SetTextTagPermanentHook(f__arg_texttag1,f__arg_boolean1) return true endfunction -function sa___prototype17_TimerUtils__init takes nothing returns boolean +function sa___prototype17_TimerUtils___init takes nothing returns boolean local integer i=0 local integer o=- 1 local boolean oops= false - if ( TimerUtils__didinit ) then + if ( TimerUtils___didinit ) then return true else - set TimerUtils__didinit=true + set TimerUtils___didinit=true endif - set TimerUtils__ht=InitHashtable() + set TimerUtils___ht=InitHashtable() loop - exitwhen ( i == TimerUtils__QUANTITY ) - set s__TimerUtils__tT[i]= CreateTimer() - call SaveInteger(TimerUtils__ht, 0, GetHandleId((s__TimerUtils__tT[i] )), ( TimerUtils__HELD)) // INLINED!! + exitwhen ( i == TimerUtils___QUANTITY ) + set s__TimerUtils___tT[i]= CreateTimer() + call SaveInteger(TimerUtils___ht, 0, GetHandleId((s__TimerUtils___tT[i] )), ( TimerUtils___HELD)) // INLINED!! set i=i + 1 endloop - set TimerUtils__tN=TimerUtils__QUANTITY + set TimerUtils___tN=TimerUtils___QUANTITY return true endfunction function sa___prototype91_UnitTypeUtils___HookSetPlayerTechResearched takes nothing returns boolean @@ -210639,8 +206819,8 @@ function sa___prototype167_UpdateEachStockBuildingHook takes nothing returns boo 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 @@ -210651,8 +206831,8 @@ 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 @@ -210788,8 +206968,8 @@ function sa___prototype184_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 @@ -210800,20 +206980,20 @@ function sa___prototype10_ResourcesGui___RemoveUnitHook takes nothing returns bo 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 @@ -210824,20 +207004,20 @@ function sa___prototype10_RayConfig___RemoveUnitHook takes nothing returns boole call FlushChildHashtable(RayConfig___h, GetHandleId((f__arg_unit1))) // INLINED!! return true endfunction -function sa___prototype184_TailSwipe___onUnitHit takes nothing returns boolean - call TailSwipe___onUnitHit(f__arg_integer1,f__arg_unit1) +function sa___prototype184_TailSwipe__onUnitHit takes nothing returns boolean + call TailSwipe__onUnitHit(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype185_TailSwipe___onDestructableHit takes nothing returns boolean - call TailSwipe___onDestructableHit(f__arg_integer1,f__arg_destructable1) +function sa___prototype185_TailSwipe__onDestructableHit takes nothing returns boolean + call TailSwipe__onDestructableHit(f__arg_integer1,f__arg_destructable1) return true endfunction -function sa___prototype186_TailSwipe___filterFunction takes nothing returns boolean - set f__result_boolean=TailSwipe___filterFunction(f__arg_integer1,f__arg_unit1) +function sa___prototype186_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 @@ -210888,16 +207068,16 @@ function sa___prototype186_SpellsMeteorKnockbackType___filterFunction takes noth set f__result_boolean=SpellsMeteorKnockbackType___filterFunction(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype184_SpellsSlideKnockbackType__onUnitHit takes nothing returns boolean - call SpellsSlideKnockbackType__onUnitHit(f__arg_integer1,f__arg_unit1) +function sa___prototype184_SpellsSlideKnockbackType___onUnitHit takes nothing returns boolean + call SpellsSlideKnockbackType___onUnitHit(f__arg_integer1,f__arg_unit1) return true endfunction -function sa___prototype185_SpellsSlideKnockbackType__onDestructableHit takes nothing returns boolean - call SpellsSlideKnockbackType__onDestructableHit(f__arg_integer1,f__arg_destructable1) +function sa___prototype185_SpellsSlideKnockbackType___onDestructableHit takes nothing returns boolean + call SpellsSlideKnockbackType___onDestructableHit(f__arg_integer1,f__arg_destructable1) return true endfunction -function sa___prototype186_SpellsSlideKnockbackType__filterFunction takes nothing returns boolean - set f__result_boolean=SpellsSlideKnockbackType__filterFunction(f__arg_integer1,f__arg_unit1) +function sa___prototype186_SpellsSlideKnockbackType___filterFunction takes nothing returns boolean + set f__result_boolean=SpellsSlideKnockbackType___filterFunction(f__arg_integer1,f__arg_unit1) return true endfunction function sa___prototype91_WoWReforgedEvolution__HookSetPlayerTechResearched takes nothing returns boolean @@ -211058,8 +207238,8 @@ function sa___prototype481_WoWReforgedPortals__HookWaygateSetDestinationLocBJ ta 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 sa___prototype38_s__MapChanger_changeMap takes nothing returns boolean @@ -211087,7 +207267,7 @@ function sa___prototype50_s__MapChanger_storeHeroesSinglePlayerNewOpLimit takes return true endfunction -function jasshelper__initstructs109402859 takes nothing returns nothing +function jasshelper__initstructs109830953 takes nothing returns nothing set st__AbstractZone_onDestroy[177]=null set st__MapChanger_storeHeroesSinglePlayerNewOpLimit=CreateTrigger() call TriggerAddCondition(st__MapChanger_storeHeroesSinglePlayerNewOpLimit,Condition( function sa__MapChanger_storeHeroesSinglePlayerNewOpLimit)) @@ -211223,8 +207403,8 @@ function jasshelper__initstructs109402859 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[117]=null set st__SpellVamp_onDestroy[143]=null set st__SpellPower_onDestroy[116]=null @@ -211232,19 +207412,19 @@ function jasshelper__initstructs109402859 takes nothing returns nothing set st__Queue_onDestroy=CreateTrigger() call TriggerAddCondition(st__Queue_onDestroy,Condition( function sa__Queue_onDestroy)) set st__PagedButtons_Type_onDestroy[108]=null - set st__Missiles__MissileEvents_onHit[107]=null - set st__Missiles__MissileEvents_onMissile[107]=null - set st__Missiles__MissileEvents_onDestructable[107]=null - set st__Missiles__MissileEvents_onItem[107]=null - set st__Missiles__MissileEvents_onCliff[107]=null - set st__Missiles__MissileEvents_onTerrain[107]=null - set st__Missiles__MissileEvents_onTileset[107]=null - set st__Missiles__MissileEvents_onPeriod[107]=null - set st__Missiles__MissileEvents_onFinish[107]=null - set st__Missiles__MissileEvents_onBoundaries[107]=null - set st__Missiles__MissileEvents_onPause[107]=null - set st__Missiles__MissileEvents_onResume[107]=null - set st__Missiles__MissileEvents_onRemove[107]=null + set st__Missiles___MissileEvents_onHit[107]=null + set st__Missiles___MissileEvents_onMissile[107]=null + set st__Missiles___MissileEvents_onDestructable[107]=null + set st__Missiles___MissileEvents_onItem[107]=null + set st__Missiles___MissileEvents_onCliff[107]=null + set st__Missiles___MissileEvents_onTerrain[107]=null + set st__Missiles___MissileEvents_onTileset[107]=null + set st__Missiles___MissileEvents_onPeriod[107]=null + set st__Missiles___MissileEvents_onFinish[107]=null + set st__Missiles___MissileEvents_onBoundaries[107]=null + set st__Missiles___MissileEvents_onPause[107]=null + set st__Missiles___MissileEvents_onResume[107]=null + set st__Missiles___MissileEvents_onRemove[107]=null set st__LifeSteal_onDestroy[103]=null set st__LifeSteal_onDestroy[142]=null set st__Evasion_onDestroy[102]=null @@ -211279,7 +207459,7 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddCondition(st__Missiles_reset,Condition( function sa__Missiles_reset)) set st__Missiles_move=CreateTrigger() call TriggerAddCondition(st__Missiles_move,Condition( function sa__Missiles_move)) - set st__Missiles__MissileEvents_onDestroy[107]=null + set st__Missiles___MissileEvents_onDestroy[107]=null set st__PagedButtons_Type_onDestroy[109]=CreateTrigger() call TriggerAddCondition(st__PagedButtons_Type_onDestroy[109],Condition( function sa__PagedButtons_SpacerType_onDestroy)) set st__PagedButtons_Type_onDestroy[110]=CreateTrigger() @@ -211300,20 +207480,20 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddAction(st___prototype10[1],function sa___prototype10_Attributes___HookRemoveUnit) call TriggerAddCondition(st___prototype10[1],Condition(function sa___prototype10_Attributes___HookRemoveUnit)) set st___prototype54[1]=CreateTrigger() - call TriggerAddAction(st___prototype54[1],function sa___prototype54_GroupUtils__HookDestroyBoolExpr) - call TriggerAddCondition(st___prototype54[1],Condition(function sa___prototype54_GroupUtils__HookDestroyBoolExpr)) + call TriggerAddAction(st___prototype54[1],function sa___prototype54_GroupUtils___HookDestroyBoolExpr) + call TriggerAddCondition(st___prototype54[1],Condition(function sa___prototype54_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)) 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)) + call TriggerAddAction(st___prototype10[3],function sa___prototype10_IdleWorkersSystem__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[3],Condition(function sa___prototype10_IdleWorkersSystem__RemoveUnitHook)) set st___prototype10[4]=CreateTrigger() call TriggerAddAction(st___prototype10[4],function sa___prototype10_ItemOrbOfLight___RemoveUnitHook) call TriggerAddCondition(st___prototype10[4],Condition(function sa___prototype10_ItemOrbOfLight___RemoveUnitHook)) set st___prototype80[1]=CreateTrigger() - call TriggerAddAction(st___prototype80[1],function sa___prototype80_ItemRespawnSystem___RemoveItemCleanup) - call TriggerAddCondition(st___prototype80[1],Condition(function sa___prototype80_ItemRespawnSystem___RemoveItemCleanup)) + call TriggerAddAction(st___prototype80[1],function sa___prototype80_ItemRespawnSystem__RemoveItemCleanup) + call TriggerAddCondition(st___prototype80[1],Condition(function sa___prototype80_ItemRespawnSystem__RemoveItemCleanup)) set st___prototype101[1]=CreateTrigger() call TriggerAddAction(st___prototype101[1],function sa___prototype101_QuestSetTitleHook) call TriggerAddCondition(st___prototype101[1],Condition(function sa___prototype101_QuestSetTitleHook)) @@ -211336,8 +207516,8 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddAction(st___prototype132[1],function sa___prototype132_TextTagUtils___SetTextTagPermanentHook) call TriggerAddCondition(st___prototype132[1],Condition(function sa___prototype132_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)) + call TriggerAddAction(st___prototype17[1],function sa___prototype17_TimerUtils___init) + call TriggerAddCondition(st___prototype17[1],Condition(function sa___prototype17_TimerUtils___init)) set st___prototype91[1]=CreateTrigger() call TriggerAddAction(st___prototype91[1],function sa___prototype91_UnitTypeUtils___HookSetPlayerTechResearched) call TriggerAddCondition(st___prototype91[1],Condition(function sa___prototype91_UnitTypeUtils___HookSetPlayerTechResearched)) @@ -211357,8 +207537,8 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddAction(st___prototype167[1],function sa___prototype167_UpdateEachStockBuildingHook) call TriggerAddCondition(st___prototype167[1],Condition(function sa___prototype167_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)) @@ -211366,8 +207546,8 @@ function jasshelper__initstructs109402859 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)) @@ -211426,8 +207606,8 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddAction(st___prototype184[1],function sa___prototype184_onUnitHit) call TriggerAddCondition(st___prototype184[1],Condition(function sa___prototype184_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)) @@ -211435,17 +207615,17 @@ function jasshelper__initstructs109402859 takes nothing returns nothing 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)) @@ -211453,17 +207633,17 @@ function jasshelper__initstructs109402859 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___prototype184[2]=CreateTrigger() - call TriggerAddAction(st___prototype184[2],function sa___prototype184_TailSwipe___onUnitHit) - call TriggerAddCondition(st___prototype184[2],Condition(function sa___prototype184_TailSwipe___onUnitHit)) + call TriggerAddAction(st___prototype184[2],function sa___prototype184_TailSwipe__onUnitHit) + call TriggerAddCondition(st___prototype184[2],Condition(function sa___prototype184_TailSwipe__onUnitHit)) set st___prototype185[2]=CreateTrigger() - call TriggerAddAction(st___prototype185[2],function sa___prototype185_TailSwipe___onDestructableHit) - call TriggerAddCondition(st___prototype185[2],Condition(function sa___prototype185_TailSwipe___onDestructableHit)) + call TriggerAddAction(st___prototype185[2],function sa___prototype185_TailSwipe__onDestructableHit) + call TriggerAddCondition(st___prototype185[2],Condition(function sa___prototype185_TailSwipe__onDestructableHit)) set st___prototype186[2]=CreateTrigger() - call TriggerAddAction(st___prototype186[2],function sa___prototype186_TailSwipe___filterFunction) - call TriggerAddCondition(st___prototype186[2],Condition(function sa___prototype186_TailSwipe___filterFunction)) + call TriggerAddAction(st___prototype186[2],function sa___prototype186_TailSwipe__filterFunction) + call TriggerAddCondition(st___prototype186[2],Condition(function sa___prototype186_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)) @@ -211501,14 +207681,14 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddAction(st___prototype186[3],function sa___prototype186_SpellsMeteorKnockbackType___filterFunction) call TriggerAddCondition(st___prototype186[3],Condition(function sa___prototype186_SpellsMeteorKnockbackType___filterFunction)) set st___prototype184[4]=CreateTrigger() - call TriggerAddAction(st___prototype184[4],function sa___prototype184_SpellsSlideKnockbackType__onUnitHit) - call TriggerAddCondition(st___prototype184[4],Condition(function sa___prototype184_SpellsSlideKnockbackType__onUnitHit)) + call TriggerAddAction(st___prototype184[4],function sa___prototype184_SpellsSlideKnockbackType___onUnitHit) + call TriggerAddCondition(st___prototype184[4],Condition(function sa___prototype184_SpellsSlideKnockbackType___onUnitHit)) set st___prototype185[4]=CreateTrigger() - call TriggerAddAction(st___prototype185[4],function sa___prototype185_SpellsSlideKnockbackType__onDestructableHit) - call TriggerAddCondition(st___prototype185[4],Condition(function sa___prototype185_SpellsSlideKnockbackType__onDestructableHit)) + call TriggerAddAction(st___prototype185[4],function sa___prototype185_SpellsSlideKnockbackType___onDestructableHit) + call TriggerAddCondition(st___prototype185[4],Condition(function sa___prototype185_SpellsSlideKnockbackType___onDestructableHit)) set st___prototype186[4]=CreateTrigger() - call TriggerAddAction(st___prototype186[4],function sa___prototype186_SpellsSlideKnockbackType__filterFunction) - call TriggerAddCondition(st___prototype186[4],Condition(function sa___prototype186_SpellsSlideKnockbackType__filterFunction)) + call TriggerAddAction(st___prototype186[4],function sa___prototype186_SpellsSlideKnockbackType___filterFunction) + call TriggerAddCondition(st___prototype186[4],Condition(function sa___prototype186_SpellsSlideKnockbackType___filterFunction)) set st___prototype91[4]=CreateTrigger() call TriggerAddAction(st___prototype91[4],function sa___prototype91_WoWReforgedEvolution__HookSetPlayerTechResearched) call TriggerAddCondition(st___prototype91[4],Condition(function sa___prototype91_WoWReforgedEvolution__HookSetPlayerTechResearched)) @@ -211573,8 +207753,8 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddAction(st___prototype481[1],function sa___prototype481_WoWReforgedPortals__HookWaygateSetDestinationLocBJ) call TriggerAddCondition(st___prototype481[1],Condition(function sa___prototype481_WoWReforgedPortals__HookWaygateSetDestinationLocBJ)) set st___prototype10[30]=CreateTrigger() - call TriggerAddAction(st___prototype10[30],function sa___prototype10_WoWReforgedEquipment___RemoveUnitHook) - call TriggerAddCondition(st___prototype10[30],Condition(function sa___prototype10_WoWReforgedEquipment___RemoveUnitHook)) + call TriggerAddAction(st___prototype10[30],function sa___prototype10_WoWReforgedEquipment__RemoveUnitHook) + call TriggerAddCondition(st___prototype10[30],Condition(function sa___prototype10_WoWReforgedEquipment__RemoveUnitHook)) set st___prototype38[1]=CreateTrigger() call TriggerAddAction(st___prototype38[1],function sa___prototype38_s__MapChanger_changeMap) call TriggerAddCondition(st___prototype38[1],Condition(function sa___prototype38_s__MapChanger_changeMap)) @@ -211583,26 +207763,26 @@ function jasshelper__initstructs109402859 takes nothing returns nothing call TriggerAddCondition(st___prototype50[1],Condition(function sa___prototype50_s__MapChanger_storeHeroesSinglePlayerNewOpLimit)) -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") @@ -211655,13 +207835,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") @@ -211671,15 +207851,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") @@ -211689,11 +207869,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") @@ -211715,7 +207895,7 @@ call ExecuteFunc("s__UnitGroupRespawnSystemConfig___S_UnitGroupRespawnSystemConf -call ExecuteFunc("s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onInit") +call ExecuteFunc("s__UnitEventEx___UnitEventEx_UnitEventEx___UnitEventExCore__onInit") @@ -211801,7 +207981,7 @@ call ExecuteFunc("s__UnitEventEx__UnitEventEx_UnitEventEx__UnitEventExCore___onI call ExecuteFunc("s__Tenacity_onInit") call ExecuteFunc("s__Evasion_onInit") call ExecuteFunc("s__LifeSteal_onInit") - call ExecuteFunc("s__Missiles__Pool_onInit") + call ExecuteFunc("s__Missiles___Pool_onInit") call ExecuteFunc("s__SpellPower_onInit") call ExecuteFunc("s__SpellVamp_onInit") call ExecuteFunc("s__DummyPool_onInit") diff --git a/wowr.w3x/war3map.w3i b/wowr.w3x/war3map.w3i index abb89d7f..d327ae98 100644 Binary files a/wowr.w3x/war3map.w3i and b/wowr.w3x/war3map.w3i differ diff --git a/wowr.w3x/war3map.wpm b/wowr.w3x/war3map.wpm index 223dc049..0ebc7ed8 100644 Binary files a/wowr.w3x/war3map.wpm and b/wowr.w3x/war3map.wpm differ diff --git a/wowr.w3x/war3map.wtg b/wowr.w3x/war3map.wtg index 6581a835..eb7076ab 100644 Binary files a/wowr.w3x/war3map.wtg and b/wowr.w3x/war3map.wtg differ