GetServicesMask

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
< [[::Category:Functions|Category:Functions]]

A function added by the Oblivion Script Extender.

Syntax:

(servicesMask:short) reference.GetServicesMask npc:ref

Returns an integer code representing the services offered by an NPC. The code is obtained by ORing (adding) service flags.


Service Flag Bit Assignments

Service flags, such as used by this function, use a bitmask. Each service flag is assigned to a single bit of a 32-bit value: when that bit is 1, that service is included, and when it is 0, it is not. Having multiple bits set to 1 allows the scripter to deal with a specific list of services at once. Multiple bits can be set to one by simply adding the listed decimal numbers together.

Hex		Dec	Service
0x00000001	1	Weapons
0x00000002	2	Armor
0x00000004	4	Clothing
0x00000008	8	Books
0x00000040	64	Ingredients
0x00000080	128	Lights
0x00000100	256	Apparatuses
0x00000400	1024	Misc.
0x00000800	2048	Spells
0x00001000	4096	Magic Items
0x00002000	8192	Potions
0x00004000	16384	Training
0x00010000	65536	Recharge
0x00020000	131072	Repair