package Circles
import AbilityData
public constant BACKPACK = compiletime(UNIT_ID_GEN.next())
public unit array backpack
let SELECT_BACKPACK = compiletime(ABIL_ID_GEN.next())
let TOWER_RANGE = compiletime(ABIL_ID_GEN.next())
public constant ZOOM_IN = compiletime(ABIL_ID_GEN.next())
public constant ZOOM_OUT = compiletime(ABIL_ID_GEN.next())
let PICK_ITEMS = compiletime(ABIL_ID_GEN.next())
let DROP_ITEMS = compiletime(ABIL_ID_GEN.next())
init
for i = 1 to 10
backpack[i] = createUnit(players[bj_PLAYER_NEUTRAL_VICTIM], BACKPACK)
registerSpellEffectEvent(SELECT_BACKPACK, () -> begin
let owner = GetSpellAbilityUnit().getOwner()
let i = owner.getNumber()
backpack[i].setOwner(owner, false)
owner.selectSingle(backpack[i])
doAfter(0.4) ->
print(backpack[i].getAbilityLevel(PICK_ITEMS))
print(backpack[i].getOwner().getName())
print(backpack[i].isPaused())
print(backpack[i].issueImmediateOrderById(Orders.stunned))
end)
registerPlayerUnitEvent(EVENT_PLAYER_UNIT_DESELECTED, () -> begin
if GetTriggerUnit().getTypeId() == BACKPACK
GetTriggerUnit().setOwner(players[bj_PLAYER_NEUTRAL_VICTIM], false)
end)
@compiletime function gen()
new UnitDefinition(BACKPACK, 'ncop')
..setHideMinimapDisplay(true)
..setSightRadiusDay(1)
..setSightRadiusNight(1)
..setSelectionScale(-1.)
..setModelFile("dummy.mdl")
..setNormalAbilities(commaList(PICK_ITEMS, DROP_ITEMS, ZOOM_IN, ZOOM_OUT, TOWER_RANGE, COURIER_INV, AbilityIds.invulnerable, AbilityIds.permanentInvisibility))
..setName("Backpack")
new ChannelAbilityPreset(ASK_HELP, 1, true)
..setHeroAbility(false)
..presetTargetTypes(Targettype.POINT)
..presetOption(Option.TARGETIMAGE, true)
..setBaseOrderID(1, "roar")
..setAreaofEffect(1, 300.)
..setCastRange(1, 99999.)
..setCooldown(1, 120.)
..setIconNormal(Icons.bTNHornOfCenarius)
..setButtonPositionNormalX(0)
..setButtonPositionNormalY(0)
..setHotkeyNormal("Q")
..setTooltipNormal(1, "[|cffffcc00Q|r] Ask help")
..setTooltipNormalExtended(1, "Orders a group of ally units up to 4, to go to help at you, if your hero dies, they will return to their previous objective.")
..setName("Ask help")
new ChannelAbilityPreset(SELECT_BACKPACK, 1, true)
..setHeroAbility(false)
..setIconNormal(Icons.bTNDustOfAppearance)
..setButtonPositionNormalX(0)
..setButtonPositionNormalY(1)
..setHotkeyNormal("A")
..setTooltipNormal(1, "[|cffffcc00A|r] Select backpack")
..setTooltipNormalExtended(1, "")
..setName("Select backpack")
new ChannelAbilityPreset(ZOOM_IN, 1, true)
..setHeroAbility(false)
..setArtCaster("")
..setIconNormal(Imports.bTNCrZoomIn)
..setButtonPositionNormalX(1)
..setButtonPositionNormalY(1)
..setHotkeyNormal("S")
..setTooltipNormal(1, "[|cffffcc00S|r] Zoom In")
..setTooltipNormalExtended(1, "Zoom in on the camera view.")
..setName("Zoom In")
new ChannelAbilityPreset(ZOOM_OUT, 1, true)
..setHeroAbility(false)
..setArtCaster("")
..setIconTurnOff(Imports.bTNCrZoomOut)
..setIconNormal(Imports.bTNCrZoomOut)
..setButtonPositionNormalX(2)
..setButtonPositionNormalY(1)
..setHotkeyNormal("D")
..setTooltipNormal(1, "[|cffffcc00D|r] Zoom Out")
..setTooltipNormalExtended(1, "Zoom out the camera view.")
..setName("Zoom Out")
let NO_IMMO = BUFF_ID_GEN.next()
new AbilityDefinitionImmolationcreep(TOWER_RANGE)
..setDamageperInterval(1, 0)
..setManaDrainedperSecond(1, 0)
..setBufferManaRequired(1, 0)
..setBuffs(1, NO_IMMO.toRawCode())
..setManaCost(1, 0)
..setAreaofEffect(1, 0)
..setIconTurnOff(Imports.bTNRadar2)
..setIconNormal(Imports.bTNRadar1)
..setButtonPositionNormalX(3)
..setButtonPositionNormalY(0)
..setButtonPositionTurnOffX(3)
..setButtonPositionTurnOffY(0)
..setHotkeyTurnOff("R")
..setHotkeyNormal("R")
..setTooltipTurnOff(1, "[|cffffcc00R|r] Hide range of towers")
..setTooltipTurnOffExtended(1, "")
..setTooltipNormal(1, "[|cffffcc00R|r] Show range of towers")
..setTooltipNormalExtended(1, "")
..setName("Tower Range")
new BuffDefinition(NO_IMMO, 'BEim')
..setArtSpecial(1, "")
..setArtTarget(1, "")
..setName("No immo")
new ChannelAbilityPreset(PICK_ITEMS, 1, true)
..setHeroAbility(false)
..setIconNormal(Icons.bTNLoad)
..setButtonPositionNormalX(0)
..setButtonPositionNormalY(2)
..setHotkeyNormal("Z")
..setTooltipTurnOff(1, "[|cffffcc00Z|r] Pick items")
..setTooltipTurnOffExtended(1, "Picks up your nearby items.")
..setTooltipNormal(1, "[|cffffcc00Z|r] Pick items")
..setTooltipNormalExtended(1, "Picks up your nearby items.")
..setName("Pick items")
new ChannelAbilityPreset(DROP_ITEMS, 1, true)
..setHeroAbility(false)
..setIconNormal(Icons.bTNUnLoad)
..setButtonPositionNormalX(1)
..setButtonPositionNormalY(2)
..setHotkeyNormal("X")
..setTooltipTurnOff(1, "[|cffffcc00X|r] Drop items")
..setTooltipTurnOffExtended(1, "Drop the items in the inventory.")
..setTooltipNormal(1, "[|cffffcc00X|r] Drop items")
..setTooltipNormalExtended(1, "Drop the items in the inventory.")
..setName("Drop items")