[CODE]problem with a manual area spell.

From: Christian Ejlertsen (chr.ejlertsen@has.dk)
Date: 02/25/03


Hi

Working on a circle bpl17 modified.

I've run into a problem with a manual spell I created. It's intended as
an area spell and it's working wonderfully until one mob dies then the
spell breaks out of it's loop and exits after that death I can't see
where this should since all it does is call the damage function and then
continues on which is exactly the same as mag_damage does in the end
therefor I can't see why it should stop Executing the spell.

I hope someone has a thought on the matter.

PS: Other simple area spells are working just fine.

// Mailer Code funky line breaks included //

ASPELL(spell_prismatic_spray)
{
struct char_data *vict, *temp_ch;
int ray_color = 0, doubleup = 0, dam = 0, rounds = 0, dead_yesno = 0;

        act("$n hand issues a spray of prismatic colors.", FALSE, ch, 0,
0, TO_ROOM);
        act("Your hand issues a spray of prismatic colors.", FALSE, ch,
0, 0, TO_CHAR);

        for (vict = world[IN_ROOM(ch)].people; vict; vict = temp_ch) {
                temp_ch = vict->next_in_room;

                if (vict == ch)
                        continue;
                if (!IS_NPC(vict) && AFF_FLAGGED(vict, AFF_GROUP) &&
                   (vict->master == ch->master || vict->master == ch))
                        continue;
                if (AFF_FLAGGED(vict, AFF_CHARM) && vict->master ==
ch->master)
                        continue;

                ray_color = number(1, 8);

                if (ray_color == 8) {
                        doubleup = 2;
                        ray_color = number(1, 7);
                }
                else {
                        doubleup = 1;
                }

                for(rounds = 0; rounds < doubleup; rounds++) {
                        if (dead_yesno < 0)
                                continue;
                        switch(ray_color) {
                                case 1:
                                        act("You hit $N with a spray of
gleaming red.", FALSE, ch, 0, vict, TO_CHAR);
                                        act("$N is hit by $n's spray of
gleaming red.", FALSE, ch, 0, vict, TO_ROOM);
                                        act("You are hit by a ray of
gleaming red.", FALSE, ch, 0, vict, TO_VICT);
                                        mag_affects(GET_LEVEL(ch), ch,
vict, SPELL_WEAKEN, 0);
                                        dam = ((GET_LEVEL(ch)/5) * 4) +
10;
                                        dead_yesno = damage(ch, vict,
dam, SPELL_PRISMATIC_SPRAY);
                                        break;
                                case 2:
                                        act("You hit $N with a spray of
bright orange.", FALSE, ch, 0, vict, TO_CHAR);
                                        act("$N is hit by $n's spray of
bright orange.", FALSE, ch, 0, vict, TO_ROOM);
                                        act("You are hit by a ray of
bright orange.", FALSE, ch, 0, vict, TO_VICT);
                                        mag_affects(GET_LEVEL(ch), ch,
vict, SPELL_BLINDNESS, 0);
                                        dam = ((GET_LEVEL(ch)/5) * 6) +
20;
                                        dead_yesno = damage(ch, vict,
dam, SPELL_PRISMATIC_SPRAY);
                                        break;
                                case 3:
                                        act("You hit $N with a spray of
sparkling yellow.", FALSE, ch, 0, vict, TO_CHAR);
                                        act("$N is hit by $n's spray of
sparkling yellow.", FALSE, ch, 0, vict, TO_ROOM);
                                        act("You are hit by a ray of
sparkling yellow.", FALSE, ch, 0, vict, TO_VICT);
                                        dam = ((GET_LEVEL(ch)/4) * 8) +
30;
                                        dead_yesno = damage(ch, vict,
dam, SPELL_PRISMATIC_SPRAY);
                                        break;
                                case 4:
                                        act("You hit $N with a spray of
dark green.", FALSE, ch, 0, vict, TO_CHAR);
                                        act("$N is hit by $n's spray of
dark green.", FALSE, ch, 0, vict, TO_ROOM);
                                        act("You are hit by a ray of
dark green.", FALSE, ch, 0, vict, TO_VICT);
                                        mag_affects(GET_LEVEL(ch), ch,
vict, SPELL_POISON, 0);
                                        dam = ((GET_LEVEL(ch)/5) * 4) +
10;
                                        dead_yesno = damage(ch, vict,
dam, SPELL_PRISMATIC_SPRAY);
                                        break;
                                case 5:
                                        act("You hit $N with a spray of
amazing blue.", FALSE, ch, 0, vict, TO_CHAR);
                                        act("$N is hit by $n's spray of
amazing blue.", FALSE, ch, 0, vict, TO_ROOM);
                                        act("You are hit by a ray of
amazing blue.", FALSE, ch, 0, vict, TO_VICT);
                                        mag_affects(GET_LEVEL(ch), ch,
vict, SPELL_HOLD_MONSTER, 0);
                                        dam = ((GET_LEVEL(ch)/5) * 4) +
10;
                                        dead_yesno = damage(ch, vict,
dam, SPELL_PRISMATIC_SPRAY);
                                        break;
                                case 6:
                                        act("You hit $N with a spray of
gleaming indigo.", FALSE, ch, 0, vict, TO_CHAR);
                                        act("$N is hit by $n's spray of
gleaming indigo.", FALSE, ch, 0, vict, TO_ROOM);
                                        act("You are hit by a ray of
gleaming indigo.", FALSE, ch, 0, vict, TO_VICT);
                                        mag_affects(GET_LEVEL(ch), ch,
vict, SPELL_SILENCE, 0);
                                        dam = ((GET_LEVEL(ch)/5) * 4) +
10;
                                        dead_yesno = damage(ch, vict,
dam, SPELL_PRISMATIC_SPRAY);
                                        break;
                                case 7:
                                        act("You hit $N with a spray of
murky violet.", FALSE, ch, 0, vict, TO_CHAR);
                                        act("$N is hit by $n's spray of
murky violet.", FALSE, ch, 0, vict, TO_ROOM);
                                        act("You are hit by a ray of
murky violet.", FALSE, ch, 0, vict, TO_VICT);
                                        dam = ((GET_LEVEL(ch)/5) * 4) +
10;
                                        dead_yesno = damage(ch, vict,
dam, SPELL_PRISMATIC_SPRAY);
                                        break;
                                default:
                                        act("Contact an immortal.",
FALSE, ch, 0, vict, TO_CHAR);
                                        act("Contact an immortal.",
FALSE, ch, 0, vict, TO_ROOM);
                                        act("Contact an immortal.",
FALSE, ch, 0, vict, TO_VICT);
                                        break;
                        }
                        ray_color = number(1, 7);
                }
        }
}

--
   +---------------------------------------------------------------+
   | 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/26/03 PDT