package Trap import BaseObject import Escaper import InstantDummyCaster import Camerashakes import Jumper constant DECREASE_DURATION_ID = compiletime(ABIL_ID_GEN.next()) constant INCREASE_DURATION_ID = compiletime(ABIL_ID_GEN.next()) constant DECREASE_INTERVAL_ID = compiletime(ABIL_ID_GEN.next()) constant INCREASE_INTERVAL_ID = compiletime(ABIL_ID_GEN.next()) constant DECREASE_VALUE_ID = compiletime(ABIL_ID_GEN.next()) constant INCREASE_VALUE_ID = compiletime(ABIL_ID_GEN.next()) constant POISON_ID = compiletime(ABIL_ID_GEN.next()) constant SHAKE_ID = compiletime(ABIL_ID_GEN.next()) constant SPEED_ID = compiletime(ABIL_ID_GEN.next()) constant INSTANT_KILL_ID = compiletime(ABIL_ID_GEN.next()) constant STUN_ID = compiletime(ABIL_ID_GEN.next()) constant KNOCKBACK_ID = compiletime(ABIL_ID_GEN.next()) constant KNOCKBACK_PULL_ID = compiletime(ABIL_ID_GEN.next()) constant KNOCKBACK_PUSH_ID = compiletime(ABIL_ID_GEN.next()) constant NEXT_EFFECT_ID = compiletime(ABIL_ID_GEN.next()) constant PREVIOUS_EFFECT_ID = compiletime(ABIL_ID_GEN.next()) constant START_ID = compiletime(ABIL_ID_GEN.next()) constant STOP_ID = compiletime(ABIL_ID_GEN.next()) constant POISON_EFFECT = "Abilities\\Weapons\\PoisonSting\\PoisonStingTarget.mdl" constant EVENT_RADIUS = 65. constant SPECIAL_ID = 'A07V' constant STUN_BUFF = 'A06J' constant SPEED_BUFF_NEG = 'A03J' constant SPEED_BUFF_POS = 'A03I' constant SFX_COUNT = 9 let SFX_STRINGS = ["Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl", "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl", "Abilities\\Spells\\Undead\\Impale\\ImpaleMissTarget.mdl", "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl", "Abilities\\Spells\\Human\\ManaFlare\\ManaFlareBoltImpact.mdl", "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl", "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl", "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl", "Objects\\Spawnmodels\\NightElf\\NEDeathSmall\\NEDeathSmall.mdl", "" ] enum ABIL KILL STUN POISON SPEED KNOCK SHAKE public class Trap extends StaticBaseObject int sfxid = 3 real interval = 2. real timerreal = 0. ABIL a real duration //Shake, Speed, Stun real value // Shake, Knockback, Speed boolean pull = false int uptimes = 0 int goocounter = 0 private Goo array[5] goos construct(vec2 pos, player owner) super(pos, createUnit(owner, TRAP_ID, pos, angle(0)) , EVENT_RADIUS, function onStep, null) deactivate() EventListener.add(actor, EVENT_PLAYER_UNIT_SPELL_CAST, () -> onCast()) static function onStep() let source = GetTriggeringTrigger().getSource() let u = GetTriggerUnit() let e = u.getEntity() let obj = source.getEntity() castTo Trap if not obj.active and e instanceof Escaper DestroyEffect(AddSpecialEffect(SFX_STRINGS[obj.sfxid],obj.actor.getX(),obj.actor.getY())) let escaper = e castTo Escaper obj.doEffect(escaper) ondestroy for i = 0 to 4 if goos[i] != null destroy goos[i] goos[i] = null override function update() if timerreal <= 0.0 flashEffect(SFX_STRINGS[sfxid], actor.getPos()) forUnitsInRange(pos.toVec2(), EVENT_RADIUS) u -> let e = u.getEntity() if e instanceof Escaper let escaper = e castTo Escaper doEffect(escaper) timerreal = interval else timerreal -= ANIMATION_PERIOD function doEffect(Escaper e) switch a case ABIL.KILL e.kill(this) case ABIL.STUN InstantDummyCaster.castTarget(DUMMY_PLAYER, STUN_BUFF, duration.toInt(), "thunderbolt", e.actor) case ABIL.SHAKE newEventPlayer(e.owner,value) //setCameraNoiseTimed(e.owner, value, 1000, duration) case ABIL.POISON e.setPoison(true) case ABIL.SPEED let level = (value/20).toInt() mod 10 printLog(Loglevel.TRACE, "Level: " + level.toString()) if level > 5 InstantDummyCaster.castTarget(DUMMY_PLAYER, SPEED_BUFF_POS, level-5, "bloodlust", e.actor) else if level < 5 InstantDummyCaster.castTarget(DUMMY_PLAYER, SPEED_BUFF_NEG, level, "bloodlust", e.actor) case ABIL.KNOCK IssueImmediateOrder(e.actor, "stop") let rallyPos = getRallyPoint() angle angl if rallyPos.distanceTo2dSq(pos.toVec2()) < 20*20 if pull angl = pos.angleTo2d(e.pos) - (180).asAngleDegrees() else angl = pos.angleTo2d(e.pos) else angl = pos.angleTo2d(rallyPos) e.addVel(angl.toVec(value).toVec3()) default function addConfiger(boolean dur, boolean val) UnitRemoveAbility(actor,INSTANT_KILL_ID) UnitRemoveAbility(actor,STUN_ID) UnitRemoveAbility(actor,SHAKE_ID) UnitRemoveAbility(actor,SPEED_ID) UnitRemoveAbility(actor,KNOCKBACK_ID) UnitRemoveAbility(actor,POISON_ID) UnitAddAbility(actor,INCREASE_INTERVAL_ID) UnitAddAbility(actor,DECREASE_INTERVAL_ID) UnitAddAbility(actor,START_ID) UnitAddAbility(actor,NEXT_EFFECT_ID) UnitAddAbility(actor,PREVIOUS_EFFECT_ID) if dur UnitAddAbility(actor,INCREASE_DURATION_ID) UnitAddAbility(actor,DECREASE_DURATION_ID) if val UnitAddAbility(actor,INCREASE_VALUE_ID) UnitAddAbility(actor,DECREASE_VALUE_ID) if noRally != null noRally.destr() noRally = null function onCast() returns boolean let spell_id = GetSpellAbilityId() let tpos = EventData.getSpellTargetPos() switch spell_id case NEXT_EFFECT_ID if sfxid >= SFX_COUNT sfxid = 0 else sfxid ++ if sfxid < SFX_COUNT DestroyEffect(AddSpecialEffect(SFX_STRINGS[sfxid],actor.getX(),actor.getY())) else createFText(pos, vec2(0,0.05), "|cffC51019No Effect", 14, 2., colorA(255,255,255,0), owner) case PREVIOUS_EFFECT_ID if sfxid <= 0 sfxid = SFX_COUNT else sfxid -- if sfxid < SFX_COUNT DestroyEffect(AddSpecialEffect(SFX_STRINGS[sfxid],actor.getX(),actor.getY())) else createFText(pos, vec2(0,0.05), "|cffC51019No Effect", 14, 2., colorA(255,255,255,0), owner) case INSTANT_KILL_ID a = ABIL.KILL addConfiger(false, false) case STUN_ID a = ABIL.STUN duration = 1. addConfiger(true, false) case SPEED_ID a = ABIL.SPEED value = 120. duration = 1. addConfiger(false, true) case SHAKE_ID a = ABIL.SHAKE value = 500 duration = 3. addConfiger(true, true) case KNOCKBACK_ID a = ABIL.KNOCK value = 10. actor.addAbility('ARal') actor.addAbility(KNOCKBACK_PULL_ID) addConfiger(false, true) case POISON_ID a = ABIL.POISON addConfiger(false, false) case INCREASE_INTERVAL_ID if interval >= 10 createFText(pos, vec2(0,0.05), "|cffC51019Max", 10, 2., colorA(255,255,255,0), owner) else interval += 0.25 createFText(pos, vec2(0,0.05), "|cffC51019Intervall "+ R2SW(interval,1,2), 10, 2., colorA(255,255,255,0), owner) case DECREASE_INTERVAL_ID if interval < 0.75 createFText(pos, vec2(0,0.05), "|cffC51019Min", 10, 2., colorA(255,255,255,0), owner) else interval -= 0.25 createFText(pos, vec2(0,0.05), "|cffC51019Intervall "+ R2SW(interval,1,2), 10, 2., colorA(255,255,255,0), owner) case INCREASE_VALUE_ID switch a case ABIL.KNOCK if value >= 200 createFText(pos, vec2(0,0.05), "|cffC51019Max Force", 10, 2., colorA(255,255,255,0), owner) else value += 5 createFText(pos, vec2(0,0.05), "|cffC51019Force "+ R2SW(value,1,0), 10, 2., colorA(255,255,255,0), owner) case ABIL.SHAKE if value >= 1500 createFText(pos, vec2(0,0.05), "|cffC51019Intensity Max", 10, 2., colorA(255,255,255,0), owner) else value += 100 createFText(pos, vec2(0,0.05), "|cffC51019Intensity "+ R2SW(value,1,0), 10, 2., colorA(255,255,255,0), owner) case ABIL.SPEED if value >= 180 uptimes++ createFText(pos, vec2(0,0.05), "|cffC51019Max Speed", 10, 2., colorA(255,255,255,0), owner) else value += 20 createFText(pos, vec2(0,0.05), "|cffC51019Speed Bonus "+ R2SW(value,1,0)+"%", 10, 2., colorA(255,255,255,0), owner) if uptimes > 10 uptimes = -99999999 printTimedToPlayer("|cff08C5E6Relax|r, it's already |cffCE2919max|r... |cffFF7B29But maybe this will help you!", 20, owner) actor.addAbility(SPECIAL_ID) default skip case DECREASE_VALUE_ID switch a case ABIL.KNOCK if value <= 5 createFText(pos, vec2(0,0.05), "|cffC51019Min Force", 10, 2., colorA(255,255,255,0), owner) else value -= 5 createFText(pos, vec2(0,0.05), "|cffC51019Force "+ value.toInt().toString(), 10, 2., colorA(255,255,255,0), owner) case ABIL.SHAKE if value <= 100 createFText(pos, vec2(0,0.05), "|cffC51019Min Intensity", 10, 2., colorA(255,255,255,0), owner) else value -= 100 createFText(pos, vec2(0,0.05), "|cffC51019Intensity "+ value.toInt().toString(), 10, 2., colorA(255,255,255,0), owner) case ABIL.SPEED if value <= 20 createFText(pos, vec2(0,0.05), "|cffC51019Min Speed", 10, 2., colorA(255,255,255,0), owner) else value -= 20 createFText(pos, vec2(0,0.05), "|cffC51019Speed Bonus "+ value.toInt().toString()+"%", 10, 2., colorA(255,255,255,0), owner) default skip case INCREASE_DURATION_ID switch a case ABIL.STUN if duration >= 4 createFText(pos, vec2(0,0.05), "|cffC51019Max Duration", 10, 2., colorA(255,255,255,0), owner) else duration += 1 createFText(pos, vec2(0,0.05), "|cffC51019Duration "+ R2SW(duration,1,0), 10, 2., colorA(255,255,255,0), owner) case ABIL.SHAKE if duration >= 5 createFText(pos, vec2(0,0.05), "|cffC51019Max Duration", 10, 2., colorA(255,255,255,0), owner) else duration += 1 createFText(pos, vec2(0,0.05), "|cffC51019Duration "+ R2SW(duration,1,0), 10, 2., colorA(255,255,255,0), owner) case ABIL.SPEED if duration >= 20 createFText(pos, vec2(0,0.05), "|cffC51019Max Duration", 10, 2., colorA(255,255,255,0), owner) else duration += 1 createFText(pos, vec2(0,0.05), "|cffC51019Duration "+ R2SW(duration,1,0), 10, 2., colorA(255,255,255,0), owner) default skip case DECREASE_DURATION_ID switch a case ABIL.STUN if duration <= 1 createFText(pos, vec2(0,0.05), "|cffC51019Min Duration", 10, 2., colorA(255,255,255,0), owner) else duration -= 1 createFText(pos, vec2(0,0.05), "|cffC51019Duration "+ R2SW(duration,1,0), 10, 2., colorA(255,255,255,0), owner) case ABIL.SHAKE if duration <= 1 createFText(pos, vec2(0,0.05), "|cffC51019Min Duration", 10, 2., colorA(255,255,255,0), owner) else duration -= 1 createFText(pos, vec2(0,0.05), "|cffC51019Duration "+ R2SW(duration,1,0), 10, 2., colorA(255,255,255,0), owner) case ABIL.SPEED if duration <= 1 createFText(pos, vec2(0,0.05), "|cffC51019Min Duration", 10, 2., colorA(255,255,255,0), owner) else duration -= 1 createFText(pos, vec2(0,0.05), "|cffC51019Duration "+ R2SW(duration,1,0), 10, 2., colorA(255,255,255,0), owner) default skip case START_ID activate() UnitRemoveAbility(actor,START_ID) UnitAddAbility(actor,STOP_ID) case STOP_ID deactivate() timerreal = 0. UnitRemoveAbility(actor,STOP_ID) UnitAddAbility(actor,START_ID) case KNOCKBACK_PULL_ID pull = true actor.removeAbility(KNOCKBACK_PULL_ID) actor.addAbility(KNOCKBACK_PUSH_ID) case KNOCKBACK_PUSH_ID pull = false actor.removeAbility(KNOCKBACK_PUSH_ID) actor.addAbility(KNOCKBACK_PULL_ID) case SPECIAL_ID let tile = tpos.getEBRTile() if not tile.hasModifier(TileModifier.ORANGEGOO) and goocounter < 4 let goo = createImage("textures\\orangegoo.blp", tpos, 128, 128)..show() goos[goocounter] = new Goo(goo, tpos) goocounter++ tile.addModifier(TileModifier.ORANGEGOO) return false override function serialize() returns Json let json = super.serialize() json..addProperty(new Property(KEY_TYPE, TRAP_INDEX.toString())) return json @objectgen function genTrap() new ChannelAbilityPreset(DECREASE_DURATION_ID, 1, TRUE) ..setName("Trap: Decrease Duration") ..presetTooltipNormal(lvl -> "|cffFF5229Decrease |rDuration [|cffFFCC00D|r]") ..presetTooltipNormalExtended(lvl -> "Decreases the duration of the trap effect, in other words: the amount of time it lasts.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNBTNDurationMinus.blp") ..presetButtonPosNormal(2, 1) ..presetHotkey("D") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(INCREASE_DURATION_ID, 1, TRUE) ..setName("Trap: Increase Duration") ..presetTooltipNormal(lvl -> "|cff73C54AIncrease |rDuration [|cffFFCC00E|r]") ..presetTooltipNormalExtended(lvl -> "Increases the duration of the trap effect, in other words: the amount of time it lasts.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNBTNDurationPlus.blp") ..presetButtonPosNormal(2, 0) ..presetHotkey("E") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(DECREASE_INTERVAL_ID, 1, TRUE) ..setName("Trap: Decrease Interval") ..presetTooltipNormal(lvl -> "|cffFF5229Decrease |rInterval [|cffFFCC00F|r]") ..presetTooltipNormalExtended(lvl -> "Decreases the traps periodic activation interval." + "|nTo turn the trap periodic, click the Start button.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNBTNIntervalMinus.blp") ..presetButtonPosNormal(3, 1) ..presetHotkey("F") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(INCREASE_INTERVAL_ID, 1, TRUE) ..setName("Trap: Increase Interval") ..presetTooltipNormal(lvl -> "|cff73C54AIncrease |rInterval [|cffFFCC00R|r]") ..presetTooltipNormalExtended(lvl -> "Increases the traps periodic activation interval." + "|nTo turn the trap periodic, click the Start button.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNBTNIntervalPlus.blp") ..presetButtonPosNormal(3, 0) ..presetHotkey("R") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(DECREASE_VALUE_ID, 1, TRUE) ..setName("Trap: Decrease Value") ..presetTooltipNormal(lvl -> "|cffFF5229Decrease |rValue [|cffFFCC00S|r]") ..presetTooltipNormalExtended(lvl -> "Decreases the value of the current trap event." + "\nValue always describes the strength or intensity of an effect, for example:" + "\n-Intensity of Camera Shake" + "\n-Strength of Knockback") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNBTNValueMinus.blp") ..presetButtonPosNormal(1, 1) ..presetHotkey("S") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(INCREASE_VALUE_ID, 1, TRUE) ..setName("Trap: Increase Value") ..presetTooltipNormal(lvl -> "Increases the value of the current trap event." + "\nValue always describes the strength or intensity of an effect, for example:" + "\n-Intensity of Camera Shake" + "\n-Strength of Knockback") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNBTNValuePlus.blp") ..presetButtonPosNormal(1, 0) ..presetHotkey("W") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(POISON_ID, 1, TRUE) ..setName("Trap: Poison") ..presetTooltipNormal(lvl -> "Set event to '|cff08C55APoison|r' [|cffFFCC00E|r]") ..presetTooltipNormalExtended(lvl -> "The entering escaper will be poisoned and can only be cured at a fountain.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNEnvenomedSpear.blp") ..presetButtonPosNormal(2, 0) ..presetHotkey("E") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(SHAKE_ID, 1, TRUE) ..setName("Trap: Shake") ..presetTooltipNormal(lvl -> "Set event to '|cff088CD6Shake Camera|r' [|cffFFCC00W|r]") ..presetTooltipNormalExtended(lvl -> "Shakes the camera of the entering escaper for a given amount and intensity.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNTornado.blp") ..presetButtonPosNormal(1, 0) ..presetHotkey("W") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(SPEED_ID, 1, TRUE) ..setName("Trap: Speed") ..presetTooltipNormal(lvl -> "Set event to '|cffBDBDBDSpeed Bonus|r' [|cffFFCC00R|r]") ..presetTooltipNormalExtended(lvl -> "Temporarely adds a movespeed bonus to the entering escaper.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNBootsOfSpeed.blp") ..presetButtonPosNormal(3, 0) ..presetHotkey("R") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(STUN_ID, 1, TRUE) ..setName("Trap: Stun") ..presetTooltipNormal(lvl -> "Set event to '|cff086B9CStun|r' [|cffFFCC00S|r]") ..presetTooltipNormalExtended(lvl -> "Stuns the entering escaper for a given duration.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNStun.blp") ..presetButtonPosNormal(1, 1) ..presetHotkey("S") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(KNOCKBACK_ID, 1, TRUE) ..setName("Trap: Knockback") ..presetTooltipNormal(lvl -> "Set event to '|cffF77B21Knockback|r' [|cffFFCC00F|r]") ..presetTooltipNormalExtended(lvl -> "Knockbacks the entering escaper." + "\nWhen no rallypoint is set, the escaper will be pushed into the same direction he is coming from." + "\nIf the rallypoint is set, he will be pushed to the rallypoints direction.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNShockWave.blp") ..presetButtonPosNormal(3, 1) ..presetHotkey("F") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(KNOCKBACK_PUSH_ID, 1, TRUE) ..setName("Trap: Knockback Push") ..presetTooltipNormal(lvl -> "Set |cffFFCC00knockback |rto |cffCE6319Push |r[|cffFFCC00E|r]") ..presetTooltipNormalExtended(lvl -> "Reset the trap to the normal, pushing mode.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNPull.blp") ..presetButtonPosNormal(2, 0) ..presetHotkey("F") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(KNOCKBACK_PULL_ID, 1, TRUE) ..setName("Trap: Knockback Pull") ..presetTooltipNormal(lvl -> "Set |cffFFCC00knockback |rto |cffCE6319Pull |r[|cffFFCC00E|r]") ..presetTooltipNormalExtended(lvl -> "Instead of pushing the escaper when entering the trap without rallypoint, " + "the escaper gets pulled. \nThis makes the trap function like a speed boost.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNPush.blp") ..presetButtonPosNormal(2, 0) ..presetHotkey("F") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(INSTANT_KILL_ID, 1, TRUE) ..setName("Trap: Instant Kill ") ..presetTooltipNormal(lvl -> "Set event to '|cffBD1910Instant Kill|r' [|cffFFCC00D|r]") ..presetTooltipNormalExtended(lvl -> "Instantly kills the entering escaper.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNCriticalStrike.blp") ..presetButtonPosNormal(2, 1) ..presetHotkey("D") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(START_ID, 1, TRUE) ..setName("Trap: Start") ..presetTooltipNormal(lvl -> "|cff21A54AStart |rPeriodic Evaluation [|cffFFCC00X|r]") ..presetTooltipNormalExtended(lvl -> "By starting periodic evaluation, the trap will only affect escapers " + "that are near the circle when the event fires." + "\nWalking into the circle doesn't fire an event anymore.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNstart.blp") ..presetButtonPosNormal(1, 2) ..presetHotkey("X") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(STOP_ID, 1, TRUE) ..setName("Trap: Stop") ..presetTooltipNormal(lvl -> "|cffC54A10Stop |rPeriodic Evaluation [|cffFFCC00X|r]") ..presetTooltipNormalExtended(lvl -> "By stupping periodic evaluation, the trap will only affect escapers " + "that walk into the trap. \nThere will be no more periodic event.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNstop.blp") ..presetButtonPosNormal(1, 2) ..presetHotkey("X") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(NEXT_EFFECT_ID, 1, TRUE) ..setName("Trap: Next Effect") ..presetTooltipNormal(lvl -> "Set to next special effect [|cffFFCC00Q|r]") ..presetTooltipNormalExtended(lvl -> "Sets the spawned effect to the next one.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNnextEffect.blp") ..presetButtonPosNormal(0, 1) ..presetHotkey("Q") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new ChannelAbilityPreset(PREVIOUS_EFFECT_ID, 1, TRUE) ..setName("Trap: Previous Effect") ..presetTooltipNormal(lvl -> "Set to previous special effect [|cffFFCC00A|r]") ..presetTooltipNormalExtended(lvl -> "Sets the spawned effect to the previous one.") ..presetIcon("ReplaceableTextures\\CommandButtons\\BTNprevEffect.blp") ..presetButtonPosNormal(0, 0) ..presetHotkey("A") ..presetTargetTypes(Targettype.NONE) ..setHeroAbility(FALSE) new BuildingDefinition(TRAP_ID, 'ncop') ..setName("|cffA55A08Trap") ..setHotkey("Y") ..setTooltipBasic("|cffFFCC00Build |cffA55A08Trap [Y]") ..setTooltipExtended("Trap that can perform various actions on an entering Escaper, like poison, stun, knockback and kill." + "\nThe trapeffect can be customized and made invisible.") ..setIconGameInterface("ReplaceableTextures\\CommandButtons\\BTNTrap.blp") ..setNormalAbilities(commaList(KNOCKBACK_ID, POISON_ID, INSTANT_KILL_ID, SHAKE_ID, SPEED_ID, STUN_ID, PREVIOUS_EFFECT_ID, NEXT_EFFECT_ID, MAKE_UNIT_INVISIBLE_ID, REMOVE_OBJECT_ID, INVULNERABILITY_ID)) ..setButtonPositionX(0) ..setButtonPositionY(2) ..setTintingColorRed(96) ..setTintingColorGreen(32) ..setTintingColorBlue(8) ..setSightRadiusDay(0) ..setSightRadiusNight(0) ..setBuildTime(1) ..setCollisionSize(0) ..setScalingValue(0.8) ..setSelectionScale(2.2) ..setUnitClassification("ancient,standon") ..setHideMinimapDisplay(true)