|
Atrinik Server 2.5
|
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) |
Object related functions used in Atrinik Python plugin.
| static PyObject* Atrinik_Object_Activate | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
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] |
Activate a rune.
| who | Who should be affected by the effects of the rune. |
| TypeError | if '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] |
Forces 'object' to apply 'what'.
| what | What object to apply. |
| flags | Reasonable combination of the following:
|
| 0 | Object cannot apply objects of that type. |
| 1 | Object was applied. |
| 2 | Object 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] |
Get object's attack value for the given attack ID.
| nr | Attack ID. One of _attacks. |
| IndexError | if the attack ID is invalid. |
Definition at line 1583 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Cast | ( | Atrinik_Object * | obj, |
| PyObject * | args, | ||
| PyObject * | keywds | ||
| ) | [static] |
Object casts the spell ID 'spell'.
| spell | ID of the spell to cast. You can lookup spell IDs by name using GetSpellNr(). |
| target | Target object for spells that require a valid target. |
| mode | One of Casting modes. If -1 (default), will try to figure out the appropriate mode automatically. |
| direction | The direction to cast the spell in. |
| option | Additional 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] |
Cast identify on target.
| target | The target object. |
| mode | One of Identify modes. |
| marked | Marked item. |
Definition at line 1243 of file atrinik_object.c.
| static PyObject* Atrinik_Object_ChangeAbil | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Permanently alters an object's stats/flags based on another what.
| what | Object that is giving bonuses/penalties to 'object'. |
Definition at line 1639 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Clone | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Clone an object.
You should do something with the clone. TeleportTo() or InsertInside() are useful functions for that.
| mode | Optional mode, one of:
|
Definition at line 1369 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Communicate | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Object says message to everybody on its map. Emote commands may be used.
| message | The message to say. |
Definition at line 409 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Controller | ( | Atrinik_Object * | what, |
| PyObject * | args | ||
| ) | [static] |
Get object's controller (the player).
| AtrinikError | if 'object' is not a player. |
Definition at line 1506 of file atrinik_object.c.
| static PyObject* Atrinik_Object_CreateForce | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Create a force object in object's inventory.
| name | String ID of the force object. |
| time | If non-zero, the force will be removed again after time / 0.02 ticks. Optional, defaults to 0. |
Definition at line 960 of file atrinik_object.c.
| static PyObject* Atrinik_Object_CreateObject | ( | Atrinik_Object * | obj, |
| PyObject * | args, | ||
| PyObject * | keywds | ||
| ) | [static] |
Creates an object from archname and inserts it into 'object'.
| archname | Name of the arch to create. |
| nrof | Number of objects to create. |
| value | If not -1, will be used as value for the new object. |
| identified | If False the object will not be identified. |
| AtrinikError | if 'archname' references an invalid archetype. |
Definition at line 1001 of file atrinik_object.c.
| static PyObject* Atrinik_Object_CreatePlayerForce | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
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.
| force_name | Name of the player force |
| time | If non-zero, the force will be removed again after time / 0.02 ticks. Optional, defaults to 0. |
Definition at line 795 of file atrinik_object.c.
| static PyObject* Atrinik_Object_CreatePlayerInfo | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
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.
| name | Name of the player info |
Definition at line 848 of file atrinik_object.c.
| static PyObject* Atrinik_Object_CreateTimer | ( | Atrinik_Object * | what, |
| PyObject * | args | ||
| ) | [static] |
Create a timer for an object.
| delay | How long until the timer event gets executed for the object |
| mode | If 1, delay is in seconds, if 2, delay is in ticks (8 ticks = 1 second) |
Definition at line 1474 of file atrinik_object.c.
| static PyObject* Atrinik_Object_CreateTreasure | ( | Atrinik_Object * | obj, |
| PyObject * | args, | ||
| PyObject * | keywds | ||
| ) | [static] |
Create treasure inside (or below, if GT_ENVIRONMENT flag was set) the object.
| treasure | Treasure list name to generate. If None, will try to generate treasure based on the object's randomitems. |
| level | Level 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. |
| flags | A combination of Treasure generation flags. |
| a_chance | Chance for the treasure to become artifact, if possible. A value of 0 will disable any chance for artifacts. |
| ValueError | if treasure is not valid. |
Definition at line 1873 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Decrease | ( | Atrinik_Object * | what, |
| PyObject * | args | ||
| ) | [static] |
Decreases an object, removing it if there's nothing left to decrease.
| num | How much to decrease the object by. |
Definition at line 1659 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Drop | ( | Atrinik_Object * | obj, |
| PyObject * | what | ||
| ) | [static] |
Make 'object' drop 'what'.
| what | Object to drop. If a string, this is equivalent of /drop command. |
| TypeError | if '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] |
Looks for a certain object in object's inventory.
| mode | How to search the inventory. One of Modes for object.FindObject(). |
| archname | Arch name of the object to search for. If None, can be any. |
| name | Name of the object. If None, can be any. |
| title | Title of the object. If None, can be any. |
| type | Type of the object. If -1, can be any. |
| multiple | If True, the return value will be a list of all matching objects, instead of just the first one found. |
| unpaid | Only match unpaid objects. |
| ValueError | if there were no conditions to search for. |
Definition at line 1109 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Fix | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
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] |
Get cost of an object in integer value.
| what | The object to query cost for. |
| type | One of Cost modes. |
Definition at line 1307 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetGender | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get an object's gender.
Definition at line 531 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetGod | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Determine the object's god.
Definition at line 201 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetGuildForce | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get the guild force from player's inventory.
Definition at line 644 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetMoney | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get all the money the object is carrying as integer.
Definition at line 1329 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetName | ( | Atrinik_Object * | what, |
| PyObject * | args | ||
| ) | [static] |
An equivalent of query_base_name().
| caller | Object calling this. |
Definition at line 1448 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetNextPlayerInfo | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get next player info object in object's inventory with same name as player_info.
| player_info | Previously found player info object. |
Definition at line 921 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetPlayerInfo | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get the first player info object with the specified name in object's inventory.
| name | Name of the player info |
Definition at line 889 of file atrinik_object.c.
| static PyObject* Atrinik_Object_GetRangeVector | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get the distance and direction from one object to another.
| to | Object to which the distance is calculated. |
| flags | One or a combination of Range Vector Flags. |
Definition at line 1830 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Hit | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Make 'object' hit 'target' for the specified amount of damage.
| target | The object to hit. |
| damage | How 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. |
| ValueError | if '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] |
Insert 'object' into 'where'.
| where | Where to insert 'object'. |
Definition at line 284 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Move | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
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.
| direction | Direction to move into, one of Direction constants. |
| AtrinikError | if object is not on map. |
Definition at line 1947 of file atrinik_object.c.
| static PyObject* Atrinik_Object_PayAmount | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get the object to pay a specified amount of money in copper.
| value | The amount of money in copper to pay for. |
Definition at line 1343 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Protection | ( | Atrinik_Object * | what, |
| PyObject * | args | ||
| ) | [static] |
Get object's protection value for the given protection ID.
| nr | Protection ID. One of _attacks. |
| IndexError | if the protection ID is invalid. |
Definition at line 1526 of file atrinik_object.c.
| static PyObject* Atrinik_Object_ReadKey | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Get key value of an object.
| key | Key to look for. |
Definition at line 1405 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Remove | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
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.
| AtrinikError | if 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] |
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().
Definition at line 1283 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Say | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Object says message to everybody on its map.
| message | The message to say. |
| mode | If 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] |
NPC talks only to player but map gets "xxx talks to yyy" msg too.
| target | Target object the NPC is talking to. |
| message | The message to say. |
| mode | If 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] |
Set object's attack value for the given attack ID.
| nr | Attack ID. One of _attacks. |
| val | Value to set. |
| IndexError | if the attack ID is invalid. |
| OverflowError | if 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] |
Changes the gender of object.
| gender | The 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] |
Make an object become follower of a different god.
The object must have the 'divine prayers' skill.
| name | Name of the god. |
Definition at line 215 of file atrinik_object.c.
| static PyObject* Atrinik_Object_SetGuildForce | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
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.
| rank_string | The rank string in the guild to set. |
Definition at line 594 of file atrinik_object.c.
| static PyObject* Atrinik_Object_SetPosition | ( | Atrinik_Object * | obj, |
| PyObject * | args | ||
| ) | [static] |
Sets new position coordinates for the object.
Cannot be used to move objects out of containers, use Drop() or TeleportTo() for that.
| x | New X position on the same map |
| y | New 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] |
Set object's protection value for the given protection ID.
| nr | Protection ID. One of _attacks. |
| val | Value to set. |
| IndexError | if the protection ID is invalid. |
| OverflowError | if 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] |
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)
| range | Range around which to look at the squares. Must be higher than 0. |
| type | One or a combination of Types for object.SquaresAround() constants. |
| beyond | If True and one of checks from 'type' parameter matches, all squares beyond the one being checked will be ignored as well. |
| callable | Defines 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. |
Definition at line 1710 of file atrinik_object.c.
| static PyObject* Atrinik_Object_Take | ( | Atrinik_Object * | obj, |
| PyObject * | what | ||
| ) | [static] |
Force 'object' to pick up 'what'.
| what | The object to pick up. If a string, this is equivalent of /take command. |
| TypeError | if '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] |
Teleport object to the given position of map.
| path | Map path to teleport the object to. |
| x | X position on the map. |
| y | Y position on the map. |
| unique | If True, the destination will be unique map for the player. |
| sound | If 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] |
Writes a message to a specific player object.
| message | The message to write. |
| color | Color to write the message in. Can be one of Color HTML notations or a HTML color notation. |
| flags | Optional 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] |
Set the key value of an object.
| key | Key to look for. |
| value | Value to set for the key. If not passed, will clear the key's value if the key is found. |
| add_key | Whether to add the key if it's not found in the object. |
Definition at line 1427 of file atrinik_object.c.
1.7.4