Advertisement
Zigzagzig

PUP.lua

Jun 17th, 2018
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.36 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job. Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. --- Addon command is : //acon list
  6.  
  7. res = require 'resources'
  8. require 'tables'
  9. files = require 'files'
  10.  
  11. function get_sets()
  12.  
  13. mote_include_version = 2
  14. -- Load and initialize the include file.
  15. include('Mote-Include.lua')
  16. include('organizer-lib')
  17.  
  18.  
  19. end
  20.  
  21.  
  22. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  23. function job_setup()
  24.  
  25.  
  26. -- Map automaton heads to combat roles
  27. petModes = {
  28. ['Harlequin Head'] = 'Melee',
  29. ['Sharpshot Head'] = 'Ranged',
  30. ['Valoredge Head'] = 'Tank',
  31. ['Stormwaker Head'] = 'Magic',
  32. ['Soulsoother Head'] = 'Heal',
  33. ['Spiritreaver Head'] = 'Nuke'
  34. }
  35.  
  36. petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
  37. "Chimera Ripper", "String Clipper", "Cannibal Blade", "Bone Crusher", "String Shredder",
  38. "Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
  39.  
  40.  
  41. -- Subset of modes that use magic
  42. magicPetModes = S{'Nuke','Heal','Magic'}
  43.  
  44. -- Var to track the current pet mode.
  45. state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
  46.  
  47. end
  48.  
  49. -------------------------------------------------------------------------------------------------------------------
  50. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  51. -------------------------------------------------------------------------------------------------------------------
  52.  
  53. function user_setup()
  54.  
  55. state.OffenseMode:options('Normal', 'Acc', 'Event', 'Pet')
  56. state.HybridMode:options ('Normal')
  57. state.WeaponskillMode:options('Normal')
  58. state.CastingMode:options('Normal')
  59. state.IdleMode:options('Normal', 'PetPDT')
  60. state.PhysicalDefenseMode:options('PDT')
  61. state.MagicalDefenseMode:options('MDT')
  62.  
  63.  
  64. defaultManeuvers = {
  65. ['Melee'] = {'Fire Maneuver', 'Thunder Maneuver', 'Wind Maneuver', 'Light Maneuver'},
  66. ['Ranged'] = {'Wind Maneuver', 'Fire Maneuver', 'Thunder Maneuver', 'Light Maneuver'},
  67. ['Tank'] = {'Earth Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Wind Maneuver'},
  68. ['Magic'] = {'Ice Maneuver', 'Light Maneuver', 'Dark Maneuver', 'Earth Maneuver'},
  69. ['Heal'] = {'Light Maneuver', 'Dark Maneuver', 'Water Maneuver', 'Earth Maneuver'},
  70. ['Nuke'] = {'Ice Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Earth Maneuver'}}
  71.  
  72. update_pet_mode()
  73.  
  74. send_command('bind %v input //exec TEMP.txt')
  75. send_command('bind %c input //exec CAP.txt')
  76. send_command('bind %w input //exec warp.txt')
  77. send_command('bind %d input //exec dem.txt')
  78.  
  79. send_command('alias geref input /echo ~ Geo Refresh ~;input /ma Geo-Refresh <st>')
  80. send_command('alias gehas input /echo ~ Geo Haste ~;input /ma Geo-Haste <st>')
  81. send_command('alias gefur input /echo ~ Geo Fury ~;input /ma Geo-Fury <st>')
  82. send_command('alias gereg input /echo ~ Geo Regen ~;input /ma Geo-Regen <st>')
  83. send_command('alias geatt input /echo ~ Geo Attunement ~;input /ma Geo-Attunement <st>')
  84. send_command('alias si input /echo ~ Sneak + Invisible ~;input /ma sneak <me>;wait 5;input /ma invisible <me>')
  85. send_command('alias sn input /echo ~ Sneak ~;input /ma sneak <st>')
  86. send_command('alias in input /echo ~ Invisible ~;input /ma invisible <st>')
  87. send_command('alias p input /echo ~ Paralyna ~;input /ma paralyna <st>')
  88. send_command('alias po input /echo ~ Poisona ~;input /ma poisona <st>')
  89. send_command('alias era input /echo ~ Erase ~;input /ma erase <st>')
  90. send_command('alias cur input /echo ~ Cursna ~;input /ma cursna <st>')
  91. send_command('alias sil input /echo ~ Silena ~;input /ma silena <st>')
  92. send_command('alias sto input /echo ~ Stona ~;input /ma stona <st>')
  93. send_command('alias bli input /echo ~ Blindna ~;input /ma blindna <st>')
  94. send_command('alias bss input /echo ~ SS + Blink ~;input /ma stoneskin;wait 9;input /ma blink')
  95. send_command('alias ss input /echo ~ SS ~;input /ma stoneskin')
  96. send_command('alias bli input /echo ~ Blink ~;input /ma blink')
  97. send_command('alias ref input /echo ~ Refresh ~;input /ma refresh <st>')
  98. send_command('alias rr input /echo ~ RR ~;input /ma reraise')
  99. send_command('alias aqu input /echo ~ Aquaveil ~;input /ma aquaveil')
  100. send_command('alias ec input /echo ~ Echo ~;input /item "Echo Drops" <me>')
  101. send_command('alias hol input /echo ~ Holy Water ~;input /item "Holy Water" <me>')
  102. send_command('alias cur input /echo ~ Cure IV ~;input /ma Cure IV <st>')
  103. send_command('alias m input /echo ~ Mount ~;input /mount "Fenrir" <me>')
  104. send_command('bind %z input /echo ~ Emergency CURE ~;input /ma "Cure IV" <me>')
  105.  
  106. send_command('input /macro book 15;wait 1;input /macro set 1;wait 10;input /lockstyleset 15')
  107.  
  108. end
  109.  
  110.  
  111. -- Define sets used by this job file.
  112. function init_gear_sets()
  113.  
  114. -- Precast Sets ----------------
  115.  
  116. sets.precast = {}
  117.  
  118. sets.precast.FC = {
  119.  
  120. head="Herculean Helm",
  121. neck="Orunmila's Torque",
  122. right_ear="Loquac. Earring",
  123. right_ring="Prolix Ring",
  124. legs="Gyve Trousers",
  125. feet="Regal Pumps +1"}
  126.  
  127.  
  128.  
  129. -- Precast sets to enhance JAs -------------------
  130.  
  131. sets.precast.JA = {}
  132.  
  133. sets.precast.JA['Tactical Switch'] = {fee="Karagoz Scarpe"}
  134.  
  135. sets.precast.JA['Repair'] = {feet="Foire Bab. +1", right_ear="Pratik Earring", left_ear="Guignol Earring"}
  136.  
  137. sets.precast.JA.Maneuver = {body="Karagoz Farsetto", hands="Foire Dastanas +2", back="Visucius's Mantle"}
  138.  
  139. sets.precast.JA['Activate'] = {back="Visucius's Mantle"}
  140.  
  141. sets.precast.JA['Overdrive'] = {body="Pitre Tobe +1"}
  142.  
  143.  
  144.  
  145. -- Waltz set (chr and vit) --------------------------
  146.  
  147. sets.precast.Waltz = {}
  148.  
  149. -- Weaponskill sets ---------------------------------
  150.  
  151.  
  152. sets.precast.WS = {
  153. main="Midnights",
  154. head="Herculean Helm",
  155. neck="Fotia Gorget",
  156. right_ear="moonshade Earring",
  157. body="Foire Tobe +2",
  158. hands="Herculean Gloves",
  159. right_ring="Niqmaddu Ring",
  160. left_ring="Regal Ring",
  161. waist="Fotia Belt",
  162. legs="Herculean Trousers",
  163. feet="Herculean Boots",
  164. left_ear="Cessance Earring",
  165. back="Visucius's Mantle"}
  166.  
  167.  
  168. -- Midcast Sets -------------------------
  169.  
  170.  
  171. -- Midcast sets for pet actions----------
  172.  
  173. sets.midcast = {}
  174.  
  175. sets.midcast.Pet = {}
  176.  
  177. sets.midcast.Pet.Cure = {legs="Foire Churidars +1"}
  178.  
  179. sets.midcast['Dark Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1"}
  180.  
  181. sets.midcast.Pet['Elemental Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", feet="Karagoz Scarpe"}
  182.  
  183. sets.midcast.Pet['Enhancing Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", feet="Karagoz Scarpe"}
  184.  
  185. sets.midcast.Pet['Enfeebling Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", feet="Karagoz Scarpe"}
  186.  
  187. sets.midcast.Pet.Weaponskill = {head="Karagoz Capello", hands="Karagoz Guanti +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", back="Dispersal Mantle"}
  188.  
  189.  
  190.  
  191. -- Idle sets ------------------------
  192.  
  193. sets.idle = {}
  194.  
  195. sets.Resting = sets.Idle
  196.  
  197.  
  198.  
  199. sets.idle.Normal = {
  200. main="Midnights",
  201. range="Animator P +1",
  202. head="Pitre Taj +1",
  203. neck="Ampath Necklace",
  204. right_ear="Handler's Earring +1",
  205. left_ear="Handler's Earring",
  206. body="Pitre Tobe +1",
  207. hands="Tali'ah Gages +1",
  208. right_ring="Warp Ring",
  209. left_ring="Shneddick Ring",
  210. waist="Klouskap Sash",
  211. legs="Desultor Tassets",
  212. feet="Tali'ah Crackows +2",
  213. back="Visuciu's Mantle"}
  214.  
  215. sets.idle.Town = {
  216. head="Pitre Taj +1",
  217. neck="Combatant's Torque",
  218. right_ear="Handler's Earring",
  219. left_ear="Handler's Earring +1",
  220. body="Tali'ah Manteel +1",
  221. hands="Tali'ah Gages +1",
  222. right_ring="Niqmaddu Ring",
  223. left_ring="Shneddick Ring",
  224. waist="Klouskap Sash",
  225. legs="Desultor Tassets",
  226. feet="Tali'ah Crackows +2",
  227. back="Visuciu's Mantle"}
  228.  
  229. -- Set for idle while pet is out (eg: pet regen gear)-----
  230.  
  231. sets.idle.Pet = sets.idle
  232.  
  233. -- Idle sets to wear while pet is engaged-----------------
  234.  
  235. sets.idle.Pet.Engaged = {
  236. main="Midnights",
  237. range="Animator P +1",
  238. head="Pitre Taj +1",
  239. neck="Shulmanu Collar",
  240. right_ear="Handler's Earring +1",
  241. left_ear="Handler's Earring",
  242. body="Pitre Tobe +1",
  243. hands="Tali'ah Gages +1",
  244. right_ring="Varar Ring",
  245. left_ring="Varar Ring",
  246. waist="Klouskap Sash",
  247. legs="Kara. Pantaloni +1",
  248. feet="Foire Bab. +1",
  249. back="Visuciu's Mantle"}
  250.  
  251. sets.idle.PetPDT = {
  252. head="Anwig Salade",
  253. neck="Adad Amulet",
  254. right_ear="Handler's Earring",
  255. left_ear="Handler's Earring +1",
  256. body="Pitre Tobe +1",
  257. hands="Pitre Tobe +1",
  258. right_ring="Varar Ring",
  259. left_ring="Varar Ring",
  260. waist="Klouskap Sash",
  261. legs="Kara. Pantaloni +1",
  262. feet="Tali'ah Crackows +2",
  263. back="Visucius's Mantle"}
  264.  
  265. sets.idle.Pet.Engaged.Ranged = set_combine(sets.idle.Pet.Engaged, {head="Tali'ah Turban +2", body="Tali'ah Manteel +1", legs="Tali'ah Seraweels", fee="Tali'ah Crackows +2", back="Visuciu's Mantle"})
  266.  
  267. sets.idle.Pet.Engaged.Nuke = set_combine(sets.idle.Pet.Engaged, {head="Tali'ah Turban +2", right_ear="Enmerkar Earring", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", back="Visuciu's Mantle"})
  268.  
  269. sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, {head="Tali'ah Turban +2", right_ear="Enmerkar Earring", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", back="Visuciu's Mantle"})
  270.  
  271.  
  272. -- Defense sets --------------------------------------------
  273.  
  274. sets.defense = {}
  275.  
  276. sets.defense.PDT = {
  277. head="Hizamaru Somen +1",
  278. neck="Loricate Torque +1",
  279. right_ear="Thureous Earring",
  280. left_ear="Ethereal Earring",
  281. body="Hizamaru Haramaki",
  282. hands="Herculean Gloves",
  283. right_ring="Patricius Ring",
  284. left_ring="Defending Ring",
  285. waist="Flume Belt",
  286. legs="Tali'ah Seraweels",
  287. feet="Herculean Boots",
  288. back="Xucau Mantle"}
  289.  
  290.  
  291. sets.defense.MDT = {
  292. head="Hizamaru Somen +1",
  293. neck="Warder's Charm",
  294. body="Hizamaru Haramaki",
  295. right_ear="Spellbr. Earring",
  296. left_ear="Zealous Earring",
  297. right_ring="Chirich Ring",
  298. left_ring="Shadow Ring",
  299. hands="Foire Dastanas +2",
  300. waist="Flume Belt",
  301. legs="Assid. Pants +1",
  302. feet="Herculean Boots",
  303. back="Toro Cape"}
  304.  
  305. -- Engaged sets --------------------------------------------------------
  306.  
  307. sets.engaged = {}
  308.  
  309. sets.engaged.Normal = {
  310. main="Midnights",
  311. range="Animator P +1",
  312. head="Tali'ah Turban +2",
  313. neck="Shulmanu Collar",
  314. right_ear="Enmerkar Earring",
  315. left_ear="Cessance Earring",
  316. body="Pitre Tobe +1",
  317. hands="Foire Dastanas +2",
  318. right_ring="Varar Ring",
  319. left_ring="Varar Ring",
  320. waist="Klouskap Sash",
  321. legs="Kara. Pantaloni +1",
  322. feet="Tali'ah Crackows +2",
  323. back="Mecisto. Mantle"}
  324.  
  325. sets.engaged.Acc = {
  326. main="Midnights",
  327. range="Animator P +1",
  328. head="Tali'ah Turban +2",
  329. neck="Shulmanu Collar",
  330. right_ear="Zennaroi Earring",
  331. left_ear="Cessance Earring",
  332. body="Tali'ah Manteel +1",
  333. hands="Tali'ah Gages +1",
  334. right_ring="Varar Ring",
  335. left_ring="Varar Ring",
  336. waist="Klouskap Sash",
  337. legs="Tali'ah Sera. +1",
  338. feet="Tali'ah Crackows +2",
  339. back="Visucius's Mantle"}
  340.  
  341.  
  342. sets.engaged.Event = {
  343. range="Animator P +1",
  344. head="Pitre Taj +1",
  345. neck="Shulmanu Collar",
  346. right_ear="Steelflash Earring",
  347. left_ear="Cessance Earring",
  348. body="Pitre Tobe +1",
  349. hands="Foire Dastanas +2",
  350. right_ring="Varar Ring",
  351. left_ring="Varar Ring",
  352. waist="Klouskap Sash",
  353. legs="Kara. Pantaloni +1",
  354. feet="Tali'ah Crackows +2",
  355. back="Visucius's Mantle"}
  356.  
  357.  
  358. sets.engaged.Pet = {
  359. head="Anwig Salade",
  360. neck="Adad Amulet",
  361. right_ear="Handler's Earring",
  362. left_ear="Handler's Earring +1",
  363. body="Pitre Tobe +1",
  364. hands="Tali'ah Gages +1",
  365. right_ring="Varar Ring",
  366. left_ring="Varar Ring",
  367. waist="Isa Belt",
  368. legs="Tali'ah Sera. +1",
  369. feet="Tali'ah Crackows +2",
  370. back="Visucius's Mantle"}
  371.  
  372. sets.reive = {neck="Ygnas's Resolve +1", back="Dispersal Mantle"}
  373.  
  374.  
  375.  
  376. end
  377.  
  378.  
  379. -------------------------------------------------------------------------------------------------------------------
  380. -- Job-specific hooks for non-casting events.
  381. -------------------------------------------------------------------------------------------------------------------
  382.  
  383. function display_current_job_state(eventArgs)
  384. display_pet_status()
  385. end
  386.  
  387.  
  388. function job_pet_change(pet, gain)
  389. update_pet_mode()
  390. end
  391.  
  392.  
  393. function status_change(new,tab)
  394. handle_equipping_gear(player.status)
  395. if new == 'Resting' then
  396. equip(sets.Resting)
  397. else
  398. equip(sets.idle.Current)
  399. end
  400. end
  401.  
  402.  
  403. function job_pet_status_change(newStatus, oldStatus)
  404. if newStatus == 'Engaged' then
  405. display_pet_status()
  406. end
  407. end
  408.  
  409.  
  410. function job_state_change(stateField, newValue, oldValue)
  411. job_handle_equipping_gear(player.status)
  412. equip(sets.idle.Current)
  413. end
  414.  
  415.  
  416. function job_self_command(cmdParams, eventArgs)
  417. if cmdParams[1] == 'maneuver' then
  418. if pet.isvalid then
  419. local man = defaultManeuvers[state.PetMode.value]
  420. if man and tonumber(cmdParams[2]) then
  421. man = man[tonumber(cmdParams[2])]
  422. end
  423. if man then
  424. send_command('input /pet "'..man..'" <me>')
  425. end
  426. else
  427. add_to_chat(123,'No valid pet.')
  428. end
  429. end
  430. end
  431.  
  432.  
  433. function get_pet_mode()
  434. if pet.isvalid then
  435. return petModes[pet.head] or 'None'
  436. else
  437. return 'None'
  438. end
  439. end
  440.  
  441.  
  442. function update_pet_mode()
  443. state.PetMode:set(get_pet_mode())
  444. update_custom_groups()
  445. end
  446.  
  447.  
  448. function job_update(cmdParams, eventArgs)
  449. update_pet_mode()
  450. end
  451.  
  452.  
  453. function update_custom_groups()
  454. classes.CustomIdleGroups:clear()
  455. if pet.isvalid then
  456. classes.CustomIdleGroups:append(state.PetMode.value)
  457. end
  458. end
  459.  
  460.  
  461. function display_pet_status()
  462. if pet.isvalid then
  463. local petInfoString = pet.name..' ['..pet.head..']: '..tostring(pet.status)..' HP%='..tostring(pet.hpp)
  464. if magicPetModes:contains(state.PetMode.value) then
  465. petInfoString = petInfoString..' MP%='..tostring(pet.mpp)
  466. end
  467. add_to_chat(122,petInfoString)
  468. end
  469. end
  470.  
  471.  
  472. function job_handle_equipping_gear(playerStatus, eventArgs)
  473. classes.CustomMeleeGroups:clear()
  474. if pet.status=="Engaged" then
  475. classes.CustomMeleeGroups:append('PetEngaged')
  476. classes.CustomMeleeGroups:append(state.PetMode.value)
  477. end
  478. if playerStatus == 'Idle' then
  479. equip(sets.idle.Current)
  480. end
  481. end
  482.  
  483.  
  484. function check_height()
  485. selfz = math.floor(windower.ffxi.get_mob_by_index(player.index).z * 10)/10
  486. targetz = math.floor(windower.ffxi.get_mob_by_index(player.target.index).z * 10)/10
  487. heightdiff = selfz - targetz
  488. targdistance = math.floor(windower.ffxi.get_mob_by_index(player.target.index).distance:sqrt() * 10+0.5)/10
  489. send_command('input /echo My Height:'..selfz..' Target Height:'..targetz..' Height Difference:'..heightdiff..' Target Distance:'..targdistance..'')
  490. end
  491.  
  492.  
  493. function job_precast(spell)
  494. if spell.type == 'WeaponSkill' then
  495. local range_mult = {
  496. [2] = 1.55,
  497. [3] = 1.490909,
  498. [4] = 1.44,
  499. [5] = 1.377778,
  500. [6] = 1.30,
  501. [7] = 1.15,
  502. [8] = 1.25,
  503. [9] = 1.377778,
  504. [10] = 1.45,
  505. [11] = 1.454545454545455,
  506. [12] = 1.666666666666667,
  507. }
  508. ability_distance = res.weapon_skills[spell.id].range
  509. if spell.target.distance > (ability_distance * range_mult[ability_distance] + spell.target.model_size + player.model_size) then
  510. cancel_spell()
  511. add_to_chat(3, spell.name..' Canceled: [Out of Range]')
  512. send_command('gs c update')
  513. return
  514. end
  515. end
  516. if spell.name == 'Utsusemi: Ichi' and (buffactive['Copy Image (3)'] or buffactive ['Copy Image (4+)']) then
  517. cancel_spell()
  518. send_command('@wait 1;')
  519. equip(sets.idle.Current)
  520. return
  521. end
  522. if spell.type == 'WeaponSkill' and player.tp < 1000 then
  523. cancel_spell()
  524. send_command('gs c update')
  525. windower.add_to_chat(50,'*** Waiting on TP ***')
  526. return
  527. end
  528. if spell.type == "WeaponSkill" then
  529. tpspent = spell.tp_cost
  530. add_to_chat(200,'-----------> WS <-----------')
  531. add_to_chat(003,'Name:'..spell.name..' Base TP:'..tpspent..'')
  532. if (#spell.skillchain_a > 1) then
  533. skillchainproperties = spell.skillchain_a
  534. end
  535. if (#spell.skillchain_b > 1) then
  536. skillchainproperties = skillchainproperties ..' '.. spell.skillchain_b
  537. end
  538. if (#spell.skillchain_c) then
  539. skillchainproperties = skillchainproperties ..' '.. spell.skillchain_c
  540. end
  541. add_to_chat(003,'Skillchain Properties:'..skillchainproperties..'')
  542. end
  543. if spell.type == 'WeaponSkill' and buffactive.Amnesia then
  544. cancel_spell()
  545. send_command('gs c update')
  546. windower.add_to_chat(50,'*** Canceling Ability - Currently have Amnesia ***')
  547. return
  548. end
  549. end
  550.  
  551.  
  552.  
  553. function job_buff_change(status,gain_or_loss)
  554. if (gain_or_loss) then
  555. add_to_chat(158,'-------> Gained Buff: '..status..' <-------')
  556. if status == "sleep" then
  557. equip(sets.WakeSleep)
  558. end
  559. if status == "KO" then
  560. send_command('input /party These tears... they sting-wing....')
  561. end
  562. else
  563. add_to_chat(039,'-------> Lost Buff: '..status..' <-------')
  564. end
  565. end
  566.  
  567.  
  568. function job_pet_midcast(spell, spellMap, action)
  569. if petWeaponskills:contains(spell.english) then
  570. equip(sets.midcast.Pet.Weaponskill)
  571. windower.add_to_chat(50,'---> PET TP: '..pet_tp..' PET WS: '..spell.name..' <---')
  572. end
  573. if spell.action_type == 'Magic' then
  574. equip(sets.midcast.Pet['Elemental Magic'])
  575. windower.add_to_chat(50,'---> PET Elemental SET <---')
  576. end
  577. end
  578.  
  579.  
  580. function job_aftercast(eventArgs, action)
  581. if pet.isvalid then
  582. if pet_midaction() then
  583. eventArgs.handled = true
  584. else
  585. handle_equipping_gear(player.status, newStatus)
  586. end
  587. end
  588. end
  589.  
  590.  
  591.  
  592. pet_tp=0
  593. packets = require('packets')
  594.  
  595. function update_pet_tp(id,data)
  596. if id == 0x068 then
  597. pet_tp = 0
  598. local update = packets.parse('incoming', data)
  599. pet_tp = update["Pet TP"]
  600. windower.send_command('lua c gearswap c pet_tp '..pet_tp)
  601. --print(pet_tp)
  602. --log_data_structure(update)
  603. --log_data_structure(pet_tp)
  604. --debuginfo = debug.getinfo(1)
  605. --log_data_structure(debuginfo)
  606. --print('here')
  607. --log_data_structure(data)
  608. end
  609. end
  610. id = windower.raw_register_event('incoming chunk', update_pet_tp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement