ID:170880
 
When a player logs in, if Warrior == 1, what is the code for giving them certain warrior verbs? Like, verbs that other classes cannot see, only ones with Warrior == 1.
I actually, helped Lorddonk with the same thing.

mob
Warrior
verb
AnimalScent()
//blah
SpearThrow()
//blah

Login()
if(src.Warrior)
src.verbs += typesof(/mob/Warrior/verb)
src.loc = locate(1,2,1)
else
src.loc = locate(1,1,1)
..()
In response to N1ghtW1ng
Well, It would seem as though that would work, but it doesnt :/ Im sure its something im doing wrong, btw I did edit it a little to suit my needs , I have character handling in my game that gives you the plus 1 on whatever class you choose so the warrior == 1 is actually true because my character is a Warrior, but, the verb does not show up when I log in :/ help meh.

mob
Login()
if(src.Warrior == 1)
src.verbs += typesof(/mob/Warrior/verb)
mob
var
Life = 0
LifeLimit = 0
MagicForce = 0
MagicLimit = 0
Wisdom = 0
WisdomLimit = 0
Trained = 0
Aura = 0
Power = 0
Knowledge = 0
RingEquipped = 0
SwordEquipped = 0
WandEquipped = 0
RobeEquipped = 0
GlovesEquipped = 0
BootsEquipped = 0
StaffEquipped = 0
LeftHand = 0
RightHand = 0
HelmetEquipped = 0
Dexterity = 0
Attacking = 0
SpellTime = 0
FireResistance = 0
IceResistance = 0
LightningResistance = 0
WaterResistance = 0
Warrior = 0
Wizard = 0
Knight = 0
Thief = 0
SwordDamage = 0
WandDamage = 0
RingDamage = 0
RobeDamage = 0
GlovesDamage = 0
BootsDamage = 0
StaffDamage = 0
SlashDamage = 0
Skill = 0
GM = 0

Classes
Warrior
Wizard
Knight
Thief
GM
turf
Start
mob
Warrior
verb
Slash()
set category = "Warrior Skills"
In response to Loch
it would take up more space, but since i'm a newb, that's what i do :P but this is how i usually do it:

mob
Login()
if(src.Warrior == 1)
src.verbs += /mob/Warrior/verb/Slash


in other words, jsut define each verb directly, BUT, that's how i'd do it.. but i'm anewb... sooo my suggestions arn't as important :P
In response to Loch
Give the players a variable when they Create the character, we'll name it class.

mob
var
class = null


Now, to set that class.

class = "Warrior"


now, to check to see if the user's var is "Warrior"

if(src.class == "Warrior")
src.verbs+=typesof(/mob/warrior/verb)


It's not the best looking code, but oh well, that's the easiest way to explain it without typing up all of it in DreamMaker and checking it. (N1ghtW1ng always beats me to posting when I do that, so you can just try to implement this into your game)