<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnPlayerSpellCastComplete</id>
	<title>OnPlayerSpellCastComplete - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnPlayerSpellCastComplete"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerSpellCastComplete&amp;action=history"/>
	<updated>2026-09-19T07:26:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=OnPlayerSpellCastComplete&amp;diff=312&amp;oldid=prev</id>
		<title>QCherry: Update Lua event reference</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerSpellCastComplete&amp;diff=312&amp;oldid=prev"/>
		<updated>2026-08-14T22:32:13Z</updated>

		<summary type="html">&lt;p&gt;Update Lua event reference&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- This page is generated from the verified Lua event definition: onPlayerSpellCastComplete. --&amp;gt;&lt;br /&gt;
= onPlayerSpellCastComplete =&lt;br /&gt;
Triggered when an authoritative spell cast completes.&lt;br /&gt;
&lt;br /&gt;
== Availability ==&lt;br /&gt;
This event is available in &amp;#039;&amp;#039;&amp;#039;server-side&amp;#039;&amp;#039;&amp;#039; scripts.&lt;br /&gt;
&lt;br /&gt;
== Callback signature ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onPlayerSpellCastComplete(playerId, spellKey, spellId, castId, phase, result, rejectReason, targetPlayerId, phaseStartTimeMs, phaseDurationMs, manaAfter)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The casting player ID.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;spellKey&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The stable spell definition key.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;spellId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The numeric spell ID.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;castId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The unique cast sequence ID for this player.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;phase&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The authoritative cast phase.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;result&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The authoritative phase result.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rejectReason&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The rejection reason, or an empty value when accepted.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;targetPlayerId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The selected target player ID, if any.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;phaseStartTimeMs&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Server time at which the phase began.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;phaseDurationMs&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Expected duration of the phase in milliseconds.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;manaAfter&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Authoritative mana after this transition.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Handle the event:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerSpellCastComplete&amp;quot;, root, function(playerId, spellKey, spellId, castId, phase, result, rejectReason, targetPlayerId, phaseStartTimeMs, phaseDurationMs, manaAfter)&lt;br /&gt;
    outputDebugString(&amp;quot;onPlayerSpellCastComplete: &amp;quot; .. spellKey .. &amp;quot; cast=&amp;quot; .. castId .. &amp;quot; phase=&amp;quot; .. phase)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Use &amp;lt;code&amp;gt;castId&amp;lt;/code&amp;gt; to correlate all phases, projectiles, impacts, and cleanup for one cast.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Events]]&lt;br /&gt;
[[Category:Server Events]]&lt;br /&gt;
[[Category:Magic Events]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>