Atrinik Server  4.0
Python constants

Python constants

List of the Python plugin constants and their meaning.

Name Details Notes
NORTHEAST Northeast.
EAST East.
SOUTHEAST Southeast.
SOUTH South.
SOUTHWEST Southwest.
WEST West.
NORTHWEST Northwest.
PLUGIN_EVENT_NORMAL Normal event: the event is attached directly to the object in question.
PLUGIN_EVENT_GLOBAL Global event, requires no attaching of event.
PLUGIN_EVENT_MAP Map-wide event.
EVENT_APPLY Object applied/unapplied.
EVENT_ATTACK Monster attacked or scripted weapon was used.
EVENT_DEATH Player or monster was killed.
EVENT_DROP Object dropped on the floor.
EVENT_PICKUP Object picked up.
EVENT_SAY Someone speaks.
EVENT_STOP Thrown object stopped.
EVENT_TIME Triggered each time the object can react/move.
EVENT_THROW Object is thrown.
EVENT_TRIGGER Button pushed, lever pulled, etc.
EVENT_CLOSE Container closed.
EVENT_ASK_SHOW Ask script whether to show this object on map.
MEVENT_ENTER A player entered a map.
MEVENT_LEAVE A player left a map.
MEVENT_RESET A map is resetting.
MEVENT_SPELL_CAST A spell is being cast.
MEVENT_SKILL_USED A skill is being used.
MEVENT_DROP Player is dropping an item.
MEVENT_PICK Player is trying to pick up an item.
MEVENT_PUT Player is trying to put an item to a container on map.
MEVENT_APPLY An item is being applied.
MEVENT_LOGIN Player has logged in.
MEVENT_CMD_DROP The /drop command was used.
MEVENT_CMD_TAKE The /take command was used.
MEVENT_EXAMINE Item was examined.
GEVENT_BORN A new character has been created.
GEVENT_LOGIN Player login.
GEVENT_LOGOUT Player logout.
GEVENT_PLAYER_DEATH Player was killed.
GEVENT_CACHE_REMOVED Cache entry was removed.
MAP_INFO_NORMAL Normal map info, to everyone in range of 12 tiles.
MAP_INFO_ALL To everyone on a map; this is a special value.
COST_TRUE True value of item, unadjusted.
COST_BUY Value for buying the item.
COST_SELL Value for selling the item.
APPLY_TOGGLE 0
APPLY_ALWAYS
UNAPPLY_ALWAYS
UNAPPLY_NO_MERGE
UNAPPLY_IGNORE_CURSE
APPLY_NO_EVENT
MAXLEVEL The maximum level.
CAST_NORMAL Normal cast.
CAST_WAND Casting from a wand.
CAST_ROD Casting from a rod.
CAST_SCROLL Casting from a scroll.
CAST_POTION Casting from a potion.
CAST_NPC NPC is doing the casting, can cast no matter what (even in areas that block magic).
IDENTIFY_NORMAL Normal identification.
IDENTIFY_ALL Identify everything.
IDENTIFY_MARKED Identify only marked item.
CLONE_WITH_INVENTORY 0
CLONE_WITHOUT_INVENTORY 1
CHAT_TYPE_ALL
CHAT_TYPE_GAME
CHAT_TYPE_CHAT
CHAT_TYPE_LOCAL
CHAT_TYPE_PRIVATE
CHAT_TYPE_GUILD
CHAT_TYPE_PARTY
CHAT_TYPE_OPERATOR
PLAYER_EQUIP_AMMO
PLAYER_EQUIP_AMULET
PLAYER_EQUIP_WEAPON
PLAYER_EQUIP_SHIELD
PLAYER_EQUIP_GAUNTLETS
PLAYER_EQUIP_RING_RIGHT
PLAYER_EQUIP_HELM
PLAYER_EQUIP_ARMOUR
PLAYER_EQUIP_BELT
PLAYER_EQUIP_GREAVES
PLAYER_EQUIP_BOOTS
PLAYER_EQUIP_CLOAK
PLAYER_EQUIP_BRACERS
PLAYER_EQUIP_WEAPON_RANGED
PLAYER_EQUIP_LIGHT
PLAYER_EQUIP_RING_LEFT
PLAYER_EQUIP_SKILL_ITEM
QUEST_TYPE_KILL The quest requires you to kill X monsters.
QUEST_TYPE_ITEM The quest requires you to get item X from some location.
QUEST_TYPE_ITEM_DROP The quest is automatically started by giving the player an item (one-drop quest item, keys from killing a monster/opening a chest, etc).
QUEST_TYPE_SPECIAL The quest is not handled by the server quest module; instead, it is handled specially by scripts.
QUEST_STATUS_COMPLETED The quest has been completed.
PARTY_MESSAGE_STATUS Status is used for party messages like password change, join/leave, etc.
PARTY_MESSAGE_CHAT Chat is used for party chat messages from party members.
ATNR_IMPACT Impact.
ATNR_SLASH Slash.
ATNR_CLEAVE Cleave.
ATNR_PIERCE Pierce.
ATNR_WEAPON_MAGIC Weapon magic. Common for spells like magic bullet.
ATNR_FIRE Fire.
ATNR_COLD Cold.
ATNR_ELECTRICITY Electricity.
ATNR_POISON Poison,
ATNR_ACID Acid.
ATNR_MAGIC Magic.
ATNR_MIND
ATNR_BLIND Blind.
ATNR_PARALYZE Paralyze. Affected object will be rooted to the spot.
ATNR_FORCE Force.
ATNR_GODPOWER Godpower.
ATNR_CHAOS Chaos.
ATNR_DRAIN Drain.
ATNR_SLOW Slow.
ATNR_CONFUSION Confusion. Affected object will move in random directions until the effect wears off.
ATNR_INTERNAL Used for internal calculations.
NROFATTACKS Number of the attacks.
TERRAIN_NOTHING No terrain.
TERRAIN_AIRBREATH No terrain.
TERRAIN_WATERWALK Walk on water - deep water too.
TERRAIN_WATERBREATH You can move underwater and on land.
TERRAIN_FIREWALK Walk over lava or fire,
TERRAIN_FIREBREATH You can move in fire environment (fire elemental dimension, hell, ...)
TERRAIN_CLOUDWALK Move "on clouds" in the air - not flying.
TERRAIN_ALL Used in blocked() when we only want know about blocked by something.
P_BLOCKSVIEW Blocks the view.
P_NO_MAGIC Spells (some) can't pass this object
P_NO_PASS Nothing can pass (wall() is true)
P_IS_PLAYER There is one or more player on this tile
P_IS_MONSTER There is a monster on this square.
P_PLAYER_ONLY Only players are allowed to enter this space. This excludes mobs and golems but also spell effects and thrown / fired items. It works like a no_pass for players only (pass_thru doesn't work for it).
P_DOOR_CLOSED A closed door is blocking this space - if we want to approach, we must first check if it's possible to open it.
P_CHECK_INV We have something like an inventory checker in this tile node.
P_NO_PVP PvP is not possible on this tile.
P_PASS_THRU

Same as NO_PASS - but objects with PASS_THRU set can cross it.

Note
If a node has NO_PASS and P_PASS_THRU set, there are 2 objects in the node, one with pass_thru and one with real no_pass - then no_pass will overrule pass_thru
P_WALK_ON For moving objects and what happens when they enter
P_WALK_OFF For moving objects and what happens when they leave
P_FLY_OFF For flying objects and what happens when they leave
P_FLY_ON For flying objects and what happens when they enter
P_MAGIC_MIRROR There is a MAGIC_MIRROR object on this tile.
P_OUTDOOR The tile has object with 'outdoor 1' flag.
P_OUT_OF_MAP Of course not set for map tiles but from blocked_xx() function where the get_map_from_coord() fails to grab a valid map or tile.
P_FLAGS_ONLY
P_FLAGS_UPDATE
P_NEED_UPDATE Update all the map square flags by looping the map objects.
P_NO_ERROR
P_NO_TERRAIN Do NOT use this with SET_MAP_FLAGS(). This is just to mark for return values of blocked().
CMD_SOUND_EFFECT
CMD_SOUND_BACKGROUND
CMD_SOUND_ABSOLUTE
BANK_SYNTAX_ERROR Syntax error: did not get text in expected format.
BANK_SUCCESS Successfully withdrawn/deposited money.
BANK_WITHDRAW_HIGH Withdraw value was too high.
BANK_WITHDRAW_MISSING Player wanted to withdraw more than they have in bank.
BANK_WITHDRAW_OVERWEIGHT Withdrawing that much money would make the player overweight.
BANK_DEPOSIT_COPPER Player doesn't have enough copper coins on hand.
BANK_DEPOSIT_SILVER Player doesn't have enough silver coins on hand.
BANK_DEPOSIT_GOLD Player doesn't have enough gold coins on hand.
BANK_DEPOSIT_JADE Player doesn't have enough jade coins on hand.
BANK_DEPOSIT_MITHRIL Player doesn't have enough mithril coins on hand.
BANK_DEPOSIT_AMBER Player doesn't have enough amber coins on hand.
AROUND_ALL All squares around the object.
AROUND_WALL Ignore squares that have a wall.
AROUND_BLOCKSVIEW Ignore squares that are blocking view.
AROUND_PLAYER_ONLY Ignore squares that are player only.
LAYER_SYS System objects.
LAYER_FLOOR Floor.
LAYER_FMASK Floor masks.
LAYER_ITEM Items: weapons, armour, books, etc.
LAYER_ITEM2 Another layer for items, often decoration.
LAYER_WALL Walls.
LAYER_LIVING Living objects like players and monsters.
LAYER_EFFECT Spell effects.
NUM_LAYERS The number of object layers.
NUM_SUB_LAYERS Number of sub-layers.
INVENTORY_ONLY Search only inside the inventory of the object.
INVENTORY_CONTAINERS Search inside the inventory of the object and inventories of containers.
INVENTORY_ALL Search inside the inventory of the object, inventories of containers and inventories of other objects.
GT_ENVIRONMENT Put generated treasure below the object instead of inside the object's inventory.
GT_INVISIBLE
GT_STARTEQUIP Generated items have FLAG_STARTEQUIP set
GT_APPLY Unused.
GT_ONLY_GOOD Don't generate bad/cursed items. Used for new player's equipment.
GT_UPDATE_INV When object has been generated, send its information to player.
GT_NO_VALUE Set value of all created treasures to 0.
SIZEOFFREE Maximum size of the arrays.
SIZEOFFREE1 Up to one space when searching around a spot.
SIZEOFFREE2 Up to two spaces when searching around a spot.
NROFREALSPELLS Number of different spells
MAX_TIME

If you feel the game is too fast or too slow, change MAX_TIME. You can experiment with the /speed <new_max_time> command first.

The length of a tick is MAX_TIME microseconds. During a tick, players, monsters, or items with speed 1 can do one thing.

OBJECT_METHOD_UNHANDLED The object was not handled.
OBJECT_METHOD_OK Successfully handled.
OBJECT_METHOD_ERROR Error handling the object.