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 Attack Event Data (to use only on Attack Event Script)
        /// </summary>
        /// <returns></returns>
        public static AttackEventData GetAttackEventData()
        {
            string          sFunc = "GetAttackEventData";
            AttackEventData data  = new AttackEventData();

            NWNXCore.NWNX_CallFunction(NWNX_Damage, sFunc);

            data.Target       = NWNXCore.NWNX_GetReturnValueObject(NWNX_Damage, sFunc);
            data.Bludgeoning  = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Pierce       = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Slash        = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Magical      = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Acid         = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Cold         = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Divine       = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Electrical   = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Fire         = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Negative     = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Positive     = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Sonic        = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Base         = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.AttackNumber = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.AttackResult = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.AttackType   = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.SneakAttack  = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);

            return(data);
        }
Esempio n. 3
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. 4
0
        /// <summary>
        /// Gets the number of players in area
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static int GetNumberOfPlayersInArea(NWGameObject area)
        {
            string sFunc = "GetNumberOfPlayersInArea";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);

            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Area, sFunc));
        }
Esempio n. 5
0
        /// <summary>
        /// Returns true if resting is not allowed in area
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static bool GetNoRestingAllowed(NWGameObject area)
        {
            string sFunc = "GetNoRestingAllowed";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);

            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Area, sFunc) == 1);
        }
Esempio n. 6
0
        /// <summary>
        /// Get the spot modifier of area
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static int GetAreaSpotModifier(NWGameObject area)
        {
            string sFunc = "GetAreaSpotModifier";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);

            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Area, sFunc));
        }
Esempio n. 7
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. 8
0
        // Get oItem's additional value in gold pieces.
        public static int GetAddGoldPieceValue(NWGameObject oItem)
        {
            string sFunc = "GetAddGoldPieceValue";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);

            NWNXCore.NWNX_CallFunction(NWNX_Item, sFunc);
            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Item, sFunc));
        }
Esempio n. 9
0
        /// <summary>
        /// Get the PVP setting of area
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static AreaPVPSetting GetPVPSetting(NWGameObject area)
        {
            string sFunc = "GetPVPSetting";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);

            return((AreaPVPSetting)NWNXCore.NWNX_GetReturnValueInt(NWNX_Area, sFunc));
        }
Esempio n. 10
0
        public static int GetBaseArmorClass(NWGameObject oItem)
        {
            string sFunc = "GetBaseArmorClass";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Item, sFunc, oItem);

            NWNXCore.NWNX_CallFunction(NWNX_Item, sFunc);
            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Item, sFunc));
        }
Esempio n. 11
0
        /// <summary>
        /// Get the day/night cycle of area
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static AreaDayNightCycle GetDayNightCycle(NWGameObject area)
        {
            string sFunc = "GetDayNightCycle";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);

            return((AreaDayNightCycle)NWNXCore.NWNX_GetReturnValueInt(NWNX_Area, sFunc));
        }
Esempio n. 12
0
        /// <summary>
        /// Get the shadow opacity of area
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static int GetShadowOpacity(NWGameObject area)
        {
            string sFunc = "GetShadowOpacity";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);

            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Area, sFunc));
        }
Esempio n. 13
0
        /// <summary>
        /// Gets whether a quest has been completed by a player
        /// Returns -1 if they don't have the journal entry
        /// </summary>
        /// <param name="player">The player object</param>
        /// <param name="sQuestName">The name of the quest</param>
        /// <returns></returns>
        public static int GetQuestCompleted(NWGameObject player, string sQuestName)
        {
            string sFunc = "GetQuestCompleted";

            NWNXCore.NWNX_PushArgumentString(NWNX_Player, sFunc, sQuestName);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Player, sFunc, player);

            NWNXCore.NWNX_CallFunction(NWNX_Player, sFunc);
            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Player, sFunc));
        }
Esempio n. 14
0
        /// <summary>
        /// Queries the existing visibility override for given (player, target) pair
        /// If player is OBJECT_INVALID, the global visibility override will be returned
        ///
        /// Player == VALID -> returns:
        ///   NWNX_VISIBILITY_DEFAULT = Player override not set
        ///   NWNX_VISIBILITY_VISIBLE = Target is always visible for player
        ///   NWNX_VISIBILITY_HIDDEN  = Target is always hidden for player
        ///
        /// Player == OBJECT_INVALID -> returns:
        ///   NWNX_VISIBILITY_DEFAULT = Global override not set
        ///   NWNX_VISIBILITY_VISIBLE = Target is globally visible
        ///   NWNX_VISIBILITY_HIDDEN  = Target is globally hidden
        /// NWNX_VISIBILITY_DM_ONLY = Target is only visible to DMs
        /// </summary>
        /// <param name="player"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public static VisibilityType GetVisibilityOverride(NWGameObject player, NWGameObject target)
        {
            string sFunc = "GetVisibilityOverride";

            NWNXCore.NWNX_PushArgumentObject(NWNX_Visibility, sFunc, target);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Visibility, sFunc, player);
            NWNXCore.NWNX_CallFunction(NWNX_Visibility, sFunc);

            return((VisibilityType)NWNXCore.NWNX_GetReturnValueInt(NWNX_Visibility, sFunc));
        }
Esempio n. 15
0
        /// <summary>
        /// Get the weather chance of type in area
        /// </summary>
        /// <param name="area"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static int GetWeatherChance(NWGameObject area, AreaWeatherChance type)
        {
            string sFunc = "GetWeatherChance";

            NWNXCore.NWNX_PushArgumentInt(NWNX_Area, sFunc, (int)type);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Area, sFunc, area);
            NWNXCore.NWNX_CallFunction(NWNX_Area, sFunc);

            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Area, sFunc));
        }
Esempio n. 16
0
        /// <summary>
        /// Convert native effect type to unpacked structure
        /// </summary>
        /// <param name="effect"></param>
        /// <returns></returns>
        public static EffectUnpacked UnpackEffect(Effect effect)
        {
            string sFunc = "UnpackEffect";

            NWNXCore.NWNX_PushArgumentEffect(NWNX_Effect, sFunc, effect);
            NWNXCore.NWNX_CallFunction(NWNX_Effect, sFunc);

            EffectUnpacked n = new EffectUnpacked
            {
                Tag               = NWNXCore.NWNX_GetReturnValueString(NWNX_Effect, sFunc),
                oParam3           = NWNXCore.NWNX_GetReturnValueObject(NWNX_Effect, sFunc),
                oParam2           = NWNXCore.NWNX_GetReturnValueObject(NWNX_Effect, sFunc),
                oParam1           = NWNXCore.NWNX_GetReturnValueObject(NWNX_Effect, sFunc),
                oParam0           = NWNXCore.NWNX_GetReturnValueObject(NWNX_Effect, sFunc),
                sParam5           = NWNXCore.NWNX_GetReturnValueString(NWNX_Effect, sFunc),
                sParam4           = NWNXCore.NWNX_GetReturnValueString(NWNX_Effect, sFunc),
                sParam3           = NWNXCore.NWNX_GetReturnValueString(NWNX_Effect, sFunc),
                sParam2           = NWNXCore.NWNX_GetReturnValueString(NWNX_Effect, sFunc),
                sParam1           = NWNXCore.NWNX_GetReturnValueString(NWNX_Effect, sFunc),
                sParam0           = NWNXCore.NWNX_GetReturnValueString(NWNX_Effect, sFunc),
                fParam3           = NWNXCore.NWNX_GetReturnValueFloat(NWNX_Effect, sFunc),
                fParam2           = NWNXCore.NWNX_GetReturnValueFloat(NWNX_Effect, sFunc),
                fParam1           = NWNXCore.NWNX_GetReturnValueFloat(NWNX_Effect, sFunc),
                fParam0           = NWNXCore.NWNX_GetReturnValueFloat(NWNX_Effect, sFunc),
                nParam7           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                nParam6           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                nParam5           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                nParam4           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                nParam3           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                nParam2           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                nParam1           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                nParam0           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                NumIntegers       = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                LinkRightValid    = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                LinkRight         = NWNXCore.NWNX_GetReturnValueEffect(NWNX_Effect, sFunc),
                LinkLeftValid     = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                LinkLeft          = NWNXCore.NWNX_GetReturnValueEffect(NWNX_Effect, sFunc),
                CasterLevel       = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                ShowIcon          = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                Expose            = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                SpellID           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                Creator           = NWNXCore.NWNX_GetReturnValueObject(NWNX_Effect, sFunc),
                ExpiryTimeOfDay   = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                ExpiryCalendarDay = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                Duration          = NWNXCore.NWNX_GetReturnValueFloat(NWNX_Effect, sFunc),
                SubType           = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                Type              = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc),
                EffectID          = NWNXCore.NWNX_GetReturnValueInt(NWNX_Effect, sFunc)
            };

            return(n);
        }
Esempio n. 17
0
        public static DevastatingCriticalData GetDevastatingCriticalEventData()
        {
            string sFunc = "GetEventData";
            DevastatingCriticalData data = new DevastatingCriticalData();

            NWNXCore.NWNX_PushArgumentInt(NWNX_Weapon, sFunc, NWNX_WEAPON_GETDATA_DC);
            NWNXCore.NWNX_CallFunction(NWNX_Weapon, sFunc);

            data.Weapon = NWNXCore.NWNX_GetReturnValueObject(NWNX_Weapon, sFunc);
            data.Target = NWNXCore.NWNX_GetReturnValueObject(NWNX_Weapon, sFunc);
            data.Damage = NWNXCore.NWNX_GetReturnValueInt(NWNX_Weapon, sFunc);

            return(data);
        }
Esempio n. 18
0
        /// <summary>
        /// Gets if combatlog message nMessage is hidden.
        /// Notes:
        /// If oPC == OBJECT_INVALID it will return the global state:
        ///    TRUE      nMessage is globally hidden
        ///    FALSE     nMessage is not globally hidden
        /// If oPC is a valid player it will return the personal state:
        ///    TRUE      nMessage is hidden for oPC
        ///    FALSE     nMessage is not hidden for oPC
        ///    -1        Personal state is not set
        /// </summary>
        /// <param name="nMessage">The combat message type. Refer to CombatLogMessageType for IDs.</param>
        /// <param name="oPC">The player to adjust.</param>
        /// <returns></returns>
        public static int GetCombatLogMessageHidden(int nMessage, NWGameObject oPC = null)
        {
            if (oPC == null)
            {
                oPC = new NWGameObject();
            }

            string sFunc        = "GetMessageHidden";
            int    nMessageType = 1;

            NWNXCore.NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessage);
            NWNXCore.NWNX_PushArgumentInt(NWNX_Feedback, sFunc, nMessageType);
            NWNXCore.NWNX_PushArgumentObject(NWNX_Feedback, sFunc, oPC);
            NWNXCore.NWNX_CallFunction(NWNX_Feedback, sFunc);

            return(NWNXCore.NWNX_GetReturnValueInt(NWNX_Feedback, sFunc));
        }
Esempio n. 19
0
        /// <summary>
        /// Get Damage Event Data (to use only on Damage Event Script)
        /// </summary>
        /// <returns></returns>
        public static DamageEventData GetDamageEventData()
        {
            string          sFunc = "GetDamageEventData";
            DamageEventData data  = new DamageEventData();

            NWNXCore.NWNX_CallFunction(NWNX_Damage, sFunc);

            data.Damager     = NWNXCore.NWNX_GetReturnValueObject(NWNX_Damage, sFunc);
            data.Bludgeoning = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Pierce      = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Slash       = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Magical     = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Acid        = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Cold        = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Divine      = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Electrical  = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Fire        = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Negative    = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Positive    = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Sonic       = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);
            data.Base        = NWNXCore.NWNX_GetReturnValueInt(NWNX_Damage, sFunc);

            return(data);
        }
Esempio n. 20
0
 // Gets the channel. Channel is a NWNX_* constant.
 // Must be called from an chat or system script handler.
 public static NWNXChatChannel GetChannel()
 {
     NWNXCore.NWNX_CallFunction("NWNX_Chat", "GET_CHANNEL");
     return((NWNXChatChannel)NWNXCore.NWNX_GetReturnValueInt("NWNX_Chat", "GET_CHANNEL"));
 }