EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Pet scaling... (https://www.eqemulator.org/forums/showthread.php?t=41290)

Nerdgasm 04-19-2017 01:22 PM

Pet scaling...
 
I know there was a script released somewhere, but after searching for the last 20-30 minutes I just cannot seem to find it...

I was wondering if anyone had a pet scaling script that has some semi customization... Like, your pet has your HP, and their damage is scaled by the amount of DEX/AGI you have, you know... things like that...

Thanks!

atrayas 04-19-2017 06:22 PM

Id recommend doing custom tables in heidi for pet scaling.

Kingly_Krab 04-19-2017 09:12 PM

Pet Scaling Plugin:
Code:

sub PetScale {
    my $client = plugin::val('client');
    my $entity_list = plugin::val('entity_list');
    my $npc = $entity_list->GetNPCByID($client->GetPetID());
    if (plugin::GetModifier() <= 1) {
        $client->Message(315, "Scaling your pet would be useless, so it was not scaled.");
        return;
    }
    my %h = ("ac" => ["Armor Class", $npc->GetAC(), int($npc->GetAC() * plugin::GetModifier())],
    "max_hp" => ["Health", $npc->GetMaxHP(), int($npc->GetMaxHP() * plugin::GetModifier())],
    "min_hit" => ["Minimum Damage", $npc->GetMinDMG(), int($npc->GetMinDMG() * plugin::GetModifier())],
    "max_hit" => ["Maximum Damage", $npc->GetMaxDMG(), int($npc->GetMaxDMG() * plugin::GetModifier())],
    "atk" => ["Attack", $npc->GetATK(), int((1000 - (1000 / $client->GetLevel())) * plugin::GetModifier())],
    "accuracy" => ["Accuracy", $npc->GetAccuracyRating(), int((1000 - (1000 / $client->GetLevel())) * plugin::GetModifier())]);
    foreach my $key (sort {$a cmp $b} keys %h) {
        if (!$npc->EntityVariableExists($key)) {
            $npc->ModifyNPCStat($key, $h{$key}[2]);
            $npc->SetHP($npc->GetMaxHP());
            $npc->ChangeSize($client->GetSize(), 1);
            $npc->SetLevel($client->GetLevel());
            $npc->SetEntityVariable($key, 1);
        } else {
            $client->Message(315, "Your pet has already been scaled.");
            return;
        }
    }
    quest::popup("Pet Scaling Information", "Your Modifier: <font color = '#00FF00'>" . plugin::commify(plugin::GetModifier()) . "</font><br>
                                            Accuracy: <font color = '#00FFFF'>" . plugin::commify($h{"accuracy"}[1]) . "</font> - <font color = '#FFFF00'>" . plugin::commify($h{"accuracy"}[2]) . "</font><br>
                                            Armor Class: <font color = '#00FFFF'>" . plugin::commify($h{"ac"}[1]) . "</font> - <font color = '#FFFF00'>" . plugin::commify($h{"ac"}[2]) . "</font><br>
                                            Attack: <font color = '#00FFFF'>" . plugin::commify($h{"atk"}[1]) . "</font> - <font color = '#FFFF00'>" . plugin::commify($h{"atk"}[2]) . "</font><br>
                                            Health: <font color = '#00FFFF'>" . plugin::commify($h{"max_hp"}[1]) . "</font> - <font color = '#FFFF00'>" . plugin::commify($h{"max_hp"}[2]) . "</font><br>
                                            Minimum Damage: <font color = '#00FFFF'>" . plugin::commify($h{"min_hit"}[1]) . "</font> - <font color = '#FFFF00'>" . plugin::commify($h{"min_hit"}[2]) . "</font><br>
                                            Maximum Damage: <font color = '#00FFFF'>" . plugin::commify($h{"max_hit"}[1]) . "</font> - <font color = '#FFFF00'>" . plugin::commify($h{"max_hit"}[2]) . "</font><br>");
    $client->Message(315, "Your pet is now completely scaled.");
}

sub GetModifier {
    my $client = plugin::val('client');
    return 1000 if ($client->Admin() == 255);
    return (($client->GetCHA() / 100 > 1) ? ($client->GetCHA() / 100) : 1);
}

return 1;

Pet Scaling in global NPC/Player scripts:
Code:

## quests/global/global_player.pl
sub EVENT_SAY {
    if ($text=~/#Scale/i) {
        if ($client->GetPetID() > 0) {
            plugin::PetScale();
        }
    }
}

sub EVENT_SIGNAL {
    if ($signal == 999) {
        plugin::PetScale();
    }
}

## quests/global/global_npc.pl
sub EVENT_SPAWN {
    if ($npc->GetOwnerID() > 0 && $entity_list->GetMobByID($npc->GetOwnerID())->IsClient()) {
        quest::settimer("PetScale", 1);
    }
}

sub EVENT_TIMER {
    if ($timer eq "PetScale") {
        quest::stoptimer("PetScale");
        $entity_list->GetClientByID($npc->GetOwnerID())->SignalClient(999);
    }
}

It's old, and it does what I wanted it to do. Change it however you'd like.

Nerdgasm 04-20-2017 02:12 PM

Thanks Kingly, while it does *scale* my pet, it doesn't do quite what I was looking for...

Kingly_Krab 04-20-2017 08:43 PM

That was just my version. Modify it to your liking if you want, I thought I'd show you how I do it so you'd have somewhere to start from.

Nerdgasm 04-20-2017 10:09 PM

Quote:

Originally Posted by Kingly_Krab (Post 254344)
That was just my version. Modify it to your liking if you want, I thought I'd show you how I do it so you'd have somewhere to start from.

Fair enough, I'll come back to it when it's more important, how I have them out now is fine, but it's like, 11 spells from 1 - 50, and one at 50... Just kind of annoying getting rid of every other spell but those. =P

GRUMPY 04-21-2017 04:01 PM

Quote:

Originally Posted by atrayas (Post 254323)
Id recommend doing custom tables in heidi for pet scaling.

I noticed when you made a post for Elysium, you mentioned scaling pet stats using charisma ?

http://www.eqemulator.org/forums/showthread.php?t=40804

I also noticed in the source (pets.cpp) something commented out //not used anymore for scaling pet HP's, etc.
Has that whole concept become obsolete ?

atrayas 04-21-2017 06:50 PM

My partner from Elysium had edited the source and created custom tables within heidi to govern pet scaling using charisma. It was a very efficient way to control the overall power of the pets on the fly in case they were over tuned or under tuned.

Darkscis 05-08-2017 01:18 AM

Quote:

Originally Posted by GRUMPY (Post 254349)
I noticed when you made a post for Elysium, you mentioned scaling pet stats using charisma ?

http://www.eqemulator.org/forums/showthread.php?t=40804

I also noticed in the source (pets.cpp) something commented out //not used anymore for scaling pet HP's, etc.
Has that whole concept become obsolete ?

Scaling for Elysium was all done in the source. I still have the code floating around somewhere if anyone wants a look at it. I don't mind sharing :)

EDIT: I think... lol I just looked but I have rebuilt both my work laptops that had the code. Hopefully I zipped it up somewhere but I have been working on other projects since then.


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

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