diff --git a/src/NWN/NWScript.cs b/src/NWN/NWScript.cs
index aa355eb..e7e180c 100644
--- a/src/NWN/NWScript.cs
+++ b/src/NWN/NWScript.cs
@@ -6279,6 +6279,8 @@ public static partial class NWScript
public const string PLAYER_DEVICE_PROPERTY_UI_RADIAL_SPELLCASTING_ALWAYS_SUBRADIAL = "ui.radial.spellcasting.always-show-as-subradial";
public const string PLAYER_DEVICE_PROPERTY_UI_RADIAL_CLASS_ABILITIES_ALWAYS_SUBRADIAL = "ui.radial.class-abilities.always-show-as-subradial";
public const string PLAYER_DEVICE_PROPERTY_UI_DISPLAY_LOADSCREEN_HINTS_IN_CHATLOG = "ui.display-loadscreen-hints-in-chatlog";
+ public const string PLAYER_DEVICE_PROPERTY_UI_MOUSE_SCALE = "ui.mouse.scale.enabled";
+ public const string PLAYER_DEVICE_PROPERTY_UI_MOUSE_SCALE_VALUE = "ui.mouse.scale.value";
public const string PLAYER_DEVICE_PROPERTY_CAMERA_MODE = "camera.mode";
public const string PLAYER_DEVICE_PROPERTY_CAMERA_EDGE_TURNING = "camera.edge-turning";
public const string PLAYER_DEVICE_PROPERTY_CAMERA_DIALOG_ZOOM = "camera.dialog-zoom";
@@ -7478,11 +7480,14 @@ public static System.IntPtr EffectSummonCreature(string sCreatureResref, int nVi
return VM.StackPopStruct(ENGINE_STRUCTURE_EFFECT);
}
- /// Get the level at which this creature cast it's last spell (or spell-like ability)
- /// * Return value on error, or if oCreature has not yet cast a spell: 0;
- public static int GetCasterLevel(uint oCreature)
+ /// Get the caster level of an object. This is consistent with the caster level used when applying effects if OBJECT_SELF is used.
+ /// - oObject: A creature will return the caster level of their currently cast spell or ability, or the item's caster level if an item was used
+ /// A placeable will return an automatic caster level: floor(10, (spell innate level * 2) - 1)
+ /// An Area of Effect object will return the caster level that was used to create the Area of Effect.
+ /// * Return value on error, or if oObject has not yet cast a spell: 0;
+ public static int GetCasterLevel(uint oObject)
{
- VM.StackPush(oCreature);
+ VM.StackPush(oObject);
VM.Call(84);
return VM.StackPopInt();
}
@@ -9322,8 +9327,9 @@ public static int GetUserDefinedEventNumber()
return VM.StackPopInt();
}
- /// This is for use in a Spell script, it gets the ID of the spell that is being
- /// cast (SPELL_*).
+ /// This is for use in a Spell script, it gets the ID of the spell that is being cast.
+ /// If used in an Area of Effect script it will return the ID of the spell that generated the AOE effect.
+ /// * Returns the spell ID (SPELL_*) or -1 if no spell was cast or on error
public static int GetSpellId()
{
VM.Call(248);
diff --git a/src/NWNX/Plugins/UtilPlugin.cs b/src/NWNX/Plugins/UtilPlugin.cs
index 64d27a5..2eba01c 100644
--- a/src/NWNX/Plugins/UtilPlugin.cs
+++ b/src/NWNX/Plugins/UtilPlugin.cs
@@ -532,6 +532,20 @@ public static void UpdateClientObject(uint oObjectToUpdate, uint oPlayer = OBJEC
VM.NWNX.Call();
}
+ /// Clean a resource directory, deleting all files of nResType.
+ /// A resource directory alias, NWNX or one defined in the custom resource directory file.
+ /// The type of file to delete or 0xFFFF for all types.
+ /// TRUE if successful, FALSE on error.
+ public static int CleanResourceDirectory(string sAlias, int nResType = 65535)
+ {
+ const string sFunc = "CleanResourceDirectory";
+ VM.NWNX.SetFunction(NWNX_Util, sFunc);
+ VM.NWNX.StackPush(nResType);
+ VM.NWNX.StackPush(sAlias);
+ VM.NWNX.Call();
+ return VM.NWNX.StackPopInt();
+ }
+
// @}
}