Re: Fire Shield / Lightning Shield

From: David Cole (tiznor@hotmail.com)
Date: 12/07/01


> The problem arises back one or two steps back. I am assuming your spells
> causes damage to be inflicted back onto the attacker? The problem with
> what you have is you didnt loop it properly so when the attacker gets
> killed, the attacker is now out of the room. Hence, your act() calls
> will fail since ch does not exist (since vict is the person who has the
> fireshield or lightning shield).
>
> You should outline how you are calling the damage back to the attacker
> because this is the main problem.
> eg. If you cause damage back in the hit() call and lets say the attacker
> has multiple attacks;
>     attack1 - hits victim, causes damage back to attacker and attacker
> dies
>     attack2 - oh crap, the attacker doesnt exist, smack bang crash boom.
> eg2, damage call actually calls hit() again
>     attack1 - hits victim - ie hit(ch, victim, attack_type); calls
> hit(victim, ch, SPELL_FIRESHIELD) and kills ch;
>     BUT hit(victim, ch, SPELL_FIRESHIELD) returns back to hit(ch,
> victim, attack_type) but ch doesnt exist anymore and bang
>
> Hope this helps.

In all honesty, you confused me more... What I don't understand is how to
loop this sucker around to where it won't actually make the game go boom.
I've tryed move it into damage() and also try working with it in hit() both
go boom cause of the act not being able to find the person after they are
dead... if tryed adding the get_pos bit if they are mortally wounded of what
not to shut off the shield, but that just makes the whole thing not work all
together.. here's what I'm working with now:

    if (AFF_FLAGGED(victim, AFF_S_FIRE) && GET_POS(victim) != POS_MORTALLYW)
{
 act("&r$n is burned when $e hits $N.&n", FALSE, ch, NULL, victim,
TO_NOTVICT);
 act("&rYou are burned when you hit $N.&n", TRUE, ch, NULL, victim,
TO_CHAR);
 act("&r$n is burned when $e hits you.&n", FALSE, ch, NULL, victim,
TO_VICT);
    damage(victim, ch, 20, SPELL_SHIELD_OF_FIRE);
      }
    if (AFF_FLAGGED(victim, AFF_S_LIGHTNING) && GET_POS(victim) !=
POS_MORTALLYW) {
 act("&C$n is shocked when $e hits $N.&n", FALSE, ch, NULL, victim,
TO_NOTVICT);
 act("&CYou are shocked when you hit $N.&n", TRUE, ch, NULL, victim,
TO_CHAR);
 act("&C$n is shocked when $e hits you.&n", FALSE, ch, NULL, victim,
TO_VICT);
    damage(victim, ch, 20, SPELL_SHIELD_OF_LIGHTNING);
      }
    if (AFF_FLAGGED(victim, AFF_S_COLD) && GET_POS(victim) != POS_MORTALLYW)
{
 act("&W$n shivers when $e hits $N.&n", FALSE, ch, NULL, victim,
TO_NOTVICT);
 act("&WYou shiver when you hit $N.&n", TRUE, ch, NULL, victim, TO_CHAR);
 act("&W$n shivers when $e hits you.&n", FALSE, ch, NULL, victim, TO_VICT);
    damage(victim, ch, 20, SPELL_SHIELD_OF_LIGHTNING);
      }

Few more shield added cause of differnt classes etc... this is placed in
damage() right after the bit where it makes a player go vis or unhide if
they hit someone, so i guess what the big thing is here, is, can someone
enlighten me as to how i loop this around to work properly without the whole
mud coming crashing down time and time again?

Thanks,
Tiznor Tri'Talzia

The Azuryn Web
http://www.wynderlon.com/~azurynweb/
fleamuds.mine.nu:1616

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



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