-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addon "Better Check" created #2049
base: dev
Are you sure you want to change the base?
Changes from all commits
d46f978
ddcea49
04e966b
b5ba45c
3d6731e
2ebec94
0cb4fa4
7cd1d71
b7bddec
6f1acc1
845a4e8
32563d5
bdaabf7
14fcb65
94e642f
6d028d0
f5350f3
64336a7
9b053f7
50cd319
1080e44
f6d3b0d
4e76eea
ab45e71
88b096f
ac0a185
72b756f
81260b0
e85f172
137c0e7
86d935c
f1ae812
f4e08b1
0b260e1
96d8774
7f8777c
e3306b3
6d361b8
1cd59d3
2d626d7
2874d46
3c24ec3
6835e21
41389c3
7d28fda
6923844
8674899
5f70f73
cfa6e15
755d2a7
30ad293
f91b678
7700d85
e403df5
644a3b7
ad2efe6
4fba7a9
fe2b389
20a9430
77b2c84
48e7f3d
1ae26a5
fe7d796
0c76bb2
b5d6d82
17f591b
8bd4bc1
94302a4
6426cd0
f09151f
c70e4b3
c4c160b
dda6ca3
29d6a0e
194ceff
a2b045b
8582160
425df84
8f17534
be55431
16b3499
de61b2d
78fe1d2
cbe51ae
5512a80
8372e24
ceb9ef2
63c294d
5b8e331
83073da
f8d4bc4
2d77f3e
7f19856
b57d448
46caf0d
b42bd9e
c0bcc0e
05b2971
332c98c
780e841
66cade8
cba53dd
c8fa161
30b8859
42ed61c
290f004
9cfde8c
c9fdaa7
4d5c3c3
4a0a241
24f3fb0
3b2700c
116115e
272ce4e
0d7ca0c
93dd76e
d2eb063
f70c941
2f6edcb
191bc6f
99f001f
e863250
cf0f1ae
a827f92
2e28261
3f231c0
5820f92
19c6271
6160423
d828596
bbdabd2
318c06c
7ed5899
a95d56f
ed27828
8898ee7
5266cf6
840f311
f10ba66
52b8e11
95e4697
ebef7d8
380bab5
b6ca5b5
42e0951
adbe571
4976f5e
955e608
e42e631
4648583
604d288
635318e
96f3852
23af758
2457d40
8d99469
7e1b699
45ed717
c6a20d0
47c8acc
0b74ca0
baacbcf
dbefed6
0cfab9b
6ea7d4b
04ca84c
a6f4394
2c9d0e6
a7c1546
97fb5a4
6f9a66d
47300e2
21ad3ea
0b78aeb
3c03b0f
dc7474d
f91eb07
c090358
3f07f71
1cebfa2
e5f19ed
9cf9d2b
8bd4324
3a64fda
331e0c3
e4cf9e9
df25880
55b8f98
b105643
6c8b61f
d85fff0
5db1339
8834cef
67125b9
b92307f
adea556
079a749
6a4aff4
1727dbd
2cec3f4
144651f
d2d6865
dff4790
208af0d
f123740
8137c01
99de2f3
e642a88
886f2b7
18fe5ab
8b30b37
7cabfab
06f7619
4bfb230
dc61272
eda1091
320e059
0eb3e39
16cb3cc
0de818d
6f9769d
3f3fdc7
be70e9d
16d1fe4
3ff8646
f63d708
0979e4f
b5acb93
e9af4b3
44daf4f
165d80a
657a54e
47a9bb3
4bc8e2a
39d1a48
95b8f72
1ed6b39
3342463
39fae0b
7d282da
62f8bea
f7b043f
8ea9cd4
57c8694
7fcd3b8
aed4210
ffcaaae
b9fa92c
30538bf
a04d4de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--[[ | ||
Copyright © 2021, Sephodious | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of Better Check nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL Sephodious BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
inspired by Battlemod (Byrth) from Windower and Checker (atom0s & Lolwutt) from Ashita | ||
]]-- | ||
|
||
_addon.name = 'Better Check' | ||
_addon.author = 'Sephodious' -- Rubenator basically wrote this with me, thanks again | ||
_addon.version = '1.0' | ||
|
||
-- sets local variables and requires | ||
local packets = require ('packets') | ||
local message_data = require ('resources').action_messages | ||
require('chat') | ||
require('sets') | ||
|
||
-- sets local tables | ||
local valid_message_ids = S{170,171,172,173,174,175,176,177,178} | ||
local mchal = {'Very Weak':color(259),'Inredibly Easy Prey':color(259),'Easy Prey':color(259),'A Decent Challenge':color(2),'Evenly Matched':color(53),'Tough':color(159),'Very Tough':color(124),'Incredibly Tough':color(167)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo on IEP - Inredibly should be Incredibly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to match in-game terms imo. |
||
local mstat = {'high evasion and defense','high evasion','high evasion but low defense','high defense','base defense and evasion','low defense','low evasion but high defense','low evasion','low evasion and defense'} | ||
|
||
|
||
-- uses incoming chunk so that we can block standard /check text | ||
windower.register_event('incoming chunk',function (id,original,modified,injected,blocked) | ||
|
||
-- ignores packets that don't begin with 29 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically it ignores packets that don't have ID 0x029 :) |
||
if id == 0x029 then | ||
|
||
local mobinfo = packets.parse('incoming', original) | ||
local message_id = mobinfo['Message'] | ||
|
||
-- tests message_id against valid_message_ids to ensure this only fires off if they match | ||
if valid_message_ids:contains(message_id) then | ||
|
||
local target = windower.ffxi.get_mob_by_id(mobinfo['Target']) or {name=('Unknown')} -- gets mob name | ||
local lvl = mobinfo['Param 1'] | ||
|
||
-- gets mob level | ||
if lvl > 0x7FFFFFFF then | ||
lvl = -1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think using something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -1 is in line with the behavior of battlemod. The value is used to describe the mobs one would fight at level 1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still feels wrong unless -1 is the actual value reported. Speaking of which, what is the actual value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh sorry nvm its reporting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay so Sephodious, we talked it over and if you
Just do
|
||
end | ||
|
||
local chal = mchal[mobinfo['Param 2'] - 63] | ||
local stat = mstat[message_id - 170] | ||
|
||
windower.add_to_chat(5, "The [%s] is (Lvl.%s), has ~%s~ and seems like its {%s}":format(target.name:color(2), tostring(lvl):color(213), stat:color(1), chal)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "seems like its" -> "seems like it's" |
||
return true -- blocks standard /check message | ||
|
||
-- sets output for NMs | ||
else if (message_id == 249) then | ||
local target = windower.ffxi.get_mob_by_id(mobinfo['Target']) or {name=('Unknown')} | ||
|
||
windower.add_to_chat(2, "[%s] Their power is over 9000!! (Impossible to gauge)":format(target.name:color(167))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if many people would appreciate that line 😅 Probably better to just use a neutral text, like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I lol'd . IDK how I feel about this one. Arcon makes a point but these add-ons are made by the community and a little personal flavor text never hurt anyone. Its not like we're some real project. |
||
return true -- blocks standard /check message | ||
|
||
end | ||
end | ||
end | ||
end) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Copyright © 2018, Sjshovan (Apogee) | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of Battle Stations nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL Sjshovan (Apogee) BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would split this table (and
mstat
as well) into multiple lines, just so the colors are more easily adjustable. This could also be made configurable via settings, so every user can define their own colors, but it's fine for the first version.