Code: Select all
--[[
--------------------------------------------------
Copyright (C) 2017 mnwaxep
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
--------------------------------------------------
]]--
--- Perform the attack routine on the selected target.
--
-- @param Entity Contains the entity we have targeted.
-- @param double Contains the distance to the target
-- @param bool Indicates whether or not the target is stunned.
-- @return bool
function Attack( Entity, Range, Stunned )
local Range = Player:GetPosition():DistanceToPosition( Entity:GetPosition());
local Position = Player:GetPosition();
local EntityState = Entity:GetState();
local AttackRange = Player:GetAttackRange();
local EntityState = Entity:GetState();
----------------------------------------------
---------Check For Enemy do somethink---------
----------------------------------------------
-- Bullet of Silence
if Helper:CheckAvailable( "Projectile of Silence" ) and Entity:GetSkillID() ~= 0 and SkillList[Entity:GetSkillID()]:IsMagical() and Entity:GetSkillTime() >= 500 then
Helper:CheckExecute( "Projectile of Silence" );
return false;
end
----------------------------------------------
-----------------Remove Shock-----------------
----------------------------------------------
-- Remove Shock -> Steal Health
if Helper:CheckAvailable( "Seizure Projectile" ) and Player:GetHealth() < 70 then
Helper:CheckExecute( "Seizure Projectile" );
return false;
end
-- Remove Shock
if Helper:CheckAvailable( "Remove Shock" ) then
Helper:CheckExecute( "Remove Shock" );
return false;
end
----------------------------------------------
---------------------Buffs--------------------
----------------------------------------------
-- Buff: Promise of Magic Power
if Helper:CheckAvailable( "Promise of Magic Power" ) and EntityState:GetState( Helper:CheckName( "Promise of Magic Power II" )) == nil then
Helper:CheckExecute( "Promise of Magic Power" );
return false;
end
-- Buff: Gift of Magic Power I
if Helper:CheckAvailable( "Gift of Magic Power II" ) and EntityState:GetState( Helper:CheckName( "Gift of Magic Power I" )) == nil then
Helper:CheckExecute( "Gift of Magic Power I" );
return false;
end
-- Buff: Enhance Magic Projectile
if Helper:CheckAvailable( "Enhance Magic Projectile IV" ) and EntityState:GetState( Helper:CheckName( "Enhance Magic Projectile IV" )) == nil then
Helper:CheckExecute( "Enhance Magic Projectile IV" );
return false;
end
if Helper:CheckAvailable( "Magic Force" ) and Player:GetDP() >=2000 then
Helper:CheckExecute( "Magic Force");
return false;
end
----------------------------------------------
---------------Recovery Skills----------------
----------------------------------------------
-- Anti-Enemy Fire
if Helper:CheckAvailable( "Restoration Volley" ) and Player:GetHealth() < 70 then
Helper:CheckExecute( "Restoration Volley" );
return false;
end
-- Soul Extractor Shot III (Normal Stigma)
if Helper:CheckAvailable( "Soulsucker Shot" ) and Player:GetHealth() < 80 then
Helper:CheckExecute( "Soulsucker Shot" );
return false;
end
----------------------------------------------
-------------------Chain----------------------
----------------------------------------------
----------------------------------------------
-------------------Chain----------------------
----------------------------------------------
-- Pistol shot -> Repeated Volley -> Repeated Rapid Fire
if Helper:CheckAvailable( "Pistol shot" ) then
Helper:CheckExecute( "Pistol shot" );
elseif Helper:CheckAvailable( "Repeated Volley" ) then
Helper:CheckExecute( "Repeated Volley" );
elseif Helper:CheckAvailable( "Repeated Volley" ) then
Helper:CheckExecute( "Repeated Volley" );
Helper:CheckExecute( "Repeated Volley" );
Helper:CheckExecute( "Repeated Rapid Fire" );
Helper:CheckExecute( "Repeated Rapid Fire" );
return false;
end
-- Soul Shot -> Soul Volley -> Rapid Soul Fire
if Helper:CheckAvailable( "Soul Shot" ) then
Helper:CheckExecute( "Soul Shot" );
elseif Helper:CheckAvailable( "Soul Volley" ) then
Helper:CheckExecute( "Soul Volley" );
elseif Helper:CheckAvailable( "Soul Volley" ) then
Helper:CheckExecute( "Soul Volley" );
Helper:CheckExecute( "Soul Volley" );
Helper:CheckExecute( "Rapid Soul Fire" );
Helper:CheckExecute( "Rapid Soul Fire" );
return false;
end
if Entity:GetHealth() < 60 and Entity:GetHealth() > 30 and Helper:CheckAvailable( "Insert Magic Projectile" ) then
Helper:CheckExecute( "Insert Magic Projectile" );
return false;
end
--------------------------------------------
----------------Main Attacks----------------
--------------------------------------------
--Initial Attack : Rapid Volley II (Greater Stigma)
if Helper:CheckAvailable( "Rapid Volley" ) then
Helper:CheckExecute( "Rapid Volley" );
Helper:CheckExecute( "Rapid Volley" );
Helper:CheckExecute( "Rapid Volley" );
Helper:CheckExecute( "Rapid Volley " );
Helper:CheckExecute( "Rapid Volley" );
return false;
end
--------------------------------------------
----------------Main Attacks----------------
--------------------------------------------
--Initial Attack Immobilize : Encircling Bomb
if Helper:CheckAvailable( "Encircling Bomb" ) then
Helper:CheckExecute( "Encircling Bomb");
return false;
end
--Initial Attack : Pistol Shot
if Helper:CheckAvailable( "Pistol Shot" ) then
Helper:CheckExecute( "Pistol Shot" );
return false;
end
-- Bullet of Silence
if Helper:CheckAvailable( "Projectile of Silence" ) then
Helper:CheckExecute( "Projectile of Silence" );
return false;
end
--Initial Attack : Soul Shot
if Helper:CheckAvailable( "Sighting Shot" ) then
Helper:CheckExecute( "Sighting Shot" );
return false;
end
--Initial Attack : Lifeline Penetration II
if Helper:CheckAvailable( "Lifeline Penetration V" ) then
Helper:CheckExecute( "Lifeline Penetration V" );
return false;
end
--Initial Attack : Between the Eyes I
if Helper:CheckAvailable( "Between the Eyes II" ) then
Helper:CheckExecute( "Between the Eyes II" );
return false;
end
--Initial Attack : Aimed Shot
if Helper:CheckAvailable( "Aimed Shot" ) then
Helper:CheckExecute( "Aimed Shot" );
return false;
end
--Initial Attack : Aimed Wing Shot
if Helper:CheckAvailable( "Aimed Wing Shot" ) then
Helper:CheckExecute( "Aimed Wing Shot" );
return false;
end
--Initial Attack : Disrupter Shot
if Helper:CheckAvailable( "Disrupter Shot" ) then
Helper:CheckExecute( "Disrupter Shot" );
return false;
end
--Initial Attack : Aimed Weakpoint Shot
if Helper:CheckAvailable( "Aimed Weakpoint Shot" ) then
Helper:CheckExecute( "Aimed Weakpoint Shot" );
return false;
end
-- Initial Attack : Automatic Attack
if self.AttackStarted ~= Entity:GetID() then
self.AttackStarted = Entity:GetID();
Helper:CheckExecute( "Attack/Chat" );
return false;
end
end
--- Perform the required pause checks.
--
-- @return bool
function Pause()
local PlayerState = Player:GetState();
--Mana healing boost (Normal stigma)
if Helper:CheckAvailable( "Breath of Magic Power" ) and PlayerState:GetState( Helper:CheckName( "Breath of Magic Power" )) == nil then
Helper:CheckExecute( "Breath of Magic Power" );
return false;
end
if Helper:CheckAvailable( "Insert Magic Projectile" ) then
Helper:CheckExecute( "Insert Magic Projectile" );
return false;
end
-- Nothing was executed, continue with other functions.
return true;
end
Any bugs = PM me
