Welcome to the Builder Academy

Question Spell being repeated

More
24 Mar 2023 18:22 #10270 by soth
Spell being repeated was created by soth
Hello,
I recently came across spells such as poison, armor, bless being able to be cast repeatedly on a ch and the duration would keep incrementing.  I took a look at stock circle and it behaved the same.  Is this a design by default?  I was thinking if you cast armor on a ch, then tried to cast it again if the ch already was affected by armor it would do a msg stating they are already affected by your spell, or the very least reset the timer to default and not incrementing it again.

I could add a check in magic.c 
Code:
if (AFF_FLAGGED(victim, AFF_POISON)) {   send_to_char(ch, "They are already poisoned..."):   return; }

Is there a more efficient way of handling this or am I off track here?

Thanks!

Please Log in or Create an account to join the conversation.

More
25 Mar 2023 17:49 #10272 by thomas
Replied by thomas on topic Spell being repeated
It is a flag in magic.c. Just set accum_duration to false for the spell (the default):
Code:
case SPELL_BLESS: af[0].location = APPLY_HITROLL; af[0].modifier = 2; af[0].duration = 6; af[1].location = APPLY_SAVING_SPELL; af[1].modifier = -1; af[1].duration = 6; - accum_duration = TRUE; to_vict = "You feel righteous."; break;

Please Log in or Create an account to join the conversation.

More
25 Mar 2023 23:38 #10273 by soth
Replied by soth on topic Spell being repeated
Thomas,
Thanks. Even easier :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.217 seconds