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

[Unfinished API?] ZetaDia.Service.GameAccount.NumHeroes etc

sinterlkaas

New Member
Joined
Jan 17, 2012
Messages
536
Reaction score
14
Tested this at char selection screen but it does not give the right information...

Logging.Write("Num Heroes: " + ZetaDia.Service.GameAccount.NumHeroes);
Logger.Write("Max slots: " + ZetaDia.Service.GameAccount.MaxHeroSlots);
Logger.Write("Empty slots: " + ZetaDia.Service.GameAccount.NumEmptyHeroSlots);

[07:29:20.754 N] Num Heroes: 128
[07:29:20.754 N] Max slots: 0
[07:29:20.755 N] Empty slots: -128



Code:
int numheroes = ZetaDia.Service.GameAccount.NumHeroes; // returns 128 heroes ? 
string lastname = ""; 
for (int i = 0; i < numheroes; i++)
                    {
                        ZetaDia.Service.GameAccount.SwitchHero(i);
                        Thread.Sleep(1000);
                        
                        h.id = i;
                        h.name = ZetaDia.Service.CurrentHero.Name;
                        h.aClass = ZetaDia.Service.CurrentHero.Class;
                        h.level = ZetaDia.Service.CurrentHero.Level;
                        

                        if (lastname.Equals(h.name))
                            break;
                        lastname = h.name;

                        HeroList.Add(h);
                    }

anyway this does work switches to each hero gets there name, class and level info but .. ofc it will cause an error when I get to the end of my hero list causing a D3 soft error: 300014 Which will be tricky if I would use this to often cause a normal user would not trigger this alot ...


is there a other way to get the list of heroes available ?
 
Just thinking out loud here, but for a "dirty" workaround maybe you could make it so the last hero on the list is something recognizable? Like a dead HC char with level lower than 5? Or a char with a specific name? Or something like that.
 
Hm yea we haven't really used that part of the API so haven't noticed it being outdated.
Also using name to select characters would be useless as there's no unique names and if you want you could use the same name for all your heroes.
Only viable option really is to use the index.

It starts from 0 at the bottom of your character list going up.
One bad thing tho is if you make a new character the indices changes.
 
hmm it does not really start from bottom of the list that is shown ingame ...
my list looks like this:
Hero1 - HC
Hero2 - Normal
Hero3 - Normal
Hero4 - HC

-----------
using a plugin to get the Heroes would get
Hero3, Hero2, Hero4, Hero1
 
Back
Top