6 const string NWNX_Object =
"NWNX_Object";
440 NWNXCall(NWNX_Object,
"GetLocalVariableCount");
448 NWNXCall(NWNX_Object,
"GetLocalVariable");
450 var.
key = NWNXPopString();
451 var.type = NWNXPopInt();
457 NWNXPushInt(bUpdateSubareas);
458 NWNXPushVector(vPosition);
459 NWNXPushObject(oObject);
460 NWNXCall(NWNX_Object,
"SetPosition");
465 NWNXPushObject(creature);
466 NWNXCall(NWNX_Object,
"GetCurrentHitPoints");
473 NWNXPushObject(creature);
474 NWNXCall(NWNX_Object,
"SetCurrentHitPoints");
480 NWNXPushObject(creature);
481 NWNXCall(NWNX_Object,
"SetMaxHitPoints");
487 NWNXCall(NWNX_Object,
"Serialize");
488 return NWNXPopString();
493 NWNXPushString(serialized);
494 NWNXCall(NWNX_Object,
"Deserialize");
495 return NWNXPopObject();
501 NWNXCall(NWNX_Object,
"GetDialogResref");
502 return NWNXPopString();
507 NWNXPushString(dialog);
509 NWNXCall(NWNX_Object,
"SetDialogResref");
514 NWNXPushInt(nAppearance);
515 NWNXPushObject(oPlaceable);
516 NWNXCall(NWNX_Object,
"SetAppearance");
521 NWNXPushObject(oPlaceable);
522 NWNXCall(NWNX_Object,
"GetAppearance");
530 NWNXCall(NWNX_Object,
"GetHasVisualEffect");
536 NWNXPushInt(damageType);
538 NWNXCall(NWNX_Object,
"GetDamageImmunity");
545 NWNXPushObject(area);
547 NWNXCall(NWNX_Object,
"AddToArea");
553 NWNXCall(NWNX_Object,
"GetPlaceableIsStatic");
559 NWNXPushInt(isStatic);
561 NWNXCall(NWNX_Object,
"SetPlaceableIsStatic");
567 NWNXCall(NWNX_Object,
"GetAutoRemoveKey");
573 NWNXPushInt(bRemoveKey);
575 NWNXCall(NWNX_Object,
"SetAutoRemoveKey");
580 NWNXPushObject(oTrigger);
581 NWNXCall(NWNX_Object,
"GetTriggerGeometry");
582 return NWNXPopString();
587 NWNXPushString(sGeometry);
588 NWNXPushObject(oTrigger);
589 NWNXCall(NWNX_Object,
"SetTriggerGeometry");
594 NWNXPushString(sAlias);
595 NWNXPushString(sFileName);
596 NWNXPushObject(oObject);
597 NWNXCall(NWNX_Object,
"Export");
602 NWNXPushString(sVarName);
603 NWNXPushObject(oObject);
604 NWNXCall(NWNX_Object,
"GetInt");
610 NWNXPushInt(bPersist);
612 NWNXPushString(sVarName);
613 NWNXPushObject(oObject);
614 NWNXCall(NWNX_Object,
"SetInt");
619 NWNXPushString(sVarName);
620 NWNXPushObject(oObject);
621 NWNXCall(NWNX_Object,
"DeleteInt");
626 NWNXPushString(sVarName);
627 NWNXPushObject(oObject);
628 NWNXCall(NWNX_Object,
"GetString");
629 return NWNXPopString();
634 NWNXPushInt(bPersist);
635 NWNXPushString(sValue);
636 NWNXPushString(sVarName);
637 NWNXPushObject(oObject);
638 NWNXCall(NWNX_Object,
"SetString");
643 NWNXPushString(sVarName);
644 NWNXPushObject(oObject);
645 NWNXCall(NWNX_Object,
"DeleteString");
650 NWNXPushString(sVarName);
651 NWNXPushObject(oObject);
652 NWNXCall(NWNX_Object,
"GetFloat");
653 return NWNXPopFloat();
658 NWNXPushInt(bPersist);
659 NWNXPushFloat(fValue);
660 NWNXPushString(sVarName);
661 NWNXPushObject(oObject);
662 NWNXCall(NWNX_Object,
"SetFloat");
667 NWNXPushString(sVarName);
668 NWNXPushObject(oObject);
669 NWNXCall(NWNX_Object,
"DeleteFloat");
674 NWNXPushString(sRegex);
675 NWNXPushObject(oObject);
676 NWNXCall(NWNX_Object,
"DeleteVarRegex");
681 NWNXPushVector(vPosition);
682 NWNXPushObject(oTrigger);
683 NWNXCall(NWNX_Object,
"GetPositionIsInTrigger");
689 NWNXPushObject(oObject);
690 NWNXCall(NWNX_Object,
"GetInternalObjectType");
696 NWNXPushObject(oItem);
697 NWNXPushObject(oObject);
698 NWNXCall(NWNX_Object,
"AcquireItem");
704 NWNXPushObject(oObject);
705 NWNXCall(NWNX_Object,
"ClearSpellEffectsOnOthers");
710 NWNXPushObject(oObject);
711 NWNXCall(NWNX_Object,
"PeekUUID");
712 return NWNXPopString();
717 NWNXPushObject(oDoor);
718 NWNXCall(NWNX_Object,
"GetDoorHasVisibleModel");
724 NWNXPushObject(oObject);
725 NWNXCall(NWNX_Object,
"GetIsDestroyable");
731 NWNXPushInt(nSpellId);
732 NWNXPushObject(oCaster);
733 NWNXPushObject(oDefender);
734 NWNXCall(NWNX_Object,
"DoSpellImmunity");
740 NWNXPushInt(nSpellSchool);
741 NWNXPushInt(nSpellLevel);
742 NWNXPushInt(nSpellId);
743 NWNXPushObject(oCaster);
744 NWNXPushObject(oDefender);
745 NWNXCall(NWNX_Object,
"DoSpellLevelAbsorption");
751 NWNXPushInt(bHasInventory);
753 NWNXCall(NWNX_Object,
"SetHasInventory");
758 NWNXPushObject(oObject);
759 NWNXCall(NWNX_Object,
"GetCurrentAnimation");
765 NWNXPushObject(oObject);
766 NWNXCall(NWNX_Object,
"GetAILevel");
773 NWNXPushObject(oObject);
774 NWNXCall(NWNX_Object,
"SetAILevel");
779 NWNXPushInt(nGender);
781 NWNXPushObject(oObject);
782 NWNXCall(NWNX_Object,
"GetMapNote");
783 return NWNXPopString();
788 NWNXPushInt(nGender);
790 NWNXPushString(sMapNote);
791 NWNXPushObject(oObject);
792 NWNXCall(NWNX_Object,
"SetMapNote");
797 NWNXPushObject(oObject);
798 NWNXCall(NWNX_Object,
"GetLastSpellCastFeat");
804 NWNXPushObject(oLast);
805 NWNXPushObject(oObject);
806 NWNXCall(NWNX_Object,
"SetLastTriggered");
811 NWNXPushObject(oAoE);
812 NWNXCall(NWNX_Object,
"GetAoEObjectDurationRemaining");
813 return NWNXPopFloat();
818 NWNXPushInt(bPrivate);
819 NWNXPushObject(oObject);
820 NWNXCall(NWNX_Object,
"SetConversationPrivate");
825 NWNXPushFloat(fRadius);
826 NWNXPushObject(oAoE);
827 NWNXCall(NWNX_Object,
"SetAoEObjectRadius");
832 NWNXPushObject(oAoE);
833 NWNXCall(NWNX_Object,
"GetAoEObjectRadius");
834 return NWNXPopFloat();
839 NWNXPushObject(oObject);
840 NWNXCall(NWNX_Object,
"GetLastSpellCastSpontaneous");
846 NWNXPushObject(oObject);
847 NWNXCall(NWNX_Object,
"GetLastSpellCastDomainLevel");
853 NWNXPushString(sUUID);
854 NWNXPushObject(oObject);
855 NWNXCall(NWNX_Object,
"ForceAssignUUID");
860 NWNXPushObject(oObject);
861 NWNXCall(NWNX_Object,
"GetInventoryItemCount");
867 NWNXPushInt(bPersist);
868 NWNXPushInt(nSpellID);
869 NWNXPushInt(nProjectilePathType);
870 NWNXPushInt(nProjectileType);
871 NWNXPushObject(oCreature);
872 NWNXCall(NWNX_Object,
"OverrideSpellProjectileVFX");
877 NWNXCall(NWNX_Object,
"GetLastSpellInstant");
883 NWNXPushObject(oCreator);
884 NWNXPushObject(oObject);
885 NWNXCall(NWNX_Object,
"SetTrapCreator");
890 string sFunc =
"GetLocalizedName";
892 NWNXPushInt(nGender);
893 NWNXPushInt(nLanguage);
894 NWNXPushObject(oObject);
896 NWNXCall(NWNX_Object, sFunc);
897 return NWNXPopString();
902 string sFunc =
"SetLocalizedName";
904 NWNXPushInt(nGender);
905 NWNXPushInt(nLanguage);
906 NWNXPushString(sName);
907 NWNXPushObject(oObject);
909 NWNXCall(NWNX_Object, sFunc);
string NWNX_Object_Serialize(object obj)
Serialize a full object to a base64 string.
void NWNX_Object_SetAILevel(object oObject, int nLevel)
Sets the AI level of an object.
const int NWNX_OBJECT_LOCALVAR_TYPE_FLOAT
const int NWNX_OBJECT_TYPE_INTERNAL_STORE
int NWNX_Object_GetLocalVariableCount(object obj)
Gets the count of all local variables.
const int NWNX_OBJECT_TYPE_INTERNAL_PROJECTILE
void NWNX_Object_SetPosition(object oObject, vector vPosition, int bUpdateSubareas=TRUE)
Set oObject's position.
int NWNX_Object_GetPositionIsInTrigger(object oTrigger, vector vPosition)
Get if vPosition is inside oTrigger's geometry.
const int NWNX_OBJECT_LOCALVAR_TYPE_INT
void NWNX_Object_SetAppearance(object oPlaceable, int nAppearance)
Set oPlaceable's appearance.
void NWNX_Object_SetConversationPrivate(object oObject, int bPrivate)
Sets conversations started by oObject to be private or not.
string NWNX_Object_GetString(object oObject, string sVarName)
Get oObject's string variable sVarName.
const int NWNX_OBJECT_TYPE_INTERNAL_DOOR
int NWNX_Object_GetPlaceableIsStatic(object obj)
Get placeable's static setting.
const int NWNX_OBJECT_LOCALVAR_TYPE_OBJECT
float NWNX_Object_GetAoEObjectDurationRemaining(object oAoE)
Gets the remaining duration of the AoE object.
const int NWNX_OBJECT_TYPE_INTERNAL_ENCOUNTER
void NWNX_Object_Export(object oObject, string sFileName, string sAlias="NWNX")
Export an object to the UserDirectory/nwnx folder.
const int NWNX_OBJECT_TYPE_INTERNAL_TRIGGER
const int NWNX_OBJECT_TYPE_INTERNAL_ITEM
string NWNX_Object_GetTriggerGeometry(object oTrigger)
Get the geometry of a trigger.
int NWNX_Object_GetAutoRemoveKey(object obj)
Gets if a door/placeable auto-removes the key after use.
void NWNX_Object_AddToArea(object obj, object area, vector pos)
Add or move an object.
void NWNX_Object_SetLocalizedName(object oObject, string sName, int nLanguage, int nGender=0)
Set the name of the object as set in the toolset for nLanguage.
void NWNX_Object_SetTriggerGeometry(object oTrigger, string sGeometry)
Set the geometry of a trigger with a list of vertex positions.
int NWNX_Object_DoSpellLevelAbsorption(object oDefender, object oCaster, int nSpellId=-1, int nSpellLevel=-1, int nSpellSchool=-1)
Checks for spell school/level immunities and mantles. Should only be called in spellscripts.
void NWNX_Object_SetAoEObjectRadius(object oAoE, float fRadius)
Sets the radius of a circle AoE object.
void NWNX_Object_SetFloat(object oObject, string sVarName, float fValue, int bPersist)
Set oObject's float variable sVarName to fValue.
string NWNX_Object_GetMapNote(object oObject, int nID=0, int nGender=0)
Retrieves the Map Note (AKA Map Pin) from a waypoint - Returns even if currently disabled.
int NWNX_Object_GetCurrentAnimation(object oObject)
Get the current animation of oObject.
void NWNX_Object_ForceAssignUUID(object oObject, string sUUID)
Force the given object to carry the given UUID. Any other object currently owning the UUID is strippe...
const int NWNX_OBJECT_LOCALVAR_TYPE_UNKNOWN
const int NWNX_OBJECT_LOCALVAR_TYPE_JSON
int NWNX_Object_GetAILevel(object oObject)
Gets the AI level of an object.
int NWNX_Object_GetDoorHasVisibleModel(object oDoor)
Get if oDoor has a visible model.
const int NWNX_OBJECT_SPELL_PROJECTILE_TYPE_USE_PATH
const int NWNX_OBJECT_TYPE_INTERNAL_MODULE
int NWNX_Object_GetIsDestroyable(object oObject)
Get if oObject is destroyable.
int NWNX_Object_GetLastSpellCastFeat(object oObject)
Gets the last spell cast feat of oObject.
int NWNX_Object_GetLastSpellCastDomainLevel(object oObject)
Gets the last spell cast domain level.
const int NWNX_OBJECT_TYPE_INTERNAL_AREA
void NWNX_Object_SetPlaceableIsStatic(object obj, int isStatic)
Set placeable as static or not.
const int NWNX_OBJECT_LOCALVAR_TYPE_LOCATION
const int NWNX_OBJECT_TYPE_INTERNAL_WAYPOINT
void NWNX_Object_DeleteString(object oObject, string sVarName)
Delete oObject's string variable sVarName.
const int NWNX_OBJECT_TYPE_INTERNAL_GUI
void NWNX_Object_SetMapNote(object oObject, string sMapNote, int nID=0, int nGender=0)
Sets a Map Note (AKA Map Pin) to any waypoint, even if no previous map note. Only updates for clients...
void NWNX_Object_SetInt(object oObject, string sVarName, int nValue, int bPersist)
Set oObject's integer variable sVarName to nValue.
const int NWNX_OBJECT_TYPE_INTERNAL_INVALID
const int NWNX_OBJECT_TYPE_INTERNAL_CREATURE
const int NWNX_OBJECT_TYPE_INTERNAL_PORTAL
void NWNX_Object_SetDialogResref(object obj, string dialog)
Sets the dialog resref.
const int NWNX_OBJECT_TYPE_INTERNAL_SOUND
const int NWNX_OBJECT_LOCALVAR_TYPE_STRING
int NWNX_Object_GetLastSpellInstant()
Returns TRUE if the last spell was cast instantly. This function should only be called in a spell scr...
const int NWNX_OBJECT_TYPE_INTERNAL_PLACEABLE
int NWNX_Object_GetDamageImmunity(object obj, int damageType)
Get an object's damage immunity.
int NWNX_Object_GetInternalObjectType(object oObject)
Gets the given object's internal type (NWNX_OBJECT_TYPE_INTERNAL_*)
void NWNX_Object_SetHasInventory(object obj, int bHasInventory)
Sets if a placeable has an inventory.
void NWNX_Object_OverrideSpellProjectileVFX(object oCreature, int nProjectileType=-1, int nProjectilePathType=-1, int nSpellID=-1, int bPersist=FALSE)
Override the projectile visual effect of ranged/throwing weapons and spells.
int NWNX_Object_AcquireItem(object oObject, object oItem)
Have oObject acquire oItem.
void NWNX_Object_SetLastTriggered(object oObject, object oLast)
Sets the last object that triggered door or placeable trap.
int NWNX_Object_GetCurrentHitPoints(object obj)
Get an object's hit points.
void NWNX_Object_SetAutoRemoveKey(object obj, int bRemoveKey)
Sets if a door/placeable auto-removes the key after use.
string NWNX_Object_GetLocalizedName(object oObject, int nLanguage, int nGender=0)
Return the name of the object for nLanguage.
string NWNX_Object_GetDialogResref(object obj)
Gets the dialog resref.
object NWNX_Object_Deserialize(string serialized)
Deserialize the object.
void NWNX_Object_SetCurrentHitPoints(object obj, int hp)
Set an object's hit points.
int NWNX_Object_GetInventoryItemCount(object oObject)
Returns how many items are in oObject's inventory.
void NWNX_Object_ClearSpellEffectsOnOthers(object oObject)
Clear all spell effects oObject has applied to others.
string NWNX_Object_PeekUUID(object oObject)
Peek at the UUID of oObject without assigning one if it does not have one.
void NWNX_Object_SetString(object oObject, string sVarName, string sValue, int bPersist)
Set oObject's string variable sVarName to sValue.
float NWNX_Object_GetFloat(object oObject, string sVarName)
Get oObject's float variable sVarName.
void NWNX_Object_SetTrapCreator(object oObject, object oCreator)
Sets the creator of a trap on door, placeable, or trigger. Also changes trap Faction to that of the n...
void NWNX_Object_DeleteInt(object oObject, string sVarName)
Delete oObject's integer variable sVarName.
const int NWNX_OBJECT_TYPE_INTERNAL_AREAOFEFFECT
void NWNX_Object_DeleteFloat(object oObject, string sVarName)
Delete oObject's persistent float variable sVarName.
int NWNX_Object_GetLastSpellCastSpontaneous(object oObject)
Gets whether the last spell cast of oObject was spontaneous.
int NWNX_Object_DoSpellImmunity(object oDefender, object oCaster, int nSpellId=-1)
Checks for specific spell immunity. Should only be called in spellscripts.
struct NWNX_Object_LocalVariable NWNX_Object_GetLocalVariable(object obj, int index)
Gets the local variable at the provided index of the provided object.
float NWNX_Object_GetAoEObjectRadius(object oAoE)
Gets the radius of a circle AoE object.
void NWNX_Object_SetMaxHitPoints(object obj, int hp)
Adjust an object's maximum hit points.
const int NWNX_OBJECT_SPELL_PROJECTILE_TYPE_DEFAULT
int NWNX_Object_GetHasVisualEffect(object obj, int nVFX)
Determine if an object has a visual effect.
const int NWNX_OBJECT_TYPE_INTERNAL_TILE
int NWNX_Object_GetAppearance(object oPlaceable)
Get oPlaceable's appearance.
void NWNX_Object_DeleteVarRegex(object oObject, string sRegex)
Delete any variables that match sRegex.
int NWNX_Object_GetInt(object oObject, string sVarName)
Get oObject's integer variable sVarName.
A local variable structure.
string key
Name of the variable.
int type
Int, String, Float, Object.