Revision for “Target Injured Friendly – by Khyro” created on February 19, 2024 @ 09:10:47
Title | Target Injured Friendly - by Khyro |
---|---|
Content | Edit your <b>Actions.lua</b> file, and add the following to the file (can be anywhere, bottom is fine):
<pre class="CodeBlock">function Actions.InjuredFriendly()
local lowerId = 0
local lowerHP = -1
for i = 1, table.getn(MobilesOnScreen.MobilesSort) do
local mobileId = MobilesOnScreen.MobilesSort[i]
local data = WindowData.MobileName[mobileId]
local noto = data.Notoriety+1
if (Actions.TargetAllowed(mobileId) and not IsPartyMember(mobileId) and noto == NameColor.Notoriety.INNOCENT) then
local mobileData = Interface.GetMobileData(mobileId, true)
if mobileData then
local curHealth = mobileData.CurrentHealth
if (curHealth < 25) then
if curHealth < lowerHP or lowerHP == -1 then
lowerHP = curHealth
lowerId = mobileId
end
end
end
end
end
if (lowerId ~= 0) then
HandleSingleLeftClkTarget(lowerId)
end
end</pre>
Then create a Macro with a command block for this:
<pre class="CodeBlock">script Actions.InjuredFriendly()</pre>
This will target the most critically injured blue mobile near you that isn't in your party. It scans the blue mobiles bars, so they must be enabled.
You can add this to the targeting action window as well if you want so you don't have to use a Command block each time.
Edit <b>ActionsWindow.lua</b>
Go to line 274 and after "ActionsWindow.ActionData[5207]" add the following line:
<b>
</b>
<pre class="CodeBlock">ActionsWindow.ActionData[5208] = { type=SystemData.UserAction.TYPE_SPEECH_USER_COMMAND, inActionWindow=true, iconId=865002, detailString=L"Targest Lowest Health Friendly", nameString=L"Target Injured Friendly", callback=L"script Actions.InjuredFriendly()" }<b>
</b></pre>
Then go down to what should now be line 441, which has "ActionsWindow.Groups[6]", and in the number index on that line, add 5208 to the list:
<b>
</b>
<pre class="CodeBlock">ActionsWindow.Groups[6] = { nameString=L"Targeting", nameTid=1079383, index={ 55, 22, 71, 77, 23, 72, 78, 24, 73, 79, 69, 74, 80, 70, 75, 81, 25, 76, 82, 11, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208 } }<b>
</b></pre>
This should put this new targeting action in the Actions list under Targeting<b>
</b>
To add this to your ui you will need to add a folder 'source' and put the changed .lua files in it.
Directory Structure
...\UserInterface\my-ui
-----\Icons...
-----\Source
----------Actions.lua
or ...\UserInterface\my-ui
-----\Icons...
-----\Source
----------Actions.lua
----------ActionsWindow.lua
|
Excerpt |