Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. antonius.attacks = antonius.attacks or {
  2. engaged = false,
  3. left = "nothing",
  4. right = "nothing"
  5. }
  6.  
  7. antonius.attacks.namespaces = {
  8. bard = "voicecraft",
  9. ["earth elemental lord"] = "earthlord",
  10. ["air elemental lord"] = "airlord"
  11. }
  12.  
  13. antonius.attacks.namespace = function()
  14. if ssc.me.isknight(ssc.me.class) then
  15. return "knight"
  16. end
  17. return antonius.attacks.namespaces[ssc.me.class] or ssc.me.class
  18. end
  19.  
  20. antonius.attacks.requeued = 0
  21. antonius.attacks.requeueafflictions = {}
  22.  
  23. antonius.attacks.attack = function(modifier, queue)
  24. antonius.attacks.lastmodifier = modifier
  25. local queue = queue == nil and true or queue
  26.  
  27. local namespace = antonius.attacks.namespace()
  28.  
  29. if not antonius.ubermode.enabled and (not antonius[namespace] or not antonius[namespace].attack) then
  30. antonius.echo("No attack function as " .. namespace .. ".")
  31. return
  32. end
  33.  
  34. local commands = nil
  35.  
  36. if ssc.inslowcuringmode() then
  37. commands = antonius[namespace].slowattack(modifier, queue)
  38.  
  39. if queue and antonius.attacks.canattack() and #commands > 0 then
  40. send("curing aeoncommand " .. commands[1], false)
  41. end
  42. else
  43. if antonius.ubermode.enabled then
  44. commands = antonius.ubermode.attack(modifier, queue)
  45. else
  46. commands = antonius[namespace].attack(modifier, queue)
  47. end
  48.  
  49. if ssc.traits.hasmajor("Health Inspector") then
  50. if antonius.target.assessed then
  51. table.insert(commands, "assess " .. antonius.target.name)
  52. else
  53. table.insert(commands, 1, "assess " .. antonius.target.name)
  54. end
  55. end
  56.  
  57. if not antonius.roleplay.persist.helm then
  58. table.insert(commands, 1, "pull 106814")
  59. end
  60.  
  61. commands = antonius.get_commands(commands)
  62. if commands and #commands > 0 then
  63. antonius.alias.set("atk", commands)
  64. if queue then
  65. antonius.queueing.queue("eqbal", "add", "atk", true)
  66. end
  67. else
  68. antonius.echo("<white>No commands.")
  69. end
  70. end
  71. end
  72.  
  73. antonius.attacks.canattack = function()
  74. if ssc.affs.has("paralysis") then return false end
  75.  
  76. if ssc.affs.has("damagedleftarm") or ssc.affs.has("mangledleftarm") then
  77. if ssc.affs.has("damagedrightarm") or ssc.affs.has("mangledrightarm") or ssc.affs.has("brokenrightarm") then
  78. return false
  79. end
  80. elseif ssc.affs.has("damagedrightarm") or ssc.affs.has("mangledrightarm") then
  81. if ssc.affs.has("damagedleftarm") or ssc.affs.has("mangledleftarm") or ssc.affs.has("brokenleftarm") then
  82. return false
  83. end
  84. end
  85.  
  86. if ssc.affs.has("webbed") or ssc.affs.has("roped") or ssc.affs.has("bound") or ssc.affs.has("transfixed") or ssc.affs.has("impaled") or ssc.affs.has("daeggerimpale") then
  87. return false
  88. end
  89.  
  90. if ssc.affs.has("prone") then
  91. if ssc.inslowcuringmode() then return false end
  92. -- prone with at least one resto break (won't be standing soon)
  93. if ssc.affs.has("damagedleftleg") or ssc.affs.has("damagedrightleg") or ssc.affs.has("mangledleftleg") or ssc.affs.has("mangledrightleg") then
  94. return false
  95. -- prone with two mending breaks (won't be standing immediately)
  96. elseif ssc.affs.has("brokenleftleg") and ssc.affs.has("brokenrightleg") then
  97. return false
  98. end
  99. end
  100.  
  101. return true
  102. end
  103.  
  104. antonius.attacks.raze = function()
  105. local namespace = antonius.attacks.namespace()
  106.  
  107. if not antonius.ubermode.enabled and (not antonius[namespace] or not antonius[namespace].raze) then
  108. antonius.echo("<white>No raze function for " .. namespace .. ".")
  109. return
  110. end
  111.  
  112. local commands = nil
  113.  
  114. if antonius.ubermode.enabled then
  115. commands = antonius.ubermode.raze()
  116. else
  117. commands = antonius[namespace].raze()
  118. end
  119.  
  120. commands = antonius.get_commands(commands)
  121. if commands and #commands > 0 then
  122. antonius.alias.set("raz", commands)
  123.  
  124. if not ssc.inslowcuringmode() then
  125. antonius.queueing.queue("eqbal", "add", "raz", true)
  126. else
  127. send("raz", false)
  128. end
  129. else
  130. antonius.echo("<white>No commands.")
  131. end
  132. end
  133.  
  134. antonius.attacks.razechange = function(event, name)
  135. if name == antonius.target.name and antonius.target.adventurer then
  136. antonius.attacks.attack(antonius.attacks.lastmodifier, false)
  137. if antonius.class() == "Alchemist" then
  138. antonius.alchemist.wrack(antonius.attacks.lastmodifier, false)
  139. elseif antonius.class() == "Blademaster" then
  140. antonius.blademaster.compass(antonius.attacks.lastmodifier, false)
  141. antonius.blademaster.balance(antonius.attacks.lastmodifier, false)
  142. antonius.blademaster.pommel(antonius.attacks.lastmodifier, false)
  143. elseif antonius.class() == "Depthswalker" then
  144. antonius.depthswalker.cull(antonius.attacks.lastmodifier, false)
  145. end
  146. end
  147. end
  148. registerAnonymousEventHandler("antonius razing change", "antonius.attacks.razechange")
  149.  
  150. antonius.attacks.bashing = function()
  151. local namespace = antonius.attacks.namespace()
  152.  
  153. if not antonius[namespace] or not antonius[namespace].bashing then
  154. antonius.echo("No bashing function as " .. namespace .. ".")
  155. return
  156. end
  157.  
  158. local commands = antonius.get_commands()
  159.  
  160. for id, item in pairs(antonius.items.lists.room) do
  161. if item.name == "a chipped tangerine shard"
  162. or item.name == "a jagged crimson shard"
  163. or item.name == "a smooth sable shard" then
  164. if not antonius.queueing.isqueued("eqbal", "get " .. id) then
  165. table.insert(commands, "get " .. id)
  166. end
  167. end
  168. end
  169.  
  170. table.insertAll(commands, antonius[namespace].bashing())
  171.  
  172. antonius.alias.set("bashing", commands)
  173. antonius.queueing.queue("eqbal", "add", "bashing", true)
  174. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement