コード例 #1
0
 // Deletes the player character from the servervault
 // The PC will be immediately booted from the game with a "Delete Character" message
 public static void DeletePlayerCharacter(uint pc, bool bPreserveBackup = true, string kickMessage = "")
 {
     // NativeFunction calls don't work for this method and cause a crash. Use the core methods instead.
     NWNXCore.NWNX_PushArgumentString(PLUGIN_NAME, "DeletePlayerCharacter", kickMessage);
     NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, "DeletePlayerCharacter", bPreserveBackup ? 1 : 0);
     NWNXCore.NWNX_PushArgumentObject(PLUGIN_NAME, "DeletePlayerCharacter", pc);
     NWNXCore.NWNX_CallFunction(PLUGIN_NAME, "DeletePlayerCharacter");
 }
コード例 #2
0
        // Convert unpacked itemproperty structure to native type.
        public static ItemProperty PackIP(ItemPropertyUnpacked itemProperty)
        {
            const string sFunc = "PackIP";

            NWNXCore.NWNX_PushArgumentString(PLUGIN_NAME, sFunc, itemProperty.Tag);
            NWNXCore.NWNX_PushArgumentObject(PLUGIN_NAME, sFunc, itemProperty.Creator);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.SpellID);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.IsUseable ? 1 : 0);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.ChanceToAppear);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.UsesPerDay);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.Param1Value);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.Param1);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.CostTableValue);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.CostTable);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.SubType);
            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, itemProperty.Property);

            NWNXCore.NWNX_CallFunction(PLUGIN_NAME, sFunc);
            return(NWNXCore.NWNX_GetReturnValueItemProperty(PLUGIN_NAME, sFunc));
        }
コード例 #3
0
ファイル: NWNXItemProperty.cs プロジェクト: zunath/SWLOR_NWN
        /// @brief Gets the active item property at the index
        /// @param oItem - the item with the property
        /// @param nIndex - the index such as returned by some Item Events
        /// @return A constructed NWNX_IPUnpacked, except for creator, and spell id.
        public static ItemPropertyUnpacked GetActiveProperty(uint oItem, int nIndex)
        {
            const string sFunc = "GetActiveProperty";

            NWNXCore.NWNX_PushArgumentInt(PLUGIN_NAME, sFunc, nIndex);
            NWNXCore.NWNX_PushArgumentObject(PLUGIN_NAME, sFunc, oItem);
            NWNXCore.NWNX_CallFunction(PLUGIN_NAME, sFunc);

            return(new ItemPropertyUnpacked
            {
                Property = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                SubType = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                CostTable = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                CostTableValue = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                Param1 = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                Param1Value = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                UsesPerDay = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                ChanceToAppear = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc),
                IsUseable = Convert.ToBoolean(NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, sFunc)),
                Tag = NWNXCore.NWNX_GetReturnValueString(PLUGIN_NAME, sFunc)
            });
        }