Has anyone tried to set up their shard to where if a person picks Warrior Class, they are limited to the spells they can use?
I know POL can, but just wondering if we can.
 
In playermobile you could create an enum for the "player class", then set it in the CharacterCreation.cs upon creation.
Then you have options:
1- You can add manual checks in every spells if X class can do that.
2- Create a check in the basic Spell.cs.
3- Create a check in SpellHelper for the (probably existing) check if the player can cast X magic, ex: Where you can't cast spells while being an Horrific beast and such.

Option #2 and #3 are the most dynamic aproaches, as you can just create an array (or list and use .Contains(X)) with types for each of the classes you wish, ex:
Code:
private Type[] m_ClassSpells = {typeof(HealSpell), typeof(GreaterHealSpell)};

Then in the check method you could add a new if statement (or "else if", depends of what you have) that do something like:
Code:
if (Array.IndexOf(m_ClassSpells, spell.GetType()) == -1)
{
	return false;
}

The code provided is an example, you would need to plan how it works before attempting to code further.

EDIT:
If you add the classes enum to the PlayerMobile it means you will need to serialize it, be sure to check the tutorials for that to avoid mistakes.
Also make a backup of the file and saves, just in case of mistake; better safe than sorry.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

A problem would be if they didn't use the premade classes, what would you do in that case?
If the user chooses blacksmith, he can still access every spells?
The dude that choose warrior would avoid taking it because of the permanent "bad sides" of it.
 
Have you thought about having a gump, or moongates set up that define classes? You could handle all of this after character creation.
 
I like all these ideas.

If we did it after character creation, which is the path I was going instead of the menu option, then I could see us needing a gump to handle the setting of the class.

So much to work out. And so many things that we could do with that.
 
Back