Advertisement
bongarippa

Bst

Aug 16th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.29 KB | None | 0 0
  1. -- ** I Use Some of Motenten's Functions ** --
  2. -- Last Updated: 06/20/14 8:00 PM *Advanced Version* --
  3.  
  4. function get_sets()
  5. AccIndex = 1
  6. AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. --
  7. WeaponIndex = 1
  8. WeaponArray = {""} -- Default Main Weapon Is Ukonvasara. Can Delete Any Weapons That You Don't Own. --
  9. IdleIndex = 1
  10. IdleArray = {"Movement"} -- Default Idle Set Is Movement --
  11. Armor = 'None'
  12. HP = 'OFF'
  13. Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
  14. Rancor = 'OFF' -- Set Default Rancor ON or OFF Here --
  15. target_distance = 7 -- Set Default Distance Here --
  16.  
  17.  
  18. sc_map = {SC1="", SC2="", SC3="Berserk"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  19.  
  20. sets.Idle = {}
  21. -- Idle/Town Sets --
  22.  
  23. sets.Idle.Movement = {
  24. ammo="",
  25. head="Ighwa Cap",
  26. neck="Twilight Torque",
  27. ear1="Merman's Earring",
  28. ear2="Ethereal Earring",
  29. body="Ankusa Jackcoat +1",
  30. hands="Ankusa Gloves",
  31. ring1="Sheltered Ring",
  32. ring2="Paguroidea Ring",
  33. back="Iximulew Cape",
  34. waist="Hurch'lan Sash",
  35. legs="Ankusa Trousers +1",
  36. feet="Skadi's Jambeaux"}
  37.  
  38.  
  39. -- TP Sets --
  40. sets.TP = {
  41. ammo="Demonry Core",
  42. head="Otomi Helm",
  43. neck="Asperity Necklace",
  44. ear1="Domesticator's Earring",
  45. ear2="Suppanomimi",
  46. body="Ankusa Jackcoat +1",
  47. hands="Regimen Mittens",
  48. ring1="Rajas Ring",
  49. ring2="Epona's Ring",
  50. back="Pastoralist's Mantle",
  51. waist="Hurch'lan Sash",
  52. legs="Ankusa Trousers +1",
  53. feet="Whirlpool Greaves"}
  54. sets.TP.MidACC = set_combine(sets.TP,{
  55. neck="Agitator's Collar",
  56. waist="Anguinus Belt",
  57. hands="Xaddi Gauntlets",
  58. ring2="Patricius Ring",})
  59. sets.TP.HighACC = set_combine(sets.TP.MidACC,{
  60. ammo="Fire Bomblet",
  61. legs="Xaddi Cuisses",
  62. head="Yaoyotl Helm",
  63. hands="Buremte Gloves",
  64. feet="Scamp's Sollerets",
  65. neck="Agitator's Collar",
  66. ear2="Heartseeker Earring"})
  67.  
  68. -- Attack TP Set --
  69. sets.TP.ATT = set_combine(sets.TP,{
  70. })
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. -- PDT/MDT Sets --
  83. sets.PDT = {
  84. ammo="Onieros Pebble",
  85. head="Ighwa Cap",
  86. neck="Agitator's Collar",
  87. ear1="Steelflash Earring",
  88. ear2="Bladeborn Earring",
  89. body="Cizin Mail",
  90. hands="Agoge Mufflers +1",
  91. ring1="Dark Ring",
  92. ring2="Dark Ring",
  93. back="Shadow Mantle",
  94. waist="Cetl Belt",
  95. legs="Pumm. Cuisses +1",
  96. feet="Cizin Greaves"}
  97.  
  98. sets.MDT = set_combine(sets.PDT,{
  99. back="Engulfer Cape",
  100. ring2="Shadow Ring",
  101. neck="Twilight Torque",
  102. hands="Umuthi Gloves",
  103. feet="Pumm. Calligae +1",
  104. head="Yaoyotl Helm"
  105.  
  106. })
  107.  
  108. -- Hybrid/HP Sets --
  109. sets.TP.Hybrid = set_combine(sets.PDT,{
  110. head="Ighwa Cap",
  111. ear1="Steelflash Earring",
  112. ear2="Bladeborn Earring",
  113. waist="Windbuffet Belt +1"})
  114. sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{
  115. head="Ighwa Cap",
  116. hands="Umuthi Gloves",
  117. waist="Anguinus Belt",
  118. legs="Pumm. Cuisses +1",
  119. feet="Cizin Greaves"})
  120. sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{
  121. neck="Agitator's Collar",
  122. back="Shadow Mantle"})
  123.  
  124. sets.HP = set_combine(sets.PDT,{
  125. neck="Dualism Collar",
  126. ear1="Bloodgem Earring",
  127. ear2="Cassie Earring",
  128. ring1="Meridian Ring",
  129. back="Anchoret's Mantle"})
  130.  
  131. -- WS Base Set --
  132. sets.WS = {}
  133.  
  134. -- Ruinator Sets --
  135. sets.WS["Ruinator"] = {
  136. ammo="Yetshila",
  137. head="Otomi Helm",
  138. neck="Justiciar's Torque",
  139. ear1="Kokou's Earring",
  140. ear2="Moonshade Earring",
  141. body="Phorcys Korazin",
  142. hands="Umuthi Gloves",
  143. ring1="Ifrit Ring",
  144. ring2="Ifrit Ring",
  145. back="Letalis Mantle",
  146. waist="Windbuffet Belt +1",
  147. legs="Xaddi Cuisses",
  148. feet="Whirlpool Greaves"}
  149. sets.WS["Ruinator"].MidACC = set_combine(sets.WS["Ruinator"],{
  150. })
  151. sets.WS["Ruinator"].HighACC = set_combine(sets.WS["Ruinator"].MidACC,{
  152. })
  153.  
  154.  
  155.  
  156. -- Raging Rush Sets --
  157. sets.WS["Raging Rush"] = {
  158. ammo="Oneiros Pebble",
  159. head="Yaoyotl Helm",
  160. neck="Justiciar's Torque",
  161. ear1="Brutal Earring",
  162. ear2="Moonshade Earring",
  163. body="Xaddi Mail",
  164. hands="Buremte Gloves",
  165. ring1="Rajas Ring",
  166. ring2="Ifrit Ring",
  167. back="Letalis Mantle",
  168. waist="Caudata Belt",
  169. legs="Ankusa Trousers +1",
  170. feet="Whirlpool Greaves"}
  171. sets.WS["Raging Rush"].MidACC = set_combine(sets.WS["Raging Rush"],{
  172.  
  173. })
  174. sets.WS["Raging Rush"].HighACC = set_combine(sets.WS["Raging Rush"].MidACC,{
  175. })
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183. -- JA Sets --
  184. sets.JA = {}
  185. sets.JA['Familiar'] = {}
  186. sets.JA['Charm'] = {}
  187. sets.JA['Reward'] = {}
  188. sets.JA['Sic'] = {}
  189. sets.JA["Feral Howl"] = {}
  190. sets.JA['Call Beast'] = {}
  191. sets.JA['Ready'] = {}
  192. sets.JA['Bestial Loyalty'] = {}
  193.  
  194. -- Waltz Set --
  195. sets.Waltz = {}
  196.  
  197. sets.Precast = {}
  198. -- Fastcast Set --
  199. sets.Precast.FastCast = {
  200. head="Haruspex Hat +1",
  201. neck="Orunmila's Torque",
  202. ear1="Loquac. Earring",
  203. hands="Thaumas Gloves",
  204. ring1="Prolix Ring",}
  205. -- Utsusemi Precast Set --
  206. sets.Precast.Utsusemi = set_combine(sets.Precast.FastCast,{neck="Magoraga Beads"})
  207.  
  208. sets.Midcast = {}
  209. -- Magic Haste Set --
  210. sets.Midcast.Haste = set_combine(sets.PDT,{})
  211. end
  212.  
  213. function pretarget(spell,action)
  214. if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  215. cancel_spell()
  216. send_command('input /item "Echo Drops" <me>')
  217. elseif spell.type == "WeaponSkill" and player.status == 'Engaged' and spell.target.distance > target_distance then -- Cancel WS If You Are Out Of Range --
  218. cancel_spell()
  219. add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  220. return
  221. end
  222. end
  223.  
  224. function precast(spell,action)
  225. if spell.type == "WeaponSkill" then
  226. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  227. cancel_spell()
  228. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  229. return
  230. else
  231. equipSet = sets.WS
  232. if equipSet[spell.english] then
  233. equipSet = equipSet[spell.english]
  234. end
  235. if Attack == 'ON' then
  236. equipSet = equipSet["ATT"]
  237. end
  238. if equipSet[AccArray[AccIndex]] then
  239. equipSet = equipSet[AccArray[AccIndex]]
  240. end
  241.  
  242. equip(equipSet)
  243. end
  244. elseif spell.type == "JobAbility" then
  245. if sets.JA[spell.english] then
  246. equip(sets.JA[spell.english])
  247. end
  248. elseif spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  249. if string.find(spell.english,'Utsusemi') then
  250. if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  251. cancel_spell()
  252. add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  253. return
  254. else
  255. equip(sets.Precast.Utsusemi)
  256. end
  257. else
  258. equip(sets.Precast.FastCast)
  259. end
  260. elseif spell.type == "Waltz" then
  261. refine_waltz(spell,action)
  262. equip(sets.Waltz)
  263. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  264. cast_delay(0.2)
  265. send_command('cancel Sneak')
  266. end
  267. if HP == 'ON' then
  268. equip(sets.HP)
  269. end
  270. end
  271.  
  272. function midcast(spell,action)
  273. if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  274. if string.find(spell.english,'Utsusemi') then
  275. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  276. send_command('@wait 1.7;cancel Copy Image*')
  277. end
  278. equip(sets.Midcast.Haste)
  279. elseif spell.english == 'Monomi: Ichi' then
  280. if buffactive['Sneak'] then
  281. send_command('@wait 1.7;cancel sneak')
  282. end
  283. equip(sets.Midcast.Haste)
  284. else
  285. equip(sets.Midcast.Haste)
  286. end
  287. end
  288. end
  289.  
  290. function aftercast(spell,action)
  291. if not spell.interrupted then
  292. if spell.type == "WeaponSkill" then
  293. send_command('wait 0.2;gs c TP')
  294. end
  295. end
  296. status_change(player.status)
  297. end
  298.  
  299. function status_change(new,old)
  300. if Armor == 'PDT' then
  301. equip(sets.PDT)
  302. elseif Armor == 'MDT' then
  303. equip(sets.MDT)
  304. elseif new == 'Engaged' then
  305. equipSet = sets.TP
  306. if Armor == 'Hybrid' and equipSet["Hybrid"] then
  307. equipSet = equipSet["Hybrid"]
  308. end
  309. if Attack == 'ON' then
  310. equipSet = equipSet["ATT"]
  311. end
  312. if equipSet[AccArray[AccIndex]] then
  313. equipSet = equipSet[AccArray[AccIndex]]
  314. end
  315.  
  316.  
  317. if Rancor == 'ON' then -- Use Rancor Toggle For Rancorous Mantle --
  318. equipSet = set_combine(equipSet,sets.TP.Rancor)
  319. end
  320. equip(equipSet)
  321. else
  322. equipSet = sets.Idle
  323. if equipSet[IdleArray[IdleIndex]] then
  324. equipSet = equipSet[IdleArray[IdleIndex]]
  325. end
  326. if equipSet[WeaponArray[WeaponIndex]] then
  327. equipSet = equipSet[WeaponArray[WeaponIndex]]
  328. end
  329. equip(equipSet)
  330. end
  331. if HP == 'ON' then
  332. equip(sets.HP)
  333. end
  334. end
  335.  
  336.  
  337. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  338. function self_command(command)
  339. if command == 'C1' then -- Accuracy Toggle --
  340. AccIndex = (AccIndex % #AccArray) + 1
  341. add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
  342. status_change(player.status)
  343. elseif command == 'C17' then -- Main Weapon Toggle --
  344. WeaponIndex = (WeaponIndex % #WeaponArray) + 1
  345. add_to_chat(158,'Main Weapon: '..WeaponArray[WeaponIndex])
  346. status_change(player.status)
  347. elseif command == 'C5' then -- Auto Update Gear Toggle --
  348. status_change(player.status)
  349. add_to_chat(158,'Auto Update Gear')
  350. elseif command == 'C2' then -- Hybrid Toggle --
  351. if Armor == 'Hybrid' then
  352. Armor = 'None'
  353. add_to_chat(123,'Hybrid Set: [Unlocked]')
  354. else
  355. Armor = 'Hybrid'
  356. add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
  357. end
  358. status_change(player.status)
  359. elseif command == 'C7' then -- PDT Toggle --
  360. if Armor == 'PDT' then
  361. Armor = 'None'
  362. add_to_chat(123,'PDT Set: [Unlocked]')
  363. else
  364. Armor = 'PDT'
  365. add_to_chat(158,'PDT Set: [Locked]')
  366. end
  367. status_change(player.status)
  368. elseif command == 'C15' then -- MDT Toggle --
  369. if Armor == 'MDT' then
  370. Armor = 'None'
  371. add_to_chat(123,'MDT Set: [Unlocked]')
  372. else
  373. Armor = 'MDT'
  374. add_to_chat(158,'MDT Set: [Locked]')
  375. end
  376. status_change(player.status)
  377. elseif command == 'C3' then -- HP Toggle --
  378. if HP == 'ON' then
  379. HP = 'OFF'
  380. add_to_chat(123,'HP Set: [Unlocked]')
  381. else
  382. HP = 'ON'
  383. add_to_chat(158,'HP Set: [locked]')
  384. end
  385. status_change(player.status)
  386. elseif command == 'C16' then -- Rancor Toggle --
  387. if Rancor == 'ON' then
  388. Rancor = 'OFF'
  389. add_to_chat(123,'Rancor: [OFF]')
  390. else
  391. Rancor = 'ON'
  392. add_to_chat(158,'Rancor: [ON]')
  393. end
  394. status_change(player.status)
  395. elseif command == 'C9' then -- Attack Toggle --
  396. if Attack == 'ON' then
  397. Attack = 'OFF'
  398. add_to_chat(123,'Attack: [OFF]')
  399. else
  400. Attack = 'ON'
  401. add_to_chat(158,'Attack: [ON]')
  402. end
  403. status_change(player.status)
  404. elseif command == 'C8' then -- Distance Toggle --
  405. if player.target.distance then
  406. target_distance = math.floor(player.target.distance*10)/10
  407. add_to_chat(158,'Distance: '..target_distance)
  408. else
  409. add_to_chat(123,'No Target Selected')
  410. end
  411. elseif command == 'C6' then -- Idle Toggle --
  412. IdleIndex = (IdleIndex % #IdleArray) + 1
  413. add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
  414. status_change(player.status)
  415. elseif command == 'TP' then
  416. add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
  417. elseif command:match('^SC%d$') then
  418. send_command('//' .. sc_map[command])
  419. end
  420. end
  421.  
  422. function timer_Berserk()
  423. local duration = 180
  424. send_command('timers create "Berserk" '..tostring(duration)..' down')
  425. end
  426.  
  427. function timer_BloodRage()
  428. local duration = 60
  429. send_command('timers create "Blood Rage" '..tostring(duration)..' down')
  430. end
  431.  
  432. function refine_waltz(spell,action)
  433. if spell.type ~= 'Waltz' then
  434. return
  435. end
  436.  
  437. if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
  438. return
  439. end
  440.  
  441. local newWaltz = spell.english
  442. local waltzID
  443.  
  444. local missingHP
  445.  
  446. if spell.target.type == "SELF" then
  447. missingHP = player.max_hp - player.hp
  448. elseif spell.target.isallymember then
  449. local target = find_player_in_alliance(spell.target.name)
  450. local est_max_hp = target.hp / (target.hpp/100)
  451. missingHP = math.floor(est_max_hp - target.hp)
  452. end
  453.  
  454. if missingHP ~= nil then
  455. if player.sub_job == 'DNC' then
  456. if missingHP < 40 and spell.target.name == player.name then
  457. add_to_chat(123,'Full HP!')
  458. cancel_spell()
  459. return
  460. elseif missingHP < 150 then
  461. newWaltz = 'Curing Waltz'
  462. waltzID = 190
  463. elseif missingHP < 300 then
  464. newWaltz = 'Curing Waltz II'
  465. waltzID = 191
  466. else
  467. newWaltz = 'Curing Waltz III'
  468. waltzID = 192
  469. end
  470. else
  471. return
  472. end
  473. end
  474.  
  475. local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50, ['Curing Waltz IV'] = 65, ['Curing Waltz V'] = 80}
  476. local tpCost = waltzTPCost[newWaltz]
  477.  
  478. local downgrade
  479.  
  480. if player.tp < tpCost and not buffactive.trance then
  481.  
  482. if player.tp < 20 then
  483. add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
  484. cancel_spell()
  485. return
  486. elseif player.tp < 35 then
  487. newWaltz = 'Curing Waltz'
  488. elseif player.tp < 50 then
  489. newWaltz = 'Curing Waltz II'
  490. elseif player.tp < 65 then
  491. newWaltz = 'Curing Waltz III'
  492. elseif player.tp < 80 then
  493. newWaltz = 'Curing Waltz IV'
  494. end
  495.  
  496. downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
  497. end
  498.  
  499. if newWaltz ~= spell.english then
  500. send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
  501. if downgrade then
  502. add_to_chat(158, downgrade)
  503. end
  504. cancel_spell()
  505. return
  506. end
  507.  
  508. if missingHP > 0 then
  509. add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
  510. end
  511. end
  512.  
  513. function find_player_in_alliance(name)
  514. for i,v in ipairs(alliance) do
  515. for k,p in ipairs(v) do
  516. if p.name == name then
  517. return p
  518. end
  519. end
  520. end
  521. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement