Re: [Newbie] Sector Types..

From: RHS Linux User (carnage@GAMES2.MUDSRUS.COM)
Date: 11/07/98


Well as far as the sector flags having real meaning I found that sectors
FLIGHT and UNDERWATER in patch level 14 didn't.  So the below is what I
did to define them:>

Put this in ACT.MOVEMENT.C right below where the function has_boat is.
Oh ya you'll notice mine and the athe has_boat deal looks real similar,
heh thats cause I just copied them and modified it to apply:>
------------------------------------------------------------------------
/* simple function to determine if char can walk on air, by SMILLIE */
int has_airship(struct char_data *ch)
{
  struct obj_data *obj;
  int i;

  if (AFF_FLAGGED(ch, AFF_FLIGHT))
    return 1;

  /* non-wearable airships in inventory will do it */
  for (obj = ch->carrying; obj; obj = obj->next_content)
    if (GET_OBJ_TYPE(obj) == ITEM_AIRSHIP && (find_eq_pos(ch, obj, NULL) < 0))
      return 1;

  /* and any airship you're wearing will do it too */
  for (i = 0; i < NUM_WEARS; i++)
     if (HAS_BODY(ch, i) && GET_EQ(ch, i) && GET_OBJ_TYPE(GET_EQ(ch, i))
== ITEM_AIRSHIP)
      return 1;

  return 0;
}
/* simple function to determine if char can breath underwater, by SMILLIE
*/
int has_scuba(struct char_data *ch)
{
  struct obj_data *obj;
  int i;
/*
  if (ROOM_IDENTITY(ch->in_room) == DEAD_SEA)
    return 1;
*/
  if (AFF_FLAGGED(ch, AFF_SEABREATH))
    return 1;

  /* non-wearable scuba gear in inventory will do it */
  for (obj = ch->carrying; obj; obj = obj->next_content)
    if (GET_OBJ_TYPE(obj) == ITEM_SCUBA && (find_eq_pos(ch, obj, NULL) < 0))
      return 1;

  /* and any scuba gear you're wearing will do it too */
  for (i = 0; i < NUM_WEARS; i++)
     if (HAS_BODY(ch, i) && GET_EQ(ch, i) && GET_OBJ_TYPE(GET_EQ(ch, i))
== ITEM_SCUBA)
      return 1;

  return 0;
}

---------------------------------------------------------------------------
Herm notice the places where it says AFF_FLIGHT and AFF_SEABREATH.
Alright we gotta creat them, add the below lines.
---------------------------------------------------------------------------
Paste this in constants.c right underneath where it says water (no swim)

  "Underwater",
  "In Flight",

PAste this in structs.h right below AFF_CHARM.

#define AFF_FLIGHT            (1 << 22)    /* Char can fly   */
#define AFF_SEABREATH         (1 << 23)    /* Breath underwater */
---------------------------------------------------------------------------
Oh ya where it sasy 22 and 23 up those if you've added anything else in
this field.  Also if you use OLC than go into olc.h and up the number off
afffects by two, meaning if it was 22 make it 24 now.  Thats about it, oh
ya if you wanted to make this a castable spell than copy the way waterwalk
works and change AFF_WATERWALK to AFF_FLIGHT and so forth.  Hope this
helps ya out af far as sector meaning and pulling it off.  Laterz.
-Smillie, IMP
Maximum Carnage
carnage.mudsrus.com 6669


     +------------------------------------------------------------+
     | 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