Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 10-22-2020, 07:34 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

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

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));
	
}
Reply With Quote
 


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 12:20 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