-
-
Notifications
You must be signed in to change notification settings - Fork 4
Custom Lua functions
The Log
script command will now output its argument to the terminal (assuming you play on emulator with guest logs enabled).
Cobalt adds support for these custom Lua functions.
Displays a notification at the top of the screen similar to when new activities are available, but does not require a MSBT entry
- Message (
string
): message to display in the notification
-- Display a notice with the message "Cobalt now supports custom Lua commands!"
CobaltNotice("Cobalt now supports custom Lua commands!")
Adds an item in the inventory of a unit without displaying the popup (similar to FE Fates)
- PID (
string
): PID of the receiving unit. providenil
if you want to send to convoy instead. - IID (
string
): IID of the item to give
-- Silently add the Lollichop to Alear's inventory
ItemGainSilent("PID_リュール", "IID_ロリポップ斧")
-- Silently add the Lollichop to the convoy
ItemGainSilent(nil, "IID_ロリポップ斧")
Sets the job of a unit without displaying the class change animation. Resets the level to 1
- PID (
string
): PID of the target unit - JID (
string
): JID of the job to set - WeaponMask (
number
, optional): Flags to add weapon proficiencies to the Unit after the job change
-- Turns Clanne into a Mage Knight that's proficient with swords
UnitSetJob("PID_クラン", "JID_マージナイト", 2)
Silently sets the level of the target unit, this change is cosmetic only and does not increase stats or unlock skills
- PID (
string
): PID of the target unit - Level (
number
): Level to assign to the unit
-- Set Alear's level to 7
UnitSetLevel("PID_リュール", 7)
Provide the unit with the job skill for its currently equipped job, disregarding the unit's level
PID (string
): PID of the target unit
-- Alear will now learn their job skill regardless of their level
UnitLearnJobSkill("PID_リュール")
Opens a window listing all the items received as part of a reward
- reward_id (
string
): ID of the reward group to gift the player with. - message_id (
string
): MSBT label of the message to display in the window
-- Gift the rewards for wave 3 of the Season Pass.
ItemGift("Patch3特典", "")
Opens the respective shop menu
-- Open the item shop menu
MenuItemShopShow()
Returns a boolean to check if the player owns the season pass
-- Check if the player has the purchased the Season Pass.
local result = HasPurchasedSeasonPass()
if result == true then
Log("Owns season pass")
else
Log("Does not own season pass")
end
Adds a Bond Ring to the player's rings
- RNID (
string
): ID of the bond ring to give to the player. - Count (
number
, optional): Amount of copies of the bond ring to give.
Example:
-- Add 69 copies of a bond ring to the player.
AddBondRing("RNID_Name_S", 69)