Basic lua knowledge;
-Ofcourse, It is a programming language.
-File association is *.lua
-Lua files contain scripts in aionscript folder and that scripts must be written by someone.
-Similar to basic english mixed math. (My opinion)
-Class scripts must be written by someone. Never falls from sky.
-Better editing tool is Notepad++. https://notepad-plus-plus.org/
Some explanations about terms in the scripts;
-Entity is your target. It can be enemy or friendly, who is targeted by you, even yourself too. Player is, ofc, you.
-State,as simply, is your buffs, debuffs. You can check your and entity's state(s).
Code: Select all
Player/Entity:GetState():GetState("State's name")
Code: Select all
Player/Entity:GetState():GetState(State ID, as number ofc)
Code: Select all
Player/Entity:GetState():GetState(8224) ~= nill/== nill
-"local" is using for an abbreviation for some similar situations or juts using as an abbreviation. For example;
Code: Select all
local EntityState = Entity:GetState();
local Posion = EntityState:GetState( "Venomous Strike" ) ~= nil or EntityState:GetState( "Massacre" ) ~= nil
Code: Select all
if Helper:CheckAvailable("Skill name like in game") then
Helper:CheckExecute( "Skill name like in game" );
end
Code: Select all
if Poison and Helper:CheckAvailable("Skill name like in game") then
Helper:CheckExecute( "Skill name like in game" );
end
function Attack() is your main attack routine funciton. function Pause() is doing somethings, when you are not busy. You can add your own functions into the script.
-Functions is written like;
Code: Select all
function Desired name(Desired situations like Stunned, Range, Entity, EntityState)
your lines
end
Code: Select all
self:Desired name(Desired situations like Stunned, Range, Entity, EntityState);
Code: Select all
local desired abbreviation = self:Desired name(Desired situations like Stunned, Range, Entity, EntityState);
-Some examples;
Code: Select all
local Entity = EntityList:GetEntity( Player:GetTargetID());
local EntityState = Entity:GetState();
local Range = Player:GetPosition():DistanceToPosition( Entity:GetPosition());
Entity:GetClass():ToString() == "Assassin, Gladiator, Chanter..."
Entity:GetName() == "Stormwing"
Player:GetHealthCurrent() < Player:GetHealthMaximum() == / <= / >= 2500
Code: Select all
function GetBuff()
-- Loop through the state of the target entity
for i = 0, Player:GetState():GetStateSize() - 1, 1 do
-- Retrieve the state from the EntityState.
local StateIndex = Player:GetState():GetStateIndex( i );
-- Check if the state is correct and check if it is a debuff.
if StateIndex ~= nil and StateIndex:IsDebuff() then
return true;
end
end
end
Code: Select all
if self:GetBuff() then
if Helper:CheckAvailableInventory( "Greater Healing Potion" ) then
PlayerInput:Inventory( "Greater Healing Potion" );
return false;
end
end