Exemplo n.º 1
0
 // Sets the memorized spell of the provided creature for the provided class, level, and index.
 // Index bounds: 0 <= index < GetMemorizedSpellCountByLevel(creature, class, level).
 public static void SetMemorizedSpell(uint creature, ClassType classId, int level, int index,
                                      MemorizedSpellSlot spell)
 {
     Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "SetMemorisedSpell");
     Internal.NativeFunctions.nwnxPushInt(spell.ID);
     Internal.NativeFunctions.nwnxPushInt(spell.Ready);
     Internal.NativeFunctions.nwnxPushInt(spell.Meta);
     Internal.NativeFunctions.nwnxPushInt(spell.Domain);
     Internal.NativeFunctions.nwnxPushInt(index);
     Internal.NativeFunctions.nwnxPushInt(level);
     Internal.NativeFunctions.nwnxPushInt((int)classId);
     Internal.NativeFunctions.nwnxPushObject(creature);
     Internal.NativeFunctions.nwnxCallFunction();
 }
Exemplo n.º 2
0
        // Gets the memorized spell of the provided creature for the provided class, level, and index.
        // Index bounds: 0 <= index < GetMemorizedSpellCountByLevel(creature, class, level).
        public static MemorizedSpellSlot GetMemorizedSpell(uint creature, ClassType classId, int level, int index)
        {
            Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "GetMemorisedSpell");
            var spell = new MemorizedSpellSlot();

            Internal.NativeFunctions.nwnxPushInt(index);
            Internal.NativeFunctions.nwnxPushInt(level);
            Internal.NativeFunctions.nwnxPushInt((int)classId);
            Internal.NativeFunctions.nwnxPushObject(creature);
            Internal.NativeFunctions.nwnxCallFunction();
            spell.Domain = Internal.NativeFunctions.nwnxPopInt();
            spell.Meta   = Internal.NativeFunctions.nwnxPopInt();
            spell.Ready  = Internal.NativeFunctions.nwnxPopInt();
            spell.ID     = Internal.NativeFunctions.nwnxPopInt();
            return(spell);
        }
Exemplo n.º 3
0
        // Gets the memorized spell of the provided creature for the provided class, level, and index.
        // Index bounds: 0 <= index < GetMemorizedSpellCountByLevel(creature, class, level).
        public MemorizedSpellSlot GetMemorizedSpell(NWCreature creature, int classId, int level, int index)
        {
            string             sFunc = "GetMemorisedSpell";
            MemorizedSpellSlot spell = new MemorizedSpellSlot();

            NWNX_PushArgumentInt(NWNX_Creature, sFunc, index);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, level);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, classId);
            NWNX_PushArgumentObject(NWNX_Creature, sFunc, creature.Object);

            NWNX_CallFunction(NWNX_Creature, sFunc);

            spell.Domain = NWNX_GetReturnValueInt(NWNX_Creature, sFunc);
            spell.Meta   = NWNX_GetReturnValueInt(NWNX_Creature, sFunc);
            spell.Ready  = NWNX_GetReturnValueInt(NWNX_Creature, sFunc);
            spell.ID     = NWNX_GetReturnValueInt(NWNX_Creature, sFunc);
            return(spell);
        }
Exemplo n.º 4
0
        // Sets the memorized spell of the provided creature for the provided class, level, and index.
        // Index bounds: 0 <= index < GetMemorizedSpellCountByLevel(creature, class, level).
        public void SetMemorizedSpell(NWCreature creature, int classId, int level, int index, MemorizedSpellSlot spell)
        {
            string sFunc = "SetMemorisedSpell";

            NWNX_PushArgumentInt(NWNX_Creature, sFunc, spell.ID);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, spell.Ready);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, spell.Meta);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, spell.Domain);

            NWNX_PushArgumentInt(NWNX_Creature, sFunc, index);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, level);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, classId);
            NWNX_PushArgumentObject(NWNX_Creature, sFunc, creature.Object);

            NWNX_CallFunction(NWNX_Creature, sFunc);
        }