Advertisement
kolton

Untitled

Oct 31st, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. function NT_Duriel()
  2. {
  3. var _tombs, _correcttomb;
  4. var _tileid;
  5.  
  6. print("ÿc3Starting Duriel Script");
  7.  
  8. if (me.area != 46)
  9. {
  10. if (!NTTM_CheckAct())
  11. throw new Error();
  12.  
  13. NTTMGR_TownManager();
  14.  
  15. print("ÿc8Going to Canyon of the Magi");
  16.  
  17. if (!NTTM_TownMove("waypoint"))
  18. throw new Error();
  19.  
  20. if (!NTM_UsePortal("Waypoint", 46))
  21. {
  22. print("ÿc8Seems we do not have the waypoint, Lets go get it! Traveling to Canyon of the Magi");
  23. NTM_TravelTO(46);
  24.  
  25. print("ÿc8Interacting with Waypoint as we don't have it.");
  26. NTM_GotoWaypoint(46, true, 10000);
  27. }
  28. }
  29.  
  30. print("ÿc5Precasting");
  31. NTP_DoPrecast();
  32.  
  33. print("ÿc8Going to Tal Rasha's Chamber");
  34. gotoCorrectTomb();
  35.  
  36. if (!NTM_MoveToObject(NTC_UNIT_OBJECT, 152, 152, -4, -4))
  37. {
  38. print("ÿc8Clearing any mobs");
  39. NTA_ClearPosition(30);
  40. NTSI_PickItems();
  41. }
  42.  
  43. if (!NTM_MoveToObject(NTC_UNIT_OBJECT, 152, 152, -8, -8))
  44. throw new Error();
  45.  
  46. NTC_Delay(500);
  47.  
  48. //while (!NTM_TakeStairs(100)) {
  49. while (!NTM_TakeUnit(2, 100)) {
  50. NTC_Delay(500);
  51. }
  52.  
  53. if (me.classid === 1) {
  54. if (!KillDuriel()) {
  55. throw new Error("KillDuriel failed.");
  56. }
  57. } else if (!NTA_KillBoss(getLocaleString(3054))) {
  58. throw new Error("KillBoss failed.");
  59. }
  60.  
  61. NTSI_PickItems();
  62.  
  63. return true;
  64. }
  65.  
  66. function KillDuriel() {
  67. var i,
  68. _target = NTC_GetUnit(NTC_UNIT_MONSTER, 211);
  69.  
  70. if (!_target) {
  71. return false;
  72. }
  73.  
  74. for(var i = 0 ; i < 300 ; i++) {
  75. if (!me.getState(121)) {
  76. NTC_DoCast(NTConfig_AttackSkill[1], _NTA_SkillHand[1], _target);
  77. } else if (NTConfig_AttackSkill[2] > -1) {
  78. NTC_DoCast(NTConfig_AttackSkill[2], _NTA_SkillHand[2], _target);
  79. } else {
  80. NTC_Delay(300);
  81. }
  82.  
  83. if (getDistance(me, _target) <= 10) {
  84. NTM_MoveTo(22638, (me.y < _target.y) ? 15722 : 15693);
  85. }
  86.  
  87. if (_target.hp <= 0 || _target.mode === 0 || _target.mode === 12) {
  88. return true;
  89. }
  90. }
  91.  
  92. return (_target.hp <= 0 || _target.mode === 0 || _target.mode === 12);
  93. }
  94.  
  95. function gotoCorrectTomb()
  96. {
  97. var _tombs = getRoom();
  98. var _correcttomb = _tombs.correcttomb;
  99.  
  100. if (!_correcttomb)
  101. return false;
  102.  
  103. var _tileid = _correcttomb - 66 + 38;
  104.  
  105. if (!NTM_MoveToObject(NTC_UNIT_TILE, _tileid))
  106. return false;
  107.  
  108. if (!NTM_takeTile(_tileid))
  109. return false;
  110.  
  111. return true;
  112. }
  113.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement