예제 #1
0
bool REFRRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    Data.Load();
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 3: //flags2
            SetHeaderUnknownFlagMask(*(UINT32 *)FieldValue);
            break;
        case 4: //eid
            Data->EDID.Copy((STRING)FieldValue);
            break;
        case 5: //base
            Data->NAME.value = *(FORMID *)FieldValue;
            return true;
        case 6: //destination
            Data->XTEL.Load();
            Data->XTEL->destinationFid = *(FORMID *)FieldValue;
            return true;
        case 7: //destinationPosX
            Data->XTEL.Load();
            Data->XTEL->destination.posX = *(FLOAT32 *)FieldValue;
            break;
        case 8: //destinationPosY
            Data->XTEL.Load();
            Data->XTEL->destination.posY = *(FLOAT32 *)FieldValue;
            break;
        case 9: //destinationPosZ
            Data->XTEL.Load();
            Data->XTEL->destination.posZ = *(FLOAT32 *)FieldValue;
            break;
        case 10: //destinationRotX
            Data->XTEL.Load();
            Data->XTEL->destination.rotX = *(FLOAT32 *)FieldValue;
            break;
        case 11: //destinationRotY
            Data->XTEL.Load();
            Data->XTEL->destination.rotY = *(FLOAT32 *)FieldValue;
            break;
        case 12: //destinationRotZ
            Data->XTEL.Load();
            Data->XTEL->destination.rotZ = *(FLOAT32 *)FieldValue;
            break;
        case 13: //lockLevel
            Data->XLOC.Load();
            Data->XLOC->level = *(UINT8 *)FieldValue;
            break;
        case 14: //unused1
            if(ArraySize != 3)
                break;
            Data->XLOC.Load();
            Data->XLOC->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            Data->XLOC->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            Data->XLOC->unused1[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 15: //lockKey
            Data->XLOC.Load();
            Data->XLOC->key = *(FORMID *)FieldValue;
            return true;
        case 16: //unused2
            if(ArraySize != 4)
                break;
            Data->XLOC.Load();
            Data->XLOC->unused2[0] = ((UINT8ARRAY)FieldValue)[0];
            Data->XLOC->unused2[1] = ((UINT8ARRAY)FieldValue)[1];
            Data->XLOC->unused2[2] = ((UINT8ARRAY)FieldValue)[2];
            Data->XLOC->unused2[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 17: //lockFlags
            SetLockFlagMask(*(UINT8 *)FieldValue);
            break;
        case 18: //unused3
            if(ArraySize != 3)
                break;
            Data->XLOC.Load();
            Data->XLOC->unused3[0] = ((UINT8ARRAY)FieldValue)[0];
            Data->XLOC->unused3[1] = ((UINT8ARRAY)FieldValue)[1];
            Data->XLOC->unused3[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 19: //owner
            Data->Ownership.Load();
            Data->Ownership->XOWN.value = *(FORMID *)FieldValue;
            return true;
        case 20: //rank
            Data->Ownership.Load();
            Data->Ownership->XRNK.Load();
            *Data->Ownership->XRNK.value = *(SINT32 *)FieldValue;
            break;
        case 21: //globalVariable
            Data->Ownership.Load();
            Data->Ownership->XGLB.value = *(FORMID *)FieldValue;
            return true;
        case 22: //parent
            Data->XESP.Load();
            Data->XESP->parent = *(FORMID *)FieldValue;
            return true;
        case 23: //parentFlags
            SetParentFlagMask(*(UINT8 *)FieldValue);
            break;
        case 24: //unused4
            if(ArraySize != 3)
                break;
            Data->XESP.Load();
            Data->XESP->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            Data->XESP->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            Data->XESP->unused1[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 25: //target
            Data->XTRG.value = *(FORMID *)FieldValue;
            return true;
        case 26: //seed
            Data->XSED.Load();
            //Borrowing ArraySize to flag if the new value is an offset
            if(ArraySize)
                {
                Data->XSED->isOffset = true;
                Data->XSED->offset = *(UINT8 *)FieldValue;
                }
            else
                {
                Data->XSED->isOffset = false;
                Data->XSED->seed = *(UINT32 *)FieldValue;
                }
            break;
        case 27: //lod1
            Data->XLOD.Load();
            Data->XLOD->lod1 = *(FLOAT32 *)FieldValue;
            break;
        case 28: //lod2
            Data->XLOD.Load();
            Data->XLOD->lod2 = *(FLOAT32 *)FieldValue;
            break;
        case 29: //lod3
            Data->XLOD.Load();
            Data->XLOD->lod3 = *(FLOAT32 *)FieldValue;
            break;
        case 30: //charge
            Data->XCHG.value = *(FLOAT32 *)FieldValue;
            break;
        case 31: //health
            Data->XHLT.value = *(SINT32 *)FieldValue;
            break;
        case 32: //unknownXPCIFormID
            Data->XPCI.Load();
            Data->XPCI->XPCI.value = *(FORMID *)FieldValue;
            return true;
        case 33: //unknownXPCIString
            Data->XPCI.Load();
            Data->XPCI->FULL.Copy((STRING)FieldValue);
            break;
        case 34: //levelMod
            Data->XLCM.value = *(SINT32 *)FieldValue;
            break;
        case 35: //unknownXRTMFormID
            Data->XRTM.value = *(FORMID *)FieldValue;
            return true;
        case 36: //actionFlags
            SetActionFlagMask(*(UINT32 *)FieldValue);
            break;
        case 37: //count
            Data->XCNT.value = *(SINT32 *)FieldValue;
            break;
        case 38: //markerFlags
            SetMapFlagMask(*(UINT8 *)FieldValue);
            break;
        case 39: //markerName
            Data->Marker.Load();
            Data->Marker->FULL.Copy((STRING)FieldValue);
            break;
        case 40: //markerType
            SetMarkerType(*(UINT8 *)FieldValue);
            break;
        case 41: //markerUnused
            if(ArraySize != 1)
                break;
            Data->Marker.Load();
            Data->Marker->TNAM.value.unused1 = ((UINT8ARRAY)FieldValue)[0];
            break;
        case 42: //scale
            Data->XSCL.Load();
            Data->XSCL.value = *(FLOAT32 *)FieldValue;
            break;
        case 43: //soulType
            SetSoul(*(UINT8 *)FieldValue);
            break;
        case 44: //posX
            Data->DATA.value.posX = *(FLOAT32 *)FieldValue;
            break;
        case 45: //posY
            Data->DATA.value.posY = *(FLOAT32 *)FieldValue;
            break;
        case 46: //posZ
            Data->DATA.value.posZ = *(FLOAT32 *)FieldValue;
            break;
        case 47: //rotX
            Data->DATA.value.rotX = *(FLOAT32 *)FieldValue;
            break;
        case 48: //rotY
            Data->DATA.value.rotY = *(FLOAT32 *)FieldValue;
            break;
        case 49: //rotZ
            Data->DATA.value.rotZ = *(FLOAT32 *)FieldValue;
            break;
        default:
            break;
        }
    return false;
    }
예제 #2
0
void MGEFRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    MGEFDATA defaultDATA;
    MGEFOBME defaultOBME;

    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //flags2
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //full
            FULL.Unload();
            return;
        case 6: //text
            DESC.Unload();
            return;
        case 7: //iconPath
            ICON.Unload();
            return;
        case 8: //modPath
            if(MODL.IsLoaded())
                MODL->MODL.Unload();
            return;
        case 9: //modb
            if(MODL.IsLoaded())
                MODL->MODB.Unload();
            return;
        case 10: //modt_p
            if(MODL.IsLoaded())
                MODL->MODT.Unload();
            return;
        case 11: //flags
            DATA.value.flags = defaultDATA.flags;
            return;
        case 12: //baseCost
            DATA.value.baseCost = defaultDATA.baseCost;
            return;
        case 13: //associated
            DATA.value.associated = defaultDATA.associated;
            return;
        case 14: //school
            DATA.value.schoolType = defaultDATA.schoolType;
            return;
        case 15: //resistValue
            DATA.value.resistValue = defaultDATA.resistValue;
            return;
        case 16: //numCounters
            DATA.value.numCounters = defaultDATA.numCounters;
            ESCE.resize(defaultDATA.numCounters);
            return;
        case 17: //unused1
            DATA.value.unused1[0] = defaultDATA.unused1[0];
            DATA.value.unused1[1] = defaultDATA.unused1[1];
            return;
        case 18: //light
            DATA.value.light = defaultDATA.light;
            return;
        case 19: //projectileSpeed
            DATA.value.projectileSpeed = defaultDATA.projectileSpeed;
            return;
        case 20: //effectShader
            DATA.value.effectShader = defaultDATA.effectShader;
            return;
        case 21: //enchantEffect
            DATA.value.enchantEffect = defaultDATA.enchantEffect;
            return;
        case 22: //castingSound
            DATA.value.castingSound = defaultDATA.castingSound;
            return;
        case 23: //boltSound
            DATA.value.boltSound = defaultDATA.boltSound;
            return;
        case 24: //hitSound
            DATA.value.hitSound = defaultDATA.hitSound;
            return;
        case 25: //areaSound
            DATA.value.areaSound = defaultDATA.areaSound;
            return;
        case 26: //cefEnchantment
            DATA.value.cefEnchantment = defaultDATA.cefEnchantment;
            return;
        case 27: //cefBarter
            DATA.value.cefBarter = defaultDATA.cefBarter;
            return;
        case 28: //counterEffects
            DATA.value.numCounters = 0;
            ESCE.Unload();
            return;
        //OBME Fields
        case 29: //recordVersion
            if(OBME.IsLoaded())
                OBME->OBME.value.recordVersion = defaultOBME.recordVersion;
            return;
        case 30: //betaVersion
            if(OBME.IsLoaded())
                OBME->OBME.value.betaVersion = defaultOBME.betaVersion;
            return;
        case 31: //minorVersion
            if(OBME.IsLoaded())
                OBME->OBME.value.minorVersion = defaultOBME.minorVersion;
            return;
        case 32: //majorVersion
            if(OBME.IsLoaded())
                OBME->OBME.value.majorVersion = defaultOBME.majorVersion;
            return;
        case 33: //mgefParamAInfo
            if(OBME.IsLoaded())
                OBME->OBME.value.mgefParamAInfo = defaultOBME.mgefParamAInfo;
            return;
        case 34: //mgefParamBInfo
            if(OBME.IsLoaded())
                OBME->OBME.value.mgefParamBInfo = defaultOBME.mgefParamBInfo;
            return;
        case 35: //reserved1
            if(OBME.IsLoaded())
                {
                OBME->OBME.value.reserved1[0] = defaultOBME.reserved1[0];
                OBME->OBME.value.reserved1[1] = defaultOBME.reserved1[1];
                }
            return;
        case 36: //handlerCode
            if(OBME.IsLoaded())
                OBME->OBME.value.handlerCode = defaultOBME.handlerCode;
            return;
        case 37: //OBMEFlags
            if(OBME.IsLoaded())
                OBME->OBME.value.flags = defaultOBME.flags;
            return;
        case 38: //mgefParamB
            if(OBME.IsLoaded())
                OBME->OBME.value.mgefParamB = defaultOBME.mgefParamB;
            return;
        case 39: //reserved2
            if(OBME.IsLoaded())
                memcpy(&OBME->OBME.value.reserved2[0], &defaultOBME.reserved2[0], sizeof(OBME->OBME.value.reserved2));
            return;
        case 40: //mgefCode
            if(OBME.IsLoaded())
                OBME->EDDX.Unload();
            return;
        case 41: //datx_p
            if(OBME.IsLoaded())
                OBME->DATX.Unload();
            return;
        default:
            return;
        }
    return;
    }
예제 #3
0
void PCBERecord::DeleteField(FIELD_IDENTIFIERS)
    {
    FNVSCHR defaultSCHR;

    GENVARS defaultVARS;
    GENSCR_ defaultSCR_;
    GENCLR defaultCLR;
    GENXDCR defaultXDCR;
    GENXAPR defaultXAPR;
    GENXESP defaultXESP;
    GENPOSDATA defaultDATA;
    GENXPWR defaultXPWR;
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //base
            NAME.Unload();
            return;
        case 8: //encounterZone
            XEZN.Unload();
            return;
        case 9: //xrgd_p
            XRGD.Unload();
            return;
        case 10: //xrgb_p
            XRGB.Unload();
            return;
        case 11: //idleTime
            if(Patrol.IsLoaded())
                Patrol->XPRD.Unload();
            return;
        case 12: //idle
            if(Patrol.IsLoaded())
                Patrol->INAM.Unload();
            return;
        case 13: //unused1
            if(Patrol.IsLoaded())
                {
                Patrol->SCHR.value.unused1[0] = defaultSCHR.unused1[0];
                Patrol->SCHR.value.unused1[1] = defaultSCHR.unused1[1];
                Patrol->SCHR.value.unused1[2] = defaultSCHR.unused1[2];
                Patrol->SCHR.value.unused1[3] = defaultSCHR.unused1[3];
                }
            return;
        case 14: //numRefs
            if(Patrol.IsLoaded())
                Patrol->SCHR.value.numRefs = defaultSCHR.numRefs;
            return;
        case 15: //compiledSize
            if(Patrol.IsLoaded())
                Patrol->SCHR.value.compiledSize = defaultSCHR.compiledSize;
            return;
        case 16: //lastIndex
            if(Patrol.IsLoaded())
                Patrol->SCHR.value.lastIndex = defaultSCHR.lastIndex;
            return;
        case 17: //scriptType
            if(Patrol.IsLoaded())
                Patrol->SetType(defaultSCHR.scriptType);
            return;
        case 18: //scriptFlags
            if(Patrol.IsLoaded())
                Patrol->SetScriptFlagMask(defaultSCHR.flags);
            return;
        case 19: //compiled_p
            if(Patrol.IsLoaded())
                Patrol->SCDA.Unload();
            return;
        case 20: //scriptText
            if(Patrol.IsLoaded())
                Patrol->SCTX.Unload();
            return;
        case 21: //vars
            if(!Patrol.IsLoaded())
                return;

            if(ListFieldID == 0) //varsSize
                {
                Patrol->VARS.Unload();
                return;
                }

            if(ListIndex >= Patrol->VARS.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //index
                    Patrol->VARS.value[ListIndex]->SLSD.value.index = defaultVARS.SLSD.value.index;
                    return;
                case 2: //unused1
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[0] = defaultVARS.SLSD.value.unused1[0];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[1] = defaultVARS.SLSD.value.unused1[1];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[2] = defaultVARS.SLSD.value.unused1[2];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[3] = defaultVARS.SLSD.value.unused1[3];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[4] = defaultVARS.SLSD.value.unused1[4];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[5] = defaultVARS.SLSD.value.unused1[5];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[6] = defaultVARS.SLSD.value.unused1[6];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[7] = defaultVARS.SLSD.value.unused1[7];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[8] = defaultVARS.SLSD.value.unused1[8];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[9] = defaultVARS.SLSD.value.unused1[9];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[10] = defaultVARS.SLSD.value.unused1[10];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[11] = defaultVARS.SLSD.value.unused1[11];
                    return;
                case 3: //flags
                    Patrol->VARS.value[ListIndex]->SetFlagMask(defaultVARS.SLSD.value.flags);
                    return;
                case 4: //unused2
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[0] = defaultVARS.SLSD.value.unused2[0];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[1] = defaultVARS.SLSD.value.unused2[1];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[2] = defaultVARS.SLSD.value.unused2[2];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[3] = defaultVARS.SLSD.value.unused2[3];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[4] = defaultVARS.SLSD.value.unused2[4];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[5] = defaultVARS.SLSD.value.unused2[5];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[6] = defaultVARS.SLSD.value.unused2[6];
                    return;
                case 5: //name
                    Patrol->VARS.value[ListIndex]->SCVR.Unload();
                    return;
                default:
                    return;
                }
            return;
        case 22: //references
            if(!Patrol.IsLoaded())
                return;

            if(ListFieldID == 0) //referencesSize
                {
                Patrol->SCR_.Unload();
                return;
                }

            if(ListIndex >= Patrol->SCR_.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //reference
                    Patrol->SCR_.value[ListIndex]->reference = defaultSCR_.reference;
                    Patrol->SCR_.value[ListIndex]->isSCRO = defaultSCR_.isSCRO;
                    return;
                default:
                    return;
                }
            return;
        case 23: //topic
            if(Patrol.IsLoaded())
                Patrol->TNAM.Unload();
            return;
        case 24: //owner
            if(Ownership.IsLoaded())
                Ownership->XOWN.Unload();
            return;
        case 25: //rank
            if(Ownership.IsLoaded())
                Ownership->XRNK.Unload();
            return;
        case 26: //count
            XCNT.Unload();
            return;
        case 27: //radius
            XRDS.Unload();
            return;
        case 28: //health
            XHLP.Unload();
            return;
        case 29: //decals
            if(ListFieldID == 0) //decalsSize
                {
                XDCR.Unload();
                return;
                }

            if(ListIndex >= XDCR.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //reference
                    XDCR.value[ListIndex]->reference = defaultXDCR.reference;
                    return;
                case 2: //unknown1
                    XDCR.value[ListIndex]->unknown1[0] = defaultXDCR.unknown1[0];
                    XDCR.value[ListIndex]->unknown1[1] = defaultXDCR.unknown1[1];
                    XDCR.value[ListIndex]->unknown1[2] = defaultXDCR.unknown1[2];
                    XDCR.value[ListIndex]->unknown1[3] = defaultXDCR.unknown1[3];
                    XDCR.value[ListIndex]->unknown1[4] = defaultXDCR.unknown1[4];
                    XDCR.value[ListIndex]->unknown1[5] = defaultXDCR.unknown1[5];
                    XDCR.value[ListIndex]->unknown1[6] = defaultXDCR.unknown1[6];
                    XDCR.value[ListIndex]->unknown1[7] = defaultXDCR.unknown1[7];
                    XDCR.value[ListIndex]->unknown1[8] = defaultXDCR.unknown1[8];
                    XDCR.value[ListIndex]->unknown1[9] = defaultXDCR.unknown1[9];
                    XDCR.value[ListIndex]->unknown1[10] = defaultXDCR.unknown1[10];
                    XDCR.value[ListIndex]->unknown1[11] = defaultXDCR.unknown1[11];
                    XDCR.value[ListIndex]->unknown1[12] = defaultXDCR.unknown1[12];
                    XDCR.value[ListIndex]->unknown1[13] = defaultXDCR.unknown1[13];
                    XDCR.value[ListIndex]->unknown1[14] = defaultXDCR.unknown1[14];
                    XDCR.value[ListIndex]->unknown1[15] = defaultXDCR.unknown1[15];
                    XDCR.value[ListIndex]->unknown1[16] = defaultXDCR.unknown1[16];
                    XDCR.value[ListIndex]->unknown1[17] = defaultXDCR.unknown1[17];
                    XDCR.value[ListIndex]->unknown1[18] = defaultXDCR.unknown1[18];
                    XDCR.value[ListIndex]->unknown1[19] = defaultXDCR.unknown1[19];
                    XDCR.value[ListIndex]->unknown1[20] = defaultXDCR.unknown1[20];
                    XDCR.value[ListIndex]->unknown1[21] = defaultXDCR.unknown1[21];
                    XDCR.value[ListIndex]->unknown1[22] = defaultXDCR.unknown1[22];
                    XDCR.value[ListIndex]->unknown1[23] = defaultXDCR.unknown1[23];
                    return;
                default:
                    return;
                }
            return;
        case 30: //linkedReference
            XLKR.Unload();
            return;
        case 31: //startRed
            if(XCLP.IsLoaded())
                XCLP->start.red = defaultCLR.red;
            return;
        case 32: //startGreen
            if(XCLP.IsLoaded())
                XCLP->start.green = defaultCLR.green;
            return;
        case 33: //startBlue
            if(XCLP.IsLoaded())
                XCLP->start.blue = defaultCLR.blue;
            return;
        case 34: //unused2
            if(XCLP.IsLoaded())
                XCLP->start.unused1 = defaultCLR.unused1;
            return;
        case 35: //endRed
            if(XCLP.IsLoaded())
                XCLP->end.red = defaultCLR.red;
            return;
        case 36: //endGreen
            if(XCLP.IsLoaded())
                XCLP->end.green = defaultCLR.green;
            return;
        case 37: //endBlue
            if(XCLP.IsLoaded())
                XCLP->end.blue = defaultCLR.blue;
            return;
        case 38: //unused3
            if(XCLP.IsLoaded())
                XCLP->end.unused1 = defaultCLR.unused1;
            return;
        case 39: //activateParentFlags
            if(ActivateParents.IsLoaded())
                ActivateParents->XAPD.Unload();
            return;
        case 40: //activateParentRefs
            if(!ActivateParents.IsLoaded())
                return;

            if(ListFieldID == 0) //activateParentRefsSize
                {
                ActivateParents->XAPR.Unload();
                return;
                }

            if(ListIndex >= ActivateParents->XAPR.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //reference
                    ActivateParents->XAPR.value[ListIndex]->reference = defaultXAPR.reference;
                    return;
                case 2: //delay
                    ActivateParents->XAPR.value[ListIndex]->delay = defaultXAPR.delay;
                    return;
                default:
                    return;
                }
            return;
        case 41: //prompt
            XATO.Unload();
            return;
        case 42: //parent
            if(XESP.IsLoaded())
                XESP->parent = defaultXESP.parent;
            return;
        case 43: //parentFlags
            if(XESP.IsLoaded())
                SetFlagMask(defaultXESP.flags);
            return;
        case 44: //unused4
            if(XESP.IsLoaded())
                {
                XESP->unused1[0] = defaultXESP.unused1[0];
                XESP->unused1[1] = defaultXESP.unused1[1];
                XESP->unused1[2] = defaultXESP.unused1[2];
                }
            return;
        case 45: //emittance
            XEMI.Unload();
            return;
        case 46: //boundRef
            XMBR.Unload();
            return;
        case 47: //reflrefrs
            if(ListFieldID == 0) //reflrefrsSize
                {
                XPWR.Unload();
                return;
                }

            if(ListIndex >= XPWR.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //reference
                    XPWR.value[ListIndex]->reference = defaultXPWR.reference;
                    return;
                case 2: //type
                    XPWR.value[ListIndex]->type = defaultXPWR.type;
                    return;
                default:
                    return;
                }
            return;
        case 48: //ignoredBySandbox
            XIBS.Unload();
            return;
        case 49: //scale
            XSCL.Unload();
            return;
        case 50: //posX
            DATA.value.posX = defaultDATA.posX;
            return;
        case 51: //posY
            DATA.value.posY = defaultDATA.posY;
            return;
        case 52: //posZ
            DATA.value.posZ = defaultDATA.posZ;
            return;
        case 53: //rotX
            DATA.value.rotX = defaultDATA.rotX;
            return;
        case 54: //rotY
            DATA.value.rotY = defaultDATA.rotY;
            return;
        case 55: //rotZ
            DATA.value.rotZ = defaultDATA.rotZ;
            return;
        default:
            return;
        }
    }
예제 #4
0
void ENCHRecord::DeleteField(FIELD_IDENTIFIERS)
{
    ENCHENIT defaultENIT;
    FNVCTDA defaultCTDA;
    FNVEffect defaultEffect;
    switch(FieldID)
    {
    case 1: //flags1
        SetHeaderFlagMask(0);
        return;
    case 3: //versionControl1
        flagsUnk = 0;
        return;
    case 4: //eid
        EDID.Unload();
        return;
    case 5: //formVersion
        formVersion = 0;
        return;
    case 6: //versionControl2
        versionControl2[0] = 0;
        versionControl2[1] = 0;
        return;
    case 7: //full
        FULL.Unload();
        return;
    case 8: //itemType
        SetType(defaultENIT.itemType);
        return;
    case 9: //chargeAmountUnused
        ENIT.value.chargeAmount = defaultENIT.chargeAmount;
        return;
    case 10: //enchantCostUnused
        ENIT.value.enchantCost = defaultENIT.enchantCost;
        return;
    case 11: //flags
        SetFlagMask(defaultENIT.flags);
        return;
    case 12: //unused1
        ENIT.value.unused1[0] = defaultENIT.unused1[0];
        ENIT.value.unused1[1] = defaultENIT.unused1[1];
        ENIT.value.unused1[2] = defaultENIT.unused1[2];
        return;
    case 13: //effects
        if(ListFieldID == 0) //effectsSize
        {
            Effects.Unload();
            return;
        }

        if(ListIndex >= Effects.value.size())
            return;

        switch(ListFieldID)
        {
        case 1: //effect
            Effects.value[ListIndex]->EFID.value = defaultEffect.EFID.value;
            return;
        case 2: //magnitude
            Effects.value[ListIndex]->EFIT.value.magnitude = defaultEffect.EFIT.value.magnitude;
            return;
        case 3: //area
            Effects.value[ListIndex]->EFIT.value.area = defaultEffect.EFIT.value.area;
            return;
        case 4: //duration
            Effects.value[ListIndex]->EFIT.value.duration = defaultEffect.EFIT.value.duration;
            return;
        case 5: //rangeType
            Effects.value[ListIndex]->SetRange(defaultEffect.EFIT.value.rangeType);
            return;
        case 6: //actorValue
            Effects.value[ListIndex]->EFIT.value.actorValue = defaultEffect.EFIT.value.actorValue;
            return;
        case 7: //conditions
            if(ListX2FieldID == 0) //conditionsSize
            {
                Effects.value[ListIndex]->CTDA.Unload();
                return;
            }

            if(ListX2Index >= Effects.value[ListIndex]->CTDA.value.size())
                return;

            switch(ListX2FieldID)
            {
            case 1: //operType
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->operType = defaultCTDA.operType;
                return;
            case 2: //unused1
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[0] = defaultCTDA.unused1[0];
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[1] = defaultCTDA.unused1[1];
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[2] = defaultCTDA.unused1[2];
                return;
            case 3: //compValue
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->compValue = defaultCTDA.compValue;
                return;
            case 4: //ifunc
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->ifunc = defaultCTDA.ifunc;
                return;
            case 5: //param1
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->param1 = defaultCTDA.param1;
                return;
            case 6: //param2
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->param2 = defaultCTDA.param2;
                return;
            case 7: //runOnType
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->runOnType = defaultCTDA.runOnType;
                return;
            case 8: //reference
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->reference = defaultCTDA.reference;
                return;
            default:
                return;
            }
            return;
        default:
            return;
        }
        return;
    default:
        return;
    }
}
예제 #5
0
void CHIPRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //boundX
            if (OBND.IsLoaded())
                OBND->x1 = 0; // defaultOBND.x;
            return;
        case 8: //boundY
            if (OBND.IsLoaded())
                OBND->y1 = 0; // defaultOBND.y;
            return;
        case 9: //boundZ
            if (OBND.IsLoaded())
                OBND->z1 = 0; // defaultOBND.z;
            return;
        case 10: //full
            FULL.Unload();
            return;
        case 11: //modPath
            if(MODL.IsLoaded())
                MODL->MODL.Unload();
            return;
        case 12: //modb
            if(MODL.IsLoaded())
                MODL->MODB.Unload();
            return;
        case 13: //modt_p
            if(MODL.IsLoaded())
                MODL->MODT.Unload();
            return;
        case 14: //mods Alternate Textures
            if(MODL.IsLoaded())
                MODL->Textures.Unload();
            return;
        case 15: //mods Alternate Textures
            if(MODL.IsLoaded())
                MODL->Textures.Unload();
            return;
        case 16: //mods Alternate Textures
            if(MODL.IsLoaded())
                MODL->Textures.Unload();
            return;
        case 17: //modelFlags
            if(MODL.IsLoaded())
                MODL->MODD.Unload();
            return;
        case 18: //iconPath
            ICON.Unload();
            return;
        case 19: //smallIconPath
            MICO.Unload();
            return;
        case 20: //dest Header
            if(Destructable.IsLoaded())
                Destructable->DEST.Unload();
            return;
        case 21: //dest Header
            if(Destructable.IsLoaded())
                Destructable->DEST.Unload();
            return;
        case 22: //dest Header
            if(Destructable.IsLoaded())
                Destructable->DEST.Unload();
            return;
        case 23: //dest_p Header
            if(Destructable.IsLoaded())
                Destructable->DEST.Unload();
            return;
        case 24: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 25: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 26: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 27: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 28: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 29: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 30: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 31: //dstd Destruction Stage Data
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DSTD.Unload();
            return;
        case 32: //dmdl Model Filename
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DMDL.Unload();
            return;
        case 33: //dmdt_p Texture Files Hashes
            if(Destructable.IsLoaded())
                Destructable->Stages.value[0]->DMDT.Unload();
            return;
        case 34: //ynam Sound - Pick Up
            YNAM.Unload();
            return;
        case 35: //znam Sound - Drop
            ZNAM.Unload();
            return;
        default:
            return;
        }
    }
예제 #6
0
void FACTRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    FNVXNAM defaultXNAM;
    FACTDATA defaultDATA;
    FACTRNAM defaultRNAM;

    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //full
            FULL.Unload();
            return;
        case 8: //relations
            if(ListFieldID == 0) //relations
                {
                XNAM.Unload();
                return;
                }

            if(ListIndex >= XNAM.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //faction
                    XNAM.value[ListIndex]->faction = defaultXNAM.faction;
                    return;
                case 2: //mod
                    XNAM.value[ListIndex]->mod = defaultXNAM.mod;
                    return;
                case 3: //groupReactionType
                    XNAM.value[ListIndex]->groupReactionType = defaultXNAM.groupReactionType;
                    return;
                default:
                    return;
                }
            return;
        case 9: //flags
            DATA.value.flags = defaultDATA.flags;
            return;
        case 10: //unused1
            DATA.value.unused1[0] = defaultDATA.unused1[0];
            DATA.value.unused1[1] = defaultDATA.unused1[1];
            return;
        case 11: //crimeGoldMultiplier
            CNAM.Unload();
            return;
        case 12: //ranks
            if(ListFieldID == 0) //ranks
                {
                RNAM.Unload();
                return;
                }

            if(ListIndex >= RNAM.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //rank
                    RNAM.value[ListIndex]->RNAM.value = defaultRNAM.RNAM.value;
                    return;
                case 2: //male
                    RNAM.value[ListIndex]->MNAM.Unload();
                    return;
                case 3: //female
                    RNAM.value[ListIndex]->FNAM.Unload();
                    return;
                case 4: //insigniaPath
                    RNAM.value[ListIndex]->INAM.Unload();
                    return;
                default:
                    return;
                }
            return;
        case 13: //reputation
            WMI1.Unload();
            return;
        default:
            return;
        }
    }
예제 #7
0
void MESGRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //description
            DESC.Unload();
            return;
        case 8: //full
            FULL.Unload();
            return;
        case 9: //inam Icon
            INAM.Unload();
            return;
        case 10: //dnam Flags
            DNAM.Unload();
            return;
        case 11: //tnam Display Time
            TNAM.Unload();
            return;
        case 12: //itxt Button Text
            //ITXT.Unload();
            return;
        case 13: //ctda Conditions
            //CTDAs.Unload();
            return;
        case 14: //ctda_p Conditions
            //CTDAs.Unload();
            return;
        case 15: //ctda Conditions
            //return UNPARSEDDEL_FIELD15;
        case 16: //ctda Conditions
            //CTDAs.Unload();
            return;
        case 17: //ctda_p Conditions
            //CTDAs.Unload();
            return;
        case 18: //ctda_p Conditions
            //CTDAs.Unload();
            return;
        case 19: //ctda Conditions
            //CTDAs.Unload();
            return;
        case 20: //ctda Conditions
            //return UNPARSEDDEL_FIELD20;
        default:
            return;
        }
    }
예제 #8
0
bool PERKRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, uint32_t ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(uint32_t *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((char *)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(uint16_t *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //full
            FULL.Copy((char *)FieldValue);
            break;
        case 8: //description
            DESC.Copy((char *)FieldValue);
            break;
        case 9: //iconPath
            ICON.Copy((char *)FieldValue);
            break;
        case 10: //smallIconPath
            MICO.Copy((char *)FieldValue);
            break;
        case 11: //ctda Conditions
            //CTDA.Load();
            //CTDA->value11 = *(uint8_t *)FieldValue;
            break;
        case 12: //ctda_p Conditions
            if(ArraySize != 3)
                break;
            //CTDA.Load();
            //CTDA->value12[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDA->value12[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDA->value12[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 13: //ctda Conditions
            //return UNPARSEDGET_FIELD13;
        case 14: //ctda Conditions
            //CTDA.Load();
            //CTDA->value14 = *(uint32_t *)FieldValue;
            break;
        case 15: //ctda_p Conditions
            if(ArraySize != 4)
                break;
            //CTDA.Load();
            //CTDA->value15[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDA->value15[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDA->value15[2] = ((UINT8ARRAY)FieldValue)[2];
            //CTDA->value15[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 16: //ctda_p Conditions
            if(ArraySize != 4)
                break;
            //CTDA.Load();
            //CTDA->value16[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDA->value16[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDA->value16[2] = ((UINT8ARRAY)FieldValue)[2];
            //CTDA->value16[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 17: //ctda Conditions
            //CTDA.Load();
            //CTDA->value17 = *(uint32_t *)FieldValue;
            break;
        case 18: //ctda Conditions
            //return UNPARSEDGET_FIELD18;
            break;
        case 19: //data DATA ,, Struct
            DATA.Load();
            DATA->trait = *(uint8_t *)FieldValue;
            break;
        case 20: //data DATA ,, Struct
            DATA.Load();
            DATA->minLevel = *(uint8_t *)FieldValue;
            break;
        case 21: //data DATA ,, Struct
            DATA.Load();
            DATA->ranks = *(uint8_t *)FieldValue;
            break;
        case 22: //data DATA ,, Struct
            DATA.Load();
            DATA->playable = *(uint8_t *)FieldValue;
            break;
        case 23: //data DATA ,, Struct
            DATA.Load();
            DATA->hidden = *(uint8_t *)FieldValue;
            break;
        case 24: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value24 = *(uint8_t *)FieldValue;
            break;
        case 25: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value25 = *(uint8_t *)FieldValue;
            break;
        case 26: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value26 = *(uint8_t *)FieldValue;
            break;
        case 27: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value27 = *(FORMID *)FieldValue;
            return true;
        case 28: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value28 = *(FORMID *)FieldValue;
            return true;
        case 29: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value29 = *(uint8_t *)FieldValue;
            break;
        case 30: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value30 = *(uint8_t *)FieldValue;
            break;
        case 31: //prke PRKE ,, Struct
            //PRKE.Load();
            //PRKE->value31 = *(uint8_t *)FieldValue;
            break;
        case 32: //prkc Run On
            //PRKC.Load();
            //PRKC->value32 = *(int8_t *)FieldValue;
            break;
        case 33: //ctda Conditions
            //CTDA.Load();
            //CTDAsReq->value33 = *(uint8_t *)FieldValue;
            break;
        case 34: //ctda_p Conditions
            if(ArraySize != 3)
                break;
            //CTDA.Load();
            //CTDAsReq->value34[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDAsReq->value34[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDAsReq->value34[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 35: //ctda Conditions
            //return UNPARSEDGET_FIELD35;
        case 36: //ctda Conditions
            //CTDA.Load();
            //CTDAsReq->value36 = *(uint32_t *)FieldValue;
            break;
        case 37: //ctda_p Conditions
            if(ArraySize != 4)
                break;
            //CTDA.Load();
            //CTDAsReq->value37[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDAsReq->value37[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDAsReq->value37[2] = ((UINT8ARRAY)FieldValue)[2];
            //CTDAsReq->value37[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 38: //ctda_p Conditions
            if(ArraySize != 4)
                break;
            //CTDA.Load();
            //CTDAsReq->value38[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDAsReq->value38[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDAsReq->value38[2] = ((UINT8ARRAY)FieldValue)[2];
            //CTDAsReq->value38[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 39: //ctda Conditions
            //CTDA.Load();
            //CTDAsReq->value39 = *(uint32_t *)FieldValue;
            break;
        case 40: //ctda Conditions
            //return UNPARSEDGET_FIELD40;
        case 41: //epft Type
            //EPFT.Load();
            //EPFT->EPFT.Load();
            //EPFT->EPFT->value41 = *(uint8_t *)FieldValue;
            break;
        case 42: //data Leveled Item
            //EPFT.Load();
            //EPFT->DATA.Load();
            //EPFT->DATA->value42 = *(FORMID *)FieldValue;
            return true;
        case 43: //epf2 Button Label
            //EPF2.Copy((char *)FieldValue);
            break;
        case 44: //epf3 Script Flags
            //EPF3.Load();
            //EPF3->value44 = *(uint16_t *)FieldValue;
            break;
        case 45: //schr_p Basic Script Data
            if(ArraySize != 4)
                break;
            //SCHR.Load();
            //SCHR->SCHR.Load();
            //SCHR->SCHR->value45[0] = ((UINT8ARRAY)FieldValue)[0];
            //SCHR->SCHR->value45[1] = ((UINT8ARRAY)FieldValue)[1];
            //SCHR->SCHR->value45[2] = ((UINT8ARRAY)FieldValue)[2];
            //SCHR->SCHR->value45[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 46: //schr Basic Script Data
            //SCHR.Load();
            //SCHR->SCHR.Load();
            //SCHR->SCHR->value46 = *(uint32_t *)FieldValue;
            break;
        case 47: //schr Basic Script Data
            //SCHR.Load();
            //SCHR->SCHR.Load();
            //SCHR->SCHR->value47 = *(uint32_t *)FieldValue;
            break;
        case 48: //schr Basic Script Data
            //SCHR.Load();
            //SCHR->SCHR.Load();
            //SCHR->SCHR->value48 = *(uint32_t *)FieldValue;
            break;
        case 49: //schr Basic Script Data
            //SCHR.Load();
            //SCHR->SCHR.Load();
            //SCHR->SCHR->value49 = *(uint16_t *)FieldValue;
            break;
        case 50: //schr Basic Script Data
            //SCHR.Load();
            //SCHR->SCHR.Load();
            //SCHR->SCHR->value50 = *(uint16_t *)FieldValue;
            break;
        case 51: //scda_p Compiled Embedded Script
            //SCHR.Load();
            //SCHR->SCDA.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 52: //sctx Embedded Script Source
            //SCHR.Load();
            //SCHR->SCTX.Copy((char *)FieldValue);
            break;
        case 53: //slsd Local Variable Data
            //SCHR.Load();
            //SCHR->SLSD.Load();
            //SCHR->SLSD->value53 = *(uint32_t *)FieldValue;
            break;
        case 54: //slsd_p Local Variable Data
            if(ArraySize != 12)
                break;
            //SCHR.Load();
            //SCHR->SLSD.Load();
            //SCHR->SLSD->value54[0] = ((UINT8ARRAY)FieldValue)[0];
            //SCHR->SLSD->value54[1] = ((UINT8ARRAY)FieldValue)[1];
            //SCHR->SLSD->value54[2] = ((UINT8ARRAY)FieldValue)[2];
            //SCHR->SLSD->value54[3] = ((UINT8ARRAY)FieldValue)[3];
            //SCHR->SLSD->value54[4] = ((UINT8ARRAY)FieldValue)[4];
            //SCHR->SLSD->value54[5] = ((UINT8ARRAY)FieldValue)[5];
            //SCHR->SLSD->value54[6] = ((UINT8ARRAY)FieldValue)[6];
            //SCHR->SLSD->value54[7] = ((UINT8ARRAY)FieldValue)[7];
            //SCHR->SLSD->value54[8] = ((UINT8ARRAY)FieldValue)[8];
            //SCHR->SLSD->value54[9] = ((UINT8ARRAY)FieldValue)[9];
            //SCHR->SLSD->value54[10] = ((UINT8ARRAY)FieldValue)[10];
            //SCHR->SLSD->value54[11] = ((UINT8ARRAY)FieldValue)[11];
            break;
        case 55: //slsd Local Variable Data
            //SCHR.Load();
            //SCHR->SLSD.Load();
            //SCHR->SLSD->value55 = *(uint8_t *)FieldValue;
            break;
        case 56: //slsd_p Local Variable Data
            if(ArraySize != 7)
                break;
            //SCHR.Load();
            //SCHR->SLSD.Load();
            //SCHR->SLSD->value56[0] = ((UINT8ARRAY)FieldValue)[0];
            //SCHR->SLSD->value56[1] = ((UINT8ARRAY)FieldValue)[1];
            //SCHR->SLSD->value56[2] = ((UINT8ARRAY)FieldValue)[2];
            //SCHR->SLSD->value56[3] = ((UINT8ARRAY)FieldValue)[3];
            //SCHR->SLSD->value56[4] = ((UINT8ARRAY)FieldValue)[4];
            //SCHR->SLSD->value56[5] = ((UINT8ARRAY)FieldValue)[5];
            //SCHR->SLSD->value56[6] = ((UINT8ARRAY)FieldValue)[6];
            break;
        case 57: //scvr Name
            //SCHR.Load();
            //SCHR->SCVR.Copy((char *)FieldValue);
            break;
        case 58: //scro Global Reference
            //SCHR.Load();
            //SCHR->SCRO.Load();
            //SCHR->SCRO->value58 = *(FORMID *)FieldValue;
            return true;
        case 59: //scrv Local Variable
            //SCHR.Load();
            //SCHR->SCRV.Load();
            //SCHR->SCRV->value59 = *(uint32_t *)FieldValue;
            break;
        default:
            break;
        }
    return false;
    }
예제 #9
0
void PERKRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //full
            FULL.Unload();
            return;
        case 8: //description
            DESC.Unload();
            return;
        case 9: //iconPath
            ICON.Unload();
            return;
        case 10: //smallIconPath
            MICO.Unload();
            return;
        case 11: //ctda Conditions
            CTDA.Unload();
            return;
        case 12: //ctda_p Conditions
            CTDA.Unload();
            return;
        case 13: //ctda Conditions
            return; // UNPARSEDDEL_FIELD13;
        case 14: //ctda Conditions
            CTDA.Unload();
            return;
        case 15: //ctda_p Conditions
            CTDA.Unload();
            return;
        case 16: //ctda_p Conditions
            CTDA.Unload();
            return;
        case 17: //ctda Conditions
            CTDA.Unload();
            return;
        case 18: //ctda Conditions
            return; // UNPARSEDDEL_FIELD18;
        case 19: //data DATA ,, Struct
            DATA.Unload();
            return;
        case 20: //data DATA ,, Struct
            DATA.Unload();
            return;
        case 21: //data DATA ,, Struct
            DATA.Unload();
            return;
        case 22: //data DATA ,, Struct
            DATA.Unload();
            return;
        case 23: //data DATA ,, Struct
            DATA.Unload();
            return;
        case 24: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 25: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 26: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 27: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 28: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 29: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 30: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 31: //prke PRKE ,, Struct
            PRKE.Unload();
            return;
        case 32: //prkc Run On
            //PRKC.Unload();
            return;
        case 33: //ctda Conditions
            CTDA.Unload();
            return;
        case 34: //ctda_p Conditions
            CTDA.Unload();
            return;
        case 35: //ctda Conditions
            return; // UNPARSEDDEL_FIELD35;
        case 36: //ctda Conditions
            CTDA.Unload();
            return;
        case 37: //ctda_p Conditions
            CTDA.Unload();
            return;
        case 38: //ctda_p Conditions
            CTDA.Unload();
            return;
        case 39: //ctda Conditions
            CTDA.Unload();
            return;
        case 40: //ctda Conditions
            return; // UNPARSEDDEL_FIELD40;
        case 41: //epft Type
            //if(EPFT.IsLoaded())
            //    EPFT->EPFT.Unload();
            return;
        case 42: //data Leveled Item
            //if(EPFT.IsLoaded())
            //    EPFT->DATA.Unload();
            return;
        case 43: //epf2 Button Label
            //EPF2.Unload();
            return;
        case 44: //epf3 Script Flags
            //EPF3.Unload();
            return;
        case 45: //schr_p Basic Script Data
            //if(SCHR.IsLoaded())
            //    SCHR->SCHR.Unload();
            return;
        case 46: //schr Basic Script Data
            //if(SCHR.IsLoaded())
            //    SCHR->SCHR.Unload();
            return;
        case 47: //schr Basic Script Data
            //if(SCHR.IsLoaded())
            //    SCHR->SCHR.Unload();
            return;
        case 48: //schr Basic Script Data
            //if(SCHR.IsLoaded())
            //    SCHR->SCHR.Unload();
            return;
        case 49: //schr Basic Script Data
            //if(SCHR.IsLoaded())
            //    SCHR->SCHR.Unload();
            return;
        case 50: //schr Basic Script Data
            //if(SCHR.IsLoaded())
            //    SCHR->SCHR.Unload();
            return;
        case 51: //scda_p Compiled Embedded Script
            //if(SCHR.IsLoaded())
            //    SCHR->SCDA.Unload();
            return;
        case 52: //sctx Embedded Script Source
            //if(SCHR.IsLoaded())
            //    SCHR->SCTX.Unload();
            return;
        case 53: //slsd Local Variable Data
            //if(SCHR.IsLoaded())
            //    SCHR->SLSD.Unload();
            return;
        case 54: //slsd_p Local Variable Data
            //if(SCHR.IsLoaded())
            //    SCHR->SLSD.Unload();
            return;
        case 55: //slsd Local Variable Data
            //if(SCHR.IsLoaded())
            //    SCHR->SLSD.Unload();
            return;
        case 56: //slsd_p Local Variable Data
            //if(SCHR.IsLoaded())
            //    SCHR->SLSD.Unload();
            return;
        case 57: //scvr Name
            //if(SCHR.IsLoaded())
            //    SCHR->SCVR.Unload();
            return;
        case 58: //scro Global Reference
            //if(SCHR.IsLoaded())
            //    SCHR->SCRO.Unload();
            return;
        case 59: //scrv Local Variable
            //if(SCHR.IsLoaded())
            //    SCHR->SCRV.Unload();
            return;
        default:
            return;
        }
    }
예제 #10
0
bool ALCHRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, uint32_t ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(uint32_t *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((char *)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(uint16_t *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //boundX1
            OBND->x1 = *(int16_t *)FieldValue;
            break;
        case 8: //boundY1
            OBND->y1 = *(int16_t *)FieldValue;
            break;
        case 9: //boundZ1
            OBND->z1 = *(int16_t *)FieldValue;
            break;
        case 10: //boundX2
            OBND->x2 = *(int16_t *)FieldValue;
            break;
        case 11: //boundY2
            OBND->y2 = *(int16_t *)FieldValue;
            break;
        case 12: //boundZ2
            OBND->z2 = *(int16_t *)FieldValue;
            break;
        case 13: //full
            FULL.Copy((char *)FieldValue);
            break;
        case 14: //keywords
            KWDA.resize(ArraySize);
            for (uint32_t i = 0; i < ArraySize; ++i)
                KWDA.value[i] = ((FORMIDARRAY)FieldValue)[i];
            return true;
        case 15: //description
            DESC.Copy((char *)FieldValue);
            break;
        case 16: //modPath
            MODL.Load();
            MODL->MODL.Copy((char *)FieldValue);
            break;
        case 17: //modt_p
            MODL.Load();
            MODL->MODT.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 18: //altTextures
            MODL.Load();
            if (ListFieldID == 0) // altTextures
            {
                MODL->Textures.resize(ArraySize);
                return false;
            }

            if (ListIndex >= MODL->Textures.MODS.size())
                break;

            switch (ListFieldID)
            {
            case 1: //name
                delete[]MODL->Textures.MODS[ListIndex]->name;
                MODL->Textures.MODS[ListIndex]->name = NULL;
                if (FieldValue != NULL)
                {
                    ArraySize = (uint32_t)strlen((char *)FieldValue) + 1;
                    MODL->Textures.MODS[ListIndex]->name = new char[ArraySize];
                    strcpy_s(MODL->Textures.MODS[ListIndex]->name, ArraySize, (char *)FieldValue);
                }
                break;
            case 2: //texture
                MODL->Textures.MODS[ListIndex]->texture = *(FORMID *)FieldValue;
                return true;
            case 3: //index
                MODL->Textures.MODS[ListIndex]->index = *(int32_t *)FieldValue;
                break;
            default:
                break;
            }
            break;
        case 19: //destructableHealth
            Destructable.Load();
            Destructable->DEST->health = *(int32_t *)FieldValue;
            break;
        case 20: //destructableCount
            Destructable.Load();
            Destructable->DEST->count = *(uint8_t *)FieldValue;
            break;
        case 21: //destructableFlags
            Destructable.Load();
            Destructable->DEST->flags = *(uint8_t *)FieldValue;
            break;
        case 22: //destructableUnused1
            if (ArraySize != 2)
                break;
            Destructable.Load();
            Destructable->DEST->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            Destructable->DEST->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 23: //destructableStages
            Destructable.Load();
            if (ListFieldID == 0) //destructableStagesSize
            {
                Destructable->Stages.resize(ArraySize);
                return false;
            }

            if (ListIndex >= Destructable->Stages.value.size())
                break;

            switch (ListFieldID)
            {
            case 1: //health
                Destructable->Stages.value[ListIndex]->DSTD->health = *(uint8_t *)FieldValue;
                break;
            case 2: //index
                Destructable->Stages.value[ListIndex]->DSTD->index = *(uint8_t *)FieldValue;
                break;
            case 3: //stage
                Destructable->Stages.value[ListIndex]->DSTD->stage = *(uint8_t *)FieldValue;
                break;
            case 4: //flags
                Destructable->Stages.value[ListIndex]->DSTD->flags = *(uint8_t *)FieldValue;
                break;
            case 5: //dps
                Destructable->Stages.value[ListIndex]->DSTD->dps = *(int32_t *)FieldValue;
                break;
            case 6: //explosion
                Destructable->Stages.value[ListIndex]->DSTD->explosion = *(FORMID *)FieldValue;
                return true;
            case 7: //debris
                Destructable->Stages.value[ListIndex]->DSTD->debris = *(FORMID *)FieldValue;
                return true;
            case 8: //debrisCount
                Destructable->Stages.value[ListIndex]->DSTD->debrisCount = *(int32_t *)FieldValue;
                break;
            case 9: //modPath
                Destructable->Stages.value[ListIndex]->DMDL.Copy((char *)FieldValue);
                break;
            case 10: //modt_p
                Destructable->Stages.value[ListIndex]->DMDT.Copy((UINT8ARRAY)FieldValue, ArraySize);
                break;
            case 11: //altTextures
                if (ListX2FieldID == 0) //altTexturesSize
                {
                    Destructable->Stages.value[ListIndex]->DMDS.resize(ArraySize);
                    return false;
                }

                if (ListX2Index >= Destructable->Stages.value[ListIndex]->DMDS.MODS.size())
                    break;

                switch (ListX2FieldID)
                {
                case 1: //name
                    delete[] Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->name;
                    Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->name = NULL;
                    if (FieldValue != NULL)
                    {
                        ArraySize = (uint32_t)strlen((char *)FieldValue) + 1;
                        Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->name = new char[ArraySize];
                        strcpy_s(Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->name, ArraySize, (char *)FieldValue);
                    }
                    break;
                case 2: //texture
                    Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->texture = *(FORMID *)FieldValue;
                    return true;
                case 3: //index
                    Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->index = *(int32_t *)FieldValue;
                    break;
                default:
                    break;
                }
                break;
            default:
                break;
            }
            break;
        case 24: //iconPath
            ICON.Copy((char *)FieldValue);
            break;
        case 25: //smallIconPath
            MICO.Copy((char *)FieldValue);
            break;
        case 26: //pickupSound
            YNAM.value = *(FORMID *)FieldValue;
            return true;
        case 27: //drop Sound
            ZNAM.value = *(FORMID *)FieldValue;
            return true;
        case 28: //equipmentType
            ETYP.value = *(FORMID *)FieldValue;
            return true;
        case 29: //wieght
            DATA.value = *(float *)FieldValue;
            break;
        case 30: //value
            ENIT->value = *(int32_t *)FieldValue;
            break;
        case 31: //flags
            SetFlagMask(*(uint8_t *)FieldValue);
            break;
        case 32: //withdrawalEffect
            ENIT->withdrawalEffect = *(FORMID *)FieldValue;
            return true;
        case 33: //addictionChance
            ENIT->addictionChance = *(float *)FieldValue;
            break;
        case 34: //consumeSound
            ENIT->consumeSound = *(FORMID *)FieldValue;
            return true;
        case 35: //effects
            if (ListFieldID == 0) //effectsSize
            {
                Effects.resize(ArraySize);
                return false;
            }

            if (ListIndex >= Effects.value.size())
                break;

            switch (ListFieldID)
            {
            case 1: //effect
                Effects.value[ListIndex]->EFID.value = *(FORMID *)FieldValue;
                return true;
            case 2: //magnitude
                Effects.value[ListIndex]->EFIT->magnitude = *(float *)FieldValue;
                break;
            case 3: //area
                Effects.value[ListIndex]->EFIT->area = *(uint32_t *)FieldValue;
                break;
            case 4: //duration
                Effects.value[ListIndex]->EFIT->duration = *(uint32_t *)FieldValue;
                break;
            case 5: //conditions
                if (ListX2FieldID == 0) //conditionsSize
                {
                    Effects.value[ListIndex]->CTDA.resize(ArraySize);
                    return false;
                }

                if (ListX2Index >= Effects.value[ListIndex]->CTDA.value.size())
                    break;

                switch (ListX2FieldID)
                {
                case 1: //operType
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->operType = *(uint8_t *)FieldValue;
                    break;
                case 2: //unused1
                    if (ArraySize != 3)
                        break;
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused1[2] = ((UINT8ARRAY)FieldValue)[2];
                    break;
                case 3: //compValue
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->compValue = *(FORMID_OR_FLOAT32 *)FieldValue;
                    return true;
                case 4: //ifunc
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->ifunc = *(uint16_t *)FieldValue;
                    return true;
                case 5: //unused2
                    if (ArraySize != 2)
                        break;
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused2[0] = ((UINT8ARRAY)FieldValue)[0];
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused2[1] = ((UINT8ARRAY)FieldValue)[1];
                    break;
                case 6: //param1
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->param1 = *(FORMID_OR_UINT32 *)FieldValue;
                    return true;
                case 7: //param2
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->param2 = *(FORMID_OR_UINT32 *)FieldValue;
                    return true;
                case 8: //runOnType
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->runOnType = *(uint32_t *)FieldValue;
                    true;
                case 9: //reference
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->reference = *(FORMID_OR_UINT32 *)FieldValue;
                    return true;
                case 10: //param3
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->param3 = *(int32_t *)FieldValue;
                    break;
                case 11: //cis1
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CIS1.Copy((char *)FieldValue);
                    return true; // affects how param1 is interpreted
                case 12: //cis2
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CIS2.Copy((char *)FieldValue);
                    return true; // affects how param2 is interpreted
                default:
                    break;
                }
                break;
            default:
                break;
            }
            break;
        default:
            break;
        }
    return false;
}
예제 #11
0
void ALCHRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    GENOBND defaultOBND;
    FNVMODS defaultMODS;
    GENDEST defaultDEST;
    DESTDSTD defaultDSTD;
    ALCHENIT defaultENIT;
    SKEffect defaultEffect;
    SKCTDA defaultCTDA;

    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //boundX1
            OBND->x1 = defaultOBND.x1;
            return;
        case 8: //boundY1
            OBND->y1 = defaultOBND.y1;
            return;
        case 9: //boundZ1
            OBND->z1 = defaultOBND.z1;
            return;
        case 10: //boundX2
            OBND->x2 = defaultOBND.x2;
            return;
        case 11: //boundY2
            OBND->y2 = defaultOBND.y2;
            return;
        case 12: //boundZ2
            OBND->z2 = defaultOBND.z2;
            return;
        case 13: //full
            FULL.Unload();
            return;
        case 14: //keywords
            KWDA.Unload();
            return;
        case 15: //description
            DESC.Unload();
            return;
        case 16: //modPath
            if (MODL.IsLoaded())
                MODL->MODL.Unload();
            return;
        case 17: //modt_p
            if (MODL.IsLoaded())
                MODL->MODT.Unload();
            return;
        case 18: //altTextures
            if (MODL.IsLoaded())
            {
                if (ListFieldID == 0) //altTextures
                {
                    MODL->Textures.Unload();
                    return;
                }

                if (ListIndex >= MODL->Textures.MODS.size())
                    return;

                switch (ListFieldID)
                {
                case 1: //name
                    delete[] MODL->Textures.MODS[ListIndex]->name;
                    MODL->Textures.MODS[ListIndex]->name = NULL;
                    return;
                case 2: //texture
                    MODL->Textures.MODS[ListIndex]->texture = defaultMODS.texture;
                    return;
                case 3: //index
                    MODL->Textures.MODS[ListIndex]->index = defaultMODS.index;
                    return;
                default:
                    return;
                }
            }
            return;
        case 19: //destructableHealth
            if (Destructable.IsLoaded())
                Destructable->DEST->health = defaultDEST.health;
            return;
        case 20: //destructableCount
            if (Destructable.IsLoaded())
                Destructable->DEST->count = defaultDEST.count;
            return;
        case 21: //destructableFlags
            if (Destructable.IsLoaded())
                Destructable->DEST->flags = defaultDEST.flags;
            return;
        case 22: //destructableUnused1
            if (Destructable.IsLoaded())
            {
                Destructable->DEST->unused1[0] = defaultDEST.unused1[0];
                Destructable->DEST->unused1[1] = defaultDEST.unused1[1];
            }
            return;
        case 23: //destructableStages
            if (Destructable.IsLoaded())
            {
                if (ListFieldID == 0) //destructableStages
                {
                    Destructable->Stages.Unload();
                    return;
                }

                if (ListIndex >= Destructable->Stages.value.size())
                    return;

                switch (ListFieldID)
                {
                case 1: //health
                    Destructable->Stages.value[ListIndex]->DSTD->health = defaultDSTD.health;
                    return;
                case 2: //index
                    Destructable->Stages.value[ListIndex]->DSTD->index = defaultDSTD.index;
                    return;
                case 3: //stage
                    Destructable->Stages.value[ListIndex]->DSTD->stage = defaultDSTD.stage;
                    return;
                case 4: //flags
                    Destructable->Stages.value[ListIndex]->DSTD->flags = defaultDSTD.flags;
                    return;
                case 5: //dps
                    Destructable->Stages.value[ListIndex]->DSTD->dps = defaultDSTD.dps;
                    return;
                case 6: //explosion
                    Destructable->Stages.value[ListIndex]->DSTD->explosion = defaultDSTD.explosion;
                    return;
                case 7: //debris
                    Destructable->Stages.value[ListIndex]->DSTD->debris = defaultDSTD.debris;
                    return;
                case 8: //debrisCount
                    Destructable->Stages.value[ListIndex]->DSTD->debrisCount = defaultDSTD.debrisCount;
                    return;
                case 9: //modPath
                    Destructable->Stages.value[ListIndex]->DMDL.Unload();
                    return;
                case 10: //modt_p
                    Destructable->Stages.value[ListIndex]->DMDT.Unload();
                    return;
                case 11: //altTextures
                    if (ListX2FieldID == 0) //altTextures
                    {
                        Destructable->Stages.value[ListIndex]->DMDS.Unload();
                        return;
                    }

                    if (ListX2Index >= Destructable->Stages.value[ListIndex]->DMDS.MODS.size())
                        return;

                    switch (ListX2FieldID)
                    {
                    case 1: //name
                        delete[] Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->name;
                        Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->name = NULL;
                        return;
                    case 2: //texture
                        Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->texture = defaultMODS.texture;
                        return;
                    case 3: //index
                        Destructable->Stages.value[ListIndex]->DMDS.MODS[ListX2Index]->index = defaultMODS.index;
                        return;
                    default:
                        return;
                    }
                    return;
                default:
                    return;
                }
            }
            return;
        case 24: //iconPath
            ICON.Unload();
            return;
        case 25: //smallIconPath
            MICO.Unload();
            return;
        case 26: //pickupSound
            YNAM.Unload();
            return;
        case 27: //dropSound
            ZNAM.Unload();
            return;
        case 28: //equipmentType
            ETYP.Unload();
            return;
        case 29: //wieght
            DATA.Unload();
            return;
        case 30: //value
            ENIT->value = defaultENIT.value;
            return;
        case 31: //flags
            ENIT->flags = defaultENIT.flags;
            return;
        case 32: //withdrawalEffect
            ENIT->withdrawalEffect = defaultENIT.withdrawalEffect;
            return;
        case 33: //addictionChance
            ENIT->addictionChance = defaultENIT.addictionChance;
            return;
        case 34: //consumeSound
            ENIT->consumeSound = defaultENIT.consumeSound;
            return;
        case 35: //effects
            if (ListFieldID == 0) //effects
            {
                Effects.Unload();
                return;
            }

            if (ListIndex >= Effects.value.size())
                return;

            switch (ListFieldID)
            {
            case 1: //effect
                Effects.value[ListIndex]->EFID = defaultEffect.EFID;
                return;
            case 2: //magnitude
                Effects.value[ListIndex]->EFIT->magnitude = defaultEffect.EFIT->magnitude;
                return;
            case 3: //area
                Effects.value[ListIndex]->EFIT->area = defaultEffect.EFIT->area;
                return;
            case 4: //duration
                Effects.value[ListIndex]->EFIT->duration = defaultEffect.EFIT->duration;
            case 5: //conditions
                if (ListX2FieldID == 0) //conditions
                {
                    Effects.value[ListIndex]->CTDA.Unload();
                    return;
                }

                if (ListX2Index >= Effects.value[ListIndex]->CTDA.value.size())
                    return;

                switch (ListX2FieldID)
                {
                case 1:  //operType
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->operType = defaultCTDA.operType;
                    return;
                case 2: //unused1
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused1[0] = defaultCTDA.unused1[0];
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused1[1] = defaultCTDA.unused1[1];
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused1[2] = defaultCTDA.unused1[2];
                    return;
                case 3: //compValue
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->compValue = defaultCTDA.compValue;
                    return;
                case 4: //ifunc
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->ifunc = defaultCTDA.ifunc;
                    return;
                case 5: //unused2
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused2[0] = defaultCTDA.unused2[0];
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->unused2[1] = defaultCTDA.unused2[1];
                    return;
                case 6: //param1
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->param1 = defaultCTDA.param1;
                    return;
                case 7: //param2
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->param2 = defaultCTDA.param2;
                    return;
                case 8: //runOnType
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->runOnType = defaultCTDA.runOnType;
                    return;
                case 9: //reference
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->reference = defaultCTDA.reference;
                    return;
                case 10: //param3
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CTDA->param3 = defaultCTDA.param3;
                    return;
                case 11: //cis1
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CIS1.Unload();
                    return;
                case 12: //cis2
                    Effects.value[ListIndex]->CTDA.value[ListX2Index]->CIS2.Unload();
                    return;
                default:
                    return;
                }
                return;
            default:
                return;
            }
            return;
        default:
            return;
        }
    }
예제 #12
0
void NOTERecord::DeleteField(FIELD_IDENTIFIERS)
    {
    GENOBND defaultOBND;
    FNVMODS defaultMODS;
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //boundX1
            OBND.value.x1 = defaultOBND.x1;
            return;
        case 8: //boundY1
            OBND.value.y1 = defaultOBND.y1;
            return;
        case 9: //boundZ1
            OBND.value.z1 = defaultOBND.z1;
            return;
        case 10: //boundX2
            OBND.value.x2 = defaultOBND.x2;
            return;
        case 11: //boundY2
            OBND.value.y2 = defaultOBND.y2;
            return;
        case 12: //boundZ2
            OBND.value.z2 = defaultOBND.z2;
            return;
        case 13: //full
            FULL.Unload();
            return;
        case 14: //modPath
            if(MODL.IsLoaded())
                MODL->MODL.Unload();
            return;
        case 15: //modb
            if(MODL.IsLoaded())
                MODL->MODB.Unload();
            return;
        case 16: //modt_p
            if(MODL.IsLoaded())
                MODL->MODT.Unload();
            return;
        case 17: //altTextures
            if(MODL.IsLoaded())
                {
                if(ListFieldID == 0) //altTextures
                    {
                    MODL->Textures.Unload();
                    return;
                    }

                if(ListIndex >= MODL->Textures.MODS.size())
                    return;

                switch(ListFieldID)
                    {
                    case 1: //name
                        delete []MODL->Textures.MODS[ListIndex]->name;
                        MODL->Textures.MODS[ListIndex]->name = NULL;
                        return;
                    case 2: //texture
                        MODL->Textures.MODS[ListIndex]->texture = defaultMODS.texture;
                        return;
                    case 3: //index
                        MODL->Textures.MODS[ListIndex]->index = defaultMODS.index;
                        return;
                    default:
                        return;
                    }
                }
            return;
        case 18: //modelFlags
            if(MODL.IsLoaded())
                MODL->MODD.Unload();
            return;
        case 19: //iconPath
            ICON.Unload();
            return;
        case 20: //smallIconPath
            MICO.Unload();
            return;
        case 21: //pickupSound
            YNAM.Unload();
            return;
        case 22: //dropSound
            ZNAM.Unload();
            return;
        case 23: //noteType
            DATA.Unload();
            return;
        case 24: //quests
            ONAM.Unload();
            return;
        case 25: //texturePath
            XNAM.Unload();
            return;
        case 26: //textOrTopic
            TNAM.Unload();
            TNAMAlt.Unload();
            return;
        case 27: //sound
            SNAM.Unload();
            return;
        default:
            return;
        }
    }
예제 #13
0
bool NOTERecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((STRING)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(UINT16 *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //boundX1
            OBND.value.x1 = *(SINT16 *)FieldValue;
            break;
        case 8: //boundY1
            OBND.value.y1 = *(SINT16 *)FieldValue;
            break;
        case 9: //boundZ1
            OBND.value.z1 = *(SINT16 *)FieldValue;
            break;
        case 10: //boundX2
            OBND.value.x2 = *(SINT16 *)FieldValue;
            break;
        case 11: //boundY2
            OBND.value.y2 = *(SINT16 *)FieldValue;
            break;
        case 12: //boundZ2
            OBND.value.z2 = *(SINT16 *)FieldValue;
            break;
        case 13: //full
            FULL.Copy((STRING)FieldValue);
            break;
        case 14: //modPath
            MODL.Load();
            MODL->MODL.Copy((STRING)FieldValue);
            break;
        case 15: //modb
            MODL.Load();
            MODL->MODB.value = *(FLOAT32 *)FieldValue;
            break;
        case 16: //modt_p
            MODL.Load();
            MODL->MODT.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 17: //altTextures
            MODL.Load();
            if(ListFieldID == 0) //altTexturesSize
                {
                MODL->Textures.resize(ArraySize);
                return false;
                }

            if(ListIndex >= MODL->Textures.MODS.size())
                break;

            switch(ListFieldID)
                {
                case 1: //name
                    delete []MODL->Textures.MODS[ListIndex]->name;
                    MODL->Textures.MODS[ListIndex]->name = NULL;
                    if(FieldValue != NULL)
                        {
                        ArraySize = (UINT32)strlen((STRING)FieldValue) + 1;
                        MODL->Textures.MODS[ListIndex]->name = new char[ArraySize];
                        strcpy_s(MODL->Textures.MODS[ListIndex]->name, ArraySize, (STRING)FieldValue);
                        }
                    break;
                case 2: //texture
                    MODL->Textures.MODS[ListIndex]->texture = *(FORMID *)FieldValue;
                    return true;
                case 3: //index
                    MODL->Textures.MODS[ListIndex]->index = *(SINT32 *)FieldValue;
                    break;
                default:
                    break;
                }
            break;
        case 18: //modelFlags
            MODL.Load();
            MODL->SetFlagMask(*(UINT8 *)FieldValue);
            break;
        case 19: //iconPath
            ICON.Copy((STRING)FieldValue);
            break;
        case 20: //smallIconPath
            MICO.Copy((STRING)FieldValue);
            break;
        case 21: //pickupSound
            YNAM.value = *(FORMID *)FieldValue;
            return true;
        case 22: //dropSound
            ZNAM.value = *(FORMID *)FieldValue;
            return true;
        case 23: //noteType
            DATA.value = *(UINT8 *)FieldValue;
            return true; //controls whether textOrTopic is a formID
        case 24: //quests
            ONAM.resize(ArraySize);
            for(UINT32 x = 0; x < ArraySize; x++)
                ONAM.value[x] = ((FORMIDARRAY)FieldValue)[x];
            return true;
        case 25: //texturePath
            XNAM.Copy((STRING)FieldValue);
            break;
        case 26: //textOrTopic
            if(IsVoice())
                {
                TNAMAlt.value = *(FORMID *)FieldValue;
                return true;
                }
            else
                {
                TNAM.Copy((STRING)FieldValue);
                break;
                }
            break;
        case 27: //sound
            SNAM.value = *(FORMID *)FieldValue;
            return true;
        default:
            break;
        }
    return false;
    }
예제 #14
0
void REFRRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    REFRXTEL defaultXTEL;
    REFRXLOC defaultXLOC;
    GENXESP defaultXESP;
    GENXLOD defaultXLOD;
    GENTNAM defaultTNAM;
    GENPOSDATA defaultDATA;
    Data.Load();
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //flags2
            flagsUnk = 0;
            return;
        case 4: //eid
            Data->EDID.Unload();
            return;
        case 5: //base
            Data->NAME.Unload();
            return;
        case 6: //destination
            if(Data->XTEL.IsLoaded())
                Data->XTEL->destinationFid = defaultXTEL.destinationFid;
            return;
        case 7: //destinationPosX
            if(Data->XTEL.IsLoaded())
                Data->XTEL->destination.posX = defaultXTEL.destination.posX;
            return;
        case 8: //destinationPosY
            if(Data->XTEL.IsLoaded())
                Data->XTEL->destination.posY = defaultXTEL.destination.posY;
            return;
        case 9: //destinationPosZ
            if(Data->XTEL.IsLoaded())
                Data->XTEL->destination.posZ = defaultXTEL.destination.posZ;
            return;
        case 10: //destinationRotX
            if(Data->XTEL.IsLoaded())
                Data->XTEL->destination.rotX = defaultXTEL.destination.rotX;
            return;
        case 11: //destinationRotY
            if(Data->XTEL.IsLoaded())
                Data->XTEL->destination.rotY = defaultXTEL.destination.rotY;
            return;
        case 12: //destinationRotZ
            if(Data->XTEL.IsLoaded())
                Data->XTEL->destination.rotZ = defaultXTEL.destination.rotZ;
            return;
        case 13: //lockLevel
            if(Data->XLOC.IsLoaded())
                Data->XLOC->level = defaultXLOC.level;
            return;
        case 14: //unused1
            if(Data->XLOC.IsLoaded())
                {
                Data->XLOC->unused1[0] = defaultXLOC.unused1[0];
                Data->XLOC->unused1[1] = defaultXLOC.unused1[1];
                Data->XLOC->unused1[2] = defaultXLOC.unused1[2];
                }
            return;
        case 15: //lockKey
            if(Data->XLOC.IsLoaded())
                Data->XLOC->key = defaultXLOC.key;
            return;
        case 16: //unused2
            if(Data->XLOC.IsLoaded())
                {
                Data->XLOC->unused2[0] = defaultXLOC.unused2[0];
                Data->XLOC->unused2[1] = defaultXLOC.unused2[1];
                Data->XLOC->unused2[2] = defaultXLOC.unused2[2];
                Data->XLOC->unused2[3] = defaultXLOC.unused2[3];
                }
            return;
        case 17: //lockFlags
            if(Data->XLOC.IsLoaded())
                Data->XLOC->flags = defaultXLOC.flags;
            return;
        case 18: //unused3
            if(Data->XLOC.IsLoaded())
                {
                Data->XLOC->unused3[0] = defaultXLOC.unused3[0];
                Data->XLOC->unused3[1] = defaultXLOC.unused3[1];
                Data->XLOC->unused3[2] = defaultXLOC.unused3[2];
                }
            return;
        case 19: //owner
            if(Data->Ownership.IsLoaded())
                Data->Ownership->XOWN.Unload();
            return;
        case 20: //rank
            if(Data->Ownership.IsLoaded())
                Data->Ownership->XRNK.Unload();
            return;
        case 21: //globalVariable
            if(Data->Ownership.IsLoaded())
                Data->Ownership->XGLB.Unload();
            return;
        case 22: //parent
            if(Data->XESP.IsLoaded())
                Data->XESP->parent = defaultXESP.parent;
            return;
        case 23: //parentFlags
            if(Data->XESP.IsLoaded())
                Data->XESP->flags = defaultXESP.flags;
            return;
        case 24: //unused4
            if(Data->XESP.IsLoaded())
                {
                Data->XESP->unused1[0] = defaultXESP.unused1[0];
                Data->XESP->unused1[1] = defaultXESP.unused1[1];
                Data->XESP->unused1[2] = defaultXESP.unused1[2];
                }
            return;
        case 25: //target
            Data->XTRG.Unload();
            return;
        case 26: //seed
            Data->XSED.Unload();
            return;
        case 27: //lod1
            if(Data->XLOD.IsLoaded())
                Data->XLOD->lod1 = defaultXLOD.lod1;
            return;
        case 28: //lod2
            if(Data->XLOD.IsLoaded())
                Data->XLOD->lod2 = defaultXLOD.lod2;
            return;
        case 29: //lod3
            if(Data->XLOD.IsLoaded())
                Data->XLOD->lod3 = defaultXLOD.lod3;
            return;
        case 30: //charge
            Data->XCHG.Unload();
            return;
        case 31: //health
            Data->XHLT.Unload();
            return;
        case 32: //unknownXPCIFormID
            if(Data->XPCI.IsLoaded())
                Data->XPCI->XPCI.Unload();
            return;
        case 33: //unknownXPCIString
            if(Data->XPCI.IsLoaded())
                Data->XPCI->FULL.Unload();
            return;
        case 34: //levelMod
            Data->XLCM.Unload();
            return;
        case 35: //unknownXRTMFormID
            Data->XRTM.Unload();
            return;
        case 36: //actionFlags
            Data->XACT.Unload();
            return;
        case 37: //count
            Data->XCNT.Unload();
            return;
        case 38: //markerFlags
            if(Data->Marker.IsLoaded())
                Data->Marker->FNAM.Unload();
            return;
        case 39: //markerName
            if(Data->Marker.IsLoaded())
                Data->Marker->FULL.Unload();
            return;
        case 40: //markerType
            if(Data->Marker.IsLoaded())
                Data->Marker->TNAM.value.markerType = defaultTNAM.markerType;
            return;
        case 41: //markerUnused
            if(Data->Marker.IsLoaded())
                Data->Marker->TNAM.value.unused1 = defaultTNAM.unused1;
            return;
        case 42: //scale
            Data->XSCL.Unload();
            return;
        case 43: //soulType
            Data->XSOL.Unload();
            return;
        case 44: //posX
            Data->DATA.value.posX = defaultDATA.posX;
            return;
        case 45: //posY
            Data->DATA.value.posY = defaultDATA.posY;
            return;
        case 46: //posZ
            Data->DATA.value.posZ = defaultDATA.posZ;
            return;
        case 47: //rotX
            Data->DATA.value.rotX = defaultDATA.rotX;
            return;
        case 48: //rotY
            Data->DATA.value.rotY = defaultDATA.rotY;
            return;
        case 49: //rotZ
            Data->DATA.value.rotZ = defaultDATA.rotZ;
            return;
        default:
            return;
        }
    return;
    }
예제 #15
0
void ACHRRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    GENXESP defaultXESP;
    GENXLOD defaultXLOD;
    GENPOSDATA defaultDATA;

    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //flags2
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //base
            NAME.Unload();
            return;
        case 6: //unknownXPCIFormID
            if(XPCI.IsLoaded())
                XPCI->XPCI.Unload();
            return;
        case 7: //unknownXPCIString
            if(XPCI.IsLoaded())
                XPCI->FULL.Unload();
            return;
        case 8: //lod1
            if(XLOD.IsLoaded())
                XLOD->lod1 = defaultXLOD.lod1;
            return;
        case 9: //lod2
            if(XLOD.IsLoaded())
                XLOD->lod2 = defaultXLOD.lod2;
            return;
        case 10: //lod3
            if(XLOD.IsLoaded())
                XLOD->lod3 = defaultXLOD.lod3;
            return;
        case 11: //parent
            if(XESP.IsLoaded())
                XESP->parent = defaultXESP.parent;
            return;
        case 12: //parentFlags
            if(XESP.IsLoaded())
                XESP->flags = defaultXESP.flags;
            return;
        case 13: //unused1
            if(XESP.IsLoaded())
                {
                XESP->unused1[0] = defaultXESP.unused1[0];
                XESP->unused1[1] = defaultXESP.unused1[1];
                XESP->unused1[2] = defaultXESP.unused1[2];
                }
            return;
        case 14: //merchantContainer
            XMRC.Unload();
            return;
        case 15: //horse
            XHRS.Unload();
            return;
        case 16: //xrgd_p
            XRGD.Unload();
            return;
        case 17: //scale
            XSCL.Unload();
            return;
        case 18: //posX
            DATA.value.posX = defaultDATA.posX;
            return;
        case 19: //posY
            DATA.value.posY = defaultDATA.posY;
            return;
        case 20: //posZ
            DATA.value.posZ = defaultDATA.posZ;
            return;
        case 21: //rotX
            DATA.value.rotX = defaultDATA.rotX;
            return;
        case 22: //rotY
            DATA.value.rotY = defaultDATA.rotY;
            return;
        case 23: //rotZ
            DATA.value.rotZ = defaultDATA.rotZ;
            return;
        default:
            return;
        }
    return;
    }
예제 #16
0
bool SCPTRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 3: //flags2
            SetHeaderUnknownFlagMask(*(UINT32 *)FieldValue);
            break;
        case 4: //eid
            EDID.Copy((STRING)FieldValue);
            break;
        case 5: //unused1
            if(ArraySize != 4)
                break;
            SCHR.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            SCHR.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            SCHR.value.unused1[2] = ((UINT8ARRAY)FieldValue)[2];
            SCHR.value.unused1[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 6: //numRefs
            SCHR.value.numRefs = *(UINT32 *)FieldValue;
            break;
        case 7: //compiledSize
            SCHR.value.compiledSize = *(UINT32 *)FieldValue;
            break;
        case 8: //lastIndex
            SCHR.value.lastIndex = *(UINT32 *)FieldValue;
            break;
        case 9: //scriptType
            SetType(*(UINT32 *)FieldValue);
            break;
        case 10: //compiled_p
            SCDA.Copy((UINT8ARRAY)FieldValue, ArraySize);
            SCHR.value.compiledSize = ArraySize;
            break;
        case 11: //scriptText
            SCTX.Copy((STRING)FieldValue);
            break;
        case 12: //vars
            if(ListFieldID == 0) //varsSize
                {
                VARS.resize(ArraySize);
                }

            if(ListIndex >= VARS.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //index
                    VARS.value[ListIndex]->SLSD.value.index = *(UINT32 *)FieldValue;
                    break;
                case 2: //unused1
                    if(ArraySize != 12)
                        break;
                    VARS.value[ListIndex]->SLSD.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
                    VARS.value[ListIndex]->SLSD.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
                    VARS.value[ListIndex]->SLSD.value.unused1[2] = ((UINT8ARRAY)FieldValue)[2];
                    VARS.value[ListIndex]->SLSD.value.unused1[3] = ((UINT8ARRAY)FieldValue)[3];
                    VARS.value[ListIndex]->SLSD.value.unused1[4] = ((UINT8ARRAY)FieldValue)[4];
                    VARS.value[ListIndex]->SLSD.value.unused1[5] = ((UINT8ARRAY)FieldValue)[5];
                    VARS.value[ListIndex]->SLSD.value.unused1[6] = ((UINT8ARRAY)FieldValue)[6];
                    VARS.value[ListIndex]->SLSD.value.unused1[7] = ((UINT8ARRAY)FieldValue)[7];
                    VARS.value[ListIndex]->SLSD.value.unused1[8] = ((UINT8ARRAY)FieldValue)[8];
                    VARS.value[ListIndex]->SLSD.value.unused1[9] = ((UINT8ARRAY)FieldValue)[9];
                    VARS.value[ListIndex]->SLSD.value.unused1[10] = ((UINT8ARRAY)FieldValue)[10];
                    VARS.value[ListIndex]->SLSD.value.unused1[11] = ((UINT8ARRAY)FieldValue)[11];
                    break;
                case 3: //flags
                    VARS.value[ListIndex]->SetFlagMask(*(UINT8 *)FieldValue);
                    break;
                case 4: //unused2
                    if(ArraySize != 7)
                        break;
                    VARS.value[ListIndex]->SLSD.value.unused2[0] = ((UINT8ARRAY)FieldValue)[0];
                    VARS.value[ListIndex]->SLSD.value.unused2[1] = ((UINT8ARRAY)FieldValue)[1];
                    VARS.value[ListIndex]->SLSD.value.unused2[2] = ((UINT8ARRAY)FieldValue)[2];
                    VARS.value[ListIndex]->SLSD.value.unused2[3] = ((UINT8ARRAY)FieldValue)[3];
                    VARS.value[ListIndex]->SLSD.value.unused2[4] = ((UINT8ARRAY)FieldValue)[4];
                    VARS.value[ListIndex]->SLSD.value.unused2[5] = ((UINT8ARRAY)FieldValue)[5];
                    VARS.value[ListIndex]->SLSD.value.unused2[6] = ((UINT8ARRAY)FieldValue)[6];
                    break;
                case 5: //name
                    VARS.value[ListIndex]->SCVR.Copy((STRING)FieldValue);
                    break;
                default:
                    break;
                }
            break;
        case 13: //references
            if(ListFieldID == 0) //referencesSize
                {
                SCR_.resize(ArraySize);
                return false;
                }

            if(ListIndex >= SCR_.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //reference
                    //Borrowing ArraySize to flag if the new value is a formID
                    SCR_.value[ListIndex]->reference = *(UINT32 *)FieldValue;
                    SCR_.value[ListIndex]->isSCRO = ArraySize ? true : false;
                    return ArraySize != 0;
                default:
                    break;
                }
            break;
        default:
            break;
        }
    return false;
    }
예제 #17
0
bool FACTRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((STRING)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(UINT16 *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //full
            FULL.Copy((STRING)FieldValue);
            break;
        case 8: //relations
            if(ListFieldID == 0) //relationsSize
                {
                XNAM.resize(ArraySize);
                return false;
                }

            if(ListIndex >= XNAM.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //faction
                    XNAM.value[ListIndex]->faction = *(FORMID *)FieldValue;
                    return true;
                case 2: //mod
                    XNAM.value[ListIndex]->mod = *(SINT32 *)FieldValue;
                    break;
                case 3: //groupReactionType
                    XNAM.value[ListIndex]->SetType(*(UINT32 *)FieldValue);
                    break;
                default:
                    break;
                }
            break;
        case 9: //flags
            SetFlagMask(*(UINT8 *)FieldValue);
            break;
        case 10: //unused1
            if(ArraySize != 2)
                break;
            DATA.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            DATA.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 11: //crimeGoldMultiplier
            CNAM.Load();
            *CNAM.value = *(FLOAT32 *)FieldValue;
            break;
        case 12: //ranks
            if(ListFieldID == 0) //ranksSize
                {
                RNAM.resize(ArraySize);
                return false;
                }

            if(ListIndex >= RNAM.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //rank
                    RNAM.value[ListIndex]->RNAM.value = *(SINT32 *)FieldValue;
                    break;
                case 2: //male
                    RNAM.value[ListIndex]->MNAM.Copy((STRING)FieldValue);
                    break;
                case 3: //female
                    RNAM.value[ListIndex]->FNAM.Copy((STRING)FieldValue);
                    break;
                case 4: //insigniaPath
                    RNAM.value[ListIndex]->INAM.Copy((STRING)FieldValue);
                    break;
                default:
                    break;
                }
            break;
        case 13: //reputation
            WMI1.value = *(FORMID *)FieldValue;
            return true;
        default:
            break;
        }
    return false;
    }
예제 #18
0
void SCPTRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    GENSCHR defaultSCHR;

    GENVARS defaultVARS;
    GENSCR_ defaultSCR_;

    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //flags2
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //unused1
            SCHR.value.unused1[0] = defaultSCHR.unused1[0];
            SCHR.value.unused1[1] = defaultSCHR.unused1[1];
            SCHR.value.unused1[2] = defaultSCHR.unused1[2];
            SCHR.value.unused1[3] = defaultSCHR.unused1[3];
            return;
        case 6: //numRefs
            SCHR.value.numRefs = defaultSCHR.numRefs;
            return;
        case 7: //compiledSize
            SCHR.value.compiledSize = defaultSCHR.compiledSize;
            return;
        case 8: //lastIndex
            SCHR.value.lastIndex = defaultSCHR.lastIndex;
            return;
        case 9: //scriptType
            SCHR.value.scriptType = defaultSCHR.scriptType;
            return;
        case 10: //compiled_p
            SCDA.Unload();
            return;
        case 11: //scriptText
            SCTX.Unload();
            return;
        case 12: //vars
            if(ListFieldID == 0) //vars
                {
                VARS.Unload();
                return;
                }

            if(ListIndex >= VARS.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //index
                    VARS.value[ListIndex]->SLSD.value.index = defaultVARS.SLSD.value.index;
                    return;
                case 2: //unused1
                    VARS.value[ListIndex]->SLSD.value.unused1[0] = defaultVARS.SLSD.value.unused1[0];
                    VARS.value[ListIndex]->SLSD.value.unused1[1] = defaultVARS.SLSD.value.unused1[1];
                    VARS.value[ListIndex]->SLSD.value.unused1[2] = defaultVARS.SLSD.value.unused1[2];
                    VARS.value[ListIndex]->SLSD.value.unused1[3] = defaultVARS.SLSD.value.unused1[3];
                    VARS.value[ListIndex]->SLSD.value.unused1[4] = defaultVARS.SLSD.value.unused1[4];
                    VARS.value[ListIndex]->SLSD.value.unused1[5] = defaultVARS.SLSD.value.unused1[5];
                    VARS.value[ListIndex]->SLSD.value.unused1[6] = defaultVARS.SLSD.value.unused1[6];
                    VARS.value[ListIndex]->SLSD.value.unused1[7] = defaultVARS.SLSD.value.unused1[7];
                    VARS.value[ListIndex]->SLSD.value.unused1[8] = defaultVARS.SLSD.value.unused1[8];
                    VARS.value[ListIndex]->SLSD.value.unused1[9] = defaultVARS.SLSD.value.unused1[9];
                    VARS.value[ListIndex]->SLSD.value.unused1[10] = defaultVARS.SLSD.value.unused1[10];
                    VARS.value[ListIndex]->SLSD.value.unused1[11] = defaultVARS.SLSD.value.unused1[11];
                    return;
                case 3: //flags
                    VARS.value[ListIndex]->SLSD.value.flags = defaultVARS.SLSD.value.flags;
                    return;
                case 4: //unused2
                    VARS.value[ListIndex]->SLSD.value.unused2[0] = defaultVARS.SLSD.value.unused2[0];
                    VARS.value[ListIndex]->SLSD.value.unused2[1] = defaultVARS.SLSD.value.unused2[1];
                    VARS.value[ListIndex]->SLSD.value.unused2[2] = defaultVARS.SLSD.value.unused2[2];
                    VARS.value[ListIndex]->SLSD.value.unused2[3] = defaultVARS.SLSD.value.unused2[3];
                    VARS.value[ListIndex]->SLSD.value.unused2[4] = defaultVARS.SLSD.value.unused2[4];
                    VARS.value[ListIndex]->SLSD.value.unused2[5] = defaultVARS.SLSD.value.unused2[5];
                    VARS.value[ListIndex]->SLSD.value.unused2[6] = defaultVARS.SLSD.value.unused2[6];
                    return;
                case 5: //name
                    VARS.value[ListIndex]->SCVR.Unload();
                    return;
                default:
                    return;
                }
            return;
        case 13: //references
            if(ListFieldID == 0) //references
                {
                SCR_.Unload();
                return;
                }

            if(ListIndex >= SCR_.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //reference
                    SCR_.value[ListIndex]->reference = defaultSCR_.reference;
                    SCR_.value[ListIndex]->isSCRO = defaultSCR_.isSCRO;
                    return;
                default:
                    return;
                }
            return;
        default:
            return;
        }
    return;
    }
예제 #19
0
bool MESGRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, uint32_t ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(uint32_t *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((char *)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(uint16_t *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //description
            DESC.Copy((char *)FieldValue);
            break;
        case 8: //full
            FULL.Copy((char *)FieldValue);
            break;
        case 9: //inam Icon
            INAM.Load();
            INAM.value = *(FORMID *)FieldValue;
            return true;
        case 10: //dnam Flags
            DNAM.Load();
            DNAM.value = *(uint32_t *)FieldValue;
            break;
        case 11: //tnam Display Time
            TNAM.Load();
            TNAM.value = *(uint32_t *)FieldValue;
            break;
        case 12: //itxt Button Text
            //ITXT.Copy((char *)FieldValue);
            break;
        case 13: //ctda Conditions
            //CTDAs.Load();
            //CTDAs->value13 = *(uint8_t *)FieldValue;
            break;
        case 14: //ctda_p Conditions
            if(ArraySize != 3)
                break;
            //CTDAs.Load();
            //CTDAs->value14[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDAs->value14[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDAs->value14[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 15: //ctda Conditions
            //return UNPARSEDGET_FIELD15;
        case 16: //ctda Conditions
            //CTDAs.Load();
            //CTDAs->value16 = *(uint32_t *)FieldValue;
            break;
        case 17: //ctda_p Conditions
            if(ArraySize != 4)
                break;
            //CTDAs.Load();
            //CTDAs->value17[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDAs->value17[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDAs->value17[2] = ((UINT8ARRAY)FieldValue)[2];
            //CTDAs->value17[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 18: //ctda_p Conditions
            if(ArraySize != 4)
                break;
            //CTDAs.Load();
            //CTDAs->value18[0] = ((UINT8ARRAY)FieldValue)[0];
            //CTDAs->value18[1] = ((UINT8ARRAY)FieldValue)[1];
            //CTDAs->value18[2] = ((UINT8ARRAY)FieldValue)[2];
            //CTDAs->value18[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 19: //ctda Conditions
            //CTDAs.Load();
            //CTDAs->value19 = *(uint32_t *)FieldValue;
            break;
        case 20: //ctda Conditions
            //return UNPARSEDGET_FIELD20;
        default:
            break;
        }
    return false;
    }
예제 #20
0
bool CSTYRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, uint32_t ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(uint32_t *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((char *)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(uint16_t *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //dodgeChance
            CSTD.value.dodgeChance = *(uint8_t *)FieldValue;
            break;
        case 8: //lrChance
            CSTD.value.lrChance = *(uint8_t *)FieldValue;
            break;
        case 9: //unused1
            if(ArraySize != 2)
                break;
            CSTD.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            CSTD.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 10: //lrTimerMin
            CSTD.value.lrTimerMin = *(float *)FieldValue;
            break;
        case 11: //lrTimerMax
            CSTD.value.lrTimerMax = *(float *)FieldValue;
            break;
        case 12: //forTimerMin
            CSTD.value.forTimerMin = *(float *)FieldValue;
            break;
        case 13: //forTimerMax
            CSTD.value.forTimerMax = *(float *)FieldValue;
            break;
        case 14: //backTimerMin
            CSTD.value.backTimerMin = *(float *)FieldValue;
            break;
        case 15: //backTimerMax
            CSTD.value.backTimerMax = *(float *)FieldValue;
            break;
        case 16: //idleTimerMin
            CSTD.value.idleTimerMin = *(float *)FieldValue;
            break;
        case 17: //idleTimerMax
            CSTD.value.idleTimerMax = *(float *)FieldValue;
            break;
        case 18: //blkChance
            CSTD.value.blkChance = *(uint8_t *)FieldValue;
            break;
        case 19: //atkChance
            CSTD.value.atkChance = *(uint8_t *)FieldValue;
            break;
        case 20: //unused2
            if(ArraySize != 2)
                break;
            CSTD.value.unused2[0] = ((UINT8ARRAY)FieldValue)[0];
            CSTD.value.unused2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 21: //atkBRecoil
            CSTD.value.atkBRecoil = *(float *)FieldValue;
            break;
        case 22: //atkBUnc
            CSTD.value.atkBUnc = *(float *)FieldValue;
            break;
        case 23: //atkBh2h
            CSTD.value.atkBh2h = *(float *)FieldValue;
            break;
        case 24: //pAtkChance
            CSTD.value.pAtkChance = *(uint8_t *)FieldValue;
            break;
        case 25: //unused3
            if(ArraySize != 3)
                break;
            CSTD.value.unused3[0] = ((UINT8ARRAY)FieldValue)[0];
            CSTD.value.unused3[1] = ((UINT8ARRAY)FieldValue)[1];
            CSTD.value.unused3[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 26: //pAtkBRecoil
            CSTD.value.pAtkBRecoil = *(float *)FieldValue;
            break;
        case 27: //pAtkBUnc
            CSTD.value.pAtkBUnc = *(float *)FieldValue;
            break;
        case 28: //pAtkNormal
            CSTD.value.pAtkNormal = *(uint8_t *)FieldValue;
            break;
        case 29: //pAtkFor
            CSTD.value.pAtkFor = *(uint8_t *)FieldValue;
            break;
        case 30: //pAtkBack
            CSTD.value.pAtkBack = *(uint8_t *)FieldValue;
            break;
        case 31: //pAtkL
            CSTD.value.pAtkL = *(uint8_t *)FieldValue;
            break;
        case 32: //pAtkR
            CSTD.value.pAtkR = *(uint8_t *)FieldValue;
            break;
        case 33: //unused4
            if(ArraySize != 3)
                break;
            CSTD.value.unused4[0] = ((UINT8ARRAY)FieldValue)[0];
            CSTD.value.unused4[1] = ((UINT8ARRAY)FieldValue)[1];
            CSTD.value.unused4[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 34: //holdTimerMin
            CSTD.value.holdTimerMin = *(float *)FieldValue;
            break;
        case 35: //holdTimerMax
            CSTD.value.holdTimerMax = *(float *)FieldValue;
            break;
        case 36: //flags
            SetFlagMask(*(uint16_t *)FieldValue);
            break;
        case 37: //unused5
            if(ArraySize != 2)
                break;
            CSTD.value.unused5[0] = ((UINT8ARRAY)FieldValue)[0];
            CSTD.value.unused5[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 38: //acroDodge
            CSTD.value.acroDodge = *(uint8_t *)FieldValue;
            break;
        case 39: //rushChance
            CSTD.value.rushChance = *(uint8_t *)FieldValue;
            break;
        case 40: //unused6
            if(ArraySize != 2)
                break;
            CSTD.value.unused6[0] = ((UINT8ARRAY)FieldValue)[0];
            CSTD.value.unused6[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 41: //rushMult
            CSTD.value.rushMult = *(float *)FieldValue;
            break;
        case 42: //dodgeFMult
            CSAD.value.dodgeFMult = *(float *)FieldValue;
            break;
        case 43: //dodgeFBase
            CSAD.value.dodgeFBase = *(float *)FieldValue;
            break;
        case 44: //encSBase
            CSAD.value.encSBase = *(float *)FieldValue;
            break;
        case 45: //encSMult
            CSAD.value.encSMult = *(float *)FieldValue;
            break;
        case 46: //dodgeAtkMult
            CSAD.value.dodgeAtkMult = *(float *)FieldValue;
            break;
        case 47: //dodgeNAtkMult
            CSAD.value.dodgeNAtkMult = *(float *)FieldValue;
            break;
        case 48: //dodgeBAtkMult
            CSAD.value.dodgeBAtkMult = *(float *)FieldValue;
            break;
        case 49: //dodgeBNAtkMult
            CSAD.value.dodgeBNAtkMult = *(float *)FieldValue;
            break;
        case 50: //dodgeFAtkMult
            CSAD.value.dodgeFAtkMult = *(float *)FieldValue;
            break;
        case 51: //dodgeFNAtkMult
            CSAD.value.dodgeFNAtkMult = *(float *)FieldValue;
            break;
        case 52: //blockMult
            CSAD.value.blockMult = *(float *)FieldValue;
            break;
        case 53: //blockBase
            CSAD.value.blockBase = *(float *)FieldValue;
            break;
        case 54: //blockAtkMult
            CSAD.value.blockAtkMult = *(float *)FieldValue;
            break;
        case 55: //blockNAtkMult
            CSAD.value.blockNAtkMult = *(float *)FieldValue;
            break;
        case 56: //atkMult
            CSAD.value.atkMult = *(float *)FieldValue;
            break;
        case 57: //atkBase
            CSAD.value.atkBase = *(float *)FieldValue;
            break;
        case 58: //atkAtkMult
            CSAD.value.atkAtkMult = *(float *)FieldValue;
            break;
        case 59: //atkNAtkMult
            CSAD.value.atkNAtkMult = *(float *)FieldValue;
            break;
        case 60: //atkBlockMult
            CSAD.value.atkBlockMult = *(float *)FieldValue;
            break;
        case 61: //pAtkFBase
            CSAD.value.pAtkFBase = *(float *)FieldValue;
            break;
        case 62: //pAtkFMult
            CSAD.value.pAtkFMult = *(float *)FieldValue;
            break;
        case 63: //coverRadius
            CSSD.value.coverRadius = *(float *)FieldValue;
            break;
        case 64: //coverChance
            CSSD.value.coverChance = *(float *)FieldValue;
            break;
        case 65: //waitTimerMin
            CSSD.value.waitTimerMin = *(float *)FieldValue;
            break;
        case 66: //waitTimerMax
            CSSD.value.waitTimerMax = *(float *)FieldValue;
            break;
        case 67: //waitFireTimerMin
            CSSD.value.waitFireTimerMin = *(float *)FieldValue;
            break;
        case 68: //waitFireTimerMax
            CSSD.value.waitFireTimerMax = *(float *)FieldValue;
            break;
        case 69: //fireTimerMin
            CSSD.value.fireTimerMin = *(float *)FieldValue;
            break;
        case 70: //fireTimerMax
            CSSD.value.fireTimerMax = *(float *)FieldValue;
            break;
        case 71: //rangedRangeMultMin
            CSSD.value.rangedRangeMultMin = *(float *)FieldValue;
            break;
        case 72: //unused7
            if(ArraySize != 4)
                break;
            CSSD.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            CSSD.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            CSSD.value.unused1[2] = ((UINT8ARRAY)FieldValue)[2];
            CSSD.value.unused1[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 73: //weaponRestrictions
            SetType(*(uint32_t *)FieldValue);
            break;
        case 74: //rangedRangeMultMax
            CSSD.value.rangedRangeMultMax = *(float *)FieldValue;
            break;
        case 75: //targetMaxFOV
            CSSD.value.targetMaxFOV = *(float *)FieldValue;
            break;
        case 76: //combatRadius
            CSSD.value.combatRadius = *(float *)FieldValue;
            break;
        case 77: //semiAutoFireDelayMultMin
            CSSD.value.semiAutoFireDelayMultMin = *(float *)FieldValue;
            break;
        case 78: //semiAutoFireDelayMultMax
            CSSD.value.semiAutoFireDelayMultMax = *(float *)FieldValue;
            break;
        default:
            break;
        }
    return false;
    }
예제 #21
0
bool ENCHRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, uint32_t ArraySize)
{
    switch(FieldID)
    {
    case 1: //flags1
        SetHeaderFlagMask(*(uint32_t *)FieldValue);
        break;
    case 3: //versionControl1
        if(ArraySize != 4)
            break;
        ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
        ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
        ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
        ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
        break;
    case 4: //eid
        EDID.Copy((char *)FieldValue);
        break;
    case 5: //formVersion
        formVersion = *(uint16_t *)FieldValue;
        break;
    case 6: //versionControl2
        if(ArraySize != 2)
            break;
        versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
        versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
        break;
    case 7: //full
        FULL.Copy((char *)FieldValue);
        break;
    case 8: //itemType
        SetType(*(uint32_t *)FieldValue);
        break;
    case 9: //chargeAmountUnused
        ENIT.value.chargeAmount = *(uint32_t *)FieldValue;
        break;
    case 10: //enchantCostUnused
        ENIT.value.enchantCost = *(uint32_t *)FieldValue;
        break;
    case 11: //flags
        SetFlagMask(*(uint8_t *)FieldValue);
        break;
    case 12: //unused1
        if(ArraySize != 3)
            break;
        ENIT.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
        ENIT.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
        ENIT.value.unused1[2] = ((UINT8ARRAY)FieldValue)[2];
        break;
    case 13: //effects
        if(ListFieldID == 0) //effectsSize
        {
            Effects.resize(ArraySize);
            return false;
        }

        if(ListIndex >= Effects.value.size())
            break;

        switch(ListFieldID)
        {
        case 1: //effect
            Effects.value[ListIndex]->EFID.value = *(FORMID *)FieldValue;
            return true;
        case 2: //magnitude
            Effects.value[ListIndex]->EFIT.value.magnitude = *(uint32_t *)FieldValue;
            break;
        case 3: //area
            Effects.value[ListIndex]->EFIT.value.area = *(uint32_t *)FieldValue;
            break;
        case 4: //duration
            Effects.value[ListIndex]->EFIT.value.duration = *(uint32_t *)FieldValue;
            break;
        case 5: //rangeType
            Effects.value[ListIndex]->SetRange(*(uint32_t *)FieldValue);
            break;
        case 6: //actorValue
            Effects.value[ListIndex]->EFIT.value.actorValue = *(int32_t *)FieldValue;
            break;
        case 7: //conditions
            if(ListX2FieldID == 0) //conditionsSize
            {
                Effects.value[ListIndex]->CTDA.resize(ArraySize);
                return false;
            }

            if(ListX2Index >= Effects.value[ListIndex]->CTDA.value.size())
                break;

            switch(ListX2FieldID)
            {
            case 1: //operType
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->operType = *(uint8_t *)FieldValue;
                break;
            case 2: //unused1
                if(ArraySize != 3)
                    break;
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[2] = ((UINT8ARRAY)FieldValue)[2];
                break;
            case 3: //compValue
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->compValue = *(FORMID_OR_FLOAT32 *)FieldValue;
                return true;
            case 4: //ifunc
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->ifunc = *(uint32_t *)FieldValue;
                return true;
            case 5: //param1
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->param1 = *(FORMID_OR_UINT32 *)FieldValue;
                return true;
            case 6: //param2
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->param2 = *(FORMID_OR_UINT32 *)FieldValue;
                return true;
            case 7: //runOnType
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->runOnType = *(uint32_t *)FieldValue;
                return true;
            case 8: //reference
                Effects.value[ListIndex]->CTDA.value[ListX2Index]->reference = *(FORMID_OR_UINT32 *)FieldValue;
                return true;
            default:
                break;
            }
            break;
        default:
            break;
        }
        break;
    default:
        break;
    }
    return false;
}
예제 #22
0
void CSTYRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    CSTYCSTD defaultCSTD;
    CSTYCSAD defaultCSAD;
    CSTYCSSD defaultCSSD;
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //dodgeChance
            CSTD.value.dodgeChance = defaultCSTD.dodgeChance;
            return;
        case 8: //lrChance
            CSTD.value.lrChance = defaultCSTD.lrChance;
            return;
        case 9: //unused1
            CSTD.value.unused1[0] = defaultCSTD.unused1[0];
            CSTD.value.unused1[1] = defaultCSTD.unused1[1];
            return;
        case 10: //lrTimerMin
            CSTD.value.lrTimerMin = defaultCSTD.lrTimerMin;
            return;
        case 11: //lrTimerMax
            CSTD.value.lrTimerMax = defaultCSTD.lrTimerMax;
            return;
        case 12: //forTimerMin
            CSTD.value.forTimerMin = defaultCSTD.forTimerMin;
            return;
        case 13: //forTimerMax
            CSTD.value.forTimerMax = defaultCSTD.forTimerMax;
            return;
        case 14: //backTimerMin
            CSTD.value.backTimerMin = defaultCSTD.backTimerMin;
            return;
        case 15: //backTimerMax
            CSTD.value.backTimerMax = defaultCSTD.backTimerMax;
            return;
        case 16: //idleTimerMin
            CSTD.value.idleTimerMin = defaultCSTD.idleTimerMin;
            return;
        case 17: //idleTimerMax
            CSTD.value.idleTimerMax = defaultCSTD.idleTimerMax;
            return;
        case 18: //blkChance
            CSTD.value.blkChance = defaultCSTD.blkChance;
            return;
        case 19: //atkChance
            CSTD.value.atkChance = defaultCSTD.atkChance;
            return;
        case 20: //unused2
            CSTD.value.unused2[0] = defaultCSTD.unused2[0];
            CSTD.value.unused2[1] = defaultCSTD.unused2[1];
            return;
        case 21: //atkBRecoil
            CSTD.value.atkBRecoil = defaultCSTD.atkBRecoil;
            return;
        case 22: //atkBUnc
            CSTD.value.atkBUnc = defaultCSTD.atkBUnc;
            return;
        case 23: //atkBh2h
            CSTD.value.atkBh2h = defaultCSTD.atkBh2h;
            return;
        case 24: //pAtkChance
            CSTD.value.pAtkChance = defaultCSTD.pAtkChance;
            return;
        case 25: //unused3
            CSTD.value.unused3[0] = defaultCSTD.unused3[0];
            CSTD.value.unused3[1] = defaultCSTD.unused3[1];
            CSTD.value.unused3[2] = defaultCSTD.unused3[2];
            return;
        case 26: //pAtkBRecoil
            CSTD.value.pAtkBRecoil = defaultCSTD.pAtkBRecoil;
            return;
        case 27: //pAtkBUnc
            CSTD.value.pAtkBUnc = defaultCSTD.pAtkBUnc;
            return;
        case 28: //pAtkNormal
            CSTD.value.pAtkNormal = defaultCSTD.pAtkNormal;
            return;
        case 29: //pAtkFor
            CSTD.value.pAtkFor = defaultCSTD.pAtkFor;
            return;
        case 30: //pAtkBack
            CSTD.value.pAtkBack = defaultCSTD.pAtkBack;
            return;
        case 31: //pAtkL
            CSTD.value.pAtkL = defaultCSTD.pAtkL;
            return;
        case 32: //pAtkR
            CSTD.value.pAtkR = defaultCSTD.pAtkR;
            return;
        case 33: //unused4
            CSTD.value.unused4[0] = defaultCSTD.unused4[0];
            CSTD.value.unused4[1] = defaultCSTD.unused4[1];
            CSTD.value.unused4[2] = defaultCSTD.unused4[2];
            return;
        case 34: //holdTimerMin
            CSTD.value.holdTimerMin = defaultCSTD.holdTimerMin;
            return;
        case 35: //holdTimerMax
            CSTD.value.holdTimerMax = defaultCSTD.holdTimerMax;
            return;
        case 36: //flags
            SetFlagMask(defaultCSTD.flags);
            return;
        case 37: //unused5
            CSTD.value.unused5[0] = defaultCSTD.unused5[0];
            CSTD.value.unused5[1] = defaultCSTD.unused5[1];
            return;
        case 38: //acroDodge
            CSTD.value.acroDodge = defaultCSTD.acroDodge;
            return;
        case 39: //rushChance
            CSTD.value.rushChance = defaultCSTD.rushChance;
            return;
        case 40: //unused6
            CSTD.value.unused6[0] = defaultCSTD.unused6[0];
            CSTD.value.unused6[1] = defaultCSTD.unused6[1];
            return;
        case 41: //rushMult
            CSTD.value.rushMult = defaultCSTD.rushMult;
            return;
        case 42: //dodgeFMult
            CSAD.value.dodgeFMult = defaultCSAD.dodgeFMult;
            return;
        case 43: //dodgeFBase
            CSAD.value.dodgeFBase = defaultCSAD.dodgeFBase;
            return;
        case 44: //encSBase
            CSAD.value.encSBase = defaultCSAD.encSBase;
            return;
        case 45: //encSMult
            CSAD.value.encSMult = defaultCSAD.encSMult;
            return;
        case 46: //dodgeAtkMult
            CSAD.value.dodgeAtkMult = defaultCSAD.dodgeAtkMult;
            return;
        case 47: //dodgeNAtkMult
            CSAD.value.dodgeNAtkMult = defaultCSAD.dodgeNAtkMult;
            return;
        case 48: //dodgeBAtkMult
            CSAD.value.dodgeBAtkMult = defaultCSAD.dodgeBAtkMult;
            return;
        case 49: //dodgeBNAtkMult
            CSAD.value.dodgeBNAtkMult = defaultCSAD.dodgeBNAtkMult;
            return;
        case 50: //dodgeFAtkMult
            CSAD.value.dodgeFAtkMult = defaultCSAD.dodgeFAtkMult;
            return;
        case 51: //dodgeFNAtkMult
            CSAD.value.dodgeFNAtkMult = defaultCSAD.dodgeFNAtkMult;
            return;
        case 52: //blockMult
            CSAD.value.blockMult = defaultCSAD.blockMult;
            return;
        case 53: //blockBase
            CSAD.value.blockBase = defaultCSAD.blockBase;
            return;
        case 54: //blockAtkMult
            CSAD.value.blockAtkMult = defaultCSAD.blockAtkMult;
            return;
        case 55: //blockNAtkMult
            CSAD.value.blockNAtkMult = defaultCSAD.blockNAtkMult;
            return;
        case 56: //atkMult
            CSAD.value.atkMult = defaultCSAD.atkMult;
            return;
        case 57: //atkBase
            CSAD.value.atkBase = defaultCSAD.atkBase;
            return;
        case 58: //atkAtkMult
            CSAD.value.atkAtkMult = defaultCSAD.atkAtkMult;
            return;
        case 59: //atkNAtkMult
            CSAD.value.atkNAtkMult = defaultCSAD.atkNAtkMult;
            return;
        case 60: //atkBlockMult
            CSAD.value.atkBlockMult = defaultCSAD.atkBlockMult;
            return;
        case 61: //pAtkFBase
            CSAD.value.pAtkFBase = defaultCSAD.pAtkFBase;
            return;
        case 62: //pAtkFMult
            CSAD.value.pAtkFMult = defaultCSAD.pAtkFMult;
            return;
        case 63: //coverRadius
            CSSD.value.coverRadius = defaultCSSD.coverRadius;
            return;
        case 64: //coverChance
            CSSD.value.coverChance = defaultCSSD.coverChance;
            return;
        case 65: //waitTimerMin
            CSSD.value.waitTimerMin = defaultCSSD.waitTimerMin;
            return;
        case 66: //waitTimerMax
            CSSD.value.waitTimerMax = defaultCSSD.waitTimerMax;
            return;
        case 67: //waitFireTimerMin
            CSSD.value.waitFireTimerMin =defaultCSSD.waitFireTimerMin;
            break;
        case 68: //waitFireTimerMax
            CSSD.value.waitFireTimerMax = defaultCSSD.waitFireTimerMax;
            break;
        case 69: //fireTimerMin
            CSSD.value.fireTimerMin = defaultCSSD.fireTimerMin;
            return;
        case 70: //fireTimerMax
            CSSD.value.fireTimerMax = defaultCSSD.fireTimerMax;
            return;
        case 71: //rangedRangeMultMin
            CSSD.value.rangedRangeMultMin = defaultCSSD.rangedRangeMultMin;
            return;
        case 72: //unused7
            CSSD.value.unused1[0] = defaultCSSD.unused1[0];
            CSSD.value.unused1[1] = defaultCSSD.unused1[1];
            CSSD.value.unused1[2] = defaultCSSD.unused1[2];
            CSSD.value.unused1[3] = defaultCSSD.unused1[3];
            return;
        case 73: //weaponRestrictions
            SetType(defaultCSSD.weaponRestrictions);
            return;
        case 74: //rangedRangeMultMax
            CSSD.value.rangedRangeMultMax = defaultCSSD.rangedRangeMultMax;
            return;
        case 75: //targetMaxFOV
            CSSD.value.targetMaxFOV = defaultCSSD.targetMaxFOV;
            return;
        case 76: //combatRadius
            CSSD.value.combatRadius = defaultCSSD.combatRadius;
            return;
        case 77: //semiAutoFireDelayMultMin
            CSSD.value.semiAutoFireDelayMultMin = defaultCSSD.semiAutoFireDelayMultMin;
            return;
        case 78: //semiAutoFireDelayMultMax
            CSSD.value.semiAutoFireDelayMultMax = defaultCSSD.semiAutoFireDelayMultMax;
            return;
        default:
            return;
        }
    }
예제 #23
0
bool CHIPRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, uint32_t ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(uint32_t *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((char *)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(uint16_t *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //boundX
            OBND.Load();
            OBND->x1 = *(int16_t *)FieldValue;
            break;
        case 8: //boundY
            OBND.Load();
            OBND->y1 = *(int16_t *)FieldValue;
            break;
        case 9: //boundZ
            OBND.Load();
            OBND->z1 = *(int16_t *)FieldValue;
            break;
        case 10: //full
            FULL.Copy((char *)FieldValue);
            break;
        case 11: //modPath
            MODL.Load();
            MODL->MODL.Copy((char *)FieldValue);
            break;
        case 12: //modb
            MODL.Load();
            MODL->MODB.value = *(float *)FieldValue;
            break;
        case 13: //modt_p
            MODL.Load();
            MODL->MODT.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 14: //mods Alternate Textures
            MODL.Load();
            //MODL->Textures.MODS.Copy((char *)FieldValue);
            break;
        case 15: //mods Alternate Textures
            MODL.Load();
            //MODL->Textures.MODS.Load();
            //MODL->Textures.MODS->value15 = *(FORMID *)FieldValue;
            return true;
        case 16: //mods Alternate Textures
            MODL.Load();
            //MODL->Textures.MODS.Load();
            //MODL->Textures.MODS->value16 = *(int32_t *)FieldValue;
            break;
        case 17: //modelFlags
            MODL.Load();
            MODL->MODD.Load();
            MODL->MODD.value = *(uint8_t *)FieldValue;
            break;
        case 18: //iconPath
            ICON.Copy((char *)FieldValue);
            break;
        case 19: //smallIconPath
            MICO.Copy((char *)FieldValue);
            break;
        case 20: //dest Header
            Destructable.Load();
            Destructable->DEST.Load();
            Destructable->DEST->health = *(int32_t *)FieldValue;
            break;
        case 21: //dest Header
            Destructable.Load();
            Destructable->DEST.Load();
            Destructable->DEST->count = *(uint8_t *)FieldValue;
            break;
        case 22: //dest Header
            Destructable.Load();
            Destructable->DEST.Load();
            Destructable->DEST->flags = *(uint8_t *)FieldValue;
            break;
        case 23: //dest_p Header
            if(ArraySize != 2)
                break;
            Destructable.Load();
            Destructable->DEST.Load();
            Destructable->DEST->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            Destructable->DEST->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 24: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->health = *(uint8_t *)FieldValue;
            break;
        case 25: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->index = *(uint8_t *)FieldValue;
            break;
        case 26: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->stage = *(uint8_t *)FieldValue;
            break;
        case 27: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->flags = *(uint8_t *)FieldValue;
            break;
        case 28: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->dps = *(int32_t *)FieldValue;
            break;
        case 29: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->explosion = *(FORMID *)FieldValue;
            return true;
        case 30: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->debris = *(FORMID *)FieldValue;
            return true;
        case 31: //dstd Destruction Stage Data
            Destructable.Load();
            Destructable->Stages.value[0]->DSTD.Load();
            Destructable->Stages.value[0]->DSTD->debrisCount = *(int32_t *)FieldValue;
            break;
        case 32: //dmdl Model Filename
            Destructable.Load();
            Destructable->Stages.value[0]->DMDL.Copy((char *)FieldValue);
            break;
        case 33: //dmdt_p Texture Files Hashes
            Destructable.Load();
            Destructable->Stages.value[0]->DMDT.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 34: //ynam Sound - Pick Up
            YNAM.Load();
            YNAM.value = *(FORMID *)FieldValue;
            return true;
        case 35: //znam Sound - Drop
            ZNAM.Load();
            ZNAM.value = *(FORMID *)FieldValue;
            return true;
        default:
            break;
        }
    return false;
    }
예제 #24
0
bool BOOKRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 3: //flags2
            SetHeaderUnknownFlagMask(*(UINT32 *)FieldValue);
            break;
        case 4: //eid
            EDID.Copy((STRING)FieldValue);
            break;
        case 5: //full
            FULL.Copy((STRING)FieldValue);
            break;
        case 6: //modPath
            MODL.Load();
            MODL->MODL.Copy((STRING)FieldValue);
            break;
        case 7: //modb
            MODL.Load();
            MODL->MODB.value = *(FLOAT32 *)FieldValue;
            break;
        case 8: //modt_p
            MODL.Load();
            MODL->MODT.Load();
            MODL->MODT.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 9: //iconPath
            ICON.Copy((STRING)FieldValue);
            break;
        case 10: //text
            DESC.Copy((STRING)FieldValue);
            break;
        case 11: //script
            SCRI.value = *(FORMID *)FieldValue;
            return true;
        case 12: //enchantment
            ENAM.value = *(FORMID *)FieldValue;
            return true;
        case 13: //enchantPoints
            ANAM.value = *(UINT16 *)FieldValue;
            break;
        case 14: //flags
            SetFlagMask(*(UINT8 *)FieldValue);
            break;
        case 15: //teaches
            DATA.value.teaches = *(SINT8 *)FieldValue;
            break;
        case 16: //value
            DATA.value.value = *(UINT32 *)FieldValue;
            break;
        case 17: //weight
            DATA.value.weight = *(FLOAT32 *)FieldValue;
            break;
        default:
            break;
        }
    return false;
    }
예제 #25
0
bool MGEFRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 2: //fid
            formID = *(FORMID *)FieldValue;
            break;
        case 3: //flags2
            SetHeaderUnknownFlagMask(*(UINT32 *)FieldValue);
            break;
        case 4: //eid
            EDID.Copy((STRING)FieldValue);
            break;
        case 5: //full
            FULL.Copy((STRING)FieldValue);
            break;
        case 6: //text
            DESC.Copy((STRING)FieldValue);
            break;
        case 7: //iconPath
            ICON.Copy((STRING)FieldValue);
            break;
        case 8: //modPath
            MODL.Load();
            MODL->MODL.Copy((STRING)FieldValue);
            break;
        case 9: //modb
            MODL.Load();
            MODL->MODB.value = *(FLOAT32 *)FieldValue;
            break;
        case 10: //modt_p
            MODL.Load();
            MODL->MODT.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 11: //flags
            SetFlagMask(*(UINT32 *)FieldValue);
            break;
        case 12: //baseCost
            DATA.value.baseCost = *(FLOAT32 *)FieldValue;
            break;
        case 13: //associated
            DATA.value.associated = *(FORMID_OR_MGEFCODE_OR_ACTORVALUE_OR_UINT32 *)FieldValue;
            return true;
        case 14: //school
            DATA.value.schoolType = *(UINT32 *)FieldValue;
            break;
        case 15: //resistValue
            DATA.value.resistValue = *(FORMID *)FieldValue;
            return true;
        case 16: //numCounters
            DATA.value.numCounters = *(UINT16 *)FieldValue;
            ESCE.value.resize(*(UINT16 *)FieldValue);
            break;
        case 17: //unused1
            if(ArraySize != 2)
                break;
            DATA.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            DATA.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 18: //light
            DATA.value.light = *(FORMID *)FieldValue;
            return true;
        case 19: //projectileSpeed
            DATA.value.projectileSpeed = *(FLOAT32 *)FieldValue;
            break;
        case 20: //effectShader
            DATA.value.effectShader = *(FORMID *)FieldValue;
            return true;
        case 21: //enchantEffect
            DATA.value.enchantEffect = *(FORMID *)FieldValue;
            return true;
        case 22: //castingSound
            DATA.value.castingSound = *(FORMID *)FieldValue;
            return true;
        case 23: //boltSound
            DATA.value.boltSound = *(FORMID *)FieldValue;
            return true;
        case 24: //hitSound
            DATA.value.hitSound = *(FORMID *)FieldValue;
            return true;
        case 25: //areaSound
            DATA.value.areaSound = *(FORMID *)FieldValue;
            return true;
        case 26: //cefEnchantment
            DATA.value.cefEnchantment = *(FLOAT32 *)FieldValue;
            break;
        case 27: //cefBarter
            DATA.value.cefBarter = *(FLOAT32 *)FieldValue;
            break;
        case 28: //counterEffects
            ESCE.resize(ArraySize);
            for(UINT32 x = 0; x < ArraySize; x++)
                ESCE.value[x] = ((MGEFCODEARRAY)FieldValue)[x];
            return true;
        //OBME Fields
        case 29: //recordVersion
            OBME.Load();
            OBME->OBME.value.recordVersion = *(UINT8 *)FieldValue;
            break;
        case 30: //betaVersion
            OBME.Load();
            OBME->OBME.value.betaVersion = *(UINT8 *)FieldValue;
            break;
        case 31: //minorVersion
            OBME.Load();
            OBME->OBME.value.minorVersion = *(UINT8 *)FieldValue;
            break;
        case 32: //majorVersion
            OBME.Load();
            OBME->OBME.value.majorVersion = *(UINT8 *)FieldValue;
            break;
        case 33: //mgefParamAInfo
            OBME.Load();
            OBME->OBME.value.mgefParamAInfo = *(UINT8 *)FieldValue;
            return true;
        case 34: //mgefParamBInfo
            OBME.Load();
            OBME->OBME.value.mgefParamBInfo = *(UINT8 *)FieldValue;
            return true;
        case 35: //reserved1
            if(ArraySize != 0x2)
                break;
            OBME.Load();
            OBME->OBME.value.reserved1[0] = ((UINT8ARRAY)FieldValue)[0];
            OBME->OBME.value.reserved1[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 36: //handlerCode
            OBME.Load();
            OBME->OBME.value.handlerCode = *(UINT32 *)FieldValue;
            break;
        case 37: //OBMEFlags
            SetOBMEFlagMask(*(UINT32 *)FieldValue);
            break;
        case 38: //mgefParamB
            OBME.Load();
            OBME->OBME.value.mgefParamB = *(FORMID_OR_MGEFCODE_OR_ACTORVALUE_OR_UINT32 *)FieldValue;
            return true;
        case 39: //reserved2
            if(ArraySize != 0x1C)
                break;
            OBME.Load();
            memcpy(&OBME->OBME.value.reserved2[0], &((UINT8ARRAY)FieldValue)[0], sizeof(OBME->OBME.value.reserved2));
            break;
        case 40: //mgefCode
            OBME.Load();
            OBME->EDDX.Load();
            memcpy(&OBME->EDDX.value.mgefCode[0], FieldValue, sizeof(OBME->EDDX.value.mgefCode) - 1);
            OBME->EDDX.value.mgefCode[4] = 0;
            return true;
        case 41: //datx_p
            if(ArraySize != 0x20)
                break;
            OBME.Load();
            OBME->DATX.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        default:
            break;
        }
    return false;
    }
예제 #26
0
void BOOKRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    BOOKDATA defaultDATA;

    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //flags2
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //full
            FULL.Unload();
            return;
        case 6: //modPath
            if(MODL.IsLoaded())
                MODL->MODL.Unload();
            return;
        case 7: //modb
            if(MODL.IsLoaded())
                MODL->MODB.Unload();
            return;
        case 8: //modt_p
            if(MODL.IsLoaded())
                MODL->MODT.Unload();
            return;
        case 9: //iconPath
            ICON.Unload();
            return;
        case 10: //text
            DESC.Unload();
            return;
        case 11: //script
            SCRI.Unload();
            return;
        case 12: //enchantment
            ENAM.Unload();
            return;
        case 13: //enchantPoints
            ANAM.Unload();
            return;
        case 14: //flags
            DATA.value.flags = defaultDATA.flags;
            return;
        case 15: //teaches
            DATA.value.teaches = defaultDATA.teaches;
            return;
        case 16: //value
            DATA.value.value = defaultDATA.value;
            return;
        case 17: //weight
            DATA.value.weight = defaultDATA.weight;
            return;
        default:
            return;
        }
    return;
    }
예제 #27
0
bool PCBERecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, uint32_t ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(uint32_t *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((char *)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(uint16_t *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //base
            NAME.value = *(FORMID *)FieldValue;
            return true;
        case 8: //encounterZone
            XEZN.value = *(FORMID *)FieldValue;
            return true;
        case 9: //xrgd_p
            XRGD.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 10: //xrgb_p
            XRGB.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 11: //idleTime
            Patrol.Load();
            Patrol->XPRD.value = *(float *)FieldValue;
            break;
        case 12: //idle
            Patrol.Load();
            Patrol->INAM.value = *(FORMID *)FieldValue;
            return true;
        case 13: //unused1
            if(ArraySize != 4)
                break;
            Patrol.Load();
            Patrol->SCHR.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            Patrol->SCHR.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            Patrol->SCHR.value.unused1[2] = ((UINT8ARRAY)FieldValue)[2];
            Patrol->SCHR.value.unused1[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 14: //numRefs
            Patrol.Load();
            Patrol->SCHR.value.numRefs = *(uint32_t *)FieldValue;
            break;
        case 15: //compiledSize
            Patrol.Load();
            Patrol->SCHR.value.compiledSize = *(uint32_t *)FieldValue;
            break;
        case 16: //lastIndex
            Patrol.Load();
            Patrol->SCHR.value.lastIndex = *(uint32_t *)FieldValue;
            break;
        case 17: //scriptType
            Patrol.Load();
            Patrol->SetType(*(uint16_t *)FieldValue);
            break;
        case 18: //scriptFlags
            Patrol.Load();
            Patrol->SetScriptFlagMask(*(uint16_t *)FieldValue);
            break;
        case 19: //compiled_p
            Patrol.Load();
            Patrol->SCDA.Copy((UINT8ARRAY)FieldValue, ArraySize);
            Patrol->SCHR.value.compiledSize = ArraySize;
            break;
        case 20: //scriptText
            Patrol.Load();
            Patrol->SCTX.Copy((char *)FieldValue);
            break;
        case 21: //vars
            Patrol.Load();
            if(ListFieldID == 0) //varsSize
                {
                Patrol->VARS.resize(ArraySize);
                return false;
                }

            if(ListIndex >= Patrol->VARS.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //index
                    Patrol->VARS.value[ListIndex]->SLSD.value.index = *(uint32_t *)FieldValue;
                    break;
                case 2: //unused1
                    if(ArraySize != 12)
                        break;
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[0] = ((UINT8ARRAY)FieldValue)[0];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[1] = ((UINT8ARRAY)FieldValue)[1];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[2] = ((UINT8ARRAY)FieldValue)[2];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[3] = ((UINT8ARRAY)FieldValue)[3];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[4] = ((UINT8ARRAY)FieldValue)[4];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[5] = ((UINT8ARRAY)FieldValue)[5];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[6] = ((UINT8ARRAY)FieldValue)[6];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[7] = ((UINT8ARRAY)FieldValue)[7];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[8] = ((UINT8ARRAY)FieldValue)[8];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[9] = ((UINT8ARRAY)FieldValue)[9];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[10] = ((UINT8ARRAY)FieldValue)[10];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused1[11] = ((UINT8ARRAY)FieldValue)[11];
                    break;
                case 3: //flags
                    Patrol->VARS.value[ListIndex]->SetFlagMask(*(uint8_t *)FieldValue);
                    break;
                case 4: //unused2
                    if(ArraySize != 7)
                        break;
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[0] = ((UINT8ARRAY)FieldValue)[0];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[1] = ((UINT8ARRAY)FieldValue)[1];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[2] = ((UINT8ARRAY)FieldValue)[2];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[3] = ((UINT8ARRAY)FieldValue)[3];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[4] = ((UINT8ARRAY)FieldValue)[4];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[5] = ((UINT8ARRAY)FieldValue)[5];
                    Patrol->VARS.value[ListIndex]->SLSD.value.unused2[6] = ((UINT8ARRAY)FieldValue)[6];
                    break;
                case 5: //name
                    Patrol->VARS.value[ListIndex]->SCVR.Copy((char *)FieldValue);
                    break;
                default:
                    break;
                }
            break;
        case 22: //references
            Patrol.Load();
            if(ListFieldID == 0) //referencesSize
                {
                Patrol->SCR_.resize(ArraySize);
                return false;
                }

            if(ListIndex >= Patrol->SCR_.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //reference
                    //Borrowing ArraySize to flag if the new value is a formID
                    Patrol->SCR_.value[ListIndex]->reference = *(uint32_t *)FieldValue;
                    Patrol->SCR_.value[ListIndex]->isSCRO = ArraySize ? true : false;
                    return ArraySize != 0;
                default:
                    break;
                }
            break;
        case 23: //topic
            Patrol.Load();
            Patrol->TNAM.value = *(FORMID *)FieldValue;
            return true;
        case 24: //owner
            Ownership.Load();
            Ownership->XOWN.value = *(FORMID *)FieldValue;
            return true;
        case 25: //rank
            Ownership.Load();
            *Ownership->XRNK.value = *(int32_t *)FieldValue;
            break;
        case 26: //count
            XCNT.value = *(int32_t *)FieldValue;
            break;
        case 27: //radius
            XRDS.value = *(float *)FieldValue;
            break;
        case 28: //health
            XHLP.value = *(float *)FieldValue;
            break;
        case 29: //decals
            if(ListFieldID == 0) //decalsSize
                {
                XDCR.resize(ArraySize);
                return false;
                }

            if(ListIndex >= XDCR.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //reference
                    XDCR.value[ListIndex]->reference = *(FORMID *)FieldValue;
                    return true;
                case 2: //unknown1
                    if(ArraySize != 24)
                        break;
                    XDCR.value[ListIndex]->unknown1[0] = ((UINT8ARRAY)FieldValue)[0];
                    XDCR.value[ListIndex]->unknown1[1] = ((UINT8ARRAY)FieldValue)[1];
                    XDCR.value[ListIndex]->unknown1[2] = ((UINT8ARRAY)FieldValue)[2];
                    XDCR.value[ListIndex]->unknown1[3] = ((UINT8ARRAY)FieldValue)[3];
                    XDCR.value[ListIndex]->unknown1[4] = ((UINT8ARRAY)FieldValue)[4];
                    XDCR.value[ListIndex]->unknown1[5] = ((UINT8ARRAY)FieldValue)[5];
                    XDCR.value[ListIndex]->unknown1[6] = ((UINT8ARRAY)FieldValue)[6];
                    XDCR.value[ListIndex]->unknown1[7] = ((UINT8ARRAY)FieldValue)[7];
                    XDCR.value[ListIndex]->unknown1[8] = ((UINT8ARRAY)FieldValue)[8];
                    XDCR.value[ListIndex]->unknown1[9] = ((UINT8ARRAY)FieldValue)[9];
                    XDCR.value[ListIndex]->unknown1[10] = ((UINT8ARRAY)FieldValue)[10];
                    XDCR.value[ListIndex]->unknown1[11] = ((UINT8ARRAY)FieldValue)[11];
                    XDCR.value[ListIndex]->unknown1[12] = ((UINT8ARRAY)FieldValue)[12];
                    XDCR.value[ListIndex]->unknown1[13] = ((UINT8ARRAY)FieldValue)[13];
                    XDCR.value[ListIndex]->unknown1[14] = ((UINT8ARRAY)FieldValue)[14];
                    XDCR.value[ListIndex]->unknown1[15] = ((UINT8ARRAY)FieldValue)[15];
                    XDCR.value[ListIndex]->unknown1[16] = ((UINT8ARRAY)FieldValue)[16];
                    XDCR.value[ListIndex]->unknown1[17] = ((UINT8ARRAY)FieldValue)[17];
                    XDCR.value[ListIndex]->unknown1[18] = ((UINT8ARRAY)FieldValue)[18];
                    XDCR.value[ListIndex]->unknown1[19] = ((UINT8ARRAY)FieldValue)[19];
                    XDCR.value[ListIndex]->unknown1[20] = ((UINT8ARRAY)FieldValue)[20];
                    XDCR.value[ListIndex]->unknown1[21] = ((UINT8ARRAY)FieldValue)[21];
                    XDCR.value[ListIndex]->unknown1[22] = ((UINT8ARRAY)FieldValue)[22];
                    XDCR.value[ListIndex]->unknown1[23] = ((UINT8ARRAY)FieldValue)[23];
                    break;
                default:
                    break;
                }
            break;
        case 30: //linkedReference
            XLKR.value = *(FORMID *)FieldValue;
            return true;
        case 31: //startRed
            XCLP.Load();
            XCLP->start.red = *(uint8_t *)FieldValue;
            break;
        case 32: //startGreen
            XCLP.Load();
            XCLP->start.green = *(uint8_t *)FieldValue;
            break;
        case 33: //startBlue
            XCLP.Load();
            XCLP->start.blue = *(uint8_t *)FieldValue;
            break;
        case 34: //unused2
            if(ArraySize != 1)
                break;
            XCLP.Load();
            XCLP->start.unused1 = ((UINT8ARRAY)FieldValue)[0];
            break;
        case 35: //endRed
            XCLP.Load();
            XCLP->end.red = *(uint8_t *)FieldValue;
            break;
        case 36: //endGreen
            XCLP.Load();
            XCLP->end.green = *(uint8_t *)FieldValue;
            break;
        case 37: //endBlue
            XCLP.Load();
            XCLP->end.blue = *(uint8_t *)FieldValue;
            break;
        case 38: //unused3
            if(ArraySize != 1)
                break;
            XCLP.Load();
            XCLP->end.unused1 = ((UINT8ARRAY)FieldValue)[0];
            break;
        case 39: //activateParentFlags
            ActivateParents.Load();
            ActivateParents->SetFlagMask(*(uint8_t *)FieldValue);
            break;
        case 40: //activateParentRefs
            ActivateParents.Load();
            if(ListFieldID == 0) //activateParentRefsSize
                {
                ActivateParents->XAPR.resize(ArraySize);
                return false;
                }

            if(ListIndex >= ActivateParents->XAPR.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //reference
                    ActivateParents->XAPR.value[ListIndex]->reference = *(FORMID *)FieldValue;
                    return true;
                case 2: //delay
                    ActivateParents->XAPR.value[ListIndex]->delay = *(float *)FieldValue;
                    break;
                default:
                    break;
                }
            break;
        case 41: //prompt
            XATO.Copy((char *)FieldValue);
            break;
        case 42: //parent
            XESP.Load();
            XESP->parent = *(FORMID *)FieldValue;
            return true;
        case 43: //parentFlags
            SetFlagMask(*(uint8_t *)FieldValue);
            break;
        case 44: //unused4
            if(ArraySize != 3)
                break;
            XESP.Load();
            XESP->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            XESP->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            XESP->unused1[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 45: //emittance
            XEMI.value = *(FORMID *)FieldValue;
            return true;
        case 46: //boundRef
            XMBR.value = *(FORMID *)FieldValue;
            return true;
        case 47: //reflrefrs
            if(ListFieldID == 0) //reflrefrsSize
                {
                XPWR.resize(ArraySize);
                return false;
                }

            if(ListIndex >= XPWR.value.size())
                break;

            switch(ListFieldID)
                {
                case 1: //reference
                    XPWR.value[ListIndex]->reference = *(FORMID *)FieldValue;
                    return true;
                case 2: //type
                    XPWR.value[ListIndex]->type = *(uint32_t *)FieldValue;
                    break;
                default:
                    break;
                }
            break;
        case 48: //ignoredBySandbox
            XIBS.value = *(uint8_t *)FieldValue;
            break;
        case 49: //scale
            XSCL.value = *(float *)FieldValue;
            break;
        case 50: //posX
            DATA.value.posX = *(float *)FieldValue;
            break;
        case 51: //posY
            DATA.value.posY = *(float *)FieldValue;
            break;
        case 52: //posZ
            DATA.value.posZ = *(float *)FieldValue;
            break;
        case 53: //rotX
            DATA.value.rotX = *(float *)FieldValue;
            break;
        case 54: //rotY
            DATA.value.rotY = *(float *)FieldValue;
            break;
        case 55: //rotZ
            DATA.value.rotZ = *(float *)FieldValue;
            break;
        default:
            break;
        }
    return false;
    }
예제 #28
0
bool ACHRRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 3: //flags2
            SetHeaderUnknownFlagMask(*(UINT32 *)FieldValue);
            break;
        case 4: //eid
            EDID.Copy((STRING)FieldValue);
            break;
        case 5: //base
            NAME.value = *(FORMID *)FieldValue;
            return true;
        case 6: //unknownXPCIFormID
            XPCI.Load();
            XPCI->XPCI.value = *(FORMID *)FieldValue;
            return true;
        case 7: //unknownXPCIString
            XPCI.Load();
            XPCI->FULL.Copy((STRING)FieldValue);
            break;
        case 8: //lod1
            XLOD.Load();
            XLOD->lod1 = *(FLOAT32 *)FieldValue;
            break;
        case 9: //lod2
            XLOD.Load();
            XLOD->lod2 = *(FLOAT32 *)FieldValue;
            break;
        case 10: //lod3
            XLOD.Load();
            XLOD->lod3 = *(FLOAT32 *)FieldValue;
            break;
        case 11: //parent
            XESP.Load();
            XESP->parent = *(FORMID *)FieldValue;
            return true;
        case 12: //parentFlags
            SetFlagMask(*(UINT8 *)FieldValue);
            break;
        case 13: //unused1
            if(ArraySize != 3)
                break;
            XESP.Load();
            XESP->unused1[0] = ((UINT8ARRAY)FieldValue)[0];
            XESP->unused1[1] = ((UINT8ARRAY)FieldValue)[1];
            XESP->unused1[2] = ((UINT8ARRAY)FieldValue)[2];
            break;
        case 14: //merchantContainer
            XMRC.value = *(FORMID *)FieldValue;
            return true;
        case 15: //horse
            XHRS.Load();
            XHRS.value = *(FORMID *)FieldValue;
            return true;
        case 16: //xrgd_p
            XRGD.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 17: //scale
            XSCL.Load();
            XSCL.value = *(FLOAT32 *)FieldValue;
            break;
        case 18: //posX
            DATA.value.posX = *(FLOAT32 *)FieldValue;
            break;
        case 19: //posY
            DATA.value.posY = *(FLOAT32 *)FieldValue;
            break;
        case 20: //posZ
            DATA.value.posZ = *(FLOAT32 *)FieldValue;
            break;
        case 21: //rotX
            DATA.value.rotX = *(FLOAT32 *)FieldValue;
            break;
        case 22: //rotY
            DATA.value.rotY = *(FLOAT32 *)FieldValue;
            break;
        case 23: //rotZ
            DATA.value.rotZ = *(FLOAT32 *)FieldValue;
            break;
        default:
            break;
        }
    return false;
    }
예제 #29
0
bool CMNYRecord::SetField(FIELD_IDENTIFIERS, void *FieldValue, UINT32 ArraySize)
    {
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(*(UINT32 *)FieldValue);
            break;
        case 3: //versionControl1
            if(ArraySize != 4)
                break;
            ((UINT8ARRAY)&flagsUnk)[0] = ((UINT8ARRAY)FieldValue)[0];
            ((UINT8ARRAY)&flagsUnk)[1] = ((UINT8ARRAY)FieldValue)[1];
            ((UINT8ARRAY)&flagsUnk)[2] = ((UINT8ARRAY)FieldValue)[2];
            ((UINT8ARRAY)&flagsUnk)[3] = ((UINT8ARRAY)FieldValue)[3];
            break;
        case 4: //eid
            EDID.Copy((STRING)FieldValue);
            break;
        case 5: //formVersion
            formVersion = *(UINT16 *)FieldValue;
            break;
        case 6: //versionControl2
            if(ArraySize != 2)
                break;
            versionControl2[0] = ((UINT8ARRAY)FieldValue)[0];
            versionControl2[1] = ((UINT8ARRAY)FieldValue)[1];
            break;
        case 7: //boundX
            OBND.Load();
            OBND->x = *(SINT16 *)FieldValue;
            break;
        case 8: //boundY
            OBND.Load();
            OBND->y = *(SINT16 *)FieldValue;
            break;
        case 9: //boundZ
            OBND.Load();
            OBND->z = *(SINT16 *)FieldValue;
            break;
        case 10: //full
            FULL.Copy((STRING)FieldValue);
            break;
        case 11: //modPath
            MODL.Load();
            MODL->MODL.Copy((STRING)FieldValue);
            break;
        case 12: //modb
            MODL.Load();
            MODL->MODB.value = *(FLOAT32 *)FieldValue;
            break;
        case 13: //modt_p
            MODL.Load();
            MODL->MODT.Copy((UINT8ARRAY)FieldValue, ArraySize);
            break;
        case 14: //mods Alternate Textures
            MODL.Load();
            MODL->MODS.Copy((STRING)FieldValue);
            break;
        case 15: //mods Alternate Textures
            MODL.Load();
            MODL->MODS.Load();
            MODL->MODS->value15 = *(FORMID *)FieldValue;
            return true;
        case 16: //mods Alternate Textures
            MODL.Load();
            MODL->MODS.Load();
            MODL->MODS->value16 = *(SINT32 *)FieldValue;
            break;
        case 17: //modelFlags
            MODL.Load();
            MODL->MODD.Load();
            MODL->MODD->value17 = *(UINT8 *)FieldValue;
            break;
        case 18: //iconPath
            ICON.Copy((STRING)FieldValue);
            break;
        case 19: //smallIconPath
            MICO.Copy((STRING)FieldValue);
            break;
        case 20: //ynam Sound - Pick Up
            YNAM.Load();
            YNAM->value20 = *(FORMID *)FieldValue;
            return true;
        case 21: //znam Sound - Drop
            ZNAM.Load();
            ZNAM->value21 = *(FORMID *)FieldValue;
            return true;
        case 22: //data Absolute Value
            DATA.Load();
            DATA->value22 = *(UINT32 *)FieldValue;
            break;
        default:
            break;
        }
    return false;
    }
예제 #30
0
void NAVIRecord::DeleteField(FIELD_IDENTIFIERS)
    {
    NAVINVMI defaultNVMI;
    NAVINVCI defaultNVCI;
    switch(FieldID)
        {
        case 1: //flags1
            SetHeaderFlagMask(0);
            return;
        case 3: //versionControl1
            flagsUnk = 0;
            return;
        case 4: //eid
            EDID.Unload();
            return;
        case 5: //formVersion
            formVersion = 0;
            return;
        case 6: //versionControl2
            versionControl2[0] = 0;
            versionControl2[1] = 0;
            return;
        case 7: //version
            NVER.Unload();
            return;
        case 8: //NVMI
            if(ListFieldID == 0) //NVMISize
                {
                NVMI.Unload();
                return;
                }

            if(ListIndex >= NVMI.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //unknown1
                    NVMI.value[ListIndex]->unknown1[0] = defaultNVMI.unknown1[0];
                    NVMI.value[ListIndex]->unknown1[1] = defaultNVMI.unknown1[1];
                    NVMI.value[ListIndex]->unknown1[2] = defaultNVMI.unknown1[2];
                    NVMI.value[ListIndex]->unknown1[3] = defaultNVMI.unknown1[3];
                    return;
                case 2: //mesh
                    NVMI.value[ListIndex]->mesh = defaultNVMI.mesh;
                    return;
                case 3: //location
                    NVMI.value[ListIndex]->location = defaultNVMI.location;
                    return;
                case 4: //xGrid
                    NVMI.value[ListIndex]->xGrid = defaultNVMI.xGrid;
                    return;
                case 5: //yGrid
                    NVMI.value[ListIndex]->yGrid = defaultNVMI.yGrid;
                    return;
                case 6: //unknown2_p
                    //Not recommended...would make read only, but required for copying one NVMI over another
                    delete []NVMI.value[ListIndex]->unknown2;
                    NVMI.value[ListIndex]->unknown2 = NULL;
                    return;
                default:
                    return;
                }
            return;
        case 9: //NVCI
            if(ListFieldID == 0) //NVCISize
                {
                NVCI.Unload();
                return;
                }

            if(ListIndex >= NVCI.value.size())
                return;

            switch(ListFieldID)
                {
                case 1: //unknown1
                    NVCI.value[ListIndex]->unknown1 = defaultNVCI.unknown1;
                    return;
                case 2: //unknown2
                    NVCI.value[ListIndex]->unknown2.clear();
                    return;
                case 3: //unknown3
                    NVCI.value[ListIndex]->unknown3.clear();
                    return;
                case 4: //doors
                    NVCI.value[ListIndex]->doors.clear();
                    return;
                default:
                    return;
                }
            return;
        default:
            return;
        }
    }