Esempio n. 1
0
        /// <summary>
        /// Gets the player's quickbar slot info
        /// </summary>
        /// <param name="player"></param>
        /// <param name="slot"></param>
        /// <returns></returns>
        public static QuickBarSlot GetQuickBarSlot(NWGameObject player, int slot)
        {
            string       sFunc = "GetQuickBarSlot";
            QuickBarSlot qbs   = new QuickBarSlot();

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, slot);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);
            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);

            qbs.Associate     = (NWNXCore.NWNX_GetReturnValueObject(NWNX_Player, sFunc));
            qbs.AssociateType = NWNXCore.NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.DomainLevel   = NWNXCore.NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.MetaType      = NWNXCore.NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.INTParam1     = NWNXCore.NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.ToolTip       = NWNXCore.NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.CommandLine   = NWNXCore.NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.CommandLabel  = NWNXCore.NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.Resref        = NWNXCore.NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.MultiClass    = NWNXCore.NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.ObjectType    = (QuickBarSlotType)NWNXCore.NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.SecondaryItem = (NWNXCore.NWNX_GetReturnValueObject(NWNX_Player, sFunc));
            qbs.Item          = (NWNXCore.NWNX_GetReturnValueObject(NWNX_Player, sFunc));

            return(qbs);
        }
Esempio n. 2
0
        /// <summary>
        /// Get an AdministrationOption value
        /// </summary>
        /// <param name="option"></param>
        /// <returns></returns>
        public static int GetPlayOption(AdministrationOption option)
        {
            NWNXCore.NWNX_PushArgumentInt("NWNX_Administration", "GET_PLAY_OPTION", (int)option);
            NWNXCore.NWNX_CallFunction("NWNX_Administration", "GET_PLAY_OPTION");

            return(NWNXCore.NWNX_GetReturnValueInt("NWNX_Administration", "GET_PLAY_OPTION"));
        }
Esempio n. 3
0
        /// <summary>
        /// Set the wind power in area
        /// windPower = 0-2
        /// </summary>
        /// <param name="area"></param>
        /// <param name="windPower"></param>
        public static void SetWindPower(NWGameObject area, int windPower)
        {
            string sFunc = "SetWindPower";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, windPower);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 4
0
        /// <summary>
        /// Set the PVP setting of area
        /// </summary>
        /// <param name="area"></param>
        /// <param name="pvpSetting"></param>
        public static void SetPVPSetting(NWGameObject area, AreaPVPSetting pvpSetting)
        {
            string sFunc = "SetPVPSetting";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, (int)pvpSetting);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 5
0
        /// <summary>
        /// Set the day/night cycle of area
        /// </summary>
        /// <param name="area"></param>
        /// <param name="type"></param>
        public static void SetDayNightCycle(NWGameObject area, AreaDayNightCycle type)
        {
            string sFunc = "SetDayNightCycle";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, (int)type);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 6
0
        /// <summary>
        /// Set whether resting is allowed in area
        /// true: Resting not allowed
        /// false: Resting allowed
        /// </summary>
        /// <param name="area"></param>
        /// <param name="bNoRestingAllowed"></param>
        public static void SetNoRestingAllowed(NWGameObject area, bool bNoRestingAllowed)
        {
            string sFunc = "SetNoRestingAllowed";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, bNoRestingAllowed ? 1 : 0);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 7
0
        /// <summary>
        /// Set the shadow opacity of area
        /// shadowOpacity = 0-100
        /// </summary>
        /// <param name="area"></param>
        /// <param name="shadowOpacity"></param>
        public static void SetShadowOpacity(NWGameObject area, int shadowOpacity)
        {
            string sFunc = "SetShadowOpacity";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, shadowOpacity);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 8
0
        public static void SetWeaponIsMonkWeapon(int nBaseItem)
        {
            string sFunc = "SetWeaponIsMonkWeapon";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);

            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);
        }
Esempio n. 9
0
        /// <summary>
        /// Set the listen modifer of area
        /// </summary>
        /// <param name="area"></param>
        /// <param name="listenModifier"></param>
        public static void SetAreaListenModifier(NWGameObject area, int listenModifier)
        {
            string sFunc = "SetAreaListenModifier";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, listenModifier);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 10
0
        /// <summary>
        ///
        /// Overrides the default visibility rules about how player perceives the target object
        /// If player is OBJECT_INVALID, the global visibility override will be set
        ///
        /// Player == VALID -> override:
        ///   NWNX_VISIBILITY_DEFAULT = Remove the player override
        ///   NWNX_VISIBILITY_VISIBLE = Target is always visible for player
        ///   NWNX_VISIBILITY_HIDDEN  = Target is always hidden for player
        ///
        /// Player == OBJECT_INVALID -> override:
        ///   NWNX_VISIBILITY_DEFAULT = Remove the global override
        ///   NWNX_VISIBILITY_VISIBLE = Target is globally visible
        ///   NWNX_VISIBILITY_HIDDEN  = Target is globally hidden
        ///   NWNX_VISIBILITY_DM_ONLY = Target is only visible to DMs
        ///
        /// Note:
        /// Player state overrides the global state which means if a global state is set
        /// to NWNX_VISIBILITY_HIDDEN or NWNX_VISIBILITY_DM_ONLY but the player's state is
        /// set to NWNX_VISIBILITY_VISIBLE for the target, the object will be visible to the player
        /// </summary>
        /// <param name="player"></param>
        /// <param name="target"></param>
        /// <param name="override"></param>
        public static void SetVisibilityOverride(NWGameObject player, NWGameObject target, VisibilityType @override)
        {
            string sFunc = "SetVisibilityOverride";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Visibility, sFunc, (int)@override);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Visibility, sFunc, target);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Visibility, sFunc, player);
            NWNXCore.NWNX_CallFunction(NWNX_Visibility, sFunc);
        }
Esempio n. 11
0
        public static void SetOption(int nOption, int nVal)
        {
            string sFunc = "SetOption";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nVal);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nOption);

            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);
        }
Esempio n. 12
0
        public static void SetWeaponFinesseSize(int nBaseItem, int nSize)
        {
            string sFunc = "SetWeaponFinesseSize";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nSize);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);

            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);
        }
Esempio n. 13
0
        /// <summary>
        /// Starts the background music for the given player only
        /// </summary>
        /// <param name="player"></param>
        public static void MusicBackgroundStart(NWGameObject player)
        {
            string sFunc = "PlayBackgroundMusic";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, 1); // bool play = TRUE
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
        }
Esempio n. 14
0
        /// <summary>
        /// Set whether to use a blacklist or whitelist mode for combatlog messages
        /// Default: Blacklist
        ///
        /// TRUE = Whitelist, all messages hidden by default
        /// FALSE = Blacklist, all messages shown by default
        ///
        /// NOTE: If using Whitelist, be sure to whitelist NWNX_FEEDBACK_COMBATLOG_FEEDBACK for feedback messages to work
        /// </summary>
        /// <param name="whitelist">true if all messages are hidden by default. false if all messages are shown by default.</param>
        public static void SetCombatLogMessageMode(bool whitelist)
        {
            string sFunc        = "SetFeedbackMode";
            int    nMessageType = 1;

            NWNXCore.NWNX_PushArgumentInt(NWNX_Feedback, sFunc, whitelist ? 1 : 0);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
            NWNXCore.NWNX_CallFunction(NWNX_Feedback, sFunc);
        }
Esempio n. 15
0
        public static void SetGreaterWeaponSpecializationFeat(int nBaseItem, int nFeat)
        {
            string sFunc = "SetGreaterWeaponSpecializationFeat";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);

            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);
        }
Esempio n. 16
0
        public static void SetWeaponImprovedCriticalFeat(int nBaseItem, int nFeat)
        {
            string sFunc = "SetWeaponImprovedCriticalFeat";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);

            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);
        }
Esempio n. 17
0
        /// <summary>
        /// Sets whether the player should always walk when given movement commands.
        /// If true, clicking on the ground or using WASD will trigger walking instead of running.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="bWalk"></param>
        public static void SetAlwaysWalk(NWGameObject player, int bWalk)
        {
            string sFunc = "SetAlwaysWalk";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, bWalk);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
        }
Esempio n. 18
0
        /// <summary>
        /// Stops the background music for the given player only
        /// </summary>
        /// <param name="player"></param>
        public static void MusicBattleStop(NWGameObject player)
        {
            string sFunc = "PlayBattleMusic";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, 0); // bool play = FALSE
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
        }
Esempio n. 19
0
        public static void BypassDevastatingCritical()
        {
            string sFunc = "SetEventData";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, 1);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, NWNX_WEAPON_SETDATA_DC_BYPASS);

            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);
        }
Esempio n. 20
0
        /// <summary>
        /// Override oPlayer's rest animation to nAnimation
        ///
        /// NOTE: nAnimation does not take ANIMATION_LOOPING_* or ANIMATION_FIREFORGET_* constants
        ///       Use NWNX_Consts_TranslateNWScriptAnimation() in nwnx_consts.nss to get their NWNX equivalent
        ///       -1 to clear the override
        /// </summary>
        /// <param name="oPlayer">The player object</param>
        /// <param name="nAnimation">The rest animation</param>
        public static void SetRestAnimation(NWGameObject oPlayer, int nAnimation)
        {
            string sFunc = "SetRestAnimation";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, nAnimation);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, oPlayer);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
        }
Esempio n. 21
0
        /// <summary>
        /// Changes the battle music track for the given player only
        /// </summary>
        /// <param name="player"></param>
        /// <param name="track"></param>
        public static void MusicBattleChange(NWGameObject player, int track)
        {
            string sFunc = "ChangeBattleMusic";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, track);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
        }
Esempio n. 22
0
        public static void SetEpicWeaponFocusFeat(int nBaseItem, int nFeat)
        {
            string sFunc = "SetEpicWeaponFocusFeat";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nFeat);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, nBaseItem);

            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);
        }
Esempio n. 23
0
        /// <summary>
        /// Override player's rest duration
        /// Duration is in milliseconds, 1000 = 1 second
        /// Minimum duration of 10ms
        /// -1 clears the override
        /// </summary>
        /// <param name="player"></param>
        /// <param name="duration"></param>
        public static void SetRestDuration(NWGameObject player, int duration)
        {
            string sFunc = "SetRestDuration";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, duration);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
        }
Esempio n. 24
0
        /// <summary>
        /// Set the weather chance of type in area
        /// </summary>
        /// <param name="area"></param>
        /// <param name="type"></param>
        /// <param name="chance"></param>
        public static void SetWeatherChance(NWGameObject area, AreaWeatherChance type, int chance)
        {
            string sFunc = "SetWeatherChance";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, chance);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, (int)type);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 25
0
 // Sends a chat message. Channel is a NWNX_* constant.
 // If no target is provided, then it broadcasts to all eligible targets.
 // Returns TRUE if successful, FALSE otherwise.
 public static int SendMessage(int channel, string message, NWGameObject sender, NWGameObject target)
 {
     NWNXCore.NWNX_PushArgumentObject("NWNX_Chat", "SEND_MESSAGE", target);
     NWNXCore.NWNX_PushArgumentObject("NWNX_Chat", "SEND_MESSAGE", sender);
     NWNXCore.NWNX_PushArgumentString("NWNX_Chat", "SEND_MESSAGE", message);
     NWNXCore.NWNX_PushArgumentInt("NWNX_Chat", "SEND_MESSAGE", channel);
     NWNXCore.NWNX_CallFunction("NWNX_Chat", "SEND_MESSAGE");
     return(NWNXCore.NWNX_GetReturnValueInt("NWNX_Chat", "SEND_MESSAGE"));
 }
Esempio n. 26
0
        /// <summary>
        /// Set the Sun/Moon Ambient/Diffuse colors of area
        /// type = NWNX_AREA_COLOR_TYPE_*
        /// color = FOG_COLOR_*
        ///
        /// The color can also be represented as a hex RGB number if specific color shades are desired.
        /// The format of a hex specified color would be 0xFFEEDD where
        /// FF would represent the amount of red in the color
        /// EE would represent the amount of green in the color
        /// DD would represent the amount of blue in the color.
        /// </summary>
        /// <param name="area"></param>
        /// <param name="type"></param>
        /// <param name="color"></param>
        public static void SetSunMoonColors(NWGameObject area, AreaColorType type, int color)
        {
            string sFunc = "SetSunMoonColors";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, color);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, (int)type);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);
        }
Esempio n. 27
0
        // Set oItem's weight. Will not persist through saving.
        public static void SetWeight(NWGameObject oItem, int w)
        {
            string sFunc = "SetWeight";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Item, sFunc, w);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);

            NWNXCore.NWNX_CallFunction(NWNX_Item, sFunc);
        }
Esempio n. 28
0
        // Set oItem's additional value in gold pieces (Total cost = base_value +
        // additional_value). Will persist through saving.
        public static void SetAddGoldPieceValue(NWGameObject oItem, int g)
        {
            string sFunc = "SetAddGoldPieceValue";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Item, sFunc, g);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);

            NWNXCore.NWNX_CallFunction(NWNX_Item, sFunc);
        }
Esempio n. 29
0
        // Set oItem's base item type. This will not be visible until the
        // item is refreshed (e.g. drop and take the item, or logging out
        // and back in).
        public static void SetBaseItemType(NWGameObject oItem, int nBaseItem)
        {
            string sFunc = "SetBaseItemType";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Item, sFunc, nBaseItem);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);

            NWNXCore.NWNX_CallFunction(NWNX_Item, sFunc);
        }
Esempio n. 30
0
        /// <summary>
        /// Apply a looping visualeffect to target that only player can see
        /// visualeffect: VFX_DUR_*, call again to remove an applied effect
        ///               -1 to remove all effects
        ///
        /// Note: Only really works with looping effects: VFX_DUR_*
        ///       Other types *kind* of work, they'll play when reentering the area and the object is in view
        ///       or when they come back in view range.
        /// </summary>
        /// <param name="player">The player object</param>
        /// <param name="target">The target to apply the visual effect to</param>
        /// <param name="visualeffect">The visual effect to use</param>
        public static void ApplyLoopingVisualEffectToObject(NWGameObject player, NWGameObject target, int visualeffect)
        {
            string sFunc = "ApplyLoopingVisualEffectToObject";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Player, sFunc, visualeffect);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, target);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
        }