Skip to content

[Quest API] Add EVENT_CHARM_START and EVENT_CHARM_END to Perl/Lua#5013

Merged
Kinglykrab merged 1 commit intomasterfrom
quest_api/charm_events
Sep 15, 2025
Merged

[Quest API] Add EVENT_CHARM_START and EVENT_CHARM_END to Perl/Lua#5013
Kinglykrab merged 1 commit intomasterfrom
quest_api/charm_events

Conversation

@Kinglykrab
Copy link
Copy Markdown
Contributor

Description

  • Adds charm events for NPCs to Perl and Lua.

Perl

  • Add EVENT_CHARM_START and EVENT_CHARM_END, no exports.

Example

sub EVENT_CHARM_START {
	my $owner_name = $client->GetCleanName();
	quest::shout("[Perl] I just got charmed by $owner_name.");
}

sub EVENT_CHARM_END {
	my $owner_name = $client->GetCleanName();
	quest::shout("[Perl] My charm from $owner_name wore off.");
}

Image

image

Lua

  • Add event_charm_start and event_charm_end, exports e.other.

Example

function event_charm_start(e)
	local owner_name = e.other:GetCleanName()
	e.self:Shout(string.format("[Lua] I just got charmed by %s.", owner_name))
end

function event_charm_end(e)
	local owner_name = e.other:GetCleanName()
	e.self:Shout(string.format("[Lua] My charm from %s wore off.", owner_name));
end

Image

image

Type of change

  • New feature

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 6506ad5 into master Sep 15, 2025
2 checks passed
@Kinglykrab Kinglykrab deleted the quest_api/charm_events branch September 15, 2025 13:14
@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