 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
33 #define EXISTCHECK(ob) { \
34 if (!ob || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
35 PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \
44 #define TYPEEXISTCHECK(ob) { \
45 if (!ob || !PyObject_TypeCheck((PyObject*)ob, &Crossfire_ObjectType) || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
46 PyErr_SetString(PyExc_ReferenceError, "Not a Crossfire object or Crossfire object no longer exists"); \
50 #define EXISTCHECK_INT(ob) { \
51 if (!ob || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
52 PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \
85 PyErr_SetString(PyExc_TypeError,
"Cannot delete the Title attribute");
89 PyErr_SetString(PyExc_TypeError,
"The Title attribute must be a string");
92 if (!PyArg_Parse(value,
"s", &val))
122 if (value == Py_None)
136 if (!PyArg_ParseTuple(args,
"s|i", &
message, &color))
145 const char *knowledge;
148 if (!PyArg_ParseTuple(args,
"s", &knowledge))
155 const char *knowledge;
158 if (!PyArg_ParseTuple(args,
"s", &knowledge))
203 if (!PyArg_Parse(value,
"s", &location))
220 if (!PyArg_Parse(value,
"i", &x))
237 if (!PyArg_Parse(value,
"i", &y))
249 if (!PyArg_ParseTuple(args,
"si", &
code, &state))
266 if (!PyArg_ParseTuple(args,
"s", &
code))
273 return Py_BuildValue(
"i", state);
282 if (!PyArg_ParseTuple(args,
"si", &
code, &state))
299 if (!PyArg_ParseTuple(args,
"s", &
code))
306 return Py_BuildValue(
"i", completed);
473 PyErr_SetString(PyExc_TypeError,
"Cannot delete the attribute");
477 PyErr_SetString(PyExc_TypeError,
"The attribute must be a string");
480 if (!PyArg_Parse(value,
"s", &val))
491 if (!PyArg_Parse(value,
"i", &val))
502 if (!PyArg_Parse(value,
"f", &val))
513 if (!PyArg_Parse(value,
"i", &val))
526 PyErr_SetString(PyExc_TypeError,
"Cannot delete the Name attribute");
530 PyErr_SetString(PyExc_TypeError,
"The Name attribute must be a string");
533 if (!PyArg_Parse(value,
"s", &val))
547 PyErr_SetString(PyExc_TypeError,
"Cannot delete the NamePl attribute");
551 PyErr_SetString(PyExc_TypeError,
"The NamePl attribute must be a string");
554 if (!PyArg_Parse(value,
"s", &val))
566 if (!PyArg_Parse(value,
"i", &val))
590 if (!PyArg_Parse(value,
"i", &val))
594 PyErr_SetString(PyExc_TypeError,
"Invalid quantity");
607 if (!PyArg_Parse(value,
"s", &
face))
611 PyErr_SetString(PyExc_TypeError,
"Unknown face.");
622 if (!PyArg_Parse(value,
"s", &anim))
626 PyErr_SetString(PyExc_TypeError,
"Unknown animation.");
638 if (!PyArg_Parse(value,
"l", &val))
672 if (!PyArg_Parse(value,
"L", &val))
684 if (!PyArg_Parse(value,
"B", &move))
695 if (!PyArg_Parse(value,
"B", &move))
706 if (!PyArg_Parse(value,
"B", &move))
717 if (!PyArg_Parse(value,
"B", &move))
728 if (!PyArg_Parse(value,
"B", &move))
739 if (!PyArg_Parse(value,
"B", &move))
791 if (!PyArg_ParseTuple(args,
"i", &clone_type))
794 if (clone_type != 0 && clone_type != 1)
796 PyErr_SetString(PyExc_ValueError,
"Clone type must be 0 (object_create_clone) or 1 (object_copy).");
804 PyErr_SetString(PyExc_RuntimeError,
"Clone failed.");
818 if (!PyArg_ParseTuple(args,
"i", &count))
825 PyErr_SetString(PyExc_ValueError, err);
863 return Py_BuildValue(
"i", val);
875 victim = pcause->
obj;
894 return Py_BuildValue(
"i", result);
901 if (!PyArg_ParseTuple(args,
"s", &
message))
912 PyErr_SetString(PyExc_ValueError,
"too many NPCs");
917 cf_log(
llevError,
"warning, too long message in npcSay, will be truncated");
933 if (!PyArg_ParseTuple(args,
"ii", &x, &y))
953 if (!PyArg_ParseTuple(args,
"i", &resist))
956 return Py_BuildValue(
"l", 0);
965 if (!PyArg_ParseTuple(args,
"ii", &resist, &value))
1019 if (!PyArg_ParseTuple(args,
"s", &spellname))
1049 if (!PyArg_ParseTuple(args,
"L", &to_pay))
1054 return Py_BuildValue(
"i", val);
1067 return Py_BuildValue(
"i", val);
1075 if (!PyArg_ParseTuple(args,
"s", &keyname))
1080 return Py_BuildValue(
"s", val ? val :
"");
1089 if (!PyArg_ParseTuple(args,
"sz|i", &keyname, &value, &add_key))
1100 if (!PyArg_ParseTuple(args,
"li", &delay, &mode))
1111 if (!PyArg_ParseTuple(args,
"s", &whatstr))
1134 if (!PyArg_ParseTuple(args,
"s", &whatstr))
1145 if (!PyArg_ParseTuple(args,
"ii", &x, &y))
1156 if (!PyArg_ParseTuple(args,
"s", &txt))
1197 const char *
skill = NULL;
1200 if (!PyArg_ParseTuple(args,
"L|si", &exp, &
skill, &arg))
1217 if (!PyArg_ParseTuple(args,
"i", &dir))
1226 if (!PyArg_ParseTuple(args,
"ii", &x, &y))
1247 op2 = activator->
obj;
1255 if (!PyArg_ParseTuple(args,
"i", &
level))
1271 return (left->
obj < right->
obj ? -1 : (left->
obj == right->
obj ? 0 : 1));
1280 Py_INCREF(Py_NotImplemented);
1281 return Py_NotImplemented;
1285 if (result == -1 && PyErr_Occurred())
1290 result = (result == 0);
1293 result = (result != 0);
1296 result = (result <= 0);
1299 result = (result >= 0);
1302 result = (result == -1);
1305 result = (result == 1);
1308 return PyBool_FromLong(result);
1451 { NULL, NULL, NULL, NULL, NULL }
1494 { NULL, NULL, 0, NULL }
1510 return (PyObject *)
self;
1521 Py_TYPE(
self)->tp_free(obj);
1536 return (PyObject *)
self;
1547 Py_TYPE(
self)->tp_free(obj);
1567 PyObject_HashNotImplemented,
1568 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1569 "Crossfire objects",
1588 { NULL, NULL, NULL, NULL, NULL }
1601 { NULL, NULL, 0, NULL }
1636 if (plwrap != NULL) {
1640 pyobj = (PyObject *)plwrap;
1643 if (wrapper != NULL) {
1644 wrapper->
obj = what;
1647 pyobj = (PyObject *)wrapper;
#define FLAG_IS_TURNABLE
Object can change face with direction.
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
static PyObject * Player_GetObjectProperty(Crossfire_Player *whoptr, void *closure)
#define FLAG_USE_BOW
(Monster) can apply and fire bows
#define FLAG_RUN_AWAY
Object runs away from nearest player \ but can still attack at a distance.
static int Object_SetMoveOn(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_TITLE
static PyGetSetDef Player_getseters[]
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
static PyObject * Crossfire_Object_Drop(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_CastAbility(Crossfire_Object *who, PyObject *args)
sstring cf_query_name_pl(object *ob)
static PyObject * Crossfire_Object_Move(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_X
static PyObject * Crossfire_Object_Teleport(Crossfire_Object *who, PyObject *args)
object * cf_object_check_for_spell(object *op, const char *name)
Wrapper for check_spell_known().
PyObject_HEAD object * obj
static PyObject * Crossfire_Object_CheckTrigger(Crossfire_Object *who, PyObject *args)
sstring cf_add_string(const char *str)
Wrapper for add_string().
#define FLAG_USE_RANGE
(Monster) can apply and use range items
static PyObject * Crossfire_Object_ForgetSpell(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetExpMul(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_CHA
#define CFAPI_OBJECT_PROP_ARCH_NAME
static PyObject * Crossfire_Object_WriteKey(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
@ llevError
Error, serious thing.
void cf_player_set_marked_item(object *op, object *ob)
#define FLAG_ANIMATE
The object looks at archetype for faces.
int cf_object_teleport(object *ob, mapstruct *map, int x, int y)
int cf_object_out_of_map(object *op, int x, int y)
PyObject_HEAD partylist * party
static PyObject * Object_GetNamePl(Crossfire_Object *whoptr, void *closure)
char * cf_object_get_string_property(object *op, int propcode, char *buf, int size)
int npc_msg_count
How many NPCs reacted to the text being said.
#define FLAG_HITBACK
Object will hit back when hit.
long cf_object_get_long_property(object *op, long propcode)
#define CFAPI_OBJECT_PROP_LEVEL
#define FLAG_USE_SCROLL
(Monster) can read scroll
static PyObject * Object_GetMoveAllow(Crossfire_Object *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_BED_X
static PyObject * Object_GetFlagProperty(Crossfire_Object *whoptr, void *closure)
sstring cf_object_get_sstring_property(object *op, int propcode)
int cf_player_knowledge_has(object *op, const char *knowledge)
Wrapper for knowledge_player_has().
static void add_object_assoc(object *key, PyObject *value)
static int Player_SetParty(Crossfire_Player *whoptr, PyObject *value, void *closure)
static int Object_SetName(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetMap(Crossfire_Object *whoptr, PyObject *value, void *closure)
object * cf_object_get_object_property(object *op, int propcode)
static int Crossfire_Object_InternalCompare(Crossfire_Object *left, Crossfire_Object *right)
static int Object_SetMoveSlow(Crossfire_Object *whoptr, PyObject *value, void *closure)
int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Wrapper for cast_spell().
void cf_fix_object(object *op)
Wrapper for fix_object().
static PyObject * Crossfire_Object_CreateTimer(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_KnowSpell(Crossfire_Object *who, PyObject *args)
#define TYPEEXISTCHECK(ob)
This is meant to be used for parameters where you don't know if the type of the object is correct.
#define CFAPI_OBJECT_PROP_SLAYING
#define CFAPI_OBJECT_PROP_FRIENDLY
#define CFAPI_OBJECT_PROP_DEX
void cf_player_knowledge_give(object *op, const char *knowledge)
Wrapper for knowledge_give();.
#define CFAPI_OBJECT_PROP_ARCHETYPE
#define FLAG_FRIENDLY
Will help players.
static PyObject * Player_GetIP(Crossfire_Player *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_COUNT
static PyObject * Crossfire_Object_CreateInside(Crossfire_Object *who, PyObject *args)
static PyObject * Player_KnowledgeKnown(Crossfire_Player *who, PyObject *args)
#define FLAG_LIFESAVE
Saves a players' life once, then destr.
static int Object_SetPickable(Crossfire_Object *whoptr, PyObject *value, void *closure)
object * cf_create_object_by_name(const char *name)
Wrapper for create_archetype() and create_archetype_by_object_name().
#define CFAPI_OBJECT_PROP_LAST_EAT
#define CFAPI_OBJECT_PROP_MOVE_ON
static PyObject * Crossfire_Object_AddExp(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_STR
#define FLAG_USE_ARMOUR
(Monster) can wear armour/shield/helmet
#define CFAPI_OBJECT_PROP_GOD
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
static PyObject * Crossfire_Player_CanPay(Crossfire_Player *who, PyObject *args)
char * cf_query_name(object *ob, char *name, int size)
void cf_object_set_float_property(object *op, int propcode, float value)
static PyObject * Crossfire_Object_InsertInto(Crossfire_Object *who, PyObject *args)
#define FLAG_BLIND
If set, object cannot see (visually)
static int Object_SetOwner(Crossfire_Object *whoptr, PyObject *value, void *closure)
int cf_object_apply(object *op, object *author, int flags)
Wrapper for apply_manual().
#define CFAPI_OBJECT_PROP_MAXSP
#define CFAPI_OBJECT_PROP_RAW_NAME
#define FLAG_WIZ
Object has special privilegies.
#define FLAG_BEEN_APPLIED
Object was ever applied, for identification purposes.
static PyObject * Crossfire_Object_Event(Crossfire_Object *who, PyObject *args)
static int Object_SetFace(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyMethodDef PlayerMethods[]
#define FLAG_SCARED
Monster is scared (mb player in future)
int64_t cf_object_get_int64_property(object *op, int propcode)
int cf_object_move_to(object *op, int x, int y)
Wrapper for move_to().
PyObject * Crossfire_Party_wrap(partylist *what)
void cf_object_free_drop_inventory(object *ob)
Wrapper for object_free_drop_inventory().
#define CFAPI_OBJECT_PROP_Y
static const flag_definition flags[]
Flag mapping.
tag_t count
Unique object number for this object.
#define CFAPI_OBJECT_PROP_ENEMY
#define FLAG_XRAYS
X-ray vision.
int cf_player_can_pay(object *op)
Wrapper for can_pay().
#define FLAG_MAKE_INVIS
(Item) gives invisibility when applied
#define CFAPI_OBJECT_PROP_MOVE_TYPE
void cf_object_set_string_property(object *op, int propcode, const char *value)
int64_t cf_object_perm_exp(object *op)
Wrapper for PERM_EXP macro.
#define CFAPI_OBJECT_PROP_FACE
#define CFAPI_OBJECT_PROP_ENVIRONMENT
void cf_quest_set_player_state(object *pl, sstring quest_code, int state)
Wrapper for quest_set_player_state();.
static PyObject * Player_GetParty(Crossfire_Player *whoptr, void *closure)
int cf_object_pickup(object *op, object *what)
static PyObject * Player_GetIntProperty(Crossfire_Player *whoptr, void *closure)
int cf_player_arrest(object *who)
Wrapper for player_arrest().
static PyObject * Crossfire_Object_SetResist(Crossfire_Object *who, PyObject *args)
#define FLAG_STEALTH
Will wake monsters with less range.
static PyObject * Crossfire_Object_Remove(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetTotalExp(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_ITEM_POWER
#define FLAG_CAST_SPELL
(Monster) can learn and cast spells
#define FLAG_CURSED
The object is cursed.
#define FLAG_CAN_ROLL
Object can be rolled.
#define CFAPI_OBJECT_PROP_CURRENT_WEAPON
CFPContext * current_context
static int Player_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure)
void cf_player_set_title(object *op, const char *title)
void cf_spring_trap(object *trap, object *victim)
Wrapper for spring_trap().
static PyObject * Crossfire_Object_Pay(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetMoveOn(Crossfire_Object *whoptr, void *closure)
int cf_object_pay_amount(object *pl, uint64_t to_pay)
Wrapper for pay_for_amount().
#define CFAPI_OBJECT_PROP_INVISIBLE
PyObject * Crossfire_Object_wrap(object *what)
Python initialized.
Plugin animator file specs[Config] name
static PyObject * Object_GetMap(Crossfire_Object *whoptr, void *closure)
#define FLAG_REMOVED
Object is not in any map or invenory.
int cf_object_change_abil(object *op, object *tmp)
Wrapper for change_abil().
int cf_object_set_key(object *op, const char *keyname, const char *value, int add_key)
Sets a value for specified key, equivalent to object_set_value().
static int Object_SetFloatProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Player_SetMarkedItem(Crossfire_Player *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_SKILL
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
static PyObject * Crossfire_Object_CheckInventory(Crossfire_Object *who, PyObject *args)
PyObject_HEAD object * obj
static PyObject * Player_QuestSetState(Crossfire_Player *whoptr, PyObject *args)
void cf_quest_start(object *pl, sstring quest_code, int state)
Wrapper for quest_start().
PyTypeObject Crossfire_PlayerType
static int Object_SetValue(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_ALIVE
Object can fight (or be fought)
#define CFAPI_OBJECT_PROP_ANIM_SPEED
static event_registration m
#define CFAPI_OBJECT_PROP_AC
#define FLAG_SEE_INVISIBLE
Will see invisible player.
#define MOVE_ALL
Mask of all movement types.
int cf_object_set_animation(object *op, const char *animation)
Set the object's animation.
#define CFAPI_OBJECT_PROP_MOVE_OFF
void cf_log_plain(LogLevel logLevel, const char *message)
Wrapper for LOG() that uses directly a buffer, without format.
PyObject_HEAD mapstruct * map
#define CF_IS_PYSTR(cfpy_obj)
#define FLAG_KNOWN_MAGICAL
The object is known to be magical.
#define CFAPI_OBJECT_PROP_HP
#define CFAPI_OBJECT_PROP_MAXHP
partylist * cf_player_get_party(object *op)
void cf_object_say(object *op, const char *msg)
static PyObject * Player_QuestWasCompleted(Crossfire_Player *whoptr, PyObject *args)
#define CFAPI_OBJECT_PROP_OB_BELOW
int cf_timer_create(object *ob, long delay, int mode)
Creates a timer, equivalent of calling cftimer_create().
#define FLAG_UNPAID
Object hasn't been paid for yet.
#define CFAPI_OBJECT_PROP_TOTAL_EXP
static PyObject * Object_GetFloatProperty(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetExp(Crossfire_Object *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_BED_Y
static int Player_SetBedY(Crossfire_Player *whoptr, PyObject *value, void *closure)
void cf_object_set_int64_property(object *op, int propcode, int64_t value)
static PyObject * Crossfire_Object_QueryName(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
#define CFAPI_OBJECT_PROP_RACE
#define CFAPI_OBJECT_PROP_MOVE_BLOCK
#define CFAPI_OBJECT_PROP_FACING
#define FLAG_MONSTER
Will attack players.
static int Player_SetBedX(Crossfire_Player *whoptr, PyObject *value, void *closure)
#define FLAG_CAN_USE_SKILL
The monster can use skills.
#define CFAPI_OBJECT_PROP_WEIGHT
static PyMethodDef ObjectMethods[]
static PyObject * Player_GetBedX(Crossfire_Player *whoptr, void *closure)
MoveType cf_object_get_movetype_property(object *op, int propcode)
object * cf_object_find_by_arch_name(const object *who, const char *name)
Wrapper for object_find_by_arch_name().
mapstruct * cf_object_get_map_property(object *op, int propcode)
#define CFAPI_OBJECT_PROP_DAM
int cf_object_query_money(const object *op)
Wrapper for query_money().
static PyObject * Crossfire_Object_Clone(Crossfire_Object *who, PyObject *args)
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
static PyObject * Crossfire_Object_Say(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetValue(Crossfire_Object *whoptr, void *closure)
static int Object_SetAnim(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetPickable(Crossfire_Object *whoptr, void *closure)
#define MAX_NPC
How many NPCs maximum will reply to the player.
static PyObject * Crossfire_Object_RemoveDepletion(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetMoveOff(Crossfire_Object *whoptr, void *closure)
uint8_t type
PLAYER, BULLET, etc.
object * cf_object_clone(object *op, int clonetype)
Clone an object.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
static PyObject * Player_GetTitle(Crossfire_Object *whoptr, void *closure)
CF_PYTHON_OBJECT(Object, Crossfire_Object_dealloc, &ObjectConvert, PyObject_HashNotImplemented, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, "Crossfire objects",(richcmpfunc) Crossfire_Object_RichCompare, ObjectMethods, Object_getseters, NULL, Crossfire_Object_new)
#define CFAPI_OBJECT_PROP_EXP
#define CFAPI_OBJECT_PROP_SPEED
#define CFAPI_OBJECT_PROP_TYPE
#define CFAPI_OBJECT_PROP_NROF
#define FLAG_BLOCKSVIEW
Object blocks view.
static void free_object_assoc(object *key)
double cf_object_get_double_property(object *op, int propcode)
PyObject * Crossfire_Archetype_wrap(archetype *what)
Information on one title.
#define FLAG_NO_PICK
Object can't be picked up.
#define FLAG_NO_SAVE
If set (through plugins), the object is not saved on maps.
static int Object_SetMoveType(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_RichCompare(Crossfire_Object *left, Crossfire_Object *right, int op)
static int Object_SetMoveBlock(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_REFL_MISSILE
Arrows will reflect from object.
static int Object_SetExp(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_ATTACK_TYPE
static PyObject * Object_GetMaterial(Crossfire_Object *whoptr, void *closure)
int cf_object_get_flag(object *ob, int flag)
#define FLAG_IS_FLOOR
Can't see what's underneath this object.
sstring cf_player_get_client(object *op)
static PyObject * Crossfire_Object_GetOutOfMap(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_OWNER
void cf_object_drop(object *op, object *author)
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
Wrapper for transfer_ob().
void cf_object_set_movetype_property(object *op, int propcode, MoveType value)
#define CFAPI_OBJECT_PROP_NAME_PLURAL
static PyObject * Crossfire_Object_Apply(Crossfire_Object *who, PyObject *args)
static std::map< object *, PyObject * > object_assoc_table
#define FLAG_RANDOM_MOVE
NPC will move randomly.
void cf_free_string(sstring str)
Wrapper for free_string().
#define FLAG_USE_WEAPON
(Monster) can wield weapons
object * cf_object_present_archname_inside(object *op, char *whatstr)
Kinda wrapper for arch_present_in_ob().
#define CFAPI_OBJECT_PROP_WIS
#define CFAPI_OBJECT_PROP_POW
archetype * cf_object_get_archetype_property(object *op, int propcode)
#define FLAG_SEE_IN_DARK
if set ob not effected by darkness
static PyObject * Object_GetMoveSlow(Crossfire_Object *whoptr, void *closure)
#define FLAG_DAMNED
The object is very cursed.
object * cf_player_get_marked_item(object *op)
#define CFAPI_OBJECT_PROP_CONTAINER
#define FLAG_ONLY_ATTACK
NPC will evaporate if there is no enemy.
static PyObject * Crossfire_Object_Fix(Crossfire_Object *who, PyObject *args)
object * cf_object_insert_in_ob(object *op, object *where)
Wrapper for object_insert_in_ob().
#define CFAPI_OBJECT_PROP_INVENTORY
#define CFAPI_OBJECT_PROP_MAP
int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix)
int cf_object_move(object *op, int dir, object *originator)
static PyObject * Crossfire_Object_PayAmount(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_ChangeAbil(Crossfire_Object *who, PyObject *args)
object * cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
Wrapper for object_split().
void cf_player_set_party(object *op, partylist *party)
#define CFAPI_PLAYER_PROP_TRANSPORT
#define FLAG_SLEEP
NPC is sleeping.
static PyObject * Crossfire_Object_GetResist(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_ReadKey(Crossfire_Object *who, PyObject *args)
#define NDI_UNIQUE
Print immediately, don't buffer.
#define FLAG_GENERATOR
Will generate type ob->stats.food.
sstring name
The name of the object, obviously...
PyTypeObject Crossfire_PartyType
#define CFAPI_OBJECT_PROP_ANIMATION
#define CFAPI_OBJECT_PROP_INT
#define CFAPI_OBJECT_PROP_SP
static int Object_SetMoveOff(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetOtherArchetype(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_NAME
#define CFAPI_OBJECT_PROP_EXP_MULTIPLIER
static PyObject * Crossfire_Object_LearnSpell(Crossfire_Object *who, PyObject *args)
void cf_object_set_flag(object *ob, int flag, int value)
#define FLAG_NO_DAMAGE
monster can't be damaged
#define FLAG_IS_THROWN
Object is designed to be thrown.
static PyObject * Object_GetMoveBlock(Crossfire_Object *whoptr, void *closure)
const typedef char * sstring
#define FLAG_STAND_STILL
NPC will not (ever) move.
#define FLAG_UNDEAD
Monster is undead.
static PyObject * Crossfire_Object_CheckArchInventory(Crossfire_Object *who, PyObject *args)
static PyObject * Player_GetMarkedItem(Crossfire_Player *whoptr, void *closure)
static PyObject * Player_GetBedMap(Crossfire_Player *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_BED_MAP
int cf_object_set_nrof(object *, int nrof)
#define CFAPI_OBJECT_PROP_WC
#define CFAPI_OBJECT_PROP_GLOW_RADIUS
static PyObject * Player_QuestStart(Crossfire_Player *whoptr, PyObject *args)
#define FLAG_APPLIED
Object is ready for use by living.
int cf_object_check_trigger(object *op, object *cause)
Wrapper for check_trigger().
static PyObject * Player_GetBedY(Crossfire_Player *whoptr, void *closure)
CF_PYTHON_NUMBER_METHODS(Object, Crossfire_Object_Long)
#define CFAPI_OBJECT_PROP_CON
int cf_quest_get_player_state(object *pl, sstring quest_code)
Wrapper for quest_get_player_state().
static PyObject * find_assoc_pyobject(object *key)
void cf_object_set_long_property(object *op, int propcode, long value)
static PyObject * Object_GetMoveType(Crossfire_Object *whoptr, void *closure)
#define FLAG_IS_USED_UP
When (–food<0) the object will exit.
static int Object_SetFlagProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
const char * cf_object_get_key(object *op, const char *keyname)
Gets value for specified key, equivalent of object_get_value().
#define CFAPI_OBJECT_PROP_GP
#define FLAG_STARTEQUIP
Object was given to player at start.
static void Crossfire_Object_dealloc(PyObject *obj)
#define CFAPI_OBJECT_PROP_LAST_SP
static PyGetSetDef Object_getseters[]
static PyObject * Player_GetClient(Crossfire_Player *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_MATERIAL
#define CFAPI_OBJECT_PROP_DURATION
#define CFAPI_OBJECT_PROP_OTHER_ARCH
static PyObject * Object_GetIntProperty(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_OB_ABOVE
static PyObject * Crossfire_Object_MoveTo(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_Reposition(Crossfire_Object *who, PyObject *args)
#define EXISTCHECK_INT(ob)
#define FLAG_CONFUSED
Will also be unable to cast spells.
sstring npc_msgs[MAX_NPC]
What the NPCs will say.
#define CFAPI_OBJECT_PROP_MOVE_ALLOW
static PyObject * Crossfire_Object_Long(PyObject *obj)
static int Object_SetStringProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
Setters.
static int Object_SetIntProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
char * cf_player_get_title(object *op, char *title, int size)
static int Player_SetBedMap(Crossfire_Player *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetMoney(Crossfire_Object *whoptr, void *closure)
static int Object_SetMoveAllow(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_Split(Crossfire_Object *who, PyObject *args)
#define FLAG_SPLITTING
Object splits into stats.food other objs.
int cf_object_set_face(object *op, const char *face)
Set the object's face.
#define CFAPI_OBJECT_PROP_MOVE_SLOW
static PyObject * Player_QuestGetState(Crossfire_Player *whoptr, PyObject *args)
void cf_player_message(object *op, const char *txt, int flags)
static PyObject * Object_GetArchetype(Crossfire_Object *whoptr, void *closure)
static PyObject * Player_GiveKnowledge(Crossfire_Player *who, PyObject *args)
object * cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Wrapper for object_insert_in_map_at().
#define CFAPI_OBJECT_PROP_LUCK
void cf_object_forget_spell(object *op, object *sp)
Wrapper for do_forget_spell(), except takes an object, not a string.
int cf_object_pay_item(object *op, object *pl)
Wrapper for pay_for_item().
Crossfire Architecture the general intention is to enhance the enjoyability and playability of CF In this code
object * cf_object_insert_object(object *op, object *container)
#define FLAG_WAS_WIZ
Player was once a wiz.
int16_t cf_object_get_resistance(object *op, int rtype)
void cf_object_set_int_property(object *op, int propcode, int value)
static PyObject * Crossfire_Object_Cast(Crossfire_Object *who, PyObject *args)
static int Object_SetEnemy(Crossfire_Object *whoptr, PyObject *value, void *closure)
static std::vector< std::string > split(const std::string &field, const std::string &by)
#define CFAPI_OBJECT_PROP_VALUE
#define CFAPI_OBJECT_PROP_MESSAGE
#define CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY
static PyObject * Crossfire_Object_ActivateRune(Crossfire_Object *who, PyObject *args)
#define FLAG_USE_RING
(Monster) can use rings, boots, gauntlets, etc
#define CFAPI_OBJECT_PROP_MAXGP
#define CFAPI_OBJECT_PROP_COUNT
static void Crossfire_Player_dealloc(PyObject *obj)
#define FLAG_IDENTIFIED
Item is identifiable (e.g.
static PyObject * Object_GetExists(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_SUBTYPE
void cf_object_remove(object *op)
Wrapper for object_remove().
static PyObject * Crossfire_Object_Arrest(Crossfire_Object *who, PyObject *args)
void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Wrapper for change_exp().
static int Object_SetNamePl(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetQuantity(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_PermExp(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetSStringProperty(Crossfire_Object *whoptr, void *closure)
#define FLAG_UNIQUE
Item is really unique (UNIQUE_ITEMS)
static PyObject * Crossfire_Object_Take(Crossfire_Object *who, PyObject *args)
sstring cf_player_get_ip(object *op)
PyObject * Crossfire_Map_wrap(mapstruct *what)
#define CFAPI_OBJECT_PROP_FP
static PyObject * Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
void cf_object_set_object_property(object *op, int propcode, object *value)
PyTypeObject Crossfire_ObjectType
#define CFAPI_OBJECT_PROP_LAST_GRACE
void cf_object_learn_spell(object *op, object *spell, int special_prayer)
Wrapper for do_learn_spell().
static PyObject * Crossfire_Player_Message(Crossfire_Player *who, PyObject *args)
int cf_object_get_int_property(object *op, int propcode)
int cf_quest_was_completed(object *pl, sstring quest_code)
Wrapper for quest_was_completed().
static PyObject * Object_GetObjectProperty(Crossfire_Object *whoptr, void *closure)
float cf_object_get_float_property(object *op, int propcode)
#define CFAPI_OBJECT_PROP_DIRECTION
void cf_object_set_resistance(object *op, int rtype, int16_t value)
static PyObject * Object_GetName(Crossfire_Object *whoptr, void *closure)
int cf_object_remove_depletion(object *op, int level)
Wrapper for remove_depletion().
#define CFAPI_OBJECT_PROP_MATERIAL_NAME
#define FLAG_REFL_SPELL
Spells (some) will reflect from object.
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the and treasurelist definitions into a single or trs file and the graphics into a face(metadata) and .tar(bitmaps) file
#define CFAPI_OBJECT_PROP_SPEED_LEFT
PyTypeObject Crossfire_MapType