Page 1 of 1

Checking Secondary Class level

Posted: Wed Jul 13, 2011 8:50 pm
by imaginethat
I am hoping this is a simple question/answer, but am also keen to know where the answer comes from so I don't have to ask easy questions and can get them myself without wasting other peoples time.

How do I check what my secondary class level is?
I can check player.level to find primary class level and move on to bigger mobs if at a certain level, but would like to check if secondary class level is also ready to move on, or should my character swap classes and continue in this area before moving on. Does that make sense?
Doing the actual class swap is discussed in the forums, and in the 1-10 xml docs, so no issue there, just the identifying of the secondary class level is the bit Im missing.

Where can I find out all the syntax around functions and what options there player.class player.level player.??? etc etc

thanks in advance

Re: Checking Secondary Class level

Posted: Wed Jul 13, 2011 9:11 pm
by lisa
player.Class2

If you have a look in rom/classes/pawn.lua from line 55-154 is a list of all the data you can get from a (pawn) which is basically any player or mob.

line 63 has
self.Class2 = CLASS_NONE;

so player.Class2 is your characters second class, something to keep in mind is that the class may be returned as a number, if you look at lines 11-19 in same file it says what the numbers mean.

So let's say you wanted to do something if your second class is druid.

Code: Select all

if player.Class2 == 8 then
printf("My second class is druid.\n")
end
This will print in the MM window that your second class is druid, if it is of course.

Re: Checking Secondary Class level

Posted: Wed Jul 13, 2011 9:48 pm
by imaginethat
Thanks for the prompt reply, and directing me to the pawn.lua file, thought I had looked though most files, but obviously missed that one.

I have not tried it (at work atm), but not quite sure this is going to give me the level of my secondary class, just the name (or number) or it.

How do I then convert this to the level on the secondary class?

cheers

Re: Checking Secondary Class level

Posted: Wed Jul 13, 2011 9:59 pm
by lisa
Ahh yep sorry, level is this

Code: Select all

player.Level2
line 66 of same file ;)

Re: Checking Secondary Class level

Posted: Wed Jul 13, 2011 10:08 pm
by imaginethat
many thanks for the speedy replies, very much appreciated. Will use it tonight.

Re: Checking Secondary Class level

Posted: Thu Jul 14, 2011 8:01 am
by rock5
Also, I'm pretty sure, with the latest updates I've made to the bot, you should be able to just change class without having to reload the profile or anything. It should switch to your other classes skill set, from your profile automatically, as soon as it does a player:update().