Exemplo n.º 1
0
 /// <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());
 }
Exemplo n.º 2
0
 /// <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, Location lLocation, float fSize = 2.0f,
                                         string sTag = "", Faction nFaction = Faction.Hostile, string sOnDisarmScript = "",
                                         string sOnTrapTriggeredScript = "")
 {
     Internal.NativeFunctions.StackPushStringUTF8(sOnTrapTriggeredScript);
     Internal.NativeFunctions.StackPushStringUTF8(sOnDisarmScript);
     Internal.NativeFunctions.StackPushInteger((int)nFaction);
     Internal.NativeFunctions.StackPushStringUTF8(sTag);
     Internal.NativeFunctions.StackPushFloat(fSize);
     Internal.NativeFunctions.StackPushGameDefinedStructure((int)EngineStructure.Location, lLocation);
     Internal.NativeFunctions.StackPushInteger((int)nTrapType);
     Internal.NativeFunctions.CallBuiltIn(809);
     return(Internal.NativeFunctions.StackPopObject());
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates the specified trap.
 /// </summary>
 /// <param name="trap">The base type of trap.</param>
 /// <param name="size">The size of the trap. Minimum size allowed is 1.0f. If no value set, defaults to 2.0f.</param>
 /// <param name="tag">The tag of the trap being created. If no value set, defaults to an empty string.</param>
 /// <param name="disarm">The script that will fire when the trap is disarmed. If no value set, defaults to an empty string and no script will fire.</param>
 /// <param name="triggered">The script that will fire when the trap is triggered. If no value set, defaults to an empty string and the default OnTrapTriggered script for the trap type specified will fire instead (as specified in the traps.2da).</param>
 public void CreateTrap(TrapBaseType trap, float size = 2.0f, string tag = "", string disarm = "", string triggered = "")
 {
     NWScript.CreateTrapAtLocation((int)trap, this, size, tag, sOnDisarmScript: disarm, sOnTrapTriggeredScript: triggered);
 }