detlef11

PhilemonBRD

Jun 25th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.55 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job. Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. --[[
  6. Custom commands:
  7.  
  8. ExtraSongsMode may take one of three values: None, Dummy, FullLength
  9.  
  10. You can set these via the standard 'set' and 'cycle' self-commands. EG:
  11. gs c cycle ExtraSongsMode
  12. gs c set ExtraSongsMode Dummy
  13.  
  14. The Dummy state will equip the bonus song instrument and ensure non-duration gear is equipped.
  15. The FullLength state will simply equip the bonus song instrument on top of standard gear.
  16.  
  17.  
  18. Simple macro to cast a dummy Daurdabla song:
  19. /console gs c set ExtraSongsMode Dummy
  20. /ma "Shining Fantasia" <me>
  21.  
  22. To use a Terpander rather than Daurdabla, set the info.ExtraSongInstrument variable to
  23. 'Terpander', and info.ExtraSongs to 1.
  24. --]]
  25.  
  26. -- Initialization function for this job file.
  27. function get_sets()
  28. mote_include_version = 2
  29.  
  30. -- Load and initialize the include file.
  31. include('Mote-Include.lua')
  32. end
  33.  
  34.  
  35. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  36. function job_setup()
  37. state.ExtraSongsMode = M{['description']='Extra Songs', 'None', 'Dummy', 'FullLength'}
  38.  
  39. state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
  40.  
  41. -- For tracking current recast timers via the Timers plugin.
  42. custom_timers = {}
  43. end
  44.  
  45. -------------------------------------------------------------------------------------------------------------------
  46. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  47. -------------------------------------------------------------------------------------------------------------------
  48.  
  49. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  50. function user_setup()
  51. state.OffenseMode:options('None', 'Normal')
  52. state.CastingMode:options('Normal', 'Resistant')
  53. state.IdleMode:options('Normal', 'PDT')
  54.  
  55. brd_daggers = S{'Izhiikoh', 'Vanir Knife', 'Atoyac', 'Aphotic Kukri', 'Sabebus'}
  56. pick_tp_weapon()
  57.  
  58. -- Adjust this if using the Terpander (new +song instrument)
  59. info.ExtraSongInstrument = 'Daurdabla'
  60. -- How many extra songs we can keep from Daurdabla/Terpander
  61. info.ExtraSongs = 2
  62.  
  63. -- Set this to false if you don't want to use custom timers.
  64. state.UseCustomTimers = M(true, 'Use Custom Timers')
  65.  
  66. -- Additional local binds
  67. send_command('bind ^` gs c cycle ExtraSongsMode')
  68. send_command('bind !` input /ma "Chocobo Mazurka" <me>')
  69.  
  70. select_default_macro_book()
  71. end
  72.  
  73.  
  74. -- Called when this job file is unloaded (eg: job change)
  75. function user_unload()
  76. send_command('unbind ^`')
  77. send_command('unbind !`')
  78. end
  79.  
  80.  
  81. -- Define sets and vars used by this job file.
  82. function init_gear_sets()
  83. --------------------------------------
  84. -- Start defining the sets
  85. --------------------------------------
  86.  
  87. telchine_feet_fc = { name="Telchine Pigaches", augments={'"Fast Cast"+5',}}
  88.  
  89. chironic_head_refresh = { name="Chironic Hat", augments={'Magic dmg. taken -1%','STR+10','"Refresh"+2','Accuracy+15 Attack+15',}}
  90. chironic_hands_refresh = { name="Chironic Gloves", augments={'STR+3','Accuracy+5 Attack+5','"Refresh"+1','Mag. Acc.+19 "Mag.Atk.Bns."+19',}}
  91.  
  92. -- Precast Sets
  93.  
  94. -- Fast cast sets for spells
  95. sets.precast.FC = {main="Sucellus",ammo="Impatiens",
  96. head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchntr. Earring +1",ear2="Loquac. Earring",
  97. body="Inyanga Jubbah +1",hands="Gende. Gages +1",ring1="Weather. Ring",ring2="Prolix Ring",
  98. back="Intarabus's Cape",waist="Witful Belt",legs="Lengo Pants",feet=telchine_feet_fc}
  99.  
  100. sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris",back="Pahtli Cape",waist="Acerbic Sash",legs="Doyen Pants",feet="Vanya Clogs"})
  101.  
  102. sets.precast.FC.Stoneskin = set_combine(sets.precast.FC, {head="Umuthi Hat",waist="Siegel Sash"})
  103.  
  104. sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  105.  
  106. sets.precast.FC.BardSong = {main="Kali",range="Marsyas",
  107. head="Fili Calot +1",neck="Orunmila's Torque",ear1="Enchntr. Earring +1",ear2="Loquac. Earring",
  108. body="Inyanga Jubbah +1",hands="Gende. Gages +1",ring1="Weather. Ring",ring2="Prolix Ring",
  109. back="Intarabus's Cape",waist="Witful Belt",legs="Gende. Spats +1",feet=telchine_feet_fc}
  110.  
  111. sets.precast.FC.Daurdabla = set_combine(sets.precast.FC.BardSong, {range=info.ExtraSongInstrument})
  112.  
  113.  
  114. -- Precast sets to enhance JAs
  115.  
  116. sets.precast.JA.Nightingale = {feet="Bihu Slippers +1"}
  117. sets.precast.JA.Troubadour = {body="Bihu Jstcorps +1"}
  118. sets.precast.JA['Soul Voice'] = {legs="Bihu Cannions +1"}
  119.  
  120. -- Waltz set (chr and vit)
  121. sets.precast.Waltz = {range="Gjallarhorn",
  122. head="Nahtirah Hat",
  123. body="Gende. Bilaut +1",hands="Buremte Gloves",
  124. back="Kumbira Cape",legs="Gende. Spats +1",feet="Gendewitha Galoshes"}
  125.  
  126.  
  127. -- Weaponskill sets
  128. -- Default set for any weaponskill that isn't any more specifically defined
  129. sets.precast.WS = {range="Gjallarhorn",
  130. head="Nahtirah Hat",neck=gear.ElementalGorget,ear1="Bladeborn Earring",ear2="Steelflash Earring",
  131. body="Bihu Justaucorps",hands="Buremte Gloves",ring1="Rajas Ring",ring2="Petrov Ring",
  132. back="Atheling Mantle",waist="Caudata Belt",legs="Brioso Cannions +1",feet="Gendewitha Galoshes"}
  133.  
  134. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  135. sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS)
  136.  
  137. sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS)
  138.  
  139. sets.precast.WS['Mordant Rime'] = set_combine(sets.precast.WS)
  140.  
  141.  
  142. -- Midcast Sets
  143.  
  144. -- General set for recast times.
  145. sets.midcast.FastRecast = {range="Angel Lyre",
  146. head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchntr. Earring +1",ear2="Loquac. Earring",
  147. body="Inyanga Jubbah +1",hands="Gende. Gages +1",ring2="Weather. Ring",ring2="Prolix Ring",
  148. back="Intarabus's Cape",waist="Ninurta's Sash",legs="Miasmic Pants",feet=telchine_feet_fc}
  149.  
  150. -- Gear to enhance certain classes of songs. No instruments added here since Gjallarhorn is being used.
  151. sets.midcast.Ballad = {legs="Fili Rhingrave +1"}
  152.  
  153. sets.midcast.Etude = {head="Mousai Turban"}
  154. sets.midcast.Madrigal = {head="Fili Calot +1",back="Intarabus's Cape"}
  155. sets.midcast.Minuet = {body="Fili Hongreline +1"}
  156. sets.midcast.Minne = {}
  157. sets.midcast.Paeon = {head="Brioso Roundlet +1"}
  158. sets.midcast.Prelude = {back="Intarabus's Cape"}
  159. sets.midcast.Carol = {head="Fili Calot +1",
  160. body="Fili Hongreline +1",hands="Fili Manchettes +1",
  161. legs="Fili Rhingrave +1",feet="Fili Cothurnes +1"}
  162. sets.midcast["Sentinel's Scherzo"] = {feet="Fili Cothurnes +1"}
  163.  
  164. sets.midcast['Honor March'] = {range="Marsyas",hands="Fili Manchettes +1"}
  165.  
  166. sets.midcast['Victory March'] = {hands="Fili Manchettes +1"}
  167.  
  168. sets.midcast['Advancing March'] = {hands="Fili Manchettes +1"}
  169.  
  170. sets.midcast['Foe Lullaby'] = {main="Carnwenhan",sub="Ammurapi Shield",range="Marsyas",
  171. head="Bihu Roundlet +1",neck="Moonbow Whistle",ear1="Regal Earring",ear2="Digni. Earring",
  172. body="Fili Hongreline +1",hands="Brioso Cuffs +3",ring1="Weather. Ring",ring2="Sangoma Ring",
  173. back="Intarabus's Cape",waist="Luminary Sash",legs="Inyanga Shalwar +1",feet="Brioso Slippers +3"}
  174.  
  175. sets.midcast['Foe Lullaby II'] = {main="Carnwenhan",sub="Ammurapi Shield",range="Marsyas",
  176. head="Bihu Roundlet +1",neck="Moonbow Whistle",ear1="Regal Earring",ear2="Digni. Earring",
  177. body="Fili Hongreline +1",hands="Brioso Cuffs +3",ring1="Weather. Ring",ring2="Sangoma Ring",
  178. back="Intarabus's Cape",waist="Luminary Sash",legs="Inyanga Shalwar +1",feet="Brioso Slippers +3"}
  179.  
  180. sets.midcast['Horde Lullaby'] = {main="Carnwenhan",sub="Ammurapi Shield",range="Marsyas",
  181. head="Bihu Roundlet +1",neck="Moonbow Whistle",ear1="Regal Earring",ear2="Digni. Earring",
  182. body="Fili Hongreline +1",hands="Brioso Cuffs +3",ring1="Weather. Ring",ring2="Sangoma Ring",
  183. back="Intarabus's Cape",waist="Luminary Sash",legs="Inyanga Shalwar +1",feet="Brioso Slippers +3"}
  184.  
  185. sets.midcast['Horde Lullaby II'] = {main="Carnwenhan",sub="Ammurapi Shield",range="Marsyas",
  186. head="Bihu Roundlet +1",neck="Moonbow Whistle",ear1="Regal Earring",ear2="Digni. Earring",
  187. body="Fili Hongreline +1",hands="Brioso Cuffs +3",ring1="Weather. Ring",ring2="Sangoma Ring",
  188. back="Intarabus's Cape",waist="Luminary Sash",legs="Inyanga Shalwar +1",feet="Brioso Slippers +3"}
  189.  
  190. sets.midcast['Magic Finale'] = {main="Carnwenhan",sub="Ammurapi Shield",range="Marsyas",
  191. head="Bihu Roundlet +1",neck="Incanter's Torque",ear1="Regal Earring",ear2="Digni. Earring",
  192. body="Fili Hongreline +1",hands="Bewegt Gloves",ring1="Weather. Ring",ring2="Sangoma Ring",
  193. back="Intarabus's Cape",waist="Luminary Sash",legs="Fili Rhingrave +1",feet="Kandza Crackows"}
  194.  
  195. sets.midcast['Fowl Aubade'] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  196. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  197. sets.midcast['Herb Pastoral'] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  198. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  199. sets.midcast['Shining Fantasia'] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  200. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  201. sets.midcast["Scop's Operetta"] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  202. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  203. sets.midcast["Puppet's Operetta"] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  204. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  205. sets.midcast['Gold Capriccio'] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  206. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  207. sets.midcast['Warding Round'] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  208. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  209. sets.midcast['Goblin Gavotte'] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  210. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  211. sets.midcast["Goddess's Hymnus"] = {main="Terra's Staff",range=info.ExtraSongInstrument,head="Nahtirah Hat",neck="Loricate Torque +1",
  212. body="Emet Harness +1",hands="Bihu Cuffs +1",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  213. sets.midcast.Mazurka = {range=info.ExtraSongInstrument}
  214.  
  215. -- For song buffs (duration and AF3 set bonus)
  216. sets.midcast.SongEffect = {main="Carnwenhan",sub="Genmei Shield",range="Gjallarhorn",
  217. head="Fili Calot +1",neck="Moonbow Whistle",ear1="Enchntr. Earring +1",ear2="Loquac. Earring",
  218. body="Fili Hongreline +1",hands="Fili Manchettes +1",ring1="Defending Ring",ring2="Dark Ring",
  219. back="Harmony Cape",waist="Slipor Sash",legs="Inyanga Shalwar +1",feet="Brioso Slippers +3"}
  220.  
  221. -- For song debuffs (duration primary, accuracy secondary)
  222. sets.midcast.SongDebuff = {main="Carnwenhan",sub="Ammurapi Shield",range="Gjallarhorn",
  223. head="Bihu Roundlet +1",neck="Moonbow Whistle",ear1="Regal Earring",ear2="Digni. Earring",
  224. body="Fili Hongreline +1",hands="Brioso Cuffs +3",ring1="Carb. Ring +1",ring2="Sangoma Ring",
  225. back="Intarabus's Cape",waist="Luminary Sash",legs="Fili Rhingrave +1",feet="Brioso Slippers +3"}
  226.  
  227. -- For song debuffs (accuracy primary, duration secondary)
  228. sets.midcast.ResistantSongDebuff = {main="Carnwenhan",sub="Ammurapi Shield",range="Gjallarhorn",
  229. head="Brioso Roundlet +1",neck="Canto Necklace +1",ear1="Regal Earring",ear2="Digni. Earring",
  230. body="Brioso Just. +1",hands="Brioso Cuffs +3",ring1="Carb. Ring +1",ring2="Sangoma Ring",
  231. back="Intarabus's Cape",waist="Luminary Sash",legs="Fili Rhingrave +1",feet="Brioso Slippers +3"}
  232.  
  233. -- Song-specific recast reduction
  234. sets.midcast.SongRecast = {ear2="Loquacious Earring",
  235. hands="Bewegt Gloves",ring1="Prolix Ring",
  236. back="Harmony Cape",waist="Corvax Sash"}
  237.  
  238. --sets.midcast.Daurdabla = set_combine(sets.midcast.FastRecast, sets.midcast.SongRecast, {range=info.ExtraSongInstrument})
  239.  
  240. -- Cast spell with normal gear, except using Daurdabla instead
  241. sets.midcast.Daurdabla = {range=info.ExtraSongInstrument}
  242.  
  243. -- Dummy song with Daurdabla; minimize duration to make it easy to overwrite.
  244. sets.midcast.DaurdablaDummy = {main="Terra's Staff",range=info.ExtraSongInstrument,
  245. head="Nahtirah Hat",neck="Loricate Torque +1",ear1="Enchntr. Earring +1",ear2="Digni. Earring",
  246. body="Emet Harness +1",hands="Bihu Cuffs +1",ring1="Defending Ring",ring2="Prolix Ring",
  247. back="Intarabus's Cape",waist="Goading Belt",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  248.  
  249. -- Other general spells and classes.
  250. sets.midcast.Cure = {main="Serenity",sub="Oneiros Grip",
  251. head="Vanya Hood",neck="Incanter's Torque",ear1="Enchntr. Earring +1",ear2="Loquac. Earring",
  252. body="Heka's Kalisiris",hands="Bokwus Gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",
  253. back="Pahtli Cape",waist="Luminary Sash",legs="Nabu's Shalwar",feet="Rubeus Boots"}
  254.  
  255. sets.midcast.Curaga = sets.midcast.Cure
  256.  
  257. sets.midcast.Stoneskin = {main="Terra's Staff",range="Gjallarhorn",
  258. head="Bihu Roundlet +1",neck="Stone Gorget",ear1="Enchntr. Earring +1",ear2="Loquac. Earring",
  259. body="Emet Harness +1",hands="Bihu Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
  260. back="Umbra Cape","waist=Siegel Sash",legs="Shedir Seraweels",feet="Bihu Slippers +1"}
  261.  
  262. sets.midcast.Cursna = {
  263. neck="Malison Medallion",
  264. hands="Hieros Mittens",ring1="Ephedra Ring",
  265. feet="Gende. Galosh. +1"}
  266.  
  267.  
  268. -- Sets to return to when not performing an action.
  269.  
  270. -- Resting sets
  271. sets.resting = {main=gear.Staff.HMP,
  272. body="Gende. Bilaut +1",
  273. legs="Nares Trews",feet="Chelona Boots +1"}
  274.  
  275.  
  276. -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  277. sets.idle = {main="Carnwenhan", sub="Genmei Shield",range="Oneiros Harp",
  278. head=chironic_head_refresh,neck="Loricate Torque +1",ear1="Genmei Earring",ear2="Etiolation Earring",
  279. body="Gende. Bilaut +1",hands=chironic_hands_refresh,ring1="Defending Ring",ring2="Dark Ring",
  280. back="Umbra Cape",waist="Fucho-no-obi",legs="Assid. Pants +1",feet="Fili Cothurnes +1"}
  281.  
  282. sets.idle.PDT = {main="Carnwenhan", sub="Genmei Shield",range="Oneiros Harp",
  283. head="Bihu Roundlet +1",neck="Loricate Torque +1",ear1="Genmei Earring",ear2="Etiolation Earring",
  284. body="Emet Harness +1",hands="Bihu Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
  285. back="Umbra Cape",waist="Slipor Sash",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  286.  
  287. sets.idle.Town = {main="Carnwenhan", sub="Genmei Shield",range="Marsyas",
  288. head=chironic_head_refresh,neck="Loricate Torque +1",ear1="Genmei Earring",ear2="Etiolation Earring",
  289. body="Gende. Bilaut +1",hands=chironic_hands_refresh,ring1="Defending Ring",ring2="Dark Ring",
  290. back="Umbra Cape",waist="Fucho-no-obi",legs="Assid. Pants +1",feet="Fili Cothurnes +1"}
  291.  
  292. sets.idle.Weak = {main="Terra's Staff",range="Oneiros Harp",
  293. head="Bihu Roundlet +1",neck="Loricate Torque +1",ear1="Genmei Earring",ear2="Etiolation Earring",
  294. body="Emet Harness +1",hands="Bihu Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
  295. back="Umbra Cape",waist="Slipor Sash",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  296.  
  297.  
  298. -- Defense sets
  299.  
  300. sets.defense.PDT = {main=gear.Staff.PDT,sub="Mephitis Grip",
  301. head="Bihu Roundlet +1",neck="Loricate Torque +1",ear1="Genmei Earring",ear2="Etiolation Earring",
  302. body="Emet Harness +1",hands="Bihu Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
  303. back="Umbra Cape",waist="Flume Belt",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  304.  
  305. sets.defense.MDT = {main=gear.Staff.PDT,sub="Mephitis Grip",
  306. head="Bihu Roundlet +1",neck="Loricate Torque +1",ear1="Genmei Earring",ear2="Etiolation Earring",
  307. body="Emet Harness +1",hands="Bihu Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
  308. back="Umbra Cape",waist="Flume Belt",legs="Bihu Cannions +1",feet="Bihu Slippers +1"}
  309.  
  310. sets.Kiting = {feet="Fili Cothurnes +1"}
  311.  
  312. sets.latent_refresh = {waist="Fucho-no-obi"}
  313.  
  314. -- Engaged sets
  315.  
  316. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  317. -- sets if more refined versions aren't defined.
  318. -- If you create a set with both offense and defense modes, the offense mode should be first.
  319. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  320.  
  321. -- Basic set for if no TP weapon is defined.
  322. sets.engaged = {range="Angel Lyre",
  323. head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  324. body="Emet Harness +1",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
  325. back="Atheling Mantle",waist="Goading Belt",legs="Brioso Cannions +1",feet="Gendewitha Galoshes"}
  326.  
  327. -- Sets with weapons defined.
  328. sets.engaged.Dagger = {range="Angel Lyre",
  329. head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  330. body="Emet Harness +1",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
  331. back="Atheling Mantle",waist="Goading Belt",legs="Brioso Cannions +1",feet="Gendewitha Galoshes"}
  332.  
  333. -- Set if dual-wielding
  334. sets.engaged.DW = {range="Angel Lyre",
  335. head="Nahtirah Hat",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
  336. body="Emet Harness +1",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
  337. back="Atheling Mantle",waist="Goading Belt",legs="Brioso Cannions +1",feet="Gendewitha Galoshes"}
  338. end
  339.  
  340.  
  341. -------------------------------------------------------------------------------------------------------------------
  342. -- Job-specific hooks for standard casting events.
  343. -------------------------------------------------------------------------------------------------------------------
  344.  
  345. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  346. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  347. function job_precast(spell, action, spellMap, eventArgs)
  348. if spell.type == 'BardSong' then
  349. -- Auto-Pianissimo
  350. if ((spell.target.type == 'PLAYER' and not spell.target.charmed) or (spell.target.type == 'NPC' and spell.target.in_party)) and
  351. not state.Buff['Pianissimo'] then
  352.  
  353. local spell_recasts = windower.ffxi.get_spell_recasts()
  354. if spell_recasts[spell.recast_id] < 2 then
  355. send_command('@input /ja "Pianissimo" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
  356. eventArgs.cancel = true
  357. return
  358. end
  359. end
  360. end
  361. end
  362.  
  363. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  364. function job_midcast(spell, action, spellMap, eventArgs)
  365. if spell.action_type == 'Magic' then
  366. if spell.type == 'BardSong' then
  367. -- layer general gear on first, then let default handler add song-specific gear.
  368. local generalClass = get_song_class(spell)
  369. if generalClass and sets.midcast[generalClass] then
  370. equip(sets.midcast[generalClass])
  371. end
  372. end
  373. end
  374. end
  375.  
  376. function job_post_midcast(spell, action, spellMap, eventArgs)
  377. if spell.type == 'BardSong' then
  378. if state.ExtraSongsMode.value == 'FullLength' then
  379. equip(sets.midcast.Daurdabla)
  380. end
  381.  
  382. state.ExtraSongsMode:reset()
  383. end
  384. end
  385.  
  386. -- Set eventArgs.handled to true if we don't want automatic gear equipping to be done.
  387. function job_aftercast(spell, action, spellMap, eventArgs)
  388. if spell.type == 'BardSong' and not spell.interrupted then
  389. if spell.target and spell.target.type == 'SELF' then
  390. adjust_timers(spell, spellMap)
  391. end
  392. end
  393.  
  394. -- duration addition by bling
  395. print(spell.name)
  396. if S{'Foe Lullaby', 'Foe Lullaby II', "Horde Lullaby", "Horde Lullaby II"}:contains(spell.name) then
  397. local troub, marco, clarion, gearduration = 1, 0, 0, 0
  398. -- PHIL, EDIT THESE NUMBERSlocal
  399. local marco_jp = 20
  400. local clarion_jp = 20
  401. local lullaby_jp = 20
  402. local jp_total = 2100
  403. -- STOP IT PHIL
  404. local G = {}
  405. G['Gjallarhorn'] = 40
  406. G['Daurdabla'] = 30
  407. G['Marsyas'] = 50
  408. G['Carnwenhan'] = 50
  409. G['Legato Dagger'] = 5
  410. G['Kali Dagger'] = 5
  411. G['Moonbow Whistle'] = 20
  412. G['Fili Hongreline +1'] = 12
  413. G['Fili Hongreline'] = 11
  414. G['Aoidos\' Matinee'] = 10
  415. G['Inyanga Shalwar +1'] = 15
  416. G['Inyanga Shalwar'] = 12
  417. G['Mdk. Shalwar +1'] = 10
  418. G['Brioso Slippers +1'] = 11
  419. G['Brioso Slippers +2'] = 13
  420. G['Brioso Slippers +3'] = 15
  421. G['Brioso Slippers'] = 10
  422. G['Brioso Cuffs +1'] = 10
  423. G['Brioso Cuffs +2'] = 10
  424. G['Brioso Cuffs +3'] = 20
  425. -- G['Brioso Cuffs +1'] = 10
  426. -- You can copy this line and uncomment it to add an item and the percent enhancement it gives to song duration
  427. -- I edited bling's format a bit here to make this easier to read
  428. local t = {"main", "sub", "range", "ammo", "head", "neck", "left_ear", "right_ear", "body", "hands", "left_ring", "right_ring", "back", "waist", "legs", "feet"}
  429. for i =1, #t do
  430. if G[player.equipment[t[i]]] then gearduration = gearduration + G[player.equipment[t[i]]] end
  431. end
  432. if jp_total >= 1200 then jp_bonus = 5 else jp_bonus = 0 end
  433. if buffactive['Troubadour'] then troub = 2 else troub = 1 end
  434. if buffactive['Marcato'] then marco = (1*marco_jp) else marco = 0 end
  435. if buffactive['Clarion Call'] then clarion = (2*clarion_jp) else clarion = 0 end
  436. if string.find(spell.name, 'II') then
  437. lul_dur = math.floor(60*(1+gearduration/100+jp_bonus/100)+lullaby_jp+clarion)*troub+marco
  438. else
  439. lul_dur = math.floor(30*(1+gearduration/100+jp_bonus/100)+lullaby_jp+clarion)*troub+marco
  440. end
  441. send_command('send @all input /echo Lullaby will wear off in '..lul_dur..' seconds.')
  442. send_command('wait '..(lul_dur-180)..'; send @all input /echo Lullaby will wear off in 3 minutes.')
  443. send_command('wait '..(lul_dur-150)..'; send @all input /echo Lullaby will wear off in 2.5 minutes.')
  444. send_command('wait '..(lul_dur-120)..'; send @all input /echo Lullaby will wear off in 2 minutes.')
  445. send_command('wait '..(lul_dur-90)..'; send @all input /echo Lullaby will wear off in 1.5 minutes.')
  446. send_command('wait '..(lul_dur-60)..'; send @all input /echo Lullaby will wear off in 60 seconds.')
  447. send_command('wait '..(lul_dur-30)..'; send @all input /echo Lullaby will wear off in 30 seconds.')
  448. send_command('wait '..(lul_dur-20)..'; send @all input /echo Lullaby will wear off in 20 seconds.')
  449. send_command('wait '..(lul_dur-10)..'; send @all input /echo Lullaby will wear off in 10 seconds.')
  450. send_command('wait '..(lul_dur)..'; send @all input /echo Lullaby is wearing off now.')
  451. end
  452. -- end addition
  453. end
  454.  
  455. -------------------------------------------------------------------------------------------------------------------
  456. -- Job-specific hooks for non-casting events.
  457. -------------------------------------------------------------------------------------------------------------------
  458.  
  459. -- Handle notifications of general user state change.
  460. function job_state_change(stateField, newValue, oldValue)
  461. if stateField == 'Offense Mode' then
  462. if newValue == 'Normal' then
  463. disable('main','sub','ammo')
  464. else
  465. enable('main','sub','ammo')
  466. end
  467. end
  468. end
  469.  
  470. -------------------------------------------------------------------------------------------------------------------
  471. -- User code that supplements standard library decisions.
  472. -------------------------------------------------------------------------------------------------------------------
  473.  
  474. -- Called by the 'update' self-command.
  475. function job_update(cmdParams, eventArgs)
  476. pick_tp_weapon()
  477. end
  478.  
  479.  
  480. -- Modify the default idle set after it was constructed.
  481. function customize_idle_set(idleSet)
  482. if player.mpp < 51 then
  483. idleSet = set_combine(idleSet, sets.latent_refresh)
  484. end
  485.  
  486. return idleSet
  487. end
  488.  
  489.  
  490. -- Function to display the current relevant user state when doing an update.
  491. function display_current_job_state(eventArgs)
  492. display_current_caster_state()
  493. eventArgs.handled = true
  494. end
  495.  
  496. -------------------------------------------------------------------------------------------------------------------
  497. -- Utility functions specific to this job.
  498. -------------------------------------------------------------------------------------------------------------------
  499.  
  500. -- Determine the custom class to use for the given song.
  501. function get_song_class(spell)
  502. -- Can't use spell.targets:contains() because this is being pulled from resources
  503. if set.contains(spell.targets, 'Enemy') then
  504. if state.CastingMode.value == 'Resistant' then
  505. return 'ResistantSongDebuff'
  506. else
  507. return 'SongDebuff'
  508. end
  509. elseif state.ExtraSongsMode.value == 'Dummy' then
  510. return 'DaurdablaDummy'
  511. else
  512. return 'SongEffect'
  513. end
  514. end
  515.  
  516.  
  517. -- Function to create custom buff-remaining timers with the Timers plugin,
  518. -- keeping only the actual valid songs rather than spamming the default
  519. -- buff remaining timers.
  520. function adjust_timers(spell, spellMap)
  521. if state.UseCustomTimers.value == false then
  522. return
  523. end
  524.  
  525. local current_time = os.time()
  526.  
  527. -- custom_timers contains a table of song names, with the os time when they
  528. -- will expire.
  529.  
  530. -- Eliminate songs that have already expired from our local list.
  531. local temp_timer_list = {}
  532. for song_name,expires in pairs(custom_timers) do
  533. if expires < current_time then
  534. temp_timer_list[song_name] = true
  535. end
  536. end
  537. for song_name,expires in pairs(temp_timer_list) do
  538. custom_timers[song_name] = nil
  539. end
  540.  
  541. local dur = calculate_duration(spell.name, spellMap)
  542. if custom_timers[spell.name] then
  543. -- Songs always overwrite themselves now, unless the new song has
  544. -- less duration than the old one (ie: old one was NT version, new
  545. -- one has less duration than what's remaining).
  546.  
  547. -- If new song will outlast the one in our list, replace it.
  548. if custom_timers[spell.name] < (current_time + dur) then
  549. send_command('timers delete "'..spell.name..'"')
  550. custom_timers[spell.name] = current_time + dur
  551. send_command('timers create "'..spell.name..'" '..dur..' down')
  552. end
  553. else
  554. -- Figure out how many songs we can maintain.
  555. local maxsongs = 2
  556. if player.equipment.range == info.ExtraSongInstrument then
  557. maxsongs = maxsongs + info.ExtraSongs
  558. end
  559. if buffactive['Clarion Call'] then
  560. maxsongs = maxsongs + 1
  561. end
  562. -- If we have more songs active than is currently apparent, we can still overwrite
  563. -- them while they're active, even if not using appropriate gear bonuses (ie: Daur).
  564. if maxsongs < table.length(custom_timers) then
  565. maxsongs = table.length(custom_timers)
  566. end
  567.  
  568. -- Create or update new song timers.
  569. if table.length(custom_timers) < maxsongs then
  570. custom_timers[spell.name] = current_time + dur
  571. send_command('timers create "'..spell.name..'" '..dur..' down')
  572. else
  573. local rep,repsong
  574. for song_name,expires in pairs(custom_timers) do
  575. if current_time + dur > expires then
  576. if not rep or rep > expires then
  577. rep = expires
  578. repsong = song_name
  579. end
  580. end
  581. end
  582. if repsong then
  583. custom_timers[repsong] = nil
  584. send_command('timers delete "'..repsong..'"')
  585. custom_timers[spell.name] = current_time + dur
  586. send_command('timers create "'..spell.name..'" '..dur..' down')
  587. end
  588. end
  589. end
  590. end
  591.  
  592. -- Function to calculate the duration of a song based on the equipment used to cast it.
  593. -- Called from adjust_timers(), which is only called on aftercast().
  594. function calculate_duration(spellName, spellMap)
  595. local mult = 1
  596. if player.equipment.range == 'Daurdabla' then mult = mult + 0.3 end -- change to 0.25 with 90 Daur
  597. if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 end -- change to 0.3 with 95 Gjall
  598. if player.equipment.range == "Marsyas" then mult = mult + 0.5 end --
  599.  
  600. if player.equipment.main == "Carnwenhan" then mult = mult + 0.5 end -- 0.1 for 75, 0.4 for 95, 0.5 for 99/119
  601. if player.equipment.main == "Legato Dagger" then mult = mult + 0.05 end
  602. if player.equipment.sub == "Legato Dagger" then mult = mult + 0.05 end
  603. if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
  604. if player.equipment.body == "Fili Hongreline +1" then mult = mult + 0.12 end
  605. if player.equipment.legs == "Mdk. Shalwar +1" then mult = mult + 0.1 end
  606. if player.equipment.legs == "Inyanga Shalwar" then mult = mult + 0.12 end
  607. if player.equipment.legs == "Inyanga Shalwar +1" then mult = mult + 0.15 end
  608. if player.equipment.feet == "Brioso Slippers" then mult = mult + 0.1 end
  609. if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
  610. if player.equipment.feet == "Brioso Slippers +3" then mult = mult + 0.13 end
  611. if player.equipment.feet == "Brioso Slippers +3" then mult = mult + 0.15 end
  612.  
  613. if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet" then mult = mult + 0.1 end
  614. if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +1" then mult = mult + 0.1 end
  615. if spellMap == 'Madrigal' and player.equipment.head == "Fili Calot +1" then mult = mult + 0.1 end
  616. if spellMap == 'Madrigal' and player.equipment.back == "Intarabus's Cape" then mult = mult + 0.1 end
  617. if spellMap == 'Minuet' and player.equipment.body == "Fili Hongreline +1" then mult = mult + 0.1 end
  618. if spellMap == 'March' and player.equipment.hands == 'Fili Manchettes +1' then mult = mult + 0.1 end
  619. if spellMap == 'Ballad' and player.equipment.legs == "Fili Rhingrave +1" then mult = mult + 0.1 end
  620. if spellMap == 'Prelude' and player.equipment.back == "Intarabus's Cape" then mult = mult + 0.1 end
  621. if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Fili Cothurnes +1" then mult = mult + 0.1 end
  622.  
  623. if buffactive.Troubadour then
  624. mult = mult*2
  625. end
  626. if spellName == "Sentinel's Scherzo" then
  627. if buffactive['Soul Voice'] then
  628. mult = mult*2
  629. elseif buffactive['Marcato'] then
  630. mult = mult*1.5
  631. end
  632. end
  633.  
  634. local totalDuration = math.floor(mult*120)
  635.  
  636. return totalDuration
  637. end
  638.  
  639.  
  640. -- Examine equipment to determine what our current TP weapon is.
  641. function pick_tp_weapon()
  642. if brd_daggers:contains(player.equipment.main) then
  643. state.CombatWeapon:set('Dagger')
  644.  
  645. if S{'NIN','DNC'}:contains(player.sub_job) and brd_daggers:contains(player.equipment.sub) then
  646. state.CombatForm:set('DW')
  647. else
  648. state.CombatForm:reset()
  649. end
  650. else
  651. state.CombatWeapon:reset()
  652. state.CombatForm:reset()
  653. end
  654. end
  655.  
  656. -- Function to reset timers.
  657. function reset_timers()
  658. for i,v in pairs(custom_timers) do
  659. send_command('timers delete "'..i..'"')
  660. end
  661. custom_timers = {}
  662. end
  663.  
  664.  
  665. -- Select default macro book on initial load or subjob change.
  666. function select_default_macro_book()
  667. set_macro_page(1, 1)
  668. end
  669.  
  670.  
  671. windower.raw_register_event('zone change',reset_timers)
  672. windower.raw_register_event('logout',reset_timers)
Advertisement
Add Comment
Please, Sign In to add comment