package UnitProducer import BaseObject import EscaperKillers import initlater InstantBuild import Preloader import ObjectTarget import TerrainChanger import Pointer import Knockbacker import Faceless public constant UNIT_PRODUCER_ID = compiletime(HERO_ID_GEN.next()) constant FIRST_PAGE = 'A07B' constant SECOND_PAGE = 'A07A' constant AIR_KILLER = 'A07Y' constant BIG_KILLER = 'A05F' constant SMALL_KILLER = 'A05K' constant BR_KILLER = 'A05G' constant SR_KILLER = 'A05J' constant TANK_KILLER = 'A05M' constant OBJ_TARGET = 'A05N' constant GLAIVE_KILLER = 'A05H' constant T_CHANGER = 'A05L' constant POINTER = 'A05I' constant BOMBER = 'A05O' constant KNOCKBACK = 'A07C' constant FACELESS = 'A07U' constant FIRE = 'Afre' public class UnitProducer extends StaticBaseObject construct(vec2 pos, player owner) super(pos, createUnit(owner, UNIT_PRODUCER_ID, pos, angle(0)), 0., null, null) actor..removeAbility(REMOVE_OBJECT_ID)..addAbility(AIR_KILLER) EventListener.add(actor, EVENT_PLAYER_UNIT_SPELL_CAST, () -> onCast()) clearQuestionmark() function onCast() returns boolean let id = GetSpellAbilityId() let obj = GetSpellAbilityUnit().getEntity() castTo UnitProducer let rallyPos = obj.getRallyPoint().toVec2() let data = getRegionData(rallyPos) if id == SECOND_PAGE obj.actor..removeAbility(BIG_KILLER)..removeAbility(SMALL_KILLER) ..removeAbility(SR_KILLER)..removeAbility(BR_KILLER) ..removeAbility(TANK_KILLER) ..removeAbility(GLAIVE_KILLER)..removeAbility(SECOND_PAGE) ..removeAbility(KNOCKBACK) ..removeAbility(FACELESS)..removeAbility(AIR_KILLER)..removeAbility(FIRE) ..addAbility(OBJ_TARGET) ..addAbility(T_CHANGER)..addAbility(POINTER) ..addAbility(FIRST_PAGE)..addAbility(BOMBER) return false else if id == FIRST_PAGE obj.actor..addAbility(BIG_KILLER)..addAbility(SMALL_KILLER) ..addAbility(SR_KILLER)..addAbility(BR_KILLER) ..addAbility(TANK_KILLER)..addAbility(FIRE) ..addAbility(GLAIVE_KILLER)..addAbility(SECOND_PAGE) ..addAbility(KNOCKBACK) ..addAbility(FACELESS)..addAbility(AIR_KILLER) ..removeAbility(OBJ_TARGET) ..removeAbility(T_CHANGER)..removeAbility(POINTER) ..removeAbility(FIRST_PAGE)..removeAbility(BOMBER) return false if data == null return false if data.canBuild(obj.owner) and data.getTypeSet().bigKillerId > 0 var index = -1 switch id case BIG_KILLER // Big Killer index = BIGKILL_INDEX case SMALL_KILLER // Small Killer index = SMALLKILL_INDEX case BR_KILLER // Big Random Killer new BigRandomKiller(rallyPos,obj.owner) case SR_KILLER // Small Random Killer new SmallRandomKiller(rallyPos,obj.owner) case TANK_KILLER // Tank new TankKiller(rallyPos,obj.owner) case OBJ_TARGET new ObjectTarget(vec2(rallyPos.x,rallyPos.y), obj.owner) case GLAIVE_KILLER new GlaiveKiller(rallyPos,obj.owner) case T_CHANGER new TerrainChanger(vec2(rallyPos.x,rallyPos.y), obj.owner) case POINTER new Pointer(vec2(rallyPos.x,rallyPos.y), obj.owner, angle(0)) case BOMBER index = BOMBER_INDEX case KNOCKBACK new Knockbacker(vec2(rallyPos.x,rallyPos.y), obj.owner, angle(0)) case FACELESS new Faceless(vec2(rallyPos.x,rallyPos.y), obj.owner, angle(0)) case AIR_KILLER new AirKiller(vec2(rallyPos.x,rallyPos.y), obj.owner, angle(0)) case FIRE new FireKiller(vec2(rallyPos.x,rallyPos.y), obj.owner, angle(0)) if index > 0 newObjectFromId(obj.owner, rallyPos, index) else DisplayTextToPlayer(obj.owner, 0, 0, "|cffC51019You have no permission to build in this region!") return false init preloadAbility(FIRST_PAGE) preloadAbility(SECOND_PAGE) preloadAbility(AIR_KILLER) preloadAbility(BIG_KILLER) preloadAbility(SMALL_KILLER) preloadAbility(BR_KILLER) preloadAbility(SR_KILLER) preloadAbility(TANK_KILLER) preloadAbility(OBJ_TARGET) preloadAbility(GLAIVE_KILLER) preloadAbility(T_CHANGER) preloadAbility(POINTER) preloadAbility(BOMBER) preloadAbility(KNOCKBACK) preloadAbility(FACELESS) @objectgen function genUnitProducer() new HeroDefinition(UNIT_PRODUCER_ID, 'Hamg') ..setName("|cffFF8000Unit Producer") ..setHotkey("A") ..setTooltipExtended("You shouldn't see this...") ..setIconGameInterface("ReplaceableTextures\\CommandButtons\\BTNEditor-MultipleUnits.blp") ..setNormalAbilities(commaList('A07U', 'A07C', 'A05F', 'A05G', 'A05H', 'A05J', 'A05K', 'A05M', 'A07A', 'Afre', GHOST_INVIS_ID, RALLY_POINT, INVULNERABILITY_ID)) ..setProperNames("|cFFFF8000Unit Producer|r") ..setProperNamesUsed(0) ..setHeroAbilities("") ..setAttacksEnabled(0) ..setAnimationBlendTimeseconds(0) ..setAnimationCastBackswing(0) ..setAnimationRunSpeed(0) ..setAnimationWalkSpeed(0) ..setAnimationCastPoint(0) ..setScalingValue(0.1) ..setShadowImageUnit("") ..setSelectionScale(-0.03) ..setSpeedBase(0) ..setTurnRate(0) ..setMovementType(MovementType.None) ..setModelFile("war3mapImported\\dummy.mdl") ..setUnitSoundSet("") ..setCollisionSize(0) ..setHitPointsMaximumBase(10000000) ..setSightRadiusDay(0) ..setSightRadiusNight(0) ..setStartingAgility(0) ..setStartingIntelligence(0) ..setStartingStrength(0) ..setPriority(0) ..setHideMinimapDisplay(true) ..setRace(Race.Commoner)