Advertisement
kolton

Untitled

Oct 31st, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         NTC_Delay(500);
  50.     }
  51.    
  52.     if (me.classid === 1) {
  53.         if (!KillDuriel()) {
  54.             throw new Error("KillDuriel failed.");
  55.         }
  56.     } else if (!NTA_KillBoss(getLocaleString(3054))) {
  57.         throw new Error("KillBoss failed.");
  58.     }
  59.    
  60.     NTSI_PickItems();
  61.  
  62.     return true;
  63. }
  64.  
  65. function KillDuriel() {
  66.     var i,
  67.         _target = NTC_GetUnit(NTC_UNIT_MONSTER, 211);
  68.    
  69.     if (!_target) {
  70.         return false;
  71.     }
  72.    
  73.     for(var i = 0 ; i < 300 ; i++) {
  74.         if (!me.getState(121)) {
  75.             NTC_DoCast(NTConfig_AttackSkill[1], _NTA_SkillHand[1], _target);
  76.         } else if (NTConfig_AttackSkill[3] > -1) {
  77.             NTC_DoCast(NTConfig_AttackSkill[3], _NTA_SkillHand[3], _target);
  78.         } else {
  79.             NTC_Delay(300);
  80.         }
  81.        
  82.         if (getDistance(me, _target) <= 10) {
  83.             NTM_MoveTo(22638, (me.y < _target.y) ? 15722 : 15693);
  84.         }
  85.        
  86.         if (_target.hp <= 0 || _target.mode === 0 || _target.mode === 12) {
  87.             return true;
  88.         }
  89.     }
  90.    
  91.     return (_target.hp <= 0 || _target.mode === 0 || _target.mode === 12);
  92. }
  93.  
  94. function gotoCorrectTomb()
  95. {
  96.     var _tombs = getRoom();
  97.     var _correcttomb = _tombs.correcttomb;
  98.    
  99.     if (!_correcttomb)
  100.         return false;
  101.    
  102.     var _tileid = _correcttomb - 66 + 38;
  103.    
  104.     if (!NTM_MoveToObject(NTC_UNIT_TILE, _tileid))
  105.         return false;
  106.        
  107.     if (!NTM_TakeStairs(_tileid, _tileid))
  108.         return false;
  109.    
  110.     return true;
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement