Welcome to the Builder Academy

Question Remove curse bug

More
18 Dec 2016 21:36 #6413 by JTP
Remove curse bug was created by JTP
Casting remove curse on someone who is wearing a NO_DROP item, doesnt Work.

It only seems to Work when they cast it them self.


5000H 5000M 5000V > cast 'remove curse' lea
Okay.
Nothing seems to happen.


Tested on tbamud, also doesnt Work.

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

More
20 Dec 2016 19:11 #6429 by JTP
Replied by JTP on topic Remove curse bug
Any fix around ?

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

More
20 Dec 2016 22:02 #6433 by thomas
Replied by thomas on topic Remove curse bug

JTP wrote: Casting remove curse on someone who is wearing a NO_DROP item, doesnt Work.

It only seems to Work when they cast it them self.


5000H 5000M 5000V > cast 'remove curse' lea
Okay.
Nothing seems to happen.

The "Okay." and "Nothing seems to happen" is happening because the spell is targetting the character and not the object. A character can also be cursed, and if that happens, the remove curse spell removes that curse. Since there is no curse on the character, you get the message about nothing changing.

So, how to fix this? Well, as I see it, we need to alter the spell somewhat. Instead of being mag_alter_objs and mag_unaffect, it needs to be handled manually. Something like this (note, even thoguh there's a lot of code here, I haven't compiled it locally, so use with caution):
Code:
diff --git a/src/magic.c b/src/magic.c index bcfefec..4f0f0fb 100644 --- a/src/magic.c +++ b/src/magic.c @@ -847,10 +847,6 @@ void mag_unaffects(int level, struct char_data *ch, struct char_data *victim, to_vict = "A warm feeling runs through your body!"; to_room = "$n looks better."; break; - case SPELL_REMOVE_CURSE: - spell = SPELL_CURSE; - to_vict = "You don't feel so unlucky."; - break; default: log("SYSERR: unknown spellnum %d passed to mag_unaffects.", spellnum); return; @@ -907,14 +903,6 @@ void mag_alter_objs(int level, struct char_data *ch, struct obj_data *obj, to_char = "$p steams briefly."; } break; - case SPELL_REMOVE_CURSE: - if (OBJ_FLAGGED(obj, ITEM_NODROP)) { - REMOVE_BIT_AR(GET_OBJ_EXTRA(obj), ITEM_NODROP); - if (GET_OBJ_TYPE(obj) == ITEM_WEAPON) - GET_OBJ_VAL(obj, 2)++; - to_char = "$p briefly glows blue."; - } - break; case SPELL_REMOVE_POISON: if (((GET_OBJ_TYPE(obj) == ITEM_DRINKCON) || (GET_OBJ_TYPE(obj) == ITEM_FOUNTAIN) || diff --git a/src/spell_parser.c b/src/spell_parser.c index 695989a..7c307c4 100644 --- a/src/spell_parser.c +++ b/src/spell_parser.c @@ -277,6 +277,7 @@ int call_magic(struct char_data *caster, struct char_data *cvict, case SPELL_SUMMON: MANUAL_SPELL(spell_summon); break; case SPELL_WORD_OF_RECALL: MANUAL_SPELL(spell_recall); break; case SPELL_TELEPORT: MANUAL_SPELL(spell_teleport); break; + case SPELL_REMOVE_CURSE: MANUAL_SPELL(spell_remove_curse); break; } return (1); @@ -887,7 +888,7 @@ void mag_assign_spells(void) spello(SPELL_REMOVE_CURSE, "remove curse", 45, 25, 5, POS_STANDING, TAR_CHAR_ROOM | TAR_OBJ_INV | TAR_OBJ_EQUIP, FALSE, - MAG_UNAFFECTS | MAG_ALTER_OBJS, + MAG_MANUAL, NULL); spello(SPELL_REMOVE_POISON, "remove poison", 40, 8, 4, POS_STANDING, diff --git a/src/spells.c b/src/spells.c index 1861408..b3349a3 100644 --- a/src/spells.c +++ b/src/spells.c @@ -448,3 +448,34 @@ ASPELL(spell_detect_poison) } } } + +ASPELL(spell_remove_curse) { + int i; + + if (victim == NULL && obj == NULL) + return; + + if (victim) { + if (affected_by_spell(victim, SPELL_CURSE)) { + affect_from_char(victim, SPELL_CURSE); + act("$n doesn't feel so unlucky anymore.", TRUE, victim, 0, ch, TO_ROOM); + return; + } + obj = NULL; // check victims' worn items, store first cursed item in obj + for (i = 0; i < NUM_WEARS; i++) + if (GET_EQ(victim, i) && OBJ_FLAGGED(GET_EQ(victim, i), ITEM_NODROP)) { + obj = GET_EQ(victim, i); + break; + } + } + } + + if (obj && OBJ_FLAGGED(obj, ITEM_NODROP)) { + REMOVE_BIT_AR(GET_OBJ_EXTRA(obj), ITEM_NODROP); + if (GET_OBJ_TYPE(obj) == ITEM_WEAPON) + GET_OBJ_VAL(obj, 2)++; + act("$p briefly glows blue.", TRUE, ch, obj, 0, TO_ROOM); + return; + } + send_to_char(ch, "%s", CONFIG_NOEFFECT); +} diff --git a/src/spells.h b/src/spells.h index c88c554..5973825 100644 --- a/src/spells.h +++ b/src/spells.h @@ -226,6 +226,7 @@ ASPELL(spell_information); ASPELL(spell_identify); ASPELL(spell_enchant_weapon); ASPELL(spell_detect_poison); +ASPELL(spell_remove_curse); /* basic magic calling functions */

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

More
20 Dec 2016 22:57 - 20 Dec 2016 23:00 #6436 by Rumble
Replied by Rumble on topic Remove curse bug
I believe it was designed that way on purpose to give spellcasters an advantage. It annoyed me as well though so that is why remove curse scrolls can be purchased.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
Last edit: 20 Dec 2016 23:00 by Rumble.

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

More
20 Dec 2016 23:05 #6437 by JTP
Replied by JTP on topic Remove curse bug
Yea rem curse scrolls works like a charm.

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

Time to create page: 0.203 seconds