Skip to content

Commit

Permalink
Updated messages and minor fix
Browse files Browse the repository at this point in the history
Updated messages and minor fix
  • Loading branch information
KenshiDRK committed Dec 10, 2018
1 parent e21876d commit 88c0877
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 37 deletions.
33 changes: 23 additions & 10 deletions OmenHelper/OmenHelper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function party_size(message_id)
return objetives_table[message_id] * party_size
end

--Omen messages in rom/353/58.dat
windower.register_event('incoming chunk',function(id, data)
local zone_id = windower.ffxi.get_info().zone
if id == 0x00B and objetives_text:visible() then
Expand Down Expand Up @@ -97,9 +98,9 @@ windower.register_event('incoming chunk',function(id, data)
return
end
local message_id = packet['Message ID'] - 0x8000
if S{7316, 7320, 7321, 7322}:contains(message_id) then
if S{7319, 7323, 7324, 7325}:contains(message_id) then
mains['Main_Objetive'] = get_messages(message_id, packet['Param 1'], packet['Param 2'], packet['Param 3'], packet['Param 4'])
if S{7320, 7321, 7322}:contains(message_id) then
if S{7323, 7324, 7325}:contains(message_id) then
subs_bool = false
else
subs_bool = true
Expand All @@ -109,13 +110,13 @@ windower.register_event('incoming chunk',function(id, data)
end
end
objetives_text:update(mains)
elseif S{7326, 7327}:contains(message_id) then
elseif S{7329, 7330}:contains(message_id) then
start_time = packet['Param 1']
end_time = os.time() + start_time
elseif message_id == 7328 then
elseif message_id == 7331 then
subs['current_'..packet['Param 1']] = '\\cs(0,255,0)Completed!\\cr'
objetives_text:update(subs)
elseif S{7330, 7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338}:contains(message_id) then
elseif S{7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341}:contains(message_id) then
local current_progress = {}
if packet['Param 4'] == 0 then
subs['Sub_Objetive_'..packet['Param 1']] = get_messages(message_id, packet['Param 1'], packet['Param 2'], packet['Param 3'], packet['Param 4'])
Expand Down Expand Up @@ -146,7 +147,7 @@ windower.register_event('incoming chunk',function(id, data)
subs['current_'..packet['Param 1']] = '\\cs(0,255,0)Completed!\\cr'
end
objetives_text:update(subs)
elseif S{7339, 7341, 7343, 7345}:contains(message_id) then --Progress for this objetives goes on other messages
elseif S{7342, 7344, 7346, 7348}:contains(message_id) then --Progress for this objetives goes on other messages
subs['Sub_Objetive_'..packet['Param 1']] = get_messages(message_id, packet['Param 1'], packet['Param 2'], packet['Param 3'], packet['Param 4'])
if not objetives[packet['Param 1']] then
objetives[packet['Param 1']] = true
Expand All @@ -165,7 +166,7 @@ windower.register_event('incoming chunk',function(id, data)
subs['current_'..packet['Param 1']] = '\\cs(0,255,0)Completed!\\cr'
end
objetives_text:update(subs)
elseif S{7340, 7342, 7344, 7346}:contains(message_id) then --Progression messages for some objetives (adding failed and completed just to make sure, as it could go on both)
elseif S{7343, 7345, 7347, 7349}:contains(message_id) then --Progression messages for some objetives (adding failed and completed just to make sure, as it could go on both)
subs['Sub_Objetive_'..packet['Param 1']] = get_messages(message_id, packet['Param 1'], packet['Param 2'], packet['Param 3'], packet['Param 4'])
if not objetives[packet['Param 1']] then
objetives[packet['Param 1']] = true
Expand All @@ -184,7 +185,7 @@ windower.register_event('incoming chunk',function(id, data)
subs['current_'..packet['Param 1']] = '\\cs(0,255,0)Completed!\\cr'
end
objetives_text:update(subs)
elseif S{7347}:contains(message_id) then
elseif S{7350}:contains(message_id) then
subs['Sub_Objetive_'..packet['Param 1']] = get_messages(message_id, packet['Param 1'], packet['Param 2'], packet['Param 3'], packet['Param 4'])
if not objetives[packet['Param 1']] then
objetives[packet['Param 1']] = true
Expand All @@ -204,7 +205,7 @@ windower.register_event('incoming chunk',function(id, data)
subs['current_'..packet['Param 1']] = '\\cs(0,255,0)Completed!\\cr'
end
objetives_text:update(subs)
elseif message_id == 7324 then
elseif message_id == 7327 then
if packet['Param 1'] == 666 then
mains['omens'] = '\\cs(0,255,0)' ..packet['Param 1'].. '\\cr'
else
Expand All @@ -216,7 +217,7 @@ windower.register_event('incoming chunk',function(id, data)
local packet = packets.parse('incoming', data)
mains['Main_Objetive'] = get_messages(packet['Message ID'], 0, 0, 0, 0)
subs_bool = true
if packet['Message ID'] == 7325 then
if packet['Message ID'] == 7326 then
mains['current'] = ''
start_kills = 0
end
Expand All @@ -228,6 +229,10 @@ windower.register_event('incoming chunk',function(id, data)
local actual_kills = start_kills + 1
start_kills = actual_kills
mains['current'] = total_kills - actual_kills
if mains['current'] <= 0 then
mains['Main_Objetive'] = '\\cs(0,255,0)Completed!\\cr'
mains['current'] = ''
end
objetives_text:update(mains)
end
elseif id == 0x05C then --wipe the secondary objetives after warping floor
Expand All @@ -247,6 +252,14 @@ windower.register_event('incoming chunk',function(id, data)
start_time = 0
initialize(objetives_text, settings)
objetives_text:update(mains)
elseif id == 0x00E then
local packet = packets.parse('incoming', data)
local mob = windower.ffxi.get_mob_by_id(packet['NPC'])
if mob and mob.name == 'Ethereal Ingress' and packet['_unknown2'] == 768 then
mains['Main_Objetive'] = '\\cs(0,255,0)Completed!\\cr'
mains['current'] = ''
objetives_text:update(mains)
end
end
end)

Expand Down
54 changes: 27 additions & 27 deletions OmenHelper/messages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ function get_messages(id, param0, param1, param2, param3)
local Miniboss = {[0] = "Thinker", [1] = "Craver", [2] = "Gorger"}
local Boss = {[0] = "Kin", [1] = "Gin", [2] = "Kei", [3] = "Kyou", [4] = "Fu", [5] = "Ou"}
messages = {
[7315] = 'Kill all Transcended foes',
[7316] = 'Kill '..param0..' Sweetwater foe'..(param0 > 1 and 's' or '')..': ',
[7317] = 'Kill 1 specific foe',
[7318] = 'Kill all foes',
[7319] = '\\cs(0,255,0)Free floor!\\cr',
[7320] = param0 <= 2 and 'Kill Glassy '..Miniboss[param0] or '',
[7321] = param0 <= 5 and 'Kill '..Boss[param0] or '',
[7322] = 'Open '..param0..' Treasure Portent'..(param0 > 1 and 's' or ''),
[7323] = '\\cs(0,255,0)Completed!\\cr',
[7330] = param0..': '..param1..' skillchain'..(param1 > 1 and 's' or '')..' ('..(param1 + 1)..' Steps): ',
[7331] = param0..': '..param1..' Critical Hits: ',
[7332] = param0..': Kill '..param1..' foe'..(param1 > 1 and 's' or '')..': ',
[7333] = param0..': '..param1..' Spells on foes: ',
[7334] = param0..': '..param1..' abilities on foes: ',
[7335] = param0..': '..param1..' physical WSs: ',
[7336] = param0..': '..param1..' elemental WSs: ',
[7337] = param0..': '..param1..' Weapon Skills: ',
[7338] = param0..': '..param1..' MB on foes: ',
[7339] = param0..': 2000+ dmg on Attack Round: ',
[7340] = param0..': 2000+ dmg on Attack Round: ',
[7341] = param0..': 30000+ Weapon Skill dmg: ',
[7342] = param0..': 30000+ Weapon Skill dmg: ',
[7343] = param0..': 15000+ Mdmg no MB: ',
[7344] = param0..': 15000+ Mdmg no MB: ',
[7345] = param0..': 30000+ MB dmg: ',
[7346] = param0..': 30000+ MB dmg: ',
[7347] = param0..': 10 500+ Heals: ',
[7318] = 'Kill all Transcended foes',
[7319] = 'Kill '..param0..' Sweetwater foe'..(param0 > 1 and 's' or '')..': ',
[7320] = 'Kill 1 specific foe',
[7321] = 'Kill all foes',
[7322] = '\\cs(0,255,0)Free floor!\\cr',
[7323] = param0 <= 2 and 'Kill Glassy '..Miniboss[param0] or '',
[7324] = param0 <= 5 and 'Kill '..Boss[param0] or '',
[7325] = 'Open '..param0..' Treasure Portent'..(param0 > 1 and 's' or ''),
[7326] = '\\cs(0,255,0)Completed!\\cr',
[7333] = param0..': '..param1..' skillchain'..(param1 > 1 and 's' or '')..' ('..(param1 + 1)..' Steps): ',
[7334] = param0..': '..param1..' Critical Hits: ',
[7335] = param0..': Kill '..param1..' foe'..(param1 > 1 and 's' or '')..': ',
[7336] = param0..': '..param1..' Spells on foes: ',
[7337] = param0..': '..param1..' abilities on foes: ',
[7338] = param0..': '..param1..' physical WSs: ',
[7339] = param0..': '..param1..' elemental WSs: ',
[7340] = param0..': '..param1..' Weapon Skills: ',
[7341] = param0..': '..param1..' MB on foes: ',
[7342] = param0..': 2000+ dmg on Attack Round: ',
[7343] = param0..': 2000+ dmg on Attack Round: ',
[7344] = param0..': 30000+ Weapon Skill dmg: ',
[7345] = param0..': 30000+ Weapon Skill dmg: ',
[7346] = param0..': 15000+ Mdmg no MB: ',
[7347] = param0..': 15000+ Mdmg no MB: ',
[7348] = param0..': 30000+ MB dmg: ',
[7349] = param0..': 30000+ MB dmg: ',
[7350] = param0..': 10 500+ Heals: ',
}
return messages[id]
end

0 comments on commit 88c0877

Please sign in to comment.