[CODE] fly

From: Nate Winters (wintersn@HOTMAIL.COM)
Date: 04/04/00


I was surprised that I couldn't find a fly spell anywhere in the archives,
snippets, or patches. So I wrote my own and here it is. Thanks go to Alex
for running this list and correcting my first attempt at submitting this.
The whole positions idea for my first attempt was a failure. So now I just
made fly into an affection. Please respond if you see any errors or
improvements. This was made for bpl16.

---snip---
spells.h
/* PLAYER SPELLS -- Numbered from 1 to MAX_SPELLS */
#define SPELL_WATERWALK  51 /* Reserved Skill[] DO NOT CHANGE */
Add:90
#define SPELL_FLY                    52

structs.h
add:246
#define AFF_FLYING            (1 << 22)

constants.c
spell_wear_off_msg[]
"Your feet seem less buoyant.",  /* 51 */
Add:783
  "You slowly float to the ground.",


class.c
INIT_SPELL_LEVELS().
/*Mages*/
Add:2147 50 = the level of required to learn the spell...
  spell_level(SPELL_FLY, CLASS_MAGIC_USER, 50);

magic.c
MAG_DAMAGE()
Add:512
  case SPELL_FLY:
    af[0].duration = 1 + (GET_LEVEL(ch) / 10);
    af[0].bitvector = AFF_FLYING;
    accum_duration = TRUE;
    to_vict = "Your feet lift up off of the ground.";
    to_room = "$n starts to fly.";
   break;

Act.informative.c
Add:304
  if(AFF_FLAGGED(i, AFF_FLYING))
    strcat(buf, " (flying)");

Add in score: 779
  if (IS_AFFECTED(ch, AFF_FLYING))
    strcat(buf, "flying  ");

constants.c
/* AFF_x */
const char *affected_bits[] =
Add:222
  "FLY",

act.movement.c
Add:70 in has_boat
  if ((IS_AFFECTED(ch, AFF_WATERWALK)) || (GET_LEVEL(ch) >= LVL_IMMORT) ||
(IS_AFFECTED(ch, AFF_FLYING)))
     return 1;

  need_movement = (movement_loss[SECT(ch->in_room)] +
     movement_loss[SECT(EXIT(ch, dir)->to_room)]) / 2;
Add:126
  if (IS_AFFECTED(ch,AFF_FLYING))
    need_movement = 1;

Change:158
  if (!AFF_FLAGGED(ch, AFF_SNEAK)) {
    sprintf(buf2, "$n leaves %s.", dirs[dir]);
    act(buf2, TRUE, ch, 0, 0, TO_ROOM);
  }
To:
  if (AFF_FLAGGED(ch, AFF_FLYING)) {
    sprintf(buf2, "$n flies %s.", dirs[dir]);
    act(buf2, TRUE, ch, 0, 0, TO_ROOM);
  }
    else if (!AFF_FLAGGED(ch, AFF_SNEAK)) {
      sprintf(buf2, "$n leaves %s.", dirs[dir]);
      act(buf2, TRUE, ch, 0, 0, TO_ROOM);
    }

spell_parser.c
  spello(SPELL_WORD_OF_RECALL, "word of recall", 20, 10, 2, POS_FIGHTING,
 TAR_CHAR_ROOM, FALSE, MAG_MANUAL);
Add:918
  spello(SPELL_FLY, "fly", 40, 20, 2, POS_STANDING,
 TAR_CHAR_ROOM, FALSE, MAG_AFFECTS);

---snip---

That's it rather simple, but it works for what I wanted.

Rumble


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT