Skip to content

[Pets] Add Pet Constants and Methods#4987

Merged
Kinglykrab merged 4 commits intomasterfrom
pets/constants_and_methods
Aug 17, 2025
Merged

[Pets] Add Pet Constants and Methods#4987
Kinglykrab merged 4 commits intomasterfrom
pets/constants_and_methods

Conversation

@Kinglykrab
Copy link
Copy Markdown
Contributor

@Kinglykrab Kinglykrab commented Aug 15, 2025

Description

  • Adds an event for capturing pet commands.
  • Adds a method to get pet command name.
  • Adds a method to get pet type name.

Type of change

  • New feature

Testing

Perl

  • Add EVENT_PET_COMMAND, exports $pet_command and $pet_command_name.
  • Add quest::get_pet_command_name(pet_command)
  • Add quest::get_pet_type_name(pet_type).
  • Add $mob->GetPetType()
  • Add $mob->GetPetTypeName().
  • Add $mob->SetPetType(pet_type)

Example

sub EVENT_PET_COMMAND {
	my $command_name = quest::get_pet_command_name($pet_command);
	quest::worldwidemessage(335, "[Perl] pet_command $command_name ($pet_command)");
	quest::worldwidemessage(335, "[Perl] pet_command_name $pet_command_name");

	my $pet_type = $client->GetPet()->GetPetType();
	my $pet_type_name = quest::get_pet_type_name($pet_type);
	quest::worldwidemessage(335, "[Perl] pet_type $pet_type_name ($pet_type)");
}

Image

image

Lua

  • Add event_pet_command, exports e.pet_command and e.pet_command_name
  • Add eq.get_pet_command_name(pet_command)
  • Add eq.get_pet_type_name(pet_type)
  • Add mob:GetPetType()
  • Add mob:GetPetTypeName()
  • Add mob:SetPetType(pet_type)

Example

function event_pet_command(e)
	local command_name = eq.get_pet_command_name(e.pet_command)
	eq.world_wide_message(335, "[Lua] pet_command " .. command_name .. " (" .. tostring(e.pet_command) .. ")")
	eq.world_wide_message(335, "[Lua] pet_command_name " .. e.pet_command_name)

	local pet_type = e.self:GetPet():GetPetType()
	local pet_type_name = eq.get_pet_type_name(pet_type)
	eq.world_wide_message(335, "[Lua] pet_type " .. pet_type_name .. " (" .. tostring(pet_type) .. ")")
end

Image

image

Checklist

  • I have tested my changes
  • I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
  • I own the changes of my code and take responsibility for the potential issues that occur

@Kinglykrab Kinglykrab merged commit a4e47d9 into master Aug 17, 2025
2 checks passed
@Kinglykrab Kinglykrab deleted the pets/constants_and_methods branch August 17, 2025 05:00
@joligario joligario mentioned this pull request Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants