Advertisement
Fiv

schillchain

Fiv
Sep 15th, 2015
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.38 KB | None | 0 0
  1. --[[Copyright © 2015, Fiv
  2. All rights reserved.
  3.  
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6.  
  7. * Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in the
  11. documentation and/or other materials provided with the distribution.
  12. * Neither the name of Schillchain nor the
  13. names of its contributors may be used to endorse or promote products
  14. derived from this software without specific prior written permission.
  15.  
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  17. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. DISCLAIMED. IN NO EVENT SHALL Fiv BE LIABLE FOR ANY
  20. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]]--
  26.  
  27. --[[
  28. tran = darkness > light
  29. comp = ice > darkness
  30. comp1 = light > darkness
  31. liqu = lightning > fire
  32. liqu1 = earth > fire
  33. scis = fire > earth
  34. scis1 = wind > earth
  35. reve = earth > water
  36. reve1 = light > water
  37. deto = lightning > wind
  38. deto1 = earth > wind
  39. deto2 = darkness > wind
  40. indu = water > ice
  41. impa = ice > lightning
  42. impa1 = water > lightning
  43. grav = wind > darkness
  44. dist = light > earth
  45. fusi = fire > lightning
  46. frag = ice > water
  47. ]]--
  48.  
  49. _addon.name = 'Schillchain'
  50. _addon.version = '1.0.0.0'
  51. _addon.author = 'Fiv'
  52. _addon.command = 'sch'
  53.  
  54. require('tables')
  55. require('strings')
  56. require('logger')
  57. require('sets')
  58. config = require('config')
  59. chat = require('chat')
  60. res = require('resources')
  61.  
  62. Telem = S{"tran","comp","comp1","liqu","liqu1","scis","scis1","reve",
  63. "reve1","deto","deto1","deto2","indu","impa","impa1","grav","dist","fusi","frag"}
  64. tier1 = 1
  65. tier2 = 1
  66. --element = {}
  67. windower.register_event('addon command',function (...)
  68. cmd = {...}
  69. local player = windower.ffxi.get_player()
  70. if Telem:contains(cmd[1]) then
  71. element = cmd[1]
  72. set_elements()
  73. windower.add_to_chat(209,'Skillchain Set:' ..element..'')
  74. elseif cmd[1]:lower() == "opentier" then
  75. if cmd[2] ~= nil then
  76. if cmd[2] == "1" then
  77. tier1 = 1
  78. windower.add_to_chat(209,"Opening nuke set to Tier 1 spells.")
  79. elseif cmd[2] == "2" then
  80. tier1 = 2
  81. windower.add_to_chat(209,"Opening nuke set to Tier 2 spells.")
  82. elseif cmd[2] == "3" then
  83. tier1 = 3
  84. windower.add_to_chat(209,"Opening nuke set to Tier 3 spells.")
  85. elseif cmd[2] == "4" then
  86. tier1 = 4
  87. windower.add_to_chat(209,"Opening nuke set to Tier 4 spells.")
  88. elseif cmd[2] == "5" then
  89. tier1 = 5
  90. windower.add_to_chat(209,"Opening nuke set to Tier 5 spells.")
  91. elseif cmd[2] == "6" then
  92. windower.add_to_chat(209,"Wishful thinking or fat fingers?")
  93. else
  94. windower.add_to_chat(209,"Incorrect Value, Please use 1,2,3,4,or 5.")
  95. end
  96. end
  97. elseif cmd[1]:lower() == "closetier" then
  98. if cmd[2] ~= nil then
  99. if cmd[2] == "1" then
  100. tier2 = 1
  101. windower.add_to_chat(209,"Closing nuke set to Tier 1 spells.")
  102. elseif cmd[2] == "2" then
  103. tier2 = 2
  104. windower.add_to_chat(209,"Closing nuke set to Tier 2 spells.")
  105. elseif cmd[2] == "3" then
  106. tier2 = 3
  107. windower.add_to_chat(209,"Closing nuke set to Tier 3 spells.")
  108. elseif cmd[2] == "4" then
  109. tier2 = 4
  110. windower.add_to_chat(209,"Closing nuke set to Tier 4 spells.")
  111. elseif cmd[2] == "5" then
  112. tier2 = 5
  113. windower.add_to_chat(209,"Closing nuke set to Tier 5 spells.")
  114. elseif cmd[2] == "6" then
  115. windower.add_to_chat(209,"Wishful thinking or fat fingers?")
  116. else
  117. windower.add_to_chat(209,"Incorrect Value, Please use 1,2,3,4,or 5.")
  118. end
  119. end
  120. elseif cmd[1]:lower() == "start" then
  121. local player = windower.ffxi.get_player()
  122. if Telem:contains(element) then
  123. if S(player.buffs):contains(359) or S(player.buffs):contains(402) then
  124. set_elements()
  125. get_spells()
  126. windower.send_command('input /ja "Immanence" <me>')
  127. windower.send_command('@wait 1.5;input /ma "'..sp1..'" <t>')
  128. windower.send_command('input /p Opening Schillchain [Magic Burst: '..burst..']')
  129. else
  130. windower.add_to_chat(209,"Oops! Dark Arts isn't active!")
  131. end
  132. else
  133. windower.add_to_chat(209,"Select an element first.")
  134. end
  135. elseif cmd[1]:lower() == "end" then
  136. windower.send_command('input /ja "Immanence" <me>')
  137. windower.send_command('@wait 1.5;input /ma "'..sp2..'" <t>')
  138. windower.send_command('input /p Closing Schillchain [Magic Burst: '..burst..']')
  139. end
  140. end)
  141.  
  142. function set_elements()
  143. if element == 'trans' then
  144. skillchain = "Transfixion"
  145. burst = "Water"
  146. ele1 = "Earth"
  147. ele2 = "Water"
  148. elseif element == 'comp' then
  149. skillchain = "Compression"
  150. burst = "Darkness"
  151. ele1 = "Ice"
  152. ele2 = "Darkness"
  153. elseif element == 'comp1' then
  154. skillchain = "Compression"
  155. burst = "Darkness"
  156. ele1 = "Light"
  157. ele2 = "Darkness"
  158. elseif element == 'liqu' then
  159. skillchain = "Liquefication"
  160. burst = "Fire"
  161. ele1 = "Lightning"
  162. ele2 = "Fire"
  163. elseif element == 'liqu1' then
  164. skillchain = "Liquefication"
  165. burst = "Fire"
  166. ele1 = "Earth"
  167. ele2 = "Fire"
  168. elseif element == 'scis' then
  169. skillchain = "Scission"
  170. burst = "Earth"
  171. ele1 = "Fire"
  172. ele2 = "Earth"
  173. elseif element == 'scis1' then
  174. skillchain = "Scission"
  175. burst = "Earth"
  176. ele1 = "Wind"
  177. ele2 = "Earth"
  178. elseif element == 'reve' then
  179. skillchain = "Reverberation"
  180. burst = "Water"
  181. ele1 = "Earth"
  182. ele2 = "Water"
  183. elseif element == 'reve1' then
  184. skillchain = "Reverberation"
  185. burst = "Water"
  186. ele1 = "Light"
  187. ele2 = "Water"
  188. elseif element == 'deto' then
  189. skillchain = "Detonation"
  190. burst = "Wind"
  191. ele1 = "Lightning"
  192. ele2 = "Wind"
  193. elseif element == 'deto1' then
  194. skillchain = "Detonation"
  195. burst = "Wind"
  196. ele1 = "Earth"
  197. ele2 = "Wind"
  198. elseif element == 'deto2' then
  199. burst = "Wind"
  200. ele1 = "Darkness"
  201. ele2 = "Wind"
  202. elseif element == 'impa' then
  203. skillchain = "Impaction"
  204. burst = "Lightning"
  205. ele1 = "Ice"
  206. ele2 = "Lightning"
  207. elseif element == 'impa1' then
  208. skillchain = "Impaction"
  209. burst = "Lightning"
  210. ele1 = "Water"
  211. ele2 = "Lightning"
  212. elseif element == 'indu' then
  213. skillchain = "Induration"
  214. burst = "Ice"
  215. ele1 = "Water"
  216. ele2 = "Ice"
  217. elseif element == 'grav' then
  218. skillchain = "Gravitation"
  219. burst = "Earth/Darkness"
  220. ele1 = "Wind"
  221. ele2 = "Darkness"
  222. elseif element == 'dist' then
  223. skillchain = "Distortion"
  224. burst = "Water/Blizzard"
  225. ele1 = "Light"
  226. ele2 = "Earth"
  227. elseif element == 'fusi' then
  228. skillchain = "Fusion"
  229. burst = "Fire/Light"
  230. ele1 = "Fire"
  231. ele2 = "Lightning"
  232. elseif element == 'frag' then
  233. skillchain = "Fragmentation"
  234. burst = "Wind/Lightning"
  235. ele1 = "Ice"
  236. ele2 = "Water"
  237. end
  238. end
  239.  
  240. function get_spells()
  241. if ele1 == "Darkness" then
  242. sp1 = "Noctohelix"
  243. elseif ele1 == "Light" then
  244. sp1 = "Luminohelix"
  245. elseif ele1 == "Earth" then
  246. sp1 = '"Stone'..tier1..'"'
  247. elseif ele1 == "Water" then
  248. sp1 = '"Water'..tier1..'"'
  249. elseif ele1 == "Wind" then
  250. sp1 = '"Aero'..tier1..'"'
  251. elseif ele1 == "Fire" then
  252. sp1 = '"Fire'..tier1..'"'
  253. elseif ele1 == "Ice" then
  254. sp1 = '"Blizzard'..tier1..'"'
  255. elseif ele1 == "Lightning" then
  256. sp1 = '"Thunder'..tier1..'"'
  257. end
  258. if ele2 == "Darkness" then
  259. sp2 = "Noctohelix"
  260. elseif ele2 == "Light" then
  261. sp2 = "Luminohelix"
  262. elseif ele2 == "Earth" then
  263. sp2 = '"Stone'..tier2..'"'
  264. elseif ele2 == "Water" then
  265. sp2 = '"Water'..tier2..'"'
  266. elseif ele2 == "Wind" then
  267. sp2 = '"Aero'..tier2..'"'
  268. elseif ele2 == "Fire" then
  269. sp2 = '"Fire'..tier2..'"'
  270. elseif ele2 == "Ice" then
  271. sp2 = '"Blizzard'..tier2..'"'
  272. elseif ele2 == "Lightning" then
  273. sp2 = '"Thunder'..tier2..'"'
  274. end
  275. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement