# cFellowship Class Reference

List of all members.

## Public Types

typedef std::map< DWORD, FellowMem > | MemberList

## Public Member Functions

DWORD | CreateFellowship (DWORD dwLeaderGUID, std::string name, char felName[50], bool shareXP, bool shareLoot)
void | Disband ()
void | ClearMembers ()
DWORD | GetID ()
DWORD | GetLeader ()
DWORD | GetSize ()
std::string | GetName ()
ULONG | GetCreationTime ()
bool | GetIsOpen ()
FellowMem * | FindMember (DWORD dwMemberGUID)
bool | SetLeader (DWORD dwNewLeaderGUID)
bool | SetOpenClose (DWORD dwIsOpen)
bool | AddMember (DWORD dwAvatarGUID)
bool | RemMember (DWORD dwMemberGUID)
bool | DismissMember (DWORD dwMemberGUID)
bool | MemberDeath (DWORD dwMemberGUID)
bool | InsertMember (DWORD dwMemberGUID)
bool | DeleteMember (DWORD dwMemberGUID, bool wasDismissed=false)
bool | UpdateMember (DWORD dwMemberGUID)
void | RelayMemberUpdate (DWORD dwMemberGUID)
void | RelayMemberDelete (DWORD dwMemberGUID)
void | RelayMemberDismiss (DWORD dwMemberGUID)
cMessage | JoinMessage (DWORD dwClGUID, DWORD dwClF7B0Sequence)
cMessage | DisbandMessage (DWORD dwClGUID, DWORD dwClF7B0Sequence)
cMessage | UpdMemberMessage (DWORD dwClGUID, DWORD dwClF7B0Sequence, DWORD dwMemberGUID)
cMessage | RemMemberMessage (DWORD dwClGUID, DWORD dwClF7B0Sequence, DWORD dwMemberGUID)
cMessage | DisMemberMessage (DWORD dwClGUID, DWORD dwClF7B0Sequence, DWORD dwMemberGUID)
void | DistributeXP (DWORD dwMemberGUID, cLocation memberLoc, DWORD dwExperience)
void | CalcShareXP ()
void | CalcProportionXP (int numFellows, int levelDiff, int minLevel)
void | CalcNonProportionXP (int numFellows)
float | CalcFellowFactor (int numFellows)
float | CalcDistanceFactor (cLocation earnMemLoc, cLocation recvMemLoc)

## Static Public Member Functions

static DWORD | NewFellowship (DWORD dwLeaderGUID, std::string name, char felName[50], bool shareXP, bool shareLoot)
static cFellowship * | GetFellowshipByID (DWORD dwFellowshipID)

## Public Attributes

MemberList | members

## Protected Attributes

DWORD | m_ID
std::string | m_Name
DWORD | m_LeaderGUID
int | m_Size
ULONG | m_CreationTime
bool | m_IsOpen
bool | m_ShareLoot
bool | m_ShareXP
bool | m_ProportionXP

## Friends

class | cAvatar
class | cMasterServer

## Member Function Documentation

bool cFellowship::AddMember | ( | DWORD | dwAvatarGUID | ) |

Handles the addition of a member of the fellowship.

Parameters:

  | dwMemberGUID | - The GUID for the member that is being added to the fellowship.

float cFellowship::CalcDistanceFactor | ( | cLocation | earnMemLoc,
|  | cLocation | recvMemLoc |
| ) |  |  |

Calculates the distance factor for a member of a fellowship.

This function is used to determine how a member's experience earnings are affected by his/her distance from the fellow that earned the experience.

earnMemLoc - The location of the fellow that earned the experience. recvMemLoc - The location of the fellow receiving apportioned experience.

Returns:
  float - Returns the distance factor.

float cFellowship::CalcFellowFactor | ( | int | numFellows | ) |

Calculates the fellow factor for a fellowship.

numFellows - The number of fellows in the fellowship.

Returns:
  float - Returns the fellowship factor.

void cFellowship::CalcNonProportionXP | ( | int | numFellows | ) |

Calculates the distribution of non-proportional experience among fellowship members.

numFellows - The number of fellows in the fellowship.

void cFellowship::CalcProportionXP | ( | int | numFellows,
|  | int | levelDiff,
|  | int | minLevel |
| ) |  |  |

Calculates the distribution of proportional experience among fellowship members.

numFellows - The number of fellows in the fellowship. levelDiff - The difference between the lowest and highest level members of the fellowship. minLevel - The lowest level of all members of the fellowship.

void cFellowship::CalcShareXP | ( |  | ) |

Calculates the proportion by which to distribute experience among fellowship members.

void cFellowship::ClearMembers | ( |  | ) |

Clears all members from the fellowship.

bool cFellowship::DeleteMember | ( | DWORD | dwMemberGUID,
|  | bool | wasDismissed = `false` |
| ) |  |  |

Removes an avatar from the fellowship member map.

The function is used when a player should be removed from a fellowship.

Parameters:

  | dwAvatarGUID | - The GUID for the avatar that should be removed.
  | wasDismissed | - Value to determine whether the member was dismissed (or else quit).

cMessage cFellowship::DisbandMessage | ( | DWORD | dwClGUID,
|  | DWORD | dwClF7B0Sequence |
| ) |  |  |

Handles the message sent for disbanding the fellowship.

dwClGUID - The client's GUID. clF7B0Sequence - The client's present F7B0 sequence value.

Returns:
  cMessage - Returns an 0x0000F7B0 server message.

cMessage cFellowship::DisMemberMessage | ( | DWORD | dwClGUID,
|  | DWORD | dwClF7B0Sequence,
|  | DWORD | dwMemberGUID |
| ) |  |  |

Handles the message sent for a player who has been dismissed from the fellowship.

dwClGUID - The client's GUID. clF7B0Sequence - The client's present F7B0 sequence value. clF7B0Sequence - The GUID for the player who been dismissed from the fellowship.

Returns:
  cMessage - Returns an 0x0000F7B0 server message.

bool cFellowship::DismissMember | ( | DWORD | dwMemberGUID | ) |

Handles the dismissal of a member from the fellowship.

Parameters:

  | dwMemberGUID | - The GUID for the member that was dismissed.

void cFellowship::DistributeXP | ( | DWORD | dwMemberGUID,
|  | cLocation | memberLoc,
|  | DWORD | dwExperience |
| ) |  |  |

Handles the distribution of experience among fellowship members.

This function only accounts for experience earned by fellowship members by hunting creatures.

dwMemberGUID - The GUID of the member who has earned the experience. memberLoc - The location of the member who has earned the experience. dwExperience - The amount of experience earned.

bool cFellowship::InsertMember | ( | DWORD | dwAvatarGUID | ) |

Inserts an avatar into the fellowship member map.

The function is used when a player should be inserted into a fellowship.

Parameters:

  | dwAvatarGUID | - The GUID for the avatar that should be inserted.

cMessage cFellowship::JoinMessage | ( | DWORD | dwClGUID,
|  | DWORD | dwClF7B0Sequence |
| ) |  |  |

Handles the message sent for joining the fellowship.

dwClGUID - The client's GUID. clF7B0Sequence - The client's present F7B0 sequence value.

Returns:
  cMessage - Returns an 0x0000F7B0 server message.

bool cFellowship::MemberDeath | ( | DWORD | dwMemberGUID | ) |

Handles the death of a member of the fellowship.

Parameters:

  | dwMemberGUID | - The GUID for the member that died.

void cFellowship::RelayMemberDelete | ( | DWORD | dwMemberGUID | ) |

Relays a member deletion to all members of the fellowship.

Parameters:

  | dwMemberGUID | - The GUID for the member who has left the fellowship.

void cFellowship::RelayMemberDismiss | ( | DWORD | dwMemberGUID | ) |

Relays a member dismissal to all members of the fellowship.

Parameters:

  | dwMemberGUID | - The GUID for the member who has been dismissed from the fellowship.

void cFellowship::RelayMemberUpdate | ( | DWORD | dwMemberGUID | ) |

Relays a member update to all members of the fellowship.

Parameters:

  | dwMemberGUID | - The GUID for the member whose information has been updated.

bool cFellowship::RemMember | ( | DWORD | dwMemberGUID | ) |

Handles the removal of a member of the fellowship.

Parameters:

  | dwMemberGUID | - The GUID for the member that quit the fellowship.

cMessage cFellowship::RemMemberMessage | ( | DWORD | dwClGUID,
|  | DWORD | dwClF7B0Sequence,
|  | DWORD | dwMemberGUID |
| ) |  |  |

Handles the message sent for a player who has left the fellowship.

dwClGUID - The client's GUID. clF7B0Sequence - The client's present F7B0 sequence value. clF7B0Sequence - The GUID for the player who left the fellowship.

Returns:
  cMessage - Returns an 0x0000F7B0 server message.

bool cFellowship::SetLeader | ( | DWORD | dwNewLeaderGUID | ) |

Handles the promotion of a member of the fellowship to leader.

Parameters:

  | dwNewLeaderGUID | - The GUID for the member that is being promoted to leader.

bool cFellowship::SetOpenClose | ( | DWORD | dwIsOpen | ) |

Handles the opening or closing of the fellowship.

Parameters:

  | dwIsOpen | - Value for whether the fellowship should be opened or closed

bool cFellowship::UpdateMember | ( | DWORD | dwMemberGUID | ) |

Updates the information for a member of the fellowship in the member map.

The function is used whenever the fellowship information should be updated for a fellowship member.

Parameters:

  | dwMemberGUID | - The GUID for the member whose information should be updated.

cMessage cFellowship::UpdMemberMessage | ( | DWORD | dwClGUID,
|  | DWORD | dwClF7B0Sequence,
|  | DWORD | dwMemberGUID |
| ) |  |  |

Handles the message sent for updating the fellowship member's information.

dwClGUID - The client's GUID. clF7B0Sequence - The client's present F7B0 sequence value. clF7B0Sequence - The GUID for the member whose information has been updated.

Returns:
  cMessage - Returns an 0x0000F7B0 server message.

The documentation for this class was generated from the following files:

- E:/uas2/Server/Fellowship.h
- E:/uas2/Server/Fellowship.cpp