Is it possible to activate the lightning
After engage into the fight with a brawler
As far as I understand
Lightning should be activated by a trigger at the point {40, 34}
But even if I directly “swap” brawler at this point
Or do as the brawler passes through {40, 34} on the way to me
Or when pushing it to the point by hero
Lightning is not activated
Code
function checkTakeHide(item) {
if (item)
{
if ( item.pos.x > 68 )
{
hero.cast( "haste", hero );
}
hero.moveXY( item.pos.x, item.pos.y );
itemCounter += 1;
if ( item.pos.x > 41 )
{
hero.buildXY( "fire-trap", hero.pos.x + 4, hero.pos.y );
hero.buildXY( "fire-trap", hero.pos.x + 4, hero.pos.y );
}
if ( item.pos.x < 41 )
{
hero.buildXY( "fire-trap", hero.pos.x - 4, hero.pos.y );
hero.buildXY( "fire-trap", hero.pos.x - 4, hero.pos.y );
}
hero.moveXY( 25, 56 );
}
}
hero.moveXY ( 54, 56 );
var itemCounter = 0;
while ( true ) {
if ( itemCounter == 4 )
{
var brawler = hero.findNearest(hero.findByType( "brawler" ));
if ( brawler )
{
if ( hero.canCast( "swap" ) )
{
hero.moveXY( 28, 56);
hero.cast( "swap", brawler );
}
while( true )
{
if ( hero.canCast( "swap" )
&& hero.distanceTo( brawler ) < 30 )
{
hero.cast( "swap", brawler );
}
hero.move( { x:40, y:34 } );
}
}
}
var stone = hero.findNearest( hero.findItems() );
if ( stone )
{
checkTakeHide( stone );
}
else if ( itemCounter < 4 )
{
hero.buildXY( "fire-trap", 27, 47 );
}
}