User Tools

Site Tools


characters:party

Party Play

Characters in crossfire can form 'parties' which enables them to work towards common goals. Whilst in the same party, characters will share experience for the skills being used. Cautioned should be exercised in decided when and with whom to form a party with. Experience shared will go into the specific skill, otherwise it goes into general experience/score. Furthermore a large difference in level will impact the balance of experience shared.

Party Experience Calculation

FIXME, this should be explained in common language.

This is defined as

void share_exp(object *op, sint64 exp, const char *skill, int flag) {

  int shares = 0, count = 0;
  player *pl;
  partylist *party;
  if (op->type != PLAYER || op->contr->party == NULL) {
      change_exp(op, exp, skill, 0);
      return;
  }
  party = op->contr->party;
  for (pl = first_player; pl != NULL; pl = pl->next) {
      if (party && pl->ob->contr->party == party && on_same_map(pl->ob, op)) {
          count++;
          shares += (pl->ob->level+4);
      }
  }
  if (count == 1 || shares > exp)
      change_exp(op, exp, skill, flag);
  else {
      sint64 share = exp/shares, given = 0, nexp;
      for (pl = first_player; pl != NULL; pl = pl->next) {
          if (party && pl->ob->contr->party == party && on_same_map(pl->ob, op)) {
              nexp = (pl->ob->level+4)*share;
              change_exp(pl->ob, nexp, skill, SK_EXP_TOTAL);
              given += nexp;
          }
      }
      exp -= given;
      /* give any remainder to the player */
      change_exp(op, exp, skill, flag);
characters/party.txt · Last modified: 2013/11/07 02:31 (external edit)