Atrinik Server 2.5
Functions
Python object functions

Functions

static PyObject * Atrinik_Object_ActivateRune (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_GetGod (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_SetGod (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_TeleportTo (Atrinik_Object *obj, PyObject *args, PyObject *keywds)
static PyObject * Atrinik_Object_InsertInto (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Apply (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Take (Atrinik_Object *obj, PyObject *what)
static PyObject * Atrinik_Object_Drop (Atrinik_Object *obj, PyObject *what)
static PyObject * Atrinik_Object_Communicate (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Say (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_SayTo (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Write (Atrinik_Object *obj, PyObject *args, PyObject *keywds)
static PyObject * Atrinik_Object_GetGender (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_SetGender (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_SetGuildForce (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_GetGuildForce (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Fix (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Hit (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Cast (Atrinik_Object *obj, PyObject *args, PyObject *keywds)
static PyObject * Atrinik_Object_CreatePlayerForce (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_CreatePlayerInfo (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_GetPlayerInfo (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_GetNextPlayerInfo (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_CreateForce (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_CreateObject (Atrinik_Object *obj, PyObject *args, PyObject *keywds)
static PyObject * Atrinik_Object_FindObject (Atrinik_Object *obj, PyObject *args, PyObject *keywds)
static PyObject * Atrinik_Object_Remove (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_SetPosition (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_CastIdentify (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Save (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_GetCost (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_GetMoney (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_PayAmount (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Clone (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_ReadKey (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_WriteKey (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_GetName (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_CreateTimer (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_Controller (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_Protection (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_SetProtection (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_Attack (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_SetAttack (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_ChangeAbil (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Decrease (Atrinik_Object *what, PyObject *args)
static PyObject * Atrinik_Object_SquaresAround (Atrinik_Object *what, PyObject *args, PyObject *keywds)
static PyObject * Atrinik_Object_GetRangeVector (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_CreateTreasure (Atrinik_Object *obj, PyObject *args, PyObject *keywds)
static PyObject * Atrinik_Object_Move (Atrinik_Object *obj, PyObject *args)
static PyObject * Atrinik_Object_Activate (Atrinik_Object *obj, PyObject *args)

Detailed Description

Object related functions used in Atrinik Python plugin.


Function Documentation

static PyObject* Atrinik_Object_Activate ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Activate()

Activates the object's connection, if it has one.

Definition at line 1977 of file atrinik_object.c.

static PyObject* Atrinik_Object_ActivateRune ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.ActivateRune(object who)

Activate a rune.

Parameters:
whoWho should be affected by the effects of the rune.
Exceptions:
TypeErrorif 'object' is not of type TYPE_RUNE.

Definition at line 173 of file atrinik_object.c.

static PyObject* Atrinik_Object_Apply ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Apply(object what, int flags)

Forces 'object' to apply 'what'.

Parameters:
whatWhat object to apply.
flagsReasonable combination of the following:
  • APPLY_TOGGLE: Normal apply (toggle)
  • APPLY_ALWAYS: Always apply (never unapply)
  • UNAPPLY_ALWAYS: Always unapply (never apply)
  • UNAPPLY_NOMERGE: Don't merge unapplied items
  • UNAPPLY_IGNORE_CURSE: Unapply cursed items
Return values:
0Object cannot apply objects of that type.
1Object was applied.
2Object must be in inventory to be applied.

Definition at line 331 of file atrinik_object.c.

static PyObject* Atrinik_Object_Attack ( Atrinik_Object what,
PyObject *  args 
) [static]

object.Attack(int nr)

Get object's attack value for the given attack ID.

Parameters:
nrAttack ID. One of _attacks.
Exceptions:
IndexErrorif the attack ID is invalid.
Returns:
The attack value.

Definition at line 1583 of file atrinik_object.c.

static PyObject* Atrinik_Object_Cast ( Atrinik_Object obj,
PyObject *  args,
PyObject *  keywds 
) [static]

object.Cast(int spell, object [target = None], int [mode = -1], int [direction = 0], string [option = None])

Object casts the spell ID 'spell'.

Parameters:
spellID of the spell to cast. You can lookup spell IDs by name using GetSpellNr().
targetTarget object for spells that require a valid target.
modeOne of Casting modes. If -1 (default), will try to figure out the appropriate mode automatically.
directionThe direction to cast the spell in.
optionAdditional string option, required by some spells (create food for example).

Definition at line 741 of file atrinik_object.c.

static PyObject* Atrinik_Object_CastIdentify ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.CastIdentify(object target, int mode, object [marked = None])

Cast identify on target.

Parameters:
targetThe target object.
modeOne of Identify modes.
markedMarked item.

Definition at line 1243 of file atrinik_object.c.

static PyObject* Atrinik_Object_ChangeAbil ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.ChangeAbil(object what)

Permanently alters an object's stats/flags based on another what.

Parameters:
whatObject that is giving bonuses/penalties to 'object'.
Returns:
True if we successfully changed a stat, False if nothing was changed.

Definition at line 1639 of file atrinik_object.c.

static PyObject* Atrinik_Object_Clone ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Clone(int [mode = CLONE_WITH_INVENTORY])

Clone an object.

You should do something with the clone. TeleportTo() or InsertInside() are useful functions for that.

Parameters:
modeOptional mode, one of:
  • CLONE_WITH_INVENTORY (default)
  • CLONE_WITHOUT_INVENTORY
Returns:
The cloned object.

Definition at line 1369 of file atrinik_object.c.

static PyObject* Atrinik_Object_Communicate ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Communicate(string message)

Object says message to everybody on its map. Emote commands may be used.

Parameters:
messageThe message to say.

Definition at line 409 of file atrinik_object.c.

static PyObject* Atrinik_Object_Controller ( Atrinik_Object what,
PyObject *  args 
) [static]

object.Controller()

Get object's controller (the player).

Exceptions:
AtrinikErrorif 'object' is not a player.
Returns:
The controller if there is one, None otherwise.

Definition at line 1506 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreateForce ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.CreateForce(string name, int time)

Create a force object in object's inventory.

Parameters:
nameString ID of the force object.
timeIf non-zero, the force will be removed again after time / 0.02 ticks. Optional, defaults to 0.
Returns:
The created force object.

Definition at line 960 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreateObject ( Atrinik_Object obj,
PyObject *  args,
PyObject *  keywds 
) [static]

object.CreateObject(string archname, int [nrof = 1], int [value = -1], bool [identified = True])

Creates an object from archname and inserts it into 'object'.

Parameters:
archnameName of the arch to create.
nrofNumber of objects to create.
valueIf not -1, will be used as value for the new object.
identifiedIf False the object will not be identified.
Exceptions:
AtrinikErrorif 'archname' references an invalid archetype.
Returns:
The created object.

Definition at line 1001 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreatePlayerForce ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.CreatePlayerForce(string force_name, int time)

Creates and inserts an invisible player force in object.

The values of the force will affect the object it is in, which should usually be player.

Parameters:
force_nameName of the player force
timeIf non-zero, the force will be removed again after time / 0.02 ticks. Optional, defaults to 0.
Returns:
The new player force object.
Deprecated:
Use object.CreateForce()

Definition at line 795 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreatePlayerInfo ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.CreatePlayerInfo(string name)

Creates a player info object of specified name in object's inventory.

The values of a player info object will NOT affect the object it is in.

Parameters:
nameName of the player info
Returns:
The new player info object
Deprecated:
Use object.CreateObject("player_info")

Definition at line 848 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreateTimer ( Atrinik_Object what,
PyObject *  args 
) [static]

object.CreateTimer(long delay, int mode)

Create a timer for an object.

Parameters:
delayHow long until the timer event gets executed for the object
modeIf 1, delay is in seconds, if 2, delay is in ticks (8 ticks = 1 second)
Returns:
0 and higher means success (and represents ID of the created timer), anything lower means a failure of some sort.

Definition at line 1474 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreateTreasure ( Atrinik_Object obj,
PyObject *  args,
PyObject *  keywds 
) [static]

object.CreateTreasure(string [treasure = None], int [level = -1], int [flags = 0], int [a_chance = ART_CHANCE_UNSET])

Create treasure inside (or below, if GT_ENVIRONMENT flag was set) the object.

Parameters:
treasureTreasure list name to generate. If None, will try to generate treasure based on the object's randomitems.
levelLevel of the generated items. If 0, will try to guess the level to use based on the object's level or the difficulty value of the map the object is on. If neither is applicable, will use MAXLEVEL.
flagsA combination of Treasure generation flags.
a_chanceChance for the treasure to become artifact, if possible. A value of 0 will disable any chance for artifacts.
Exceptions:
ValueErrorif treasure is not valid.

Definition at line 1873 of file atrinik_object.c.

static PyObject* Atrinik_Object_Decrease ( Atrinik_Object what,
PyObject *  args 
) [static]

object.Decrease(int [num = 1])

Decreases an object, removing it if there's nothing left to decrease.

Parameters:
numHow much to decrease the object by.
Returns:
'object' if something is left, None if the amount reached 0.

Definition at line 1659 of file atrinik_object.c.

static PyObject* Atrinik_Object_Drop ( Atrinik_Object obj,
PyObject *  what 
) [static]

object.Drop(object what)

Make 'object' drop 'what'.

Parameters:
whatObject to drop. If a string, this is equivalent of /drop command.
Exceptions:
TypeErrorif 'what' is neither an Atrinik object nor a string.

Definition at line 382 of file atrinik_object.c.

static PyObject* Atrinik_Object_FindObject ( Atrinik_Object obj,
PyObject *  args,
PyObject *  keywds 
) [static]

object.FindObject(int [mode = INVENTORY_ONLY], string [archname = None], string [name = None], string [title = None], int [type = -1], bool [multiple = False], bool [unpaid = False])

Looks for a certain object in object's inventory.

Parameters:
modeHow to search the inventory. One of Modes for object.FindObject().
archnameArch name of the object to search for. If None, can be any.
nameName of the object. If None, can be any.
titleTitle of the object. If None, can be any.
typeType of the object. If -1, can be any.
multipleIf True, the return value will be a list of all matching objects, instead of just the first one found.
unpaidOnly match unpaid objects.
Exceptions:
ValueErrorif there were no conditions to search for.
Returns:
The object we wanted if found, None otherwise.

Definition at line 1109 of file atrinik_object.c.

static PyObject* Atrinik_Object_Fix ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Fix()

Recalculate player's or monster's stats depending on equipment, forces, skills, etc.

Definition at line 675 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetCost ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetCost(object what, int type)

Get cost of an object in integer value.

Parameters:
whatThe object to query cost for.
typeOne of Cost modes.
Returns:
The cost of the item as integer.

Definition at line 1307 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetGender ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetGender()

Get an object's gender.

Returns:
One of the constants from Gender module constants.

Definition at line 531 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetGod ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetGod()

Determine the object's god.

Returns:
Returns a string of the god's name.

Definition at line 201 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetGuildForce ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetGuildForce()

Get the guild force from player's inventory.

Returns:
The guild force object if found.

Definition at line 644 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetMoney ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetMoney()

Get all the money the object is carrying as integer.

Note:
Can only be used on player or container objects.
Returns:
The amount of money the object is carrying in copper (as integer).

Definition at line 1329 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetName ( Atrinik_Object what,
PyObject *  args 
) [static]

object.GetName(object [caller = None])

An equivalent of query_base_name().

Parameters:
callerObject calling this.
Returns:
Full name of the object, including material, name, title, etc.

Definition at line 1448 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetNextPlayerInfo ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetNextPlayerInfo(object player_info)

Get next player info object in object's inventory with same name as player_info.

Parameters:
player_infoPreviously found player info object.
Returns:
The next player info object if found, None otherwise.
Deprecated:
Use object.FindObject(archname = "player_info", name = "info_name", multiple = True)

Definition at line 921 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetPlayerInfo ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetPlayerInfo(string name)

Get the first player info object with the specified name in object's inventory.

Parameters:
nameName of the player info
Returns:
The player info object if found, None otherwise.
Deprecated:
Use object.FindObject(archname = "player_info", name = "info_name")

Definition at line 889 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetRangeVector ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.GetRangeVector(object to, int [flags = 0])

Get the distance and direction from one object to another.

Parameters:
toObject to which the distance is calculated.
flagsOne or a combination of Range Vector Flags.
Returns:
None if the distance couldn't be calculated, otherwise a tuple containing:
  • Direction 'object' should head to reach 'to', one of Direction constants.
  • Distance between 'object' and 'to'.
  • X distance.
  • Y distance.
  • Part of the object that is closest.

Definition at line 1830 of file atrinik_object.c.

static PyObject* Atrinik_Object_Hit ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Hit(object target, int damage)

Make 'object' hit 'target' for the specified amount of damage.

Parameters:
targetThe object to hit.
damageHow much damage to do. If -1, the target object will be killed, otherwise the actual damage done is calculated depending on the hitter's attack types, the target's protections, etc.
Exceptions:
ValueErrorif 'target' is not on map or is not alive.

Definition at line 694 of file atrinik_object.c.

static PyObject* Atrinik_Object_InsertInto ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.InsertInto(object where)

Insert 'object' into 'where'.

Parameters:
whereWhere to insert 'object'.

Definition at line 284 of file atrinik_object.c.

static PyObject* Atrinik_Object_Move ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Move(int direction)

Move the object in the specified direction. The object must have the correct (combination of) object::terrain_flag set in order to able to move onto the new square.

Parameters:
directionDirection to move into, one of Direction constants.
Exceptions:
AtrinikErrorif object is not on map.
Returns:
True if the object was moved successfully, False otherwise.

Definition at line 1947 of file atrinik_object.c.

static PyObject* Atrinik_Object_PayAmount ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.PayAmount(int value)

Get the object to pay a specified amount of money in copper.

Parameters:
valueThe amount of money in copper to pay for.
Returns:
True if the object paid the money (the object had enough money in inventory), False otherwise.

Definition at line 1343 of file atrinik_object.c.

static PyObject* Atrinik_Object_Protection ( Atrinik_Object what,
PyObject *  args 
) [static]

object.Protection(int nr)

Get object's protection value for the given protection ID.

Parameters:
nrProtection ID. One of _attacks.
Exceptions:
IndexErrorif the protection ID is invalid.
Returns:
The protection value.

Definition at line 1526 of file atrinik_object.c.

static PyObject* Atrinik_Object_ReadKey ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.ReadKey(string key)

Get key value of an object.

Parameters:
keyKey to look for.
Returns:
Value for the key if found, None otherwise.

Definition at line 1405 of file atrinik_object.c.

static PyObject* Atrinik_Object_Remove ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Remove()

Takes the object out of whatever map or inventory it is in. The object can then be inserted or teleported somewhere else, or just left alone for the garbage collection to take care of.

Exceptions:
AtrinikErrorif one of the involved objects is attempted to be removed (activator, who or other).

Definition at line 1195 of file atrinik_object.c.

static PyObject* Atrinik_Object_Save ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Save()

Dump an object, as if it was being saved to map or player file. Useful for saving the object somewhere for loading later with LoadObject().

Returns:
String containing the saved object.

Definition at line 1283 of file atrinik_object.c.

static PyObject* Atrinik_Object_Say ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.Say(string message, bool [mode = False])

Object says message to everybody on its map.

Parameters:
messageThe message to say.
modeIf True, message is not prefixed with "object.name says: ".

Definition at line 434 of file atrinik_object.c.

static PyObject* Atrinik_Object_SayTo ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.SayTo(object target, string message, bool [mode = False])

NPC talks only to player but map gets "xxx talks to yyy" msg too.

Parameters:
targetTarget object the NPC is talking to.
messageThe message to say.
modeIf True, there is no "xxx talks to yyy" map message. The message is not prefixed with "xxx says: " either.

Definition at line 468 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetAttack ( Atrinik_Object what,
PyObject *  args 
) [static]

object.SetAttack(int nr, int val)

Set object's attack value for the given attack ID.

Parameters:
nrAttack ID. One of _attacks.
valValue to set.
Exceptions:
IndexErrorif the attack ID is invalid.
OverflowErrorif the value to set is not in valid range.

Definition at line 1610 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetGender ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.SetGender(int gender)

Changes the gender of object.

Parameters:
genderThe new gender to set. One of the constants from Gender module constants.

Definition at line 543 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetGod ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.SetGod(string name)

Make an object become follower of a different god.

The object must have the 'divine prayers' skill.

Parameters:
nameName of the god.

Definition at line 215 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetGuildForce ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.SetGuildForce(string rank_string)

Set the current rank of object to rank_string.

This only sets the title. The guild tag is in slaying field of the force object.

To test for guild force, use GetGuildForce().

To set the guild tag you can use this function, because it returns the guild force object after setting the title.

Parameters:
rank_stringThe rank string in the guild to set.
Returns:
The guild force object if found.

Definition at line 594 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetPosition ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.SetPosition(int x, int y)

Sets new position coordinates for the object.

Cannot be used to move objects out of containers, use Drop() or TeleportTo() for that.

Parameters:
xNew X position on the same map
yNew Y position on the same map

Definition at line 1220 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetProtection ( Atrinik_Object what,
PyObject *  args 
) [static]

object.SetProtection(int nr, int val)

Set object's protection value for the given protection ID.

Parameters:
nrProtection ID. One of _attacks.
valValue to set.
Exceptions:
IndexErrorif the protection ID is invalid.
OverflowErrorif the value to set is not in valid range.

Definition at line 1553 of file atrinik_object.c.

static PyObject* Atrinik_Object_SquaresAround ( Atrinik_Object what,
PyObject *  args,
PyObject *  keywds 
) [static]

object.SquaresAround(int range, int [type = AROUND_ALL], int [beyond = False], function [callable = None])

Looks around the specified object and returns a list of tuples containing the squares around it in a specified range. The tuples have a format of (map, x, y).

Example that ignores walls and floors with grass:

from Atrinik import *

activator = WhoIsActivator()

def cmp_squares(m, x, y, obj):
    # 'obj' is now same as 'activator'.
    try:
        return m.GetLayer(x, y, LAYER_FLOOR)[0].name == "grass"
    # Exception was raised; ignore it, as it probably means there is no
    # floor.
    except:
        return False

for (m, x, y) in activator.SquaresAround(1, type = AROUND_WALL, callable = cmp_squares):
    for ob in m.GetLayer(x, y, LAYER_FLOOR):
        print(ob)
Parameters:
rangeRange around which to look at the squares. Must be higher than 0.
typeOne or a combination of Types for object.SquaresAround() constants.
beyondIf True and one of checks from 'type' parameter matches, all squares beyond the one being checked will be ignored as well.
callableDefines function to call for comparisons. The function should have parameters in the order of map, x, y, obj where map is the map, x/y are the coordinates and obj is the object that SquaresAround() was called for. The function should return True if the square should be considered ignored, False otherwise. 'type' being AROUND_ALL takes no effect if this is set, but it can be combined with other types.
Returns:
A list containing tuples of the squares.

Definition at line 1710 of file atrinik_object.c.

static PyObject* Atrinik_Object_Take ( Atrinik_Object obj,
PyObject *  what 
) [static]

object.Take(object what)

Force 'object' to pick up 'what'.

Parameters:
whatThe object to pick up. If a string, this is equivalent of /take command.
Exceptions:
TypeErrorif 'what' is neither an Atrinik object nor a string.

Definition at line 353 of file atrinik_object.c.

static PyObject* Atrinik_Object_TeleportTo ( Atrinik_Object obj,
PyObject *  args,
PyObject *  keywds 
) [static]

object.TeleportTo(string map, int x, int y, bool [unique = False], bool [sound = True])

Teleport object to the given position of map.

Parameters:
pathMap path to teleport the object to.
xX position on the map.
yY position on the map.
uniqueIf True, the destination will be unique map for the player.
soundIf False, will not play a sound effect.

Definition at line 245 of file atrinik_object.c.

static PyObject* Atrinik_Object_Write ( Atrinik_Object obj,
PyObject *  args,
PyObject *  keywds 
) [static]

object.Write(string message, string [color = COLOR_ORANGE], int [flags = 0])

Writes a message to a specific player object.

Parameters:
messageThe message to write.
colorColor to write the message in. Can be one of Color HTML notations or a HTML color notation.
flagsOptional flags, one of New draw info flags.

Definition at line 508 of file atrinik_object.c.

static PyObject* Atrinik_Object_WriteKey ( Atrinik_Object obj,
PyObject *  args 
) [static]

object.WriteKey(string key, string [value = None], int [add_key = True])

Set the key value of an object.

Parameters:
keyKey to look for.
valueValue to set for the key. If not passed, will clear the key's value if the key is found.
add_keyWhether to add the key if it's not found in the object.
Returns:
1 on success, 0 on failure.

Definition at line 1427 of file atrinik_object.c.