diff --git a/addons/Clock/Clock.lua b/addons/Clock/Clock.lua index 9a66f68374..b3ae51540a 100644 --- a/addons/Clock/Clock.lua +++ b/addons/Clock/Clock.lua @@ -62,7 +62,15 @@ config.register(settings, redraw) clock:show() -utc_diff = os.difftime(os.time(), os.time(os.date('!*t', os.time()))) +local function get_timezone_offset(ts) + ts = ts or os.time() + local utcdate = os.date("!*t", ts) + local localdate = os.date("*t", ts) + localdate.isdst = false -- this is the trick + return os.difftime(os.time(localdate), os.time(utcdate)) +end + +utc_diff = get_timezone_offset() windower.register_event('prerender', function() local utc_now = os.time() - utc_diff diff --git a/addons/GearSwap/packet_parsing.lua b/addons/GearSwap/packet_parsing.lua index 869b73579c..410ea7613c 100644 --- a/addons/GearSwap/packet_parsing.lua +++ b/addons/GearSwap/packet_parsing.lua @@ -185,7 +185,9 @@ parse.i[0x037] = function (data) end end end]] - + -- Info provided by Akaden + vana_offset = os.time() - (((data:unpack("I",0x41)*60 - data:unpack("I",0x3D)) % 0x100000000) / 60) + local indi_byte = data:byte(0x59) if indi_byte%128/64 >= 1 then local temp_indi = _ExtraData.player.indi @@ -457,7 +459,7 @@ parse.i[0x063] = function (data) for i=1,32 do local buff_id = data:unpack('H',i*2+7) if buff_id ~= 255 and buff_id ~= 0 then -- 255 is used for "no buff" - local t = data:unpack('I',i*4+0x45)/60+572662306+1009810800 + local t = data:unpack('I',i*4+0x45)/60 newbuffs[i] = setmetatable({ name=res.buffs[buff_id].name, buff=copy_entry(res.buffs[buff_id]), @@ -467,7 +469,7 @@ parse.i[0x063] = function (data) }, {__index=function(t,k) if k and k=='duration' then - return rawget(t,'time')-os.time() + return rawget(t,'time')-os.time()+(vana_offset or 0) else return rawget(t,k) end @@ -475,7 +477,6 @@ parse.i[0x063] = function (data) end end if seen_0x063_type9 then - -- Look for exact matches for n,new in pairs(newbuffs) do newbuffs[n].matched_exactly = nil @@ -556,7 +557,7 @@ parse.i[0x063] = function (data) end end end - + table.reassign(_ExtraData.player.buff_details,newbuffs) for i=1,32 do player.buffs[i] = (newbuffs[i] and newbuffs[i].id) or nil diff --git a/addons/GearSwap/statics.lua b/addons/GearSwap/statics.lua index 49863a1d49..a81f428bee 100644 --- a/addons/GearSwap/statics.lua +++ b/addons/GearSwap/statics.lua @@ -190,6 +190,7 @@ slot_map.back = 15 gearswap_disabled = false seen_0x063_type9 = false delay_0x063_v9 = false +vana_offset = 572662306+1009810800 not_sent_out_equip = {} command_registry = Command_Registry.new() equip_list = {} diff --git a/addons/Trusts/Trusts.lua b/addons/Trusts/Trusts.lua index 36d03527de..c35f66c36e 100644 --- a/addons/Trusts/Trusts.lua +++ b/addons/Trusts/Trusts.lua @@ -139,7 +139,7 @@ function check_exist() local get_party = windower.ffxi.get_party() for i=1,5 do local member = get_party['p'..i] - if member then + if member and member.mob then if member.mob.spawn_type == 14 then party[member.name] = member.mob.models[1] table.insert(party_ind,member.name) diff --git a/addons/gametime/gametime.lua b/addons/gametime/gametime.lua index 9ea880138a..6b9d4c2a03 100644 --- a/addons/gametime/gametime.lua +++ b/addons/gametime/gametime.lua @@ -1,4 +1,4 @@ --- Copyright © 2013-2016, Omnys of Valefor +-- Copyright © 2013-2016, 2022, Omnys of Valefor -- All rights reserved. -- Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ _addon.name = 'gametime' _addon.author = 'Omnys' -_addon.version = '0.6' +_addon.version = '0.7' _addon.commands = {'gametime','gt'} require('chat') @@ -287,6 +287,7 @@ end windower.register_event('time change', function(new, old) gt.hours = (new / 60):floor() gt.minutes = new % 60 + gt.dectime = timeconvert(gt.hours..':'..gt.minutes) gt.gtt:update(gt) end) diff --git a/addons/libs/packets/fields.lua b/addons/libs/packets/fields.lua index 98525c1fe7..0d14bbe579 100644 --- a/addons/libs/packets/fields.lua +++ b/addons/libs/packets/fields.lua @@ -106,7 +106,7 @@ do end bufftime = function(ts) - return fn((ts / 60) + 572662306 + 1009810800) + return fn(1009810800 + (ts / 60) + 0x100000000 / 60 * 9) -- increment last number every 2.27 years end end @@ -398,7 +398,7 @@ fields.outgoing[0x029] = L{ fields.outgoing[0x02B] = L{ {ctype='unsigned char', label='Starting Language'}, -- 04 0 == JP, 1 == EN {ctype='unsigned char', label='Ending Language'}, -- 05 0 == JP, 1 == EN - {ctype='unsigned short', label='_unknown1', const=0x0000}, -- 06 + {ctype='unsigned short', label='_unknown1', const=0x0000}, -- 06 {ctype='char[64]', label='Phrase'}, -- 08 Quotation marks are removed. Phrase is truncated at 64 characters. } @@ -696,7 +696,7 @@ fields.outgoing[0x05C] = L{ -- Outgoing emote fields.outgoing[0x05D] = L{ {ctype='unsigned int', label='Target ID', fn=id}, -- 04 - {ctype='unsigned short', label='Target Index', fn=index}, -- 08 + {ctype='unsigned short', label='Target Index', fn=index}, -- 08 {ctype='unsigned char', label='Emote', fn=emote}, -- 0A {ctype='unsigned char', label='Type'}, -- 0B 2 for motion, 0 otherwise {ctype='unsigned int', label='_unknown1', const=0}, -- 0C @@ -760,7 +760,7 @@ fields.outgoing[0x070] = L{ -- Kick fields.outgoing[0x071] = L{ - {ctype='data[6]', label='_unknown1'}, -- 04 + {ctype='data[6]', label='_unknown1'}, -- 04 {ctype='unsigned char', label='Kick Type'}, -- 0A 0 for party, 1 for linkshell, 2 for alliance (maybe) {ctype='unsigned char', label='_unknown2'}, -- 0B {ctype='data[16]', label='Member Name'} -- 0C Null terminated string @@ -794,8 +794,8 @@ fields.outgoing[0x078] = L{ -- Guild NPC Buy -- Sent when buying an item from a guild NPC fields.outgoing[0x082] = L{ - {ctype='unsigned short', label='Item', fn=item}, -- 08 - {ctype='unsigned char', label='_unknown1', const=0x00}, -- 0A + {ctype='unsigned short', label='Item', fn=item}, -- 08 + {ctype='unsigned char', label='_unknown1', const=0x00}, -- 0A {ctype='unsigned char', label='Count'}, -- 0B Number you are buying } @@ -859,8 +859,8 @@ fields.outgoing[0x0A2] = L{ -- Guild Buy Item -- Sent when buying an item from a guild NPC fields.outgoing[0x0AA] = L{ - {ctype='unsigned short', label='Item', fn=item}, -- 04 - {ctype='unsigned char', label='_unknown1', const=0x00}, -- 06 + {ctype='unsigned short', label='Item', fn=item}, -- 04 + {ctype='unsigned char', label='_unknown1', const=0x00}, -- 06 {ctype='unsigned char', label='Count'}, -- 07 Number you are buying } @@ -872,8 +872,8 @@ fields.outgoing[0x0AB] = L{ -- Guild Sell Item -- Sent when selling an item to a guild NPC fields.outgoing[0x0AC] = L{ - {ctype='unsigned short', label='Item', fn=item}, -- 04 - {ctype='unsigned char', label='_unknown1'}, -- 06 + {ctype='unsigned short', label='Item', fn=item}, -- 04 + {ctype='unsigned char', label='_unknown1'}, -- 06 {ctype='unsigned char', label='Count'}, -- 07 Number you are selling } @@ -918,8 +918,8 @@ fields.outgoing[0x0C0] = L{ -- /makelinkshell fields.outgoing[0x0C3] = L{ - {ctype='unsigned char', label='_unknown1'}, -- 04 - {ctype='unsigned char', label='Linkshell Number'}, -- 05 + {ctype='unsigned char', label='_unknown1'}, -- 04 + {ctype='unsigned char', label='Linkshell Number'}, -- 05 {ctype='data[2]', label='_junk1'} -- 05 } @@ -1147,7 +1147,7 @@ fields.outgoing[0x10D] = L{ fields.outgoing[0x10E] = L{ {ctype='unsigned short', label='RoE Quest'}, -- 04 This field is likely actually 12 bits } - + -- Currency Menu fields.outgoing[0x10F] = L{ } @@ -1190,7 +1190,7 @@ fields.outgoing[0x115] = L{ -- Open Unity Menu :: Two of these are sent whenever I open my unity menu. The first one has a bool of 0 and the second of 1. fields.outgoing[0x116] = L{ {ctype='bool', label='_unknown1'}, -- 04 - {ctype='char[3]', label='_unknown2'}, -- 05 + {ctype='char[3]', label='_unknown2'}, -- 05 } -- Unity Ranking Results :: Sent when I open my Unity Ranking Results menu. Triggers a Sparks Update packet and may trigger ranking packets that I could not record. @@ -1201,7 +1201,7 @@ fields.outgoing[0x117] = L{ -- Open Chat status fields.outgoing[0x118] = L{ {ctype='bool', label='Chat Status'}, -- 04 0 for Inactive and 1 for Active - {ctype='char[3]', label='_unknown2'}, -- 05 + {ctype='char[3]', label='_unknown2'}, -- 05 } types.job_level = L{ @@ -1212,8 +1212,8 @@ types.job_level = L{ fields.incoming[0x00A] = L{ {ctype='unsigned int', label='Player', fn=id}, -- 04 {ctype='unsigned short', label='Player Index', fn=index}, -- 08 - {ctype='unsigned char', label='_padding'}, -- 0A - {ctype='unsigned char', label='Heading', fn=dir}, -- 0B -- 0B to + {ctype='unsigned char', label='_padding'}, -- 0A + {ctype='unsigned char', label='Heading', fn=dir}, -- 0B -- 0B to {ctype='float', label='X'}, -- 0C {ctype='float', label='Z'}, -- 10 {ctype='float', label='Y'}, -- 14 @@ -1344,7 +1344,7 @@ fields.incoming[0x00D] = L{ {ctype='unsigned int', label='Player', fn=id}, -- 04 {ctype='unsigned short', label='Index', fn=index}, -- 08 - {ctype='boolbit', label='Update Position'}, -- 0A:0 Position, Rotation, Target, Speed + {ctype='boolbit', label='Update Position'}, -- 0A:0 Position, Rotation, Target, Speed {ctype='boolbit', label='Update Status'}, -- 1A:1 Not used for 0x00D {ctype='boolbit', label='Update Vitals'}, -- 0A:2 HP%, Status, Flags, LS color, "Face Flags" {ctype='boolbit', label='Update Name'}, -- 0A:3 Name @@ -1369,7 +1369,7 @@ fields.incoming[0x00D] = L{ {ctype='unsigned char', label='Linkshell Green'}, -- 25 {ctype='unsigned char', label='Linkshell Blue'}, -- 26 {ctype='unsigned char', label='_flags1'}, -- 27 0x80 Autogroup flag - {ctype='unsigned char', label='_flags2'}, -- 28 0x01 puts your weapon on hand, 0x02 Request flag, + {ctype='unsigned char', label='_flags2'}, -- 28 0x01 puts your weapon on hand, 0x02 Request flag, {ctype='unsigned char', label='PvP Stuff'}, -- 29 Same pattern than incoming 0x037 packet {ctype='unsigned char', label='_flags3'}, -- 2A 0x20 Sneak Effect flag, 0x80 New Adventurer flag {ctype='unsigned char', label='_flags4'}, -- 2B 0x01 Mentor flag @@ -1890,8 +1890,8 @@ fields.incoming[0x029] = L{ --[[ 0x2A can also be triggered by spending cruor by buying non-vwnm related items, or even activating/using Flux Field1 will be the amount of cruor spent ]] - - + + --[[ 0x2A can also be triggered by zoning into Abyssea: Field1 will be set to your remaining time. 5 at first, then whatever new value when acquiring visiting status. 0x2A will likely be triggered as well when extending your time limit. Needs verification. @@ -1951,7 +1951,7 @@ fields.incoming[0x030] = L{ -- Synth List / Synth Recipe --[[ This packet is used for list of recipes, but also for details of a specific recipe. - If you ask the guild NPC that provides regular Image Suppor for recipes, + If you ask the guild NPC that provides regular Image Suppor for recipes, s/he will give you a list of recipes, fields are as follows: Field1-2: NPC ID Field3: NPC Index @@ -1961,13 +1961,13 @@ fields.incoming[0x030] = L{ Field24: Usually Item ID of the recipe on next page - If you ask a guild NPC for a specific recipe, fields are as follows: + If you ask a guild NPC for a specific recipe, fields are as follows: field1: item to make (item id) field2,3,4: sub-crafts needed. Note that main craft will not be listed. 1 = woodworking 2 = smithing 3 = goldsmithing - 4 = clothcraft + 4 = clothcraft 5 = leatherworking 6 = bonecraft 7 = Alchemy @@ -1976,10 +1976,10 @@ fields.incoming[0x030] = L{ field6: KeyItem needed, if any (in Big Endian) field7-14: material required (item id) field15-22: qty for each material above. - field23-24: Unknown + field23-24: Unknown ]] fields.incoming[0x031] = L{ - {ctype='unsigned short[24]', label='Field'}, -- 04 + {ctype='unsigned short[24]', label='Field'}, -- 04 } -- NPC Interaction Type 1 @@ -2010,7 +2010,7 @@ fields.incoming[0x033] = L{ -- NPC Interaction Type 2 fields.incoming[0x034] = L{ {ctype='unsigned int', label='NPC', fn=id}, -- 04 - {ctype='data[32]', label='Menu Parameters'}, -- 08 + {ctype='data[32]', label='Menu Parameters'}, -- 08 {ctype='unsigned short', label='NPC Index', fn=index}, -- 28 {ctype='unsigned short', label='Zone', fn=zone}, -- 2A {ctype='unsigned short', label='Menu ID'}, -- 2C Seems to select between menus within a zone @@ -2072,14 +2072,14 @@ enums.indi = { -- 0x2000 -- No obvious effect -- 0x4000 -- No obvious effect -- 0x8000 -- No obvious effect - + _flags2: -- 0x01 -- POL Icon :: Actually a flag, overrides everything else but does not affect name color -- 0x02 -- No obvious effect -- 0x04 -- Disconnection icon :: Actually a flag, overrides everything but POL Icon -- 0x08 -- No linkshell -- 0x0A -- No obvious effect - + -- 0x10 -- No linkshell -- 0x20 -- Trial account icon -- 0x40 -- Trial account icon @@ -2093,13 +2093,13 @@ enums.indi = { -- Bit 0x80 overpowers those bits -- Bit 0x80 combines with 0x04 and 0x02 to make SGM. -- These are basically flags, but they can be combined to mean different things sometimes. - + _flags3: -- 0x10 -- No obvious effect -- 0x20 -- Event mode? Can't activate the targeting cursor but can still spin the camera -- 0x40 -- No obvious effect -- 0x80 -- Invisible model - + _flags4: -- 0x02 -- No obvious effect -- 0x04 -- No obvious effect @@ -2108,16 +2108,16 @@ enums.indi = { -- 0x20 -- Bazaar icon -- 0x40 -- Event status again? Can't activate the targeting cursor but can move the camera. -- 0x80 -- No obvious effects - + _flags5: -- 0x01 -- No obvious effect -- 0x02 -- No obvious effect -- 0x04 -- Autoinvite icon - + _flags6: -- 0x08 -- Terror flag -- 0x10 -- No obvious effect - + PvP stuff: -- 0x0020 -- No obvious effect -- 0x0040 -- San d'Oria ballista flag @@ -2131,7 +2131,7 @@ enums.indi = { -- 0x0420 -- Pankration blue icon -- 0x0800 -- and I still don't D:< -- 0x1000 -- and I still don't D:< - + _flags7: -- 0x0020 -- No obvious effect -- 0x0040 -- Individually, this bit has no effect. When combined with 0x20, it prevents you from returning to a walking animation after you stop (sliding along the ground while bound) @@ -2146,8 +2146,8 @@ fields.incoming[0x037] = L{ {ctype='unsigned char[32]', label='Buff', fn=buff}, -- 04 {ctype='unsigned int', label='Player', fn=id}, -- 24 {ctype='unsigned short', label='_flags1'}, -- 28 Called "Flags" on the old dev wiki. Second byte might not be part of the flags, actually. - {ctype='unsigned char', label='HP %', fn=percent}, -- 2A - {ctype='bit[8]', label='_flags2'}, -- 2B + {ctype='unsigned char', label='HP %', fn=percent}, -- 2A + {ctype='bit[8]', label='_flags2'}, -- 2B {ctype='bit[12]', label='Movement Speed/2'}, -- 2C Player movement speed {ctype='bit[4]', label='_flags3'}, -- 2D {ctype='bit[9]', label='Yalms per step'}, -- 2E Determines how quickly your animation walks @@ -2156,7 +2156,7 @@ fields.incoming[0x037] = L{ {ctype='unsigned char', label='LS Color Red'}, -- 31 {ctype='unsigned char', label='LS Color Green'}, -- 32 {ctype='unsigned char', label='LS Color Blue'}, -- 33 - {ctype='bit[3]', label='_flags5'}, -- 34 + {ctype='bit[3]', label='_flags5'}, -- 34 {ctype='bit[16]', label='Pet Index', fn=index}, -- 34 From 0x08 of byte 0x34 to 0x04 of byte 0x36 {ctype='bit[2]', label='_flags6'}, -- 36 {ctype='bit[9]', label='PvP Stuff'}, -- 36 Ballista flags here also makes appear the score, but it is probably modified in a ballista specific packet. @@ -2176,7 +2176,7 @@ fields.incoming[0x037] = L{ {ctype='bit[7]', label='Indi Buff', fn=e+{'indi'}}, -- 58 {ctype='boolbit', label='Job Master Flag'}, -- 58 {ctype='unsigned char', label='Face Flags'}, -- 59 - {ctype='unsigned char', label='_unknown5'}, -- 5A + {ctype='unsigned char', label='_unknown5'}, -- 5A {ctype='unsigned char', label='Mount'}, -- 5B Related to Mounts, seems to be mount id + 1, except for chocobo. The value doesn't get zeroed after dismount {ctype='boolbit', label='Wardrobe 3'}, -- 5C {ctype='boolbit', label='Wardrobe 4'}, -- 5C @@ -2229,7 +2229,7 @@ types.shop_item = L{ {ctype='unsigned short', label='Item', fn=item}, -- 04 {ctype='unsigned short', label='Shop Slot'}, -- 08 {ctype='unsigned short', label='Craft Skill'}, -- 0A Zero on normal shops, has values that correlate to res\skills. - {ctype='unsigned short', label='Craft Rank'}, -- 0C Correlates to Rank able to purchase product from GuildNPC + {ctype='unsigned short', label='Craft Rank'}, -- 0C Correlates to Rank able to purchase product from GuildNPC } -- Shop @@ -2440,7 +2440,7 @@ func.incoming[0x04B].base = L{ {ctype='signed char', label='Delivery Slot'}, -- 06 This goes left to right and then drops down a row and left to right again. Value is 00 through 07 -- 01 if Type is 06, otherwise FF -- 06 Type always seems to come in a pair, this field is only 01 for the first packet - {ctype='signed char', label='_unknown2'}, -- 07 Always FF FF FF FF? + {ctype='signed char', label='_unknown2'}, -- 07 Always FF FF FF FF? {ctype='signed int', label='_unknown3', const=-1}, -- 0C When in a 0x0D/0x0E type, 01 grants request to open inbox/outbox. With FA you get "Please try again later" {ctype='signed char', label='_unknown4'}, -- 0D 02 and 03 observed {ctype='signed char', label='Packet Number'}, -- 0E FF FF observed @@ -2592,8 +2592,8 @@ func.incoming[0x04C][0x0D] = L{ func.incoming[0x04C][0x0E] = L{ {ctype='unsigned char', label='_unknown1'}, -- 05 {ctype='unsigned char', label='Buy Status', fn=e+{'buy stat'}}, -- 06 - {ctype='unsigned char', label='_unknown2'}, -- 07 - {ctype='unsigned int', label='Price', fn=gil}, -- 08 + {ctype='unsigned char', label='_unknown2'}, -- 07 + {ctype='unsigned int', label='Price', fn=gil}, -- 08 {ctype='unsigned short', label='Item ID', fn=item}, -- 0C {ctype='unsigned short', label='_unknown3'}, -- 0E {ctype='unsigned short', label='Count'}, -- 10 @@ -2758,7 +2758,7 @@ fields.incoming[0x056] = function (data, type) return (func.incoming[0x056][type or data and data:unpack('H',0x25)] or L{{ctype='data[32]', label='Quest Flags'}}) + func.incoming[0x056].type end -func.incoming[0x056].type = L{ +func.incoming[0x056].type = L{ {ctype='unsigned short',label='Type', fn=e+{'quest_mission_log'}} -- 24 } @@ -2827,7 +2827,7 @@ fields.incoming[0x058] = L{ -- Emote fields.incoming[0x05A] = L{ - {ctype='unsigned int', label='Player ID', fn=id}, -- 04 + {ctype='unsigned int', label='Player ID', fn=id}, -- 04 {ctype='unsigned int', label='Target ID', fn=id}, -- 08 {ctype='unsigned short', label='Player Index', fn=index}, -- 0C {ctype='unsigned short', label='Target Index', fn=index}, -- 0E @@ -2942,7 +2942,7 @@ fields.incoming[0x05E] = L{ {ctype='unsigned char', label="Days to tally"}, -- 8C Number of days to the next conquest tally {ctype='data[3]', label="_unknown4"}, -- 8D All Zeros, and changed nothing when 0xFF'd. {ctype='int', label='Conquest Points'}, -- 90 - {ctype='unsigned char', label="Beastmen region bar"}, -- 94 + {ctype='unsigned char', label="Beastmen region bar"}, -- 94 {ctype='data[12]', label="_unknown5"}, -- 95 Mostly zeros and noticed no change when 0xFF'd. -- These bytes are for the overview summary on the map. @@ -3013,15 +3013,15 @@ fields.incoming[0x061] = L{ {ctype='unsigned short', label='_unknown2'}, -- 4E {ctype='unsigned char', label='Nation'}, -- 50 0 = sandy, 1 = bastok, 2 = windy {ctype='unsigned char', label='_unknown3'}, -- 51 Possibly Unity ID (always 7 for me, I'm in Aldo's unity) - {ctype='unsigned char', label='Su Level'}, -- 52 + {ctype='unsigned char', label='Su Level'}, -- 52 {ctype='unsigned char', label='_unknown4'}, -- 53 Always 00 for me - {ctype='unsigned char', label='Maximum iLevel'}, -- 54 + {ctype='unsigned char', label='Maximum iLevel'}, -- 54 {ctype='unsigned char', label='iLevel over 99'}, -- 55 0x10 would be an iLevel of 115 - {ctype='unsigned char', label='Main Hand iLevel'}, -- 56 + {ctype='unsigned char', label='Main Hand iLevel'}, -- 56 {ctype='unsigned char', label='_unknown5'}, -- 57 Always 00 for me {ctype='bit[5]', label='Unity ID'}, -- 58 0=None, 1=Pieuje, 2=Ayame, 3=Invincible Shield, 4=Apururu, 5=Maat, 6=Aldo, 7=Jakoh Wahcondalo, 8=Naja Salaheem, 9=Flavira {ctype='bit[5]', label='Unity Rank'}, -- 58 Danger, 00ing caused my client to crash - {ctype='bit[17]', label='Unity Points'}, -- 59 + {ctype='bit[17]', label='Unity Points'}, -- 59 {ctype='bit[5]', label='_unknown6'}, -- 5A No obvious function {ctype='unsigned int', label='_junk1'}, -- 5C {ctype='unsigned int', label='_junk2'}, -- 60 @@ -3289,7 +3289,7 @@ fields.incoming[0x079] = L{ -- Guild Buy Response -- Sent when buying an item from a guild NPC fields.incoming[0x082] = L{ - {ctype='unsigned short', label='Item', fn=item}, -- 08 + {ctype='unsigned short', label='Item', fn=item}, -- 08 {ctype='unsigned char', label='_junk1'}, -- 0A No obvious purpose {ctype='unsigned char', label='Count'}, -- 0B Number you bought } @@ -3305,14 +3305,14 @@ fields.incoming[0x083] = L{ {ref=types.guild_entry, label='Item', count='30'}, -- 04 {ctype='unsigned char', label='Item Count'}, -- F4 {ctype='bit[4]', label='Order'}, -- F5 - {ctype='bit[4]', label='_unknown'}, + {ctype='bit[4]', label='_unknown'}, {ctype='unsigned short', label='_padding'} -- F6 } -- Guild Sell Response -- Sent when selling an item to a guild NPC fields.incoming[0x084] = L{ - {ctype='unsigned short', label='Item', fn=item}, -- 08 + {ctype='unsigned short', label='Item', fn=item}, -- 08 {ctype='unsigned char', label='_junk1'}, -- 0A No obvious purpose {ctype='unsigned char', label='Count'}, -- 0B Number you bought. If 0, the transaction failed. } @@ -3322,7 +3322,7 @@ fields.incoming[0x085] = L{ {ref=types.guild_entry, label='Item', count='30'}, -- 04 {ctype='unsigned char', label='Item Count'}, -- F4 {ctype='bit[4]', label='Order'}, -- F5 - {ctype='bit[4]', label='_unknown'}, + {ctype='bit[4]', label='_unknown'}, {ctype='unsigned short', label='_padding'} -- F6 } -- Guild Open @@ -3457,10 +3457,10 @@ func.incoming[0x0C9][0x01] = L{ {ctype='unsigned char', label='Icon Set Subtype'}, -- 0E 0 = Unopened Linkshell?, 1 = Linkshell, 2 = Pearlsack, 3 = Linkpearl, 4 = Ripped Pearlsack (I think), 5 = Broken Linkpearl? {ctype='unsigned char', label='Icon Set ID'}, -- 0F This identifies the icon set, always 2 for linkshells. {ctype='data[16]', label='Linkshell', enc=ls_enc}, -- 10 6-bit packed - {ctype='bit[4]', label='_junk1'}, -- 20 + {ctype='bit[4]', label='_junk1'}, -- 20 {ctype='bit[4]', label='Linkshell Red'}, -- 20 0xGR, 0x-B - {ctype='bit[4]', label='Linkshell Green'}, -- 21 - {ctype='bit[4]', label='Linkshell Blue'}, -- 21 + {ctype='bit[4]', label='Linkshell Green'}, -- 21 + {ctype='bit[4]', label='Linkshell Blue'}, -- 21 {ctype='unsigned char', label='_unknown1'}, -- 22 {ctype='unsigned char', label='Sub Job', fn=job}, -- 23 {ctype='unsigned char', label='Main Job Level'}, -- 24 @@ -3476,7 +3476,7 @@ func.incoming[0x0C9][0x01] = L{ fields.incoming[0x0CA] = L{ {ctype='char[124]', label='Bazaar Message'}, -- 04 Terminated with a vertical tab {ctype='char[16]', label='Player Name'}, -- 80 - {ctype='unsigned short', label='Player Title ID'}, -- 90 + {ctype='unsigned short', label='Player Title ID'}, -- 90 {ctype='unsigned short', label='_unknown4'}, -- 92 00 00 observed. } diff --git a/addons/libs/slips.lua b/addons/libs/slips.lua index d3af947a71..860e12930d 100644 --- a/addons/libs/slips.lua +++ b/addons/libs/slips.lua @@ -34,7 +34,7 @@ slips.items = { [slips.storages[19]] = L{27715, 27866, 27716, 27867, 278, 281, 284, 3680, 3681, 27859, 28149, 27860, 28150, 21107, 21108, 27625, 27626, 26693, 26694, 26707, 26708, 27631, 27632, 26705, 26706, 27854, 27855, 26703, 26704, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 21097, 21098, 26717, 26718, 26728,26719,26720,26889,26890, 21095, 21096, 26738, 26739, 26729, 26730, 26788, 26946, 27281, 27455, 26789, 3698, 20713, 20714, 26798, 26954, 26799, 26955, 3706, 26956, 26957, 3705, 26964, 26965, 27291, 26967, 27293, 26966, 27292, 26968, 27294, 21153, 21154, 21086, 21087, 25606, 26974, 27111, 27296, 27467, 25607, 26975, 27112, 27297, 27468, 14195, 14830, 14831, 13945, 13946, 14832, 13947, 17058, 13948, 14400, 14392, 14393, 14394, 14395, 14396, 14397, 14398, 14399, 11337, 11329, 11330, 11331, 11332, 11333, 11334, 11335, 11336, 15819, 15820, 15821, 15822, 15823, 15824, 15825, 15826, 3670, 3672, 3661, 3595, 3665, 3668, 3663, 3674, 3667, 191, 28, 153, 151, 198, 202, 142, 134, 137, 340, 341, 334, 335, 337, 339, 336, 342, 338, 3631, 3632, 3625, 3626, 3628, 3630, 3627, 3633, 3629, 25632, 25633, 25604, 25713, 27325, 25714, 27326, 3651, 25711, 25712, 10925, 10948, 10949, 10950, 10951, 10952, 10953, 10954, 10955, 25657, 25756, 25658, 25757, 25909}, -- 192 [slips.storages[20]] = L{26740, 26898, 27052, 27237, 27411, 26742, 26900, 27054, 27239, 27413, 26744, 26902, 27056, 27241, 27415, 26746, 26904, 27058, 27243, 27417, 26748, 26906, 27060, 27245, 27419, 26750, 26908, 27062, 27247, 27421, 26752, 26910, 27064, 27249, 27423, 26754, 26912, 27066, 27251, 27425, 26756, 26914, 27068, 27253, 27427, 26758, 26916, 27070, 27255, 27429, 26760, 26918, 27072, 27257, 27431, 26762, 26920, 27074, 27259, 27433, 26764, 26922, 27076, 27261, 27435, 26766, 26924, 27078, 27263, 27437, 26768, 26926, 27080, 27265, 27439, 26770, 26928, 27082, 27267, 27441, 26772, 26930, 27084, 27269, 27443, 26774, 26932, 27086, 27271, 27445, 26776, 26934, 27088, 27273, 27447, 26778, 26936, 27090, 27275, 27449, 26780, 26938, 27092, 27277, 27451, 26782, 26940, 27094, 27279, 27453}, -- 110 [slips.storages[21]] = L{26741, 26899, 27053, 27238, 27412, 26743, 26901, 27055, 27240, 27414, 26745, 26903, 27057, 27242, 27416, 26747, 26905, 27059, 27244, 27418, 26749, 26907, 27061, 27246, 27420, 26751, 26909, 27063, 27248, 27422, 26753, 26911, 27065, 27250, 27424, 26755, 26913, 27067, 27252, 27426, 26757, 26915, 27069, 27254, 27428, 26759, 26917, 27071, 27256, 27430, 26761, 26919, 27073, 27258, 27432, 26763, 26921, 27075, 27260, 27434, 26765, 26923, 27077, 27262, 27436, 26767, 26925, 27079, 27264, 27438, 26769, 26927, 27081, 27266, 27440, 26771, 26929, 27083, 27268, 27442, 26773, 26931, 27085, 27270, 27444, 26775, 26933, 27087, 27272, 27446, 26777, 26935, 27089, 27274, 27448, 26779, 26937, 27091, 27276, 27450, 26781, 26939, 27093, 27278, 27452, 26783, 26941, 27095, 27280, 27454}, -- 110 - [slips.storages[22]] = L{25639, 25715, 25638, 3707, 3708, 21074, 26406, 25645, 25726, 25648, 25649, 25650, 25758, 25759, 25672, 25673, 282, 279, 280, 268, 25670, 25671, 26520, 25652, 25669, 22017, 22018, 25586, 25587, 10384, 10385, 22019, 22020, 25722, 25585, 25776, 25677, 25678, 25675, 25679, 20668, 20669, 22069, 25755, 3722, 21608, 3713, 3714, 3715, 3717, 3727, 3728, 20577, 3726, 20666, 20667, 21741, 21609, 3723, 26410, 26411, 25850, 21509, 3725, 3720, 21658, 26524, 20665, 26412, 21965, 21966, 21967, 25774, 25838, 25775, 25839, 3724, 3721, 21682, 22072, 21820, 21821, 23731, 26517, 23730, 20573, 20674, 21742, 21860, 22065, 22039, 22124, 22132, 3719, 3738, 26518, 27623, 21867, 21868, 22283, 26516, 20933, 20578, 20568, 3739, 20569, 20570, 22288, 26352, 23737, 22282, 3740, 0, 26545, 21977, 21978, 3742, 26519, 26514, 26515, 3743, 21636, 23753, 23754, 54, 25910, 20571, 23790, 23791, 26489, 22153, 22154, 20574, 20675, 21743, 21861, 22066, 3748, 21638, 23800, 23801, 3749, 3750, 22045, 22046, 3751}, -- 146 SE Skipped an index hence the 0 as one of the items + [slips.storages[22]] = L{25639, 25715, 25638, 3707, 3708, 21074, 26406, 25645, 25726, 25648, 25649, 25650, 25758, 25759, 25672, 25673, 282, 279, 280, 268, 25670, 25671, 26520, 25652, 25669, 22017, 22018, 25586, 25587, 10384, 10385, 22019, 22020, 25722, 25585, 25776, 25677, 25678, 25675, 25679, 20668, 20669, 22069, 25755, 3722, 21608, 3713, 3714, 3715, 3717, 3727, 3728, 20577, 3726, 20666, 20667, 21741, 21609, 3723, 26410, 26411, 25850, 21509, 3725, 3720, 21658, 26524, 20665, 26412, 21965, 21966, 21967, 25774, 25838, 25775, 25839, 3724, 3721, 21682, 22072, 21820, 21821, 23731, 26517, 23730, 20573, 20674, 21742, 21860, 22065, 22039, 22124, 22132, 3719, 3738, 26518, 27623, 21867, 21868, 22283, 26516, 20933, 20578, 20568, 3739, 20569, 20570, 22288, 26352, 23737, 22282, 3740, 0, 26545, 21977, 21978, 3742, 26519, 26514, 26515, 3743, 21636, 23753, 23754, 54, 25910, 20571, 23790, 23791, 26489, 22153, 22154, 20574, 20675, 21743, 21861, 22066, 3748, 21638, 23800, 23801, 3749, 3750, 22045, 22046, 3751, 26490, 26546, 22047, 22048, 22049}, -- 151 SE Skipped an index hence the 0 as one of the items [slips.storages[23]] = L{25659, 25745, 25800, 25858, 25925, 25660, 25746, 25801, 25859, 25926, 25663, 25749, 25804, 25862, 25929, 25664, 25750, 25805, 25863, 25930, 25665, 25751, 25806, 25865, 25931, 25666, 25752, 25807, 25866, 25932, 25661, 25747, 25802, 25860, 25927, 25662, 25748, 25803, 25861, 25928, 25667, 25753, 25808, 25867, 25933, 25668, 25754, 25809, 25868, 25934, 25579, 25779, 25818, 25873, 25940, 25580, 25780, 25819, 25874, 25941, 25590, 25764, 25812, 25871, 25937, 25591, 25765, 25813, 25872, 25938, 25581, 25781, 25820, 25875, 25942, 25582, 25782, 25821, 25876, 25943, 25588, 25762, 25810, 25869, 25935, 25589, 25763, 25811, 25870, 25936, 25583, 25783, 25822, 25877, 25944, 25584, 25784, 25823, 25878, 25945, 25574, 25790, 25828, 25879, 25946, 25575, 25791, 25829, 25880, 25947, 25576, 25792, 25830, 25881, 25948, 25577, 25793, 25831, 25882, 25949, 25578, 25794, 25832, 25883, 25950, 26204, 26205, 26206, 26207, 26208, 25569, 25797, 25835, 25886, 25953, 25573, 25796, 25834, 25885, 25952, 25570, 25798, 25836, 25887, 25954, 25572, 25795, 25833, 25884, 25951, 25571, 25799, 25837, 25888, 25955, 26211, 26210, 26212, 26209, 26213, 21863, 22004, 21744, 21272, 20576, 21761, 26409, 22070, 21681, 22005, 21745, 22068, 21759, 21770, 22067, 21680, 22071}, --177 [slips.storages[24]] = L{23040, 23107, 23174, 23241, 23308, 23041, 23108, 23175, 23242, 23309, 23042, 23109, 23176, 23243, 23310, 23043, 23110, 23177, 23244, 23311, 23044, 23111, 23178, 23245, 23312, 23045, 23112, 23179, 23246, 23313, 23046, 23113, 23180, 23247, 23314, 23047, 23114, 23181, 23248, 23315, 23048, 23115, 23182, 23249, 23316, 23049, 23116, 23183, 23250, 23317, 23050, 23117, 23184, 23251, 23318, 23051, 23118, 23185, 23252, 23319, 23052, 23119, 23186, 23253, 23320, 23053, 23120, 23187, 23254, 23321, 23054, 23121, 23188, 23255, 23322, 23055, 23122, 23189, 23256, 23323, 23056, 23123, 23190, 23257, 23324, 23057, 23124, 23191, 23258, 23325, 23058, 23125, 23192, 23259, 23326, 23059, 23126, 23193, 23260, 23327, 23060, 23127, 23194, 23261, 23328, 23061, 23128, 23195, 23262, 23329, 23062, 23129, 23196, 23263, 23330}, --115 [slips.storages[25]] = L{23375, 23442, 23509, 23576, 23643, 23376, 23443, 23510, 23577, 23644, 23377, 23444, 23511, 23578, 23645, 23378, 23445, 23512, 23579, 23646, 23379, 23446, 23513, 23580, 23647, 23380, 23447, 23514, 23581, 23648, 23381, 23448, 23515, 23582, 23649, 23382, 23449, 23516, 23583, 23650, 23383, 23450, 23517, 23584, 23651, 23384, 23451, 23518, 23585, 23652, 23385, 23452, 23519, 23586, 23653, 23386, 23453, 23520, 23587, 23654, 23387, 23454, 23521, 23588, 23655, 23388, 23455, 23522, 23589, 23656, 23389, 23456, 23523, 23590, 23657, 23390, 23457, 23524, 23591, 23658, 23391, 23458, 23525, 23592, 23659, 23392, 23459, 23526, 23593, 23660, 23393, 23460, 23527, 23594, 23661, 23394, 23461, 23528, 23595, 23662, 23395, 23462, 23529, 23596, 23663, 23396, 23463, 23530, 23597, 23664, 23397, 23464, 23531, 23598, 23665}, --115 diff --git a/addons/pointwatch/FIXING POINTWATCH.txt b/addons/pointwatch/FIXING POINTWATCH.txt deleted file mode 100644 index 61bb39cdaf..0000000000 --- a/addons/pointwatch/FIXING POINTWATCH.txt +++ /dev/null @@ -1,35 +0,0 @@ -Updating Message IDs: A guide - - Pointwatch relies on zone-based message IDs for some of its features. -These IDs change on a regular basis. Fortunately, their positions relative -to one another rarely change, which means that most of the time you only -have to change one number and the entire zone will work again. - -I have written this guide to explain how to change those numbers in the -hopes that members of the community will maintain pointwatch's message- -dependent features. - -Method 1 - POLUtils -1) Download POLUtils (if you don't already have it) from the google code site -2) Install it and run it -3) Click "FFXI Data Browser" -4) Go to the "Dialog Tables" menu and select the zone you are interested in -5) Wait for it to load, then export the entire table as xml -6) Open the xml file up in a text editor, like Notepad or Notepad++. -7) Control-F for the key phrase. -8) The associated message ID is the offset value for that zone. - -Method 2 - message_printing -1) Load Pointwatch (//lua l pointwatch) -2) Enable message printing (//pw message_printing) -3) Generate the key message (for instance, by resting in Abyssea) -4) This will print message IDs to your windower console. They appear in the - order they were generated. Select the one that you want (for instance, - the second one when you rest in Abyssea). -5) That value is your offset. -6) Disable message printing (//pw message_printing) - -Both methods: -* Open message_ids.lua -* Find the zone and replace the zone.offset value with the correct value. -* Submit your file to Github, so that everyone can have a working copy! diff --git a/addons/pointwatch/ReadMe.txt b/addons/pointwatch/ReadMe.txt index 4616a8c477..2143b47d8f 100644 --- a/addons/pointwatch/ReadMe.txt +++ b/addons/pointwatch/ReadMe.txt @@ -14,10 +14,6 @@ Text Box Commands: * bg_transparency - Changes the background transparency. Number should be between 0 and 1 ** pos_x, pos_y, pad, transparency, alpha, and bg_alpha are also valid commands and are documented in the texts library. -Other Commands: -* message_printing - See FIXING POINTWATCH.txt in this directory for a full explanation. - - Strings Options: The two strings options in settings.xml are loaded as Lua code and run accordingly, diff --git a/addons/pointwatch/pointwatch.lua b/addons/pointwatch/pointwatch.lua index 386869e397..4fc0ac0dda 100644 --- a/addons/pointwatch/pointwatch.lua +++ b/addons/pointwatch/pointwatch.lua @@ -64,10 +64,7 @@ packet_handlers = { [0x02A] = function(org) -- Resting message local p = packets.parse('incoming',org) local zone = 'z'..windower.ffxi.get_info().zone - if settings.options.message_printing then - print('Message ID: '..bit.band(p['Message ID'], 16383)) - end - + if messages[zone] then local msg = bit.band(p['Message ID'], 16383) for i,v in pairs(messages[zone]) do @@ -132,9 +129,12 @@ packet_handlers = { lp.number_of_merits = p['Merit Points'] lp.maximum_merits = p['Max Merit Points'] elseif p['Order'] == 5 then - local job = windower.ffxi.get_player().main_job_full - cp.current = p[job..' Capacity Points'] - cp.number_of_job_points = p[job..' Job Points'] + local player = windower.ffxi.get_player() + if player then + local job = player.main_job_full + cp.current = p[job..' Capacity Points'] + cp.number_of_job_points = p[job..' Job Points'] + end end end, [0x110] = function(org) @@ -211,9 +211,6 @@ windower.register_event('addon command',function(...) windower.send_command('lua u pointwatch') elseif first_cmd == 'reset' then initialize() - elseif first_cmd == 'message_printing' then - settings.options.message_printing = not settings.options.message_printing - print('Pointwatch: Message printing is '..tostring(settings.options.message_printing)..'.') elseif first_cmd == 'eval' then assert(loadstring(table.concat(commands, ' ')))() end diff --git a/addons/pointwatch/statics.lua b/addons/pointwatch/statics.lua index bf87bc2ea7..5afd4af9e0 100644 --- a/addons/pointwatch/statics.lua +++ b/addons/pointwatch/statics.lua @@ -60,10 +60,7 @@ default_settings = { green = 255, blue = 255 } - }, - options = { - message_printing = false, - }, + } } -- Approved textbox commands: