Lineage 2 Tower Forum

Full Version: Help: Routine to use many skills in script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm having trouble creating a function in a script to use attack skills in class as feoh, Eviscerator and iss. The script works for a while and then displays error "Overload findById".

Does anyone know of a way to use multiple skill in a script and I can share?

It may be just the tool to use multiple skill.
assign them as functions..
    LUA Programming
1blahskillid = 1;
2blahskillid = 2;
3blahskillid = 3;
 
function blahSKills()
 if blah.blah then
 UseSkillAttack(1blahskillID);
 Sleep(250);
 
 UseSkillAttack(2blahskillID);
 Sleep(250);
 
 UseSkillAttack(3blahskillID);
 Sleep(250);
	end;
etc...
end;
repeat
if blah then
blahskills()
end;
until false;
end;

Code:
CharSkills = {
    [187] = { -- Eviscerator
        auraSkill = {
            30602, -- Eviscerator Aura
            1986, --DualMaxHpID
        },
        selfBuffSkills = {
            30512, --Distortion = 30512.
            30520, --SteelMind = 30520.
            1914, --Savage = 1914.
            30511, --AirLight = 30511.

        },
        DefensiveSkills = {
            30516, --GravityBarrier = 30516.
            30519, --WarperSpaceID = 30519.
            30515, --SpallationID = 30515.
            30509, --BackStep = 30503.
            30514,    --FluidWeave = 30503.
            1912, --Disparition = 30503.
            30502, --ChinStrike = 30502.
            30506, --DistantKick = 30506.
        },
        singleAttackSkills = {
            30508, --RightSideStep = 30508.
            30500, --LateralHit = 30500.
            30504, --GravityHit = 30504.
            30501, --BackSpinBlow= 30501.
            30507, --LeftSideStep = 30507.
            30503,  --SpinningKick = 30503.
        },
        massAttackSkills = {
            30518, --ReverseWeight =30518.
        },
    };    
}

Call skills from the table is possible?
How without client crash?
are you wanting and AIO (all in one) sript?
If not, don't use tables, just assign the skills to the Id's like you find in most scripts..
Tables come with a lot more to make them work, see ISS OOP Scripts for help if you persue that.
Otherwise use,
if playerclass == player:GetClass() == 162 or player:GetClass() == 163 or player:GetClass() == 164 or player:GetClass() == 165 then -- Archers
and for all classes either per-script, or in AIO..
Easiest way is to combine all Attacks into functions.
ie,
function Archer()
if playerclass == player:GetClass() == 162 etc...
if blah me/target then
attacks
end
function mage()
if playerclass == player:GetClass() == XXX etc..
if blah me/target then
attacks
end

wrap up all into Main function,
function Main()
Archers()
Mage()
etc.
end

then process function normally,

repeat
Main()
until false;
end..

hope that helps
Reference URL's