<?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%3AGetMoraleBarData</id>
	<title>API:GetMoraleBarData - 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%3AGetMoraleBarData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetMoraleBarData&amp;action=history"/>
	<updated>2026-10-17T22:25:41Z</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:GetMoraleBarData&amp;diff=30431&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:GetMoraleBarData&amp;diff=30431&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:28Z</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;
Returns the morale ability placed in a morale bar slot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hasAbility, abilityId = GetMoraleBarData(moraleLevel)&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).&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;hasAbility : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – 1 if an ability is placed in the slot, otherwise 0. This is a number, not a boolean: 0 counts as true in Lua.&lt;br /&gt;
;abilityId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Id of the ability in the slot, 0 if empty.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* For a slot outside 1 to 4 the error below is logged (not raised as a Lua error) and nothing is returned.&lt;br /&gt;
* The stock UI only uses the second value.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetMoraleBarData&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 the argument is missing or not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;easystem_actionbarclustermanager/source/newabilityhandler.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local _, currentlySlottedMoraleAbilityId = GetMoraleBarData (newAbility.moraleLevel)&lt;br /&gt;
&lt;br /&gt;
if (currentlySlottedMoraleAbilityId == 0)&lt;br /&gt;
then&lt;br /&gt;
    SetMoraleBarData (newAbility.moraleLevel, newAbility.id)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SetMoraleBarData|SetMoraleBarData]]&lt;br /&gt;
* [[API:GetMoraleCooldown|GetMoraleCooldown]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>