<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ASetMoraleBarData</id>
	<title>API:SetMoraleBarData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ASetMoraleBarData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SetMoraleBarData&amp;action=history"/>
	<updated>2026-10-18T04:53:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:SetMoraleBarData&amp;diff=30729&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SetMoraleBarData&amp;diff=30729&amp;oldid=prev"/>
		<updated>2026-10-16T19:49:10Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Hotbar}}&lt;br /&gt;
Asks the server to place a morale ability in a morale bar slot, or to clear the slot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetMoraleBarData(moraleLevel, abilityId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;moraleLevel : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Morale slot, 1 to &amp;lt;code&amp;gt;GameData.NUM_MORALE_LEVELS&amp;lt;/code&amp;gt; (4). It is converted to an 8-bit integer.&lt;br /&gt;
;abilityId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Id of the morale ability, or 0 to clear the slot. It is converted to a 16-bit integer.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The client only sends the request; it does not change its own copy of the morale bar here.&lt;br /&gt;
* Nothing is sent if the connection is not ready.&lt;br /&gt;
* For a slot outside 1 to 4 the error below is logged (not raised as a Lua error) and nothing is sent.&lt;br /&gt;
* The function needs at least two arguments and only reads the last two.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;SetMoraleBarData&amp;#039;: moraleSlotId must be 1 to GameData.NUM_MORALE_LEVELS.&amp;lt;/code&amp;gt; (logged)&lt;br /&gt;
* The generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument is not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_moralewindow/source/moralewindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetMoraleBarData (self.m_MoraleLevel, Cursor.Data.ObjectId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clearing a slot, from the same file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetMoraleBarData (self.m_MoraleLevel, 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetMoraleBarData|GetMoraleBarData]]&lt;br /&gt;
* [[API:SetHotbarData|SetHotbarData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>