Skip to content

Instantly share code, notes, and snippets.

@valda
Created July 14, 2010 02:27
Show Gist options
  • Save valda/474914 to your computer and use it in GitHub Desktop.
Save valda/474914 to your computer and use it in GitHub Desktop.
Lovers の体位スロット拡張
# -*- coding: utf-8-dos; mode: python -*-
import bosh
from bolt import GPath
bosh.initDirs()
bosh.initSettings(readOnly=True)
bosh.oblivionIni = bosh.OblivionIni()
bosh.modInfos = bosh.ModInfos()
bosh.modInfos.refresh()
fileInfo = bosh.ModInfo('.', GPath('Lovers with PK.esp'))
loadFactory = bosh.LoadFactory(True,bosh.MreIdle)
modFile = bosh.ModFile(fileInfo,loadFactory)
modFile.load(True)
tes4 = modFile.tes4
idles = {}
fid = 0
for idle in modFile.IDLE.records:
idles[idle.eid] = idle
fid = max(fid,idle.fid)
fid += 1
prevxLanims = idles['xLanims50']
prevxLanims.setChanged()
for index in range(51,201):
# create xLanims
xlanims = bosh.MreIdle(('IDLE',0,0,0,0))
xlanims.fid = fid;fid+=1
xlanims.eid = 'xLanims%02d' % index
xlanims.model = xlanims.getDefault('model')
xlanims.model.modPath = 'Characters\\_Male\\IdleAnims'
xlanims.model.modb_p = '\x00\x00\x00\x00'
cond = xlanims.getDefault('conditions')
cond.operFlag = 0
cond.compValue = index
cond.ifunc = 47
cond.param1 = 0x01002a2d
xlanims.conditions.insert(0,cond)
xlanims.group = 4
xlanims.parent = 0x010411d2
xlanims.prevId = idles['xLanimsReset'].fid
xlanims.setChanged()
modFile.IDLE.setRecord(xlanims)
prevxLanims.prevId = xlanims.fid
prevxLanims = xlanims
# create Defense
defense = bosh.MreIdle(('IDLE',0,0,0,0))
defense.fid = fid;fid+=1
defense.eid = 'Defense%02d' % index
defense.model = defense.getDefault('model')
defense.model.modPath = 'Characters\\_Male\\IdleAnims'
defense.model.modb_p = '\x00\x00\x00\x00'
cond = defense.getDefault('conditions')
cond.operFlag = 0
cond.compValue = 1
cond.ifunc = 47
cond.param1 = 0x0103d454
defense.conditions.insert(0,cond)
defense.group = 4
defense.parent = prevxLanims.fid
defense.setChanged()
modFile.IDLE.setRecord(defense)
prevDefstage = None
for stage in range(0,4):
defstage = bosh.MreIdle(('IDLE',0,0,0,0))
defstage.fid = fid;fid+=1
defstage.eid = 'Def%02dx%02d' % (index,stage)
defstage.model = defstage.getDefault('model')
defstage.model.modPath = 'Characters\\_Male\\IdleAnims\\ani2\\%02d_DefMotionx%d.kf' % (index,stage)
defstage.model.modb_p = '\x00\x00\x00\x00'
cond = defstage.getDefault('conditions')
cond.operFlag = 0
cond.compValue = {0:5,1:2,2:3,3:4}[stage]
cond.ifunc = 47
cond.param1 = 0x01002a2e
defstage.conditions.insert(0,cond)
defstage.group = 4
defstage.parent = defense.fid
if prevDefstage:
defstage.prevId = prevDefstage.fid
defstage.setChanged()
modFile.IDLE.setRecord(defstage)
prevDefstage = defstage
# create Offense
offense = bosh.MreIdle(('IDLE',0,0,0,0))
offense.fid = fid;fid+=1
offense.eid = 'Offense%02d' % index
offense.model = offense.getDefault('model')
offense.model.modPath = 'Characters\\_Male\\IdleAnims'
offense.model.modb_p = '\x00\x00\x00\x00'
cond = offense.getDefault('conditions')
cond.operFlag = 0
cond.compValue = 1
cond.ifunc = 47
cond.param1 = 0x0103bfcf
offense.conditions.insert(0,cond)
offense.group = 4
offense.parent = prevxLanims.fid
offense.prevId = defense.fid
offense.setChanged()
modFile.IDLE.setRecord(offense)
prevOffstage = None
for stage in range(0,4):
offstage = bosh.MreIdle(('IDLE',0,0,0,0))
offstage.fid = fid;fid+=1
offstage.eid = 'Off%02dx%02d' % (index,stage)
offstage.model = offstage.getDefault('model')
offstage.model.modPath = 'Characters\\_Male\\IdleAnims\\ani2\\%02d_OffMotionx%d.kf' % (index,stage)
offstage.model.modb_p = '\x00\x00\x00\x00'
cond = offstage.getDefault('conditions')
cond.operFlag = 0
cond.compValue = {0:5,1:2,2:3,3:4}[stage]
cond.ifunc = 47
cond.param1 = 0x01002a2e
offstage.conditions.insert(0,cond)
offstage.group = 4
offstage.parent = offense.fid
if prevOffstage:
offstage.prevId = prevOffstage.fid
offstage.setChanged()
modFile.IDLE.setRecord(offstage)
prevOffstage = offstage
modFile.save(GPath('Lovers with PK.new.esp'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment