Admiral Refuge Posted March 26, 2011 Author Share Posted March 26, 2011 Hi everyone, this is my first tutorial.I saw someone earlier asking if it was possible to have locked classes in EO, so I figured I'd tell you guys how to do it. This code worked for me, it should work for you as well. Not sure if it works for everything, and there's probably a better way to do it, but meh…So, what are "Locked" classes? Some of you may ask. Well, with this, you can make it possible to forbid a user from starting out as a certain class when they register their character, so classes where "Locked=1" in the classes.ini won't show up in the character creation screen.First, go into your classes.ini file, and give each class a new value:Locked=0Set it to '1' if you want the class locked, 0 for unlocked.After that, you need to add a new type to the class called "Locked". So go into modTypes, and look for where it says "Private Type ClassRec"In that record, look for the line: "StartSpell() As Long", and add after that:```Locked As Byte```Then, go into the LoadClasses sub in modDatabase, and look for this code:```Class(i).Stat(Stats.Willpower) = Val(GetVar(filename, "CLASS" & i, "Willpower"))```After that line, paste this:``` 'Load the locked class Class(i).Locked = Val(GetVar(filename, "CLASS" & i, "Locked"))```Next step, is to find this code in the SendNewCharClasses sub (located in modServerTCP):``` Dim packet As String Dim i As Long, n As Long, q As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SNewCharClasses```After that last line, add the following:```Dim Class_Number As LongClass_Number = 0For i = 1 To Max_Classes If Class(i).Locked = 0 Then Class_Number = Class_Number + 1 End IfNext```Then, replace (just a few lines down) "Buffer.WriteLong Max_Classes" with "Buffer.WriteLong Class_Number"After that, in the same sub you're currently in, change:``` For i = 1 To Class_Number Buffer.WriteString GetClassName(i) Buffer.WriteLong GetClassMaxVital(i, Vitals.HP) Buffer.WriteLong GetClassMaxVital(i, Vitals.MP)```To:``` For i = 1 To Class_Number If Class(i).Locked = 0 Then Buffer.WriteString GetClassName(i) Buffer.WriteLong GetClassMaxVital(i, Vitals.HP) Buffer.WriteLong GetClassMaxVital(i, Vitals.MP)```Then change (about 20 lines down):``` For q = 1 To Stats.Stat_Count - 1 Buffer.WriteLong Class(i).Stat(q) Next Next```To this:``` For q = 1 To Stats.Stat_Count - 1 Buffer.WriteLong Class(i).Stat(q) Next End If Next```Hope this is somewhat clear, if not, let me know, I'll try to clarify.**Note:** If you're going to have some classes locked and others unlocked, be sure to have the unlocked classes first, listed before the locked ones. Otherwise you'll get some nasty results if there's an unlocked class after a locked one in the classes.ini. Link to comment Share on other sites More sharing options...
iSKweek Posted March 26, 2011 Share Posted March 26, 2011 For this part```If Class(i).Locked = 0 Then Class_Number = Class_Number + 1 End If```wouldn't it only add up the number of classes that are unlocked and not get the details for the ones after that number in```For i = 1 To Class_Number If Class(i).Locked = 0 Then Buffer.WriteString GetClassName(i) Buffer.WriteLong GetClassMaxVital(i, Vitals.HP) Buffer.WriteLong GetClassMaxVital(i, Vitals.MP)```For example, if you had 7 classes but number 3 was locked it would be counted as having 6 classes and you wouldn't get the stats for the 7th with the second code? I am probably horribly wrong but that is my thoughts.I am glad someone finally made a tutorial for this though, a lot of people ask for it :P Link to comment Share on other sites More sharing options...
Admiral Refuge Posted March 26, 2011 Author Share Posted March 26, 2011 Actually you may be onto something. I'm looking over this code right now, and I have a feeling it's 'off'. Stress-testing the code now, so we'll see what happens (I actually think this was an issue in the EEs, iirc).Edit: Yeah, you were right. I updated the topic (left something out anyway), letting users know they need to have locked classes after unlocked ones (as we did in EE). Link to comment Share on other sites More sharing options...
Alatar Posted March 26, 2011 Share Posted March 26, 2011 Nice addition, it's the same way EE handled it but it should work as far as i can see ^^ Link to comment Share on other sites More sharing options...
Drakiac Posted March 26, 2011 Share Posted March 26, 2011 Thanks alot! I was looking for something like this!-Drakiac Link to comment Share on other sites More sharing options...
Dzastin Posted March 26, 2011 Share Posted March 26, 2011 How do add activation lock classes by player on game? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted March 26, 2011 Author Share Posted March 26, 2011 @aℓνιη:> How do add activation lock classes by player on game?If you mean, having a player unlock/lock classes, via game, that's beyond the scope of this tutorial. If not, could you explain your question? Link to comment Share on other sites More sharing options...
EclipseCommunity Posted March 26, 2011 Share Posted March 26, 2011 What are locked classes and what are their benefits? Link to comment Share on other sites More sharing options...
iSKweek Posted March 26, 2011 Share Posted March 26, 2011 It is just so you can have class advancements I guess (that is what I would use it for), so you can create classes that aren't accessible until later in the game. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted March 26, 2011 Author Share Posted March 26, 2011 @Xlithan:> What are locked classes and what are their benefits?Refer to:@Anŧhøñy:> So, what are "Locked" classes? Some of you may ask. Well, with this, you can make it possible to forbid a user from starting out as a certain class when they register their character, so classes where "Locked=1" in the classes.ini won't show up in the character creation screen.They're pretty much used for what Skweek said; class advancements, etc. Link to comment Share on other sites More sharing options...
EclipseCommunity Posted March 29, 2011 Share Posted March 29, 2011 That's a pretty good idea if you wanted to make a Dark Ages style system where you can combine 2 classes. Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2011 Share Posted March 30, 2011 Amaizing idea, I will use this ;PIt would be XXL Amaizing, if you make a button in the admin menu in the client so other admins can lock and unlock classes, because they dont own the server files.. would you make that??? Link to comment Share on other sites More sharing options...
Demetour Posted May 21, 2011 Share Posted May 21, 2011 Hey, i have an error. When you select your class it comes up with the classes and the locked ones have blanked names but you can still select them Link to comment Share on other sites More sharing options...
Ateat2 Posted May 30, 2011 Share Posted May 30, 2011 I'm just wondering, will this work for 2.0? Because I try to Ctrl+F the things there and I am unable to find it :c Link to comment Share on other sites More sharing options...
shado360 Posted May 30, 2011 Share Posted May 30, 2011 Yes, it is. Link to comment Share on other sites More sharing options...
Ateat2 Posted May 30, 2011 Share Posted May 30, 2011 Nevermind I got a fix* ^.^ Link to comment Share on other sites More sharing options...
Spiked Posted September 24, 2011 Share Posted September 24, 2011 I really think I figured it out, this looks like a wonderful addition, I am sorry for my nubness : P Link to comment Share on other sites More sharing options...
xxXReichoXxx Posted December 10, 2011 Share Posted December 10, 2011 if i got it right then ..at start ur cleric and if u get lvl 50 u get ur priest class..but is there a way to change startlevel 50?? or something for the priest. so class priest is open only if player has reached lvl 50 Link to comment Share on other sites More sharing options...
Myron Posted December 10, 2011 Share Posted December 10, 2011 @xxXReichoXxx:> if i got it right then ..> at start ur cleric and if u get lvl 50 u get ur priest class..> > but is there a way to change startlevel 50?? or something for the priest. so class priest is open only if player has reached lvl 50@Admiral:> If you mean, having a player unlock/lock classes, via game, that's beyond the scope of this tutorial. If not, could you explain your question? Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 25, 2012 Share Posted March 25, 2012 I got an failure…At the character create where you choice your class is one blank...but in the Class.ini is nothing blank...you can say its not so heavy... but im using an Change class item... and there is all false when there one is blank >.> How can i fix this?[![](http://www7.pic-upload.de/thumb/25.03.12/pjpdovklf4a.png)](http://www.pic-upload.de/view-13479156/Lcoekd.png.html)Here my Classes.ini>! [INIT]MaxClasses=33>! [CLASS1]Name=Lehrling der KriegerMaleSprite=1,2,3,16,14,15,38,39,40FemaleSprite=117,118,119,130,131,132,149,150,151Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=0>! [CLASS2]Name=Lehrling der MagierMaleSprite=1,2,3,16,14,15,38,39,40FemaleSprite=117,118,119,130,131,132,149,150,151Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=0>! [CLASS3]Name=Lehrling der DiebeMaleSprite=1,2,3,16,14,15,38,39,40FemaleSprite=117,118,119,130,131,132,149,150,151Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=0>! [CLASS4]Name=Lehrling der JägerMaleSprite=1,2,3,16,14,15,38,39,40FemaleSprite=117,118,119,130,131,132,149,150,151Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=0>! [CLASS5]Name=Lehrling der PriesterMaleSprite=1,2,3,16,14,15,38,39,40FemaleSprite=117,118,119,130,131,132,149,150,151Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=0>! [CLASS6]Name=Krieger/inMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS7]Name=Magier/inMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS8]Name=Dieb/inMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS9]Name=Jäger/inMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS10]Name=Priester/inMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS11]Name=RitterMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=0>! [CLASS12]Name=PaladinMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS13]Name=ScholarMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS14]Name=HeuchlerMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS15]Name=AttentäterMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS16]Name=BardeMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS17]Name=KopfgeldjägerMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS18]Name=FlüstererMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS19]Name=GelehrterMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS20]Name=MönchMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS21]Name=GeneralMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS22]Name=TemplarMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS23]Name=WarlockMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS24]Name=SchamaneMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS25]Name=AssasineMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS26]Name=MusikerMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS27]Name=SniperMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS28]Name=FörsterMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS29]Name=BischofMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS30]Name=ÄltesterMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS31]Name=WaffenmeisterMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS32]Name=NinjaMaleSprite=1FeMaleSprite=1Strength=5Endurance=5Intelligence=5Agility=5Willpower=5Locked=1>! [CLASS33]Name=KindMaleSprite=1FeMaleSprite=1Strength=1Endurance=1Intelligence=1Agility=1Willpower=1Locked=1 Link to comment Share on other sites More sharing options...
Gleech Posted April 2, 2012 Share Posted April 2, 2012 I'm sorry if this is a bump, but I have to ask:I'm not seeing this anywhere, so I figured before I add this I need to know what it does… Now I've heard you guys say that it's for "Class Advancement", and everything... but, well, how does one _ADVANCE_ to the locked class?Like say I have a class, Warrior, and a locked class, Knight. How would I go about getting a player from Warrior to Knight using this?Or is that not what this does? Because if not I don't understand the point to having classes that are locked so no one can use them. Why have the class then? o.oThanks for taking the time to read this. :) Link to comment Share on other sites More sharing options...
erkro1 Posted April 3, 2012 Share Posted April 3, 2012 Then you just have to hide the class from Add Char class selection thing and and something in level up sub that will change the class when you reach a certain level or gives you the choice to advance. Link to comment Share on other sites More sharing options...
Gleech Posted April 3, 2012 Share Posted April 3, 2012 Ohh I see. Well then I'll just have to learn a bit of VB6 myself then, wont I? ;)Thanks Erwin. :3 Link to comment Share on other sites More sharing options...
ulqui17 Posted April 21, 2012 Share Posted April 21, 2012 I think you forgot the part that saves the class I am corrected it and it worked here, I did so:Server-Soucerin Sub SaveClassesunder```Call PutVar(filename, "CLASS" & i, "Willpower", STR(Class(i).Stat(Stats.willpower)))```add:```Call PutVar(filename, "class" & i, "Locked", STR(Class(i).Locked))```DONE :Dps: use google translator, I am Brazilian Link to comment Share on other sites More sharing options...
Fehedax Posted August 3, 2012 Share Posted August 3, 2012 @Mortal:> I got an failure…> At the character create where you choice your class is one blank...> but in the Class.ini is nothing blank...> you can say its not so heavy... but im using an Change class item... and there is all false when there one is blank >.> How can i fix this?> [![](http://www7.pic-upload.de/thumb/25.03.12/pjpdovklf4a.png)](http://www.pic-upload.de/view-13479156/Lcoekd.png.html)> Here my Classes.ini> > >! [INIT]> MaxClasses=33> >! [CLASS1]> Name=Lehrling der Krieger> MaleSprite=1,2,3,16,14,15,38,39,40> FemaleSprite=117,118,119,130,131,132,149,150,151> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=0> >! [CLASS2]> Name=Lehrling der Magier> MaleSprite=1,2,3,16,14,15,38,39,40> FemaleSprite=117,118,119,130,131,132,149,150,151> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=0> >! [CLASS3]> Name=Lehrling der Diebe> MaleSprite=1,2,3,16,14,15,38,39,40> FemaleSprite=117,118,119,130,131,132,149,150,151> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=0> >! [CLASS4]> Name=Lehrling der Jäger> MaleSprite=1,2,3,16,14,15,38,39,40> FemaleSprite=117,118,119,130,131,132,149,150,151> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=0> >! [CLASS5]> Name=Lehrling der Priester> MaleSprite=1,2,3,16,14,15,38,39,40> FemaleSprite=117,118,119,130,131,132,149,150,151> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=0> >! [CLASS6]> Name=Krieger/in> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS7]> Name=Magier/in> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS8]> Name=Dieb/in> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS9]> Name=Jäger/in> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS10]> Name=Priester/in> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS11]> Name=Ritter> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=0> >! [CLASS12]> Name=Paladin> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS13]> Name=Scholar> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS14]> Name=Heuchler> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS15]> Name=Attentäter> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS16]> Name=Barde> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS17]> Name=Kopfgeldjäger> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS18]> Name=Flüsterer> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS19]> Name=Gelehrter> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS20]> Name=Mönch> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS21]> Name=General> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS22]> Name=Templar> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS23]> Name=Warlock> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS24]> Name=Schamane> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS25]> Name=Assasine> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS26]> Name=Musiker> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS27]> Name=Sniper> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS28]> Name=Förster> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS29]> Name=Bischof> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS30]> Name=Ältester> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS31]> Name=Waffenmeister> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS32]> Name=Ninja> MaleSprite=1> FeMaleSprite=1> Strength=5> Endurance=5> Intelligence=5> Agility=5> Willpower=5> Locked=1> >! [CLASS33]> Name=Kind> MaleSprite=1> FeMaleSprite=1> Strength=1> Endurance=1> Intelligence=1> Agility=1> Willpower=1> Locked=1How i can fix this :`(? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now