Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2013, 02:07 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

if you can set the correct race via in-game command, i'd recommend looking at the related entries for that npc your database instead of putting a perl band-aid on the issue.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #2  
Old 02-11-2013, 02:32 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Quote:
Originally Posted by c0ncrete View Post
if you can set the correct race via in-game command, i'd recommend looking at the related entries for that npc your database instead of putting a perl band-aid on the issue.
Yeah, I was trying to do that from the beginning.... Unfortunately, I was messing with the NPC_TYPES table, and I just ended up duplicating the npc row that I wanted and I am going to just use the #dbspawn command for pre-made characters that I know work in the zone(s) that I am populating.

Thanks for all your help though, it is greatly appreciated, and you have been really helpful and quick to respond to me c0ncrete.

Thanks.
Reply With Quote
  #3  
Old 02-11-2013, 03:43 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

this should take care of spell casting specialization skills correctly.
i haven't tested it yet, but the syntax is correct and the logic looks sound.

Code:
    use List::Util qw(first);

    # shorthand aliases for the client methods we'll be using
    $CanSkill = sub { $client->CanHaveSkill(shift) };
    $MaxSkill = sub { $client->MaxSkill( shift, $class, $ulevel ) };
    $RawSkill = sub { $client->GetRawSkill(shift) };
    $SetSkill = sub { $client->SetSkill( shift, shift ) };

    # set all available skills to max value for client's current level
    # NOTE: spell-casting specialization skills are handled later
    foreach my $skillNum ( 0 .. 42, 48 .. 74 ) {
        next unless $CanSkill->($skillNum);
        $SetSkill->( $skillNum, $MaxSkill->($skillNum) );
    }

    # if client is a caster and can specialize
    if ( $CanSkill->(43) ) {

        # get current raw value for all spell-casting spec skills
        my %spec = map { $_ => $RawSkill->($_) } ( 43 .. 47 );

        # if one spell-casting spec skill is above 50 (main spec for caster),
        # set it to the max value for the client's current level
        # (this skill is deleted from hash and doesn't get calculated again)
        if ( my $mainSpec = first { $spec{$_} > 50 } keys %spec ) {
            $SetSkill->( $mainSpec, $MaxSkill->($mainSpec) );
            delete $spec{$mainSpec};
        }

        # set spell-casting spec skills to max value for client's current level
        # all skill levels but the first one that goes over 50 are capped at 50
        foreach my $skillNum ( keys %spec ) {
            next if $spec{$skillNum} == 50;
            my $maxVal = $MaxSkill->($skillNum);
            $SetSkill->( $skillNum, $maxVal > 50 ? 50 : $maxVal );
        }
    }
NOTE: oops... i forgot to include the List::Util module in my copy/paste. corrected.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;

Last edited by c0ncrete; 02-11-2013 at 04:08 AM.. Reason: more clarification in comments
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:22 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3