// ============================================================================
// RynthCore.Engine - Plugins/PluginContract.cs
// Defines the C ABI contract between RynthCore and plugin DLLs.
//
// A plugin DLL must export at least:
// int RynthPluginInit(RynthCoreAPI* api) — return 0 on success
// void RynthPluginShutdown()
//
// Optional exports:
// const char* RynthPluginName() — human-readable name
// const char* RynthPluginVersion() — version string (e.g. "1.0.0")
// void RynthPluginTick() — per-frame logic (before render)
// void RynthPluginRender() — per-frame ImGui drawing (ImGui shell on)
// void RynthPluginRenderOverlay() — per-frame ImGui drawing while the ImGui shell is
// off (Avalonia mode): only windows that have no
// Avalonia panel. Gated by engine.json
// "EnablePluginOverlayWindows" (default true).
// ============================================================================
using System;
using System.Runtime.InteropServices;
namespace RynthCore.Engine.Plugins;
///
/// The host API struct passed to every plugin at init time.
/// Plugins receive a pointer to this and can call back into RynthCore.
/// Layout must stay ABI-stable — append new fields at the end only.
///
[StructLayout(LayoutKind.Sequential)]
internal struct RynthCoreAPI
{
/// API version. Plugins should check this before using later fields.
public uint Version;
/// ImGui context pointer — plugin must call igSetCurrentContext before drawing.
public IntPtr ImGuiContext;
/// IDirect3DDevice9* — the game's active D3D device.
public IntPtr D3DDevice;
/// HWND of the game window.
public IntPtr GameHwnd;
/// Function pointer: void Log(const char* message)
public IntPtr LogFn;
/// Function pointer: void ProbeClientHooks()
public IntPtr ProbeClientHooksFn;
/// Function pointer: uint GetClientHookFlags()
public IntPtr GetClientHookFlagsFn;
/// Function pointer: int ChangeCombatMode(int combatMode)
public IntPtr ChangeCombatModeFn;
/// Function pointer: int CancelAttack()
public IntPtr CancelAttackFn;
/// Function pointer: int QueryHealth(uint targetId)
public IntPtr QueryHealthFn;
/// Function pointer: int MeleeAttack(uint targetId, int attackHeight, float powerLevel)
public IntPtr MeleeAttackFn;
/// Function pointer: int MissileAttack(uint targetId, int attackHeight, float accuracyLevel)
public IntPtr MissileAttackFn;
/// Function pointer: int DoMovement(uint motion, float speed, int holdKey)
public IntPtr DoMovementFn;
/// Function pointer: int StopMovement(uint motion, int holdKey)
public IntPtr StopMovementFn;
/// Function pointer: int JumpNonAutonomous(float extent)
public IntPtr JumpNonAutonomousFn;
/// Function pointer: int SetAutonomyLevel(uint level)
public IntPtr SetAutonomyLevelFn;
/// Function pointer: int SetAutoRun(int enabled)
public IntPtr SetAutoRunFn;
/// Function pointer: int TapJump()
public IntPtr TapJumpFn;
/// Function pointer: void SetIncomingChatSuppression(int enabled)
public IntPtr SetIncomingChatSuppressionFn;
/// Function pointer: int SelectItem(uint objectId)
public IntPtr SelectItemFn;
/// Function pointer: int SetSelectedObjectId(uint objectId)
public IntPtr SetSelectedObjectIdFn;
/// Function pointer: uint GetSelectedItemId()
public IntPtr GetSelectedItemIdFn;
/// Function pointer: uint GetPreviousSelectedItemId()
public IntPtr GetPreviousSelectedItemIdFn;
/// Function pointer: uint GetPlayerId()
public IntPtr GetPlayerIdFn;
/// Function pointer: uint GetGroundContainerId()
public IntPtr GetGroundContainerIdFn;
/// Function pointer: int GetNumContainedItems(uint objectId)
public IntPtr GetNumContainedItemsFn;
/// Function pointer: int GetNumContainedContainers(uint objectId)
public IntPtr GetNumContainedContainersFn;
/// Function pointer: int GetCurCoords(double* northSouth, double* eastWest)
public IntPtr GetCurCoordsFn;
/// Function pointer: int UseObject(uint objectId)
public IntPtr UseObjectFn;
/// Function pointer: int UseObjectOn(uint sourceObjectId, uint targetObjectId)
public IntPtr UseObjectOnFn;
/// Function pointer: int UseEquippedItem(uint sourceObjectId, uint targetObjectId)
public IntPtr UseEquippedItemFn;
/// Function pointer: int MoveItemExternal(uint objectId, uint targetContainerId, int amount)
public IntPtr MoveItemExternalFn;
/// Function pointer: int MoveItemInternal(uint objectId, uint targetContainerId, int slot, int amount)
public IntPtr MoveItemInternalFn;
/// Function pointer: int WriteToChat(const wchar_t* textUtf16, int chatType)
public IntPtr WriteToChatFn;
/// Function pointer: int GetPlayerPose(uint* objCellId, float* x, float* y, float* z, float* qw, float* qx, float* qy, float* qz)
public IntPtr GetPlayerPoseFn;
/// Function pointer: int IsPortaling() — returns 1 if SmartBox::teleport_in_progress, 0 otherwise
public IntPtr IsPortalingFn;
/// Function pointer: int SetMotion(uint motion, int enabled)
public IntPtr SetMotionFn;
/// Function pointer: int StopCompletely()
public IntPtr StopCompletelyFn;
/// Function pointer: int TurnToHeading(float headingDegrees)
public IntPtr TurnToHeadingFn;
/// Function pointer: int GetPlayerHeading(float* headingDegrees)
public IntPtr GetPlayerHeadingFn;
/// Function pointer: const char* GetObjectName(uint objectId)
public IntPtr GetObjectNameFn;
/// Function pointer: int GetPlayerVitals(uint* health, uint* maxHealth, uint* stamina, uint* maxStamina, uint* mana, uint* maxMana)
public IntPtr GetPlayerVitalsFn;
/// Function pointer: int GetObjectPosition(uint objectId, uint* objCellId, float* x, float* y, float* z)
public IntPtr GetObjectPositionFn;
/// Function pointer: int RequestId(uint objectId) — sends appraisal/identify request to server
public IntPtr RequestIdFn;
/// Function pointer: int GetTargetVitals(uint objectId, uint* health, uint* maxHealth, uint* stamina, uint* maxStamina, uint* mana, uint* maxMana)
public IntPtr GetTargetVitalsFn;
/// Function pointer: int CastSpell(uint targetId, int spellId)
public IntPtr CastSpellFn;
/// Function pointer: int GetItemType(uint objectId, uint* typeFlags)
public IntPtr GetItemTypeFn;
/// Function pointer: int GetObjectIntProperty(uint objectId, uint stype, int* value)
public IntPtr GetObjectIntPropertyFn;
/// Function pointer: int GetObjectBoolProperty(uint objectId, uint stype, int* value) — returns 1 if property exists, value is 0/1
public IntPtr GetObjectBoolPropertyFn;
/// Function pointer: int ObjectIsAttackable(uint objectId) — calls ClientCombatSystem::ObjectIsAttackable, returns 1 if attackable
public IntPtr ObjectIsAttackableFn;
/// Function pointer: int GetObjectSkill(uint objectId, uint skillStype, int* base, int* training)
/// base = InitialLevel + LevelFromPracticePoints (no enchantments). training: 0=Unusable,1=Untrained,2=Trained,3=Specialized.
public IntPtr GetObjectSkillFn;
/// Function pointer: int IsSpellKnown(uint objectId, uint spellId) — returns 1 if in spell book
public IntPtr IsSpellKnownFn;
///
/// Function pointer: int ReadPlayerEnchantments(uint* spellIds, double* expiryTimes, int maxCount)
/// Fills arrays with active player enchantments. expiryTimes are in server-time seconds.
/// Returns number written, or -1 if not available (not logged in / no registry).
///
public IntPtr ReadPlayerEnchantmentsFn;
///
/// Function pointer: double GetServerTime()
/// Returns estimated current server time in seconds. Returns 0 if no time sync received yet.
///
public IntPtr GetServerTimeFn;
///
/// Function pointer: int ReadObjectEnchantments(uint objectId, uint* spellIds, double* expiryTimes, int maxCount)
/// Reads enchantments from any game object (armor, weapon, etc.) by ID.
/// Returns number written, 0 if no enchantments, -1 if object not found or has no registry.
///
public IntPtr ReadObjectEnchantmentsFn;
///
/// Function pointer: int WorldToScreen(float worldX, float worldY, float worldZ, float* screenX, float* screenY)
/// Projects a 3D game-world position to 2D screen coordinates.
/// World coordinates are in the same space as GetObjectPosition returns.
/// Returns 1 if on screen, 0 if behind camera or unavailable.
///
public IntPtr WorldToScreenFn;
///
/// Function pointer: int GetViewportSize(uint* width, uint* height)
/// Returns the current D3D9 viewport dimensions.
/// Returns 1 on success, 0 if not available yet.
///
public IntPtr GetViewportSizeFn;
///
/// Function pointer: void Nav3DClear()
/// Clears the 3D nav marker submission buffer. Call once per frame before adding markers.
///
public IntPtr Nav3DClearFn;
///
/// Function pointer: void Nav3DAddRing(float wx, float wy, float wz, float radius, float thickness, uint colorArgb)
/// Submits a flat 3D ring at the given world position. Coordinates are D3D: X=EW, Y=height, Z=NS.
/// Color is ARGB (D3DCOLOR format).
///
public IntPtr Nav3DAddRingFn;
///
/// Function pointer: void Nav3DAddLine(float x1, float y1, float z1, float x2, float y2, float z2, float thickness, uint colorArgb)
/// Submits a flat 3D line between two world positions. Coordinates are D3D: X=EW, Y=height, Z=NS.
///
public IntPtr Nav3DAddLineFn;
///
/// Function pointer: int InvokeChatParser(const wchar_t* textUtf16)
/// Passes text to the AC outgoing chat parser as if the player typed it.
/// Returns 1 on success, 0 if the hook is not installed yet.
///
public IntPtr InvokeChatParserFn;
///
/// Function pointer: int GetObjectDoubleProperty(uint objectId, uint stype, double* value)
/// Reads an STypeFloat (double) property from any game object.
/// Returns 1 on success, 0 if undefined.
///
public IntPtr GetObjectDoublePropertyFn;
///
/// Function pointer: int GetObjectQuadProperty(uint objectId, uint stype, __int64* value)
/// Reads an STypeInt64 (quad) property from any game object.
/// Returns 1 on success, 0 if undefined.
///
public IntPtr GetObjectQuadPropertyFn;
///
/// Function pointer: int GetObjectAttribute2ndBaseLevel(uint objectId, uint stype2nd, ulong* value)
/// Reads the unbuffed base maximum vital via CACQualities::InqAttribute2ndBaseLevel.
/// stype2nd: 1=MAX_HEALTH, 3=MAX_STAMINA, 5=MAX_MANA.
/// Returns 1 on success, 0 if unavailable.
///
public IntPtr GetObjectAttribute2ndBaseLevelFn;
///
/// Function pointer: int GetPlayerBaseVitals(uint* baseMaxHp, uint* baseMaxStam, uint* baseMaxMana)
/// Returns unbuffed base maximum vitals via InqAttribute2ndStruct(_initLevel + _levelFromCp).
/// Excludes spell enchantments; includes base training, gear, and augmentations.
/// Returns 1 on success, 0 if player qualities not yet available.
///
public IntPtr GetPlayerBaseVitalsFn;
///
/// Function pointer: IntPtr GetObjectStringProperty(uint objectId, uint stype)
/// Returns pointer to ANSI string data, or IntPtr.Zero if undefined.
///
public IntPtr GetObjectStringPropertyFn;
///
/// Function pointer: int GetObjectWielderInfo(uint objectId, uint* wielderID, uint* location)
/// Reads PublicWeenieDesc._wielderID and _location from the weenie struct.
///
public IntPtr GetObjectWielderInfoFn;
///
/// Function pointer: int NativeAttack(int attackHeight, float power)
/// Uses the client's native combat pipeline (ClientCombatSystem) which handles
/// turn-to-face and attack execution naturally. Requires target to be selected first.
/// Returns 1 on success, 0 if not available.
///
public IntPtr NativeAttackFn;
///
/// Function pointer: int IsPlayerReady()
/// Returns 1 if the player is in a ready position to begin an attack.
///
public IntPtr IsPlayerReadyFn;
///
/// Function pointer: void SetFpsLimit(int enabled, int focusedFps, int backgroundFps)
/// Controls the engine-level EndScene frame governor.
///
public IntPtr SetFpsLimitFn;
///
/// Function pointer: int GetContainerContents(uint containerId, uint* itemIds, int maxCount)
/// Writes contained item IDs into the provided buffer and returns the number written.
///
public IntPtr GetContainerContentsFn;
///
/// Function pointer: int GetObjectOwnershipInfo(uint objectId, uint* containerID, uint* wielderID, uint* location)
/// Reads PublicWeenieDesc ownership fields from the weenie struct.
///
public IntPtr GetObjectOwnershipInfoFn;
///
/// Function pointer: int SplitStackInternal(uint objectId, uint targetContainerId, int slot, int amount)
/// Moves a stack of items onto a specific slot in the target container, merging
/// with any existing same-type stack at that slot. Unlike MoveItemInternal which
/// sends opcode 0x19 (whole move, first empty slot), this sends opcode 0x55
/// (StackableSplitToContainer) which honors the slot parameter.
///
public IntPtr SplitStackInternalFn;
///
/// Function pointer: int MergeStackInternal(uint sourceObjectId, uint targetObjectId)
/// Merges two stacks of the same item type by sending opcode 0x1A (STACKABLE_MERGE).
/// This is the real merge path used by drag-drop UI — opcode 0x55 (split-to-slot)
/// creates new stacks instead of merging, so AutoStack must use this entry point.
///
public IntPtr MergeStackInternalFn;
///
/// Function pointer: int GetCurrentCombatMode()
/// Reads the current combat mode directly from ClientCombatSystem in AC memory.
/// Returns 1=NonCombat, 2=Melee, 4=Missile, 8=Magic.
///
public IntPtr GetCurrentCombatModeFn;
///
/// Function pointer: int SalvagePanelOpen(uint toolId)
/// Calls CM_Inventory::SendNotice_OpenSalvagePanel to open the salvage panel
/// for the given salvage tool. Returns 1 on success. The panel opens
/// asynchronously — wait ~400 ms before calling SalvagePanelAddItem.
///
public IntPtr SalvagePanelOpenFn;
///
/// Function pointer: int SalvagePanelAddItem(uint itemId)
/// Calls gmSalvageUI::AddNewItem to add an item to the open salvage panel.
/// Requires the panel to have been opened at least once.
/// Returns 1 on success, 0 if the gmSalvageUI instance is not yet captured.
///
public IntPtr SalvagePanelAddItemFn;
///
/// Function pointer: int SalvagePanelExecute()
/// Calls gmSalvageUI::Salvage to execute the salvage operation.
/// Requires the panel to have been opened at least once.
/// Returns 1 on success, 0 if the gmSalvageUI instance is not yet captured.
///
public IntPtr SalvagePanelExecuteFn;
///
/// Function pointer: float GetVitae(uint playerId)
/// Returns the player's vitae multiplier via CACQualities::GetVitaeValue.
/// 1.0 = no vitae, 0.95 = 5% penalty. Returns 1.0 if unavailable.
///
public IntPtr GetVitaeFn;
///
/// Function pointer: const char* GetAccountName()
/// Returns a pointer to the cached ANSI account name string, or IntPtr.Zero if not available.
/// The pointer is valid until the next call.
///
public IntPtr GetAccountNameFn;
///
/// Function pointer: const char* GetWorldName()
/// Returns a pointer to the cached UTF-8 world/server name string, or IntPtr.Zero if not available.
/// The pointer is valid until the next call.
///
public IntPtr GetWorldNameFn;
///
/// Function pointer: uint GetObjectWcid(uint objectId)
/// Returns the Weenie Class ID (WCID) from PublicWeenieDesc._wcid for the given object.
/// Returns 0 if the object is not found or the phys_obj offset is not yet probed.
///
public IntPtr GetObjectWcidFn;
///
/// Function pointer: int HasAppraisalData(uint objectId)
/// Returns 1 if a SendNotice_SetAppraiseInfo has been received for this guid this session, 0 otherwise.
///
public IntPtr HasAppraisalDataFn;
///
/// Function pointer: long GetLastIdTime(uint objectId)
/// Returns the Unix timestamp (seconds) of the last appraisal receipt for this guid, or 0 if never.
///
public IntPtr GetLastIdTimeFn;
///
/// Function pointer: int GetObjectHeading(uint objectId, float* headingDegrees)
/// Returns the object's facing direction (0–360°, clockwise, 0=North). Returns 1 on success, 0 on failure.
///
public IntPtr GetObjectHeadingFn;
///
/// Function pointer: int GetBusyState()
/// Returns 0 if the character is idle, positive if a UI action is in progress.
///
public IntPtr GetBusyStateFn;
///
/// Function pointer: int GetObjectSpellIds(uint objectId, uint* spellIds, int maxCount)
/// Fills spellIds with the spell book IDs from the last server appraisal for this object.
/// Returns total count (may exceed maxCount), or -1 if no appraisal data is cached.
/// Requires the player to have identified (RequestId) the object this session.
///
public IntPtr GetObjectSpellIdsFn;
/// Function pointer: int GetObjectSkillBuffed(uint objectId, uint skillStype, int* buffed)
/// Returns the live buffed skill level (with spell enchantments) via InqSkill(raw=0).
public IntPtr GetObjectSkillBuffedFn;
/// Function pointer: int GetObjectAttribute(uint objectId, uint stype, int raw, uint* value)
/// Reads a primary attribute via InqAttribute. raw=0→buffed, raw=1→base.
/// stype: 1=Strength, 2=Endurance, 3=Quickness, 4=Coordination, 5=Focus, 6=Self.
public IntPtr GetObjectAttributeFn;
/// Function pointer: int GetObjectMotionOn(uint objectId, int* isOn)
/// Returns 1 if a DoMotion On/Off state is known for the object; isOn is 1 if On (open), 0 if Off (closed).
/// Returns 0 if no motion state has been observed for this object since injection.
public IntPtr GetObjectMotionOnFn;
/// Function pointer: int GetObjectState(uint objectId, uint* state)
/// Returns 1 if a PhysicsState has been received from the server for this object; state is the raw bitfield.
/// Returns 0 if no SetState message has been observed for this object since injection.
public IntPtr GetObjectStateFn;
/// Function pointer: uint GetObjectBitfield(uint objectId)
/// Returns the PublicWeenieDesc._bitfield (ObjectDescriptionFlags) for the given object.
/// BF_DOOR = 0x1000, BF_VENDOR = 0x200, BF_CORPSE = 0x2000, etc.
/// Returns 0 if the object is not found.
public IntPtr GetObjectBitfieldFn;
/// Function pointer: void ForceResetBusyCount()
/// Force-resets the client's ClientUISystem busy count to zero.
/// Use after portal teleports that interrupt actions and leave the hourglass cursor stuck.
public IntPtr ForceResetBusyCountFn;
/// Function pointer: int GetObjectPalettes(uint objectId, uint* subIds, uint* offsets, int maxCount)
/// Fills subIds and offsets with the item's ObjDesc subpalette data (sorted by offset).
/// Returns total subpalette count, or -1 if no data was captured for this object.
/// subIds[i] is the palette DID; offsets[i] is the range-start offset (used as slot index).
public IntPtr GetObjectPalettesFn;
/// Function pointer: int CommenceJump()
/// Calls ClientCombatSystem::CommenceJump (spacebar key-down). Starts the
/// power-bar charge cycle. Pair with DoJump(autonomous) to release.
public IntPtr CommenceJumpFn;
/// Function pointer: int DoJump(int autonomous)
/// Calls ClientCombatSystem::DoJump (spacebar key-up). Releases a jump
/// at the current power-bar level. Pass autonomous=1 for the normal
/// player-driven jump (matches keyboard behavior).
public IntPtr DoJumpFn;
/// Function pointer: int LaunchJumpWithMotion(int shift, int w, int x, int z, int c)
/// Writes motion vector directly into CMotionInterp, calls DoJump(1), then
/// clears the motion. This is the only way to jump with forward/back/strafe
/// momentum — SetMotion does not bake velocity into the physics sim in time
/// for DoJump. Mirrors UB's UBHelper.Jumper algorithm.
public IntPtr LaunchJumpWithMotionFn;
/// Function pointer: int GetRadarRect(int* x0, int* y0, int* x1, int* y1)
/// Returns the retail gmRadarUI element's current screen rect in pixels
/// (x0,y0 top-left, x1,y1 bottom-right exclusive). Returns 1 on success, 0
/// if the radar has not rendered yet this session. Requires API v53+.
public IntPtr GetRadarRectFn;
/// Function pointer: void SetRadarSuppressed(int enabled)
/// When enabled=1, the engine skips the original gmRadarUI::DrawObjects call
/// so the vanilla radar stops rendering and a plugin can own that rect.
/// Requires API v54+.
public IntPtr SetRadarSuppressedFn;
/// Function pointer: void SetChatSuppressed(int enabled)
/// When enabled=1, the engine calls UIElement::SetVisible(false) on the
/// gmMainChatUI each frame, hiding the retail chatbox entirely.
/// Requires API v55+.
public IntPtr SetChatSuppressedFn;
/// Function pointer: void SetPowerbarSuppressed(int enabled)
/// When enabled=1, the engine no-ops gmPowerbarUI's RecvNotice_(Begin/
/// Level/Finish), so the retail attack/magic power bar never renders.
/// Requires API v56+.
public IntPtr SetPowerbarSuppressedFn;
/// Function pointer: int GetCastBusyState()
/// 0 = clear to cast, 1 = a cast/action gesture is animating. This is the
/// REAL cast gate (CMotionInterp sequenced-motion queue), distinct from
/// GetBusyState (the ClientUISystem hourglass, which reads 0 while AC still
/// rejects a cast with "You're too busy!"). Sampled on the plugin pump; no
/// acclient.exe hook. Returns 0 when not reachable. Requires API v58+.
public IntPtr GetCastBusyStateFn;
/// Function pointer: int ReadKnownSpells(uint* spellIds, int maxCount)
/// Fills the array with the character's known spell ids from a main-thread
/// spellbook snapshot. Returns count written, or -1 if unavailable (cold
/// snapshot / not logged in). Requires API v59+.
public IntPtr ReadKnownSpellsFn;
/// Function pointer:
/// void Nav3DAddTriangle(float x1, float y1, float z1,
/// float x2, float y2, float z2,
/// float x3, float y3, float z3,
/// uint colorArgb)
/// Submits a filled 3D triangle in world coordinates. Coordinates are D3D:
/// X=EW, Y=height, Z=NS. Use this instead of three Nav3DAddLine calls when
/// you want a face that conforms exactly to a terrain triangle (slope
/// passability overlay). Requires API v60+.
public IntPtr Nav3DAddTriangleFn;
/// Function pointer:
/// void Nav3DAddRingEx(float wx, float wy, float wz, float radius,
/// float thickness, float height, uint colorArgb)
/// Same as Nav3DAddRing but with an explicit cylinder-wall height in
/// world units. Use when you want a tall but thin ring (radar range
/// marker) without coupling visual thickness to wall height. Requires
/// API v61+.
public IntPtr Nav3DAddRingExFn;
/// Function pointer: int GiveObjectTo(uint objectId, uint targetId, int amount)
/// Gives an item to an NPC/player via CM_Inventory::Event_GiveObjectRequest
/// (the F7B1 give GameAction). amount=0 gives the whole object. This is the
/// correct give-to-NPC primitive; MoveItemExternal is move-to-container and
/// does NOT give. Requires API v62+. APPENDED-AT-END for ABI safety.
public IntPtr GiveObjectToFn;
/// Function pointer: int GetUseDoneSeq()
/// Monotonic count of inbound server UseDone (GameEvent 0x01C7) events. The
/// server sends UseDone when it FINISHES an action (cast/use) — completed
/// (WeenieError.None) or refused (e.g. YoureTooBusy). A plugin records this
/// at cast time and watches for it to change to know the server resolved the
/// cast, so combat casts can be paced on real completion instead of a blind
/// interval (which re-fires into the deferred-windup window and orphans the
/// cast). Read-only observation; never touches client m_cBusy. Returns 0 when
/// unavailable. Requires API v63+. APPENDED-AT-END for ABI safety.
public IntPtr GetUseDoneSeqFn;
/// Function pointer: const char* GetEngineStatusJson()
/// Returns the engine-side per-client status fields (host/pid/account/character/server/
/// uptime/fps/pluginTicksPerSec/workingSet/inWorld/queueDropped/reconciles/forceClears/
/// deaths/vitae/xp+lum rates/burden/area/lastIssue) as an ANSI JSON object, EXCLUDING the
/// bot sub-object. A generic "here are my own metrics" accessor — benign, not a remote
/// feature. The returned pointer is valid until the next call on the same thread. Returns
/// IntPtr.Zero on failure. Requires API v64+. APPENDED-AT-END for ABI safety.
public IntPtr GetEngineStatusJsonFn;
/// Function pointer: const char* GetPluginSnapshotJson(const char* pluginName)
/// Brokers the named plugin's RynthPluginGetSnapshotJson export and returns its ANSI JSON
/// pointer (IntPtr.Zero if that plugin isn't loaded / produced no snapshot). Lets one plugin
/// read another's snapshot without GetProcAddress-ing it directly — PluginManager owns the
/// module handles. The returned buffer is owned by the target plugin (valid until its next
/// snapshot call); copy it immediately. Requires API v64+. APPENDED-AT-END for ABI safety.
public IntPtr GetPluginSnapshotJsonFn;
/// Function pointer: int SendPluginCommand(const char* pluginName, const char* action, const char* value)
/// Forwards a (action,value) command to the named plugin's RynthPluginApplyRemoteCommand
/// export. Returns 1 if delivered, 0 otherwise. The receiving plugin copies the args and
/// applies them on its OWN pump/main thread (never on the caller's thread). Requires API
/// v64+. APPENDED-AT-END for ABI safety.
public IntPtr SendPluginCommandFn;
/// Function pointer: int GetObjectDataIdProperty(uint objectId, uint stype, uint* value)
/// Reads a STypeDID property that lives in the object's PublicWeenieDesc (currently Icon=8 →
/// _iconID). Read directly from the embedded PWD struct — network-populated, so it works on
/// UNequipped/never-appraised pack items with no qualities pointer and no main-thread native
/// call. Returns 1 on success (value = the DataID, e.g. 0x06xxxxxx), 0 otherwise. Requires API
/// v65+. APPENDED-AT-END for ABI safety.
public IntPtr GetObjectDataIdPropertyFn;
/// Function pointer: const char* GetPluginExportJson(const char* pluginName, const char* exportName)
/// Generic sibling of GetPluginSnapshotJson: brokers ANY parameterless JSON-getter export on the named
/// plugin (by convention RynthPluginGet*Json — takes no args, returns const char*). Lets one plugin read
/// another's secondary JSON surfaces (e.g. RynthRemote pulling RynthAi's RynthPluginGetInventoryJson)
/// without GetProcAddress-ing it directly — PluginManager owns the module handles. The returned buffer is
/// owned by the target plugin (valid until its next call on that export); copy it immediately. Requires
/// API v66+. APPENDED-AT-END for ABI safety.
public IntPtr GetPluginExportJsonFn;
// ── Vendor trading (v67) ─────────────────────────────────────────────
// Decal's WorldFilter.OpenVendor + Actions.VendorBuyAll/VendorSellAll, as
// stateless batch calls. Reads come from a snapshot the engine takes on AC's
// main thread when the server's vendor list (ApproachVendor 0x0062) is
// opened; buy/sell are queued and sent on AC's main thread through the
// client's own gmVendorUI::SendShopEvent (CM_Vendor::Event_Buy/Event_Sell).
// See Compatibility/VendorTrade.cs. APPENDED-AT-END for ABI safety.
/// Function pointer: int GetVendorInfo(VendorInfoNative* info)
/// Fills info for the vendor that is open right now. Returns 1
/// if a vendor is open, 0 if not (info is zeroed). Any thread. Requires API v67+.
public IntPtr GetVendorInfoFn;
/// Function pointer: int GetVendorItems(VendorItemNative* items, int maxCount)
/// Copies up to maxCount of the open vendor's items. Returns the TOTAL item count
/// (call with maxCount=0 to size a buffer), or -1 if no vendor is open. Any thread.
/// Requires API v67+.
public IntPtr GetVendorItemsFn;
/// Function pointer: uint VendorBuy(uint vendorId, VendorTradeEntryNative* entries, int count)
/// Buys (objectId, amount) pairs from the open vendor (vendorId 0 = whichever is open).
/// Returns a request id (>0) once the request passes the snapshot checks and is
/// queued, or 0 if it was refused (reason in GetVendorTradeStatus and the log).
/// Funds, pack slots and burden are checked again on AC's main thread before the
/// packet goes out; poll GetVendorTradeStatus for the outcome. One transaction is in
/// flight at a time. Requires API v67+.
public IntPtr VendorBuyFn;
/// Function pointer: uint VendorSell(uint vendorId, uint* itemIds, int count)
/// Sells the player's own items (whole stacks) to the open vendor. Same return and
/// status contract as VendorBuy. Requires API v67+.
public IntPtr VendorSellFn;
/// Function pointer: int GetVendorTradeStatus(VendorTradeStatusNative* status)
/// Fills the state of the most recent VendorBuy/VendorSell request. Returns 1 if a
/// request has been made this session, 0 if not. Any thread. Requires API v67+.
public IntPtr GetVendorTradeStatusFn;
/// Function pointer: int GetMergeStackResult(uint sourceObjectId, uint targetObjectId, int* amount, int* ageMs)
/// Outcome of the latest MergeStackInternal(source, target) request: 0 none, 1 queued,
/// 2 sent (amount = units sent), 3 skipped because the target was already full,
/// 4 failed (invalid ids / AC rejected / threw), 5 dropped (main-thread queue full).
/// ageMs = how long ago the outcome was recorded. Either out pointer may be null.
/// Any thread. Requires API v68+. APPENDED-AT-END for ABI safety.
public IntPtr GetMergeStackResultFn;
}
// ─── Vendor trading ABI structs (v67) ───────────────────────────────────
// Blittable, Pack=4, 4-byte fields + fixed ANSI buffers only. Mirrored exactly
// by RynthCore.PluginSdk/VendorTypes.cs. Never reorder or resize; add new calls
// instead of growing these.
/// The open vendor (VendorProfile from ApproachVendor 0x0062). 192 bytes.
[StructLayout(LayoutKind.Sequential, Pack = 4)]
internal unsafe struct VendorInfoNative
{
public uint VendorId;
/// Bumps every time the server (re)sends the vendor list: on open and after
/// each accepted buy/sell. Compare before/after a trade to see the refresh.
public uint Generation;
/// ShopMode passed to gmVendorUI::OpenVendor (raw client value).
public int ShopMode;
/// ITEM_TYPE mask of what the vendor buys.
public uint ItemTypes;
public int MinValue;
public int MaxValue;
public int DealsMagic;
/// Vendor pays value * BuyRate when you sell.
public float BuyRate;
/// Vendor charges value * SellRate when you buy.
public float SellRate;
/// WCID of the vendor's currency; 0 = pyreals.
public uint AltCurrencyWcid;
/// Alt currency count as the server reported it in the vendor list (-1 if none).
public int AltCurrencyServerCount;
/// Alt currency the engine counted in the player's packs (-1 = not counted yet).
public int AltCurrencyHave;
/// Player's pyreals (CoinValue), refreshed on AC's main thread; -1 unknown.
public int PlayerCoins;
public int ItemCount;
/// bit0 = trading available (client functions resolved and layout verified),
/// bit1 = a transaction is in flight.
public uint Flags;
public uint Reserved0;
public fixed byte Name[64];
public fixed byte AltCurrencyName[64];
}
/// One item on the vendor's list (ItemProfile + its PublicWeenieDesc). 120 bytes.
[StructLayout(LayoutKind.Sequential, Pack = 4)]
internal unsafe struct VendorItemNative
{
public uint ObjectId;
public uint Wcid;
public uint ItemType;
public uint IconId;
/// How many the vendor has; -1 = unlimited.
public int Amount;
public int StackSize;
public int MaxStackSize;
/// PWD value of the listed stack.
public int Value;
/// Value of one unit (Value / StackSize for stacks).
public int UnitValue;
/// What one unit costs the player here (server rounding; notes at 1.15x).
public int UnitPrice;
public int Burden;
/// bit0 unlimited, bit1 stackable, bit2 needs a container slot (pack/foci).
public uint Flags;
public uint Reserved0;
public uint Reserved1;
public fixed byte Name[64];
}
/// One buy line: vendor object id + how many.
[StructLayout(LayoutKind.Sequential, Pack = 4)]
internal struct VendorTradeEntryNative
{
public uint ObjectId;
public int Amount;
}
/// State of the most recent trade request. 160 bytes.
[StructLayout(LayoutKind.Sequential, Pack = 4)]
internal unsafe struct VendorTradeStatusNative
{
public uint RequestId;
/// 1 queued, 2 sent (waiting for the server), 3 done, 4 refused (never sent).
public int State;
/// With State 3: 1 = server accepted (vendor list re-sent), 2 = server answered
/// without re-sending the list (refused: funds/busy/space), 3 = no answer (timed out).
public int Result;
public int IsBuy;
public uint VendorId;
public int EntryCount;
/// Buy: estimated cost (pyreals or alt currency). Sell: estimated payout.
public int Estimate;
public uint Reserved0;
public fixed byte Message[128];
}
/// Current API version. Bump when adding fields to RynthCoreAPI.
internal static class PluginContractVersion
{
public const uint Current = 68; // v68: GetMergeStackResult
}
internal static class ClientActionHookFlags
{
public const uint CombatInitialized = 1u << 0;
public const uint MovementInitialized = 1u << 1;
public const uint MeleeAttack = 1u << 2;
public const uint MissileAttack = 1u << 3;
public const uint ChangeCombatMode = 1u << 4;
public const uint CancelAttack = 1u << 5;
public const uint QueryHealth = 1u << 6;
public const uint DoMovement = 1u << 7;
public const uint StopMovement = 1u << 8;
public const uint JumpNonAutonomous = 1u << 9;
public const uint SetAutonomyLevel = 1u << 10;
public const uint SetAutoRun = 1u << 11;
public const uint TapJump = 1u << 12;
public const uint SetMotion = 1u << 13;
public const uint StopCompletely = 1u << 14;
public const uint TurnToHeading = 1u << 15;
public const uint GetPlayerHeading = 1u << 16;
}
// ─── Delegate types matching the plugin's exported functions ────────────
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int PluginInitDelegate(ref RynthCoreAPI api);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginShutdownDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr PluginNameDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr PluginVersionDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnLoginCompleteDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnLogoutDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnUIInitializedDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnBusyCountIncrementedDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnBusyCountDecrementedDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnSelectedTargetChangeDelegate(uint currentTargetId, uint previousTargetId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnCombatModeChangeDelegate(int currentCombatMode, int previousCombatMode);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnSmartBoxEventDelegate(uint opcode, uint blobSize, uint status);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnDeleteObjectDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnCreateObjectDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnUpdateObjectDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnUpdateObjectInventoryDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnViewObjectContentsDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnStopViewingObjectContentsDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnVendorOpenDelegate(uint vendorId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnVendorCloseDelegate(uint vendorId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnUpdateHealthDelegate(uint targetId, float healthRatio, uint currentHealth, uint maxHealth);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnCombatDamageDelegate(uint damage, uint damageType, uint crit, uint isAttacker);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnKillNotificationDelegate(IntPtr textUtf16);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnChatWindowTextDelegate(IntPtr textUtf16, int chatType, IntPtr eatFlag);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnChatBarEnterDelegate(IntPtr textUtf16, IntPtr eatFlag);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginBarActionDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginTickDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginRenderDelegate();
// ─── Log callback that plugins can call ─────────────────────────────────
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void LogCallbackDelegate(IntPtr messageUtf8);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void ProbeClientHooksCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate uint GetClientHookFlagsCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int ChangeCombatModeCallbackDelegate(int combatMode);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int CancelAttackCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int QueryHealthCallbackDelegate(uint targetId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int MeleeAttackCallbackDelegate(uint targetId, int attackHeight, float powerLevel);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int MissileAttackCallbackDelegate(uint targetId, int attackHeight, float accuracyLevel);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int NativeAttackCallbackDelegate(int attackHeight, float power);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int IsPlayerReadyCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int IsPortalingCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetFpsLimitCallbackDelegate(int enabled, int focusedFps, int backgroundFps);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int DoMovementCallbackDelegate(uint motion, float speed, int holdKey);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int StopMovementCallbackDelegate(uint motion, int holdKey);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int JumpNonAutonomousCallbackDelegate(float extent);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SetAutonomyLevelCallbackDelegate(uint level);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SetAutoRunCallbackDelegate(int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int TapJumpCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int CommenceJumpCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int DoJumpCallbackDelegate(int autonomous);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int LaunchJumpWithMotionCallbackDelegate(int shift, int w, int x, int z, int c);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SetMotionCallbackDelegate(uint motion, int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int StopCompletelyCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int TurnToHeadingCallbackDelegate(float headingDegrees);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetPlayerHeadingCallbackDelegate(float* headingDegrees);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetIncomingChatSuppressionCallbackDelegate(int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SelectItemCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SetSelectedObjectIdCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate uint GetItemIdCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetCurCoordsCallbackDelegate(double* northSouth, double* eastWest);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int UseObjectCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int UseObjectOnCallbackDelegate(uint sourceObjectId, uint targetObjectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int UseEquippedItemCallbackDelegate(uint sourceObjectId, uint targetObjectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int MoveItemExternalCallbackDelegate(uint objectId, uint targetContainerId, int amount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int MoveItemInternalCallbackDelegate(uint objectId, uint targetContainerId, int slot, int amount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SplitStackInternalCallbackDelegate(uint objectId, uint targetContainerId, int slot, int amount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int MergeStackInternalCallbackDelegate(uint sourceObjectId, uint targetObjectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int GiveObjectToCallbackDelegate(uint objectId, uint targetId, int amount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int WriteToChatCallbackDelegate(IntPtr textUtf16, int chatType);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetPlayerPoseCallbackDelegate(
uint* objCellId,
float* x,
float* y,
float* z,
float* qw,
float* qx,
float* qy,
float* qz);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr GetObjectNameCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetPlayerVitalsCallbackDelegate(
uint* health,
uint* maxHealth,
uint* stamina,
uint* maxStamina,
uint* mana,
uint* maxMana);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectPositionCallbackDelegate(
uint objectId,
uint* objCellId,
float* x,
float* y,
float* z);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int RequestIdCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetTargetVitalsCallbackDelegate(
uint objectId,
uint* health,
uint* maxHealth,
uint* stamina,
uint* maxStamina,
uint* mana,
uint* maxMana);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int CastSpellCallbackDelegate(uint targetId, int spellId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetItemTypeCallbackDelegate(uint objectId, uint* typeFlags);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectIntPropertyCallbackDelegate(uint objectId, uint stype, int* value);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectBoolPropertyCallbackDelegate(uint objectId, uint stype, int* value);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int ObjectIsAttackableCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectSkillCallbackDelegate(uint objectId, uint skillStype, int* buffed, int* training);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int IsSpellKnownCallbackDelegate(uint objectId, uint spellId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnEnchantmentAddedDelegate(uint spellId, double durationSeconds);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PluginOnEnchantmentRemovedDelegate(uint enchantmentId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int ReadPlayerEnchantmentsCallbackDelegate(uint* spellIds, double* expiryTimes, int maxCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int ReadKnownSpellsCallbackDelegate(uint* spellIds, int maxCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate double GetServerTimeCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int ReadObjectEnchantmentsCallbackDelegate(uint objectId, uint* spellIds, double* expiryTimes, int maxCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int WorldToScreenCallbackDelegate(float worldX, float worldY, float worldZ, float* screenX, float* screenY);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetViewportSizeCallbackDelegate(uint* width, uint* height);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void Nav3DClearCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void Nav3DAddRingCallbackDelegate(float wx, float wy, float wz, float radius, float thickness, uint colorArgb);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void Nav3DAddLineCallbackDelegate(float x1, float y1, float z1, float x2, float y2, float z2, float thickness, uint colorArgb);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void Nav3DAddTriangleCallbackDelegate(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, uint colorArgb);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void Nav3DAddRingExCallbackDelegate(float wx, float wy, float wz, float radius, float thickness, float height, uint colorArgb);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int InvokeChatParserCallbackDelegate(IntPtr textUtf16);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectDoublePropertyCallbackDelegate(uint objectId, uint stype, double* value);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectQuadPropertyCallbackDelegate(uint objectId, uint stype, long* value);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectAttribute2ndBaseLevelCallbackDelegate(uint objectId, uint stype2nd, uint* value);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetPlayerBaseVitalsCallbackDelegate(uint* baseMaxHp, uint* baseMaxStam, uint* baseMaxMana);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr GetObjectStringPropertyCallbackDelegate(uint objectId, uint stype);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectWielderInfoCallbackDelegate(uint objectId, uint* wielderID, uint* location);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetContainerContentsCallbackDelegate(uint containerId, uint* itemIds, int maxCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectOwnershipInfoCallbackDelegate(uint objectId, uint* containerID, uint* wielderID, uint* location);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int GetCurrentCombatModeCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SalvagePanelOpenCallbackDelegate(uint toolId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SalvagePanelAddItemCallbackDelegate(uint itemId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SalvagePanelExecuteCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate float GetVitaeCallbackDelegate(uint playerId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr GetAccountNameCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr GetWorldNameCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate uint GetObjectWcidCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int HasAppraisalDataCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate long GetLastIdTimeCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectHeadingCallbackDelegate(uint objectId, float* headingDegrees);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int GetBusyStateCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int GetCastBusyStateCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int GetUseDoneSeqCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectSpellIdsCallbackDelegate(uint guid, uint* spellIds, int maxCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectSkillLevelCallbackDelegate(uint objectId, uint skillStype, int raw, int* level);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectAttributeCallbackDelegate(uint objectId, uint stype, int raw, uint* value);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectMotionOnCallbackDelegate(uint objectId, int* isOn);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectStateCallbackDelegate(uint objectId, uint* state);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate uint GetObjectBitfieldCallbackDelegate(uint objectId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void ForceResetBusyCountCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectPalettesCallbackDelegate(uint objectId, uint* subIds, uint* offsets, int maxCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetRadarRectCallbackDelegate(int* x0, int* y0, int* x1, int* y1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetRadarSuppressedCallbackDelegate(int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetPowerbarSuppressedCallbackDelegate(int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetChatSuppressedCallbackDelegate(int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr GetEngineStatusJsonCallbackDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr GetPluginSnapshotJsonCallbackDelegate(IntPtr pluginNameAnsi);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int SendPluginCommandCallbackDelegate(IntPtr pluginNameAnsi, IntPtr actionAnsi, IntPtr valueAnsi);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetObjectDataIdPropertyCallbackDelegate(uint objectId, uint stype, uint* value);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr GetPluginExportJsonCallbackDelegate(IntPtr pluginNameAnsi, IntPtr exportNameAnsi);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetVendorInfoCallbackDelegate(VendorInfoNative* info);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetVendorItemsCallbackDelegate(VendorItemNative* items, int maxCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate uint VendorBuyCallbackDelegate(uint vendorId, VendorTradeEntryNative* entries, int count);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate uint VendorSellCallbackDelegate(uint vendorId, uint* itemIds, int count);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetVendorTradeStatusCallbackDelegate(VendorTradeStatusNative* status);
internal unsafe delegate int GetMergeStackResultCallbackDelegate(uint sourceObjectId, uint targetObjectId, int* amount, int* ageMs);