First Release Version. Version 1.1
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
-- The alchemist implementation variables
|
||||
alchemist = alchemist or {}
|
||||
alchemist.pid = nil
|
||||
alchemist.specialty = nil
|
||||
alchemist.balances = alchemist.balances or {}
|
||||
alchemist.balances.homunculus = true
|
||||
alchemist.balances.humor = true
|
||||
alchemist.humors = alchemist.humors or {}
|
||||
alchemist.humors.table = {
|
||||
"Sanguine",
|
||||
"Sanguine",
|
||||
@@ -22,12 +22,12 @@ alchemist.inundate = false
|
||||
-- NOTE: This script was written for a Sublimation user and primarily pushes keeping class specific weaknesses and using bleeding/aurify as a killpath
|
||||
function alchemist.decideAction()
|
||||
if gmcp.Char.Status.class ~= "Alchemist" then
|
||||
cecho("\n<firebrick>(BadPVP): Called Alchemist decision engine when not a Alchemist.")
|
||||
cecho("\n<firebrick>COMBAT NOTICE: Called Alchemist decision engine when not a Alchemist.")
|
||||
return
|
||||
end
|
||||
|
||||
if not target or target == nil then
|
||||
cecho("\n<firebrick>(BadPVP): Called decision engine without a target.")
|
||||
if not target or target == nil or target == "None" or target == "Dude" then
|
||||
cecho("\n<firebrick>COMBAT NOTICE: Called decision engine without a target.")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -40,10 +40,10 @@ function alchemist.decideAction()
|
||||
local affsReport = {}
|
||||
local enemyClass = nil
|
||||
local humors = {
|
||||
choleric = ak.alchemist.humour.choleric or 0,
|
||||
melancholic = ak.alchemist.humour.melancholic or 0,
|
||||
phlegmatic = ak.alcehmist.humour.phlegmatic or 0,
|
||||
sanguine = ak.alchemist.humour.sanguine or 0
|
||||
Choleric = ak.alchemist.humour.choleric or 0,
|
||||
Melancholic = ak.alchemist.humour.melancholic or 0,
|
||||
Phlegmatic = ak.alchemist.humour.phlegmatic or 0,
|
||||
Sanguine = ak.alchemist.humour.sanguine or 0
|
||||
}
|
||||
|
||||
if table.contains(Legacy.CT.Enemies, target) then
|
||||
@@ -77,12 +77,12 @@ function alchemist.decideAction()
|
||||
table.insert(commandString, "homunculus corrupt " .. target)
|
||||
table.insert(affsReport, "homunculus corruption")
|
||||
alchemist.balances.homunculus = false
|
||||
alchemist.hopid = tempTimer(12, alchemist.resetBalance("homunculus"))
|
||||
tempTimer(12, function() alchemist.resetBalance("homunculus") end)
|
||||
else
|
||||
-- Just attack
|
||||
table.insert(commandString, "homunculus attack " .. target)
|
||||
alchemist.balances.homunculus = false
|
||||
alchemist.hopid = tempTimer(3, alchemist.resetBalance("homunculus"))
|
||||
tempTimer(3, function() alchemist.resetBalance("homunculus") end)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -90,20 +90,20 @@ function alchemist.decideAction()
|
||||
-- temper target humour (1.7 seconds Humor)
|
||||
-- inundate target humor (1.7 seconds humor)
|
||||
-- This will rotate through the alchemist.humors.table and temper those humors in order until it is time to inundate
|
||||
if humors.sanguine > 2 then
|
||||
if humors.Sanguine > 2 then
|
||||
-- push inundate at 3+ sanguine to push bleeding
|
||||
table.insert(commandString, "inundate " .. target .. " sanguine")
|
||||
table.insert(affsReport, "bleeding")
|
||||
alchemist.hupid = tempTimer(1.7, alchemist.resetBalance("humor"))
|
||||
tempTimer(1.7, function() alchemist.resetBalance("humor") end)
|
||||
alchemist.inundate = true
|
||||
elseif humors.phlegmatic >= 4 then
|
||||
elseif humors.Phlegmatic >= 4 then
|
||||
-- For some reason, they allowed us to push phlegmatic very high so inundate this for extra affs
|
||||
table.insert(commandString, "inundate " .. target .. " phlegmatic")
|
||||
table.insert(affsReport, "lethargy")
|
||||
if humors.phlegmatic >= 4 then table.insert(affsReport, "anorexia") end
|
||||
if humors.phlegmatic >= 6 then table.insert(affsReport, "slickness") end
|
||||
if humors.phlegmatic >= 8 then table.insert(affsReport, "weariness") end
|
||||
alchemist.hupid = tempTimer(1.7, alchemist.resetBalance("humor"))
|
||||
if humors.Phlegmatic >= 4 then table.insert(affsReport, "anorexia") end
|
||||
if humors.Phlegmatic >= 6 then table.insert(affsReport, "slickness") end
|
||||
if humors.Phlegmatic >= 8 then table.insert(affsReport, "weariness") end
|
||||
tempTimer(1.7, function() alchemist.resetBalance("humor") end)
|
||||
else
|
||||
-- Temper whatever humor we have
|
||||
local ourHumor = alchemist.humors.table[alchemist.humors.index]
|
||||
@@ -111,12 +111,12 @@ function alchemist.decideAction()
|
||||
table.insert(affsReport, "tempered" .. ourHumor .. "(" .. tostring(humors[ourHumor] + 1) .. ")")
|
||||
alchemist.humors.index = alchemist.humors.index + 1
|
||||
if alchemist.humors.index > #alchemist.humors.table then alchemist.humors.index = 1 end
|
||||
alchemist.hupid = tempTimer(1.7, alchemist.resetBalance("humor"))
|
||||
tempTimer(1.7, function() alchemist.resetBalance("humor") end)
|
||||
end
|
||||
|
||||
-- Educe
|
||||
local hpPercent = ((gmcp.Char.Vitals.hp / gmcp.Char.Vitals.maxhp) * 100)
|
||||
if alchemist.wrackCount ~= 0 and alchemist.wrackcount % 3 ~= 0 then
|
||||
if alchemist.wrackCount ~= 0 and alchemist.wrackCount % 3 ~= 0 then
|
||||
-- Educe here as we aren't truewracking
|
||||
if ak.defs.shield then
|
||||
-- Break Shield
|
||||
@@ -161,9 +161,6 @@ function alchemist.decideAction()
|
||||
send("queue addclearfull eqbal murder")
|
||||
send("pt " .. target .. " hit with " .. table.concat(affsReport, " "))
|
||||
|
||||
if fighter.automate then
|
||||
alchemist.pid = registerAnonymousEventHandler("gmcp.Char.Vitals", "alchemist.isReady")
|
||||
end
|
||||
end
|
||||
|
||||
-- Functioned used to reset special class balances for Alchemist
|
||||
@@ -171,14 +168,11 @@ function alchemist.resetBalance(which)
|
||||
if which == "homunculus" then
|
||||
alchemist.balances.homunculus = true
|
||||
cecho("\n<firebrick>COMBAT NOTICE: Homunculus balance restored.")
|
||||
killTimer(alchemist.hopid)
|
||||
elseif which == "humor" then
|
||||
alchemist.balances.humor = true
|
||||
cecho("\n<firebrick>COMBAT NOTICE: Humor balance restored.")
|
||||
killTimer(alchemist.hupid)
|
||||
else
|
||||
cecho("\n<firebrick>COMBAT NOTICE: We were asked to reset the Alchemist balance " ..
|
||||
which .. " but that isn't a valid balance.")
|
||||
cecho("\n<firebrick>COMBAT NOTICE: We were asked to reset the Alchemist balance " .. which .. " but that isn't a valid balance.")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -198,22 +192,9 @@ function alchemist.setSpecialty()
|
||||
end
|
||||
|
||||
if ourSpecialty == nil then
|
||||
cecho(
|
||||
"\n<firebrick>COMBAT NOTICE: No alchemy specialty found. If you have not yet embraced your class or you are not currently an Alchemist this is normal. Otherwise, this is an error.")
|
||||
cecho("\n<firebrick>COMBAT NOTICE: No alchemy specialty found. If you have not yet embraced your class or you are not currently an Alchemist this is normal. Otherwise, this is an error.")
|
||||
else
|
||||
alchemist.specialty = ourSpecialty
|
||||
cecho("\n<firebrick>COMBAT NOTICE: Set alchemy specialty to " .. ourSpecialty)
|
||||
end
|
||||
end
|
||||
|
||||
-- This function is responsible for automating the combat system
|
||||
-- This is an example of one that handles multiple balance timers
|
||||
function alchemist.isReady()
|
||||
-- Skip if we are still off balance
|
||||
if (gmcp.Char.Vitals.eq == 0) or (gmcp.Char.Vitals.bal == 0) then return end
|
||||
-- We want to make sure we at least have humor balance (Which we should generally)
|
||||
if not alchemist.balances.humor then return end
|
||||
|
||||
killAnonymousEventHandler(alchemist.pid)
|
||||
alchemist.decideAction()
|
||||
end
|
||||
|
@@ -2,8 +2,7 @@ fighter = fighter or {}
|
||||
|
||||
function fighter.Setup()
|
||||
fighter.classes = {}
|
||||
fighter.automate = false
|
||||
|
||||
|
||||
-- To add a new class, put the name here
|
||||
fighter.classes.implemented = {
|
||||
"Psion",
|
||||
@@ -63,5 +62,68 @@ function fighter.Setup()
|
||||
-- This will set the variable alchemist.specialty to Sublimation or Formulation depending
|
||||
alchemist.setSpecialty()
|
||||
end
|
||||
|
||||
registerAnonymousEventHandler("sysLoadEvent", "fighter.Setup")
|
||||
|
||||
function fighter.verifyInstall(_, name)
|
||||
if name ~= "fighter" then return end
|
||||
fighter.Setup()
|
||||
end
|
||||
registerAnonymousEventHandler("sysInstall", "fighter.verifyInstall")
|
||||
|
||||
function fighter.verifyUninstall(_, name)
|
||||
if name ~= "fighter" then return end
|
||||
fighter = nil
|
||||
alchemist = nil
|
||||
psion = nil
|
||||
end
|
||||
registerAnonymousEventHandler("sysUninstall", "fighter.verifyUninstall")
|
||||
|
||||
function fighter.generateHelp()
|
||||
local tablemaker = require("Fighter.MDK.ftext").TableMaker
|
||||
local formatter = require ("Fighter.MDK.ftext").TextFormatter
|
||||
|
||||
headerFormat = formatter:new({
|
||||
width = 80,
|
||||
cap = "<|",
|
||||
capColor = "<DarkSlateBlue>",
|
||||
textColor = "<white>",
|
||||
spacerColor = "<steel_blue>",
|
||||
inside = false,
|
||||
spacer = " ",
|
||||
alignment = "center",
|
||||
mirror = true
|
||||
})
|
||||
|
||||
helpTable = tablemaker:new({
|
||||
title = "Fighter Help",
|
||||
printTitle = false,
|
||||
printHeaders = true,
|
||||
frameColor = "<steel_blue>",
|
||||
separateRows = false,
|
||||
forceHeaderSeparator = true
|
||||
})
|
||||
helpTable:addColumn({
|
||||
name = "Command",
|
||||
width = 30,
|
||||
textColor = "<DarkSlateBlue>"
|
||||
})
|
||||
helpTable:addColumn({
|
||||
name = "Description",
|
||||
width = 50,
|
||||
textColor = "<DarkSlateGrey>"
|
||||
})
|
||||
--pvp
|
||||
helpTable:addRow({
|
||||
"fight",
|
||||
"Generate your next pvp action."
|
||||
})
|
||||
--pvpnt
|
||||
helpTable:addRow({
|
||||
"<LightSlateBlue>fighthelp",
|
||||
"<LightSlateGrey>Display this menu."
|
||||
})
|
||||
|
||||
cecho(headerFormat:format("Fighter Help Docs"))
|
||||
cecho(helpTable:assemble())
|
||||
|
||||
end
|
@@ -1,18 +1,17 @@
|
||||
-- Psion Implementation Variables
|
||||
psion = psion or {}
|
||||
psion.timeToFlurry = false
|
||||
psion.pid = nil
|
||||
|
||||
-- The primary function to build pvp actions for the psion class
|
||||
-- NOTE: This script primarily pushes for keeping specific class weaknesses applied and stacking unweaved body/mind until it can be inverted to spirit and flurried against
|
||||
function psion.decideAction()
|
||||
if gmcp.Char.Status.class ~= "Psion" then
|
||||
cecho("\n<firebrick>(BadPVP): Called Psion decision engine when not a Psion.")
|
||||
cecho("\n<firebrick>COMBAT NOTICE: Called Psion decision engine when not a Psion.")
|
||||
return
|
||||
end
|
||||
|
||||
if not target or target == nil then
|
||||
cecho("\n<firebrick>(BadPVP): Called decision engine without a target.")
|
||||
if not target or target == nil or target == "None" or target == "Dude" then
|
||||
cecho("\n<firebrick>COMBAT NOTICE: Called decision engine without a target.")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -187,11 +186,3 @@ function psion.decideAction()
|
||||
psion.pid = registerAnonymousEventHandler("gmcp.Char.Vitals", "psion.isReady")
|
||||
end
|
||||
end
|
||||
|
||||
-- This function is responsible for automating the combat system
|
||||
function psion.isReady()
|
||||
if (gmcp.Char.Vitals.eq == 0) or (gmcp.Char.Vitals.bal == 0) then return end
|
||||
|
||||
killAnonymousEventHandler(psion.pid)
|
||||
psion.decideAction()
|
||||
end
|
||||
|
Reference in New Issue
Block a user