Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Прорвись с боем в святилище вождя огров и убей его.
- function attackFriends(friends) {
- for(var i = 0; i < friends.length; i++) {
- var friend = friends[i];
- var enemy = friend.findNearestEnemy();
- if(enemy) {
- hero.command(friend, "attack", enemy);
- }
- }
- }
- function sumUnit() {
- if(hero.gold > hero.costOf("soldier")) {
- hero.summon("soldier");
- }
- }
- while(hero.time < 28) {
- var friends = hero.findFriends();
- attackFriends(friends);
- var cata = hero.findNearest(hero.findByType("catapult"));
- if(hero.pos.x < 80)
- hero.move({'x': 73, 'y': 32 });
- if(cata && cata.health > 0) {
- hero.attack(cata);
- }
- if(!cata) {
- hero.move({ 'x': 96, 'y': 33});
- }
- }
- while(hero.time < 56) {
- var friends = hero.findFriends();
- if(friends)
- attackFriends(friends);
- var enemy = hero.findNearestEnemy();
- if(enemy && enemy.health > 0 && enemy.pos.x < 163)
- hero.attack(enemy);
- }
- var enemy = hero.findNearestEnemy();
- while(enemy.health > 0 && enemy.pos.x < 170) {
- hero.attack(enemy);
- }
- hero.moveXY(153, 34);
- hero.moveXY(163, 34);
- while (hero.time < 70){
- hero.moveXY( 163, 34);
- }
- hero.moveXY(208, 6);
- hero.moveXY(260, 34);
- while(hero.time < 100) {
- var friends = hero.findFriends();
- attackFriends(friends);
- var warlock = hero.findNearest(hero.findByType("warlock"));
- if (warlock && warlock.health >0) {
- hero.attack(warlock);
- } else {
- hero.shield();
- }
- }
- while(true) {
- sumUnit();
- var friends = hero.findFriends();
- attackFriends(friends);
- var enemy = hero.findNearestEnemy();
- if(enemy && enemy.health > 0) {
- hero.attack(enemy);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement