Constants (gmp.enum)
Shared constants: hit types, equipment slots, item types, object types, relations, controls and skills.
All constants taken and returned by the API live in gmp.enum - shared: the same names and values in client-side and server-side scripts. Always use the names, never the raw numbers - new values are only ever added at the end, so existing numbers never change.
local E = gmp.enum
attacker:hit(victim, E.HitType.MeleeHeavy)
ch:grantSkill(E.Skill.Ranged_Bow_Master)HitType
Kind of a hit.
| Name | Value | Description |
|---|---|---|
gmp.enum.HitType.Fists | 0 | A punch. |
gmp.enum.HitType.Melee | 1 | A light swing with the attacker's equipped melee weapon (short stagger). |
gmp.enum.HitType.MeleeHeavy | 2 | A heavy swing: knocks the victim down. |
gmp.enum.HitType.MeleeMedium | 3 | A medium swing: a stronger stagger without a knockdown. |
gmp.enum.HitType.Arrow | 4 | A projectile (arrow or bolt) from the attacker's equipped bow or crossbow; no knockdown. |
gmp.enum.HitType.Spell | 5 | A spell projectile (spell projectile definition class as the weapon). |
gmp.enum.HitType.Tick | 6 | Damage without a weapon: damage over time, burning, a fall. |
EquipSlot
Where an item is equipped.
| Name | Value | Description |
|---|---|---|
gmp.enum.EquipSlot.MeleeWeapon | 0 | Melee weapon slot (can also hold a rune or scroll). |
gmp.enum.EquipSlot.RangedWeapon | 1 | Ranged weapon slot (can also hold a rune or scroll). |
gmp.enum.EquipSlot.Armor | 2 | Armor. |
gmp.enum.EquipSlot.RingLeft | 3 | Ring on the left hand. |
gmp.enum.EquipSlot.RingRight | 4 | Ring on the right hand. |
gmp.enum.EquipSlot.Amulet | 5 | Amulet. |
gmp.enum.EquipSlot.QuickBar | 6 | Quick-access bar (the entry's index is the position on the bar). |
gmp.enum.EquipSlot.Torch | 7 | Torch slot. |
ItemType
What an item is.
| Name | Value | Description |
|---|---|---|
gmp.enum.ItemType.Other | 0 | Any other item (ores, herbs, miscellaneous items). |
gmp.enum.ItemType.MeleeWeapon | 1 | One- or two-handed melee weapon. |
gmp.enum.ItemType.Bow | 2 | Bow. |
gmp.enum.ItemType.Crossbow | 3 | Crossbow. |
gmp.enum.ItemType.Ammo | 4 | Ammunition (arrows, bolts). |
gmp.enum.ItemType.Torch | 5 | Torch. |
gmp.enum.ItemType.Armor | 6 | Armor. |
gmp.enum.ItemType.Ring | 7 | Ring. |
gmp.enum.ItemType.Amulet | 8 | Amulet. |
gmp.enum.ItemType.Rune | 9 | Rune. |
gmp.enum.ItemType.Scroll | 10 | Spell scroll. |
gmp.enum.ItemType.Potion | 11 | Potion. |
gmp.enum.ItemType.Food | 12 | Food or drink. |
gmp.enum.ItemType.Writing | 13 | Written item (book, letter, map). |
gmp.enum.ItemType.Key | 14 | Key. |
ObjectType
Kind of an interactive world object.
| Name | Value | Description |
|---|---|---|
gmp.enum.ObjectType.Seat | 0 | Bench or chair. |
gmp.enum.ObjectType.Ladder | 1 | Ladder. |
gmp.enum.ObjectType.Torch | 2 | Object with a fire that can be lit or extinguished: roadside torch, fire basket. |
gmp.enum.ObjectType.Other | 3 | Any other interactive object (door, chest, crafting table, bed...). Reported in events only; not searchable. |
Relation
How a character treats another character (one-way).
| Name | Value | Description |
|---|---|---|
gmp.enum.Relation.Unknown | 0 | Unknown or not set. |
gmp.enum.Relation.Enemy | 1 | Enemy. |
gmp.enum.Relation.Hostile | 2 | Hostile. |
gmp.enum.Relation.Angry | 3 | Angered (e.g. after being hit). |
gmp.enum.Relation.Neutral | 4 | Neutral. |
gmp.enum.Relation.Friend | 5 | Friend. |
Control
Control "keys" of a character. Directions are relative to the character's camera angle.
| Name | Value | Description |
|---|---|---|
gmp.enum.Control.Forward | 0 | Move forward. |
gmp.enum.Control.Backward | 1 | Move backward. |
gmp.enum.Control.Left | 2 | Move left. |
gmp.enum.Control.Right | 3 | Move right. |
gmp.enum.Control.Walk | 4 | Walk instead of running. |
gmp.enum.Control.Sprint | 5 | Sprint. |
gmp.enum.Control.Jump | 6 | Jump (on press; to jump again release and press it again). |
gmp.enum.Control.Sneak | 7 | Sneak (while held). |
Skill
Skills and their levels. The levels of one skill replace each other
(Untrained -> Trained -> Master; for thievery and mining: Untrained -> Skilled -> Master).
Melee combat
| Name | Value | Description |
|---|---|---|
gmp.enum.Skill.Melee_Fists_Untrained | 0 | |
gmp.enum.Skill.Melee_Fists_Trained | 1 | |
gmp.enum.Skill.Melee_Fists_Master | 2 | |
gmp.enum.Skill.Melee_OneHanded_Untrained | 3 | |
gmp.enum.Skill.Melee_OneHanded_Trained | 4 | |
gmp.enum.Skill.Melee_OneHanded_Master | 5 | |
gmp.enum.Skill.Melee_Orc_Untrained | 6 | Orc weapons. |
gmp.enum.Skill.Melee_Orc_Trained | 7 | |
gmp.enum.Skill.Melee_Orc_Master | 8 | |
gmp.enum.Skill.Melee_TwoHanded_Untrained | 9 | |
gmp.enum.Skill.Melee_TwoHanded_Trained | 10 | |
gmp.enum.Skill.Melee_TwoHanded_Master | 11 |
Ranged combat
| Name | Value | Description |
|---|---|---|
gmp.enum.Skill.Ranged_Bow_Untrained | 12 | |
gmp.enum.Skill.Ranged_Bow_Trained | 13 | |
gmp.enum.Skill.Ranged_Bow_Master | 14 | |
gmp.enum.Skill.Ranged_Crossbow_Untrained | 15 | |
gmp.enum.Skill.Ranged_Crossbow_Trained | 16 | |
gmp.enum.Skill.Ranged_Crossbow_Master | 17 |
Magic circles (also set the circle level used by runes and scrolls)
| Name | Value | Description |
|---|---|---|
gmp.enum.Skill.Mage_Circle_Untrained | 18 | |
gmp.enum.Skill.Mage_Circle_Amateur | 19 | |
gmp.enum.Skill.Mage_Circle_1 | 20 | |
gmp.enum.Skill.Mage_Circle_2 | 21 | |
gmp.enum.Skill.Mage_Circle_3 | 22 | |
gmp.enum.Skill.Mage_Circle_4 | 23 | |
gmp.enum.Skill.Mage_Circle_5 | 24 | |
gmp.enum.Skill.Mage_Circle_6 | 25 |
Thievery
| Name | Value | Description |
|---|---|---|
gmp.enum.Skill.Picklock_Untrained | 26 | |
gmp.enum.Skill.Picklock_Skilled | 27 | |
gmp.enum.Skill.Picklock_Master | 28 | |
gmp.enum.Skill.Pickpocket_Untrained | 29 | |
gmp.enum.Skill.Pickpocket_Skilled | 30 | |
gmp.enum.Skill.Pickpocket_Master | 31 | |
gmp.enum.Skill.Sneak | 32 |
Crafting and mining
| Name | Value | Description |
|---|---|---|
gmp.enum.Skill.Crafting_Alchemy | 33 | |
gmp.enum.Skill.Crafting_Blacksmith_Untrained | 34 | |
gmp.enum.Skill.Crafting_Blacksmith_Trained | 35 | |
gmp.enum.Skill.Crafting_Blacksmith_Master | 36 | |
gmp.enum.Skill.Crafting_Inscription | 37 | Writing scrolls. |
gmp.enum.Skill.Mining_Untrained | 38 | |
gmp.enum.Skill.Mining_Skilled | 39 | |
gmp.enum.Skill.Mining_Master | 40 |
Hunting (taking trophies from animals)
| Name | Value | Description |
|---|---|---|
gmp.enum.Skill.Hunting_Claw_Trained | 41 | |
gmp.enum.Skill.Hunting_Fins_Trained | 42 | |
gmp.enum.Skill.Hunting_Fur_Trained | 43 | |
gmp.enum.Skill.Hunting_MandibleMineCrawler_Trained | 44 | |
gmp.enum.Skill.Hunting_MCPlate_Trained | 45 | Minecrawler plates. |
gmp.enum.Skill.Hunting_Organ_Trained | 46 | |
gmp.enum.Skill.Hunting_Reptiles_Trained | 47 | |
gmp.enum.Skill.Hunting_Scutes_Trained | 48 | |
gmp.enum.Skill.Hunting_Scutes_Master | 49 | |
gmp.enum.Skill.Hunting_Secretion_Trained | 50 | |
gmp.enum.Skill.Hunting_ShadowbeastHorn_Trained | 51 | |
gmp.enum.Skill.Hunting_Skin_Trained | 52 | |
gmp.enum.Skill.Hunting_SkinSwampshark_Trained | 53 | |
gmp.enum.Skill.Hunting_SkullArmor_Trained | 54 | |
gmp.enum.Skill.Hunting_Spines_Trained | 55 | |
gmp.enum.Skill.Hunting_Stings_Trained | 56 | |
gmp.enum.Skill.Hunting_StingsBloodfly_Trained | 57 | |
gmp.enum.Skill.Hunting_Teeth_Trained | 58 | |
gmp.enum.Skill.Hunting_TeethSwampshark_Trained | 59 | |
gmp.enum.Skill.Hunting_TongueOfFire_Trained | 60 | |
gmp.enum.Skill.Hunting_TrollHorn_Trained | 61 | |
gmp.enum.Skill.Hunting_UluMulu_Trained | 62 |
Other
| Name | Value | Description |
|---|---|---|
gmp.enum.Skill.Acrobatics | 63 | |
gmp.enum.Skill.Diving | 64 | |
gmp.enum.Skill.Orcish_Untrained | 65 | Orcish language. |
gmp.enum.Skill.Orcish_Skilled | 66 | |
gmp.enum.Skill.Orcish_Master | 67 | |
gmp.enum.Skill.Riding | 68 | |
gmp.enum.Skill.Scavenging | 69 | |
gmp.enum.Skill.Wallclimbing | 70 |
