OnPreSkillCast for KNIGHT_MANA_RETURN
Posted: Wed Nov 23, 2011 9:24 pm
So, I did some searching and couldn't find this in the forum. There were some modifications to the profile skill insert but I wanted a little more control over when it was used. Hopes this helps you knight grinding peoples!
First, you need to have the skill in your profile skills list to use it.
Then you add this to your profile or ammend your OnPreSkillCast section with the contents:
First, you need to have the skill in your profile skills list to use it.
Then you add this to your profile or ammend your OnPreSkillCast section with the contents:
Code: Select all
<onPreSkillCast>
target = player:getTarget();
if not tmpSkill then
tmpSkill = {};
for i,v in pairs(settings.profile.skills) do
if( v.Name == "KNIGHT_MANA_RETURN" ) then
skill_found = true;
tmpSkill = CSkill(v);
break;
end
end
cprintf(cli.yellow,"tmpSkill updated to KNIGHT_MANA_RETURN.\n");
end
if not isInCooldown then
function isInCooldown(skill)
return ((skill.Cooldown*1000 + 1000) > deltaTime(getTime(), skill.LastCastTime))
end
end
if ((player.Class1 == 6) and (85 > (player.MP/player.MaxMP*100)) and
(target:hasBuff("Holy Seals", 3)) and not isInCooldown(tmpSkill)) then
player:cast("KNIGHT_MANA_RETURN");
return false;
end
</onPreSkillCast>