Code: Select all
function OnLoad()
Settings = Include( "OfficialGrinderFramework/Settings.lua" );
Helper = Include( "OfficialGrinderFramework/HelperFunction.lua" );
Settings:Initialize();
Class = Include( "OfficialGrinderFramework/Classes/" .. Player:GetClass():ToString() .. ".lua" );
end
function OnFrame()
-- Check if we are currently moving, when we are, we cannot do this.
if not Player:IsMoving() and not Player:IsResting() then
-- Check if we need to perform kind of healing routine.
if Class.Heal ~= nil and not Class:Heal( true ) then
return false;
end
-- Check the force members and see if we have to do anything.
if Class.Force ~= nil and not Class:Force() then
return false;
end
-- Check if we need to perform kind of healing routine.
if Class.Heal ~= nil and not Class:Heal( false ) then
return false;
end
end
-- Initialize the variable that we need to hold the target entity.
local Entity = EntityList:GetEntity( Player:GetTargetID());
-- Check if the entity is valid and if it is alive.
if Entity ~= nil and not Entity:IsDead() and not Entity:IsFriendly() then
Class:Attack(Entity, Entity:GetPosition():DistanceToPosition( Player:GetPosition()), false);
else
for ID, Entity in DictionaryIterator( EntityList:GetList()) do
-- Check if the entiy is valid.
if Entity ~= nil then
-- Check entity name
if ResonatorMobCheck( Entity) == true then
-- Check distance
if Entity:GetPosition():DistanceToPosition( Player:GetPosition()) <= 20 then
Player:SetTarget(Entity);
Class:Attack(Entity, Entity:GetPosition():DistanceToPosition( Player:GetPosition()), false);
end
end
end
end
end
end
-- "Id Resonator", "Elite Siege Cannon of the Hyperion Defence"
function ResonatorMobCheck(Entity)
if Entity ~= nil and not Entity:IsDead() then
if Entity:GetName()=="Elite Siege Cannon of the Hyperion Defence" or Entity:GetName()=="Id Resonator" then
local EntityState = Entity:GetState();
if EntityState:GetState( "Id Aetheric Field" ) == nil then
--Write("unita list".. Entity:GetName());
return true;
end
end
end
return false;
end
function Attack ( Entity, Range, Stunned)
return Class:Attack ( Entity, Range, Stunned);
end
function Heal (CombatEnabled)
return Class:Heal(CombatEnabled);
end
function Pause()
return Class:Pause()
end