/* This code took me about an hour to create. This spell has been seen on
* other MUDs, however, I'm not sure how they made it, or if they made it...
* All I know is there is no snippet... So I'm making one. And this one
* I hand coded. If you install this spell, then install my Immortal
* spellup command, then you can give players the TRUE sight spell as an imm.
* All I ask is that you put in the help file, and leave my comments. Trust me
* They're in there to give a little help finding the spell too.
*/
First,
in help.are:
Add this helpfile to the bottom:
+
+0 'TRUE SIGHT'~
+Syntax: cast 'true sight'
+
+This powerful detection spell allows a user to see all things at once,
+rather than trying to have to cast four spells to see magic, invis, etc.
+By doing this however, since all spells are cast at once, the spell costs
+a little more mana than the other detection spells do. This allows
+the user to see: Magic, Good, Evil, Hidden, Invis, and even in Darkness.
+-----------------------------------------------------------------------
+This spell, while seen in other MUDs was hand coded by Koqlb for
+Subversive Visions, 2014.
+~
+
above:
0 ~
#$
---------------------------------------------------------------------------------
Then, in magic.c above:
void spell_detect_evil (int sn, int level, CHAR_DATA * ch, void *vo,
and below:
spell_curse (gsn_curse, 3 * level / 4, ch, (void *) victim, TARGET_CHAR);
}
------------------------------------------------------------------------------------
+/* True sight added by Koqlb
+ * Can detect everything including dark vision.
+ * Leave infrared alone to allow sneak, wizinvis, and incognito.
+ */
+void spell_true_sight (int sn, int level, CHAR_DATA * ch, void *vo,
+ int target)
+{
+ CHAR_DATA *victim = (CHAR_DATA *) vo;
+ AFFECT_DATA af;
+
+ if (IS_AFFECTED (victim, AFF_TRUE_SIGHT))
+ {
+ if (victim == ch)
+ send_to_char ("Your eyes are already flared!\n\r", ch);
+ else
+ act ("$N can already see almost everything.", ch, NULL, victim,
+ TO_CHAR);
+ return;
+ }
+/* Get rid of other detection affects
+ * if affected by them already (i.e.- detect invis, etc.)
+ * to avoid duplicate affects.
+ */
+
+ af.where = TO_AFFECTS;
+ af.type = sn;
+ af.level = level;
+ af.duration = level;
+ af.modifier = 0;
+ af.location = APPLY_NONE;
+ af.where = TO_AFFECTS;
+ af.type = sn;
+ af.level = level;
+ af.duration = level;
+ af.modifier = 0;
+ af.location = APPLY_NONE;
+ af.bitvector = AFF_DETECT_MAGIC;
+ affect_to_char (victim, &af);
+ af.bitvector = AFF_DETECT_INVIS;
+ affect_to_char (victim, &af);
+ af.bitvector = AFF_DETECT_HIDDEN;
+ affect_to_char (victim, &af);
+ af.bitvector = AFF_DETECT_GOOD;
+ affect_to_char (victim, &af);
+ af.bitvector = AFF_DETECT_EVIL;
+ affect_to_char (victim, &af);
+ af.bitvector = AFF_DARK_VISION; /* Dark vision because Infrared doesn't cut it */
+ affect_to_char (victim, &af);
+ send_to_char ("Your eyes flare! You can see almost everything!\n\r", victim);
+ if (ch != victim)
+ send_to_char ("Ok.\n\r", ch);
+ return;
+}
+
------------------------------------------------------------------------------------
Also in magic.c in void spell_detect_evil, replace:
if (IS_AFFECTED (victim, AFF_DETECT_EVIL)) with
+ if (IS_AFFECTED (victim, AFF_DETECT_EVIL) || IS_AFFECTED (victim, AFF_TRUE_SIGHT))
In "void spell_detect_good, replace:
if (IS_AFFECTED (victim, AFF_DETECT_GOOD)) with
+ if (IS_AFFECTED (victim, AFF_DETECT_GOOD) || IS_AFFECTED (victim, AFF_TRUE_SIGHT))
In "void spell_detect_hidden" replace:
if (IS_AFFECTED (victim, AFF_DETECT_HIDDEN)) with
+ if (IS_AFFECTED (victim, AFF_DETECT_HIDDEN) || IS_AFFECTED (victim, AFF_TRUE_SIGHT))
In "void spell_detect_invis", replace:
if (IS_AFFECTED (victim, AFF_DETECT_INVIS)) with
+ if (IS_AFFECTED (victim, AFF_DETECT_INVIS) || IS_AFFECTED (victim, AFF_TRUE_SIGHT))
In "void spell_detect_magic", replace:
if (IS_AFFECTED (victim, AFF_DETECT_MAGIC)) with
+ if (IS_AFFECTED (victim, AFF_DETECT_MAGIC) || IS_AFFECTED (victim, AFF_TRUE_SIGHT))
In "void spell_infravision", replace:
if (IS_AFFECTED (victim, AFF_DARK_VISION)) with
+ if (IS_AFFECTED (victim, AFF_INFRARED) || IS_AFFECTED (victim, AFF_TRUE_SIGHT))
------------------------------------------------------------------------------------
In magic.h under
DECLARE_SPELL_FUN( spell_teleport );
add
+DECLARE_SPELL_FUN( spell_true_sight );
------------------------------------------------------------------------------------
If you have an unlimited bit system (like QuickMUD and others),
then in bitsys.c under
if (STR_IS_SET(vector, AFF_DARK_VISION) )
strcat( buf, " dark_vision" );
add:
+ if (STR_IS_SET(vector, AFF_TRUE_SIGHT) )
+ strcat( buf, " true_sight" );
Otherwise, don't even worry about this part.
------------------------------------------------------------------------------------
In const.c:
{
"detect evil", {11, 4, 12, 53}, {1, 1, 2, 2},
spell_detect_evil, TAR_CHAR_SELF, POS_STANDING,
NULL, SLOT (18), 5, 12,
"", "The red in your vision disappears.", ""},
+/* True sight all detects made by Koqlb */
+ {
+ "true sight", {20, 20, 20, 20}, {1, 1, 2, 2},
+ spell_true_sight, TAR_CHAR_SELF, POS_STANDING,
+ NULL, SLOT (37), 5, 18,
+ "", "You no longer see all things.", ""},
+
-----------------------------------------------------------------------------------
Also in const.c, in the detections, add "true sight" to the list of detect spells:
replace:
{
"detection", {4, 3, 6, -1},
{"detect evil", "detect good", "detect hidden", "detect invis",
"detect magic", "detect poison", "farsight", "identify",
"know alignment", "locate object"}
},
with
{
"detection", {4, 3, 6, -1},
{"detect evil", "detect good", "detect hidden", "detect invis",
"detect magic", "detect poison", "farsight", "identify",
"know alignment", "locate object", "true sight"}
},
(or just add the true sight at the end of them)
----------------------------------------------------------------------------------
In handler.c search for char *affect_bit_name (int vector). Under:
if ( vector == AFF_INVISIBLE )
strcat( buf, " invisible" );
add:
+ if ( vector == AFF_TRUE_SIGHT )
+ strcat( buf, "true sight" );
---------------------------------------------------------------------------------
In tables.c:
const struct flag_type affect_flags[] = {
{"blind", AFF_BLIND, TRUE},
{"invisible", AFF_INVISIBLE, TRUE},
{"detect_evil", AFF_DETECT_EVIL, TRUE},
{"detect_invis", AFF_DETECT_INVIS, TRUE},
{"detect_magic", AFF_DETECT_MAGIC, TRUE},
{"detect_hidden", AFF_DETECT_HIDDEN, TRUE},
{"detect_good", AFF_DETECT_GOOD, TRUE},
+ {"true_sight", AFF_TRUE_SIGHT, TRUE}, /* Koqlb */
{"sanctuary", AFF_SANCTUARY, TRUE},
-------------------------------------------------------------------------------
In merc.h
under:
#define AFF_SLOW (dd) /*-- (may vary depending on your MUD)*/
add:
#define AFF_TRUE_SIGHT (ff)
/* As stated above, my MUD has different tables due to the unlimited bits.
* I have numbers instead of alphanumeric characters. My define here is (31)
* not (ff), but yours may be different.
*/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LAST BUT NOT LEAST THE MOST CRUCIAL:
Look for MAX_SKILL. Increase that number by 1. do a clean make (remove all .o files,
then 'make', copyover or boot up. This should compile and work. I've tested it on my MUD as I couldn't find a frickin' snippet of this anywhere. Then, when I tested it with AFF_INFRARED
instead of AFF_DARK_VISION, and went to the dump, I still couldn't see... so I ganked
it and made it work right.
If you have any problems, feel free to post a message on mudbytes.net. Any feedback
is greatly appreciated.