Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quest API] Add Potion Belt Methods #4634

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kinglykrab
Copy link
Contributor

@Kinglykrab Kinglykrab commented Feb 2, 2025

Description

  • Adds Potion Belt methods to Perl and Lua.

Type of change

  • New feature

Perl

  • Add $client->GetPotionBeltItemIcon(slot_id)
  • Add $client->GetPotionBeltItemID(slot_id)
  • Add $client->GetPotionBeltItemName(slot_id)

Testing

image

Example

sub EVENT_SAY {
	if ($text=~/#a/i) {
		for (my $slot_id = 0; $slot_id < 5; $slot_id++) {
			my $item_icon = $client->GetPotionBeltItemIcon($slot_id);
			my $item_id = $client->GetPotionBeltItemID($slot_id);
			my $item_name = $client->GetPotionBeltItemName($slot_id);
			quest::message(315, "[Perl] Slot: $slot_id Icon: $item_icon ID: $item_id Name: $item_name");
		}
	}
}

Lua

  • Add client:GetPotionBeltItemIcon(slot_id)
  • Add client:GetPotionBeltItemID(slot_id)
  • Add client:GetPotionBeltItemName(slot_id)

Testing

image

Example

function event_say(e)
	if e.message:findi("#a") then
		for slot_id = 0, 4 do
			local item_icon = e.self:GetPotionBeltItemIcon(slot_id)
			local item_id = e.self:GetPotionBeltItemID(slot_id)
			local item_name = e.self:GetPotionBeltItemName(slot_id)

			eq.message(315, string.format("[Lua] Slot: %d Icon: %d ID: %d Name: %s", slot_id, item_icon, item_id, item_name))
		end
	end
end

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

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.

1 participant