number() & gate spell.

From: David Cole (tiznor@hotmail.com)
Date: 02/21/02


Hello all,

I'm currently beating my head against a wall here, I've been attempting to
write a new gate spell based off of a previous gate spell post. I've managed
to completely rewrite the entire damn thing minus getting it working the way
I want it too. I've added arguments to casting and the way I'm trying to get
gate to work is,

c 'gate' eathreal/water/fire/astral/void/prime

seems pretty simple huh? Well guess again, what's happening is with no
argument it auto gates to EP (Eathreal Plane, 1, 500 vnum zone 0.), this is
correct, but when every you add your argument it gets kind of funky and
gates to places it is not sapose to gate to, sometime fire, sometimes water,
it just really depends on what the mud feels like I sapose.

in spell.creation.c: (MagCreations) (mag_creation for stock circle users)
room_rnum to_room;
Above is at the top of the function.

  case SPELL_GATE:
    z = 2;
 if (*argument == 'e') {
   to_room = number(1, 500);
 } else if (*argument == 'a') {
   to_room = number(601, 699);
 } else if (*argument == 'f') {
   to_room = number(1101, 1199);
 } else if (*argument == 'w') {
   to_room = number(1601, 1699);
 } else if (*argument == 'v') {
   to_room = number(2101, 2120);
    } else if (*argument == 'p') {
   to_room = number(1, 500);
 } else {
   to_room = number(1, 500);
 }
 break;

Then a little further down:

  if (!(tobj = read_object(z, VIRTUAL)) || !(tobj2 = read_object(z,
VIRTUAL))) {
    send_to_char("I seem to have goofed.\r\n", ch);
    log("SYSERR: spell_creations, spell %d, obj %d: obj not found",
     spellnum, z);
    return;
  }
  if (GET_OBJ_TYPE(tobj) == ITEM_PORTAL) {
 obj_to_room(tobj, IN_ROOM(ch));
 obj_to_room(tobj2, to_room);
    GET_OBJ_VAL(tobj, 0) = to_room;
    GET_OBJ_VAL(tobj2, 0) = IN_ROOM(ch);
    GET_OBJ_TIMER(tobj) = 3;
    GET_OBJ_TIMER(tobj2) = 3;
    act("There is a slight breeze as the dusts swirl around\r\nand condense
into $p.", TRUE, ch, tobj, 0, TO_ROOM);
    act("There is a slight breeze as the dusts swirl around\r\nand condense
into $p.", TRUE, ch, tobj, 0, TO_CHAR);
  } else {
    obj_to_room(tobj, IN_ROOM(ch));
    act("$n creates $p.", FALSE, ch, tobj, 0, TO_ROOM);
    act("You create $p.", FALSE, ch, tobj, 0, TO_CHAR);
    load_otrigger(tobj);
  }
}

that is basically the entire spell minus the additions for look in portal to
see the gated too room and the entering stuff. Also at times it will not
even find the gated too room and load the obj to nowhere, so if you do a
where portal it displays as:

a rainbow colored portal - in an unknown location

c 'gate' f equals and SYERR below:
Feb 21 22:29:08 :: SYSERR: Illegal value(s) passed to obj_to_room. (Room
#1147/812, obj 006C0030)

I find this rather odd, everything compiles great, no errors what's so ever.
Am I over looking a mundane detail or something? Any help would be greatly
appreciated.

Thanks,
Dave

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT