Anybody has a gunslinger lua. I have one lua but its only autoattacking it doest use some skills. Im playing on Eu Server.
Thx
Gunslinger.lua
-
- Posts: 75
- Joined: Wed Jan 18, 2017 12:27 pm
- Has thanked: 10 times
- Been thanked: 13 times
Re: Gunslinger.lua
that one from this forum--[[
--------------------------------------------------
Copyright (C) 2011 Blastradius, macrokor, rellis
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.
--------------------------------------------------
]]--
--[[
KNOWN STATE ID'S
- State Name = Stunning Shot II - State ID = 679
- State Name = Stunned - State ID = 8217
- State Name = Entangling Shot III - State ID = 676
- State Name = No Name (Godstone: Deltras's Loyalty) State ID = 8540
- State Name = Shackle Arrow I - State ID = 672
- State Name = Sleep Arrow I - State ID = 695
]]--
function CountMobs( EntityTarget, Distance )
local i = 0;
-- Iterate through all entities
for ID, Entity in DictionaryIterator( EntityList:GetList()) do
-- Check if the entiy is valid.
if Entity ~= nil then
-- Retrieve the entity state.
local EntityState = Entity:GetState();
-- Check if the entity state is valid.
if EntityState ~= nil then
-- Check if this is a living monster that is in range.
if Entity:IsMonster() and not Entity:IsDead() and Entity:IsHostile() and EntityTarget:GetPosition():DistanceToPosition( Entity:GetPosition()) <= Distance then
-- Check if this entity is sleeping
if EntityState:GetState( Helper:CheckName( "Sleep Arro" )) ~= nil then
return 0;
-- Increment the number.
else
i = i + 1;
end
end
end
end
end
return i;
end
function SleepMultipleAttacker( EntityTarget, AttackRange )
-- Check if we have stored a target.
if self._SleepTarget ~= nil then
-- Check if the current target is the stored target.
if self._SleepTarget:GetID() == Player:GetTargetID() then
-- Check if Sleep Arrow is available.
if Helper:CheckAvailable( "Sleep Arro" ) then
-- Shoot the Sleep Arrow.
Helper:CheckExecute( "Sleep Arro" );
-- Indicate we cannot continue attacking.
return false;
else
-- Set the target.
Player:SetTarget( self._SleepTargetRestore );
-- Indicate we cannot continue attacking.
return false;
end
-- Check if the current target is the original target.
elseif not Helper:CheckAvailable( "Sleep Arro" ) and self._SleepTargetRestore:GetID() == EntityTarget:GetID() then
-- Clear the sleep target.
self._SleepTarget = nil;
-- Indicate we cannot continue attacking.
return true;
else
-- Set the target.
Player:SetTarget( self._SleepTarget );
-- Indicate we cannot continue attacking.
return false;
end
end
-- Check if Sleep Arrow is available.
if Helper:CheckAvailable( "Sleep Arro" ) then
-- Loop through the entities.
for ID, Entity in DictionaryIterator( EntityList:GetList()) do
-- Check if this entity is a monster, is not friendly and decided to attack me (and obviously is not my current target).
if not Entity:IsDead() and Entity:IsMonster() and not Entity:IsFriendly() and Entity:GetTargetID() == Player:GetID() and Entity:GetID() ~= EntityTarget:GetID() then
-- Check if the entity that is attacking us is within range.
if Entity:GetPosition():DistanceToPosition( Player:GetPosition()) <= AttackRange then
-- Store the sleep target.
self._SleepTarget = Entity;
-- Store the restore target.
self._SleepTargetRestore = EntityTarget;
-- Set the target.
Player:SetTarget( Entity );
-- Indicate we cannot continue attacking.
return false;
end
end
end
end
-- Indicate we can continue attacking.
return true;
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, SkipFocusedEvasion )
local TripeedFruit = InventoryList["Tripeed Fruit"];
local TripeedSeed = InventoryList["Tripeed Seed"];
local AttackRange = Player:GetAttackRange();
-- Correct the attack range when using Bestial Fury.
if Player:GetState():GetState( Helper:CheckName( "Parting Sho" )) then
AttackRange = AttackRange - 5;
end
-- Check if we are allowed to sleep attackers.
if Settings.Ranger.AllowSleep and not self:SleepMultipleAttacker( Entity, AttackRange ) then
return false;
end
--------------------------------------------------
-- I N I T I A L A T T A C K (S) (I) --
--------------------------------------------------
-- Initial Attack 1: Automatic Attack
if self.AttackStarted ~= Entity:GetID() then
self.AttackStarted = Entity:GetID();
Helper:CheckExecute( "Attack/Chat" );
return false;
end
--------------------------------------------------
-- N O R M A L A T T A C K (S) --
--------------------------------------------------
-- Demonstration of using the multicast mechanism on a muse.
--
-- ~ By Blastradius
--
-- Contains the multicast level.
local Level = 0
-- Contains the previous identifier.
local PreviousId = 0
--
-- Perform a begin to end attack routine.
--
function OnRun()
-- Find the selected target entity.
local Target = EntityList:GetEntity(Player:GetTargetId())
-- Check if a selected target is available and is alive.
if Target ~= nil and not Target:IsDead() then
-- Retrieve the skill identifier.
local Id = Player:GetSkillId()
-- Check if the skill identifier has not been set.
if Id == 0 then
-- Initialize the multicast level.
Level = 0
-- Initialize the previous identifier.
PreviousId = 0
-- Begin with the Incendiary Shell ability.
Do("Incendiary Shell");
-- Otherwise check if the previous identifier is invalid.
elseif PreviousId == 0 then
-- Initialize the multicast level.
Level = 1
-- Set the previous identifier.
PreviousId = Id
-- Otherwise check if the identifier has increased.
elseif Id > PreviousId then
-- Increment the multicast level.
Level = Level + 1
-- Set the previous identifier.
PreviousId = Id
-- Check if the desired multicast level has been achieved.
if Level == 3 then
-- End with the Incendiary Shell ability.
Do("Incendiary Shell");
end
end
end
end
--
-- Perform an ability without condition checking.
--
function Do(Name)
-- Find the ability with the specified name.
local Ability = AbilityList:GetAbility(Name)
-- Check if the ability is valid.
if Ability ~= nil then
-- Input the command to do the ability.
PlayerInput:Console("/Skill " .. Ability:GetName())
end
end
if Helper:CheckAvailable( "Steal Health" ) then
Helper:CheckExecute( "Steal Health" );
return false;
elseif Helper:CheckAvailable( "Remove Shock" ) then
Helper:CheckExecute( "Remove Shock" );
return false;
end
if Helper:CheckAvailable( "Spend Success" ) and Player:GetDP() >= 2000 then
Helper:CheckExecute( "Spend Success" );
return false;
end
if Helper:CheckAvailable( "Bulletproof" ) then
Helper:CheckExecute( "Bulletproof", Player );
return false;
end
if Helper:CheckAvailable( "Bullet Resistance" ) and Player:GetHealth() <= 70 then
Helper:CheckExecute( "Bullet Resistance" );
return false;
end
if Helper:CheckAvailable( "Autoload" ) and Player:GetManaCurrent() < Player:GetManaMaximum() - 3000 then
Helper:CheckExecute( "Autoload", Entity );
return false;
end
if Helper:CheckAvailable( "Nature's Favor" ) then
Helper:CheckExecute( "Nature's Favor", Player );
return false;
end
if Helper:CheckAvailable( "Aion's Favor" ) then
Helper:CheckExecute( "Aion's Favor", Player );
return false;
end
if Helper:CheckAvailable( "Pressurized Chamber" ) then
Helper:CheckExecute( "Pressurized Chamber", Player );
return false;
end
-- Skills starts
if Helper:CheckAvailable( "Hot Shot" ) then
Helper:CheckExecute( "Hot Shot" )
return false;
end
if Helper:CheckAvailable( "Green Grenade" ) then
Helper:CheckExecute( "Green Grenade" )
return false;
end
if Helper:CheckAvailable( "Direct Shot" ) then
Helper:CheckExecute( "Direct Shot" )
return false;
end
if Helper:CheckAvailable( "Hemorrhage Shot" ) then
Helper:CheckExecute( "Hemorrhage Shot" )
return false;
end
-- Chain Attack 1: Crosstrigger
if Helper:CheckAvailable( "Crosstrigger" ) then
Helper:CheckExecute( "Crosstrigger" );
end
if Helper:CheckAvailable( "Reload" ) then
Helper:CheckExecute( "Reload" );
return false;
end
if Helper:CheckAvailable( "Spinning Fire" ) then
Helper:CheckExecute( "Spinning Fire" );
return false;
end
if Helper:CheckAvailable( "Wing Clip" ) then
Helper:CheckExecute( "Wing Clip" )
return false;
end
if Helper:CheckAvailable( "Pulverizer Cannon" ) then
Helper:CheckExecute( "Pulverizer Cannon" );
end
if Helper:CheckAvailable( "Quieting Gale" ) then
Helper:CheckExecute( "Quieting Gale" )
return false;
end
if Helper:CheckAvailable( "Autoload" ) then
Helper:CheckExecute( "Autoload" );
return false;
end
if Helper:CheckAvailable( "Steady Fire" ) then
Helper:CheckExecute( "Steady Fire" )
return false;
end
if Helper:CheckAvailable( "Anti-Enemy Fire " ) then
Helper:CheckExecute( "Anti-Enemy Fire " )
return false;
end
end
--- Perform healing checks both in and our of combat.
--
-- @param bool Indicates whether or not the function is running before force checks.
-- @return bool
function Heal( BeforeForce )
-- Nothing was executed, continue with other functions.
return true;
end
--- Perform the safety checks before moving to the next target.
--
-- @return bool
function Pause()
-- Nothing was executed, continue with other functions.
return true;
end
Re: Gunslinger.lua
i see this is a ranger lua ? is this a false lua. i found it in gunslinger lua here at forum.
-
- Posts: 75
- Joined: Wed Jan 18, 2017 12:27 pm
- Has thanked: 10 times
- Been thanked: 13 times
Re: Gunslinger.lua
I´ll give u mine, i took it frome here too (other post i guess) and made some fixes as it was very old.
I didnt spent much time on optimizing it but it should do the basic stuff.
Report back if you have some improvements or if something doesnt work.
Btw: Its an EU one so if you are on na u have to change skill names.
I didnt spent much time on optimizing it but it should do the basic stuff.
Report back if you have some improvements or if something doesnt work.
Btw: Its an EU one so if you are on na u have to change skill names.
Code: Select all
--[[
--------------------------------------------------
Copyright (C) 2017 mnwaxep tweaked by Ukn0wnUs3r
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
if Helper:CheckAvailable( "Remove Shock" ) then
Helper:CheckExecute( "Remove Shock" );
return false;
end
-------------------------------------
--------------Chain------------------
-------------------------------------
--------------Pistol Shot------------
if Helper:CheckAvailable( "Repeated Volley" ) then
Helper:CheckExecute( "Repeated Volley" );
Helper:CheckExecute( "Repeated Volley" );
return false;
end
if Helper:CheckAvailable( "Repeated Rapid Fire" ) then
Helper:CheckExecute( "Repeated Rapid Fire" );
Helper:CheckExecute( "Repeated Rapid Fire" );
return false;
end
if Helper:CheckAvailable( "Heavy Projectile" ) then
Helper:CheckExecute( "Heavy Projectile" );
return false;
end
--------------Soul Shot--------------
if Helper:CheckAvailable( "Soul Volley" ) then
Helper:CheckExecute( "Soul Volley" );
Helper:CheckExecute( "Soul Volley" );
return false;
end
if Helper:CheckAvailable( "Rapid Soul Fire" ) then
Helper:CheckExecute( "Rapid Soul Fire" );
Helper:CheckExecute( "Rapid Soul Fire" );
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
-- Attack 5: Materialised Wall Form
if Player:GetHealth() < 50 and Helper:CheckAvailable( "Materialised Wall Form" ) then
Helper:CheckExecute( "Materialised Wall Form" );
return false;
end
----------------------------------------------
---------------------Buffs--------------------
----------------------------------------------
-- Buff: Promise of Magic Power
if Helper:CheckAvailable( "Promise of Magic Power" ) and Player:GetState():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
if Helper:CheckAvailable( "Soulsucker Shot" ) and Player:GetHealth() < 80 then
Helper:CheckExecute( "Soulsucker Shot" );
return false;
end
-- Soul Extractor Shot
if Helper:CheckAvailable( "Wild Magic Projectile" ) and Player:GetHealth() < 30 then
Helper:CheckExecute( "Wild Magic Projectile" );
Helper:CheckExecute( "Wild Magic Projectile" );
return false;
end
----------------------------------------------
-------------------Chain----------------------
----------------------------------------------
----------------------------------------------
-------------------Chain----------------------
----------------------------------------------
-- Soul Shot -> Soul Volley -> Rapid Soul Fire
if Helper:CheckAvailable( "Soul Shot" ) and Player:GetManaCurrent() < Player:GetManaMaximum() * 0.3 then
Helper:CheckExecute( "Soul Shot" );
return false;
end
-- Pistol shot -> Repeated Volley -> Repeated Rapid Fire
if Helper:CheckAvailable( "Pistol Shot" ) and Entity:GetHealth() >= 25 then
Helper:CheckExecute( "Pistol Shot" );
return false;
end
if 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 : Sighting Shot
if Helper:CheckAvailable( "Sighting Shot" ) then
Helper:CheckExecute( "Sighting 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 : 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 not Helper:CheckAvailable( "Pistol Shot" ) and Helper:CheckAvailable( "Insert Magic Projectile" ) then
Helper:CheckExecute( "Insert Magic Projectile" );
return false;
end
-- Nothing was executed, continue with other functions.
return true;
end
Who is online
Users browsing this forum: No registered users and 0 guests