Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] "Locked" classes


Admiral Refuge
 Share

Recommended Posts

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=0
Set 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 Long
Class_Number = 0
For i = 1 To Max_Classes
    If Class(i).Locked = 0 Then
        Class_Number = Class_Number + 1
    End If
Next
```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

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

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

@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

Amaizing idea, I will use this ;P
It 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

  • 1 month later...
  • 2 weeks later...
  • 3 months later...
  • 2 months later...
@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

  • 3 months later...
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=1
Link to comment
Share on other sites

  • 2 weeks later...
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.o

Thanks for taking the time to read this. :)
Link to comment
Share on other sites

  • 3 weeks later...
I think you forgot the part that saves the class I am corrected it and it worked here, I did so:

Server-Soucer

in Sub SaveClasses

under

```
Call PutVar(filename, "CLASS" & i, "Willpower", STR(Class(i).Stat(Stats.willpower)))
```
add:

```
Call PutVar(filename, "class" & i, "Locked", STR(Class(i).Locked))
```
DONE :D

ps: use google translator, I am Brazilian
Link to comment
Share on other sites

  • 3 months later...
@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=1

How i can fix this :`(?
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...