Atrinik Server 2.5
Functions | Variables
server/party.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

void add_party_member (party_struct *party, object *op)
void remove_party_member (party_struct *party, object *op)
static party_structmake_party (const char *name)
void form_party (object *op, const char *name)
party_structfind_party (const char *name)
sint16 party_member_get_skill (object *op, object *skill)
static void party_loot_random (object *pl, object *corpse)
int party_can_open_corpse (object *pl, object *corpse)
void party_handle_corpse (object *pl, object *corpse)
void send_party_message (party_struct *party, const char *msg, int flag, object *op)
void remove_party (party_struct *party)
void party_update_who (player *pl)

Variables

const char *const party_loot_modes [PARTY_LOOT_MAX]
const char *const party_loot_modes_help [PARTY_LOOT_MAX]
party_structfirst_party = NULL

Detailed Description

This file handles party related code.

Definition in file party.c.


Function Documentation

void add_party_member ( party_struct party,
object op 
)

Add a player to party's member list.

Parameters:
partyParty to add the player to.
opThe player to add.

Definition at line 55 of file party.c.

party_struct* find_party ( const char *  name)

Find a party by name.

Parameters:
nameParty name to find.
Returns:
Party if found, NULL otherwise.

Definition at line 171 of file party.c.

void form_party ( object op,
const char *  name 
)

Form a new party.

Parameters:
opObject forming the party.
nameName of the party.

Definition at line 157 of file party.c.

static party_struct* make_party ( const char *  name) [static]

Initialize a new party structure.

Parameters:
nameName of the new party.
Returns:
The initialized party structure.

Definition at line 140 of file party.c.

int party_can_open_corpse ( object pl,
object corpse 
)

Check if player can open a party corpse.

Parameters:
plPlayer trying to open the corpse.
corpseThe corpse.
Returns:
1 if we can open the corpse, 0 otherwise.

Definition at line 309 of file party.c.

void party_handle_corpse ( object pl,
object corpse 
)

Do any special handling after a party corpse has been opened.

Parameters:
plPlayer who opened the corpse.
corpseThe corpse.

Definition at line 341 of file party.c.

static void party_loot_random ( object pl,
object corpse 
) [static]

Randomly split corpse's loot between party's members.

Parameters:
plPlayer that opened the corpse.
corpseThe corpse.

Definition at line 246 of file party.c.

sint16 party_member_get_skill ( object op,
object skill 
)

A party member has killed a monster. In the experience sharing code we call this to check for all party members to check whether they have the skill that was used to kill the monster. If they don't have the skill, they won't be counted as 'getting exp shared'.

This will also correctly handle cases where one player kills with slash and everyone in the party also gets the exp shared, even if they are cleave or impact, for example. Same happens for archery.

Note that for the above to work, the party member must have the weapon actually applied. If someone kills with slash, and this party member is using punching (no weapon), they will not get any exp.

Parameters:
opParty member.
skillSkill that was used to kill the monster.
Returns:
Skill ID to get experience in for op, NO_SKILL_READY otherwise.

Definition at line 202 of file party.c.

void party_update_who ( player pl)

Update player's hp/sp/etc in the party widget of all party members.

Parameters:
plPlayer.

Definition at line 426 of file party.c.

void remove_party ( party_struct party)

Remove a party.

Parameters:
partyThe party to remove.

Definition at line 389 of file party.c.

void remove_party_member ( party_struct party,
object op 
)

Remove player from party's member list.

Parameters:
partyParty to remove the player from.
opThe player to remove.

Definition at line 83 of file party.c.

void send_party_message ( party_struct party,
const char *  msg,
int  flag,
object op 
)

Send a message to party.

Parameters:
partyParty to send the message to.
msgMessage to send.
flagOne of party message flags.
opPlayer sending the message. If not NULL, this player will not receive the message.

Definition at line 364 of file party.c.


Variable Documentation

The party list.

Definition at line 49 of file party.c.

const char* const party_loot_modes[PARTY_LOOT_MAX]
Initial value:
{
    "normal", "leader", "random"
}

String representations of the party looting modes.

Definition at line 34 of file party.c.

const char* const party_loot_modes_help[PARTY_LOOT_MAX]
Initial value:
{
    "everyone is able to loot the corpse",
    "only the leader can loot the corpse",
    "loot is randomly split between party members when the corpse is opened"
}

Explanation of the party modes.

Definition at line 41 of file party.c.