Official: Assassin.lua

User avatar
0x00
VIP
Posts: 105
Joined: Tue Jan 10, 2017 11:40 pm
Has thanked: 10 times
Been thanked: 23 times

Official: Assassin.lua

Post by 0x00 » Thu Jan 12, 2017 9:37 pm

The official Assassin LUA. Please submit any edits and I will implement!

Last updated - 14.03.2017

Code: Select all

--[[

	--------------------------------------------------
	Copyright (C) 2011 agonic & Blastradius & macrokor

    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	StateList Contains the state list of the target entity.
-- @return	int

function _CheckRunes( EntityState )

	if EntityState ~= nil then
		-- Using numeric identifiers because there are multiple entries of this kind of skill,
		-- one for monsters and one for players. We're interested only in what we do, and unfortunately,
		-- this is the second entry.
		if EntityState:GetState( 8307 ) ~= nil then
			return 5;
		elseif EntityState:GetState( 8306 ) ~= nil then
			return 4;
		elseif EntityState:GetState( 8305 ) ~= nil then
			return 3;
		elseif EntityState:GetState( 8304 ) ~= nil then
			return 2;
		elseif EntityState:GetState( 8303 ) ~= nil then
			return 1;
		end
	end
	
	return 0;
	
end

--- 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 )

	-- Check if we are a melee orientated class and the target has reflect!
	-- NOTE: Removed CheckMelee, so even Sorcerers will take a break here. Some reason, that didn't work.. no clue why!

	----------------------------------------------
	------------------ContRanged Buffs----------------
	----------------------------------------------
		-- Retrieve the entity state.
		local EntityState = Entity:GetState();
		
		-- Retrieve the rune level on the target.
		local Runes = self:_CheckRunes( EntityState );
	
		-- Stunned is overwritten with Spin, but Assassinate needs the real stun status.
		local ReallyStunned = Stunned;

		-- Check if the enemy is in the spin state, let's assume that's a type of stun!
		if EntityState ~= nil and EntityState:GetState( "Spin" ) ~= nil then
			Stunned = true;
			Spinned = true;
		else
			Spinned = false;
		end
		
		
	----------------------------------------------
	-----------------Conditionals-----------------
	----------------------------------------------
	
	-- Retrieve the skill from the skill list.
	local Skill = SkillList:GetSkill( Entity:GetSkillID());
			
	-- Check if this is a valid skill and is a magical skill, in which case we can use Aethertwisting.
	if Skill ~= nil and Skill:IsMagical() and Helper:CheckAvailable( "Aethertwisting" ) then
			Helper:CheckExecute( "Aethertwisting" );
	end
	if Skill ~= nil and Skill:IsMagical() and Helper:CheckAvailable( "Spelldodging" ) then
			Helper:CheckExecute( "Spelldodging" );
	end
	if Skill ~= nil and Helper:CheckAvailable( "Focused Evasion" ) then	
			Helper:CheckExecute( "Focused Evasion" );
	end
	-- 25m range activation
	if Player:GetPosition():DistanceToPosition( Entity:GetPosition()) <= 25 then
	--Buff 1: Apply Deadly Poison
		if Player:GetState():GetState( Helper:CheckName( "Apply Deadly Poison" )) == nil and Helper:CheckAvailable( "Apply Deadly Poison" ) then
			Helper:CheckExecute( "Apply Deadly Poison" );	
		end
	end	
	-- 10m range activation
	if Player:GetPosition():DistanceToPosition( Entity:GetPosition()) <= 10 then
		if Helper:CheckAvailable( "Devotion" ) then
			Helper:CheckExecute( "Devotion" );
		elseif Helper:CheckAvailable( "Flurry" ) then
			Helper:CheckExecute( "Flurry" );
		end
	end
	--if Helper:CheckMelee() and Helper:CheckAvailable( "Blinding Burst" ) then
	--	Helper:CheckExecute( "Blinding Burst");	
	--end
	-- Transformation: Slayer
	-- Buff 2: Transformation: Slayer
	if Player:GetState():GetState( Helper:CheckName( "Transformation: Slayer" )) == nil and Helper:CheckAvailable( "Transformation: Slayer" ) then
					Helper:CheckExecute( "Transformation: Slayer" );
	end
	-- Transformation: Avatar of Fire
	-- Buff 3: Compassion of Fire
	if Player:GetState():GetState( Helper:CheckName( "Compassion of Fire" )) == nil and Helper:CheckAvailable( "Compassion of Fire" ) then
			Helper:CheckExecute( "Compassion of Fire" );
	end
	
	if Helper:CheckAvailable( "Sneak Ambush" ) then
		Helper:CheckExecute( "Sneak Ambush" );	
	end
	-- Start Chain 1: Killing Spree
	if Helper:CheckAvailable( "Killing Spree" ) then
		Helper:CheckExecute( "Killing Spree" );
	end
	
	-- Fang Strike -> Beast Kick
	if Helper:CheckAvailable( "Beast Kick" ) then
		Helper:CheckExecute( "Beast Kick" );
	-- Beast Kick -> Beast Swipe
	elseif Helper:CheckAvailable( "Beast Swipe" ) then
		Helper:CheckExecute( "Beast Swipe" );
	end
	
	-- Soul Slash  -> Rune Slash
	if Helper:CheckAvailable( "Soul Slash"  ) then
		Helper:CheckExecute( "Soul Slash" );
	elseif Helper:CheckAvailable( "Rune Slash" ) then
		Helper:CheckExecute( "Rune Slash" );	
	end
	-- Check how long since Entity has been Aetherheld, if above 3 seconds -> Use "Fall"
	if self._iBindingTime ~= nil and self._iBindingTime < Time() and Helper:CheckAvailable( "Fall" ) then
		Helper:CheckExecute( "Fall" );
		self._iBindingTime = nil;
	end
	
	if Player:GetPosition():DistanceToPosition( Entity:GetPosition()) <= 2 and not Player:IsMoving() and Helper:CheckAvailable("Back Breaker" ) then
			local PosE = Entity:GetPosition();
			local dist = 1;  
			local Angle = Entity:GetRotation();
			PosE.X = PosE.X - dist*math.sin(Angle*(math.pi/180));
			PosE.Y = PosE.Y + dist*math.cos(Angle*(math.pi/180));
			Player:SetPosition(PosE);
			Helper:CheckExecute( "Back Breaker" );
		
	end
	-- Stunned -> Shadowfall
	if Helper:CheckAvailable( "Shadowfall" ) then
		Helper:CheckExecute( "Shadowfall" );
	end
	if Helper:CheckAvailable( "Evasive Boost" ) then
		Helper:CheckExecute( "Evasive Boost" );	
	end
	-- Evasion -> "Whirlwind Slash" or "Counter-Attack"
	if Helper:CheckAvailable("Whirlwind Slash") then
		Helper:CheckExecute("Whirlwind Slash");
	elseif Helper:CheckAvailable( "Cross Slash" ) then
		Helper:CheckExecute( "Cross Slash" );
	end
	
	-- Evasion -> "Whirlwind Slash" or "Counter-Attack"
	if Helper:CheckAvailable( "Cross Slash" ) then
		Helper:CheckExecute( "Cross Slash" );
	elseif Helper:CheckAvailable("Counter-Attack") then
		Helper:CheckExecute("Counter-Attack");	
	end

	if Helper:CheckAvailable( "Ambush Attack" ) then
		Helper:CheckExecute( "Ambush Attack" );
	elseif Helper:CheckAvailable(  "Ambush Assault"  ) then
		Helper:CheckExecute( "Ambush Assault" );
	end
	--------------------------------------------
	----------------Main Attacks----------------
	--------------------------------------------
	if Helper:CheckAvailable("Venomous Strike") then
		Helper:CheckExecute( "Venomous Strike" );
	end
	-- First Magical Attack
	if Helper:CheckAvailable( "Rune Carve" ) then
			Helper:CheckExecute( "Rune Carve");
	end
	-- Start Chain 2: Fang Strike
	if Helper:CheckAvailable( "Fang Strike" ) then
		Helper:CheckExecute( "Fang Strike" );
	
	end
	-- Start Chain 3: Swift Edge
	if Helper:CheckAvailable( "Swift Edge" ) then
		Helper:CheckExecute( "Swift Edge" );
	
	end
	-- Runes, Attack 4: Swift Edge
	if Helper:CheckAvailable( "Beast Fang" ) and Runes <= 3  then
		Helper:CheckExecute( "Beast Fang" );
	end
	-- Attack 4: Quickening Doom
	if Helper:CheckAvailable( "Quickening Doom" ) then
		Helper:CheckExecute( "Quickening Doom" );
	end
	
	if Helper:CheckAvailable( "Assassination" ) then
		Helper:CheckExecute( "Assassination" );		
	end
	--------------------------------------------
	-------------------Runes--------------------
	--------------------------------------------	
	if Runes >= 5 then
		if Helper:CheckAvailable( "Signet Silence" ) then
			Helper:CheckExecute( "Signet Silence" );
		end
	elseif Runes >= 5 then
		if Helper:CheckAvailable( "Binding Rune" ) then
			_iBindingTime = Time() + 1000;
			Helper:CheckExecute( "Binding Rune" );
		end
	elseif Runes >= 3 then
		if not Stunned and Helper:CheckAvailable( "Pain Rune" ) then
			Helper:CheckExecute( "Pain Rune" );
		end
	elseif Runes >= 2 then
		if Helper:CheckAvailable( "Repeated Rune Carve" ) then
			Helper:CheckExecute( "Repeated Rune Carve" );
		end
	end
	
	-- Attack 5: Surprise Attack (Spin)
	if Player:GetPosition():DistanceToPosition( Entity:GetPosition()) <= 2 and not Player:IsMoving() and Helper:CheckAvailable("Surprise Attack") then
			local PosE = Entity:GetPosition();
			local dist = 1;  
			local Angle = Entity:GetRotation();
			PosE.X = PosE.X - dist*math.sin(Angle*(math.pi/180));
			PosE.Y = PosE.Y + dist*math.cos(Angle*(math.pi/180));
			Player:SetPosition(PosE);
			Helper:CheckExecute( "Surprise Attack" );
	end
	
		end

function Pause()

	-- Nothing was executed, continue with other functions.
	return true;
	
end
Changelog:

v1.0.3
  • Changed from storing variables to making the direct function call for Range related teleporting skills
  • Fixed a few minor bugs - incl. using poison and Devotion when targetting a door!
  • Created better logic if / elseif chains
v1.0.2
  • Sorted out the storing of variables (used the appropriate 'local' tag where it will help speed things up!
  • Fixed a few minor bugs
  • Added Slayer form to buffs
  • Created more logic if / elseif chains
v1.0.1
  • Updated the teleportation behind target IF statements.
  • Killing Spree now works (x3 chain after Assassination)
v1.0.0
  • Released initial LUA

creatine
Posts: 120
Joined: Wed Jan 18, 2017 4:12 pm
Has thanked: 19 times
Been thanked: 5 times

Re: Assassin.lua (Highest DPS)

Post by creatine » Wed Jan 18, 2017 4:16 pm

believe it or not, after several years of tweaking, I have a better one :3

My sin can outdps a geared level 72 sorcerer at level 65... or maybe that sorc just sucks.

In any case, this one is for Gameforge right?

User avatar
0x00
VIP
Posts: 105
Joined: Tue Jan 10, 2017 11:40 pm
Has thanked: 10 times
Been thanked: 23 times

Re: Assassin.lua (Highest DPS)

Post by 0x00 » Tue Jan 24, 2017 4:52 am

Oh ofc I believe you! I only used HIGHEST DPS to promote it. I'm missing a few skills to be honest! Its because I used it for support in a shitty PvP situation so I left some space for human interaction.

and with attack speed at 75% I can believe it. Maybe not a FULLY geared Sorc but definately the majority!

Online
User avatar
nucular
Site Admin
Posts: 260
Joined: Sat Jan 07, 2017 9:08 pm
Has thanked: 27 times
Been thanked: 388 times

Re: Assassin.lua (Highest DPS)

Post by nucular » Tue Jan 24, 2017 10:12 am

creatine wrote:
Wed Jan 18, 2017 4:16 pm
believe it or not, after several years of tweaking, I have a better one :3

My sin can outdps a geared level 72 sorcerer at level 65... or maybe that sorc just sucks.

In any case, this one is for Gameforge right?
Then share it ;-)

User avatar
FarAwaY
Posts: 48
Joined: Sun Jan 29, 2017 9:31 pm
Has thanked: 22 times
Been thanked: 13 times

Re: Assassin.lua (Highest DPS)

Post by FarAwaY » Mon Jan 30, 2017 11:15 pm

What Stigmas I Need that this Assassin.lua Works Great?
Image

User avatar
0x00
VIP
Posts: 105
Joined: Tue Jan 10, 2017 11:40 pm
Has thanked: 10 times
Been thanked: 23 times

Re: Assassin.lua (Highest DPS)

Post by 0x00 » Wed Feb 22, 2017 1:42 am

FarAwaY wrote:
Mon Jan 30, 2017 11:15 pm
What Stigmas I Need that this Assassin.lua Works Great?
Quickening Doom
Dash and Slash
Shadowfall
Venomous Strike
Sensory Boost
Oath of Accuracy

crazymonkey84
Posts: 37
Joined: Sun Jan 29, 2017 4:33 am
Has thanked: 6 times
Been thanked: 3 times

Re: Official: Assassin.lua

Post by crazymonkey84 » Mon Feb 27, 2017 10:40 am

i tried this code on my sin, and it just doesnt attack, it only selects the target and the he just change the target again and nothing else

regards

User avatar
FarAwaY
Posts: 48
Joined: Sun Jan 29, 2017 9:31 pm
Has thanked: 22 times
Been thanked: 13 times

Re: Official: Assassin.lua

Post by FarAwaY » Mon Feb 27, 2017 11:11 am

crazymonkey84 wrote:
Mon Feb 27, 2017 10:40 am
i tried this code on my sin, and it just doesnt attack, it only selects the target and the he just change the target again and nothing else

regards
The Script Works great on EU i Testet it ;D I Need to add some Skills but it Works Very Good. Thx for sharing it 0x00.
Use the Newest AionScript. NA or EU Servers?
Image

crazymonkey84
Posts: 37
Joined: Sun Jan 29, 2017 4:33 am
Has thanked: 6 times
Been thanked: 3 times

Re: Official: Assassin.lua

Post by crazymonkey84 » Mon Feb 27, 2017 11:27 am

im using lasted update of AS, and im playin on NA servers

ty

User avatar
FarAwaY
Posts: 48
Joined: Sun Jan 29, 2017 9:31 pm
Has thanked: 22 times
Been thanked: 13 times

Re: Official: Assassin.lua

Post by FarAwaY » Mon Feb 27, 2017 3:13 pm

crazymonkey84 wrote:
Mon Feb 27, 2017 11:27 am
im using lasted update of AS, and im playin on NA servers

ty
Maybe U have some wrong Stigmas or the Skill Names are wrong in NA
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest