Page 1 of 1
Quest useItem when Mob low health - Help
Posted: Tue Jan 01, 2013 3:56 pm
by Buster99
I have a quest where I have to:
1. Attack a quest mob until mob is below 35% health.
2. Use item in backpack on mob to "catch" it.
1. I have searched and cannot find out how to get mob health and then stop attacking so I can use item before killing mob.
2. I am pretty sure I can get this part of the quest with a simple inventory update and useItem.
Thanks in advance for help.
Re: Quest useItem when Mob low health - Help
Posted: Tue Jan 01, 2013 5:19 pm
by lisa
to stop attacking something you use
for target HP % you could use
Code: Select all
local target = player:getTarget();
local targetper = target.HP/target.MaxHP*100
So you will probably have to add something to the onskillcast for the specific mob
Code: Select all
<onSkillCast><![CDATA[
local target = player:getTarget();
if target.Name == "mobnamehere" and 35 > (target.HP/target.MaxHP*100) then
player:breakFight()
--add use item code here, might need to retarget the target, not sure if the breakFight clears target or not
end
]]></onSkillCast>
Re: Quest useItem when Mob low health - Help
Posted: Wed Jan 02, 2013 3:25 am
by rock5
You probably don't need to break fight. After you do the code to capture it it will probably disappear so the fight sequence would end anyway.
Re: Quest useItem when Mob low health - Help
Posted: Mon Jan 07, 2013 11:58 am
by Buster99
I am still having a little problem with this part of script. The code works fine but have a logistic problem. The quest mob is dieing too fast because I am using a warlock DOT skill and I am having skills level up automatically as I level.
So, two questions:
1. Is there a way to use the levelupSkills1To10() from lvl 5-10? i.e. - Don't level character until gets to lvl 5, THEN lvl it all the way to lvl 10 (if I start the levelup at lvl 5 it currently only levels up one level at a time, so at Lvl 6 only has +1 to skills)
2. Can I turn off a specific skill for this quest then just re-enable it after? (if I could turn the DOT skill off, Weakening Weave Curse, then back on would be helpful)
Thanks in advance for info
Re: Quest useItem when Mob low health - Help
Posted: Mon Jan 07, 2013 6:33 pm
by lisa
2.
many examples of this all over the forum
Code: Select all
for i, skill in pairs(settings.profile.skills) do
if skill.Name == "MAGE_PURGATORY_FIRE" then
settings.profile.skills[i].AutoUse = true
end
if skill.Name == "MAGE_FLAME" then
settings.profile.skills[i].AutoUse = false
end
if skill.Name == "MAGE_PLASMA_ARROW" then
settings.profile.skills[i].AutoUse = true
end
end
or
Code: Select all
changeProfileSkill("MAGE_PLASMA_ARROW", "Autouse", false)
Re: Quest useItem when Mob low health - Help
Posted: Mon Jan 07, 2013 9:58 pm
by Buster99
TY Lisa