/// <summary> /// Set the source light color on the tile at lTileLocation. /// - lTileLocation: the vector part of this is the tile grid (x,y) coordinate of /// the tile. /// - nSourceLight1Color: TILE_SOURCE_LIGHT_COLOR_* /// - nSourceLight2Color: TILE_SOURCE_LIGHT_COLOR_* /// </summary> public static void SetTileSourceLightColor(NWN.Location lTileLocation, int nSourceLight1Color, int nSourceLight2Color) { NWN.Internal.NativeFunctions.StackPushInteger(nSourceLight2Color); NWN.Internal.NativeFunctions.StackPushInteger(nSourceLight1Color); NWN.Internal.NativeFunctions.StackPushLocation(lTileLocation.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(515); }
/// <summary> /// Force the action subject to move to lDestination. /// </summary> public static void ActionForceMoveToLocation(NWN.Location lDestination, bool bRun = false, float fTimeout = 30.0f) { NWN.Internal.NativeFunctions.StackPushFloat(fTimeout); NWN.Internal.NativeFunctions.StackPushInteger(bRun? 1 : 0); NWN.Internal.NativeFunctions.StackPushLocation(lDestination.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(382); }
/// <summary> /// Get the nNth object nearest to lLocation that is of the specified type. /// - nObjectType: OBJECT_TYPE_* /// - lLocation /// - nNth /// * Return value on error: OBJECT_INVALID /// </summary> public static uint GetNearestObjectToLocation(NWN.Location lLocation, ObjectType nObjectType = ObjectType.All, int nNth = 1) { NWN.Internal.NativeFunctions.StackPushInteger(nNth); NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.StackPushInteger((int)nObjectType); NWN.Internal.NativeFunctions.CallBuiltIn(228); return(NWN.Internal.NativeFunctions.StackPopObject()); }
/// <summary> /// Duplicates the object specified by oSource. /// ONLY creatures and items can be specified. /// If an owner is specified and the object is an item, it will be put into their inventory /// If the object is a creature, they will be created at the location. /// If a new tag is specified, it will be assigned to the new object. /// </summary> public static uint CopyObject(uint oSource, NWN.Location locLocation, uint oOwner = OBJECT_INVALID, string sNewTag = "") { NWN.Internal.NativeFunctions.StackPushStringUTF8(sNewTag); NWN.Internal.NativeFunctions.StackPushObject(oOwner); NWN.Internal.NativeFunctions.StackPushLocation(locLocation.Handle); NWN.Internal.NativeFunctions.StackPushObject(oSource); NWN.Internal.NativeFunctions.CallBuiltIn(600); return(NWN.Internal.NativeFunctions.StackPopObject()); }
/// <summary> /// Create an object of the specified type at lLocation. /// - nObjectType: OBJECT_TYPE_ITEM, OBJECT_TYPE_CREATURE, OBJECT_TYPE_PLACEABLE, /// OBJECT_TYPE_STORE, OBJECT_TYPE_WAYPOINT /// - sTemplate /// - lLocation /// - bUseAppearAnimation /// - sNewTag - if this string is not empty, it will replace the default tag from the template /// </summary> public static uint CreateObject(ObjectType nObjectType, string sTemplate, NWN.Location lLocation, bool nUseAppearAnimation = false, string sNewTag = "") { NWN.Internal.NativeFunctions.StackPushStringUTF8(sNewTag); NWN.Internal.NativeFunctions.StackPushInteger(nUseAppearAnimation? 1 : 0); NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.StackPushStringUTF8(sTemplate); NWN.Internal.NativeFunctions.StackPushInteger((int)nObjectType); NWN.Internal.NativeFunctions.CallBuiltIn(243); return(NWN.Internal.NativeFunctions.StackPopObject()); }
/// <summary> /// Creates a square Trap object. /// - nTrapType: The base type of trap (TRAP_BASE_TYPE_*) /// - lLocation: The location and orientation that the trap will be created at. /// - fSize: The size of the trap. Minimum size allowed is 1.0f. /// - sTag: The tag of the trap being created. /// - nFaction: The faction of the trap (STANDARD_FACTION_*). /// - sOnDisarmScript: The OnDisarm script that will fire when the trap is disarmed. /// If "" no script will fire. /// - sOnTrapTriggeredScript: The OnTrapTriggered script that will fire when the /// trap is triggered. /// If "" the default OnTrapTriggered script for the trap /// type specified will fire instead (as specified in the /// traps.2da). /// </summary> public static uint CreateTrapAtLocation(TrapBaseType nTrapType, NWN.Location lLocation, float fSize = 2.0f, string sTag = "", Faction nFaction = Faction.Hostile, string sOnDisarmScript = "", string sOnTrapTriggeredScript = "") { NWN.Internal.NativeFunctions.StackPushStringUTF8(sOnTrapTriggeredScript); NWN.Internal.NativeFunctions.StackPushStringUTF8(sOnDisarmScript); NWN.Internal.NativeFunctions.StackPushInteger((int)nFaction); NWN.Internal.NativeFunctions.StackPushStringUTF8(sTag); NWN.Internal.NativeFunctions.StackPushFloat(fSize); NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.StackPushInteger((int)nTrapType); NWN.Internal.NativeFunctions.CallBuiltIn(809); return(NWN.Internal.NativeFunctions.StackPopObject()); }
/// <summary> /// Get the position vector from lLocation. /// </summary> public static NWN.Vector GetPositionFromLocation(NWN.Location lLocation) { NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(223); return(NWN.Internal.NativeFunctions.StackPopVector()); }
/// <summary> /// Get the area's object ID from lLocation. /// </summary> public static uint GetAreaFromLocation(NWN.Location lLocation) { NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(224); return(NWN.Internal.NativeFunctions.StackPopObject()); }
/// <summary> /// Get the color (TILE_SOURCE_LIGHT_COLOR_*) for the source light 2 of the tile /// at lTile. /// - lTile: the vector part of this is the tile grid (x,y) coordinate of the /// tile. /// </summary> public static int GetTileSourceLight2Color(NWN.Location lTile) { NWN.Internal.NativeFunctions.StackPushLocation(lTile.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(520); return(NWN.Internal.NativeFunctions.StackPopInteger()); }
/// <summary> /// Returns the z-offset at which the walkmesh is at the given location. /// Returns -6.0 for invalid locations. /// </summary> public static float GetGroundHeight(NWN.Location at) { NWN.Internal.NativeFunctions.StackPushLocation(at.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(871); return(NWN.Internal.NativeFunctions.StackPopFloat()); }
/// <summary> /// Get the surface material at the given location. (This is /// equivalent to the walkmesh type). /// Returns 0 if the location is invalid or has no surface type. /// </summary> public static int GetSurfaceMaterial(NWN.Location at) { NWN.Internal.NativeFunctions.StackPushLocation(at.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(870); return(NWN.Internal.NativeFunctions.StackPopInteger()); }
/// <summary> /// Apply eEffect at lLocation. /// </summary> public static void ApplyEffectAtLocation(DurationType nDurationType, NWN.Effect eEffect, NWN.Location lLocation, float fDuration = 0.0f) { NWN.Internal.NativeFunctions.StackPushFloat(fDuration); NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.StackPushEffect(eEffect.Handle); NWN.Internal.NativeFunctions.StackPushInteger((int)nDurationType); NWN.Internal.NativeFunctions.CallBuiltIn(216); }
/// <summary> /// The subject will jump to lLocation instantly (even between areas). /// If lLocation is invalid, nothing will happen. /// </summary> public static void ActionJumpToLocation(NWN.Location lLocation) { NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.CallBuiltIn(214); }
public static void StackPushLocation(NWN.Location value) { StackPushLocation_Native(value.m_Handle); }
/// <summary> /// Get the creature nearest to lLocation, subject to all the criteria specified. /// - nFirstCriteriaType: CREATURE_TYPE_* /// - nFirstCriteriaValue: /// -> CLASS_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_CLASS /// -> SPELL_* if nFirstCriteriaType was CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT /// or CREATURE_TYPE_HAS_SPELL_EFFECT /// -> TRUE or FALSE if nFirstCriteriaType was CREATURE_TYPE_IS_ALIVE /// -> PERCEPTION_* if nFirstCriteriaType was CREATURE_TYPE_PERCEPTION /// -> PLAYER_CHAR_IS_PC or PLAYER_CHAR_NOT_PC if nFirstCriteriaType was /// CREATURE_TYPE_PLAYER_CHAR /// -> RACIAL_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_RACIAL_TYPE /// -> REPUTATION_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_REPUTATION /// For example, to get the nearest PC, use /// (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC) /// - lLocation: We're trying to find the creature of the specified type that is /// nearest to lLocation /// - nNth: We don't have to find the first nearest: we can find the Nth nearest.... /// - nSecondCriteriaType: This is used in the same way as nFirstCriteriaType to /// further specify the type of creature that we are looking for. /// - nSecondCriteriaValue: This is used in the same way as nFirstCriteriaValue /// to further specify the type of creature that we are looking for. /// - nThirdCriteriaType: This is used in the same way as nFirstCriteriaType to /// further specify the type of creature that we are looking for. /// - nThirdCriteriaValue: This is used in the same way as nFirstCriteriaValue to /// further specify the type of creature that we are looking for. /// * Return value on error: OBJECT_INVALID /// </summary> public static uint GetNearestCreatureToLocation(Type nFirstCriteriaType, bool nFirstCriteriaValue, NWN.Location lLocation, int nNth = 1, int nSecondCriteriaType = -1, int nSecondCriteriaValue = -1, int nThirdCriteriaType = -1, int nThirdCriteriaValue = -1) { NWN.Internal.NativeFunctions.StackPushInteger(nThirdCriteriaValue); NWN.Internal.NativeFunctions.StackPushInteger(nThirdCriteriaType); NWN.Internal.NativeFunctions.StackPushInteger(nSecondCriteriaValue); NWN.Internal.NativeFunctions.StackPushInteger(nSecondCriteriaType); NWN.Internal.NativeFunctions.StackPushInteger(nNth); NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle); NWN.Internal.NativeFunctions.StackPushInteger(nFirstCriteriaValue? 1 : 0); NWN.Internal.NativeFunctions.StackPushInteger((int)nFirstCriteriaType); NWN.Internal.NativeFunctions.CallBuiltIn(226); return(NWN.Internal.NativeFunctions.StackPopObject()); }