Advertisement
Guest User

bst.lua.seal

a guest
Jun 16th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.19 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Initialization function that defines sets and variables to be used.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
  6.  
  7. -- Initialization function for this job file.
  8. function get_sets()
  9. -- Load and initialize the include file.
  10. include('Mote-Include.lua')
  11. end
  12.  
  13.  
  14. -- Setup vars that are user-independent.
  15. function job_setu
  16.  
  17. -- Var to track the current pet mode.
  18. state.PetMode = 'Melee'
  19. update_pet_mode()
  20. end
  21.  
  22.  
  23. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  24. function user_setup()
  25. -- Options: Override default values
  26. options.OffenseModes = {'Normal', 'Acc'}
  27. options.DefenseModes = {'Normal', 'DT'}
  28. options.WeaponskillModes = {'Normal', 'Att', 'Mod'}
  29. options.IdleModes = {'Normal'}
  30. options.RestingModes = {'Normal'}
  31. options.PhysicalDefenseModes = {'PDT', 'Evasion'}
  32. options.MagicalDefenseModes = {'MDT'}
  33.  
  34. state.Defense.PhysicalMode = 'PDT'
  35.  
  36.  
  37. -- Called when this job file is unloaded (eg: job change)
  38. function file_unload()
  39. if binds_on_unload then
  40. binds_on_unload()
  41. end
  42. end
  43.  
  44.  
  45. -- Define sets used by this job file.
  46. function init_gear_sets()
  47.  
  48. -- Precast Sets
  49.  
  50. -- Fast cast sets for spells
  51. sets.precast.FC = {head="Totemic Helm",hands="Ankusa Gloves",legs="Ferine Quijotes +2",feet="Ankusa Gaiters"}
  52.  
  53.  
  54. -- Precast sets to enhance JAs
  55. sets.precast.JA['Call Beast'] = {body="Mirke Wardecors",feet="Ankusa Gloves"}
  56.  
  57. sets.precast.JA['Tame'] = {head="Totemic Helm",body="Kirin's Osode",hands="Espial Bracers",
  58. legs="Espial Hose",feet="Espial Socks"}
  59.  
  60. sets.precast.JA['Reward'] = {head="Bison Warbonnet", Ear1="Star Earring",Ear2="Star Earring",
  61. body="Kirin's Osode",hands="Ogre Gloves +1",ring1="Star Ring",ring2="Star Ring",
  62. waist="Crudelis Belt",legs="Monster Trousers +2",feet="Ankusa Gaiters"}
  63.  
  64. sets.precast.JA['Spur'] = {feet="Ferine Ocreae +1"}
  65.  
  66. sets.precast.JA['Charm'] = {main="Eminent Axe",
  67. head="Totemic Helm",neck="Ferine Necklace",Ear1="Melody Earring +1",Ear2="Melody Earring +1",
  68. body="Monster Jackcoat",hands="Ankusa Gloves",Ring1="Angel's Ring",Ring2="Allure Ring",
  69. back="Ferine Mantle",waist="Monster Belt",legs="Ferine Quijotes +2",feet="Ankusa Gaiters"}
  70.  
  71.  
  72.  
  73.  
  74. -- Waltz set (chr and vit)
  75. sets.precast.Waltz = {
  76. head="Totemic Helm",neck="Ferine Necklace",Ear1="Melody Earring +1",Ear2="Melody Earring +1",
  77. body="Monster Jackcoat",hands="Ankusa Gloves",Ring1="Angel's Ring",Ring2="Allure Ring",
  78. back="Ferine Mantle",waist="Monster Belt",legs="Ferine Quijotes +2",feet="Ankusa Gaiters"}
  79.  
  80. -- Don't need any special gear for Healing Waltz.
  81. sets.precast.Waltz['Healing Waltz'] = {}
  82.  
  83.  
  84. -- Weaponskill sets
  85. -- Default set for any weaponskill that isn't any more specifically defined
  86. sets.precast.WS = {
  87. head="Whirlpool Mask",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  88. body="Manibozho Jerkin",hands="Otronif Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
  89. back="Pantin Cape",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Manibozho Boots"}
  90.  
  91. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  92. sets.precast.WS['Stringing Pummel'] = set_combine(sets.precast.WS, {neck="Rancor Collar",ear1="Brutal Earring",ear2="Moonshade Earring",
  93. ring1="Spiral Ring",waist="Soil Belt"})
  94. sets.precast.WS['Stringing Pummel'].Mod = set_combine(sets.precast.WS['Stringing Pummel'], {legs="Nahtirah Trousers"})
  95.  
  96. sets.precast.WS['Victory Smite'] = set_combine(sets.precast.WS, {neck="Rancor Collar",ear1="Brutal Earring",ear2="Moonshade Earring",
  97. waist="Thunder Belt"})
  98.  
  99. sets.precast.WS['Shijin Spiral'] = set_combine(sets.precast.WS, {neck="Light Gorget",waist="Light Belt"})
  100.  
  101.  
  102. -- Midcast Sets
  103.  
  104.  
  105. sets.midcast.Pet.WeaponSkill = {feet="Ferine Ocreae +2"}
  106.  
  107.  
  108.  
  109. -- Sets to return to when not performing an action.
  110.  
  111. -- Resting sets
  112. sets.resting = {body="Kirin's Osode",neck="Wiglen Gorget",
  113. ring1="Sheltered Ring",ring2="Paguroidea Ring"}
  114.  
  115.  
  116. -- Idle sets
  117.  
  118. sets.idle = {range="Eminent Animator",
  119. head="Pitre Taj",neck="Wiglen Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  120. body="Foire Tobe",hands="Regimen Mittens",ring1="Sheltered Ring",ring2="Paguroidea Ring",
  121. back="Shadow Mantle",waist="Hurch'lan Sash",legs="Foire Churidars",feet="Hermes' Sandals"}
  122.  
  123. sets.idle.Town = set_combine(sets.idle, {main="Oatixur"})
  124.  
  125. -- Set for idle while pet is out (eg: pet regen gear)
  126. sets.idle.Pet = sets.idle
  127.  
  128. -- Idle sets to wear while pet is engaged
  129. sets.idle.Pet.Engaged = {
  130. head="Totemic Helm",neck="Ferine Necklace",
  131. hands="Ankusa Gloves",Ring1="Angel's Ring",
  132. back="Ferine Mantle",waist="Moepapa Stone",legs="Ferine Quijotes +2",feet="Ankusa Gaiters"}
  133.  
  134.  
  135. -- Defense sets
  136.  
  137.  
  138. sets.defense.PDT = {
  139. head="Totemic Helm",neck="Twilight Torque",
  140. hands="Ankusa Gloves",Ring1="Jelly Ring",Ring2="Paguroidea Ring",
  141. back="Atheling Mantle",waist="Twilight Belt",legs="Ferine Quijotes +2",feet="Totemic Gaiters"}
  142.  
  143. sets.defense.MDT = {
  144. }
  145.  
  146. sets.Kiting = {}
  147.  
  148. -- Engaged sets
  149.  
  150. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  151. -- sets if more refined versions aren't defined.
  152. -- If you create a set with both offense and defense modes, the offense mode should be first.
  153. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  154.  
  155. -- Normal melee group
  156. sets.engaged = {
  157. head="Whirlpool Mask",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  158. body="Thaumas Coat",hands="Otronif Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
  159. back="Pantin Cape",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Otronif Boots +1"}
  160. sets.engaged.Acc = {
  161. head="Whirlpool Mask",neck="Ej Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  162. body="Thaumas Coat",hands="Otronif Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
  163. back="Pantin Cape",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Otronif Boots +1"}
  164. sets.engaged.DT = {
  165. head="Whirlpool Mask",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  166. body="Otronif Harness +1",hands="Regimen Mittens",ring1="Defending Ring",ring2="Epona's Ring",
  167. back="Iximulew Cape",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Otronif Boots +1"}
  168. sets.engaged.Acc.DT = {
  169. head="Whirlpool Mask",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  170. body="Otronif Harness +1",hands="Regimen Mittens",ring1="Defending Ring",ring2="Beeline Ring",
  171. back="Iximulew Cape",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Otronif Boots +1"}
  172. end
  173.  
  174.  
  175. -------------------------------------------------------------------------------------------------------------------
  176. -- Job-specific hooks that are called to process player actions at specific points in time.
  177. -------------------------------------------------------------------------------------------------------------------
  178.  
  179. -- Called when player is about to perform an action
  180. function job_precast(spell, action, spellMap, eventArgs)
  181. if spell.type == 'Waltz' then
  182. refine_waltz(spell, action, spellMap, eventArgs)
  183. end
  184. end
  185.  
  186. -- Called when pet is about to perform an action
  187. function job_pet_midcast(spell, action, spellMap, eventArgs)
  188. if petWeaponskills:contains(spell.english) then
  189. classes.CustomClass = "Weaponskill"
  190. end
  191. end
  192.  
  193.  
  194. -------------------------------------------------------------------------------------------------------------------
  195. -- General hooks for other game events.
  196. -------------------------------------------------------------------------------------------------------------------
  197.  
  198. -- Called when a player gains or loses a buff.
  199. -- buff == buff gained or lost
  200. -- gain == true if the buff was gained, false if it was lost.
  201. function job_buff_change(buff, gain)
  202. if buff == 'Wind Maneuver' then
  203. handle_equipping_gear(player.status)
  204. end
  205. end
  206.  
  207. -- Called when a player gains or loses a pet.
  208. -- pet == pet gained or lost
  209. -- gain == true if the pet was gained, false if it was lost.
  210. function job_pet_change(pet, gain)
  211. update_pet_mode()
  212. end
  213.  
  214. -- Called when the pet's status changes.
  215. function job_pet_status_change(newStatus, oldStatus)
  216. if newStatus == 'Engaged' then
  217. display_pet_status()
  218. end
  219. end
  220.  
  221.  
  222. -------------------------------------------------------------------------------------------------------------------
  223. -- User code that supplements self-commands.
  224. -------------------------------------------------------------------------------------------------------------------
  225.  
  226. -- Called for custom player commands.
  227. function job_self_command(cmdParams, eventArgs)
  228. if cmdParams[1] == 'maneuver' then
  229. if pet.isvalid then
  230. local man = defaultManeuvers[state.PetMode]
  231. if man and tonumber(cmdParams[2]) then
  232. man = man[tonumber(cmdParams[2])]
  233. end
  234.  
  235. if man then
  236. send_command('input /pet "'..man..'" <me>')
  237. end
  238. else
  239. add_to_chat(123,'No valid pet.')
  240. end
  241. end
  242. end
  243.  
  244.  
  245. -- Called by the 'update' self-command, for common needs.
  246. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  247. function job_update(cmdParams, eventArgs)
  248. update_pet_mode()
  249. end
  250.  
  251.  
  252. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  253. function display_current_job_state(eventArgs)
  254. local defenseString = ''
  255. if state.Defense.Active then
  256. local defMode = state.Defense.PhysicalMode
  257. if state.Defense.Type == 'Magical' then
  258. defMode = state.Defense.MagicalMode
  259. end
  260.  
  261. defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
  262. end
  263.  
  264. add_to_chat(122,'Melee: '..state.OffenseMode..'/'..state.DefenseMode..', WS: '..state.WeaponskillMode..', '..defenseString..
  265. 'Kiting: '..on_off_names[state.Kiting])
  266.  
  267. display_pet_status()
  268.  
  269. eventArgs.handled = true
  270. end
  271.  
  272.  
  273. -------------------------------------------------------------------------------------------------------------------
  274. -- Utility functions specific to this job.
  275. -------------------------------------------------------------------------------------------------------------------
  276.  
  277. -- Get the pet mode value based on the equipped head of the automaton.
  278. -- Returns nil if pet is not valid.
  279. function get_pet_mode()
  280. if pet.isvalid then
  281. return petModes[pet.head]
  282. end
  283. end
  284.  
  285. -- Update state.PetMode, as well as functions that use it for set determination.
  286. function update_pet_mode()
  287. state.PetMode = get_pet_mode()
  288. update_custom_groups()
  289. end
  290.  
  291. -- Update custom groups based on the current pet.
  292. function update_custom_groups()
  293. classes.CustomIdleGroups:clear()
  294. if pet.isvalid then
  295. classes.CustomIdleGroups:append(state.PetMode)
  296. end
  297. end
  298.  
  299. -- Display current pet status.
  300. function display_pet_status()
  301. if pet.isvalid then
  302. local petInfoString = pet.name..' ['..pet.head..']: '..tostring(pet.status)..' TP='..tostring(pet.tp)..' HP%='..tostring(pet.hpp)
  303.  
  304. if magicPetModes:contains(state.PetMode) then
  305. petInfoString = petInfoString..' MP%='..tostring(pet.mpp)
  306. end
  307.  
  308. add_to_chat(122,petInfoString)
  309. end
  310. end
  311.  
  312. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement