Gunslinger.lua by mnwaxep EU version

Post Reply
mnwaxep
Posts: 10
Joined: Wed Feb 15, 2017 1:53 am
Has thanked: 4 times
Been thanked: 3 times

Gunslinger.lua by mnwaxep EU version

Post by mnwaxep » Fri Mar 17, 2017 8:58 pm

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
1.0.0 test version.

Any bugs = PM me ;)

agonic
VIP
Posts: 159
Joined: Tue Jan 10, 2017 6:39 pm
Has thanked: 34 times
Been thanked: 112 times

Re: Gunslinger.lua by mnwaxep EU version

Post by agonic » Sun Mar 19, 2017 9:55 pm

Why do you use the skill levels like Between the Eyes "II", Lifeline Penetration "V" ? It was old system of aion.

ugel
Posts: 14
Joined: Thu Jan 19, 2017 9:42 am
Has thanked: 22 times
Been thanked: 4 times

Re: Gunslinger.lua by mnwaxep EU version

Post by ugel » Mon Mar 20, 2017 5:35 am

agonic wrote:
Sun Mar 19, 2017 9:55 pm
Why do you use the skill levels like Between the Eyes "II", Lifeline Penetration "V" ? It was old system of aion.
Script base coat on an old script from VaanC & Macrokor "(C) 2013" ;)
Very OLD V.I.P from aionscript.com orjange bowe :D

agonic
VIP
Posts: 159
Joined: Tue Jan 10, 2017 6:39 pm
Has thanked: 34 times
Been thanked: 112 times

Re: Gunslinger.lua by mnwaxep EU version

Post by agonic » Mon Mar 20, 2017 11:40 am

ugel wrote:
Mon Mar 20, 2017 5:35 am
agonic wrote:
Sun Mar 19, 2017 9:55 pm
Why do you use the skill levels like Between the Eyes "II", Lifeline Penetration "V" ? It was old system of aion.
Script base coat on an old script from VaanC & Macrokor "(C) 2013" ;)
But it says "Copyright (C) 2017 mnwaxep" :D

unkn0wnus3r
Posts: 75
Joined: Wed Jan 18, 2017 12:27 pm
Has thanked: 10 times
Been thanked: 13 times

Re: Gunslinger.lua by mnwaxep EU version

Post by unkn0wnus3r » Mon Jul 24, 2017 1:51 pm

made some small fixes and improvements:
- fixed some spell names
- no mana chain unless char is under 30% mana
- no pistol chain if the target is below 40% health
- added focused evasion if targed cast something

only testet the script with lvl 30 gunner.

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
	-------------------------------------
	--------------Evade------------------
	-------------------------------------
	if Entity:GetSkillID() ~= 0 then
	
		-- Attack 5: Focused Evasion
		if Helper:CheckAvailable( "Focused Evasion" ) then
			Helper:CheckExecute( "Focused Evasion" );
			return false;
		end
	end

	----------------------------------------------
	---------------------Buffs--------------------
	----------------------------------------------

	-- Buff: Promise of Magic Power 
	if Helper:CheckAvailable( "Promise of Magic Power" ) and EntityState:GetState( Helper:CheckName( "Promise of Magic Power" )) == nil then
	Helper:CheckExecute( "Promise of Magic Power" );
		return false;
	end

	-- Buff: Gift of Magic Power I 
	if Helper:CheckAvailable( "Gift of Magic Power" ) and EntityState:GetState( Helper:CheckName( "Gift of Magic Power" )) == nil then
		Helper:CheckExecute( "Gift of Magic Power" );
		return false;
	end

	-- Buff: Enhance Magic Projectile 
	if Helper:CheckAvailable( "Enhance Magic Projectile" ) and EntityState:GetState( Helper:CheckName( "Enhance Magic Projectile" )) == nil then
		Helper:CheckExecute( "Enhance Magic Projectile" );
		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" ) and Entity:GetHealth() < 40 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" ) and Player:GetManaCurrent() < Player:GetManaMaximum() * 0.3 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 
	if Helper:CheckAvailable( "Lifeline Penetration" ) then
		Helper:CheckExecute( "Lifeline Penetration" );
		return false;
	end

	--Initial Attack : Between the Eyes
	if Helper:CheckAvailable( "Between the Eyes" ) then
		Helper:CheckExecute( "Between the Eyes" );
		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

maq2285
Posts: 10
Joined: Wed Feb 22, 2017 9:12 am
Has thanked: 7 times

Re: Gunslinger.lua by mnwaxep EU version

Post by maq2285 » Sat Sep 23, 2017 8:18 am

- Unable to find a class or player controller!
- invalid arguments to method call

What am i doing wrong?
Last edited by maq2285 on Sun Sep 24, 2017 8:28 am, edited 1 time in total.

maq2285
Posts: 10
Joined: Wed Feb 22, 2017 9:12 am
Has thanked: 7 times

Re: Gunslinger.lua by mnwaxep EU version

Post by maq2285 » Sun Sep 24, 2017 8:28 am

unkn0wnus3r wrote:
Mon Jul 24, 2017 1:51 pm
made some small fixes and improvements:
- fixed some spell names
- no mana chain unless char is under 30% mana
- no pistol chain if the target is below 40% health
- added focused evasion if targed cast something

only testet the script with lvl 30 gunner.

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
	-------------------------------------
	--------------Evade------------------
	-------------------------------------
	if Entity:GetSkillID() ~= 0 then
	
		-- Attack 5: Focused Evasion
		if Helper:CheckAvailable( "Focused Evasion" ) then
			Helper:CheckExecute( "Focused Evasion" );
			return false;
		end
	end

	----------------------------------------------
	---------------------Buffs--------------------
	----------------------------------------------

	-- Buff: Promise of Magic Power 
	if Helper:CheckAvailable( "Promise of Magic Power" ) and EntityState:GetState( Helper:CheckName( "Promise of Magic Power" )) == nil then
	Helper:CheckExecute( "Promise of Magic Power" );
		return false;
	end

	-- Buff: Gift of Magic Power I 
	if Helper:CheckAvailable( "Gift of Magic Power" ) and EntityState:GetState( Helper:CheckName( "Gift of Magic Power" )) == nil then
		Helper:CheckExecute( "Gift of Magic Power" );
		return false;
	end

	-- Buff: Enhance Magic Projectile 
	if Helper:CheckAvailable( "Enhance Magic Projectile" ) and EntityState:GetState( Helper:CheckName( "Enhance Magic Projectile" )) == nil then
		Helper:CheckExecute( "Enhance Magic Projectile" );
		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" ) and Entity:GetHealth() < 40 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" ) and Player:GetManaCurrent() < Player:GetManaMaximum() * 0.3 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 
	if Helper:CheckAvailable( "Lifeline Penetration" ) then
		Helper:CheckExecute( "Lifeline Penetration" );
		return false;
	end

	--Initial Attack : Between the Eyes
	if Helper:CheckAvailable( "Between the Eyes" ) then
		Helper:CheckExecute( "Between the Eyes" );
		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
- Unable to find a class or player controller!
- invalid arguments to method call

What am i doing wrong?

unkn0wnus3r
Posts: 75
Joined: Wed Jan 18, 2017 12:27 pm
Has thanked: 10 times
Been thanked: 13 times

Re: Gunslinger.lua by mnwaxep EU version

Post by unkn0wnus3r » Mon Sep 25, 2017 12:46 pm

maq2285 wrote:
Sun Sep 24, 2017 8:28 am
unkn0wnus3r wrote:
Mon Jul 24, 2017 1:51 pm
made some small fixes and improvements:
- fixed some spell names
- no mana chain unless char is under 30% mana
- no pistol chain if the target is below 40% health
- added focused evasion if targed cast something

only testet the script with lvl 30 gunner.

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
	-------------------------------------
	--------------Evade------------------
	-------------------------------------
	if Entity:GetSkillID() ~= 0 then
	
		-- Attack 5: Focused Evasion
		if Helper:CheckAvailable( "Focused Evasion" ) then
			Helper:CheckExecute( "Focused Evasion" );
			return false;
		end
	end

	----------------------------------------------
	---------------------Buffs--------------------
	----------------------------------------------

	-- Buff: Promise of Magic Power 
	if Helper:CheckAvailable( "Promise of Magic Power" ) and EntityState:GetState( Helper:CheckName( "Promise of Magic Power" )) == nil then
	Helper:CheckExecute( "Promise of Magic Power" );
		return false;
	end

	-- Buff: Gift of Magic Power I 
	if Helper:CheckAvailable( "Gift of Magic Power" ) and EntityState:GetState( Helper:CheckName( "Gift of Magic Power" )) == nil then
		Helper:CheckExecute( "Gift of Magic Power" );
		return false;
	end

	-- Buff: Enhance Magic Projectile 
	if Helper:CheckAvailable( "Enhance Magic Projectile" ) and EntityState:GetState( Helper:CheckName( "Enhance Magic Projectile" )) == nil then
		Helper:CheckExecute( "Enhance Magic Projectile" );
		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" ) and Entity:GetHealth() < 40 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" ) and Player:GetManaCurrent() < Player:GetManaMaximum() * 0.3 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 
	if Helper:CheckAvailable( "Lifeline Penetration" ) then
		Helper:CheckExecute( "Lifeline Penetration" );
		return false;
	end

	--Initial Attack : Between the Eyes
	if Helper:CheckAvailable( "Between the Eyes" ) then
		Helper:CheckExecute( "Between the Eyes" );
		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
- Unable to find a class or player controller!
- invalid arguments to method call

What am i doing wrong?
Rename the Gunslinger.lua to Gunner.lua or vise versa depands on which server u play (NA or EU)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest