Papyrus : インベントリメニューからデータを取得

インベントリやマジックメニューで選択中のアイテム/呪文の情報を取得する方法をざっくりまとめるぞ。

必須環境


SKSE
SkyUI

インベントリ/マジックメニューの”選択中のエントリ”


MenuName : “InventoryMenu” , “MagicMenu”
Menu_Root : “_root.Menu_mc.inventoryLists.itemList.selectedEntry”

例文


・”選択中のエントリ”
String MENU_ROOT = “_root.Menu_mc.inventoryLists.itemList.selectedEntry”

・選択中のアイテムのFormIDを取得
Form item = Game.GetFormEx(UI.GetInt(“InventoryMenu”, MENU_ROOT + “.formId”))

・選択中のアイテムの名前を取得
String name = UI.GetString(“InventoryMenu”, MENU_ROOT + “.text”))

・選択中のアイテムの個数を取得
Int count = UI.GetInt(“InventoryMenu”, MENU_ROOT + “.count”))

・選択中の武器の攻撃力を取得
Float damage = UI.GetFloat(“InventoryMenu”, MENU_ROOT + “.infoDamage”)

・選択中のアイテムが盗品であるかどうかを取得
Bool stolen = UI.GetBool(“InventoryMenu”, MENU_ROOT + “.isStolen”)

アイテム情報


大文字/小文字は区別されるので注意。とりあえずぶち込んで返ってきた値をまとめておく。

一般
String .text :名前
int .formId :Form ID (Game.GetFormEXでForm型に変換すること)

アイテム


int .count :個数
int .infoValue :価値

float .infoWeight :重量
float .infoValueWeight :価値/重量
float .infoDamage :武器の攻撃力
float .infoArmor :防具の防御値
int .weightClass :防具のクラス

 0:その他
 1:重装
 2:???
 3:衣服 - VendorItemClothing
 4:装飾品- VendorItemJewelry

魂石


int .soulSize :魂石に入っている魂の大きさ
int .gemSize :魂石の許容量

0:空
1:極小
2:小
3:中
4:大
5:極大、黒

魔法


String .infoSchoolName :呪文の系統(破壊、変性、回復など)
float .infoSpellCost :呪文の消費マジカ
float .magnitude :魔法効果の威力
int .duration :魔法効果の持続時間

状態


bool .enabled :有効/無効 (True:白字、False:暗転)
bool .isStolen :盗品か否か
bool .isPoisoned :毒が塗ってあるか否か (メニューを開き直さないと更新されない)
bool .isEnchanted :付呪されているか否か
bool .isEquipped :装備中か否か
bool .isRead :本が既読であるか否か
int .equipState :装備状態

0:装備していない
1:装備中
2:左手で装備中
3:右手で装備中
4:両手で装備中

Int .filterflag : フィルター


“InventoryMenu”
2 : Ammo / Weapon
4 : Armor
8 : Potion/Poison
16: Scroll
32: Food
64: Ingredient
128: Book
256: Key
512: Misc/Torch/Soulgel

“MagicMenu”
2 : Alteration
4 : Illusion
8 : Destruction
16: Conjuration
32: Restoration
64: shout
128:Power
256:Ability

Int .type: 型


1 : Armor
2 : Weapon / Ammo
3 : Misc / Torch
4 : Book
5 : Food
6 : Potion / Poison / Scroll / SpellTome?
7 : Spell
8 : Ingredient
9 : Key
10: Shout
11: Abiltiy
12: SoulGem
13: Power

Int .subType: 部分型(武器の種類や防具の装備箇所など)



防具
(type: 1)
subType
-------------------------------------------------------------
1 : Head
2 :
3 : Body
4 :
5 : Hands
6 : Shield
7 :
8 : Feet
9 : Circlet
10: Amulet
11:
12: Ring

武器 (type: 2)
subType
-------------------------------------------------------------
1 : sword
2 : Dagger
3 : WarAxe
4 : Mace
5 : Greatsword
6 : BattleAxe
7 : Warhammer
8 : Bow
9 : Crossbow
10: Staff
11: PickAxe
12: WoodAxe

矢/ボルト(type: 2)
subType
-------------------------------------------------------------
0:矢
1:ボルト

Misc (type: 3)
subType
-------------------------------------------------------------
1 : 竜の爪
2 : デイドラ・アーティファクト – VendorItemDaedricArtifact
3 : 革
4 : 革の紐
5 : 毛皮 – VendorItemAnimalHide
6 : 動物の素材 – VendorItemAnimalPart
7 : インゴット/鉱石 – VendorItemOreIngot
8 : 道具 – VendorItemTool
9 : 子供服 – BYOHAdoptionClothesKeyword
10: 玩具 – BYOHAdoptionToyKeyword
 - :
 - :
 - :
18: 建築 –

BYOHHouseCraftingCategoryShelf
BYOHHouseCraftingCategoryFurniture
BYOHHouseCraftingCategoryExterior
BYOHHouseCraftingCategoryContainers
BYOHHouseCraftingCategoryBuilding
BYOHHouseCraftingCategorySmithing

19: 雑貨 – VendorItemClutter
20: ロックピック

0 : その他
– : 宝石 – VendorItemGem
– : 薪 – VendorItemFireword

(type: 4)
subType
-------------------------------------------------------------
0:通常
1:メモ

スクロール (type: 6)
subType
-------------------------------------------------------------
18: 変性-Alteration
19: 召喚-Conjuration
20: 破壊-Desutruction
21: 幻惑-Illusion
22: 回復-Restoration

ポーション (type: 6)
subType
-------------------------------------------------------------
0 : 体力回復
1 :
2 : 体力回復率
3 : マジカ回復
4 :
5 : マジカ回復率
6 : スタミナ回復
7 :
8 : スタミナ回復率
9 : 炎耐性
10: 雷耐性
11: 氷耐性
12: その他のポーション
13: 飲み物
14: 食べ物
15: 毒

魔法 (type: 7)
subType
-------------------------------------------------------------
18: 変性-Alteration
19: 召喚-Conjuration
20: 破壊-Desutruction
21: 幻惑-Illusion
22: 回復-Restoration

ソウルジェム (type: 12)
subType
-------------------------------------------------------------
1:極小
2:小
3:中
4:大
5:極大、黒
6:アズラの星

Int .formType : Formの分類。GetTypeと同じ。


23 : Scroll
26 : Armor
27 : Book
30 : ingredient
31 : Torch/Light
32 : Misc
41 : Weapon
42 : Ammo
45 : Key
46 : Potion/Poison/Food
53 : SoulGem

int .material :武器/防具/弾薬のMaterial Keywordによる分類


 武器/弾薬
6 : WeapMaterialDaedric
8 : DLC1WeapMaterialDragonbone
11: WeapMaterialDraugr
12: WeapMaterialDraugrHoned
14: WeapMaterialDwarven
15: WeapMaterialEbony
16: WeapMaterialElven
18: WeapMaterialFalmer
20: WeapMaterialFalmerHoned
22: WeapMaterialGlass
25: WeapMaterialImperial
27: WeapMaterialIron
33: DLC2WeaponMaterialNordic
34: WeapMaterialOrcish
36: WeapMaterialSilver
37: DLC2WeaponMaterialStalhrim
38: WeapMaterialSteel
43: WeapMaterialWood

防具
2 : DLC2ArmorMaterialBonemodHeavy, DLC2ArmorMaterialBonemodLight
4 : DLC2ArmorMaterialChitinHeavy, DLC2ArmorMaterialChitinLight
6 : ArmorMaterialDaedric
7 : DLC1ArmorMaterialDawnguard
9 : ArmorMaterialDragonplate
10: ArmorMaterialDragonscale
14: ArmorMaterialDwarven
15: ArmorMaterialEbony
16: ArmorMaterialElven
17: ArmorMaterialElvenGuided
19: DLC1ArmorMaterialFalmerHardened
22: ArmorMaterialGlass
23: ArmorMaterialHide
24: DLC1ArmorMaterialHunter
25: ArmorMaterialImperialHeavy. ArmorMaterialImperialLight
26: ArmorMaterialImperialStudded
27: ArmorMaterialIron
28: ArmorMaterialIronBanded
29: ArmorMaterialLeather
31: DLC2ArmorMaterialMoragTong
33: DLC2ArmorMaterialNordicHeavy, DLC2ArmorMaterialNordicLight
34: ArmorMaterialOrcish
35: ArmorMaterialScaled
37: DLC2ArmorMaterialStalhrimHeavy, DLC2ArmorMaterialStalhrimLight
38: ArmorMaterialSteel
39: ArmorMaterialSteelplate
40: ArmorMaterialStormcloak
41: ArmorMaterialStudded
42: DLC1ArmorMaterialVampire

0 : その他
ArmorMaterialBearStormcloak
ArmorMaterialBlades
ArmorMaterialFalmer
ArmorMaterialForsworn
ArmorMaterialMS02Forsworn
ArmorMaterialPenitus
ArmorMaterialThievesGuild
ArmorMaterialThievesGuildLeader
DLC1ArmorMaterielFalmerHeavy
DLC1ArmorMaterielFalmerHeavyOriginal

コメント

タイトルとURLをコピーしました