EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   Pet enhancments (https://www.eqemulator.org/forums/showthread.php?t=43095)

hayward6 10-22-2020 02:13 PM

Pet enhancments
 
For as long as I've played Everquest, and as long as I have hosted a server, I have always preferred pet classes. The biggest downside to pet classes in Everquest is their weakness when compared to other games, including even EQ2. To combat that on my server I have always adjusted the NPCtypes of all pets to have double the HP, Damage, and regeneration. That works, but ultimately it's messy. First of all that tweaks all pets in the game, so you have to be careful if you're fighting in Najena or any other place with a lot of those npc types.

What I am wondering, is if anyone has a better idea. Maybe in the form of a pet leveling script that would run when a pet is summoned, or a scaling buff spell that can be scribed by pet classes that would buff the pet and maybe even summon gear for it.

Appreciate any thoughts on the subject.

ChaosSlayerZ 10-22-2020 04:52 PM

Yep there is simple enough pet script you can attach to a pet that will adjust pet power, for example based on your stats and keep it in level.
I had this script fully functional back when I was working on my server 7 years back, but I lost all my files.
I plan to recreate it again in a few days, unless someone else beats me to it before that ;)

NatedogEZ 10-22-2020 07:34 PM

Inside global_player.pl

Signals the players pet on level up to re-scale them...

Code:

sub EVENT_LEVEL_UP {
        $client->Message(15, "Auto Skill Activating");
                foreach my $skill ( 0 .. 42, 48 .. 54, 56, 62, 66, 67, 70 .. 74 ) {
               
                next unless $client->CanHaveSkill($skill);
               
                my $max = $client->MaxSkill( $skill, $client->GetClass(), $client->GetLevel() );
               
                next unless $max > $client->GetRawSkill($skill);
               
                $client->SetSkill( $skill, $max );
        }
        if($ulevel < 70) {
                quest::traindiscs($ulevel);
                quest::scribespells($ulevel);
        }
       
        my $PETID = $client->GetPetID();
        if($PETID > 0) {
                my $PET = $entity_list->GetNPCByID($PETID);
                $PET->SignalNPC(42);
        }
}


global_npc.pl

On spawn of an NPC.. checks if its a pet... and calls ScalePet()

The signal code is here for when a player levels it will receive the signal and re-scale to the players new level.

I can't find my original code that did this for me... but this is a rough idea of what I used to use :D

Code:

sub EVENT_SPAWN {


        #Pet Code only below here
    my $ownerid = $npc->GetOwnerID();
    if($ownerid <= 0) { return; }
   
    my $owner = $entity_list->GetMobByID($ownerid);
   
    if($owner->IsClient()) {
        $npc->SetLevel($owner->GetLevel());
        ScalePet($npc, $owner->CastToClient(), $owner->GetCHA());
    }
}


sub EVENT_SIGNAL {

        if ($signal == 42) {
                my $ownerid = $npc->GetOwnerID();
                if($ownerid <= 0) { return; }
                my $owner = $entity_list->GetMobByID($ownerid);
                if($owner->IsClient()) {
                        $npc->SetLevel($owner->GetLevel());
                        ScalePet($npc, $owner->CastToClient(), $owner->GetCHA());
                }
        }
}

sub ScalePet {
        my $pet = $_[0];
        my $owner = $_[1];
        my $cha = $_[2];
       

      #Add more code under here to modify them ect...
        $pet->ModifyNPCStat("max_hp", $owner->GetMaxHP() + ($cha * 0.25));
       
}


ChaosSlayerZ 10-22-2020 09:46 PM

LOL Natedog that was fast =P

Looks like I won't have to reinvent this script from scratch ;)

hayward6 10-23-2020 07:06 AM

Thank you very much! It does seem to do what I am looking for, and I will experiment with tweaks. One thing I notice is the pet spawns low on health. Figure it's due to the scaling happening after summoning, and the new HP gap.

NatedogEZ 10-24-2020 03:14 PM

on spawn i have....

Code:

$npc->SetHP($npc->GetMaxHP());
at the end of the pet scaling code to make sure they are full HP after re-scale :D

Also I found my original code for it... but it has some things that are custom in it and I'd rather not confuse people with snippets of code that don't work without the custom source for it lol

hayward6 10-25-2020 02:29 PM

That worked perfectly, thank you again! I used to have a basic understanding of perl and what we could do, but it's mostly lost on me now. Between this and some regeneration tweaks, pet classes should have it pretty good.

Nerdgasm 04-20-2021 11:51 PM

So with this, Nate, can you add multiple different pet scaling options? Like, one for Beastlord would be different then one for... Mage's lets say... is there a way to do that?


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

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.