I'm struggling to find an answer to this.

I'm updating MyRunUO.cs to update a new field in the myrunuo_characters table.

I thought getting the race would be as simple as:
Code:
string race = mob.Race;
but this is not the case. If anyone knows how to return player race, would appreciate a nudge in the right direction.

Thanks,
Ix
 
I am sure you could use mob.Race and then check the skill based on that
Code:
			public bool IsGarg(Mobile mob, bool isGarg)
        {
			if (mob.Race == Race.Gargoyle)
			return isGarg=true;
			else
			return isGarg=false;
		}
			bool isGarg = new IsGarg();
This doesn't work. Any ideas?
 
uhm that doesnt work since you have a method called IsGarg and then you want to create an instance of a class called IsGarg for a bool.

if you want to use the IsGarg method you could simply use
Code:
public bool IsGarg(Mobile mob)
{
	return mob.Race == Race.Gargyole;
}
 
uhm that doesnt work since you have a method called IsGarg and then you want to create an instance of a class called IsGarg for a bool.

if you want to use the IsGarg method you could simply use
Code:
public bool IsGarg(Mobile mob)
{
	return mob.Race == Race.Gargyole;
}
How would I use this in an if statement?

thanks for the help!
 
like
Code:
if(isGarg(mob))

and if you wouldnt make / use such a method you could simply write
Code:
if(mob.Race == Race.Gargoyle)
 
like
Code:
if(isGarg(mob))

and if you wouldnt make / use such a method you could simply write
Code:
if(mob.Race == Race.Gargoyle)
Tried that and got errors:
Code:
Errors:
 + _Custom/SkillBallPlus.cs:
    CS0117: Line 24: 'Server.Race' does not contain a definition for 'Gargyole'
    CS0103: Line 132: The name 'mob' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.

//Line 24
			public bool IsGarg(Mobile mob)
		{
			return mob.Race == Race.Gargyole;
		}

//Line 132
			  if(mob.Race == Race.Gargoyle)
				  this.AddCheck(65, 425, 2510, 2511, false, (int)SkillName.Throwing);
 
had a typo in the method version,
Gargoyle not Gargyole ;)

and the other error is because mob is not defined where you placed it
 
had a typo in the method version,
Gargoyle not Gargyole ;)

and the other error is because mob is not defined where you placed it

New error...
Code:
Errors:
 + _Custom/SkillBallPlus.cs:
    CS0103: Line 132: The name 'mob' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.
 
How do I use IsGarg() in an if statement?

I basically want to to execute this line if the player is a Gargoyle:

this.AddCheck(65, 425, 2510, 2511, false, (int)SkillName.Throwing);
 
Back