Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions behaviors/buffs.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'ffxi.recast';

local party = require('party');
local config = require('config');
local actions = require('actions');
Expand Down Expand Up @@ -246,4 +248,18 @@ function buffs:SneakyTime(levels)
end
end

function buffs:AbilityOnCD(abilityName)
local r = AshitaCore:GetResourceManager();
local onCD = false;
for x = 0, 31 do
if (ashita.ffxi.recast.get_ability_recast_by_index(x) > 0) then
local ability = r:GetAbilityByTimerId(ashita.ffxi.recast.get_ability_id_from_index(x));
if (ability.Name[0] == abilityName) then
onCD = true;
end
end
end
return onCD;
end

return buffs;
39 changes: 37 additions & 2 deletions jobs/sam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ local packets = require('packets');
local buffs = require('behaviors.buffs')
local healing = require('behaviors.healing');

local spell_levels = {};
local status = packets.status;
local abilities = packets.abilities;
local stoe = packets.stoe;

local ability_levels = {};
ability_levels[packets.abilities.THIRD_EYE] = 15;
ability_levels[packets.abilities.HASSO] = 25;
ability_levels[packets.abilities.MEDITATE] = 30;
ability_levels[packets.abilities.SEIGAN] = 35;
ability_levels[packets.abilities.SEKKANOKI] = 40;
ability_levels[packets.abilities.KONZENITTAI] = 65;

local jsam = {
spell_levels = spell_levels,
Expand All @@ -18,14 +27,15 @@ function jsam:tick()
local cnf = config:get();
local tid = AshitaCore:GetDataManager():GetTarget():GetTargetServerId();
local tp = AshitaCore:GetDataManager():GetParty():GetMemberCurrentTP(0);
local player = AshitaCore:GetDataManager():GetPlayer();

if (cnf.ATTACK_TID and tid ~= cnf.ATTACK_TID) then
cnf.ATTACK_TID = nil;
AshitaCore:GetChatManager():QueueCommand("/follow " .. cnf.leader, 1);
-- Attempt to weaponskill when you have TP
elseif (cnf.ATTACK_TID and tid == cnf.ATTACK_TID and tp >= 1000) then
if (cnf.WeaponSkillID ~= nil ) then
if AshitaCore:GetDataManager():GetPlayer():HasWeaponSkill(tonumber(cnf.WeaponSkillID)) then
if player:HasWeaponSkill(tonumber(cnf.WeaponSkillID)) then
for k, v in pairs(packets.weaponskills) do
if (tonumber(cnf.WeaponSkillID) == tonumber(v)) then
AshitaCore:GetChatManager():QueueCommand('/ws "' .. string.gsub(string.gsub(k,"_"," "),"TACHI","TACHI:") .. '" <t>', 1);
Expand All @@ -34,6 +44,31 @@ function jsam:tick()
end
end
end
if (party:GetBuffs(0)[packets.status.EFFECT_INVISIBLE]) then return end

if (buffs:IsAble(abilities.HASSO, ability_levels) and party:GetBuffs(0)[stoe.HASSO] ~= true and not(buffs:AbilityOnCD("Hasso"))) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(ability, '"Hasso"', '<me>'))
:next(partial(wait, 3))
:next(function(self) actions.busy = false; end));
return true;
end

local queueJobAbility = nil;
if not(buffs:AbilityOnCD("Meditate")) then
queueJobAbility = '"Meditate"';
--elseif not(buffs:AbilityOnCD("Third Eye")) then
-- queueJobAbility = '"Third Eye"';
end
if (queueJobAbility ~= nil) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(ability, queueJobAbility, '<me>'))
:next(partial(wait, 3))
:next(function(self) actions.busy = false; end));
return true;
end
end

function jsam:attack(tid)
Expand Down
22 changes: 22 additions & 0 deletions jobs/war.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ return {
AshitaCore:GetChatManager():QueueCommand("/follow " .. cnf.leader, 1);
end

if (party:GetBuffs(0)[packets.status.EFFECT_INVISIBLE]) then return end

local sub = AshitaCore:GetDataManager():GetPlayer():GetSubJob();
if (sub == Jobs.Dancer and cnf.ATTACK_TID ~= nil) then
Expand All @@ -38,6 +39,27 @@ return {
end
if (healing:DNCHeal(spell_levels)) then return end
end

local queueJobAbility = nil;
local queueTarget = nil;
if (not(buffs:AbilityOnCD("Provoke")) and cnf.ATTACK_TID ~= nil) then
queueJobAbility = '"Provoke"';
queueTarget = '<t>';
elseif not(buffs:AbilityOnCD("Warcry")) then
queueJobAbility = '"Warcry"';
queueTarget = '<me>';
elseif not(buffs:AbilityOnCD("Defender")) then
queueJobAbility = '"Defender"';
queueTarget = '<me>';
end
if (queueJobAbility ~= nil) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(ability, queueJobAbility, queueTarget))
:next(partial(wait, 3))
:next(function(self) actions.busy = false; end));
return true;
end
end,

attack = function(self, tid)
Expand Down
10 changes: 10 additions & 0 deletions packets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,16 @@ local packets = {
EFFECT_PUPPET_ROLL = 327,
EFFECT_DANCERS_ROLL = 328,
EFFECT_SCHOLARS_ROLL = 329,
EFFECT_HASSO = 353,
EFFECT_DRAIN_SAMBA = 368,
EFFECT_POISON_II = 540,
},

abilities = {
STEAL = 25,
THIRD_EYE = 46,
MEDITATE = 47,
WARDING_CIRCLE = 48,
PHANTOM_ROLL = 81,
FIGHTERS_ROLL = 82,
MONKS_ROLL = 83,
Expand All @@ -153,7 +158,11 @@ local packets = {
PUPPET_ROLL = 99,
DANCERS_ROLL = 100,
SCHOLARS_ROLL = 101,
HASSO = 157,
SEIGAN = 158,
DRAIN_SAMBA = 168,
SEKKANOKI = 214,
KONZENITTAI = 304
},

spells = {
Expand Down Expand Up @@ -514,5 +523,6 @@ stoe.VALOR_MINUET_II = status.EFFECT_MINUET;
stoe.VALOR_MINUET_III = status.EFFECT_MINUET;
stoe.SWORD_MADRIGAL = status.EFFECT_MADRIGAL;
stoe.BLADE_MADRIGAL = status.EFFECT_MADRIGAL;
stoe.HASSO = status.EFFECT_HASSO;

return packets;