Guest User

Untitled

a guest
Jun 21st, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.45 KB | None | 0 0
  1. S EnableGroup NoTanks off
  2.  
  3. S EnableGroup Force off
  4.  
  5. ?Force T(500) effectTime($ChallengeAura) == 0 : Cast $ChallengeAura
  6.  
  7. ?Force T(500) effectTime($SigelForce) == 0 : Cast $SigelForce
  8.  
  9. ?Sounds @CreatureSay type == 2 and actor ~= me : PlaySound whisper
  10. // ##################################################################################################
  11. // ############################### L2Ranger Harnak Tank Script ######################################
  12. // ##################################################################################################
  13. // ##################################### Created By: Mr_K ###########################################
  14. // ##################################################################################################
  15.  
  16. // ##################################################################################################
  17. // ### PM YOURSELF "set room center" To define center of the room. ###
  18. // ### PM YOURSELF "set my location" To define where you want to stand. ###
  19. // ### PM YOURSELF "clear my location" To clear standing location. ###
  20. // ### ###
  21. // ### NOTE: You must define a room center to properly target mobs. ###
  22. // ### NOTE: Once you define a standing location, you will periodically move towards it. ###
  23. // ##################################################################################################
  24.  
  25. // ##################################################################################################
  26. // ### FEATURES: ###
  27. // ### * Targets mobs within a set area (center point defined by the player) . ###
  28. // ### * Moves to a preferred location periodically (defined by the player). ###
  29. // ### * Chain strikes harnak sniper mobs outside of AOE hate range. ###
  30. // ### * Casts aoe hate on a fixed timer. ###
  31. // ### * Casts single target hate on mobs attacking party members and outside of aoe hate range. ###
  32. // ### * Casts ultimate defense when player hp falls below 20%. ###
  33. // ### * Casts party ultimate defense when player hp falls below 25%. ###
  34. // ### * Casts ChainGalaxy/GustBlade/ShieldImpact/ShieldWave when mobs in AOE range. ###
  35. // ##################################################################################################
  36.  
  37. // *************************************** Variables ************************************************
  38.  
  39. // Group is off by default.
  40. L EnableGroup HarnakTank off
  41.  
  42. // Keep track of center position.
  43. V: HarnakTank_X, HarnakTank_Y
  44.  
  45. // Action lockout variables.
  46. V: HarnakTank_ActionStop, HarnakTank_ActionStopTime
  47. L Assign HarnakTank_ActionStopTime = 250;
  48. L Assign HarnakTank_ActionStop = 0;
  49.  
  50. // *************************************** Functions ************************************************
  51.  
  52. // Figure out if we have a center position stored.
  53. F: HarnakTank_MyLocation = HarnakTank_X and HarnakTank_Y
  54.  
  55. // Find out if a target object is in range of specified distance.
  56. F: HarnakTank_InRange(object, distance) = distance(object) < distance
  57.  
  58. // Find out if target object is in room (or close).
  59. F: HarnakTank_InRoom(object) = inRange(1114, object) and \
  60. zdiff(object) < 250
  61.  
  62. // Find out if target object is in aoe range.
  63. F: HarnakTank_AoeRange(object) = HarnakTank_InRange(object, 200) and HarnakTank_InRoom(object)
  64.  
  65. // Find out if player can perform an action (no casting, lockout, or disabled).
  66. F: HarnakTank_CanPerformAction = now > HarnakTank_ActionStop and not nowCasting and alive(me) and \
  67. not isMedused(me) and not isSilenced(me) and \
  68. not isStunned(me) and not isTranced (me)
  69.  
  70. // Find out if object is skill we can use (not on cooldown and can perform action).
  71. F: HarnakTank_CanUseSkill(object) = not skillCoolTime(object) and HarnakTank_CanPerformAction
  72.  
  73. // Find out if object is a valid object, alive, attackable, and can see.
  74. F: HarnakTank_ValidTarget(object) = object and alive(object) and attackable(object)
  75.  
  76. // ************************************ Range and Functors ******************************************
  77.  
  78. // Attackable, alive, inside room.
  79. L MobFunctor 1111 (Attackable and Alive and \
  80. HarnakTank_InRoom(actor))
  81.  
  82. // Attackable, alive, inside room, outside of aoe range.
  83. L MobFunctor 1112 (Attackable and Alive and \
  84. HarnakTank_InRoom(actor)) and \
  85. not HarnakTank_AoeRange(actor)
  86.  
  87. // Attackable, alive, inside room, outside of aoe range, targetting party.
  88. L MobFunctor 1113 (Attackable and Alive and \
  89. HarnakTank_InRoom(actor)) and \
  90. not HarnakTank_AoeRange(actor) and \
  91. isMember(name(target(actor)))
  92.  
  93. // Attackable, alive, inside room, inside of aoe range.
  94. L MobFunctor 1114 (Attackable and Alive and \
  95. HarnakTank_InRoom(actor)) and \
  96. HarnakTank_AoeRange(actor)
  97.  
  98. // ***************************************** Events *************************************************
  99.  
  100. // If user pm's themselfs 'set center', set the center combat point.
  101. ?HarnakTank @CreatureSay type == 2 and actor == me and text == "set room center" : \
  102. Display 1 ("Room center point set to " .. xpos(me) .. " " .. ypos(me) .. " " .. zpos(me)); \
  103. RoundRange 1114 xpos(me) ypos(me) 700;
  104.  
  105. // If user pm's themselfs 'set center', set the center combat point.
  106. ?HarnakTank @CreatureSay type == 2 and actor == me and text == "set my location" : \
  107. Display 1 ("My preferred location set to " .. xpos(me) .. " " .. ypos(me) .. " " .. zpos(me)); \
  108. Assign HarnakTank_X = xpos(me); Assign HarnakTank_Y = ypos(me);
  109.  
  110. // If user pm's themselfs 'set center', set the center combat point.
  111. ?HarnakTank @CreatureSay type == 2 and actor == me and text == "clear my location" : \
  112. Display 1 ("My preferred location cleared."); \
  113. Assign HarnakTank_X = 0; Assign HarnakTank_Y = 0;
  114.  
  115. // *********************************** Movement Intervals *******************************************
  116.  
  117. // If we have a preferred location defined, move to it.
  118. ?HarnakTank T(3000) HarnakTank_MyLocation and \
  119. Zone ~= 12 : \
  120. Display 1 ("Moving to my preferred location [" .. \
  121. HarnakTank_X .. " " .. HarnakTank_Y .. "]."); \
  122. MoveTo HarnakTank_X HarnakTank_Y zpos(me);
  123.  
  124. // ******************************* Targetting/Attack Intervals **************************************
  125.  
  126. // If can perform action, and not valid target or targetting player and have mob.
  127. ?HarnakTank T(1000) HarnakTank_CanPerformAction and \
  128. not HarnakTank_ValidTarget(target(me)) and \
  129. mobsFind(1111) : \
  130. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  131. Display 1 ("Selecting and attacking a new target [" .. npc(lastFound) .. "]."); \
  132. Select(lastFound) safe > Attack;
  133.  
  134. // *************************************** Intervals ************************************************
  135.  
  136. // If at least one mob is around, and hate aura is not on cooldown.
  137. ?HarnakTank T(1000, 2500) HarnakTank_CanUseSkill($SuperiorHateAura) and \
  138. mobsCount(1111) : \
  139. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  140. Display 1 ("[" .. mobsCount(1111) .. "] mobs in room, using [" .. \
  141. skillName($SuperiorHateAura) .. "]."); \
  142. Cast $SuperiorHateAura;
  143.  
  144. // If mob attacking someone, use single target hate.
  145. ?HarnakTank T(1001, 2500) HarnakTank_CanUseSkill($SuperiorHate) and \
  146. mobsFind(1113) : \
  147. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  148. Display 1 ("[" .. name(target(lastFound)) .. "] is being attacked, using [" .. \
  149. skillName($SuperiorHate) .. "]."); \
  150. Select (lastFound) > Cast $SuperiorHate;
  151.  
  152. // If a sniper is found matching our mob criteria, chain strike it.
  153. ?HarnakTank T(1002, 2500) HarnakTank_CanUseSkill($ChainStrike) and \
  154. mobsFind(1112) : \
  155. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  156. Display 1 ("Using [" .. skillName($ChainStrike) .. "] on a mob ouside of aoe range."); \
  157. Select(lastFound) > Cast $ChainStrike;
  158.  
  159. // If hp falls below 20% target self and use ultimate defense.
  160. ?HarnakTank T(1003, 5000) HarnakTank_CanUseSkill($FinalUltimateDefense) and \
  161. php(me) < 20 : \
  162. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  163. Display 1 ("HP below 20% using [" .. skillName($FinalUltimateDefense) .. "]."); \
  164. SelectSelf > Cast $FinalUltimateDefense;
  165.  
  166. // If hp falls below 25% use party ultimate defense.
  167. ?HarnakTank T(1004, 5000) HarnakTank_CanUseSkill($ProtectionOfFaith) and \
  168. php(me) < 25 : \
  169. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  170. Display 1 ("HP below 25% using [" .. skillName($ProtectionOfFaith) .. "]."); \
  171. Cast $ProtectionOfFaith;
  172.  
  173. // ********************************** Within AOE Intervals ******************************************
  174.  
  175. // If at least two mobs inside aoe range, use chain galaxy.
  176. ?HarnakTank T(1005, 2500) HarnakTank_CanUseSkill($ChainGalaxy) and \
  177. mobsFind(1114) > 1 : \
  178. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  179. Display 1 ("Using [" .. skillName($ChainGalaxy) .. "]."); \
  180. Cast $ChainGalaxy;
  181.  
  182. // If at least two mobs inside aoe range, use gust blade.
  183. ?HarnakTank T(1006, 2500) HarnakTank_CanUseSkill($GustBlade) and \
  184. mobsFind(1114) > 1 : \
  185. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  186. Display 1 ("Using [" .. skillName($GustBlade) .. "]."); \
  187. Cast $GustBlade;
  188.  
  189. // If at least two mobs inside aoe range, use shield impact.
  190. ?HarnakTank T(1007, 2500) HarnakTank_CanUseSkill($ShieldImpact) and \
  191. mobsFind(1114) > 1 : \
  192. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  193. Display 1 ("Using [" .. skillName($ShieldImpact) .. "]."); \
  194. Cast $ShieldImpact;
  195.  
  196. // If at least two mobs inside aoe range, use shield wave.
  197. ?HarnakTank T(1008, 2500) HarnakTank_CanUseSkill($ShieldWave) and \
  198. mobsFind(1114) > 1 : \
  199. Assign HarnakTank_ActionStop = now + HarnakTank_ActionStopTime; \
  200. Display 1 ("Using [" .. skillName($ShieldWave) .. "]."); \
  201. Cast $ShieldWave;
Add Comment
Please, Sign In to add comment