Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.17 KB | None | 0 0
  1. act1: function () {
  2. this.den = function () {
  3. Team.announce("den");
  4.  
  5. var cleartry;
  6.  
  7. if (!me.getQuest(1, 1)) {
  8. Util.smurfToExit([1, 2], true, Config.ClearType);
  9. //Util.startFollow();
  10. if (Team.myType === Team.type.smurf || Team.myType !== Team.type.smurf) {
  11. Util.smurfToExit([2, 3], true, Config.ClearType);
  12. delay(500);
  13. Team.clickWP();
  14. Util.smurfToExit([2, 8], true, Config.ClearType);
  15. Team.inGame();
  16. for (cleartry = 1;
  17. cleartry <= 3 && !me.getQuest(1, 1);
  18. cleartry += 1) {
  19. Team.announce("clearing - try number " + cleartry);
  20. Attack.clearLevel();
  21. delay(100);
  22. }
  23. }
  24. //Util.stopFollow();
  25. Util.smurfToExit([2, 1], true, Config.ClearType);
  26. if (!me.inTown) {
  27. delay(1000);
  28. Packet.flash(me.gid);
  29. delay(500);
  30. Util.smurfToExit([2, 1], false);
  31. Util.smurfToExit([2, 1], true, Config.ClearType);
  32. }
  33. }
  34.  
  35. if (me.inTown) {
  36. Util.talkTo("akara");
  37. Town.doChores();
  38. delay(1000);
  39. }
  40.  
  41. return true;
  42. };
  43.  
  44. this.cave = function () {
  45. Team.announce("cave");
  46.  
  47. var chest, i;
  48.  
  49. Pather.useWaypoint(3);
  50. for (i = 120; i && !Team.inArea(); i -= 1) {
  51. Attack.clear(40);
  52. delay(500);
  53. }
  54. if (!i && me.diff) {
  55. quit();
  56. }
  57. Precast.doPrecast(true);
  58. //Util.startFollow();
  59. if (Team.myType === Team.type.smurf || Team.myType !== Team.type.smurf) {
  60. Util.smurfToExit([9, 13], true, Config.ClearType);
  61. Attack.clearLevel();
  62. chest = getPresetUnit(me.area, 2, 397);
  63. if (chest) {
  64. Pather.moveToUnit(chest, 0, 0, Config.ClearType);
  65. Misc.openChest(chest);
  66. }
  67. }
  68. //Util.stopFollow();
  69.  
  70. if (me.diff) {
  71. Town.goToTown();
  72. return true;
  73. }
  74. if (Team.isLevel(SmurfConfig.caveLvl[me.diff])) {
  75. if (Util.smurfToExit([9, 3], true, Config.ClearType)) {
  76. Team.clickWP(false);
  77. Pather.useWaypoint(1);
  78. } else {
  79. Town.goToTown();
  80. }
  81.  
  82. return true;
  83. }
  84. else if (Util.smurfToExit([9, 3], true, Config.ClearType)) {
  85. Team.clickWP(false);
  86. Pather.useWaypoint(1);
  87. } else {
  88. Town.goToTown();
  89. }
  90.  
  91. if (me.inTown) {
  92. Town.doChores();
  93. }
  94.  
  95. delay(40000);
  96. return false;
  97. };
  98.  
  99. this.bloodRaven = function () {
  100. Team.announce("BloodRaven");
  101.  
  102. var i;
  103. if (!me.getQuest(2, 1)) {
  104. Pather.useWaypoint(3);
  105. for (i = 120; i && !Team.inArea(); i -= 1) {
  106. Attack.clear(40);
  107. delay(500);
  108. }
  109. if (!i && me.diff) {
  110. quit();
  111. }
  112. Precast.doPrecast(true);
  113. Pather.moveToExit(17, true, Config.ClearType);
  114. Team.inGame();
  115. try {
  116. Pather.moveToPreset(17, 1, 805);
  117. Attack.kill(getLocaleString(3111)); // Blood Raven
  118. } catch (e) {
  119. print(e);
  120. Attack.clear(30);
  121. }
  122. Pickit.pickItems();
  123. Town.goToTown();
  124. }
  125. Util.talkTo("kashya");
  126.  
  127. return true;
  128. };
  129.  
  130. this.cain = function () {
  131. Team.announce("cain");
  132.  
  133. var i, unit,
  134. stones = [];
  135.  
  136. if (!me.getQuest(4, 1)) {
  137. Util.startFollow();
  138. if (Team.myType !== Team.type.smurf) {
  139. Util.travel(0);
  140. }
  141. Util.stopFollow();
  142. //4,3 -> may be true in wierd cases (scroll lost?)
  143. if (!me.getQuest(4, 4) //redportal already open
  144. //&& !me.getQuest(4, 3) //'holding scroll'
  145. && !me.getItem(524) && !me.getItem(525)) {
  146. Town.goToTown();
  147. Pather.useWaypoint(5, true); //dark wood
  148. Precast.doPrecast(true);
  149.  
  150. for (i = 0; i < 3 && !me.getItem(524); i += 1) {
  151. Pather.moveToPreset(me.area, 1, 738, 0, 0,
  152. Config.ClearType); //tree
  153. unit = getUnit(2, 30); //tree
  154. if (unit) {
  155. Pather.moveToUnit(unit);
  156. sendPacket(1, 0x13, 4, unit.type, 4, unit.gid);
  157. delay(me.ping * 2 + 100);
  158. Util.getQuestItem(524);
  159. }
  160. Attack.clear(20); // treehead
  161. delay(200 + me.ping * 2);
  162. }
  163. Team.inGame();
  164. if (!Pather.usePortal(null, null)) {
  165. Town.goToTown();
  166. }
  167. unit = me.getItem(524); //another scroll...
  168. if (unit) {
  169. if (unit.location !== 7
  170. && Storage.Stash.CanFit(unit)) {
  171. Storage.Stash.MoveTo(unit);
  172. delay(me.ping * 2 + 100);
  173. me.cancel();
  174. }
  175. }
  176. }
  177.  
  178. Util.talkTo("akara");
  179. unit = me.getItem(525); //yay! this is the last scroll
  180. if (unit) {
  181. if (unit.location !== 7 && Storage.Stash.CanFit(unit)) {
  182. Storage.Stash.MoveTo(unit);
  183. delay(me.ping);
  184. me.cancel();
  185. }
  186. }
  187. Team.inGame();
  188. Pather.useWaypoint(4, true); //stoney field
  189. Precast.doPrecast(true);
  190. Pather.moveToPreset(me.area, 1, 737, 0, 0,
  191. Config.ClearType);
  192. try {
  193. Attack.clear(15, 0, getLocaleString(2872));// Rakanishu
  194. } catch (e2) {
  195. print(e2);
  196. Attack.clear(20);
  197. }
  198. Attack.clear(20);
  199.  
  200. if (!me.getQuest(4, 4)) { //redportal already open
  201. Team.inGame();
  202. for (i = 17; i <= 21; i += 1) {
  203. stones.push(getUnit(2, i));
  204. }
  205. for (i = 0; i < 5; i += 1) { //brute-forcing...
  206. for (unit = stones.length - 1; unit >= 0; unit -= 1) {
  207. Misc.openChest(stones[unit]);
  208. }
  209. }
  210. }
  211. for (i = 10; i && !Pather.usePortal(38); i -= 1) {
  212. delay(500 + me.ping * 2);
  213. }
  214. if (!i) {
  215. print("cain failed");
  216. return false;
  217. }
  218. unit = getUnit(2, 26); //sad cain
  219. Misc.openChest(unit);
  220. if (!Pather.usePortal(null, null)) {
  221. Town.goToTown();
  222. }
  223. delay(3000);
  224. }
  225.  
  226. Util.talkTo("akara");
  227. Util.talkTo("cain"); //happy cain
  228.  
  229. return true;
  230. };
  231.  
  232. this.trist = function () {
  233. Team.announce("trist");
  234.  
  235. var i,
  236. xx = [ 25175, 25147, 25149, 25127, 25128, 25150, 25081,
  237. 25066, 25045, 25061, 25048, 25099, 25109, 25078, 25154],
  238. yy = [ 5187, 5201, 5172, 5188, 5144, 5123, 5137,
  239. 5195, 5186, 5099, 5055, 5058, 5095, 5093, 5095];
  240.  
  241. if (!me.getQuest(4, 0)) {
  242. return this.cain();
  243. }
  244. Pather.useWaypoint(4);
  245. Precast.doPrecast(true);
  246. Pather.moveToPreset(me.area, 1, 737, 0, 0, Config.ClearType, true);
  247. try {
  248. Attack.clear(15, 0, getLocaleString(2872)); // Rakanishu
  249. } catch (e) {
  250. print(e);
  251. Attack.clear(20);
  252. }
  253. for (i = 0; i < 10 && !Pather.usePortal(38); i += 1) {
  254. delay(500 + me.ping * 2);
  255. }
  256.  
  257. for (i = 0; i < xx.length; i += 1) {
  258. Pather.moveTo(xx[i], yy[i], 3, Config.ClearType);
  259. Attack.clear(20);
  260. }
  261.  
  262. Town.goToTown();
  263. if (me.inTown) {
  264. Town.doChores();
  265. }
  266.  
  267. delay(35000);
  268. return Team.isLevel(SmurfConfig.tristLvl[me.diff]);
  269. };
  270.  
  271. this.andy = function () {
  272. Team.announce("andy");
  273.  
  274. if (me.getQuest(6, 0) && !me.getQuest(7, 0)) {
  275. Team.changeAct(2);
  276. return true;
  277. }
  278.  
  279. if (!me.getQuest(6, 1)) {
  280. if (!me.diff) {
  281. if ((Team.myType === Team.type.smurfette && me.diff) || (Team.myType !== Team.type.smurf && !me.diff)) {
  282. try {
  283. Util.travel(1);
  284. } catch (e1) {
  285. Attack.clearLevel();
  286. Town.goToTown();
  287. print("travel failed, waiting 3mn : " + e1); //pro!
  288. delay(180000);
  289. }
  290. Pather.useWaypoint(35, true);
  291. Precast.doPrecast(true);
  292. Pather.teleport = !!me.diff;
  293.  
  294. if (!Pather.teleport
  295. || !Util.smurfToExit([36, 37], true,0)) {
  296. Util.smurfToExit([36, 37], true, Config.ClearType);
  297. }
  298. }
  299. } else if ((Team.myType === Team.type.smurfette && me.diff) || (Team.myType !== Team.type.smurf && !me.diff)) {
  300. try {
  301. Util.travel(1);
  302. } catch (e1) {
  303. Attack.clearLevel();
  304. Town.goToTown();
  305. print("travel failed, waiting 3mn : " + e1); //pro!
  306. delay(180000);
  307. }
  308. Pather.useWaypoint(35, true);
  309. Precast.doPrecast(true);
  310. Pather.teleport = !!me.diff;
  311.  
  312. if (!Pather.teleport
  313. || !Util.smurfToExit([36, 37], true, Config.ClearType)) {
  314. Util.smurfToExit([36, 37], true, Config.ClearType);
  315. }
  316. } else if (!Team.waitTP(37)) {
  317. return true;
  318. }
  319. Team.inGame();
  320. Precast.doPrecast(true);
  321. delay(500);
  322. if (me.diff !== 2) {
  323. Pather.teleport = false;
  324. Pather.makePortal();
  325. Team.sendMsg(Team.type.smurf | Team.type.bigSmurf, "come");
  326. Util.startFollow();
  327. Pather.moveTo(22594, 9641, 3, Config.ClearType);
  328. Pather.moveTo(22564, 9629, 3, Config.ClearType);
  329. Pather.moveTo(22533, 9641, 3, Config.ClearType);
  330. Pather.moveTo(22568, 9582, 3, Config.ClearType);
  331. Pather.moveTo(22548, 9568, 3, Config.ClearType);
  332. } else {
  333. Pather.moveTo(22548, 9568);
  334. Pather.makePortal();
  335. Team.sendMsg(Team.type.smurf | Team.type.bigSmurf, "come");
  336. }
  337. if (me.area === 37){
  338. try {
  339. Attack.kill(156); // Andariel
  340. } catch (e2) {
  341. print(e2);
  342. Attack.clear(35);
  343. }
  344. }
  345. delay(2000); // Wait for minions to die.
  346. Util.stopFollow();
  347. Pickit.pickItems();
  348. if (!Pather.usePortal(null, null)) {
  349. Town.goToTown();
  350. }
  351. }
  352.  
  353. delay(3000);
  354. Team.changeAct(2);
  355.  
  356. return true;
  357. };
  358.  
  359. Town.goToTown(1);
  360.  
  361. if (!me.getQuest(1, 0)) {
  362. return this.den();
  363. }
  364. if (!Team.isLevel(SmurfConfig.caveLvl[me.diff])) {
  365. return this.cave();
  366. }
  367. if (Msg.action === "broken") {
  368. this.cave(); // + andy
  369. }
  370. if (!me.diff) {
  371. if (!me.getQuest(2, 0)) {
  372. return this.bloodRaven();
  373. }
  374. if (!me.getQuest(4, 0)) {
  375. return this.cain();
  376. }
  377. }
  378. if (!Team.isLevel(SmurfConfig.tristLvl[me.diff])) {
  379. return this.trist();
  380. }
  381.  
  382. return this.andy();
  383. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement