What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Boolean for specific critera of an achievement

DocTalbuk

Community Developer
Joined
Jan 7, 2015
Messages
578
Reaction score
13
I am working on a quest profile to kill the rares in legion.

I want the bot to check whether the mob has already been killed.
Whether the mob has been killed before, is part of a criteria for this achievement.
So before it goes killing the mob, I want it to check whether the specific part of the achievement has been completed.

I found the boolean IsAchievementComplete, but thats the closest I found.

Perhaps im overthinking this and theres an easier way to check whether a mob has been killed before?

Any help is appreciated, thanks.
 
You're on the right track : IsAchievementCompleted(X, Y)

X = Achievement ID, Y = Index of sub objective.


This can be a little tricky to figure out because I think it works like this:

1 2
3 4
5 6

If there are multiple sub objectives.
 
Run this in the console and it should give the correct index's for the achievement, you will probably need to write your own code to use in a profile tho dont think it exists as one of the conditions.

Code:
var id = 11263;
var achiveInfo = Lua.GetReturnValues($"return GetAchievementInfo({id});");
var getAchievementNumCriteria = Lua.GetReturnVal<int>($"return GetAchievementNumCriteria({id});", 0);
Log($"{achiveInfo[1]} IsCompleted {achiveInfo[3]} NumCriteria {getAchievementNumCriteria}");
for (var i = 1; i <= getAchievementNumCriteria; i++)
{
var criteriaInfo = Lua.GetReturnValues($"return GetAchievementCriteriaInfo({id},{i});");
if (criteriaInfo != null)
Log($"[{i}] {criteriaInfo[0]} IsCompleted {criteriaInfo[2]}");
}

Havnt tested but might work

Code:
public bool IsAchievementCriteriaComplete(uint id, uint criteria) => Lua.GetReturnVal<bool>($"return GetAchievementCriteriaInfo({id}, {criteria});", 2);
 
Back
Top