View Single Post
  #4  
Old 02-12-2013, 10:13 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Quote:
Originally Posted by c0ncrete View Post
have you tried a number other than 250 to see if that works?

i've never used quest::setallskill() as i'm not a fan of setting all skills to the same number, especially if the character isn't supposed to be able to use a certain skill or have it go over a certain level due to race or class limitations.

you can use something like this to limit skills by race, class, and level:

Code:
foreach my $skill ( 0 .. 74 ) {
    next unless $client->CanHaveSkill($skill);
    my $max = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
    next unless $max > $client->GetRawSkill($skill);
    $client->SetSkill( $skill, $max );
}
you can change $ulevel to the maximum level attainable on your server and it will just limit skills by the character's race and class.

yes, that's the correct way to use check_handin()
I tried to get this to work, but I just can't do it. I am not sure if this is meant to be put in the player.pl file, or if it was meant for the trainer.

What I am really wanting to do is make it a quest in the end. For the lower levels, you can just hail him, and he will set your skills to around 50 or so to start off with. Later, if you want, then you can do a quest and make them max level.

I don't really care if the person is using skills not normally aquired by that class, but I am just wanting it to where thier skills can be maxed outside of skilling it up, like Meditate, or Specializations or something of that caliber.

Here is my quest file so far. The only thing missing from it is where I would appoint skills.

Code:
##########
#Skills Trainer And Quest
#By Kingmen30264
##########

 sub EVENT_SAY
  {
  my $train = quest::saylink("train");
  my $advanced = quest::saylink("advanced skills");
  my $trade = quest::saylink("trade");
  my $free = quest::saylink("FREE");
  my $items = quest::saylink("items");
  my $zone1 = quest::saylink("zone1");
  my $zone2 = quest::saylink("zone2");
  my $item1 = quest::varlink("9989");
  my $item2 = quest::varlink("9999");
  my $count1 = quest::saylink("2");
  my $count2 = quest::saylink("2");
  my $skill = (0 .. 74);

  if($text=~/Hail/i)
    {
      plugin::Whisper("Hi $name. My name is Skills.
                I can $train you in your skills if you would like. Otherwise I might be able to teach some more $advanced.");
    }
  if($text=~/train/i)
    {
        #Insert Skill Command Here <--
    }
  if($text=~/advanced skills/i)
    {
      plugin::Whisper("Yes, I can train you even more. I can train you so much, in fact, that when I am done, I doubt you could go further! However, I cannot merely offer my services for $free now can I?");
      plugin::Whisper("No, no. But, I am in a good mood today, and I am willing to $trade you your higher skills in exchange for something.");
    }
  if($text=~/free/i)
    {
      plugin::Whisper("The only thing you will get from me for free is a swift kick up the --");
      quest::emote("Skills turns his head in disgust.");
    }
  if($text=~/trade/i)
    {
      plugin::Whisper("Yes, you must do something for me for your $advanced.");
      plugin::Whisper("If you wouldn't mind getting your armor a little scratched, I am going to require a few $items from some different locations.");
    }
  if($text=~/items/i)
    {
      plugin::Whisper("Ah, glad to hear that you are willing to begin your training. In that case, I am going to need the following:");
      $client->Message(315, "===$zone1===");
      plugin::Whisper("$item1 X $count1");
      $client->Message(315, "===$zone2===");
      plugin::Whisper("$item2 X $count2");
    }
    
  }
 sub EVENT_ITEM
  {

  if(plugin::check_handin(\%itemcount, 9989 => 1))
    
    {
    plugin::Whisper("As promised, here are your advanced skills. Use them wisely.");
      #Insert Skill Command Here <--
    }
    
    plugin::return_items(\%itemcount);
  }
Hopefully I can get something working. I am going to try and put it in the player.pl file for the zone and see if once zoning into the zone if it doesn't just make it what I want.

As I said, I was really hoping to do a quest to max out all the skills later without having to write out each skill code.

Example
Code:
$client->SetSkill(#,#);
$client->SetSkill(#,#);
Thanks,
Kingmen
Reply With Quote