Atrinik Server 2.5
Defines | Functions | Variables
types/book.c File Reference
#include <global.h>

Go to the source code of this file.

Defines

#define BOOK_LEVEL_DIFF   12

Functions

void apply_book (object *op, object *tmp)

Variables

static int book_level_mod [MAX_STAT+1]
static double book_exp_mod [MAX_STAT+1]

Detailed Description

Handles code related to books.

Definition in file book.c.


Define Documentation

#define BOOK_LEVEL_DIFF   12

Maximum amount of difference in levels between the book's level and the player's literacy skill.

Definition at line 35 of file book.c.


Function Documentation

void apply_book ( object op,
object tmp 
)

Apply a book.

Sends the book contents to the player object using Send_With_Handling(), but only if the book does not have an APPLY plugin trigger.

A book can only be read if you're high enough level compared to the book's level. You will also get experience for reading books, but only if the book has not been read before.

Parameters:
opThe player object applying the book.
tmpThe book.

Definition at line 81 of file book.c.


Variable Documentation

double book_exp_mod[MAX_STAT+1] [static]
Initial value:
{
    -3.00f,
    -2.00f, -1.90f, -1.80f, -1.70f, -1.60f,
    -1.50f, -1.40f, -1.30f, -1.20f, -1.10f,
    1.00f, 1.00f, 1.00f, 1.00f, 1.00f,
    1.05f, 1.10f, 1.15f, 1.20f, 1.30f,
    1.35f, 1.40f, 1.50f, 1.55f, 1.60f,
    1.70f, 1.75f, 1.85f, 1.90f, 2.00f
}

The higher your wisdom, the more you are able to make use of the knowledge you read from books. Thus, you get more experience by reading books the more wisdom you have, and less experience if you have unnaturally low wisdom.

Definition at line 58 of file book.c.

int book_level_mod[MAX_STAT+1] [static]
Initial value:
{
    -9,
    -8, -7, -6, -5, -4,
    -4, -3, -2, -2, -1,
    0, 0, 0, 0, 0,
    1, 1, 2, 2, 3,
    3, 3, 4, 4, 5,
    6, 7, 8, 9, 10
}

Affects BOOK_LEVEL_DIFF, depending on the player's intelligence stat. If the player is intelligent enough, they may be able to read higher level books; if their intelligence is too low, the maximum level books they can read will decrease.

Definition at line 42 of file book.c.