Quest useItem when Mob low health - Help

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Buster99
Posts: 69
Joined: Fri Nov 25, 2011 9:27 am

Quest useItem when Mob low health - Help

#1 Post 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.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Quest useItem when Mob low health - Help

#2 Post by lisa »

to stop attacking something you use

Code: Select all

player:breakFight()
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>
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
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Quest useItem when Mob low health - Help

#3 Post 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.
  • 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
Buster99
Posts: 69
Joined: Fri Nov 25, 2011 9:27 am

Re: Quest useItem when Mob low health - Help

#4 Post 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
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Quest useItem when Mob low health - Help

#5 Post 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)
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
Buster99
Posts: 69
Joined: Fri Nov 25, 2011 9:27 am

Re: Quest useItem when Mob low health - Help

#6 Post by Buster99 »

TY Lisa
Post Reply