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.
Quest useItem when Mob low health - Help
Re: Quest useItem when Mob low health - Help
to stop attacking something you use
for target HP % you could use
So you will probably have to add something to the onskillcast for the specific mob
Code: Select all
player:breakFight()Code: Select all
local target = player:getTarget();
local targetper = target.HP/target.MaxHP*100
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>
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Quest useItem when Mob low health - Help
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.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Quest useItem when Mob low health - Help
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
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
2.
many examples of this all over the forum
or
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
Code: Select all
changeProfileSkill("MAGE_PLASMA_ARROW", "Autouse", false)
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual