You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Description
Expands the scripting API surface for `ActorObject`, `RoomObject`, `ItemObject`, `PetObject`, and `ContainerObject` with a broad set of new methods covering character state, inventory, equipment, quests, skills, spells, cooldowns, combat state, room properties, and container inspection. Updates the admin scripting reference documentation to match, and corrects "See Also" links across all script type pages to point to the new `scripting-objects` reference instead of the old `scripting-functions` anchors.
## Changes
**`internal/scripting/actor_func.go`**
- Added `GetDescription` — returns the actor's current description text
- Added `GetGold` / `GetBank` — returns carried gold and banked gold
- Added `GetWornItems` / `GetWornItem(slot)` — returns all equipped items or the item in a specific slot
- Added `FindInBackpack(itemName)` / `FindOnBody(itemName)` — fuzzy-search actor inventory and equipped slots
- Added `IsQuestDone(questToken)` / `ClearQuestToken(questToken)` — check quest completion and reset quest progress
- Added `GetAllSkills` / `GetSpells` — return skill ranks and spellbook as maps
- Added `UnLearnSpell` / `DisableSpell` / `EnableSpell` — mutate the actor's spellbook
- Added `GetCooldown(tag)` / `TryCooldown(tag, period)` — read and atomically check-and-set cooldowns
- Added `GetSetting(name)` / `SetSetting(name, value)` — read and write persistent character settings
- Added `GetExperience` / `GetExtraLives` — read progression state
- Added `IsInCombat` / `IsDowned` — check combat and health state
- Added `GetDefense` / `GetGearValue` / `GetCarryCapacity` — read gear and carry stats
- Added `GetZoneVisitProgress(zoneName)` — returns visited/total/percent exploration for a zone (user actors only)
- Added `GetAdjectives` / `HasAdjective(adj)` — inspect actor adjective state
- Added `GetActionPoints` / `GetActionPointsMax` — read current and maximum action points
- Added `GetHealthAppearance` — returns a human-readable health description string
**`internal/scripting/room_func.go`**
- Added `GetTitle` / `SetTitle(title)` — read and write the room's title
- Added `GetDescription` / `SetDescription(desc)` — read and write the room's description
- Added `GetGold` / `AddGold(amount)` / `RemoveGold(amount)` — inspect and mutate floor gold
- Added `GetZone` — returns the room's zone name
- Added `IsPvp` / `IsBank` — check room flags
- Added `GetContainer(name)` — returns a `ContainerObject` for the named container, or null
- Added `SpawnTempContainer(name, duration, lockDifficulty, ...trapBuffIds)` — creates a temporary container
- Added `IsCalm` / `AreMobsAttacking(userId)` / `ArePlayersAttacking(userId)` — query room combat state
- Added `MobCount` / `PlayerCount` — returns occupant counts
- Added `GetVisibility` — returns the room's current light level (0=dark, 1=dim, 2=lit)
- Added `GetNouns` / `AddNoun(noun, desc)` / `RemoveNoun(noun)` — manage room interactive nouns
- Added `GetSigns` / `AddSign(text, userId, days)` — read and post room signs
- Added `HasRecentVisitors` — returns whether the room has had recent activity
- Added `ContainerObject.GetLockDifficulty` / `GetTrapBuffIds` / `GetDespawnRound` / `Exists` — inspect container lock and lifecycle state
**`internal/scripting/item_func.go`**
- Added `GetType` / `GetSubtype` — returns the item's type and subtype strings
- Added `GetValue` / `GetDescription` / `GetQuestToken` / `GetElement` — read item spec fields
- Added `GetBuffIds` / `GetWornBuffIds` — returns use and passive buff IDs
- Added `GetStatMods` — returns stat modifier map
- Added `GetDamageReduction` / `GetDamage` — read armor and weapon stats
- Added `GetBreakChance` / `GetKeyLockId` — read item fragility and key lock ID
- Added `IsCursed` / `HasUses` / `IsWearable` / `IsWeapon` — boolean item classification helpers
**`internal/scripting/pet_func.go`**
- Added `GetItems` — returns all items in the pet's inventory
- Added `FindItem(itemName)` — fuzzy-search pet inventory
- Added `StoreItem(item)` / `RemoveItem(item)` — add and remove items from pet inventory
- Added `GetBuffIds` — returns the passive buff IDs the pet grants its owner
**Admin documentation (`_datafiles/html/admin/`)**
- Added documentation entries for all new methods to `scripting-objects.html` under their respective object sections
- Updated `scripting.html` to include `ContainerObject` in the function reference description
- Updated "See Also" links in `scripting-buffs.html`, `scripting-items.html`, `scripting-mobs.html`, `scripting-pets.html`, `scripting-rooms.html`, and `scripting-spells.html` to point to `scripting-objects` anchors instead of the old `scripting-functions` anchors
- Added a `ContainerObject Reference` See Also link to `scripting-rooms.html`
<divclass="feature-card-desc">Complete API docs for ActorObject, RoomObject, ItemObject, PetObject, PartyObject, Utility, Messaging, and Panel functions.</div>
271
+
<divclass="feature-card-desc">Complete API docs for ActorObject, RoomObject, ItemObject, PetObject, PartyObject, ContainerObject, Utility, Messaging, and Panel functions.</div>
0 commit comments