Dan(Tasanar)

Moderator
I am working on a minor side project, trying to shut off Meditation gains. I looked in playermobile, skillcheck, regenrates, the actual skill meditation.

Any help would be great, thanks.

On that note so I wanted to shut off a skill like Meditation or Magery. Is there a way in the core or skillcheck.cs I can do this?
 
shutting off skills has to be done in the skill file itself.
For the gain you can return false in AllowGain (SkillCheck.cs) in those skills.
 
That I did but there is no mention of passive skills for meditation in the skill file itself. IE - the passive gain of meditation when you die and regain INT.

Code:
public static void Gain(Mobile from, Skill skill)
        {
            if (from.Region.IsPartOf(typeof(Regions.Jail)))
                return;

            if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
                return;

            if (skill.SkillName == SkillName.Meditation)
                return;

I will try something like this.
 
So you only want to turn off the passive gain? And the AllowGain method was designed for those checks I think but it would work fine in Gain where you wrote it too
 
I just want to shut off all gains to meditation in general. Thanks for pointing me to the right file and method(s)
 
Adding following lines to SkillCheck.cs should do the trick.

Add:
Code:
      else if (from is PlayerMobile && skill.Info.SkillID == (int)SkillName.Meditation)
  return false;
after
Code:
  else if (from is PlayerMobile && from.Race != Race.Gargoyle && skill.Info.SkillID == (int)SkillName.Throwing)
  return false;
 
Code:
public static void Gain(Mobile from, Skill skill)
        {
            if (from.Region.IsPartOf(typeof(Regions.Jail)))
                return;
            if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
                return;
            if (skill.SkillName == SkillName.Meditation)
                return;

Would you recommend that, as a more efficient way over this? ^ Or is it just two ways to skin the same cat
 
Both should work but I think "AllowGain" is the appropriate place and you're not preventing NPCs from gaining meditation ;)
 
Back