[CODE] Some kind of strange occurence....

From: Christoffer Lundberg (avatar@ORION.BODEN.SE)
Date: 07/05/98


I have implemented a skill which enables you to make tattooes.
but when I use it, some kind of ugly symbols appear over the
message "You tattoo a tattoo on your right arm."

I tested the same thing with a normal Telnet client, but then,
the symbols appeared right after a Clear Screen.

Here's the code:

ACMD(do_tattoo)
{
  struct obj_data *tattoo;
  struct affected_type af;
  char color[30];
  char animal[30];
  int duration = 0, mana = 0, ac = 0;
  skip_spaces(&argument);

  if (!GET_SKILL(ch, SKILL_TATTOO)) {
    send_to_char("You have no idea how to make tattooes!\r\n", ch);
    return;
  }
  if (GET_EQ(ch, WEAR_TATTOO_1) && GET_EQ(ch, WEAR_TATTOO_2)) {
    send_to_char("You already have two tattooes.\r\n", ch);
    return;
  }
  if (!*argument) {
    send_to_char("Which tattoo?\r\n", ch);
    return;
  }
  if (GET_LEVEL(ch) < 41) {
    duration = 1;
    mana = 25;
    ac = 0;
    strcpy(color, "&Bblue&n");
  } else if (GET_LEVEL(ch) < 55) {
    duration = 2;
    mana = 30;
    ac = -1;
    strcpy(color, "&Ggreen&n");
  } else if (GET_LEVEL(ch) < 61) {
    duration = 3;
    mana = 35;
    ac = -2;
    strcpy(color, "&Rred&n");
  } else if (GET_LEVEL(ch) < 76) {
    duration = 4;
    mana = 40;
    ac = -3;
    strcpy(color,"&ybronzen&n");
  } else if (GET_LEVEL(ch) < 81) {
    duration = 5;
    mana = 45;
    ac = -4;
    strcpy(color, "&Wsilver&n");
  } else if (GET_LEVEL(ch) < 90) {
    duration = 7;
    mana = 50;
    ac = -5;
    strcpy(color, "&Ygolden&n");
  } else if (GET_LEVEL(ch) < 125) {
    duration = 10;
    mana = 60;
    ac = -7;
    strcpy(color, "&Kmith'ryal&n");
  }
  if (GET_MANA(ch) < mana) {
    send_to_char("Your Rage is too low.\r\n", ch);
    return;
  }
  if (strcmp(argument, "snake") == 0) {
    if (GET_LEVEL(ch) < 27) {
      send_to_char("You haven't learned how to make that tattoo.\r\n", ch);
      return;
    }
    strcpy(animal, "snake");
    duration += 1;

    af.type = SKILL_TATTOO;
    af.duration = duration - 1;
    af.location = APPLY_DEX;
    af.modifier = 1;
    af.bitvector = 0;
    affect_to_char(ch, &af);
  }
  GET_MANA(ch) -= mana;

  tattoo = create_obj();
  tattoo->item_number = NOTHING;
  tattoo->in_room = NOWHERE;
  tattoo->name = str_dup("tattoo");
  sprintf(buf2, "This is a tattoo - and they should not be on the ground. REPORT.");
    tattoo->description = str_dup(buf2);
  sprintf(buf2, "a tattoo depicting a %s %s", color, animal);
    tattoo->short_description = str_dup(buf2);
  GET_OBJ_TYPE(tattoo) = ITEM_AWEAPON;
  GET_OBJ_WEAR(tattoo) = ITEM_WEAR_TATTOO;
  GET_OBJ_EXTRA(tattoo) = ITEM_MAGIC;
  tattoo->affected[0].location = APPLY_AC;
  tattoo->affected[0].modifier = ac;

  obj_to_char(tattoo, ch);

  if (!GET_EQ(ch, WEAR_TATTOO_1)) {
    perform_wear(ch, tattoo, WEAR_TATTOO_1);
    act("You tattoo a tattoo on your right arm.", FALSE, ch, 0, 0, TO_CHAR);
    act("$n tattooes a tattoo on $s right arm.", FALSE, ch, 0, 0, TO_ROOM);
  } else {
    act("You tattoo a tattoo on your left arm.", FALSE, ch, 0, 0, TO_CHAR);
    act("$n tattooes a tattoo on $s left arm.", FALSE, ch, 0, 0, TO_ROOM);
    perform_wear(ch, tattoo, WEAR_TATTOO_2);
  }
}


I have the WEAR_TATTOO_x implemented, and they work fine. Something else
must be wrong here.

>Christoffer<

                #############################################
                #       You have recieved this E-mail       #
                #    from Avatar at avatar@orion.boden.se   #
                #       If you want you can write back      #
                # if you don't want to then get outta here  #
                #         (Ouch, me 'urt me 'ead)           #
                #############################################


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST